akhauriyash/Code-Regression huggingface dataset:
import sys
readline = sys.stdin.readline
from collections import deque

def main():
    N = int(readline())
    path = [[] for _ in range(N)]
    for _ in range(N-1):
        a, b, c = map(int, readline().rstrip().split())
        path[a-1].append((b-1, c))
        path[b-1].append((a-1, c))
    Q, K = map(int, readline().rstrip().split())
    K -= 1

    dist = [-1] * N
    dist[K] = 0
    for n, c in path[K]:
        dist[n] = c
        
    que = deque([(K, n) for n, c in path[K]])
    while que:
        pre, now = que.popleft()
        for next, d in path[now]:
            if next != pre:
                dist[next] = dist[now] + d
                que.append((now, next))

    for _ in range(Q):
        x, y = map(int, readline().rstrip().split())
        print(dist[x-1] + dist[y-1])

if __name__ == '__main__':
    main()

Measured memory_bytes: 47184
#include <algorithm>
#include <bitset>
#include <complex>
#include <cstdio>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <typeinfo>
#include <utility>
#include <valarray>
#include <vector>
#if __cplusplus >= 201103L
#include <array>
#include <atomic>
#include <chrono>
#include <condition_variable>
#include <forward_list>
#include <future>
#include <initializer_list>
#include <mutex>
#include <random>
#include <ratio>
#include <regex>
#include <scoped_allocator>
#include <system_error>
#include <thread>
#include <tuple>
#include <typeindex>
#include <type_traits>
#include <unordered_map>
#include <unordered_set>
#endif

using namespace std;

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

typedef long long ll;

const int Inf = 100100100;
const double EPS = 1e-9;

int gcd(int a, int b) {
    if (b == 0) {
        return a;
    } else {
        return gcd(b, a % b);
    }
}

int lcm(int a, int b) {
    return a * b / gcd(a, b);
}

int bitCount(long bits) {
    bits = (bits & 0x55555555) + (bits >> 1 & 0x55555555);
    bits = (bits & 0x33333333) + (bits >> 2 & 0x33333333);
    bits = (bits & 0x0f0f0f0f) + (bits >> 4 & 0x0f0f0f0f);
    bits = (bits & 0x00ff00ff) + (bits >> 8 & 0x00ff00ff);
    return (bits & 0x0000ffff) + (bits >>16 & 0x0000ffff);
}

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    int k, ans;
    cin >> k;
    if (k % 2 == 1) {
      ans = (k / 2 + 1) * (k / 2);
    } else {
      ans = (k / 2 ) * (k / 2);
    }

    cout << ans << '\n';

    return 0;
}


Measured memory_bytes: 256
from collections import Counter

H, W = map(int, input().split())
s = ''
for _ in range(H):
    s += input()
jdg = True
cnt = Counter(s)
lst = list(cnt.values())
lst4 = [l%4 for l in lst if l%4!=0]
lst42 = []
if len(lst4) > ((H%2) * W//2 + (W%2) * H//2 + (H%2)*(W%2)): jdg = False
elif len(lst4) == 0 and (H%2 == 1 and W%2 == 1):jdg = False 
else:
    lst42 = [l%2 for l in lst4 if l%2!=0]
    if len(lst42) != (H%2) * (W%2): jdg = False

print('Yes' if jdg else 'No')



Measured memory_bytes: 3316
N = int(input())
h = [int(i) for i in input().split()]
h.append(0)
ans = 0

while any(h):
  l,r = 0, 0
  for i in range(N):
    if h[i] == 0 and h[i+1] != 0:
      l = i+1
    if (h[i] != 0 and h[i+1] == 0):
      r = i+1
      minh = min(h[l:r])
      ans += minh
      for j in range(l,r):
        h[j] -= minh
print(ans)

Measured memory_bytes: 3064
#include<iostream>
using namespace std;
int main()
{
  int S,h,m,s;
  cin >> S;
  h = S/60/60;
  m = (S-h*60*60)/60;
  s = S%60;
  cout << h << ":" << m << ":" << s << endl;
  return 0;
}

Measured memory_bytes: 1164
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define FOR(i, s, e) for (int i = (int)(s); i <= (int)(e); i++)
#define printYesNo(is_ok) puts(is_ok ? "Yes" : "No");
#define SORT(v) sort(v.begin(), v.end());
#define RSORT(v) sort(v.rbegin(), v.rend());
#define REVERSE(v) reverse(v.begin(), v.end());

template <typename T>
void printlnVector(T v)
{
  rep(i, v.size())
  {
    cout << v[i] << endl;
  }
}

template <typename T>
void printVector(T v)
{
  rep(i, v.size())
  {
    cout << v[i] << " ";
  }
  cout << endl;
}

int main()
{
  long double A, B;
  cin >> A >> B;
  long long ans = B * A;
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 3732
#include<iostream>
#include<queue>
#include<vector>

using namespace std;

int N, M;
int inedge[50];
bool isend[50];
vector<vector<int>> e;

int main() {
	cin >> N >> M;
	e.resize(N);
	for (int i = 0; i < M; i++) {
		int a, b;
		cin >> a >> b;
		a--, b--;
		inedge[a]++;
		inedge[b]++;
		e[a].push_back(b);
		e[b].push_back(a);
	}

	queue<int> q;

	for (int i = 0; i < N; i++) {
		if (inedge[i] == 1) {
			q.push(i);
		}
	}

	int ans = 0;

	while (q.size()) {
		int t = q.front(); q.pop();
		isend[t] = true;
		for (int i = 0; i < e[t].size(); i++) {
			if (!isend[e[t][i]]) {
				inedge[e[t][i]]--;
				if (inedge[e[t][i]] == 1) {
					q.push(e[t][i]);
				}
			}
		}
		ans++;
	}
	if (ans == N)ans--;
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 256
o=input()
e=input()
tmp=[]
if len(o)==len(e):
    for i in range(len(o)):
        tmp.append(o[i])
        tmp.append(e[i])
else:
    for i in range(len(o)-1):
        tmp.append(o[i])
        tmp.append(e[i])
    tmp.append(o[i+1])
print(''.join(tmp))

Measured memory_bytes: 3064
/** Author: Nicklaus **/
 #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long long int lli;
typedef long double ld;

int main(){
	int n, k;
	string s;
	cin>>n>>k>>s;
	s[k-1]=s[k-1]+32;
	cout<<s<<endl;
	return 0;
}

Measured memory_bytes: 256
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int x = sc.nextInt();
		int num500 = x / 500;
		int num5 = (x - num500 * 500) / 5;
		System.out.println(num500*1000+num5*5);
		sc.close();
	}
}

Measured memory_bytes: 35684
import math 

from sys import stdin
 



A, B = map(int, stdin.readline().split())

A_min = int(math.ceil(100*A/8))
A_max = int(math.floor((100*A + 1)/8))
B_min = 10*B 


A_ = []
c = int(math.ceil(100*A/8))
while c < (A + 1)*100/8:
	A_.append(c)
	c += 1
B_ = []
c = 10*B 
while c < 10*B + 10:
	B_.append(c)
	c += 1 

C = list(set(A_) & set(B_))
if len(C) == 0:
	print (-1)
else:
	print (min(C))

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

#define en '\n'
using ll = long long;
template <class T>
using vec = vector<T>;
template <class T>
using vvec = vec<vec<T>>;
#define REP(i, n) for(int(i) = 0; (i) < (n); (i)++)
#define all(hoge) hoge.begin(), hoge.end()

int main(void) {
    int n, m;

    while(cin >> n >> m) {
        if(n == 0 and m == 0)
            break;

        vvec<int> v(m);
        REP(i, n) {
            int dd, vv;
            cin >> dd >> vv;
            dd--;
            v[dd].push_back(vv);
        }

        int ans = 0;
        REP(i, m) {
            sort(all(v[i]));
            ans += v[i].back();
        }
        cout << ans << en;
    }
    return 0;
}


Measured memory_bytes: 3128
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<n;i++)
using namespace std;
const int INF=1<<29,MOD=1e9+7;

vector<int> prime;

void Sieve_of_Eratosthenes(int n){
	n++;
    bool list[n]; rep(i,n) list[i]=1; //全数にフラグ
	//2の倍数,3の倍数…と削っていく
    for(int i=2;i*i<n;i++){
        if(list[i]){
            for(int j=2;i*j<n;j++) list[i*j]=0;
        }
    }
	//フラグが立っていれば素数
    for(int i=3;i<n;i++){
        if(list[i]) prime.push_back(i);
    }
}

bool is_prime(int n){
    if(n<2) return 0; //素数は2以上
	if(n==2 || n==3) return 1;
    if(n%2==0 || n%3==0) return 0;
    //以降素数は6k±1にしかない
    if(n%6!=1 && n%6!=5) return 0;
    for(int i=5;i*i<=n;i+=6){
        if(n%i==0) return 0; //6k-1
        if(n%(i+2)==0) return 0; //6k+1
    }
    return 1;
}


int main(){
	Sieve_of_Eratosthenes(1e5);
	vector<int> ans;
	int m=prime.size();
	rep(j,m){
		if(is_prime((prime[j]+1)/2)) ans.push_back(prime[j]);
	}
	int q; cin>>q;
	m=ans.size();
	rep(i,q){
		int l,r; cin>>l>>r;
		int cnt=0;
		rep(j,m){
			if(l<=ans[j]&&ans[j]<=r) cnt++;
		}
		cout<<cnt<<endl;
	}
}


Measured memory_bytes: 896
#include<bits/stdc++.h>
//g++ -std=c++11 

using namespace std;
typedef long long ll;

#define rep(i,n) for (long long i = 0; i < (n); ++i)
#define DIV 1000000007 //10^9+7

ll N;
ll P[55];

bool check() {
	rep(i, N - 1) {
		if(P[i] > P[i+1]) {
			return false;
		}
	}
	return true;
}

int main(){
	cin >> N;
	rep(i, N) cin >> P[i];

	if(check()) {
		cout << "YES" << endl;
		return 0;
	}

	for(ll i = 0; i < N; i++) {
		for(ll j = i + 1; j < N; j++) {
			swap(P[i], P[j]);
			if(check()) {
				cout << "YES" << endl;
				return 0;
			}
			swap(P[i], P[j]);
		}
	}
	cout << "NO" << endl;
}

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

using namespace std;
#define ll long long
#define int long long

#define rep(i, a) for (int (i) = 0; (i) < (int) (a); (i)++)
#define reps(i, a, b) for (int (i) = (int) (a); (i) < (int) (b); (i)++)
#define rrep(i, a) for (int (i) = (int) a-1; (i) >= 0; (i)--)
#define rreps(i, a, b) for (int (i) = (int) (a)-1; (i) >= (int) (b); (i)--)
#define MP(a, b) make_pair((a), (b))
#define PB(a) push_back((a))
#define all(v) (v).begin(), (v).end()
#define PRINT(f) if((f)){cout << (TRUE__) << endl;}else{cout << FALSE__ << endl;}
#define TRUE__ "Yes"
#define FALSE__ "No"
#define PERM(v) next_permutation(all(v))
#define UNIQUE(v) sort(all(v));(v).erase(unique(all(v)), v.end())
#define CIN(type, x) type x;cin >> x

#ifdef LOCAL
	#define lcout(a) cout << a;
	#define lcoutln(a) cout << a << endl;
	#define lcerr(a) cerr << a;
	#define lcerrln(a) cerr << a << endl;
#else
	#define lcout(a) 
	#define lcoutln(a) 
	#define lcerr(a) 
	#define lcerrln(a) 
#endif

vector<vector<int> > v(100000);
int N;
bool keiro[100000];
bool hou[100000];
bool dfshou[100000];

bool dfs(int pos)
{
	if (dfshou[pos]) return false;
	dfshou[pos] = true;
	if (pos == N-1) return keiro[pos] = true;
	rep (i, v[pos].size()) {
		int x = v[pos][i];
		if (dfs(x)) return keiro[pos] = true;
	}
	return false;
}

int cnt(int pos)
{
	int res = 0;
	if (hou[pos]) return 0;
	hou[pos] = true;
	rep (i, v[pos].size()) {
		int x = v[pos][i];
		res += cnt(x);
	}
	return res + 1;
}

signed main()
{
	cin >> N;
	rep(i, N-1) {
		CIN(int, a);
		CIN(int, b);
		v[a-1].PB(b-1);
		v[b-1].PB(a-1);
	}
	dfs(0);
	int fe = 0, su = N-1;
	vector<int> fv;
	vector<int> sv;
	fv.PB(0);
	sv.PB(N-1);
	hou[0] = hou[N-1] = true;
	int fres = 1, sres = 1;
	while(true) {
		rep(i, v[fe].size()) {
			int x = v[fe][i];
			if (keiro[x] && hou[x]) continue;
			if (keiro[x]) {
				hou[x] = true;
				fe = x;
				fv.PB(x);
				fres++;
				goto E1;
			}
		}
		break;
E1:
		rep(i, v[su].size()) {
			int x = v[su][i];
			if (keiro[x] && hou[x]) continue;
			if (keiro[x]) {
				hou[x] = true;
				su = x;
				sv.PB(x);
				sres++;
				goto E2;
			}
		}
		break;
E2:
	continue;
	}
	rep(i, fv.size()) {
		int x = fv[i];
		rep(j, v[x].size()) {
			int y = v[x][j];
			fres += cnt(y);
		}
	}
	rep(i, sv.size()) {
		int x = sv[i];
		rep(j, v[x].size()) {
			int y = v[x][j];
			sres += cnt(y);
		}
	}
	if (fres > sres) cout << "Fennec" << endl;
	else cout << "Snuke" << endl;
}


Measured memory_bytes: 10028
#include <iostream>
#include <vector>
#include <map>
#include <set>
#include <string>
#include <utility>
#include <algorithm>
#include <cstdio>
#include <iomanip>
#include <queue>
#include <deque>
#include <stack>
#include <fstream>
#include <cmath>
#include <random>
#include <complex>
#include <functional>

#define ll int64_t
#define Rep(i, n) for (ll i = 0; i < n; i++)
using namespace std;
typedef vector<ll> vec;
typedef vector<vec> mat;

const ll inf = 1LL << 60;

template<class T> inline void chmin(T& a, T b) {
  if (a > b) {
    a = b;
  }
}
template<class T> inline void chmax(T& a, T b) {
  if (a < b) {
    a = b;
  }
}

typedef complex<long double> co;
const long double EPS = 1e-10;
bool EQ(long double a, long double b) {
    return (abs(a-b) < EPS);
}
bool EQV(co a, co b) {
    return EQ(a.real(), b.real()) and EQ(a.imag(), b.imag());
}

long double dot(co a, co b) {
    return (a.real() * b.real() + a.imag() * b.imag());
}

long double cross(co a, co b) {
    return (a.real() * b.imag() - a.imag() * b.real());
}

co intersection(co a1, co a2, co b1, co b2) {
    co a = a2 - a1; co b = b2 - b1;
    return a1 + a * cross(b, b1 - a1) / cross(b, a);
}

co gaishin(co a, co b, co c) {
    co e1 = b - a, e2 = c - a;
    co h1 = e1 * co(0, 1), h2 = e2 * co(0, 1);
    return intersection(a+e1/co(2, 0), a+e1/co(2, 0)+h1, a+e2/co(2, 0), a+e2/co(2, 0)+h2);
}

bool ccw(co a, co b, co c) {
    return EQ(cross(b-a, c-a), 0.0);
}

int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);

    ll N;
    cin >> N;
    vector<co> points(N);
    Rep (i, N) {
        long double a, b;
        cin >> a >> b;

        points[i] = {a, b};
    }

    vector<co> koho;

    Rep (i, N) {
        for (ll j = i+1; j < N; j++) {
            koho.push_back((points[i]+points[j])/co(2, 0));
            for (ll k = j+1; k < N; k++) {
                if (1 or !ccw(points[i], points[j], points[k])) {
                    koho.push_back(gaishin(points[i], points[j], points[k]));
                }
            }
        }
    }

    long double ans = inf;
    for (co e : koho) {
        long double tmp = 0;
        Rep (i, N) {
            chmax(tmp, abs(e-points[i]));
        }
        chmin(ans, tmp);
    }

    cout << fixed << setprecision(10) << ans << endl;
}

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

int main() {
  
  int a,b ;
  cin >> a >> b ;
  
  if( ( a + b ) % 2 == 0 ){
    cout << ( a + b ) / 2 << endl;
  }
  else{
    cout << ( a + b ) / 2 + 1 << endl;
  }
}

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

// #undef DEBUG  // Uncomment this line to forcefully disable debug print.
#if DEBUG
template <typename T>
void debug(T value) {
  std::cerr << value;
}
template <typename T, typename... Ts>
void debug(T value, Ts... args) {
  std::cerr << value << ", ";
  debug(args...);
}
#define dbg(...)                              \
  do {                                        \
    cerr << #__VA_ARGS__ << ": ";             \
    debug(__VA_ARGS__);                       \
    cerr << " (L" << __LINE__ << ")" << endl; \
  } while (0)
#else
#define dbg(...)
#endif

void read_from_cin() {}
template <typename T, typename... Ts>
void read_from_cin(T& value, Ts&... args) {
  std::cin >> value;
  read_from_cin(args...);
}
#define in(type, ...) \
  type __VA_ARGS__;   \
  read_from_cin(__VA_ARGS__);

template <typename T>
void write_to_cout(const T& value) {
  std::cout << value << std::endl;
}
template <typename T, typename... Ts>
void write_to_cout(const T& value, const Ts&... args) {
  std::cout << value << ' ';
  write_to_cout(args...);
}
#define out(...) write_to_cout(__VA_ARGS__);

#define all(x) (x).begin(), (x).end()
#define rep(i, n) for (int i = 0; i < (int)(n); ++i)

using ll = long long;

using namespace std;

template <typename T>
bool Setmax(T& a, T b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}

int main() {
  in(int, D);
  vector<int> c(26);
  rep(i, 26) cin >> c[i];
  vector<vector<int>> s(D, vector<int>(26));
  rep(i, D) rep(j, 26) cin >> s[i][j];

  int score = 0;
  vector<int> last(26);
  rep(i, D) {
    int maxi = numeric_limits<int>::min();
    int chosen;
    rep(j, 26) {
      int score_change = s[i][j];
      rep(k, 26) {
        int last_day = k == j ? i + 1 : last[k];
        score_change -= c[k] * (i + 1 - last_day);
      }
      if (Setmax(maxi, score_change)) {
        chosen = j;
      }
    }
    last[chosen] = i + 1;
    score += maxi;
    dbg(score, maxi, chosen);
    out(chosen + 1);
  }
}


Measured memory_bytes: 3680
#include<iostream>
#include<iomanip>
#include<cassert>
#include<math.h>
#include<complex>
#include<algorithm>
#include<utility>
#include<queue>
#include<string.h>
#include<string>
#include<set>
#include<map>
#include<unordered_map>
#include<functional>
#include<vector>
using namespace std;
typedef long long ll;
typedef pair<ll,ll> P;
const ll INF=2e18;
const ll MOD=1e9+7;

ll N;
int main(){
    cin>>N;
    string ans;
    while(N>0){
        if(N%26==0){
            N-=26;
            ans+='z';
        }else{
            ans+='a'+N%26-1;
        }
        N/=26;
    }
    reverse(ans.begin(),ans.end());
    cout<<ans<<endl;

    return 0;
}

Measured memory_bytes: 3624
import std.algorithm;
import std.array;
import std.conv;
import std.math;
import std.range;
import std.stdio;
import std.string;
import std.typecons;

T read(T)() { return readln.chomp.to!T; }
T[] reads(T)() { return readln.split.to!(T[]); }
alias readint = read!int;
alias readints = reads!int;

void main() {
    auto nml = readints;
    int n = nml[0], m = nml[1], l = nml[2];

    auto a = new long[][](n, m);
    auto b = new long[][](m, l);
    for (int i = 0; i < n; i++) {
        a[i][] = reads!long;
    }
    for (int i = 0; i < m; i++) {
        b[i][] = reads!long;
    }

    auto mat = new Mat!long(a) * new Mat!long(b);
    mat.dump();
}

class Mat(T) {
    private const T[][] _mat;

    @property int rows() const { return cast(int)_mat.length; }
    @property int cols() const { return cast(int)_mat[0].length; }

    this(const T[][] init) {
        assert(init.length > 0 && init[0].length > 0);

        _mat = init.dup;
    }

    T get(int r, int c) const {
        return _mat[r][c];
    }

    Mat opMul(Mat m) {
        return mul(m, T.max);
    }

    Mat mul(const Mat m, T mod) const {

        Mat multiple(const T[][] a, const T[][] b) {
            auto arows = a.length;
            auto acols = a[0].length;
            auto brows = b.length;
            auto bcols = b[0].length;

            auto t = new T[][](arows, bcols);
            for (int i = 0; i < arows; i++) {
                for (int j = 0; j < bcols; j++) {
                    T x = 0;
                    for (int k = 0; k < acols; k++) {
                        x = (x + (a[i][k] * b[k][j]) % mod) % mod;
                    }
                    t[i][j] = x;
                }
            }
            return new Mat(t);
        }

        return multiple(_mat, m._mat);
    }

    Mat copy() const {
        return new Mat(_mat);
    }

    Mat pow(int k, int mod) const {
        assert(k > 0);
        if (k == 1) return this.copy();

        auto m = this.pow(k / 2, mod);
        return k % 2 == 0
            ? m.mul(m, mod)
            : this.mul(m.mul(m, mod), mod);
    }

    void dump() const {
        for (int i = 0; i < rows; i++) {
            for (int j = 0; j < cols; j++) {
                if (j > 0) write(" ");
                write(_mat[i][j]);
            }
            writeln();
        }
    }
}



Measured memory_bytes: 3172
#include <stdio.h>
#include <stdlib.h>

int main()
{
    int i,j,n,o,po,s;
    int shuzu[10086];
    while(~scanf("%d",&n))
    {
        for(i=1; i<=n; i*=2)
        {
            if(i*2>n)
            {
                break;
            }

        }
        printf("%d\n",i);
    }
    return 0;
}


Measured memory_bytes: 128
#[allow(unused_imports)]
use proconio::{input, marker::*};

#[allow(unused_imports)]
use std::collections::{BTreeMap, BTreeSet, BinaryHeap, HashMap, HashSet, VecDeque};

#[allow(unused_imports)]
use std::io::Write;

#[allow(unused_macros)]
macro_rules! debug {
    ($($a:expr),*) => {
        #[cfg(debug_assertions)]
        writeln!(&mut std::io::stderr(), concat!("[DEBUG] ", $(stringify!($a), "={:?} "),*), $($a),*).unwrap();
    }
}

fn prime_fact(m: usize) -> BTreeMap<usize, usize> {
    let mut m = m;
    let mx = (m as f64).sqrt() as usize;
    let mut map = BTreeMap::new();
    for i in 2..mx + 1 {
        while m % i == 0 {
            m /= i;
            *map.entry(i).or_insert(0) += 1;
        }
    }
    if m > 1 {
        map.insert(m, 1);
    }
    map
}

fn main() {
    input! {
        n: usize,
    }
    let mut sum = 0usize;
    for (_, val) in prime_fact(n) {
        let mut v = 0;
        for i in 1.. {
            if i * (i + 1) / 2 > val {
                v = i - 1;
                break;
            }
        }
        dbg!(v);
        sum += v;
    }
    println!("{}", sum);
}


Measured memory_bytes: 2200
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ABC149
{
    class Program
    {
        static void Main(string[] args)
        {
            b();
        }

        public static void a()
        {
            string[] st = Console.ReadLine().Split(' ');
            Console.WriteLine("{0}{1}", st[0], st[1]);
        }

        public static void b()
        {
            long[] abk = Console.ReadLine().Split(' ').Select(s => long.Parse(s)).ToArray();
            long a = abk[0], b = abk[1], k = abk[2];
            long a1 = a;
            a -= k;
            if(a < 0)
            { a = 0; }
            k -= a1;
            if(k < 0)
            { k = 0; }
            b -= k;
            if(b < 0)
            { b = 0; }
            Console.WriteLine("{0} {1}", a, b);
        }

        public static void c()
        {
            long x = long.Parse(Console.ReadLine());
            long ans = x;
            while(true)
            {
                if (x != ans)
                { break; }
                else
                { x++; }
            }
            Console.WriteLine(ans);
        }
    }
}


Measured memory_bytes: 13396
#include<bits/stdc++.h>
using namespace std;
int main()
{
    int a,b;
    char s[15];
    cin>>a;
    cin>>b;
    int f = 1;

        if((a>=1&&a<=9)&&(b>=1&&b<=9))
        {
            cout<<a*b<<endl;
        }
   else cout<<-1<<endl;
    return 0;
}


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

int main(){
    string s;
    cin >> s;
    string ans = "Good";

    for (auto i = 0; i < 3; i++)
    {
        if(s[i] == s[i+1]){
            ans = "Bad";
        }
    }
    cout << ans << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int N;
  int S=1;
  cin>>N;
  vector<int>vec(N);
  for(int X=0;X<N;X++){
    cin>>vec[X];
    if(vec[X]==S){
      S++;
    }
  }
  if(S==1){
    cout<<-1<<endl;
  }
  else{
    cout<<N-(S-1)<<endl;
  }
}

Measured memory_bytes: 4048
import sys
n = int(input())
a = int(input())
b = 0
while True:
    c = 0
    if (500*b + c) > n:
        print("No")
        break
    for i in range(a+1):
        if (500*b + c) == n:
            print("Yes")
            sys.exit(0)
        c+=1
    b+=1


Measured memory_bytes: 9132
// abc144_a
#include <bits/stdc++.h>
#ifdef LOCAL
#include "../cxx-prettyprint/prettyprint.hpp"
#endif
using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> P;

#define REP(i, n) for (int (i) = 0 ; (i) < (int)(n) ; ++(i))
#define REPN(i, m, n) for (int (i) = m ; (i) < (int)(n) ; ++(i))
#define REP_REV(i, n) for (int (i) = (int)(n) - 1 ; (i) >= 0 ; --(i))
#define REPN_REV(i, m, n) for (int (i) = (int)(n) - 1 ; (i) >= m ; --(i))
#define ALL(x) x.begin(), x.end()

#define INF ((1 << 29)-1)
#define MOD (1000000007)

#define print2D(h, w, arr) REP(i, h) { REP(j, w) cout << arr[i][j] << " "; cout << endl; }
#define print_line(vec, n) {for(int i=0;i<(n-1);i++) cout << (vec)[i] << " "; cout << (vec)[(n)-1] << endl;}
template<class T> void print(const T& x){cout << x << endl;}
template<class T, class... A> void print(const T& first, const A&... rest) { cout << first << " "; print(rest...); }
struct PreMain {PreMain(){cin.tie(0);ios::sync_with_stdio(false);cout<<fixed<<setprecision(20);}} premain;

int main() {
#ifdef LOCAL
    ifstream in("../arg.txt"); cin.rdbuf(in.rdbuf());
#endif

    int A, B;
    cin >> A >> B;

    if (A < 10 && B < 10){
        print(A*B);
    } else{
        print(-1);
    }

    return 0;
}


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

int main(){
  int N;
  std::cin>>N;
  int h[100];
  for(int i=0;i<N;++i){
    std::cin>>h[i];
  }
  int ans=0;
  for(int i=0;i<N;++i){
    while(h[i]>0){
      ++ans;
      for(int j=i;j<N;++j){
	if(h[j]==0)break;
	--h[j];
      }
    }
  }
  std::cout<<ans<<std::endl;
  return 0;
}


Measured memory_bytes: 256
//#define _GLIBCXX_DEBUG
#include<bits/stdc++.h>
 
using namespace std;
 
 
template<class T>
bool chmax(T& a, T b) {
    if (a < b) {
        a = b;
        return true;
    }
    return false;
}
 
 
long long dp[105][100005];
 
void solve() {
    int N, W; cin >> N >> W;
    vector<int> w(N), v(N);
    for (int i = 0; i < N; i++) cin >> w[i] >> v[i];
 
    if (w[0] <= W) dp[0][w[0]] = v[0];
 
    for (int i = 1; i < N; i++) {
        for (int j = 0; j <= W; j++) {
            chmax(dp[i][j], dp[i-1][j]);
            if (j - w[i] >= 0) {
                chmax(dp[i][j], dp[i-1][j-w[i]] + v[i]);
            }
        } 
    }
 
    long long ans = 0;
    for (int i = 0; i <= W; i++) {
        chmax(ans, dp[N-1][i]);
    }
 
    cout << ans << endl;
}
 
 
int main() {
    solve();
    return 0;
}


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

using i64=int64_t;

#define rep(i,x,y) for(i64 i=i64(x),i##_max_for_repmacro=i64(y); i<i##_max_for_repmacro; ++i)
#define debug(x) #x << "=" << (x)
 
#ifdef DEBUG
#define _GLIBCXX_DEBUG
#define print(x) std::cerr << debug(x) << " (L:" << __LINE__ << ")" << std::endl
#else
#define print(x)
#endif
 
const int inf=1.01e9;
const i64 inf64=4.01e18;
const double eps=1e-9;
 
template <typename T> ostream &operator<<(ostream &os, const vector<T> &vec){
    os << "[";
    for (const auto &v : vec) {
        os << v << ",";
    }
    os << "]";
    return os;
}

void solve(){
    i64 N;
    cin >> N;

    vector<i64> A(N);
    rep(i,0,N) cin >> A[i];
    sort(begin(A),end(A));

    if(N==2){
        cout << A[1]-A[0] << endl;
        return;
    }

    auto f=[&](i64 si, i64 sd) {
        i64 ans = 0, i = si, d = sd, l = 0, r = N - 1, cnt = 1;
        while (cnt < N) {
            if (d == 1) {
                ans += A[r] - A[i];
                i = r;
                --r;
                d = 0;
            } else {
                ans += A[i] - A[l];
                i = l;
                ++l;
                d = 1;
            }
            ++cnt;
        }
        return ans;
    };

    cout << (N%2==0?max({f(N/2,0),f(N/2-1,0),f(N/2,1),f(N/2-1,1)}):max(f(N/2,0),f(N/2,1))) << endl;
}

int main(){
    std::cin.tie(0);
    std::ios::sync_with_stdio(false);
    cout.setf(ios::fixed);
    cout.precision(16);
    solve();
    return 0;
}


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

using namespace std;

using ll = long long;

int main() {
   ios_base::sync_with_stdio(false);
   int N, MOD;
   cin >> N >> MOD;
   vector<vector<int>> dp(3 * N + 1, vector<int>(6 * N + 1, 0));
   dp[3 * N][3 * N] = 1;
   for (int i = 3 * N; i > 0; --i) {
      for (int j = 0; j <= 6 * N; ++j) {
         if (!dp[i][j]) continue;
         dp[i - 1][j + 1] += dp[i][j];
         if (dp[i - 1][j + 1] >= MOD) dp[i - 1][j + 1] -= MOD;
         if (i >= 2) dp[i - 2][j - 1] = (dp[i - 2][j - 1] + ll(dp[i][j]) * (i - 1)) % MOD;
         if (i >= 3) dp[i - 3][j] = (dp[i - 3][j] + ll(dp[i][j]) * (i - 1) * (i - 2)) % MOD;
      }
   }
   int ans = 0;
   for (int i = 3 * N; i <= 6 * N; ++i) {
      ans += dp[0][i];
      if (ans >= MOD) ans -= MOD;
   }
   cout << ans << "\n";
   return 0;
}


Measured memory_bytes: 281856
#include<stdio.h>

int main(){
  int n,tlong,alltime=0;
  int i,k=0,kiroku=0;
  scanf("%d %d",&n,&tlong);
  int time[n];
  for(i=0;i<n;i++)
    scanf("%d",&time[i]);
  
  for(i=0;i<n;i++){
    if(k==0){
      kiroku=i;
      k++;
    }
    if(time[i+1]-time[i]>tlong || i==n-1){
      alltime=alltime+time[i]-time[kiroku]+tlong;
      k=0;
    }
  }
  printf("%d",alltime);
}

Measured memory_bytes: 896
package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
	"strings"
)

func nextLine(sc *bufio.Scanner) string {
	sc.Scan()
	return sc.Text()
}

var fp *os.File

func input() *os.File {
	var err error
	fp, err = os.Open("input.txt")
	if err != nil {
		panic(err)
	}
	return fp
}

// main

func main() {

	//var sc = bufio.NewScanner(input())
	var sc = bufio.NewScanner(os.Stdin)

	var a, b, c int64
	var in = strings.Split(nextLine(sc), " ")
	a, _ = strconv.ParseInt(in[0], 10, 64)
	b, _ = strconv.ParseInt(in[1], 10, 64)
	c, _ = strconv.ParseInt(in[2], 10, 64)

	if a == (b+c) || b == (a+c) || c == (a+b) {
		fmt.Println("Yes")
	} else {
		fmt.Println("No")
	}
	defer fp.Close()

}


Measured memory_bytes: 640
n,y=map(int,input().split())
a,b,c=-1,-1,-1
f=0
for i in range(n+1):
    if f==1:
        break
    for j in range(n+1-i):
        if (i*10000 + j*5000 + (n-i-j)*1000) == y:
            a=i
            b=j
            c=n-i-j
            f=1
print(a,b,c)

Measured memory_bytes: 3064
package main

import (
	"bufio"
	"fmt"
	"math"
	"os"
	"reflect"
	"strconv"
)

const (
	maxBufSize = 1024 * 1024
)

var (
	sc = func() *bufio.Scanner {
		sc := bufio.NewScanner(os.Stdin)
		buf := make([]byte, 1)
		sc.Buffer(buf, maxBufSize)
		sc.Split(bufio.ScanWords)
		return sc
	}()
	out = bufio.NewWriter(os.Stdout)
)

func sqr2(x uint64) (uint64, bool) {
prevInc := false
 xn := uint64(math.Sqrt(float64(x)));
 for {
	if xn * xn ==  4 * x {
		return xn, false
	}
	if xn * xn < 4 * x {
		xn ++;
		prevInc = true
	}else {
		if prevInc {
			return xn - 1, true
		}
		xn --;
	}
 }
}

const yes = "Yes"
const no = "No"

func solve(a uint64, b uint64, c uint64) bool {
	sqrt_ab, _ := sqr2(a * b)
	left := a + b + sqrt_ab
	right := c
	return left < right
}

func main() {
	defer out.Flush()

	a := nextInt()
	b := nextInt()
	c := nextInt()
	if solve(uint64(a), uint64(b), uint64(c)) {
		fmt.Fprintln(out, yes)
	} else {
		fmt.Fprintln(out, no)
	}
}

func next() string {
	sc.Scan()
	return sc.Text()
}

func nextStringAsBytes() []byte {
	sc.Scan()
	return []byte(sc.Text())
}

func nextInt() int64 {
	a, _ := strconv.ParseInt(next(), 10, 64)
	return a
}

func nextFloat() float64 {
	a, _ := strconv.ParseFloat(next(), 64)
	return a
}

func nextInts(n int64) []int64 {
	ret := make([]int64, n)
	for i := int64(0); i < n; i++ {
		ret[i] = nextInt()
	}
	return ret
}

func nextFloats(n int64) []float64 {
	ret := make([]float64, n)
	for i := int64(0); i < n; i++ {
		ret[i] = nextFloat()
	}
	return ret
}
func nextStrings(n int64) []string {
	ret := make([]string, n)
	for i := int64(0); i < n; i++ {
		ret[i] = next()
	}
	return ret
}

func containStr(arr []string, target string) bool {
	for _, v := range arr {
		if v == target {
			return true
		}
	}
	return false
}

func PrintOut(src interface{}, joinner string) {
	switch reflect.TypeOf(src).Kind() {
	case reflect.Slice:
		s := reflect.ValueOf(src)
		for idx := 0; idx < s.Len(); idx++ {
			fmt.Fprintf(out, "%v", s.Index(idx))
			if idx < s.Len()-1 {
				fmt.Fprintf(out, "%s", joinner)
			} else {
				fmt.Fprintln(out)
			}
		}
	default:
		fmt.Fprintln(out, "orz")
	}
}

// mapからkeysとvaluesを返す
func splitKeyValue(m map[interface{}]interface{}) (keys, values []interface{}) {
	switch reflect.TypeOf(m).Kind() {
	case reflect.Map:
		s := reflect.ValueOf(m)
		for _, v := range s.MapKeys() {
			keys = append(keys, v)
			values = append(values, s.MapIndex(v))
		}
	default:
		fmt.Fprintln(out, "orz")
	}
	return
}


Measured memory_bytes: 640
#!/usr/bin/env python3
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10**8)
INF = float("inf")


def main():

    # def representable(S, v):
    #     # Sの基底を用いて、vを表現可能か
    #     for s in S:
    #         # sの最下位bitがvにあるなら、xorを加えていく
    #         if v & (s & (-s)):
    #             v ^= s
    #     return v == 0

    # def update(S, v):
    #     # リストSへvを追加する。
    #     for s in S:
    #         # 最下位bitが重複するなら、消しておく
    #         if v & (s & -s):
    #             v ^= s
    #     return S+[v]            # 計算コスト怪しい

    T = int(input())
    for t in range(T):
        N = int(input())
        A = list(map(int, input().split()))
        S = input()
        lose = False

        # 後ろから見ていく
        # 作成可能な数の集合をあらわす基底を保持していく
        X = []
        for i in reversed(range(N)):
            v = A[i]
            for x in X:
                if v & (x & -x):
                    v ^= x
            if v != 0:
                if S[i] == "0":
                    X.append(v)
                else:
                    lose = True
                    break
        if lose == True:
            print(1)
        else:
            print(0)

    return


if __name__ == '__main__':
    main()


Measured memory_bytes: 68112
#include <bits/stdc++.h>
#define fin freopen("input", "r", stdin);
#define fout freopen("output", "w", stdout);
#define wt(x) cerr << #x << ": " << x << " ";
#define whatis(x) {cerr << #x << ": " << x << endl;}
#define whatis2(x, y) {wt(x); wt(y); cerr << endl;}
#define whatis3(x, y, z) {wt(x); wt(y); wt(z); cerr << endl;}
#define whatis4(x, y, z, a) {wt(x); wt(y); wt(z); wt(a); cerr << endl;}
using namespace std;

typedef long long ll; typedef unsigned long long ull; typedef long double ld;
const ll MOD = 1000000007; const ld PI = acos(-1.0);

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL); cout.tie(NULL);

    int k;
    cin >> k;
    string s;
    cin >> s;
    int n = s.size();
    if (n <= k) {
        cout << s << endl;
    } else {
        for (int i = 0; i < k; ++i) cout << s[i];
        cout << "..." << endl;
    }


    return 0;
}


Measured memory_bytes: 3612
var input = require('fs').readFileSync('/dev/stdin', 'utf8');
var Arr=input.split("\n");

var A=Arr[1].split(" ").map(Number);
var N=Arr[0];

let cnt = 0;

for(let i = 0;i<N;i++){
    let j = i;
    while(j !== 0){
        if(A[j-1]>A[j]){
            let tmp = A[j-1];
            A[j-1] = A[j];
            A[j] = tmp;
            
            cnt++;
        }
        j--;
    }
}

console.log(A.join(" "));
console.log(cnt);


Measured memory_bytes: 15416
import java.util.Scanner;

public class Main {
	public static void main(String args[]) {
		Scanner sc = new Scanner(System.in);
		char[] words = {'a','i','u','e','o'};
		char a = sc.next().charAt(0);
		String answer = "consonant";
		for(int i=0; i<5; i++) {
			if(a == words[i]) {
				answer = "vowel";
				break;
			}
		}
		System.out.println(answer);
	}
}

Measured memory_bytes: 35604
import sys

def input(): return sys.stdin.readline()[:-1]
def ceil(x, y=1): return int(-(-x // y))
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def MATINT(h): return [list(map(int, input().split())) for _ in range(h)]
def MATSTR(h): return [input() for _ in range(h)]
def Yes(): print('Yes')
def No(): print('No')
def YES(): print('YES')
def NO(): print('NO')
sys.setrecursionlimit(10 ** 9)
inf = float('inf')
mod = 10 ** 9 + 7
from collections import Counter

def main():
    N = INT()
    S = []
    for _ in range(N):
        tmp = Counter(input())
        S_tmp = ''
        for i in sorted(tmp.keys()):
            S_tmp += i + str(tmp[i])
        S.append(S_tmp)
    # alpha2num = lambda c: ord(c) - ord('a')
    count = Counter(S)
    ans = 0
    for i in count.values():
        if i > 1:
            ans += i * (i - 1) / 2
    print(int(ans))

if __name__ == '__main__':
    main()


Measured memory_bytes: 71128
#include <iostream>
#include <cstdio>
#include <cmath>
#include <string>
using namespace std;
#define ll long long int
#define abs(n) ((n>0)?(n):((n)*(-1)))

int map753[] = {-1,-1,-1,0,-1,1,-1,2};
int cnt=0;

void get753(ll crit,ll base,int restDepth){
	if(base > crit) return;
	if(restDepth==0){
		string s = to_string(base);
		int l = s.length();
		bool have753[] = {false,false,false};
		for (int i = 0; i < l; ++i) {
			have753[map753[s[i]-'0']]=true;
		}
		if(have753[0]&&have753[1]&&have753[2]){
//			cerr << s << endl;
			cnt++;
		}
	}else{
		get753(crit,base*10+3,restDepth-1);
		get753(crit,base*10+5,restDepth-1);
		get753(crit,base*10+7,restDepth-1);
	}
	return;
}


int main(int argc, const char * argv[]) {
	ll N;
	cin >> N;
	int len = to_string(N).length();
	if(len==10) len=9;
	for (int i = 3; i <= len; ++i) {
		get753(N,0,i);
	}
	cout << cnt<< endl;
}


Measured memory_bytes: 256
#include<stdio.h>
#include<stdlib.h>
#define N NULL

struct node{
  struct node *r;
  struct node *l;
  struct node *p;
  int key;
};
typedef struct node * Node;

Node root;
void insert(int);
void inorder(Node );
void preorder(Node );

int main(){
  int s, i, x;
  char c[10];

  scanf("%d", &s);

  for ( i = 0; i < s; i++ ){
    scanf("%s", c);
    if ( c[0] == 'i' ){
      scanf("%d", &x);
      insert(x);
    } 
    if ( c[0] == 'p' ){
      inorder(root);
      printf("\n");
      preorder(root);
      printf("\n");
    } 
  }
  return 0;
}

void insert(int k){
  Node y = N;
  Node x = root;
  Node z;

  z = malloc(sizeof(struct node));
  z->key = k;
  z->l = N;
  z->r = N;
 
  while(x != N){
    y = x;
    if(z->key < x->key) x = x->l;
    else x = x->r;
  }

  z->p = y;
  if(y == N) root = z;
  else if(z->key < y->key) y->l = z;
  else y->r = z;
}

void inorder(Node u){
  if(u != N){
    inorder(u->l);
    printf(" %d",u->key);
    inorder(u -> r);
  }
}
void preorder(Node u){
  if(u != N){
    printf(" %d",u->key);
    preorder(u->l);
    preorder(u->r);
  }
}

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

int main()
{
    int n;
    int d[110];
    int num[110] = {0};

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

    for (int i = 0; i < n; i++) {
        num[d[i]]++;
    }

    int ans = 0;
    for (int i = 1; i <= 100; i++) {
        if (num[i]) {
            ans++;
        }
    }
    cout << ans << endl;
}

Measured memory_bytes: 3192
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;

class MaxFlow{
public:
  struct edge{ll to, rev, cap;};

  const ll INF = 4e18;
  static const ll MAX_V = 10000;

  vector<edge> G[MAX_V];
  bool used[MAX_V] = {};
  void add_edge(int frm, int to, ll cap) {
    G[frm].push_back((edge){to, G[to].size(), cap});
    G[to].push_back((edge){frm, G[frm].size() - 1, 0});
  }
  ll dfs(int frm, int to, ll flow) {
    if (frm == to) return flow;
    used[frm] = 1;
    for (int i = 0; i < G[frm].size(); i++) {
      edge &e = G[frm][i];
      if (!used[e.to] && e.cap > 0) {
        int d = dfs(e.to, to, min(flow, e.cap));
        if (d > 0) {
          e.cap -= d;
          G[e.to][e.rev].cap += d;
          return d;
        }
      }
    }
    return 0;
  }
  ll maxflow(int s, int t) {
    ll flow = 0;
    while (1) {
      memset(used, 0, sizeof(used));
      ll f = dfs(s, t, INF);
      if (f == 0) return flow;
      flow += f;
    }
  }
};


int main() {
    MaxFlow mf;
    int n;
    cin >> n;
    int s = 0, t = n+1;
    ll a[110];
    ll ans = 0;
    for (int i = 1; i <= n; i++) {
        cin >> a[i];
        if (a[i] > 0) ans += a[i];
    }
    for (int i = 1; i <= n; i++) {
        if (a[i] <= 0) mf.add_edge(s,i,-a[i]);
        else mf.add_edge(i,t,a[i]);
        for (int j = i + i; j <= n; j += i) {
            mf.add_edge(i,j,mf.INF);
        }
    }
    ans -= mf.maxflow(s,t);
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 512
M = int( input() )
if 599 >= M and M >= 400:
    print("8")
if 799 >= M and M >= 600:
    print("7")
if 999 >= M and M >= 800:
    print("6")
if 1199 >= M and M >= 1000:
    print("5")
if 1399 >= M and M >= 1200:
    print("4")
if 1599 >= M and M >= 1400:
    print("3")
if 1799 >= M and M >= 1600:
    print("2")
if 1999 >= M and M >= 1800:
    print("1")

Measured memory_bytes: 61880
#include <bits/stdc++.h>
#define pi 3.14159
using namespace std;

int main()
 {
 	int n,m;
 	cin>>n;
 	if(n%2==0)
 		m=n/2;
 	else
 		m=n/2+1;
 	cout<<m<<endl;
 	return 0;
}
 	
 					

Measured memory_bytes: 3588
#include <iostream>
#include <map>
#define For(i,x,y) for(register int i=(x); i<=(y); i++)
using namespace std;
map<int,int>vis;
int main()
{
    ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
    int n,x,temp;
    cin>>x>>n;
    For(i,1,n)
    {
        cin>>temp;
        vis[temp]=1;
    }
    int ans=0,i=x,j=x;
    while(1)
    {
        if(vis[i])i--;
        else
        {
            ans=i;
            break;
        }
        if(vis[j])j++;
        else
        {
            ans=j;
            break;
        }
    }
    cout<<ans<<endl;
    return 0;
}


Measured memory_bytes: 3644
// inputに入力データ全体が入る
function Main(input) {
  var a, s;
  a = Number(input.split('\n')[0]);
  s = input.split('\n')[1];
  
  if(a >= 3200){
    console.log(s);
  }else{
    console.log('red');
  }
  
}
//*この行以降は編集しないでください（標準入出力から一度に読み込み、Mainを呼び出します）
Main(require("fs").readFileSync("/dev/stdin", "utf8"));


Measured memory_bytes: 7496
#include <iostream>
#include <fstream>
#include <string>
#include <cmath>
#include <cstdio>
#include <algorithm>
#include <iomanip>
#include <vector>
#include <utility>
#include <numeric>
#include <stack>
#include <queue>
#include <map>
#include <unordered_map>
#include <limits.h>
using namespace std;
using P = pair<int, int>;
using ll = long long;
using prique = priority_queue<int>;
const int MOD = 1000000007;
char s[2000][2000];
int cnth[2000][2000];
int cntw[2000][2000];
int cntall[2000][2000];
signed main(){
	int h,w;
	cin>>h>>w;
	for(int i=0;i<h;i++){
		for(int j=0;j<w;j++){
			cin>>s[i][j];
		}
	}
	int cnt=0;
	for(int i=0;i<h;i++){
		for(int j=0;j<w;j++){
			if(s[i][j]=='#')cnt=0;
			else cnt++;
			cnth[i][j]=cnt;
		}
		cnt=0;
	}
	for(int i=0;i<h;i++){
		for(int j=w-1;j>=0;j--){
			if(s[i][j]=='#')cnth[i][j]=0;
			else if(j<w-1)cnth[i][j]=max(cnth[i][j+1],cnth[i][j]);
		}
	}
	cnt=0;
	for(int i=0;i<w;i++){
		for(int j=0;j<h;j++){
			if(s[j][i]=='#')cnt=0;
			else cnt++;
			cntw[j][i]=cnt;
		}
		cnt=0;
	}
	for(int i=0;i<w;i++){
		for(int j=h-1;j>=0;j--){
			if(s[j][i]=='#')cntw[j][i]=0;
			else if(j<h-1)cntw[j][i]=max(cntw[j+1][i],cntw[j][i]);
		}
	}
	
	int ans=0;
	for(int i=0;i<h;i++){
		for(int j=0;j<w;j++){
			cntall[i][j]=cnth[i][j]+cntw[i][j]-1;
			ans=max(ans,cntall[i][j]);
		}
	}
	cout<<ans<<endl;
	return 0;
}



Measured memory_bytes: 51072
#include<bits/stdc++.h>
using namespace std;
#define FOR(i,l,r) for(long long i=(l);i<(r);++i)
#define REP(i,n) FOR(i,0,n)
#define int long long
const int MOD=1e9+7;
const int INF=1e15;

signed main(){
    string S,T;cin>>S>>T;
    bool ok=false;
    REP(i,S.size()+1){
        if(S==T){
            ok=true;
            break;
        }
        S=S[S.size()-1]+S;
        S=S.substr(0,S.size()-1);
    }
    if(ok)cout<<"Yes"<<endl;
    else cout<<"No"<<endl;
}

Measured memory_bytes: 256
#pragma GCC optimize("Ofast",3,"inline")
#include<bits/stdc++.h>
using namespace std;
#define fir first
#define sec second
#define m_p make_pair
#define y1 ygftgfgcdtfgxffgx
#define y2 yfdsesgvtyghftfvv
#define x1 xvyr6cf6fgcfgf676
#define x2 xcr6rfc5r66y6r6fr
#define up_bound upper_bound
#define low_bound lower_bound
#define next_per next_permutation
#define pb push_back
#define i_to_s to_string
typedef priority_queue<int> p_queue;
typedef priority_queue<int, vector<int>, greater<int> > min_p_queue;
typedef long long ll;
typedef long double ld;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
int mon[20]={31,28,31,30,31,30,31,31,30,31,30,31};
ll gcd(ll x,ll y){return ((y==0)?x:gcd(y,x%y));}
int m,n;
int a,b,c;
int maxx=-1;
int main(){
	ios_base::sync_with_stdio(false);
	cin.tie(0);
//	freopen(".in","r",stdin);
//	freopen(".out","w",stdout);
	cin>>m>>n;cin>>c;a=c;
	for(int i=1;i<n;i++){
		b=a;
		cin>>a;
		maxx=max(maxx,a-b);
	}
	maxx=max(maxx,c+m-a);
	cout<<m-maxx;
	return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <memory>
#include <memory.h>
#include <cmath>
#include <fstream>
#include <cmath>
#include <numeric>
#include <vector>
#include <stack>
#include <string>
#include <queue>
#include <sstream>
#include <cstdlib>
#include <cassert>
#include <cstdio>
#include <map>
#include <iomanip>
#include <list>
#include <cctype>
#include <algorithm>
#include <complex>
#define USE_MATH_DEFINES
using namespace std;

typedef complex<double> xy_t;
typedef pair<xy_t, xy_t> line;
typedef long long ll;
typedef pair<int, int> P;
typedef pair<int, P> PP;
typedef pair<int, PP> PPP;
const int INF = 1 << 29;
const double EPS = 1E-10;

namespace std{
	bool operator < (const xy_t &a, const xy_t &b){
		return real(a) != real(b) ? real(a) < real(b) : imag(a) < imag(b);
	}
}

double cross(const xy_t &a, const xy_t &b){
	return imag(conj(a) * b);
}

double dot(const xy_t &a, const xy_t &b){
	return real(conj(a)*b);
}

int ccw(xy_t a, xy_t b, xy_t c){
	b -= a; c -= a;
	if(cross(b, c) > 0) return 1;
	if(cross(b, c) < 0) return -1;
	if(dot(b, c) < 0) return +2;
	if(norm(b) < norm(c) ) return -2;
	return 0;
}

bool intersectSS(const line &s, const line &t){
	return ccw(s.first, s.second, t.first) * ccw(s.first, s.second, t.second) <= 0 &&
		ccw(t.first, t.second, s.first) * ccw(t.first, t.second, s.second) <= 0;
}

xy_t crosspoint(const line &l, const line &m){
	double a = cross(l.second - l.first, m.second - m.first);
	double b = cross(l.second - l.first, l.second - m.first);
	if(abs(a) < EPS && abs(b) < EPS) return m.first;
	if(abs(a) < EPS) assert(false);
	return m.first + b / a * (m.second - m.first);
}

typedef pair<double, string> data;
data dat[200];
bool comp(const data &d1, const data &d2){
	return abs(d1.first - d2.first) > EPS ? d1.first < d2.first : d1.second  > d2.second;
}

int main(){
	int n;
	while(cin >> n && n){
		for(int i = 0; i < n; i++){
			string l;
			int  p, a, b, c, d, e, f, s, m;
			cin >> l >> p >> a >> b >> c >> d >> e >> f >> s >> m;
			double incom = f * s * m - p;
			int t = a + b + c + (d + e) * m;
			dat[i] = data(incom / t, l);
		}
		sort(dat, dat + n, comp);
		for(int i = n - 1; i >= 0; i--) cout << dat[i].second <<  endl;
		cout << "#" << endl;
	}

	return 0;
}

Measured memory_bytes: 0
#include <bits/stdc++.h>
using namespace std;
#define REP(i, m, n) for(int i = m; i < n; i++)
#define rep(i, n) REP(i, 0, n)
#define ALL(a) (a).begin(), (a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define dup(x, y) (((x) + (y)-1) / (y))
#define PI 3.14159265359
typedef long long LL;
typedef vector<vector<int>> Graph;
typedef vector<int> Vector;
const LL MOD = 1e9 + 7;
const LL LLINF = 1LL << 60;
const int INF = 1 << 30;
template <class T> inline void chmax(T &a, T b) {
    if(a < b) {
        a = b;
    }
}
template <class T> inline void chmin(T &a, T b) {
    if(a > b) {
        a = b;
    }
}
template <class T> inline T gcd(T x, T y) {
    if(y == 0) {
        return x;
    } else if(x == 0) {
        return y;
    }
    return gcd(y, x % y);
}
template <class T> inline T lcm(T x, T y) { return (x * y) / gcd(x, y); }
template <class T> inline void print_vector(vector<T> vec) {
    for(int i = 0; i < vec.size(); i++) {
        cout << vec[i] << " ";
    }
    cout << endl;
}
template <class T> inline T mpower(T x, T n) {
    if(n == 0) {
        return 1;
    } else if(n % 2 == 0) {
        return mpower(x * x % MOD, n / 2);
    } else {
        return x * mpower(x, n - 1) % MOD;
    }
}
LL mfrac(LL x) {
    LL res = 1;
    for(LL i = x; i >= 1; i--) {
        res *= i;
        res %= MOD;
    }
    return res;
}
LL mcomb(LL n, LL r) {

    if(n == 0 and r == 0) {
        return 1;
    } else if(n < r || n < 0) {
        return 0;
    }

    LL res = mfrac(n) * mpower(mfrac(r), MOD - 2) % MOD;
    res *= mpower(mfrac(n - r), MOD - 2) % MOD;

    return res;
}

const double TAX_RATE = 1.08;

int main(void) {
    int N;
    cin >> N;
    
    int X_1 = int(N / TAX_RATE);
    int X_2 = int(N / TAX_RATE) + 1;
    int price_1 = X_1 * TAX_RATE;
    int price_2 = X_2 * TAX_RATE;

    if(N == price_1) {
        cout << X_1 << endl;
    }else if(N == price_2){
        cout << X_2 << endl;
    }else{
        cout << ":(" << endl;
    }
    return 0;
}


Measured memory_bytes: 256
#include <iostream>
using namespace std;
typedef long long ll;
int main(){
    int n;
    cin >> n;
    int a[n+1];
    a[0]=0;
    for (int i=1; i<=n; i++){
        cin >> a[i];
    }
    ll ans=0;
    for (int i=1; i<=n; i++){
        if ((a[i-1]+a[i])%2==0){
            ans+=(a[i-1]+a[i])/2;
            a[i]=0;
        }else if (a[i]!=0){
            ans+=(a[i-1]+a[i]-1)/2;
            a[i]=1;
        }else {
            continue;
        }
    }
    cout << ans;
}
     


Measured memory_bytes: 640