akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>

#include <iostream>
//#include <algorithm>
// #include <iomanip>
#define ll long long
#define map unordered_map
#define set unordered_set
#define pll pair<ll, ll>
#define vll vector<ll>
#define mll map<ll, ll>

using namespace std;

const ll MOD = 1000000007LL;
const ll INF = (1LL << 60LL);

int main() {
  ll N;
  scanf("%lld", &N);

  ll ans = -1;

  for (ll i = 0; i <= 1000000; i++) {
    ll p = i + (i * 8) / 100;

    if (p == N) {
      ans = i;
      break;
    }
  }

  if (ans == -1) {
    cout << ":(" << endl;
  } else {
    cout << ans << endl;
  }
}


Measured memory_bytes: 256
x, y = map(int, input().split())
A=[1, 3, 5, 7, 8, 10, 12]
B=[4, 6, 9, 11]
C=[2]
if (x in A and y in A) or (x in B and y in B) or (x in C and y in C):
    print("Yes")
else:
    print("No")

Measured memory_bytes: 3064
#include <bits/stdc++.h>
#define REP(i, n) for (int i = 0; i < n; i++)
#define REPR(i, n) for (int i = n; i >= 0; i--)
#define FOR(i, m, n) for (int i = m; i < n; i++)
#define FORR(i, m, n) for (int i = m; i >= n; i--)
#define INF 1e9;
using namespace std;
typedef long long ll;
int main() {
  int N;
  cin >> N;
  double sum = 0;
  REP(i, N) {
    double x;
    string u;

    cin >> x >> u;

    sum += (u == "JPY" ? x : 380000.0 * x);
  }
  cout << sum;
  return 0;
}

Measured memory_bytes: 256
#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;
long double pi = acos(-1);
const int INF = 1001001001;
const int N_MAX = 100001;
const int modint = 1000000007;

// 最小公倍数を求める
int euqlid (int a, int b){
  int temp;
  temp = a % b;
  if(temp == 0)return b;
  return euqlid(b,temp);
}
ll conbination(ll a,ll b){
  ll u = 1;
  ll d = 1;
  while(b != 0){
    u *= a;
    d *= b;
    a--;
    b--;
  }
  return u / d;
}
int strtoint(char s){
  return (int(s-'0'));
}
char changeS(char alpha){
  if(0x41 <= alpha and alpha <= 0x5A)return (alpha + 0x20);
  else if(0x61 <= alpha and alpha <= 0x7A)return (alpha - 0x20);
  return alpha;
}
int fact(int n){
  if(n == 1)return 1;
  return n * fact(n-1);
  }
int ceil(int a,int b){
  // a/bの切り上げを考える
  return (a+b-1)/b;
}

int main(){
  int n;
  while(true){
    cin >> n;
    if(n == 0)break;
    int dp[n];
    memset(dp, 0, sizeof(dp));

    dp[0] = 1;
    dp[1] = 2;
    dp[2] = 4;
    rep(i,n-3){
      dp[i+3] = dp[i+2] + dp[i+1] + dp[i];
    }
    cout << ceil(ceil(dp[n-1],10), 365) << endl;
  }
}


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

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

inline void Main() {
  // code
  int k,x,l=0;
  cin>>k>>x;

  repi(i, x-k+1, k+x) {
    if(!(-1000000<=i && i<=1000000)) continue;
    if(l++) cout << ' ';
    cout << i;
  }
  cout << endl;
}

int main() {
  std::cin.tie(0);
  std::ios::sync_with_stdio(false);
  std::cout << std::fixed << std::setprecision(20);
  Main();
  return 0;
}


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

string s;

ll func(int pos, ll t, ll sum){
    if(pos == s.length()-1) {        
        return (int) s[pos] - '0' + sum + t;
    } 
    return func(pos+1, 0, sum + t + (int)s[pos] - '0')  + func(pos+1, (t + (int) s[pos] - '0') * 10, sum);
}

int main() {
    cin >> s;
    cout << func(0, 0, 0) << endl;    
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef long long int lli;
typedef unsigned long long int ulli;
const lli INF = 1e9 + 100;
const lli INF64 = (1LL << 61) + 100;
const lli MOD = 1e9 + 7;
const lli MH1 = 1599614977, MH2 = 2034417103, MH3 = 1090250123, MH4 = 2024491871; 
const int N = 3005;
long double nums[N];
long double dp[N][N];
lli bpow(lli baseee, lli exponenttt) {
	if(exponenttt < 0) return 0;
	lli res = 1;
	baseee %= MOD;
	while (exponenttt > 0) {
		if ((exponenttt & 1) == 1) res = (res*baseee) % MOD;
		baseee = (baseee*baseee) % MOD;
		exponenttt >>= 1;
	}
	return res;
}
lli multInverse(lli a) {//if_mod_is_prime
	return bpow(a, MOD - 2);
}
lli divm(lli a, lli b) {//if_mod_is_prime
	return (a * multInverse(b)) % MOD;
}
lli multm(lli a, lli b) {
	return (a * b) % MOD;
}
lli subm(lli a, lli b) {
	a += MOD;
	lli r = a - b;
	if(r >= MOD) return r - MOD;
	return r;
}
lli addm(lli a, lli b) {
	lli r = a + b;
	if(r >= MOD) return r - MOD;
	return r;
}
signed main() {
	ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
	cout << setprecision(20) << fixed;
	//	freopen("input.txt", "r", stdin);
	//	freopen("output.txt", "w", stdout);
	int n;
	cin >> n;
	for(int i = 1; i <= n; i++) cin >> nums[i];
	
	dp[1][1] = nums[1];
	dp[1][0] = 1 - nums[1];
	for(int i = 2; i <= n; i++) {
		dp[i][0] = dp[i-1][0] * (1 - nums[i]);
		for(int j = 1; j <= i; j++)
			dp[i][j] = (dp[i-1][j-1] * nums[i]) + (dp[i-1][j] * (1 - nums[i]));
	}
	long double ans = 0;
	for(int j = n; 2*j > n; j--)
		ans += dp[n][j];
	cout << ans << "\n";
	return 0;
}

Measured memory_bytes: 139392
l,r,d=list(map(int,input().split()))
if l>r: l,r = r,l
k=(r-l+1)//d
x=(r-l+1)%d
if x:
    if l%d==0 or (l+x-1)%d==0:
        k+=1
    else:k+=-(l//d)+(l+x-1)//d
print(k)

Measured memory_bytes: 61796
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < n; i++)
using namespace std;
using ll = long long;
int INF = 1000000009;
int main()
{
  int k;
  cin >> k;
  ll ans = 0;
  for (int a = 1; a <= k; a++)
  {
    for (int b = 1; b <= k;b++){
      for (int c = 1; c <= k;c++){
        ans += __gcd(a, __gcd(b, c));
      }
    }
  }
  cout << ans << endl;
}

Measured memory_bytes: 3624
import java.util.Scanner;
import java.util.Arrays;
import java.lang.Math;
import java.util.ArrayList;

  
public class Main {
	static class Key {
        public int cost;
        public int state;
      }
  
  	void run() {
     
    }

    public static void main(String[] args) {
     // new Main().run();
       
      Scanner scanner = new Scanner(System.in);
      int n = scanner.nextInt();
      int m = scanner.nextInt();
      int[] results = new int[1 << n];
      Arrays.fill(results, 0x35f5e100);
      
      ArrayList<Key> keys = new ArrayList<Key>(m);
      //Key[] keys = new Key[m];
      for (int i = 0; i < m; i++) {
        Key k = new Key();
        k.cost= scanner.nextInt();
        int num = scanner.nextInt();
        int sum = 0;
        while (num > 0) {
          	sum |= 1 << (scanner.nextInt() - 1);
        	num--;
        }
        k.state = sum;
        results[sum] = k.cost;
        keys.add(k);
      }
      
      results[0] = 0;
	  for (int i = 0; i < results.length; i++) {
        for (int j = 0; j < m; j++) {
          results[i | keys.get(j).state] = 
            Math.min(results[i | keys.get(j).state], results[i] + keys.get(j).cost);
        }
        //System.out.println(results[i]);
      }
      
      if (results[results.length - 1] == 0x35f5e100)
        System.out.println("-1");
      else
        System.out.println(results[results.length - 1]);
    }
  
}


Measured memory_bytes: 37124
n=int(input())
s=input()
W=[0]*n
E=[0]*n
W[0]=1 if s[0]=="W" else 0
for i in range(n-1):
  W[i+1]=W[i]+ (1 if s[i+1]=="W" else 0)
  E[i+1]=(i+2)-W[i+1]
ans=E[-1]-E[0]
for i in range(1,n):
  ans=min(ans,(W[i-1]+E[-1]-E[i]))
print(ans)

Measured memory_bytes: 27128
let s = stdin.ReadLine() 
let n = s.Length

let f x =if (x%2=0 && s.[x-1]<>'R') || (x%2=1 && s.[x-1]<>'L') then 0 else 1


[1..n]
|>List.sumBy f
|>fun x -> if x>0 then "No" else "Yes" 
|>stdout.WriteLine

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

int main(){
	ll n,X;
	cin >> n >> X;
	vector<ll> x(n);
	rep(i,n) cin >> x[i];
	sort(x.begin(),x.end());
	ll g = 0;
	REP(i,n-1){
		g = __gcd(g, x[i] - x[i-1]);
	}
	ll ans = 0;
	ll temp = g;
	rep(i,n){
		g = temp;
		ll temp = abs(X-x[i]);
		g = __gcd(g, temp);
		ans = max(ans, g);
	}
	cout << ans << endl;
    return 0;
}



Measured memory_bytes: 1024
#include <cstdio>
#include <iostream>
#include <algorithm>
#include <deque>
#include <vector>
#include <set>
#include <string>
#include <queue>
#include <map>
#include <cmath>

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

using namespace std;

int main(){
	int H, W;
	char C[101][101];

	cin >> H >> W;
	for(int i = 0; i < H; i++){
		for(int k = 0; k < W; k++){
			cin >> C[i][k];
		}
	}
	for(int i = 0; i < H * 2; i++){
		for(int k = 0; k < W; k++){
			cout << C[i/2][k];
		}
		cout << endl;
	}
	return 0;
}


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

int main () {
  char x,y;
  cin >> x >> y;
  int a=x-55,b=y-55;

  if (x<y) cout << "<" << endl;
  else if (x>y) cout << ">" << endl;
  else cout << "=" << endl;

  return 0;
}


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

int main() {
    int n, ans=0;
    int l[110];
    cin >> n;
    rep(i,n){
        cin >> l[i];
    }
    for(int i=0;i<n;i++){
        for(int j=i+1;j<n;j++){
            for(int k=j+1;k<n;k++){
                int a = l[i], b = l[j], c = l[k];
                if(a+b > c && b+c > a && c+a > b && a != b && b != c && a != c)ans++;
            }
        }
    }
    cout << ans <<endl;
    return 0;
}

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

int main() {
    int n;
    cin >> n;
    vector<int> t(n + 1), x(n + 1), y(n + 1);
    for (int i = 1; i <= n; ++i) {
        cin >> t[i] >> x[i] >> y[i];
    }
    for (int j = 1; j <= n; ++j) {
        int dist = abs(x[j] - x[j - 1]) + abs(y[j] - y[j - 1]);
        int time = t[j] - t[j - 1];
        if (dist > time) {
            cout << "No" << endl;
            return 0;
        }
        if (time % 2 != dist % 2) {
            cout << "No" << endl;
            return 0;
        }
    }
    cout << "Yes" << endl;
}


Measured memory_bytes: 1408
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int A, B, C, D, E;
  cin >> A >> B >> C >> D >> E;
  
  if(A == 0){
    cout << 1 << endl;
  }
  
  else if(B == 0){
    cout << 2 << endl;
  }
  
  else if(C == 0){
    cout << 3 << endl;
  }
  
  else if(D == 0){
    cout << 4 << endl;
  }
  
  else if(E == 0){
    cout << 5 << endl;
  }
  
}

Measured memory_bytes: 3568
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.io.UncheckedIOException;
import java.util.StringTokenizer;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author mikit
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        LightScanner in = new LightScanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        AMoveAndWin solver = new AMoveAndWin();
        solver.solve(1, in, out);
        out.close();
    }

    static class AMoveAndWin {
        public void solve(int testNumber, LightScanner in, PrintWriter out) {
            int n = in.ints(), a = in.ints(), b = in.ints();
            if ((b - a) % 2 == 0) {
                out.println("Alice");
            } else {
                out.println("Borys");
            }
        }

    }

    static class LightScanner {
        private BufferedReader reader = null;
        private StringTokenizer tokenizer = null;

        public LightScanner(InputStream in) {
            reader = new BufferedReader(new InputStreamReader(in));
        }

        public String string() {
            if (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new UncheckedIOException(e);
                }
            }
            return tokenizer.nextToken();
        }

        public int ints() {
            return Integer.parseInt(string());
        }

    }
}



Measured memory_bytes: 23124
#include <bits/stdc++.h>
using namespace std;
int main(){
  int N;
  cin >> N;
  vector<int> vec(N);
  
  for(int i = 0; i < N; ++i){
    cin >> vec.at(i);
    vec.at(i)--;
  }
  int k = 0;
  for(int i = 1; i < N; ++i){
    k = vec.at(k);
    if (k == 1){
      cout << i << endl;
      return 0;
    }
  }
  cout << -1 << endl;
}


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

#define rep(i, n) for(int i = 0; i < (int)(n); i++)
typedef long long ll;
ll max(ll a, ll b){ 
	if(a >= b) return a;
	else if(a < b) return b;
}

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

int main(){
	ll w, a, b;
	cin >> w >> a >> b;
	if(a >= b)swap(a, b);
	ll ans = (a + w >= b)? ans = 0: b - (a + w);
	cout << ans << endl;
}

Measured memory_bytes: 256
import java.util.Arrays;
import java.util.Scanner;

public class Main{
	public static void main(String[]args) {
		
		Scanner sc=new Scanner(System.in);
		
		int N=sc.nextInt();
		int[] A=new int[N];
		int[] B=new int[N];
		
		for(int i=0;i<N;i++) {
			A[i]=sc.nextInt();
			B[i]=A[i];
		}
		
		Arrays.sort(A);
		
		for(int i=0;i<N;i++) {
			 
			if(A[N-1]==B[i]) {
				System.out.println(A[N-2]);
			}else {
				System.out.println(A[N-1]);
			}
			
		}
		
		sc.close();
	}
}

Measured memory_bytes: 91840
#include <bits/stdc++.h>
using namespace std;
#define int long long
typedef pair<int,int> P;
int INF = 1e9+7;
int mod = 1e9+7;
int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};
int mod_pow(int x,int y) {
    int res = 1;
    while(y > 0) {
        if(y%2) {
            res = res*x%INF;
        }
        x = x*x%INF;
        y/=2;
    }
    return res;
}
signed main() {
    int N;
    cin >> N;
    vector<int>A(N);
    map<int,int>Mp;
    for(int i = 0; i < N; i++) {
        cin >> A[i];
        Mp[A[i]]++;
    }
    if(N%2 == 0) {
        // o o o o o o
        // 5 3 1 1 3 5
        for(int i = 1; i < N; i+=2) {
            if(Mp[i] != 2) {
                cout << 0 << endl;
                return 0;
            }
        }
        cout << mod_pow(2,N/2) << endl;
    }
    else {
        // o o o o o
        // 4 2 0 2 4
        for(int i = 0; i < N; i+=2) {
            if(i == 0) {
                if(Mp[i] != 1) {
                    cout << 0 << endl;
                    return 0;
                }
            }
            else if(Mp[i] != 2) {
                cout << 0 << endl;
                return 0;
            }
        }
        cout << mod_pow(2,(N-1)/2)%INF << endl;
    }
}

Measured memory_bytes: 7996
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i,n) for(ll i=0;i<(int)n;i++)
#define rep2(i,l,r) for(ll i=l;i<(int)r;i++)


int main(){
  ll n;cin >> n;
  rep2(i,1,3501)rep2(j,1,3501){
    if((4*i*j-n*(i+j))<=0)continue;
    if(n*i*j%(4*i*j-n*(i+j))==0){
      printf("%lld %lld %lld\n",i,j,n*i*j/(4*i*j-n*(i+j)));
      return 0;
    }
  }
  cout << fixed << setprecision(10);
  
}

Measured memory_bytes: 3728
#include <iostream>
#include <set>
#include <utility>
using namespace std;

typedef pair<int, int> pii;

int main(void) {

    int A, B, C; cin >> A >> B >> C;
    int cnt = 0;
    set<pii> AB;
    while (1) {
        if (A%2 != 0 || B%2 != 0 || C%2 != 0) break;
        pii p = pii(A,B);
        if (AB.find(p) != AB.end()) {
            cnt = -1;
            break;
        }

        int ta, tb, tc;
        AB.insert(pii(A,B));
        ta = B/2 + C/2;
        tb = C/2 + A/2;
        tc = A/2 + B/2;

        A = ta;
        B = tb;
        C = tc;
        cnt++;
    }

    cout << cnt << endl;

    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define sp ' '
#define nyan "(=^・ω・^=)"
#define mkp make_pair
#define intmax 2147483647
#define llmax 9223372036854775807
#define lP pair<ll,ll>
#define iP pair<int,int>
typedef long long ll;
using namespace std;
const int mod = 1000000007, mod998 = 998244353;

int A, B;

int main() {
	cin >> A >> B;
	if (A*B % 2 == 0) {
		cout << "No" << endl;
	}
	else {
		cout << "Yes" << endl;
	}
	return 0;
}

Measured memory_bytes: 256
#include<stdio.h>
#include<stdlib.h>
#include<string.h>

int time(int n, int N, int *C, int *S, int *F) {
	int i;
	int time;

	time = 0;
	for(i = n; i < N - 1; i += 1) {
		if(time <= S[i]) {//次の電車をを待つ
			time = S[i];
		} else {
			time += (F[i] - ((time - S[i]) % F[i])) % F[i];
		}
		time += C[i];//次の駅までの時間
	}
	return time;
}

int main(void) {
	int i;
	int N;
	int *C, *S, *F;
	char buf[128], *ch;

	fgets(buf, sizeof(buf), stdin);
	ch = strtok(buf, " ");
	N = atoi(ch);

	C = (int *)calloc(N - 1, sizeof(int));
	S = (int *)calloc(N - 1, sizeof(int));
	F = (int *)calloc(N - 1, sizeof(int));

	for(i = 0; i < N - 1; i+= 1) {
		fgets(buf, sizeof(buf), stdin);
		ch = strtok(buf, " ");
		C[i] = atoi(ch);
		ch = strtok(NULL, " ");
		S[i] = atoi(ch);
		ch = strtok(NULL, " ");
		F[i] = atoi(ch);
	}
	for(i = 0; i < N; i+= 1) {
		printf("%d\n", time(i, N, C, S, F));
	}

	free(C);
	free(S);
	free(F);
	return 0;
}


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

signed main(){

  int q;
  cin>>q;
  multiset<int> s;
  while(q--){
    int c,x;
    cin>>c>>x;
    if(c==0){
      s.insert(x);
      cout<< s.size() <<endl;
    }
    else if(c==1){
      cout<< s.count(x) <<endl;
    }
    else if(c==2){
      s.erase(x);
    }
    else if(c==3){
      int y;
      cin>>y;
      auto itr = s.lower_bound(x);
      auto end = s.upper_bound(y);
      while(itr!=end){
        cout<<*itr<<endl;
        itr++;
      }
    }
  }

}


Measured memory_bytes: 12332
from sys import stdout
printn = lambda x: stdout.write(x)
inn = lambda : int(input())
inl   = lambda: list(map(int, input().split()))
inm   = lambda:      map(int, input().split())
DBG = True # and False
BIG = 999999999
R = 10**9 + 7

def ddprint(x):
  if DBG:
    print(x)

m1,d1 = inm()
m2,d2 = inm()
print(1 if m2>m1 else 0)


Measured memory_bytes: 38384
/*
PROG: apc001c
LANG: C++11
    _____
  .'     '.
 /  0   0  \
|     ^     |
|  \     /  |
 \  '---'  /
  '._____.'
 */
#include <bits/stdc++.h>

using namespace std;

long long readi()
{
	long long input = 0;
	bool negative = false;
	char c = ' ';
	while (c < '-')
	{
		c = getchar();
	}
	if (c == '-')
	{
		negative = true;
		c = getchar();
	}
	while (c >= '0')
	{
		input = 10 * input + (c - '0');
		c = getchar();
	}
	if (negative)
	{
		input = -input;
	}
	return input;
}
void printi(long long output)
{
	if (output == 0)
	{
		putchar('0');
		return;
	}
	if (output < 0)
	{
		putchar('-');
		output = -output;
	}
	int aout[20];
	int ilen = 0;
	while(output)
	{
		aout[ilen] = ((output % 10));
		output /= 10;
		ilen++;
	}
	for (int i = ilen - 1; i >= 0; i--)
	{
		putchar(aout[i] + '0');
	}
	return;
}
string reads()
{
	string input = "";
	char c = ' ';
	while (c <= ' ')
	{
		c = getchar();
	}
	while (c > ' ')
	{
		input += c;
		c = getchar();
	}
	return input;
}
int sgn(long long x)
{
	if (x < 0) 
	{
		return -1;
	}
	if (x > 0) 
	{
		return 1;
	}
	return 0;
}
long long randomize(long long mod)
{
	return ((1 << 30) * rand() + (1 << 15) * rand() + rand()) % mod;
}

#define MP make_pair
#define PB push_back
#define PF push_front
#define LB lower_bound
#define UB upper_bound
#define fi first
#define se second

const long double PI = 4.0 * atan(1.0);
const long double EPS = 1e-20;

#define SINF 10007
#define CO 1000007
#define INF 1000000007
#define BIG 1000000931
#define LARGE 1696969696967ll
#define GIANT 2564008813937411ll
#define LLINF 2696969696969696969ll
#define MAXN 100010

long long normalize(long long x, long long mod = INF)
{
	return (((x % mod) + mod) % mod);
}

typedef long long ll;
typedef long double ld;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;

int N;
int val[MAXN];

bool query(int idx)
{
	if (val[idx])
	{
		return val[idx] - 1;
	}
	cout << idx << '\n';
	fflush(stdout);
	string input;
	cin >> input;
//	cerr << input << endl;
	if (input[0] == 'V')
	{
		exit(0);
	}
	if (input[0] == 'F')
	{
		val[idx] = 1;
		return false;
	}
	val[idx] = 2;
	return true;
}
bool cnt(int L, int R)
{
	if (L < R)
	{
		return (R - L + 1) % 2;
	}
	return (L - R) % 2;
}
void solve(int L, int R)
{
//	cerr << "solve " << L << ' ' << R << endl;
	int mid = (L + R)/2;
	query(mid);
	if (val[mid] == val[L] && !cnt(L, mid))
	{
		solve(L, mid);
	}
	else if (val[mid] != val[L] && cnt(L, mid))
	{
		solve(L, mid);
	}
	else
	{
		solve(mid, R);
	}
	return;
}

int32_t main()
{
	ios_base::sync_with_stdio(0); 
	srand(time(0));
	//	cout << fixed << setprecision(12);	
	//	cerr << fixed << setprecision(12);
	if (fopen("apc001c.in", "r"))
	{	
		freopen ("apc001c.in", "r", stdin);
		freopen ("apc001c.out", "w", stdout);
	}
	cin >> N;
	query(0);
	query(N - 1);
	solve(0, N - 1);
	//	cerr << "time elapsed = " << (clock() / (CLOCKS_PER_SEC / 1000)) << " ms" << endl;
	return 0;
}


Measured memory_bytes: 976
/*
ID: markusz1
TASK: template
PROG: template
LANG: C++
*/
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef unsigned long long int ul;
typedef priority_queue<int> p_int_max; // top is max
typedef priority_queue<int, vector<int>, greater<int> >p_int_min; // top is min
typedef priority_queue<ll> p_ll;
typedef priority_queue<double> p_double;
typedef pair<int, int> pr;
typedef map<int, int> m_int;
// ascending order
bool compare_pr_second(pr &a, pr &b){return a.second < b.second;}

int n,k,temp,k_bef,ans;
m_int m;
vector<pr> v;
int main(){
	ios_base::sync_with_stdio(0);
	cin.tie(0);

	cin >> n >> k;
	for (int i=0;i<n;i++){
		cin >> temp;
		if (m[temp] == 0) k_bef++;
		m[temp]++;
	}
	if (k_bef <= k) cout << 0 << endl;
	else {
		for (auto const &item: m) v.push_back(make_pair(item.first,item.second));
		sort(v.begin(), v.end(), compare_pr_second);
		for (int i=0;k_bef>k;i++){
			ans += v[i].second;
			k_bef--;
		}
		cout << ans << endl;
	}

}


Measured memory_bytes: 11764
#include <stdio.h>
#include <string.h>

int main(void)
{
  char str[100];
  char p[100];

  scanf("%s", str);
  int num = strlen(str);

  for (int i = 0; i < num; i++)
    p[i] = 'x';
  p[num] = '\0';

  printf("%s\n", p);

  return 0;
}


Measured memory_bytes: 128
#include <cstdio>
#include <vector>
#include <tuple>

using namespace std;

using ll = long long;
ll n, m;
int par[100000];
vector<int> G[100000];
tuple<int, int> bridges[100000];
ll deltas[100000];
ll elements[100000];
ll heights[100000];

int groupof(int elem)
{
  while (par[elem] != -1) elem = par[elem];
  int root = elem;
  while (par[elem] != -1) { tie(elem, par[elem]) = make_tuple(par[elem], root); }
  return root;
}

bool union_(int left, int right)
{
  int l = groupof(left);
  int r = groupof(right);
  // printf("union_([%d], [%d])\n", l+1, r+1);
  if (l == r) return false;
  if (heights[l] > heights[r]) {
    tie(l, r) = make_tuple(r, l);
    // printf("(l, r) = ([%d], [%d])\n", l+1, r+1);
  }
  par[l] = r;
  heights[r] = max(heights[r], heights[l]+1);
  elements[r] += elements[l];
  return true;
}

int main()
{
  scanf("%lld %lld", &n, &m);
  for (int i = 0; i < m; i++) {
    int s, t;
    scanf("%d %d", &s, &t);
    s--;
    t--;
    G[s].push_back(t);
    G[t].push_back(s);
    bridges[i] = make_tuple(s, t);
  }
  for (int i = 0; i < n; i++) {
    par[i] = -1;
    heights[i] = 1;
    elements[i] = 1;
  }
  ll result[100001];
  result[m] = n*(n-1)/2;
  for (int i = m-1; 0 <= i; i--) {
    int s, t;
    tie(s, t) = bridges[i];
    ll ns = elements[groupof(s)];
    ll nt = elements[groupof(t)];
    if (union_(s, t)) {
      // printf("(ns, nt) = (%d, %d)\n", ns, nt);
      result[i] = result[i+1]-ns*nt;
    }
    else {
      result[i] = result[i+1];
    }
  }
  for (int i = 1; i <= m; i++) {
    printf("%lld\n", result[i]);
  }
  return 0;
}


Measured memory_bytes: 11000
package main

import (
	"fmt"
	"strings"
)

func main() {
	var s string
	fmt.Scan(&s)

	words := [4]string{"dream", "dreamer", "erase", "eraser"}
	ans := "YES"
	for s != "" {
		matched := false
		for _, word := range words {
			l := len(s)
			if strings.HasSuffix(s, word) {
				s = s[:l-len(word)]
				matched = true
				break
			}
		}

		if !matched {
			ans = "NO"
			break
		}
	}

	fmt.Println(ans)
}


Measured memory_bytes: 1280
# list all primes
import numpy as np
ind_prime = np.ones(10**5+1, dtype="int")


max_prime = int(np.ceil(np.sqrt(10**5)))

if max_prime**2 == 10**5:
    max_prime += 1

ind_prime[0] = 0
ind_prime[1] = 0

for i in range(2, max_prime):
    if ind_prime[i] == 1:
        ind_prime[i*i:(10**5+1):i] = 0


ind_like_2017 = np.zeros(10**5+1, dtype="int")
for i in range(1, 10**5+1, 2):
    if ind_prime[i] == 1 and ind_prime[(i+1)//2] == 1:
        ind_like_2017[i] = 1
        
ind_like_2017_cum = ind_like_2017.cumsum()

res_list = []
Q = int(input())
for _ in range(Q):
    l, r = map(int, input().split())
    res_list.append(ind_like_2017_cum[r]-ind_like_2017_cum[l-1])
    
for r in res_list:
    print(r)

Measured memory_bytes: 21268
#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<iomanip>
#include<math.h>
#include<complex>
#include<queue>
#include<deque>
#include<stack>
#include<map>
#include<set>
#include<bitset>
#include<functional>
#include<assert.h>
#include<numeric>
using namespace std;
#define REP(i,m,n) for(int i=(int)m ; i < (int) n ; ++i )
#define rep(i,n) REP(i,0,n)
typedef long long ll;
typedef pair<int,int> pint;
typedef pair<ll,int> pli;
const int inf=1e9+7;
const ll longinf=1LL<<60 ;
const ll mod=1e9+7 ;

ll dp[2][50];
ll a[101010],X;
int n;

ll rec(int k,int flag){
    if(k==-1)return 0;
    if(dp[flag][k]!=-1)return dp[flag][k];
    ll mask=1LL<<k;
    ll ret=0;
    int cnt=0;
    rep(i,n){
        if(mask&a[i])++cnt;
    }
    if(flag){
        ret=max(n-cnt,cnt)*mask+rec(k-1,1);
    }
    else {
        if(mask&X){
            ret=max(rec(k-1,0)+(n-cnt)*mask,rec(k-1,1)+cnt*mask);
        }
        else ret=rec(k-1,0)+mask*cnt;
    }
    return dp[flag][k]=ret;
}

int main(){
    cin>>n>>X;
    rep(i,n)cin>>a[i];
    rep(i,42)rep(j,2)dp[j][i]=-1;
    cout<<rec(41,0)<<endl;
    return 0;
}

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

int main()
{
    long long a,b;
    cin>>a>>b;
    if(a*b<=0)puts("Zero");
    else if(a>0&&b>0)puts("Positive");
    else if(a==b)puts("Negative");
    else if((b-a)&1)puts("Positive");
    else puts("Negative");
    return 0;
}


Measured memory_bytes: 256
N = int(input())
S = input()
E = [0 for i in range(N)]
W = [0 for i in range(N)]

if S[0] == "E":
    E[0] = 1
else:
    W[0] = 1

for i in range(1, N):
    if S[i] == "E":
        E[i] = E[i-1] + 1
        W[i] = W[i-1]
    else:
        E[i] = E[i-1]
        W[i] = W[i-1] + 1
ans = N
ans = min(ans, E[N-1]-E[0])
for i in range(1, N):
    ans = min(ans, W[i-1] + E[N-1] - E[i])
print(ans)

Measured memory_bytes: 17980
X = int(input())
if X <= 599:
    print(8)
elif X <= 799:
    print(7)
elif X <= 999:
    print(6)
elif X <= 1199:
    print(5)
elif X <= 1399:
    print(4)
elif X <= 1599:
    print(3)
elif X <= 1799:
    print(2)
else:
    print(1)

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

#define inf 1000000000
#define rep(i,a,b) for (int i = a; i <= b; i++)
#define rep1(i, a, b) for(int i =a; i >=b; i--)

//#define mp make_pair

string s;
int ans;

int main(){

cin >> s;
char cur = s[0];

rep(i, 1, s.size()-1){

if(s[i]==cur)continue;
else ans++;
cur = s[i];
}

int mn = 0;
cur = s[s.size()-1];

rep1(i,s.size()-2, 0){

if(s[i]==cur)continue;
else mn++;
cur = s[i];
}


cout << min(mn, ans) << endl;


return 0;}


Measured memory_bytes: 512
#include <bits/stdc++.h>
#define tam 100010

using namespace std;

typedef long long ll;
typedef vector <int> vi;
typedef vector <ll> vl;
typedef pair <ll, ll> dl;
typedef pair <int, int> ii;
typedef pair <ll, ll> dll;
typedef vector <ii> vii;
typedef vector <vi> graph;

ll n, m;
dl arr[tam];

int main() {
    ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
	
	cin >> n >> m;
	int in1, in2;
	for (int i = 0; i < n; ++i)
	{
		cin >> in1 >> in2;
		arr[i] = {in1, in2};
	}
	sort(arr, arr + n);
	ll suma = 0;
	for (int i = 0; m > 0 && i < n; ++i)
	{
		ll temp = min(arr[i].second, m);
		m -= temp;
		suma += (temp * arr[i].first);
	}
	cout << suma << "\n";
	return 0;
}


Measured memory_bytes: 1792
import java.util.*;

public class Main {
  public static void main(String[] args) {
    Scanner scanner = new Scanner(System.in);
    char[] S = scanner.nextLine().toCharArray();

    HashMap<Character, Integer> map = new HashMap<Character, Integer>();
    for (int i = 0; i < 4; i++) {
      if (map.containsKey(S[i])) {
        map.put(S[i], map.get(S[i]) + 1);
      } else {
        map.put(S[i], 1);
      }
    }

    boolean isFiftyFifty = true;
    for (char key : map.keySet()) {
      if (map.get(key) != 2) {
        isFiftyFifty = false;
      }
    }

    if (isFiftyFifty) {
      System.out.println("Yes");
    } else {
      System.out.println("No");
    }

  }
}

Measured memory_bytes: 21716
n = int(input())
H = [0]+list(map(int,input().split()))

if n >= 3:
    dp = [0]*(n+1)
    dp[2] = abs(H[2]-H[1])
    dp[3] = min(abs(H[3]-H[2])+dp[2], abs(H[3]-H[1]))
    for i in range(4,n+1):
        dp[i] = min(abs(H[i]-H[i-1])+dp[i-1], abs(H[i]-H[i-2])+dp[i-2])
    print(dp[n])
else:
    print(abs(H[2]-H[1]))

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

using namespace std;

const int MAXN=207;
const int INF=1e9;

int main(){
	ios_base::sync_with_stdio (false);
    int N, M, R;
    cin >> N >> M >> R;
  	vector<vector<int>> g(MAXN, vector<int>(MAXN, INF));
  	vector<int> r;
  	int ri;
  	for(int i=0; i<R; ++i){
    	cin >> ri;
      	r.push_back(ri);
    }
  	int a, b, c;
  	for(int i=0; i<M; ++i){
    	cin >> a >> b >> c;
      	g[a][b]=c;
      	g[b][a]=c;
    }
    for(int k=1; k<=N; ++k){
        for(int i=1; i<=N; ++i){
            for(int j=1; j<=N; ++j){
            	g[i][j]=min(g[i][j], g[i][k]+g[k][j]);
            }
        }
    }

  	int res=INF;
  	sort(r.begin(), r.end());
  	do{
        int cur=0;
      	for(int i=0; i<R-1; ++i){
        	cur+=g[r[i]][r[i+1]];
        }
      	res=min(res, cur);
  	}while(next_permutation(r.begin(), r.end()));
  	cout << res;
    return 0;
}


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

using namespace std;
using ll=long long;
using ull=unsigned long long;
using pii=pair<int,int>;

#define INF LONG_MAX
#define MOD 1000000007
#define rng(a) a.begin(),a.end()
#define rrng(a) a.end(),a.begin()

int main(){
  ios::sync_with_stdio(false);
  cin.tie(0);
  
  int a;
  string s;
  cin>>a>>s;
  if(a>=3200)cout<<s<<endl;
  else cout<<"red"<<endl;
  return 0;
}


Measured memory_bytes: 892
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using static System.Convert;
using static System.Console;
using static System.Math;
class MainClass
{
	static void Main(string[] args)
	{
		Answer();
	}
	public static void Answer()
	{
			int[] arr = Console.ReadLine().Split(' ').Select(int.Parse).ToArray();
			int A1 = arr[0];int B1 = arr[1];int halfhalf = arr[2];int X = arr[3];int Y = arr[4];
			//double A1B1 = halfhalf * 2;
			int ans = 0;
			if ((halfhalf * 2) <= (A1 + B1))
			{
				int left = Y - X;
				if (left<0)
				{
					ans += (Y * halfhalf * 2);
					if (A1 <= (halfhalf * 2))
						ans += (-1 * left * A1);
					else
						ans += (-1 * left * halfhalf * 2);
				}
				else
				{
					ans += (X * halfhalf * 2);
					if (B1 <= (halfhalf * 2))
						ans += (left * B1);
					else
						ans += (left * halfhalf * 2);
				}
			}
			else
			{
				ans += ((X * A1) + (Y * B1));
			}
			Console.WriteLine(ans);
	}
}

Measured memory_bytes: 13396
import sys

sys.setrecursionlimit(10 ** 7)
f_inf = float('inf')
mod = 10 ** 9 + 7


def resolve():
    x = int(input())
    m = 0
    for i in range(1, 1000):
        for j in range(2, 100):
            k = pow(i, j)
            if k <= x:
                m = max(m, k)
    print(m)


if __name__ == '__main__':
    resolve()


Measured memory_bytes: 41820
#include <iostream>
#include<vector>
using namespace std;
int main(void)
{
	int A, B;
	cin >> A >> B;

	int hantei = (B - A);
	if (hantei % 2 == 0)
	{
		int onaziatai = hantei / 2;
		cout << B-onaziatai << endl;
	}
	else
	{
		cout << "IMPOSSIBLE" << endl;
	}
}

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

int main()
{
	string S;
	cin >> S;
	if (S[0] != S[1] && S[1] != S[2] && S[2] != S[0])
		cout << "Yes" << endl;
	else cout << "No" << endl;

	fflush (stdin);
	getchar();
	fflush(stdin);
	getchar();
	return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i = 0; i < n; i++)
#define All(V) V.begin(), V.end()
typedef long long int ll;
typedef pair<int, int> P;
const ll MOD = 1e9+7, INF = 1e9;

int main()
{
    string s; cin >> s;
    cout << s.substr(0, 3) << endl;
    system("pause");
}

Measured memory_bytes: 3652
import sys
input=sys.stdin.readline
N=int(input())
A=[]
B=[]
for i in range(N):
    a,b=map(int,input().split())
    A.append(a)
    B.append(b)
    
m=10**10
for i in range(N):
    if A[i]>B[i]:
        if m>B[i]:
            m=B[i]

if m==10**10:
    print(0)
else:
    print(sum(A)-m)

Measured memory_bytes: 4852
// https://atcoder.jp/contests/abc144/tasks/abc144_b
#include <iostream>

int main()
{
	std::cin.sync_with_stdio(false);
	std::cout.sync_with_stdio(false);

	int n;

	std::cin >> n;

	int i;
	for (i = 1; i <= 9; ++i)
	{
		int div = n / i;
		if (n == (div * i) && div <= 9)
		{
			std::cout << "Yes";
			break;
		}
	}
	if (i == 10)
		std::cout << "No";
}


Measured memory_bytes: 256
import java.util.*;

import javax.xml.crypto.Data;

import java.math.*;

public class Main {
	
	
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int d = sc.nextInt();
		int c = sc.nextInt();
		System.out.println(d * c);
	}
	
}

Measured memory_bytes: 17356
#include<bits/stdc++.h>
using namespace std;
int main(){
    int n,manzoku=0;
    cin>>n;
    vector<int> tamesi1(n),tamesi2(n),tamesi3(n-1);

    for(int i = 0;i<n;i++){
        cin>> tamesi1[i];
        //cout<<tamesi1[i]<<endl;
    }
    for(int i = 0;i<n;i++){
        cin>> tamesi2[i];
        //cout<<tamesi2[i]<<endl;
    }
    for(int i = 0;i<n-1;i++){
        cin>> tamesi3[i];
        //cout<<tamesi3[i]<<endl;
    }

    for(int i = 0;i<n;i++){
        manzoku += tamesi2[tamesi1[i]-1];
        //cout<<manzoku<<endl;
        if((tamesi1[i]-tamesi1[i-1])==1){
            manzoku += tamesi3[tamesi1[i-1]-1];
        }
    }
    cout << manzoku<<endl;
    return 0;
}

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


int main() {
    int N;
    cin >> N;
    string S;
    cin >> S;
    string ans = "";
    int count = 0;
    for (char c : S) {
        if (c == ')') {
            if (count == 0) {
                ans = "(" + ans;
            } else {
                count--;
            }
        } else {
            count++;
        }
        ans += c;
    }
    rep(i, count) {
        ans += ")";
    }

    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <cstring>
#include<vector>
#include <algorithm>
#include<cstdlib>
#include<set>
#include<math.h>
#include<map>
#include<iomanip>

using namespace std;
using ll = long long;
using ull = unsigned long long;
#define rep(n,x) for(ll i=0;i<n;i++) cin>>x[i];


int main()
{
	int n;
	cin >> n;
	vector<ll> a(n);
	vector<ll> b(n - 1);
	rep(n - 1, b);
	a[0] = b[0];
	a[n - 1] = b[n - 2];
	for (ll i = 1; i < n - 1 ; i++)
	{
		a[i] = min(b[i], b[i - 1]);
	}
	ll sum = 0;
	for (ll i = 0; i < n; i++)
	{
		sum += a[i];
	}
	cout << sum << "\n";
	return 0;
}

Measured memory_bytes: 3608
#include <stdio.h>
#include <math.h>

int main(void){
	int n = 0;
	double xa, ya, ra, xb, yb, rb;
	double d = 0.0;
	scanf("%d", &n);
	for(int i=0; i<n; ++i){
		scanf("%lf %lf %lf %lf %lf %lf",
			&xa, &ya, &ra, &xb, &yb, &rb);
		d = sqrt((xa-xb)*(xa-xb) + (ya-yb)*(ya-yb));

		if(d > ra+rb){
			puts("0");
		}else if(ra > d+rb){
			puts("2");
		}else if(rb > d+ra){
			puts("-2");
		}else{
			puts("1");
		}
	}
	return 0;
}

Measured memory_bytes: 0
using System;

public class Program
{
    static void Main()
    {
        var s = Console.ReadLine();
        var t = Console.ReadLine();
        for (int i = 0; i < s.Length; i++)
        {
            if (t == s)
            {
                Console.WriteLine("Yes");
                return;
            }

            var buf = t[t.Length - 1];
            t = t.Remove(t.Length - 1);
            t = t.Insert(0, buf.ToString());
        }

        Console.WriteLine("No");
    }
}


Measured memory_bytes: 11092
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <math.h>
int max(int a, int b) { return a > b ? a : b; }
int min(int a, int b) { return a < b ? a : b; }
int main(void){
    int n,m,x,i,j,ans,cost=100000000,und[15]={},k[15]={},flag=0,c[15]={},a[15][15]={};
    scanf("%d %d %d\n",&n,&m,&x);
    for(i=1; i<=n; i++){
        scanf("%d",&c[i]);
        for(j=1; j<=m; j++){
            scanf("%d",&a[i][j]);
        }
    }
    for(k[1]=0;k[1]<=1;k[1]++){
        for(k[2]=0;k[2]<=1;k[2]++){
            for(k[3]=0;k[3]<=1;k[3]++){
                for(k[4]=0;k[4]<=1;k[4]++){
                    for(k[5]=0;k[5]<=1;k[5]++){
                        for(k[6]=0;k[6]<=1;k[6]++){
                            for(k[7]=0;k[7]<=1;k[7]++){
                                for(k[8]=0;k[8]<=1;k[8]++){
                                    for(k[9]=0;k[9]<=1;k[9]++){
                                        for(k[10]=0;k[10]<=1;k[10]++){
                                            for(k[11]=0;k[11]<=1;k[11]++){
                                                for(k[12]=0;k[12]<=1;k[12]++){
                                                    for(i=1; i<=n; i++){
                                                        for(j=1; j<=m; j++){
                                                            und[j]+=a[i][j]*k[i];
                                                        }
                                                    }
                                                    for(j=1; j<=m; j++){
                                                        if(und[j]<x)flag=1;
                                                    }
                                                    
                                                    for(j=1; j<=14; j++){
                                                        und[j]=0;
                                                    }
                                                    if(flag==0){
                                                        for(i=1; i<=n; i++){
                                                            ans+=c[i]*k[i];
                                                        }
                                                        cost=min(ans,cost);
                                                    }
                                                    ans=0;
                                                    flag=0;
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
    if(cost==100000000){
        printf("-1");
        return 0;
    }
    printf("%d",cost);
    return 0;
}

Measured memory_bytes: 1732
def main():
    H, W = map(int, input().split())
    a = [[0] * W]
    for _ in range(H):
        ai = list(map(int, input().split()))
        ai.insert(0, 0)
        a.append(ai)
    N = 0
    yx = []
    for i in range(1, H + 1):
        for j in range(1, W + 1):
            if a[i][j] % 2 == 0:
                continue
            if W >= j + 1:
                a[i][j] -= 1
                a[i][j + 1] += 1
                N += 1
                yx.append([i, j, i, j + 1])
            elif H >= i + 1:
                a[i][j] -= 1
                a[i + 1][j] += 1
                N += 1
                yx.append([i, j, i + 1, j])
        if H > i + 1 and a[i][j] % 2 != 0:
            a[i][j] -= 1
            a[i + 1][j] += 1
            N += 1
            yx.append([i, j + 1, i + 1, j])
    print(N)
    for row in yx:
        print(' '.join(list(map(str, row))))


main()


Measured memory_bytes: 25996
using System;

namespace OnlineJudge
{
    class ITP1_2_A
    {
        static void Main(string[] args)
        {
            var str = Console.ReadLine().Split(' ');
            if (str.Length < 2)
                return;
            var a = int.Parse(str[0]);
            var b = int.Parse(str[1]);
            if (a < b)
                Console.WriteLine("a < b");
            else if(a > b)
                Console.WriteLine("a > b");
            else
                Console.WriteLine("a == b");
        }
    }
}

Measured memory_bytes: 8988
#include <bits/stdc++.h>
using namespace std;
#define SORT(a) sort((a).begin(), (a).end())
#define RSORT(a) reverse((a).begin(), (a).end())
#define rep(i, n) for (int i = 0; i < n; i++)
typedef long long ll;
const long long INF = 1LL << 60;

int main() {
  int n;
  cin >> n;
  vector<int> a(n);
  vector<int> b(n);
  for (int i = 0; i < n; i++) cin >> a[i];
  for (int i = 0; i < n; i++) cin >> b[i];
  int ma = 0;
  for (int i = 0; i < n; i++) {
    int count = 0;
    for (int j = 0; j < n; j++) {
      if (j < i)
        count += a[j];
      else if (j == i)
        count += a[j] + b[j];
      else
        count += b[j];
    }
    ma = max(ma, count);
  }
  cout << ma << endl;
}


Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <cmath>
#include <algorithm>
#define N 205
using namespace std;

typedef long long ll;
struct st{
	ll x, y;
} a[N];
ll n, sx, sy, mx;

bool cmp(st p, st q) {
	return atan2(1.0 * p.y, 1.0 * p.x) < atan2(1.0 * q.y, 1.0 * q.x);
}

int main()
{
	ll i, j;
	cin >> n;
	for (i = 0; i < n; i++) scanf("%lld %lld", &a[i].x, &a[i].y);
	sort(a, a + n, cmp);
	for (i = 0; i < n; i++) a[n + i] = a[i];
	for (i = 0; i < n; i++) {
		sx = sy = 0;
		for (j = 0; j < n; j++) {
			sx += a[i + j].x;
			sy += a[i + j].y;
			mx = max(mx, sx * sx + sy * sy);
		}
	}
	printf("%.15f", sqrt(1.0 * mx));
    return 0;
}

Measured memory_bytes: 256
#coding: utf-8

a, b, c = map(int, input().split())
b = min(b, c)
#print('a, b, c = {}, {}, {}'.format(a, b, c))
lenD = b - a + 1
divisors = [0 for i in range(lenD)]
for i in range(lenD):
    if divisors[i] == 1:
        continue
    if c % (a + i) == 0:
        divisors[i] = 1
        x = c // (a + i) - a
        if i < x and x < lenD:
            divisors[x] = 1
print(sum(divisors))


Measured memory_bytes: 5648
#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <algorithm>
using namespace std;

// bad knowhow
#define REP(i,n) for(long long i=0;i<(long long)n;++i)

#define INF 10000001
#define MAX_SIZE 101
long long g_d[MAX_SIZE][MAX_SIZE];
void warshall_floyd(int v) {
	REP(k, v) REP(i, v) REP(j,v) g_d[i][j] = min(g_d[i][j], g_d[i][k]+g_d[k][j]);
}

int main() {
	//freopen("Text.txt", "r", stdin);

	while (true) {
		int n,m,s,g1,g2;
		cin >> n >> m >> s >> g1 >> g2;
		--s; --g1; --g2;
		if (n==0) break;

		// memsetはシングルバイトのみ
		fill(*g_d, *g_d + MAX_SIZE*MAX_SIZE, INF);
		REP(i, MAX_SIZE) g_d[i][i] = 0;

		REP(i, m) {
			int b1,b2;
			cin >> b1 >> b2;
			--b1; --b2;
			cin >> g_d[b1][b2];
		}

		warshall_floyd(n);

		long long cost = INF;
		REP(i, n) cost = min(cost, g_d[s][i] + g_d[i][g1] + g_d[i][g2]);

		cout << cost << endl;
	}
}

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

int main() {
    int fives = 0, sevens = 0;
    int buffer;
    for(int i = 0; i < 3; i++){
        cin >> buffer;
        switch(buffer){
        case 5:
            fives++;
            break;
        case 7:
            sevens++;
            break;
        default:
            cout << "NO";
            return 0;
        }
    }
    if(fives == 2 && sevens == 1){
        cout << "YES";
    }else{
        cout << "NO";
    }
    return 0;
}

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

using namespace std;

constexpr static int MAXN = 1e5 + 10;

int n, m;
vector <int> adj[MAXN];

int qv[MAXN], qd[MAXN], qc[MAXN];
vector <int> qidx[11];
int qmax[11][MAXN];

int main() {
    cin >> n >> m;
    for (int i = 0; i < m; i++) {
        int u, v;
        cin >> u >> v;
        u--, v--;
        adj[u].push_back(v);
        adj[v].push_back(u);
    }

    int q;
    cin >> q;
    for (int j = 0; j < q; j++) {
        cin >> qv[j] >> qd[j] >> qc[j];
        qv[j]--;
        qidx[qd[j]].push_back(j);
    }

    for (int dist = 10; dist >= 0; dist--)
        for (int i = 0; i < n; i++)
            qmax[dist][i] = -1;
    for (int dist = 10; dist >= 0; dist--) {
        for (int j : qidx[dist])
            qmax[dist][qv[j]] = max(qmax[dist][qv[j]], j);
        if (dist > 0) {
            for (int u = 0; u < n; u++)
                if (qmax[dist][u] != -1) {
                    for (int v : adj[u])
                        qmax[dist - 1][v] = max(qmax[dist - 1][v], qmax[dist][u]);
                }
        }
        /*
        cout << ">";
        for (int i = 0; i < n; i++)
            cout << " " << qmax[dist][i];
        cout << endl;
        */
    }
    for (int i = 0; i < n; i++) {
        int color = 0;
        int curmax = -1;
        for (int dist = 10; dist >= 0; dist--)
            curmax = max(curmax, qmax[dist][i]);
        if (curmax != -1)
            color = qc[curmax];
        cout << color << endl;
    }
}


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

int main(){
  string S; cin >> S;
  int k=S.size();
  int64_t ans=0;
  int count=0;
  for(int i=0;i<k;i++){
    if(S.at(i)=='B'){
      count++;
    }
    else ans+=count;
  }
  cout << ans << endl;
}

Measured memory_bytes: 640
#include <iostream>
#include <bits/stdc++.h>
using namespace std;
#define MOD ( long ) ( 1e9 + 7 ) 

int main() {
	 string s;
	 cin >> s;
    vector < long [ 4 ]> dp (s.size () + 1 );
    dp [ 0 ] [ 0 ] = 1 ;
     for ( int i = 1 ; i <= s.size (); i ++) {
         for ( int j = 0 ; j <= 3 ; j ++) {
            dp [i] [j] = dp [i- 1 ] [j];
             if (s [i- 1 ] == '?' )
                dp [i] [j] *= 3 ;
            dp [i] [j]%= MOD;
        }
        if (s [i- 1 ]!= '?' )
            dp [i] [s [i- 1 ] + 1 - 'A' ] += dp [i- 1 ] [s [i- 1 ] - 'A' ];
          else {
             for ( int j = 1 ; j <= 3 ; j ++) {
                dp [i] [j] += dp [i- 1 ] [j- 1 ];
               dp [i] [j]%= MOD;
            }
        }
    }
    cout << dp [s.size ()] [ 3 ]% MOD;
	return 0;
}

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

int main(void) {
	int x;
	string s, t;
	cin >> s >> t;
	for (int i = 0; i < t.length(); i++) {
		string tmp{ s[t.length()-1] };
		s.insert(0, tmp);
		s.pop_back();
		if (s == t) {
			cout << "Yes" << endl;
			return 0;
		}
	}
	cout << "No" << endl;
	return 0;
}

Measured memory_bytes: 256
#define _USE_MATH_DEFINES

#include <iostream>
#include <iterator>
#include <fstream>
#include <string>
#include <vector>
#include <algorithm>
#include <cassert>
#include <map>
#include <set>
#include <cmath>
#include <queue>
#include <unordered_set>
#include <unordered_map>
#include <climits>
#include <ctime>

using namespace std;
using ll = long long;
using ull = unsigned long long;

void solve() {
	int n;
	scanf("%d", &n);
	vector<ll> c(n-1), s(n-1), f(n-1);
	for (int i = 0; i < n-1; ++i)
		scanf("%lld%lld%lld", &c[i], &s[i], &f[i]);
	for (int i = 0; i < n; ++i) {
		ll t = 0;
		for (ll j = i; j < n-1; ++j) {
			t = max(s[j], (t + f[j] - 1) / f[j] * f[j]);
			t += c[j];
		}
		cout << t << endl;
	}
}

int main() {
#ifdef LOCAL
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif

	solve();

#ifdef LOCAL
	cerr << double(clock()) / CLOCKS_PER_SEC << " sec" << endl;
#endif
	return 0;
}

Measured memory_bytes: 256