akhauriyash/Code-Regression huggingface dataset:
#include "bits/stdc++.h"
using namespace std;

#define REP(i, n) for(ll i = 0;i < n;i++)
#define REP1(i, n) for(ll i = 1;i < n;i++)
#define REPR(i, n) for(ll i = n-1;i >= 0;i--)
#define FOR(i, m, n) for(ll i = m;i < n;i++)

#define VSORT(v) sort(v.begin(), v.end())
#define VRSORT(v) sort(v.rbegin(), v.rend())

#define ll long long
#define ALL(a)  (a).begin(),(a).end()

#define pb(a) push_back(a)

ll r,d,x;


int main(){
  int ans=0;
  cin >> r >> d>>x;
  REP(i,10){
    x=r*x-d;
    cout<<(x)<<endl;
  }
  return 0;
}

Measured memory_bytes: 256
import numpy as np

n, d = map(int, input().split())
x = []
for i in range(n):
    x.append(list(map(int, input().split())))

num = 0
for i in range(n):
    for j in range(i+1, n):
        xi = x[i]
        xj = x[j]
        dist = 0
        for k in range(d):
            dist += (xi[k] - xj[k])**2
        if np.sqrt(dist).is_integer():
            num += 1

print(num)

Measured memory_bytes: 21404
n = int(input())
apple = list(map(int, input().split()))
orange = list(map(int, input().split()))
count = 0

for i in range(n):
    if orange[i] >= apple[i]:
        a = orange[i] - apple[i]
        count += apple[i]
        if apple[i+1] >= a and a != 0:
            b = apple[i + 1] - a
            apple[i+1] = b
            count += a
        elif apple[i + 1] < a and a != 0:
            count += apple[i + 1]
            apple[i + 1] = 0
        else:
            pass
    else:
        count += orange[i]
        apple[i] = 0
print(count)

Measured memory_bytes: 82020
#include <bits/stdc++.h>
using namespace std;
/*#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
template<typename T> using gpp_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
template<typename T, typename L> using gpp_map = tree<T, L, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
template<typename T> using gpp_multiset = tree<T, null_type, less_equal<T>, rb_tree_tag, tree_order_statistics_node_update>;*/
struct fast_ios { fast_ios(){ cin.tie(0); ios::sync_with_stdio(false); cout << fixed << setprecision(20); }; } fast_ios_;
#define FOR(i, begin, end) for(int i=(begin);i<(end);i++)
#define REP(i, n) FOR(i,0,n)
#define IFOR(i, begin, end) for(int i=(end)-1;i>=(begin);i--)
#define IREP(i, n) IFOR(i,0,n)
#define Sort(v) sort(v.begin(), v.end())
#define Reverse(v) reverse(v.begin(), v.end())
#define all(v) v.begin(),v.end()
#define SZ(v) ((int)v.size())
#define Lower_bound(v, x) distance(v.begin(), lower_bound(v.begin(), v.end(), x))
#define Upper_bound(v, x) distance(v.begin(), upper_bound(v.begin(), v.end(), x))
#define Max(a, b) a = max(a, b)
#define Min(a, b) a = min(a, b)
#define bit(n) (1LL<<(n))
#define bit_exist(x, n) ((x >> n) & 1)
#define debug(x) cout << #x << "=" << x << endl;
#define vdebug(v) { cout << #v << "=" << endl; REP(i_debug, v.size()){ cout << v[i_debug] << ","; } cout << endl; }
#define mdebug(m) { cout << #m << "=" << endl; REP(i_debug, m.size()){ REP(j_debug, m[i_debug].size()){ cout << m[i_debug][j_debug] << ","; } cout << endl;} }
#define Return(ans) { cout << (ans) << endl; return 0; }
#define pb push_back
#define f first
#define s second
#define int long long
#define INF 1000000000000000000
template<typename T> istream &operator>>(istream &is, vector<T> &v){ for (auto &x : v) is >> x; return is; }
template<typename T> ostream &operator<<(ostream &os, vector<T> &v){ for(int i = 0; i < v.size(); i++) { cout << v[i]; if(i != v.size() - 1) cout << endl; }; return os; }
template<typename T1, typename T2> ostream &operator<<(ostream &os, pair<T1, T2> p){ cout << '(' << p.first << ',' << p.second << ')'; return os; }
template<typename T> void Out(T x) { cout << x << endl; }
template<typename T1, typename T2> void Ans(bool f, T1 y, T2 n) { if(f) Out(y); else Out(n); }
 
using vec = vector<int>;
using mat = vector<vec>;
using Pii = pair<int, int>;
using PiP = pair<int, Pii>;
using PPi = pair<Pii, int>;
using bools = vector<bool>;
using pairs = vector<Pii>;
 
//int dx[4] = {1,0,-1,0};
//int dy[4] = {0,1,0,-1};
//char d[4] = {'D','R','U','L'};
 
const int mod = 1000000007;
//const int mod = 998244353;
//#define Add(x, y) x = (x + (y)) % mod
//#define Mult(x, y) x = (x * (y)) % mod


#include <bits/stdc++.h>
using namespace std;
signed main(){
    int N,L; cin>>N>>L;
    vector<string> S(N);
    REP(i,N) cin>>S[i];
    Sort(S);
    string ans = "";
    REP(i,N) ans += S[i];
    Out(ans);
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#define vll vector<ll>
#define vi vector<int>
#define vpll vector<pair<ll,ll>>
#define pii pair<int,int>
#define REP(i,a) for(int (i)=0; (i)<(a); (i)++)
#define RREP(i,a) for(int (i)=a-1; (i)>=(0); (i)--)
#define REP2(i,a,b) for(int (i)=(a); (i)<(b); (i)++)
#define MOD 1000000007
#define ALL(v) v.begin(), v.end()
#define m0(x) memset(x,0,sizeof(x))
typedef long long ll;

using namespace std;

int main(){
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  string S;
  cin >> S;
  int sz = S.size();
  if(sz%2 != 0){cout << "No"; return 0;}
  else{
    REP(i,S.size()){
      if(i %2 == 0 && (S[i] - 'h') != 0){cout << "No"; return 0;}
      if(i %2 == 1 && (S[i] - 'i') != 0){cout << "No"; return 0;}
    }
  }
  cout << "Yes";

  return 0;
}


Measured memory_bytes: 256
#include<stdio.h>
int main(){
	int a,b;
	scanf("%d %d",&a,&b);
	if(a==b){
	printf("a == b\n");
	}
	else{
		if(a<b){
			printf("a < b\n");
		}
		else{
			printf("a > b\n");
		}
	}
	return 0;
}

Measured memory_bytes: 2564
import java.util.Scanner;

class Main {
  public static void main(String args[]){
    long A = 0;
    int B = 0;
    int K = 0;
    Scanner scan = new Scanner(System.in);
    A = scan.nextInt();
    B = scan.nextInt();
    K = scan.nextInt();
    scan.close();
    if((B - A)/2.0 >= K){
    for(int i = 0;i < K; i++){
      System.out.println(A + i);
    }
    for(int i = 0;i < K; i++){
      System.out.println(B - K + i +1);
    }
  }
  else{
    for(int i = 0; i < B - A + 1; i++){
      System.out.println(A + i);
    }
  }
  }
}



Measured memory_bytes: 23764
#include <bits/stdc++.h>

using namespace std;

#define REP(i, n)   for(int i = 0; i < (n); i++)
#define REPS(i, n)  for(int i = 1; i <= (n); i++)
#define RREP(i, n)  for(int i = (n)-1; i >= 0; i--)
#define RREPS(i, n) for(int i = (n); i > 0; i--)
#define ALL(v) v.begin(), v.end()
#define RALL(v) v.rbegin(), v.rend()
#define UNIQUE(v) v.erase(unique(v.begin(), v.end()), v.end())
#define mp make_pair
#define mt make_tuple
#define pb push_back

using ll  = long long;
using pi  = pair<int, int>;
using pl  = pair<ll, ll>;
using vi  = vector<int>;
using vl  = vector<ll>;
using vs  = vector<string>;
using vb  = vector<bool>;
using vvi = vector<vi>;
using vvl = vector<vl>;

const int MOD = 1e9 + 7;
const int INF = 1e9 + 7;
const ll  INFL = 1e18;
const double PI = 3.141592653589793;
const double EPS = 1e-9;

template<class T> bool chmax(T &a, const T &b) { if(a < b) { a = b; return true; } return false; }
template<class T> bool chmin(T &a, const T &b) { if(a > b) { a = b; return true; } return false; }

signed main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(20);

    int A, B;
    char op;
    cin >> A >> op >> B;
    if(op == '+') cout << A+B << endl;
    else cout << A-B << endl;
}

Measured memory_bytes: 3592
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <stack>
#include <queue>
#include <set>
#include <cmath>
#include <map>
using namespace std;
#define MOD 1000000007
#define ADD(X,Y) ((X) = ((X) + (Y)%MOD) % MOD)
typedef long long i64; typedef vector<int> ivec; typedef vector<string> svec;

int N,L;
string S[100];

int main()
{
  scanf("%d %d", &N, &L);
  for (int i = 0; i < N; ++i) cin >> S[i];
  sort(S,S+N);
  for (int i = 0; i < N; ++i) cout << S[i];
  return 0;
}


Measured memory_bytes: 764
#include <iostream>
#include<string>
#include<cmath>
#include<algorithm>
#include<cctype>
#include<queue>
#include<deque>
#include<regex>
#include<stack>
#include<stdio.h>
#include<vector>
#include<set>
#include<map>
#include<iomanip>
using namespace std;
#define rep(i,n) for(int i=0;i<n;i++)
typedef int long long ll;

int main(){

ll l;
cin>>l;
ll r=0;
//    for (r=1;r<=19;++r) {
//        if (l < pow(2,r)) {
//            break;
//        }
//    }
for(int i=1;i<20;i++){
    if (l < pow(2,i)) {
    break;
    }else{
        r=i;
    }
}
//r--;
vector<vector<ll>> ans;
for(ll i=1;i<=r;i++){
    ans.push_back({i,i+1,0});
    ans.push_back({i,i+1,static_cast<ll>(pow(2,i-1))});

}

for(ll i=r;i>=1;i--){
    if(l-pow(2,i-1)>=pow(2,r)){
    ans.push_back({i,r+1,l-static_cast<ll>(pow(2,i-1))});
    l-=pow(2,i-1);
}

}
    cout<<r+1<<' '<<ans.size()<<endl;
for(auto ea:ans){
    cout<<ea[0]<<' '<<ea[1]<<' '<<ea[2]<<endl;
}



}

Measured memory_bytes: 256
#include <stdio.h>
long A[500000];
long M[500000];
int main()
{
	long N;
	scanf("%d", &N);
	for (long i = 1;i <= N;i++)
	{
		scanf("%d", &A[i]);
	}
	long j;
	int flag = 1;
	for (int i = 1;i <= N;i++)
	{
		M[1] = M[1] + A[i] * flag;
		flag = flag * -1;
	}
	for (j=1;j < N;j++)
	{
		M[j + 1] = (A[j] - M[j] / 2) * 2;
	}
	for (long i = 1;i < N;i++)
		printf("%d ", M[i]);
	printf("%d", M[N]);
	return 0;
}

Measured memory_bytes: 6144
num_s = gets.chomp.to_i
array_s = gets.chomp.split.map(&:to_i)
num_t = gets.chomp.to_i
array_t = gets.chomp.split.map(&:to_i)

count = 0
array_t.each do |item_t|
  a = array_s.bsearch {|x| x >= item_t}
  count += 1 if a == item_t
end
puts count

Measured memory_bytes: 16404
#include <bits/stdc++.h>
using namespace std;
int main(){
  string s; long long k; cin >> s >> k;
  for (int i = 0; i < (int) s.size(); i++) {
    if (s[i] == '1') {
      k--;
      if (k == 0) {
        cout << s[i] << endl;
        return 0;
      }
    } else {
      cout << s[i] << endl;
      return 0;
    }
  }
  return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef string str;
#define rep(i, n) for(int i=0; i<n; ++i)
#define REP(i, n) for(int i=1; i<=n; ++i)
#define all(obj) (obj).begin(), (obj).end()
using P = pair<int, int>;
const int inf = 1e9;
const ll INF = 1e18;
const ll MOD = 1e9+7;
const ll MAX = 1e9+7;
template<typename T> T factorial(T n){
    if(n==1) return 1;
    else return n*factorial(n-1)%MOD;
}
template<typename T> T Pow(T x, T n, T m){
    if(n == 0) return 1;
    if(n % 2 == 0) return Pow(x * x % m, n / 2, m);
    else return x * Pow(x, n - 1, m) % m;
}
template<typename T> T combination(T n, T k, T m){
    return factorial<T>(n) * Pow<T>(factorial(k), m-2, m) % m * Pow<T>(factorial(n-k), m-2, m) % m;
}
struct edge{
    int to; // 辺の行き先
    int weight; // 辺の重み
    edge(int t, int w) : to(t), weight(w) { }
};
using graph = vector<vector<edge>>;
using Graph = vector<vector<int>>;

int main(){
    ll k; cin >> k;
    deque<ll> dq;
    priority_queue<ll, vector<ll>, greater<ll>> pq;
    REP(i, 9){
        dq.push_back(i);
    }
    ll tmp;
    if(k > 10){
        rep(i, k-10){
            tmp = dq.front();
            if(tmp % 10 != 0) dq.push_back(tmp * 10 + tmp % 10 - 1);
            dq.push_back(tmp * 10 + tmp % 10);
            if(tmp % 10 != 9) dq.push_back(tmp * 10 + tmp % 10 + 1);
            pq.push(tmp);
            dq.pop_front();
        }
    }
    while(!dq.empty()){
        tmp = dq.front();
        pq.push(tmp);
        dq.pop_front();
    }
    rep(i, k-1) pq.pop();
    cout << pq.top() << endl;
    return 0;
}

Measured memory_bytes: 7792
{
  const main = (
    input: string
  ): void | string | number | string[] | number[] => {
    const r = _reader(input)
    const s = r.s()
    const a = s.split('').map(Number)

    for (let i = 0; i < 2 ** 3; i++) {
      const d0 = getBit(i, 0)
      const d1 = getBit(i, 1)
      const d2 = getBit(i, 2)

      const k =
        a[0] +
        (d0 ? 1 : -1) * a[1] +
        (d1 ? 1 : -1) * a[2] +
        (d2 ? 1 : -1) * a[3]

      if (k === 7) {
        return (
          s[0] +
          (d0 ? '+' : '-') +
          s[1] +
          (d1 ? '+' : '-') +
          s[2] +
          (d2 ? '+' : '-') +
          s[3] +
          '=7'
        )
      }
    }

    return
  }

  const getBit = (n, i) => (n >> i) & 1

  const _reader = (str: string, i = 0) => {
    const lines = str.trim().split('\n')
    const s = () => lines[i++] || ''
    const n = () => Number(s())

    const mn = (v: string[]) => v.map(Number)
    const sp = (v: string) => v.split(' ')
    const ss = () => sp(s())
    const nn = () => mn(ss())
    const nls = () => mn(lines.slice(i))
    const nnls = () => lines.slice(i).map(v => mn(sp(v)))

    return { lines, s, n, ss, nn, nls, nnls }
  }

  const _getInput = () => require('fs').readFileSync('/dev/stdin', 'utf8')
  const _res = main(_getInput())

  if (typeof _res === 'number' || typeof _res === 'string') console.log(_res)
  if (typeof _res === 'object') console.log(_res.join(' '))
}


Measured memory_bytes: 7372
#include <iostream>
#include <vector>
#include <algorithm>
#include <map>
using namespace std;
int main(){
    int n,m;
    cin>>n>>m;
    vector<pair<int, int>> p(m);
    for (int i=0; i<m; i++) {
        cin>>p[i].second>>p[i].first;
    }
    sort(p.begin(), p.end());
    
    int pos=0;
    int cnt=0;
    for (int i=0; i<m; i++) {
        if (p[i].second<=pos&&pos<p[i].first) {
            continue;
        }else{
            cnt++;
            pos=p[i].first-1;
        }
    }
    cout<<cnt<<endl;
    return 0;
}

Measured memory_bytes: 1024
#include <iostream>
using namespace std;
int main()
{
    int W,H,x,y,r;
    cin >> W >> H >> x >> y >> r;
    if((x-r) < 0 || (y-r) < 0 || (x+r) > W || (y+r) > H){
        cout << "No" <<endl;
    } else {
        cout << "Yes" << endl;
    }
    return 0;
}


Measured memory_bytes: 3088
#include <iostream>

using namespace std;

int main() {
    int n; cin >> n;
    string a,b; cin >> a; cin.ignore();
    cin >> b; cin.ignore();
    
    int res=0;
    for(int i=0; i<n; i++){
        int temp=0;
        for(int j=0; j<i+1; j++){
            if(a[n-1+j-i] == b[j]){
                temp++;
            }else{
                break;
            }

        }
        res = max(res,temp);
      
    }
    cout << 2*n-res << endl;
    
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;

const int MOD = (int)1e9+7;

void dfs(vector<vector<bool>> &ab,vector<bool> &visited,int V){
  visited.at(V)=true;
  for(int i=0;i<ab.size();i++){
    if(visited.at(i)==true) continue;
    if(ab.at(V).at(i)==true)  dfs(ab,visited,i);
  }
}

int main(){
  int N,M;
  cin >> N >> M;
  vector<int> a(M);
  vector<int> b(M);
  vector<vector<bool>> ab(N,vector<bool>(N,false));
  for(int i=0;i<M;i++){
    cin >> a.at(i) >> b.at(i);
    a.at(i)--;
    b.at(i)--;
    ab.at(a.at(i)).at(b.at(i))=ab.at(b.at(i)).at(a.at(i))=true;
  }

  int ans=0;
  for(int i=0;i<M;i++){
    ab.at(a.at(i)).at(b.at(i))=ab.at(b.at(i)).at(a.at(i))=false;
    vector<bool> visited(N,false);
    dfs(ab,visited,0);
    bool flag=true;
    for(int i=0;i<N;i++){
      if(!visited.at(i))  flag=false;
    }
    if(!flag)  ans++;
    ab.at(a.at(i)).at(b.at(i))=ab.at(b.at(i)).at(a.at(i))=true;
  }
  cout << ans << endl;

  return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;


int main(){
    int n,k;
    cin>>k>>n;

    int arr[2*n];


    for(int i=0;i<n;i++){
        cin>>arr[i];
        arr[n+i]=k+arr[i];
    }

    int ans=1e7;

    for(int i=0;i<n;i++){
          int z=i+n-1;

          ans=min(ans,arr[z]-arr[i]);

    }

    cout<<ans<<endl;



}


Measured memory_bytes: 1792
#include <iostream>
#include <cmath>
using namespace std;
int main() {
    long long N;
    cin >> N;
    long long n = (long long)sqrt(N);
    for(int i = n; i >= 1; i--){
        if(N % i == 0){
            long long j = N / i;
            cout << i + j - 2 << endl;
            return 0;
        }
    }
    return 0;

}

Measured memory_bytes: 256
import java.io.BufferedReader
import java.util.*
import kotlin.system.exitProcess

fun main() = abc135d()

@OptIn(ExperimentalStdlibApi::class)
fun abc135d() = SimpleFastIOWithToken_abc135d().exec {
    val s = readString()
    val mod = 1_000_000_007L
    val n = s.length

    // [seen i+1][rem] = patterns
    val dp = Array(n + 1) { LongArray(13) }.apply { this[0][0] = 1 }

    fun transition(i: Int, num: Int, beforeRem: Int) {
        dp[i + 1][(beforeRem * 10 + num) % 13] += dp[i][beforeRem]
        dp[i + 1][(beforeRem * 10 + num) % 13] %= mod
    }

    for ((i, c) in s.withIndex()) for (beforeRem in 0..12) {
        if (c == '?') {
            for (num in 0..9) transition(i, num, beforeRem)
        } else {
            val num = Character.getNumericValue(c)
            transition(i, num, beforeRem)
        }
    }

    val answer = dp[n][5]

    println(answer)
}

// region kokokara template dayo (^o^)
@Suppress("unused", "HasPlatformType", "MemberVisibilityCanBePrivate", "ClassName")
private class SimpleFastIOWithToken_abc135d(private val separator: String = System.lineSeparator()) {
    private val br: BufferedReader = System.`in`.bufferedReader()
    private var st: StringTokenizer = StringTokenizer("")
    private val sb: StringBuilder = StringBuilder()
    private fun prepareNext() = run { if (!st.hasMoreTokens()) st = StringTokenizer(br.readLine()) }

    fun readString(): String = run { prepareNext() }.run { st.nextToken() }
    fun readInt(): Int = Integer.valueOf(readString())
    fun readLong(): Long = java.lang.Long.valueOf(readString())

    fun println(): Unit = run { sb.append(separator) }
    fun print(any: Any): Unit = run { sb.append(any) }
    fun println(any: Any): Unit = run { sb.append(any.toString() + separator) }

    fun exec(action: SimpleFastIOWithToken_abc135d.() -> Unit) = run {
        Thread(null, { action() }, "(^o^)", 128 * 1024 * 1024)
            .apply { setUncaughtExceptionHandler { _, e -> e.printStackTrace(); exitProcess(1) } }
            .apply { start() }.join()
    }.run { kotlin.io.print(sb) }

    fun readLine(): Nothing = error("readLine is disabled.")
}
// endregion kokomade template dayo (^o^)


Measured memory_bytes: 48952
#include<iostream>
#include<algorithm>
#include<vector>
#include<map>
#include<string>

using namespace std;

int main(void) {
	long long int D, N;
	cin >> D >> N;
	long long int ans = N;
	if (N == 100) ans++;
	for (int i = 0; i < D; i++) ans *= 100;
	cout << ans << endl;
	system("pause");
	return 0;
}

Measured memory_bytes: 504
#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
using namespace std;

#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n) FOR(i,0,n)

int A[300000];

int main() {
  ios::sync_with_stdio(false);

  int N;
  string S;
  cin >> N >> S;

  long long ans = 0;

  REP(bits, 1 << N) {
    vector<char> bs, rs;
    REP(i, N) {
      if (((1 << i) & bits) == 0) {
        rs.push_back(S[i]);
      } else {
        bs.push_back(S[i]);
      }
    }
    reverse(rs.begin(), rs.end());
    reverse(bs.begin(), bs.end());

    int lenr = rs.size(), lenb = bs.size();

    long long dp[lenr+1][lenb+1];
    REP(i, lenr + 1) {
      REP(j, lenb + 1) {
        dp[i][j] = 0;
      }
    }

    dp[0][0] = 1;
    REP(i, lenr + 1) {
      REP(j, lenb + 1) {
        if (i < lenr && rs[i] == S[N+i+j]) {
            dp[i+1][j] += dp[i][j];
        }
        if (j < lenb && bs[j] == S[N+i+j]) {
            dp[i][j+1] += dp[i][j];          
        }
      }
    }    
    ans += dp[lenr][lenb];
  }

  cout << ans << endl;
}


Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <vector>
#include <cmath>

using namespace std;


int main() {

    int A, B, C, X;

    cin >> A >> B >> C >> X;

    int count = 0;

    for (int a = 0; a <= A; a++) {
        for (int b = 0; b <= B; b++) {
            for (int c = 0; c <= C; c++) {
                if ((a * 500 + b * 100 + c * 50) == X) {
                    count += 1;
                }
            }
        }
    }

    cout << count << "\n";

    return 0;
}

Measured memory_bytes: 256
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <stack>
#include <queue>
#include <set>
#include <map>
using namespace std;
typedef long long int LL;
typedef vector<int> ivec;
typedef vector<string> svec;

//int a[100010];
int main(){
	string str;
	cin>>str;
	if(str.find("7")!=string::npos)cout<<"Yes"<<endl;
	else cout<<"No"<<endl;
} 


Measured memory_bytes: 3564
#include<iostream>
#include<cmath>
#include<algorithm>
#include<string>
#include<vector>
#include<stack>
#include<queue>
#include<set>
#include<map>
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
typedef pair<int,P> P1;
typedef pair<P,P> P2;
#define pu push
#define pb push_back
#define mp make_pair
#define eps 1e-7
#define INF 1000000000
#define fi first
#define sc second
#define rep(i,x) for(int i=0;i<x;i++)
#define repn(i,x) for(int i=1;i<=x;i++)
#define SORT(x) sort(x.begin(),x.end())
#define ERASE(x) x.erase(unique(x.begin(),x.end()),x.end())
#define POSL(x,v) (lower_bound(x.begin(),x.end(),v)-x.begin())
#define POSU(x,v) (upper_bound(x.begin(),x.end(),v)-x.begin())

const int MAX = 510000;
const int MOD = 1000000007;

int main(){
  double ans = 0.0;
  ll N; cin>>N;

  ans = N * 2 * 3.141592;

  cout<<ans<<endl;


}


Measured memory_bytes: 3788
function Main(input) {
	var inputdata = input.split(/\n/);
	var N = inputdata[0];
	var ip = inputdata[1].split(/\s/);
	ip.sort(compareFunc);
	var value = parseInt(ip[0]);
	for(var i=1;i<N;i++){
	    value = (parseFloat(value)+parseInt(ip[i]))/2;
	}
	console.log(value);
}
 
function compareFunc(a, b) {
    return parseInt(a) - parseInt(b);
}
     
//*この行以降は編集しないでください（標準入出力から一度に読み込み、Mainを呼び出します）
Main(require("fs").readFileSync("/dev/stdin", "utf8"));

Measured memory_bytes: 7756
#include<bits/stdc++.h>
using namespace std;
	
#define ll long long int
#define pb push_back
#define rep(i , j , n) for(ll i = j ; i < n ; i++)
#define per(i , j , n) for(ll i = j ; i >= n ; i--)

int main(){
	ll a,b,n;
	cin >> a >> b >> n;
	if(n > b - 1) cout << ((a * (b - 1))/b) - (a*((b - 1)/b));
	else cout << ((a * (n))/b) - (a*((n)/b));
} 


Measured memory_bytes: 3620
n = input()
precise = 0
over = 1
for d in n:
    d = int(d)
    new_over = min(precise + d + 1, over + d + 2, over + 9 - d)
    precise = min(over + d + 1, precise + d)
    over = new_over
over += 1
print(min(precise, over))


Measured memory_bytes: 5492
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <climits>
#include <cfloat>
#include <cstring>
#include <map>
#include <utility>
#include <set>
#include <iostream>
#include <memory>
#include <string>
#include <vector>
#include <list>
#include <algorithm>
#include <functional>
#include <sstream>
#include <complex>
#include <stack>
#include <queue>
#include <unordered_set>
#include <unordered_map>
#include <array>
#include <cassert>
#include <bitset>
using namespace std;
using LL = long long;

//?????¨??°??????????????§??????????????°????±???????
//ford-fulkerson??????????¬????????????????????????????
class BipartiteMatching {
protected:
	vector<vector<int>>graph;
	//match=?????????????????????????????´??????-1???alive=0???????????¨???????????§??????(?¶???????????????§?????¨)???used=????????????????????????
	vector<int>match, alive, used;
	int stamp;
	int V;
	bool dfs(int v) {
		used[v] = stamp;
		for (auto u : graph[v]) {
			int w = match[u];
			if (!alive[u])continue;
			if (w == -1 || (used[w] != stamp&&dfs(w))) {
				match[v] = u;
				match[u] = v;
				return true;
			}
		}
		return false;
	}
public:
	BipartiteMatching(int n)
		:stamp(0), V(n), graph(n), match(n, -1), alive(n, 1), used(n, 0)
	{}
	//u??¨v?????????????????????
	void addedge(int u, int v) {
		graph[u].push_back(v);
		graph[v].push_back(u);
	}
	//??°??????????????§??????????????°????±???????
	int getMatch() {
		int ret = 0;
		for (int i = 0; i < V; ++i) {
			if (!alive[i])continue;
			if (match[i] == -1) {
				++stamp;
				ret += dfs(i);
			}
		}
		return ret;
	}
};

//???????????£????????????????¨?????????????????????§??????
class FixMatching : public BipartiteMatching
{
public:
	FixMatching(int sz) : BipartiteMatching(sz) {}
	//??????k??????????????¨???????????????????±???????
	int add(int k) {
		alive[k] = 1;
		++stamp;
		return (dfs(k));
	}
	//??????k?????????????????¨???????????????????±???????
	int kill(int k) {
		alive[k] = 0;
		if (match[k] == -1) return (0);
		match[match[k]] = -1;
		++stamp;
		int ret = dfs(match[k]);
		match[k] = -1;
		return (ret - 1);
	}
};

int main(void)
{
	int X, Y, E;
	cin >> X >> Y >> E;
	BipartiteMatching bm(X + Y);
	for (int i = 0; i < E; ++i) {
		int x, y; cin >> x >> y;
		bm.addedge(x, X + y);
	}
	cout << bm.getMatch() << endl;
	return 0;
}

Measured memory_bytes: 3252
#include<bits/stdc++.h>
using namespace std;

int main(){
	cin.tie(0),ios::sync_with_stdio(false);
	int k,s; cin>>k>>s;
	int ans=0;
	for(int x=0;x<=k;++x){
		for(int y=0;y<=k;++y){
			int z=s-x-y;
			if(0<=z&&z<=k)++ans;
		}
	}
	cout<<ans<<"\n"s;
}


Measured memory_bytes: 3640
// O O O O O O O O O O O O O O O OO O OO O OO O O O TTCH O TTTCH O TTTCH O O O O
#pragma GCC optimize("Ofast")
#pragma GCC optimize("no-stack-protector")
#pragma GCC optimize("unroll-loops")
#pragma GCC optimize("fast-math")
#pragma GCC target("sse,sse2,sse3,ssse3,popcnt,abm,mmx")
#include <iostream>
#include <vector>
#include <algorithm>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <stdio.h>
#include <cstdio>
#include <math.h>
#include <cmath>
#include <string>
#include <cstring>
#include <queue>
#include <deque>
// #include <random>
#include <iomanip>
#include <bitset>
#include <cassert>
 
using namespace std;

#define y1 y11
#define double long double
#define less less228
#define left left228
#define right right228
#define list list228
#define all(v) v.begin(), v.end()
 
 
 
template<typename T> void uin(T &a, T b) {
    if (b < a) a = b;
}
template<typename T> void uax(T &a, T b) {
    if (b > a) a = b;
}

const int N = 100 * 1000 + 282;

bool dp[N][2];

vector<int>g[N];

void dfs(int v, int par = -1) {
    vector<int> sons;
    for (int to : g[v]) {
        if (to != par) {
            dfs(to, v);
            sons.emplace_back(to);
        }
    }
    int sz = (int)sons.size();
    dp[v][0] = 1;
    int good = 0;
    for (int to : sons) {
        if (!dp[to][1])dp[v][0]=0;
        if (dp[to][1])++good;
    }
    for (int to : sons) {
        if (good - dp[to][1] == sz - 1 && dp[to][0]) {
            dp[v][1] = 1;
        }
    }
}

signed main() {
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    int n;
    cin >> n;
    for (int i = 1; i < n; ++i) {
        int a, b;
        cin >> a >> b;
        g[a].emplace_back(b);
        g[b].emplace_back(a);
    }

    dfs(1);
    if (dp[1][1]) cout << "Second\n";
    else cout << "First\n";
    return 0;
}
// RU_023
 
/*
4 2
2 1 3 3
1 2 4 3
6 1 7 4
5 3 7 5

3 3
1 1 1 1
1 2 1 2
1 3 1 3

*/

Measured memory_bytes: 6016
#include<bits/stdc++.h>
using namespace std;
int main(){
  int h,w;
  cin>>h>>w;
  vector<vector<char>> c(h+2,vector<char>(w+2,'.'));
  for(int i=1;i<=h;i++){
    for(int j=1;j<=w;j++){
      cin>>c[i][j];
    }
  }
  vector<vector<int>> a(h+2,vector<int>(w+2,0));
  int x[8]={-1,0,1,-1,1,-1,0,1};
  int y[8]={1,1,1,0,0,-1,-1,-1};
  for(int i=1;i<=h;i++){
    for(int j=1;j<=w;j++){
      if(c[i][j]=='#'){
        a[i][j]=9;
        for(int k=0;k<8;k++){
          a[i+x[k]][j+y[k]]++;
        }
      }
    }
  }
  for(int i=1;i<=h;i++){
    for(int j=1;j<=w;j++){
      if(a[i][j]<9) cout<<a[i][j];
      else cout<<'#';
    }cout<<endl;
  }
}

Measured memory_bytes: 256
# coding: utf-8

# https://atcoder.jp/contests/abc109


def main():
    N = int(input())
    W = [None] * N
    for i in range(N):
        W[i] = input()
    
    app = [W[0]]
    for i in range(1, N):
        w = W[i]
        if w in app or w[0] != app[-1][-1]:
            return "No"
        app.append(w)
    
    return "Yes"


print(main())


Measured memory_bytes: 3060
# 問題：https://atcoder.jp/contests/abc145/tasks/abc145_c

import math
import itertools

n = int(input())
x = []
y = []
for _ in range(n):
    X, Y = map(int, input().strip().split())
    x.append(X)
    y.append(Y)

distance = [[0 for _ in range(n)] for _ in range(n)]
for i in range(n):
    for j in range(i+1, n):
        dist_i_j = math.sqrt((x[i]-x[j])**2 + (y[i]-y[j])**2)
        distance[i][j] = dist_i_j
        distance[j][i] = dist_i_j

p = itertools.permutations(range(n))
tmp_n = n
num_p = 1
while tmp_n > 1:
    num_p *= tmp_n
    tmp_n -= 1
res = 0
for perm in p:
    for i in range(n-1):
        dist = distance[perm[i]][perm[i+1]]
        res += dist / num_p

print(res)


Measured memory_bytes: 9220
#include <bits/stdc++.h>
using namespace std;
#define mp make_pair
#define pb push_back
#define vll vector<ll>
#define G vector<vll >
#define F first
#define S second
#define pll pair<ll,ll>
#define FOR1(i,a) for(i=0;i<=a;i++)
#define FOR2(i,a,b) for(i=a;i<=b;i++)
#define endl '\n'
#define clr(a) memset(a,0,sizeof(a))
#define all(x) x.begin(),x.end()
typedef long long ll;
auto& in = std::cin;
auto& out = std::cout;

int main()
{
	in.sync_with_stdio(false);
	out.sync_with_stdio(false);
	ll n,m,q,i,j,p;
	in>>n>>m>>q;
	vector<vector<char> > g(n);
	FOR1(i,n-1)
	{
		g[i].resize(m);
		FOR1(j,m-1)
		in>>g[i][j];
	}

	G V(n),EH(n),EV(n);

	V[0].resize(m);EH[0].resize(m);EV[0].resize(m);
	V[0][0]=((g[0][0]=='1')?1:0);
	EV[0][0]=0;
	EH[0][0]=0;
	FOR2(i,1,n-1)
	{
		V[i].resize(m);EH[i].resize(m);EV[i].resize(m);

		V[i][0]=V[i-1][0];
		EV[i][0]=EV[i-1][0];

		if(g[i][0]=='1')
		{
			V[i][0]+=1;
			if(g[i-1][0]=='1')
				EV[i][0]=EV[i-1][0]+1;
		}
		// cout<<"\n"<<V[i][0]<<" :"<<g[i][0]<<" "<<i<<'0';cin>>p;
	}

	FOR2(j,1,m-1)
	{
		V[0][j]=V[0][j-1];
		EH[0][j]=EH[0][j-1];
		if(g[0][j]=='1')
		{
			V[0][j]+=1;
			if(g[0][j-1]=='1')
				EH[0][j]=EH[0][j-1]+1;
		}
	}

	FOR2(i,1,n-1)
	{
		FOR2(j,1,m-1)
		{	
			V[i][j]=V[i-1][j]+V[i][j-1]-((V[i-1][j]==0||V[i][j-1]==0)?0:V[i-1][j-1]);
			EH[i][j]=EH[i-1][j]+EH[i][j-1]-((EH[i-1][j]==0||EH[i][j-1]==0)?0:EH[i-1][j-1]);
			EV[i][j]=EV[i-1][j]+EV[i][j-1]-((EV[i-1][j]==0||EV[i][j-1]==0)?0:EV[i-1][j-1]);
			if(g[i][j]=='1')
			{
				V[i][j]+=1;
				if(g[i-1][j]=='1')
					EV[i][j]+=1;
				if(g[i][j-1]=='1')
					EH[i][j]+=1;
			}
		}		
	}
	// FOR1(i,n-1)
	// {
	// 	FOR1(j,m-1)
	// 	out<<V[i][j]<<" ";out<<endl;
	// }
	// cout<<endl<<"----------------"<<endl;
	// FOR1(i,n-1)
	// {
	// 	FOR1(j,m-1)
	// 	out<<EH[i][j]<<" ";out<<endl;
	// }
	// cout<<endl<<"----------------"<<endl;
	// FOR1(i,n-1)
	// {
	// 	FOR1(j,m-1)
	// 	out<<EV[i][j]<<" ";out<<endl;
	// }
	
	ll x1,x2,y1,y2,max,leftsum,topsum,centersum,countV,countE;
	// cout<<"HI:";
	while(q--)
	{
	in>>x1>>y1>>x2>>y2;
	--x1,--x2,--y1,--y2;
	// cout<<x1<<" "<<y1<<" "<<x2<<" "<<y2;
	max=V[x2][y2];
	leftsum=((y1>0)?V[x2][y1-1]:0);
	// cout<<"\nLEFTSUM:"<<leftsum;cin>>p;
	topsum=((x1>0)?V[x1-1][y2]:0);
	// cout<<"\ntopsum:"<<topsum;cin>>p;
	centersum=((x1>0&&y1>0)?V[x1-1][y1-1]:0);
	// cout<<"\ncentersum:"<<centersum;cin>>p;
	// cout<<"\nanswer V:"<<max-(leftsum+topsum-centersum);
	countV=max-(leftsum+topsum-centersum);
	max=EH[x2][y2]+EV[x2][y2];
	leftsum=EH[x2][y1]+((y1>0)?EV[x2][y1-1]:0);
	// cout<<"\nLEFTSUM:"<<leftsum;cin>>p;
	topsum=EV[x1][y2]+((x1>0)?EH[x1-1][y2]:0);
	// cout<<"\ntopsum:"<<topsum;cin>>p;
	centersum=((x1>0)?EH[x1-1][y1]:0)+((y1>0)?EV[x1][y1-1]:0);
	// cout<<"\ncentersum:"<<centersum;cin>>p;
	// cout<<"\nanswer EH:"<<max-(leftsum+topsum-centersum);
	countE=max-(leftsum+topsum-centersum);
	cout<<countV-countE<<endl;
}
	return 0;
}

Measured memory_bytes: 100224
#include <iostream>
#include <string>
using namespace std;

int main() {
  string chiper;
  cin >> chiper;
  for (int i = 0; i < chiper.size(); i++) chiper[i] = 'A' + (chiper[i] + 26 - 'A' - 3) % 26;
  cout << chiper << endl;
  return 0;
}


Measured memory_bytes: 3164
#include<cstdio>
#include<iostream>
#include<string>
#include<set>
#include<map>
#include<vector>
#include<queue>
#include<stack>
#include<deque>
#include<tuple>
#include<algorithm>
#include<numeric>
#include<limits>
#include<boost/multiprecision/cpp_int.hpp>
using namespace boost::multiprecision;
using namespace std;
#define BEGIN ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
#define END return EXIT_SUCCESS
#define up(I,A,B) for(auto I=(A);I<=(B);++I)
#define dw(I,A,B) for(auto I=(A);I>=(B);--I)
#define rep(I,N) up(I,0,N-1)
#define all(C) (C).begin(),(C).end()
#define rall(C) (C).rbegin(),(C).rend()
#define ft first
#define sd second
#define mp make_pair
#define mt make_tuple
#define pf push_front
#define pb push_back
#define lb lower_bound
#define ub upper_bound
#define rs resize
typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;
template<class T>inline bool chmax(T& a,T b){if(a<b){a=b;return 1;}return 0;}
template<class T>inline bool chmin(T& a,T b){if(a>b){a=b;return 1;}return 0;}
template<class T>inline void                                      in(T &p){cin>>p;}
template<class T1,class T2>inline void                            in(T1 &p1,T2 &p2){cin>>p1>>p2;}
template<class T1,class T2,class T3>inline void                   in(T1 &p1,T2 &p2,T3 &p3){cin>>p1>>p2>>p3;}
template<class T1,class T2,class T3,class T4>inline void          in(T1 &p1,T2 &p2,T3 &p3,T4 &p4){cin>>p1>>p2>>p3>>p4;}
template<class T1,class T2,class T3,class T4,class T5>inline void in(T1 &p1,T2 &p2,T3 &p3,T4 &p4,T5 &p5){cin>>p1>>p2>>p3>>p4>>p5;}
template<class T>inline void                                      ins(T &p){for_each(all(p),in<decltype(p[0])>);}
template<class T>inline void                             out(T p){cout<<p<<"\n";}
template<class T1,class T2>inline void                   out(T1 p1,T2 p2){cout<<p1<<" "<<p2<<"\n";}
template<class T1,class T2,class T3>inline void          out(T1 p1,T2 p2,T3 p3){cout<<p1<<" "<<p2<<" "<<p3<<"\n";}
template<class T1,class T2,class T3,class T4>inline void out(T1 p1,T2 p2,T3 p3,T4 p4){cout<<p1<<" "<<p2<<" "<<p3<<" "<<p4<<"\n";}
inline void                                              out(ld p){printf("%.12Lf\n",p);}
template<class T>inline void outml(T p){for_each(all(p),out<decltype(p[0])>);}//ml=multi line
template<class T>inline void outol(T V){auto n=V.size();rep(i,n)cout<<V[i]<<" \n"[i==n-1];}//ol=one line
vector<vector<ll>>g;
vector<bool>used;
ll ans;
void dfs(ll now){
  used[now]=true;
  bool f=true;
  for(auto result:used){
    if(!result){
      f=false;
      break;
    }
  }
  if(f)ans++;
  for(auto e:g[now]){
    if(!used[e]){
      dfs(e);
      used[e]=false;
    }
  }
}
inline void solve(void){
  ll n,m;
  in(n,m);
  used.resize(n);
  g.resize(n);
  rep(i,m){
    ll a,b;
    in(a,b);
    a--;b--;
    g[a].pb(b);
    g[b].pb(a);
  }
  dfs(0);
  out(ans);
}
int main(void){
  BEGIN;
  solve();
  END;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define sz(x) int(x.size())
using namespace std;

typedef long long ll;
typedef pair<ll, ll> P;
// const ll INF = 1LL << 60;
const int INF = 1e8;

const int mod = 1000000007;

char s[55][55];
int H, W;
int dx[4] = {1, 0, -1, 0}, dy[4] = {0, 1, 0, -1};

int d[55][55]; // 最短距離

int bfs() {
    int sx = 0, sy = 0;
    int gx = H - 1, gy = W - 1;

    rep(i, H)rep(j, W) d[i][j] = INF;

    queue<P> que;
    que.push(P(sx, sy));
    d[sx][sy] = 0;

    while (que.size()) {
        P p = que.front(); que.pop();
        if (p.first == gx && p.second == gy) break;

        for (int i = 0; i < 4; i++) {
            int nx = p.first + dx[i], ny = p.second + dy[i];
            if (0 <= nx && nx < H && 0 <= ny && ny < W && d[nx][ny] == INF && s[nx][ny] != '#') {
                que.push(P(nx, ny));
                d[nx][ny] = d[p.first][p.second] + 1;
            }
        }

    }

    return d[gx][gy];
}

int main() {
    cin >> H >> W;
    rep(i, H)rep(j, W) cin >> s[i][j];

    int dist =  bfs();
    if (dist == INF) {
        cout << -1 << endl;
        return 0;
    }  

    int a = 0; // 障害物
    rep(i, H)rep(j, W) {
        if (s[i][j] == '#') a++;
    };
    int ans = H * W;
    ans -= (dist + 1);
    ans -= a;

    cout << ans << endl;
}

Measured memory_bytes: 256
#!/usr/bin/env python3
from collections import defaultdict,deque
from heapq import heappush, heappop
from bisect import bisect_left, bisect_right
import sys, random, itertools, math
sys.setrecursionlimit(10**5)
input = sys.stdin.readline
sqrt = math.sqrt
def LI(): return list(map(int, input().split()))
def LF(): return list(map(float, input().split()))
def LI_(): return list(map(lambda x: int(x)-1, input().split()))
def II(): return int(input())
def IF(): return float(input())
def S(): return input().rstrip()
def LS(): return S().split()
def IR(n): return [II() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def FR(n): return [IF() for _ in range(n)]
def LFR(n): return [LI() for _ in range(n)]
def LIR_(n): return [LI_() for _ in range(n)]
def SR(n): return [S() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
mod = 1000000007
inf = float("INF")

#solve
def solve():
    s = S()
    t = S()
    ans = inf
    for i in range(len(s) - len(t) +1):
        tmp = 0
        for j in range(len(t)):
            if s[i + j] == t[j]:
                continue
            tmp += 1
        ans = min(ans, tmp)
    print(ans)
    return


#main
if __name__ == '__main__':
    solve()


Measured memory_bytes: 77460
#include<set>
#include<map>
#include<cmath>
#include<ctime>
#include<queue>
#include<cstdio>
#include<string>
#include<vector>
#include<cstdlib>
#include<cstring>
#include<iomanip>
#include<iostream>
#include<algorithm>
#define fi first
#define se second
#define pb push_back
#define lowbit(x) x&(-x)
#define PII  pair<int, int> 
#define FAST ios::sync_with_stdio(false);cin.tie(0);cout.tie(0)
typedef long long ll;
const int inf = 0x3f3f3f3f;
const int mod = (int)1e9 + 7;
const int maxn = (int)505;
using namespace std;

int G[maxn][maxn];
vector<PII> ansc, ansr;

int main()
{
	int h, w; scanf("%d %d", &h, &w);
	for(int i = 1; i <= h; i++){
		for(int j = 1; j <= w; j++){
			scanf("%d", &G[i][j]);
		}
	}
	for(int i = 1; i <= h; i++){
		for(int j = 1; j <= w - 1; j++){
			if(G[i][j] & 1){
				ansr.pb(make_pair(i, j));
				G[i][j]--, G[i][j+1]++;
			}
		}
	}
	for(int i = 1; i <= h - 1; i++){
		if(G[i][w] & 1){
			ansc.pb(make_pair(i, w));
			G[i][w]--, G[i+1][w]++;
		}
	}
	printf("%d\n", ansc.size() + ansr.size());
	for(auto i : ansr){
		printf("%d %d %d %d\n", i.fi, i.se, i.fi, i.se + 1);
	}
	for(auto i : ansc){
		printf("%d %d %d %d\n", i.fi, i.se, i.fi + 1, i.se);
	}
	return 0;
}

Measured memory_bytes: 4212
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define pb push_back
#define mp make_pair
#define F first
#define S second

signed main(){
#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif

	int n;
	cin >> n;
	int a,c=0;
	for(int i=1; i<=n; i++){
		cin >> a;
		if(i%2==1 && a%2==1)
			c++;
	}
	cout << c;


	
	

	return 0;
}

Measured memory_bytes: 3620
#include <bits/stdc++.h>
#define rep(i,n) for (int i=0; i<(n); ++i)
using namespace std;
typedef long long ll;
typedef pair<int,int> P;

ll a[100010];
ll sum_all[100010],sum_plus[100010];

int main(){
  int n,k;
  cin>>n>>k;
  rep(i,n)cin>>a[i];
  rep(i,n){
    sum_all[i+1]=sum_all[i]+a[i];
    sum_plus[i+1]=sum_plus[i]+(a[i]>=0?a[i]:0);
  }
  ll ans=0;
  //白
  for(int i=1; i<=n-k+1; ++i){
    ans=max(ans,(sum_all[i+k-1]-sum_all[i-1])+((sum_plus[n]-sum_plus[0])-(sum_plus[i+k-1]-sum_plus[i-1])));
  }
  //黒
  for(int i=1; i<=n-k+1; ++i){
    ans=max(ans,((sum_plus[n]-sum_plus[0])-(sum_plus[i+k-1]-sum_plus[i-1])));
  }
  cout<<ans<<endl;
}

Measured memory_bytes: 5848
#include <algorithm>
#include <iostream>
#include <limits.h>
#include <math.h>
#include <set>
#include <stack>
#include <stdlib.h>
#include <string>
#include <vector>

#define el endl
#define fd fixed
#define INF INT_MAX/2-1
#define pb push_back

using namespace std;

int main() {
  int n, num1, num2, num3, prev;
  string mcxi1, mcxi2, mcxi3;
  string mcxi[4] = {"m", "c", "x", "i"};
  string num[10] = {"0", "1", "2", "3", "4", "5", "6", "7", "8", "9"};
  cin >> n;
  while (n--) {
    cin >> mcxi1 >> mcxi2;
    num1 = 0, num2 = 0, prev = 1;
    for (int i = 0; i < mcxi1.length(); i++) {
      if (mcxi1[i] == 'm') num1 += prev*1000, prev = 1;
      else if (mcxi1[i] == 'c') num1 += prev*100, prev = 1;
      else if (mcxi1[i] == 'x') num1 += prev*10, prev = 1;
      else if (mcxi1[i] == 'i') num1 += prev;
      else prev = (int)(mcxi1[i] - '0');
    }
    prev = 1;
    for (int i = 0; i < mcxi2.length(); i++) {
      if (mcxi2[i] == 'm') num2 += prev*1000, prev = 1;
      else if (mcxi2[i] == 'c') num2 += prev*100, prev = 1;
      else if (mcxi2[i] == 'x') num2 += prev*10, prev = 1;
      else if (mcxi2[i] == 'i') num2 += prev;
      else prev = (int)(mcxi2[i] - '0');
    }
    num3 = num1 + num2;
    mcxi3 = "";
    for (int i = 0; i < 4; i++) {
      if (num3 % 10 == 1) {
        mcxi3 = mcxi[3-i] + mcxi3;
      } else if (num3 % 10 != 0) {
        mcxi3 = num[num3%10] + mcxi[3-i] + mcxi3;
      }
      num3 /= 10;
    }
    cout << mcxi3 << el;
  }
}

Measured memory_bytes: 1208
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {

		ABC115_A();
		// ABC115_B();
		// ABC115_C();
		// ABC115_D();
	}

	private static void ABC115_A() {
		Scanner scanner = null;
		int date = 0;

		try {
			scanner = new Scanner(System.in);
			date = scanner.nextInt();

			switch (date) {
			case 22:
				System.out.println("Christmas Eve Eve Eve");
				break;
			case 23:
				System.out.println("Christmas Eve Eve");
				break;
			case 24:
				System.out.println("Christmas Eve");
				break;
			case 25:
				System.out.println("Christmas");
				break;
			default:
				System.out.println("fail!");
				break;
			}

		} finally {
			if (scanner != null) {
				scanner.close();
			}
		}
	}

	private static void ABC115_B() {
		Scanner scanner = null;
		int lineAB = 0;
		int lineBC = 0;
		int lineCA = 0;

		try {
			scanner = new Scanner(System.in);
			lineAB = scanner.nextInt();

			System.out.println("");

		} finally {
			if (scanner != null) {
				scanner.close();
			}
		}
	}

	private static void ABC115_C() {
		Scanner scanner = null;
		int lineAB = 0;
		int lineBC = 0;
		int lineCA = 0;

		try {
			scanner = new Scanner(System.in);
			lineAB = scanner.nextInt();

			System.out.println("");

		} finally {
			if (scanner != null) {
				scanner.close();
			}
		}
	}

	private static void ABC115_D() {
		Scanner scanner = null;
		int lineAB = 0;
		int lineBC = 0;
		int lineCA = 0;

		try {
			scanner = new Scanner(System.in);
			lineAB = scanner.nextInt();

			System.out.println("");

		} finally {
			if (scanner != null) {
				scanner.close();
			}
		}
	}
}

Measured memory_bytes: 20948
#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <numeric>
    
using namespace std;    
typedef long long ll;
#define all(x) (x).begin(),(x).end()
#define rall(x) (x).rbegin(),(x).rend()

int main(){

    int N , M, Q;
    cin >> N >> M >> Q;

    ll memo[N][N];
    for(int i = 0; i < N; i++){
        for(int j = 0; j < N; j++){
            memo[i][j] = 0;
        }
    }
    for(int i = 0; i < M; i++){
        int left, right;
        cin >> left >> right;
        memo[right - 1][left - 1] ++;
    }


    ll ans[N][N];
    for(int i = 0; i < N; i++){
        for(int j = 0; j < N; j++){
            ans[i][j] = 0;
        }
    }
    for(int r = 0; r < N; r++){
        ans[r][N-1] = memo[r][N-1];
        for(int l = N - 2; l >= 0; l--){
            ans[r][l] = ans[r][l + 1] + memo[r][l];
        }
    }

    for(int l = 0; l < N; l++){
        for(int r = 0; r < N - 1; r++){
            ans[r + 1][l] += ans[r][l];
        }
    }

    for(int i = 0; i < Q; i++){
        int p, q;
        cin >> p >> q;
        cout << ans[q-1][p-1] << endl;
    }


}


Measured memory_bytes: 4864
#include <bits/stdc++.h>
using namespace std;
int main() {
  string s, t, u;
  int a, b;
  cin >> s >> t;
  cin >> a >> b;
  cin >> u;
  if(s == u) printf("%d %d\n", a-1, b);
  else printf("%d %d\n", a, b-1);
}


Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <algorithm>
#include <utility>
#include <cmath>
#include <numeric>
#include <string>

#define debug(s) cout << s << endl
#define debug1(s, t) cout << s << " " << t << endl

using namespace std;
using i64 = long long;

int main()
{
    int n;
    cin >> n;

    double ans = 0.5;
    if (n % 2 == 1) // odd
        ans += 0.5 / n;
    printf("%lf", ans);

    return 0;
}

Measured memory_bytes: 256
// ABC 116 D
#include<bits/stdc++.h>

using namespace std;
//container util
//------------------------------------------
#define REP(i,n) for(int (i)=0;(i)<(n);(i)++)
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())
#define RSORT(c) sort((c).begin(),(c).end(),greater<int>())
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define PB(a) push_back(a)
#define ALL(x) (x).begin(),(x).end()
#define MAX_EL(c) *max_element((c).begin(),(c).end())
//typedef
//------------------------------------------
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef long long LL;
typedef vector<long long> VL;
typedef string str;

//constant
//--------------------------------------------
const double EPS = 1e-10;
const double PI  = acos(-1.0);
//debug
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;

int main(){
// magic spell------------------------------
  cin.tie(0);
  ios::sync_with_stdio(false);
//------------------------------------------

  LL n,k;
  cin >> n >> k;
  vector <pair <LL,LL>> td(n);
  REP(i,n){
    cin >> td[i].first >> td[i].second;
    td[i].first--;
  }
  LL ans = 0;
  VL vari(n,0);
  sort(ALL(td),[](const auto& a, const auto& b){return a.second>b.second;});
  priority_queue<LL, VL, greater<LL> > pque;
  LL vnum = 0;

  REP(i,k){
    if(vari[td[i].first]==0){
      vari[td[i].first]++;
      ans += vnum * 2 + 1;
      vnum++;
      ans += td[i].second;
    }else{
      ans += td[i].second;
      pque.push(td[i].second);
    }
  }
  LL fans = ans;
  FOR(i,k,n){
    if(pque.empty()) break;
    if(vari[td[i].first]>0) continue;
    vari[td[i].first]++;
    ans -= pque.top();
    pque.pop();
    ans += vnum*2+1;
    ans+=td[i].second;
    vnum++;
    fans=max(ans,fans);
  }
  cout << fans << endl;
  return 0;
}


Measured memory_bytes: 3196
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int main()
{
	
	
		ll n,i,j,k,u,v,a,b=0;
		cin>>n>>k;
		if(n>=10) cout<<k<<endl;
		else cout<<k+100*(10-n)<<endl;
	
	
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;

typedef long long int ll;
typedef pair<ll, ll> pll;

#define FOR(i, n, m) for (ll(i) = (m); (i) < (n); ++(i))
#define REP(i, n) FOR(i, n, 0)
#define OF64 std::setprecision(10)

const ll MOD = 1000000007;
const ll INF = (ll)1e15;

int main()
{
    ll K, T;
    cin >> K >> T;
    ll max = 0;
    REP(i, T)
    {
        ll a;
        cin >> a;
        max = std::max(max, a);
    }
    cout << std::max(0LL, 2 * max - K - 1) << endl;

    return 0;
}

Measured memory_bytes: 256
#include<iostream>
using namespace std;

int main(){
	int t[6][2] = {
		{1,2},
		{-1,3},
		{1,-1},
		{4,5},
		{5,2},
		{2,1}
	};
	string in;
	while( cin >> in, in[0]!='#' ){
		int p = 0;
		for( int i=0; i<in.length(); i++ ){
			p = t[p][in[i]-'0'];
			if( p == -1 ){
				cout << "No" << endl;
				break;
			}
		}
		if( p != -1 )
			cout << (p==5 ? "Yes" : "No") << endl;
		
	}
	return 0;
}

Measured memory_bytes: 1176
L=list(map(int,input().split()))
X,K,D = abs(L[0]),L[1],L[2]
Y = X-K*D
W = (K-X//D)%2
if Y >= 0:
    Z = Y
elif Y < 0:
    if W == 1:
        Z = D - X % D
    else:
        Z = X % D
print(Z)

Measured memory_bytes: 9204