akhauriyash/Code-Regression huggingface dataset:
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <vector>
#include <math.h>
#include <string.h>
#include <algorithm>
#include <iostream>
#include <string>
#include <sstream>
#include <iostream>
#include <time.h>
#include <queue>
#include <list>
#include <map>
#include <set>
#include <vector>
#include <stack>
#include <string.h>
#define sf scanf
#define pf printf
#define lf double
#define ll long long
#define p123 printf("123\n");
#define pn printf("\n");
#define pk printf(" ");
#define p(n) printf("%d",n);
#define pln(n) printf("%d\n",n);
#define s(n) scanf("%d",&n);
#define ss(n) scanf("%s",n);
#define ps(n) printf("%s",n);
#define sld(n) scanf("%lld",&n);
#define pld(n) printf("%lld",n);
#define slf(n) scanf("%lf",&n);
#define plf(n) printf("%lf",n);
#define sc(n) scanf("%c",&n);
#define pc(n) printf("%c",n);
#define gc getchar();
#define re(n,a) memset(n,a,sizeof(n));
#define len(a) strlen(a)
using namespace std;
ll a[105000];
ll b[105000];
int main(){
    int n;
    s(n)
    for(int i = 0; i < n+1; i ++){
        sld(a[i])
    }
    ll sum = 0ll;
    for(int i = 0; i < n; i ++){
        sld(b[i])
        if(b[i] >= a[i]){
            b[i] -= a[i];
            sum += a[i];
            a[i] = 0;
            if(b[i] >= a[i+1]){
                b[i] -= a[i+1];
                sum += a[i+1];
                a[i+1] = 0;
            }else{
                sum += b[i];
                a[i+1] -= b[i];
                b[i] = 0;
            }
        }else{
            sum += b[i];
            b[i] = 0;
        }
    }
    pld(sum) pn
    return 0;
}


Measured memory_bytes: 1792
#!usr/bin/env python3
from collections import defaultdict
from heapq import heappush, heappop
import sys
import math
import bisect
import random
def LI(): return list(map(int, sys.stdin.readline().split()))
def I(): return int(sys.stdin.readline())
def LS(): return list(map(list, sys.stdin.readline().split()))
def S(): return list(sys.stdin.readline())[:-1]
def IR(n): return [I() for i in range(n)]
def LIR(n): return [LI() for i in range(n)]
def SR(n): return [S() for i in range(n)]
def LSR(n): return [LS() for i in range(n)]
mod = 1000000007


#A
"""
def check(n):
    n = list(map(int,list(str(n))))
    s = 0
    for i in n:
        s += f[i]
    return s == 0
n,k = LI()
d = LI()
f = [0 for i in range(10)]
for i in d:
    f[i] = 1
while 1:
    if check(n):
        print(n)
        quit()
    n += 1
"""
#B
h,w,a,b = LI()
ans = 0
k = 1
inv = [pow(i,mod-2,mod) for i in range(h+w+1)]
x = b+1
y = a+1
for i in range(min(x-1,h-y)):
    k *= (x-1+h-y-i)*inv[i+1]%mod
    k %= mod
for i in range(min(y-1,w-x)):
    k *= (y-1+w-x-i)*inv[i+1]%mod
    k %= mod
for i in range(1,min(w-b,h-a)+1):
    ans += k
    ans %= mod
    k *= (h-y)*(w-x)*inv[x]*inv[y]%mod
    k %= mod
    x += 1
    y += 1
print(ans)
#C

#D

#E

#F

#G

#H

#I

#J

#K

#L

#M

#N

#O

#P

#Q

#R

#S

#T


Measured memory_bytes: 53232
#include<cstdio>
#include<algorithm>
using namespace std;
typedef long long ll;
int main(){
	int n;
	bool prime[1001];
	ll ans = 1;
	scanf("%d",&n);
	fill(prime,prime+1001,true);
	for(int i=2;i<=n;i++){
		if(prime[i]){
			int pos = 2 * i;
			while(pos<=n){
				prime[pos] = false;
				pos += i;
			}
			int x = n;
			int usi = 0;
			while(x>0){
				usi += x / i;
				x /= i;
			}
			ans *= usi + 1;
			ans %= 1000000007;
		}
	}
	printf("%lld\n",ans);
}


Measured memory_bytes: 128
#include<iostream>
#include<vector>
using namespace std;
int main(){
  int n,div[1001]={},temp;
  vector<pair<int,int>> prime_list;
  long long int sum;
  cin >> n;
  for(int i=2;i<=n;i++){
    if(div[i]==0){
      for(int j=2*i;j<=n;j+=i){
        div[j]=1;
      }
    }
  }
  for(int i=2;i<=n;i++){
    if(div[i]==0) prime_list.push_back(pair<int,int>(i,0));
  }
  for(int i=2;i<=n;i++){
    for(int j=0;j<prime_list.size();j++){
        temp=i;
        while(temp%prime_list[j].first==0){
          temp/=prime_list[j].first;
          prime_list[j].second++;
        }
    }
  }
  sum=1;
  for(int i=0;i<prime_list.size();i++){
    sum=(sum*(prime_list[i].second+1))%(1000000000+7);
  }
  cout<<sum<<endl;
}


Measured memory_bytes: 256
#include<stdio.h>

int main(void)
{
	int i,x[10000];
	
	for(i=0;i<=10000;i++){
		scanf("%d",&x[i]);
		if(x[i]==0){
			break;
		}
	}
	for(i=0;i<=10000;i++){
		if(x[i]!=0){
			printf("Case %d: %d\n",i+1,x[i]);
		}else{
			break;
		}
	}
	return 0;
}

Measured memory_bytes: 636
#include <bits/stdc++.h>
using namespace std;
#define rep(i,a,n) for (int i=a;i<n;i++)
#define per(i,a,n) for (int i=n-1;i>=a;i--)
#define pb push_back
#define mp make_pair
#define all(x) (x).begin(),(x).end()
#define fi first
#define se second
#define SZ(x) ((int)(x).size())
typedef vector<int> VI;
typedef long long ll;
typedef pair<int,int> PII;
typedef double db;
mt19937 mrand(random_device{}());
const ll mod=1000000007;
int rnd(int x) { return mrand() % x;}
ll powmod(ll a,ll b) {ll res=1;a%=mod; assert(b>=0); for(;b;b>>=1){if(b&1)res=res*a%mod;a=a*a%mod;}return res;}
ll gcd(ll a,ll b) { return b?gcd(b,a%b):a;}
// head

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

    int n;
    cin >> n;
    int cntwa = 0;
    int cntac = 0;
    int cnttle = 0;
    int cntre = 0;
    while (n--) {
        string s;
        cin >> s;
        if (s == "AC") {
            cntac++;
        }
        else if (s == "WA") {
            cntwa++;
        }
        else if (s == "TLE") {
            cnttle++;
        }
        else {
            cntre++;
        }
    }

    cout << "AC x " << cntac << endl;
    cout << "WA x " << cntwa << endl;
    cout << "TLE x " << cnttle << endl;
    cout << "RE x " << cntre << endl;

    return 0;
}

Measured memory_bytes: 3664
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
using Graph = vector<vector<int>>;
const int INT_INF = 2147483647;
//stoi(s) : string→int stoll(s) :string→longlong  int→string to_string(i)
const double PI = acos(-1.0);
//小数点の表し方 cout << fixed << setprecision(5);
const ll LLMAX = 9223372036854775805;

int main(){
    int h,w,k;
    cin >> h >> w >> k;
    vector<string> cp(h);
    for(int i=0;i<h;i++){
        cin >> cp[i];
    }
    int ans = 0;
    for(int bith = 0;bith < (1<<h) ;bith++){
        for(int bitw = 0;bitw < (1<<w);bitw++){
            vector<string> c(h);
            for(int i=0;i<h;i++){
                c[i] = cp[i];
            }
            bitset<6> ch(bith);
            bitset<6> cw(bitw);
            //cout << ch << cw << endl;
            for(int i=0;i<h;i++){
                //cout << ch[i] << endl;
                if(ch[i] == 1){
                    for(int j = 0;j < w;j++){
                        c[i][j] = 'R';
                    }
                }
            }
            for(int i=0;i<w;i++){
                if(cw[i] == 1){
                    for(int j=0;j<h;j++){
                        c[j][i] = 'R';
                    }
                }
            }
            int cnt = 0;
            for(int i=0;i<h;i++){
                for(int j=0;j<w;j++){
                    if(c[i][j] == '#'){
                        cnt++;
                    }
                }
            }
            /*
            if(bith == 0 && bitw == 2){
                cout << ch << " " << cw << endl;
                for(int i=0;i<h;i++){
                    cout << c[i] << endl;
                }
                cout << cnt << endl;
            }
            */
            if(cnt == k){
                ans++;
            }
            //cout << cnt << endl;
        }
        
    }
    cout << ans << endl;
}

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

int main(){

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

  int time = 0;
  int ans = 0;

  for(int i = 100 ; i > 0 ; i--){

    if(A % i == 0 && B % i == 0) {
      // cout << A << "\t" << B << "\t" << i << endl;
      time++;
      ans = i;
      if(time == K) break;
    }

  }

  cout << ans << endl;

}

Measured memory_bytes: 256
import sys
sys.setrecursionlimit(10**9)
INF=10**18
MOD=10**9+7
def input(): return sys.stdin.readline().rstrip()

def main():
    a,b,c,d=map(int,input().split())
    l=[a-c,d-b]
    ans1=[c-l[1],d-l[0]]
    ans2=[a-l[1],b-l[0]]
    print(*(ans1+ans2))

if __name__ == '__main__':
    main()


Measured memory_bytes: 38256
#include<bits/stdc++.h>
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>
#define pi 3.141592653589793238
#define int long long
using namespace __gnu_pbds;
using namespace std;
template <typename T>
using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;

vector<int>temp[205];
vector<vector<int> >adj;
int mx=0;
void dfs(int ver,int pr,int x)
{	
	mx=max(mx,x);
	for(auto i:adj[ver])
	{
		if(i!=pr)
			dfs(i,ver,x+1);
	}
}

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

  #ifndef ONLINE_JUDGE
      if(fopen("INPUT.txt","r"))
      {
      freopen ("INPUT.txt" , "r" , stdin);
      freopen ("OUTPUT.txt" , "w" , stdout);
      }
  #endif  

	int n;
	cin>>n;
	adj.resize(n+1);
	pair<int,int> a[n+1];
	int pp[n+1];
	for(int i=1;i<=n;i++)
	{
		cin>>a[i].first;
		pp[i]=a[i].first;
		a[i].second=i;
		temp[a[i].first].push_back(i);
	}
	sort(a+1,a+n+1);
	int x,y;
	x=1,y=2;
	vector<pair<int,int>> ans;

	if(a[1].first==a[2].first)
	{
		ans.push_back({a[1].second,a[2].second});
		x=a[1].second;
		y=a[2].second;
		for(int i=a[1].first+1;i<=n;i++)
		{
			if(!temp[i].empty())
			{
				ans.push_back({temp[i].back(),y});
				y=temp[i].back();
				temp[i].pop_back();
				int z=1;
				while (!temp[i].empty())
				{
					z=temp[i].back();
					ans.push_back({x,z});
					temp[i].pop_back();
				}
				x=z;
			}
		}
	}
	else if(n>2)
	{
		for(auto i:temp[a[1].first+1])
		{
			ans.push_back({a[1].second,i});	
			y=x;
			x=i;					
		}

		for(int i=a[1].first+2;i<=n;i++)
		{
			if(!temp[i].empty())
			{
				ans.push_back({temp[i].back(),y});
				y=temp[i].back();
				temp[i].pop_back();
				int z=1;
				while (!temp[i].empty())
				{
					z=temp[i].back();
					ans.push_back({x,z});
					temp[i].pop_back();
				}
				x=z;
			}
		}		
	}

	for(auto i:ans)
	{
		adj[i.first].push_back(i.second);
		adj[i.second].push_back(i.first);
	}	

	for(int i=1;i<=n;i++)
	{
		mx=0;
		dfs(i,0,0);
		if(pp[i]!=mx)
		{
			cout<<"Impossible";
			return 0;
		}
	}
	cout<<"Possible";
}


Measured memory_bytes: 3680
#include <iostream>
#include <string>
#include <cmath>
#include <vector>

using namespace std;

int main(void){
    int s;
    int n;

    cin >> s;
    int a[1000000];
    a[1] = s;

    for(int i = 1;; i++){

        for( int j = 1; j < i; j++){
            for(int k = 1; k < i; k++){
                if(a[j] == a[k] && j != k){
                    cout << i-1 << endl;
                    return 0;
                }
            }
        }

        if( a[i] % 2 == 0){
            a[i+1] = a[i] / 2;
        }
        else{
            a[i+1] = 3 * a[i] + 1;
        }
    }
    
    return 0;
}

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

int main(void){
    int n;
    int a[100];

    cin >> n;
    for (int i=0; i < n; i++) cin >> a[i];

    int ans = 0;

    sort (a, a+n, greater<int>());

    for (int i=0; i < n; i++) {
        if ((i%2) == 0) {
            ans += a[i];
        } else {
            ans -= a[i];
        }
    }

    cout << ans;
    cout << "\n";
}

Measured memory_bytes: 256
import java.util.Scanner;

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

    while (in.hasNext()) {
      int N = in.nextInt();
      int[] A = new int[N + 1];
      int[] B = new int[N];
      long killed = 0;

      for (int i = 0; i < A.length; ++i) {
        A[i] = in.nextInt();
      }

      for (int i = 0; i < B.length; ++i) {
        B[i] = in.nextInt();
      }

      for (int i = 0; i < B.length; ++i) {
        int areaSum = A[i] + A[i + 1];

        killed += Math.min(B[i], areaSum);
        
        B[i] = Math.max(B[i] - A[i], 0);
        A[i + 1] = Math.max(A[i + 1] - B[i], 0);
      }

      System.out.println(killed);
    }
  }
}

Measured memory_bytes: 82628
#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <set>
#include <queue>
#include <map>

using namespace std;

typedef long long ll;
typedef long double ld;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<ld> vld;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;

#define INF ((int)1e9)
#define INFLL ((ll)1e18)
#define MOD (1000000007LL)


int main(int argc, const char * argv[]) {
    ll N, K;
    cin >> N >> K;
    
    if (K%2 == 0) {
        cout << (N/K)*(N/K)*(N/K) + ((N+K/2)/(K))*((N+K/2)/(K))*((N+K/2)/(K)) << endl;
    } else {
        cout << (N/K)*(N/K)*(N/K) << endl;
    }

    return 0;
}


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

int main(int argc, const char * argv[]) {
    char a, b, c;
    int total = 700;
    cin >> a >> b >> c;
    
    if (a == 'o') {
        total += 100;
    }
    if (b == 'o') {
        total += 100;
    }
    if (c == 'o') {
        total += 100;
    }
    
    cout << total << endl;
    
    return 0;
}

Measured memory_bytes: 256
/*
ID: espr1t
TASK: 
KEYWORDS: 
*/

#include <cstdio>
#include <cstring>
#include <algorithm>
#include <vector>
#include <string>

using namespace std;
FILE* in = stdin; FILE* out = stdout;

const int MAX = 1024;

int main(void) {
	// in = fopen("A.in", "rt");
	
	int mask = 0;
	for (int i = 0; i < 4; i++) {
	    int tmp;
	    fscanf(in, "%d", &tmp);
	    mask |= (1 << tmp);
    }
    if (mask == ((1 << 1) | (1 << 9) | (1 << 7) | (1 << 4))) {
        fprintf(out, "YES\n");
    } else {
        fprintf(out, "NO\n");
    }
	
	return 0;
}

Measured memory_bytes: 128
#include <bits/stdc++.h>
#define int long long
#define INT_MAX INT64_MAX
#define INT_MIN INT64_MIN
#define CLK clock_t clk = clock();//Start of main
#define OCLK cerr << "Time (in ms): " << (double)(clock() - clk) * 1000.0 / CLOCKS_PER_SEC << '\n';//End of main
#define MOD 1000000007
/* DEFINE cout */
#define pln cout << "===============================\n"
#define on cout<<"\n"
#define os cout<<" "
#define o2(a,b) cout<<a<<" "<<b
#define o(a) cout << a
#define bitcount __builtin_popcount
/* DEFINE cout */
#define endl "\n"
#define fastio ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);//fastio
using namespace std;
struct hash_pair { // use pair as key in unordered_map<pair<int,int>,int,hash_pair>;
    template <class T1, class T2>
    size_t operator()(const pair<T1, T2>& p) const
    {
        auto hash1 = hash<T1>{}(p.first);
        auto hash2 = hash<T2>{}(p.second);
        return hash1 ^ hash2;
    }
};
bool prime[10000001];
int P=MOD-2;
int factorial[10000001]={0};
int powerFunction(int x,int y){
    int res = 1;
    int p = MOD;
    x = x % p;
    while (y > 0){
        if (y & 1)
            res = (res*x) % p;
        y = y>>1;
        x = (x*x) % p;
    }
    return res;
}
void sieveFunction(int maxLimit){
    memset(prime, true, sizeof(prime));
    prime[0] = prime[1]=false;
    for(int i=2; maxLimit >= i ; i++){
        if(prime[i]){
            for(int j=2*i ; maxLimit >= j ; j+=i)
                prime[j]=false;
        }
    }
}
void factorialFunction(int maxLimit){
    factorial[0]=1;
    for(int i=1 ; i <= maxLimit ; i++)
        factorial[i]=(factorial[i-1]*i)%MOD;
    return;
}
int gcd(int a, int b){
    if (b == 0)
        return a;
    return gcd(b, a % b);
}
vector<int> v[100005];
bool visited[100005];
int parent[100005];
int level[100005];
void bfs(int node){
    queue<int> q;
    q.push(node);
    visited[node] = true;
    while(q.size()){
        int p = q.front();
        q.pop();
        for(int i=0; v[p].size()>i; i++){
            if(!visited[v[p][i]]){
                visited[v[p][i]] = true;
                parent[v[p][i]] = p;
                q.push(v[p][i]);
            }
        }
    }
}
signed main(){
    int n, m;
    cin >> n >> m;
    for(int i=0; m>i; i++){
        int a, b;
        cin >> a >> b;
        v[a].push_back(b);
        v[b].push_back(a);
    }
    int count = 0;
    for(int i=1; n>=i; i++){
        if(!visited[i]){
            bfs(i);
            count++;
        }
    }
    if(count != 1){
        cout << "No\n";
    }else{
        cout << "Yes\n";
        for(int i=2; n>=i; i++){
            cout << parent[i] << endl;
        }
    }
}






Measured memory_bytes: 13056
#include<stdio.h>

int main()
{
    int a,b,c;
    
    do{
        scanf("%d %d %d",&a,&b,&c);
    }while(!(1<=a && a<=10000 && 1<=b && b<=10000 && 1<=c && c<=10000));
    
    int max;
    max = a;
    if(b > max) max = b;
    if(c > max) max = c;
        
    printf("%d\n",a+b+c-max);
    return 0;
}



Measured memory_bytes: 128
// AUTHOR - RUTVIK KOTHARI
// DAIICT , GANDHINAGAR

#include<bits/stdc++.h>
using namespace std;

#define ll long long int
#define ull unsigned long long
#define pll pair<ll,ll>
#define MS(x, y) memset(x, y, sizeof(x))
#define all(x) x.begin(),x.end()
#define ff first
#define ss second
#define INFL LLONG_MAX
#define pb push_back
#define FIO ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);

const ll N = 1e5 + 5;
const ll M = 1e5 + 5;
const ll mod = 1e9 + 7;
const ll m1 = 1e9 + 7;
const ll m2 = 1e9 + 9;
const ll p1 = 402653189;
const ll p2 = 1610612741;
const int LN = 32;

ll powermodm(ll x,ll n,ll M){ll result=1;while(n>0){if(n % 2 ==1)result=(result * x)%M;x=(x*x)%M;n=n/2;}return result;}
ll power(ll _a,ll _b){ll _r=1;while(_b){if(_b%2==1)_r=(_r*_a);_b/=2;_a=(_a*_a);}return _r;}
ll gcd(ll a,ll b){if(a==0)return b;return gcd(b%a,a);}
ll lcm(ll a,ll b){return (max(a,b)/gcd(a,b))*min(a,b);}

ll dx[4]={-1,  1,  0,  0};
ll dy[4]={ 0,  0,  1, -1};

ll pw[LN],fact[N],invfact[N];

void pre()
{
    fact[0]=1;
    for(int i=0;i<LN;i++)pw[i]=power(2,i);
    for(int i=1;i<N;i++)fact[i]=(i*fact[i-1])%mod;
    for(int i=0;i<N;i++)invfact[i]=powermodm(fact[i],mod-2,mod);
}



int main()
{
    FIO;
    //pre();

    ll i,j;
    
    ll n;
    cin>>n;
    
    ll ans = 0;
    
    for(i=1;i<=n;i++)
    {
        ll tmp = i;
        ll sum = 0;
        
        while(tmp)
        {
            sum++;
            tmp/=10;
        }
        
        if(sum%2)
            ans++;
    }
    
    cout<<ans;
    
    
    return 0;
}

Measured memory_bytes: 256
// B - Trained?
#include <bits/stdc++.h>
using namespace std;
using vi = vector<int>;
#define rp(i,s,e) for(int i=(s);i<(e);++i)

int main(){
	int N; cin>>N;
	vi A(N); rp(i, 0, N){cin>>A[i]; --A[i];}
	vi visited(N, false);
	int a = 0;
	visited[a] = true;
	rp(t, 1, N+1){
		a = A[a];
		if(visited[a]) break;
		visited[a] = true;
		if(a == 1){
			cout<< t <<endl;
			return 0;
		}
	}
	cout<< -1 <<endl;
}

Measured memory_bytes: 1024
#include <bits/stdc++.h>
#define LL long long
using namespace std;
const LL Maxn = 100000 + 100;
LL A[Maxn], d[Maxn], P[Maxn];
LL Tmp[Maxn], Ans[Maxn];
LL N, M;
LL K;
inline void Pow()
{
	LL b = K;
	for (LL i = 1; i <= N; ++i) Ans[i] = i;
	while (b)
	{
		if (b & 1)
		{
			for (LL i = 1; i <= N; ++i) Tmp[i] = Ans[P[i]];
			for (LL i = 1; i <= N; ++i) Ans[i] = Tmp[i];
		}
		for (LL i = 1; i <= N; ++i) Tmp[i] = P[P[i]];
		for (LL i = 1; i <= N; ++i) P[i] = Tmp[i];
		b >>= 1;
	}
	for (LL i = 1; i <= N; ++i) Tmp[i] = d[Ans[i]];
	for (LL i = 1; i <= N; ++i) d[i] = Tmp[i];
}
int main()
{
#ifdef hk_cnyali
	freopen("C.in", "r", stdin);
	freopen("C.out", "w", stdout);
#endif
	scanf("%lld", &N);
	for (LL i = 1; i <= N; ++i)
		scanf("%lld", &A[i]), d[i] = A[i] - A[i - 1];
	scanf("%lld %lld", &M, &K);
	for (LL i = 1; i <= N; ++i) P[i] = i;
	for (LL i = 1; i <= M; ++i)
	{
		LL x; scanf("%lld", &x);
		swap(P[x], P[x + 1]);
	}
	Pow();
	LL Sum = 0;
	for (LL i = 1; i <= N; ++i)
	{
		Sum += d[i];
		cout<<Sum<<endl;
	}
	return 0;
}

Measured memory_bytes: 5120
package main

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

func main() {

	a := nextInt64()
	b := nextInt64()
	c := nextInt64()

	d := c - a - b
	if d >= 0 && 4*a*b < d*d {
		fmt.Println("Yes")
	} else {
		fmt.Println("No")
	}
}

var stdin = initStdin()

func initStdin() *bufio.Scanner {
	bufsize := 1 * 1024 * 1024 // 1 MB
	var stdin = bufio.NewScanner(os.Stdin)
	stdin.Buffer(make([]byte, bufsize), bufsize)
	stdin.Split(bufio.ScanWords)
	return stdin
}

func nextString() string {
	stdin.Scan()
	return stdin.Text()
}

func nextBytes() []byte {
	stdin.Scan()
	return stdin.Bytes()
}

func nextInt() int {
	i, _ := strconv.Atoi(nextString())
	return i
}

func nextInt64() int64 {
	i, _ := strconv.ParseInt(nextString(), 10, 64)
	return i
}


Measured memory_bytes: 640
#include <cstdio>
#define MAX_NODE_SIZE 25
#define NULL_INDEX -1

struct Node {
  int parent_index;
  int left_child_index;
  int right_child_index;
};

void init_tree(Node tree[], int size) {
  for(int i = 0; i < size; i++) {
    tree[i].parent_index = NULL_INDEX;
    tree[i].left_child_index = NULL_INDEX;
    tree[i].right_child_index = NULL_INDEX;
  }
}

void walk_preorder(Node tree[], int current_node_index) {
  Node current_node = tree[current_node_index];

  if(current_node_index == NULL_INDEX) {
    return;
  }

  printf(" %d", current_node_index);
  walk_preorder(tree, current_node.left_child_index);
  walk_preorder(tree, current_node.right_child_index);
}

void walk_inorder(Node tree[], int current_node_index) {
  Node current_node = tree[current_node_index];

  if(current_node_index == NULL_INDEX) {
    return;
  }

  walk_inorder(tree, current_node.left_child_index);

  printf(" %d", current_node_index);

  walk_inorder(tree, current_node.right_child_index);
}

void walk_postorder(Node tree[], int current_node_index) {
  Node current_node = tree[current_node_index];

  if(current_node_index == NULL_INDEX) {
    return;
  }

  walk_postorder(tree, current_node.left_child_index);
  walk_postorder(tree, current_node.right_child_index);

  printf(" %d", current_node_index);
}

int main() {
  int node_size;
  Node tree[MAX_NODE_SIZE];

  scanf("%d%*c", &node_size);
  init_tree(tree, node_size);

  for(int i = 0; i < node_size; i++) {
    int node_index, left_child_index, right_child_index;
    scanf("%d %d %d%*c", &node_index, &left_child_index, &right_child_index);

    tree[node_index].left_child_index = left_child_index;
    tree[node_index].right_child_index = right_child_index;

    if(left_child_index != NULL_INDEX) {
      tree[left_child_index].parent_index = node_index;
    }
    if(right_child_index != NULL_INDEX) {
      tree[right_child_index].parent_index = node_index;
    }
  }

  int root_index;
  for(int i = 0; i < node_size; i++) {
    if(tree[i].parent_index == NULL_INDEX) {
      root_index = i;
      break;
    }
  }


  printf("Preorder\n");
  walk_preorder(tree, root_index);
  printf("\n");

  printf("Inorder\n");
  walk_inorder(tree, root_index);
  printf("\n");

  printf("Postorder\n");
  walk_postorder(tree, root_index);
  printf("\n");
}



Measured memory_bytes: 2740
s = input().split()
n = input().split()
kaisuu = int(s[0])
sum = int(0)
count = 0;

for i in range(kaisuu):
    if (sum <= int(s[1])):
        sum += int(n[i])
        if (sum <= int(s[1])):
        	count+=1

print(count+1)

Measured memory_bytes: 3064
//#pragma GCC optimize("Ofast,no-stack-protector,unroll-loops")
//#pragma GCC target("avx,avx2")
//#pragma GCC target("avx2")
//#pragma GCC optimize("O3")

//# include <x86intrin.h>
# include <bits/stdc++.h>

# include <ext/pb_ds/assoc_container.hpp>
# include <ext/pb_ds/tree_policy.hpp>

using namespace __gnu_pbds;
using namespace std;
 
template<typename T> using ordered_set = tree <T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;

#define _USE_MATH_DEFINES_
#define ll long long
#define ld long double
#define Accepted 0
#define pb push_back
#define mp make_pair
#define sz(x) (int)(x.size())
#define every(x) x.begin(),x.end()
#define F first
#define S second
#define lb lower_bound
#define ub upper_bound
#define For(i,x,y)  for (ll i = x; i <= y; i ++) 
#define FOr(i,x,y)  for (ll i = x; i >= y; i --)
#define SpeedForce ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0)
// ROAD to...                                                                                                                                                                                                                Red

void setIn(string s) { freopen(s.c_str(),"r",stdin); }
void setOut(string s) { freopen(s.c_str(),"w",stdout); }
void setIO(string s = "") {
	// cin.exceptions(cin.failbit); 
	// throws exception when do smth illegal
	// ex. try to read letter into int
	if (sz(s)) { setIn(s+".in"), setOut(s+".out"); } // for USACO
}

const double eps = 0.000001;
const ld pi = acos(-1);
const int maxn = 1e7 + 9;
const int mod = 1e9 + 7;
const ll MOD = 1e18 + 9;
const ll INF = 1e18 + 123;
const int inf = 2e9 + 11;
const int mxn = 1e6 + 9;
const int N = 6e5 + 123;                                          
const int M = 22;
const int pri = 997;
const int Magic = 2101;

const int dx[] = {-1, 0, 1, 0};
const int dy[] = {0, -1, 0, 1};
mt19937 gen(chrono::steady_clock::now().time_since_epoch().count());
 
int rnd (int l, int r) {
	return uniform_int_distribution<int> (l, r)(gen);
}
int n, k, a[N];

int main () {
	SpeedForce;
	
	cin >> n >> k;
	for (int i = 1; i <= n; ++i) {
		cin >> a[i];
	}

	for (int i = 1; i + k <= n; ++i) {
		cout << (a[i+k] > a[i] ? "Yes\n" : "No\n");
	}

	return Accepted;
}

// B...a

Measured memory_bytes: 4448
#include <algorithm>
#include <iostream>
#include <cstdio>
#include <vector>
#include <cmath>
#include <queue>
#include <stack>
#include <set>
using namespace std;
#define fi first
#define se second
typedef long long lli;
typedef pair<int, int> pii;
const int maxn = 1e5 + 5;
int n;
int a[maxn][3];

int dp[maxn][3];

void ReadInput()
{
    cin >> n;
    for(int i = 1; i <= n; ++i)
        for(int j = 0; j < 3; ++j)
            cin >> a[i][j];
}

void Solve()
{
    fill_n(&dp[0][0], sizeof(dp) / sizeof(dp[0][0]), -1);
    for(int j = 0; j < 3; ++j)
        dp[1][j] = a[1][j];
    for(int i = 1; i < n; ++i)
        for(int j = 0; j < 3; ++j)
            for(int k = 0; k < 3; ++k)
                if(k != j) dp[i + 1][k] = max(dp[i + 1][k], dp[i][j] + a[i + 1][k]);
    int ans = -1;
    for(int j = 0; j < 3; ++j)
        ans = max(ans, dp[n][j]);
    cout << ans << '\n';
}

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    ReadInput();
    Solve();
}


Measured memory_bytes: 2560
#include<bits/stdc++.h>
using namespace std;
int main(){
  string s;
  cin >> s;
  cout << (s[0]!='A' || count(s.begin()+2,s.end()-1,'C')!=1 || count_if(s.begin(),s.end(),[](char ch){return 'A'<=ch && ch<='Z';})!=2 ? "WA" : "AC") << endl;
  return 0;
}

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

#define watch(x) cout << (#x) << " is " << (x) << endl
#define fr(i,n) for(int i=0; i<n; i++)
#define rep(i, st, en) for(int i=st; i<=en; i++)
#define repn(i, st, en) for(int i=st; i>=en; i--)
#define sq(a) (a*a)
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
ll mod = 1e9+7;

ll gcdll(ll a, ll b){
    if(!b) return a;
    return gcdll(b, a%b);
}

void seive(int n){
    vector<bool> is_prime(n+1, true);
    is_prime[0] = is_prime[1] = false;

    for(int i=2; i*i<=n; i++){
        if(is_prime[i]){
            for(int j=i*i; j<=n; j+=i){
                is_prime[j] = false;
            }
        }
    }
}

vector<int> constructZFunc(string s){
    int n = s.size();
    vector<int> z(n);
    int l, r;
    l = r = 0;
    z[0] = 0;
    rep(i, 1, n-1){
        z[i] = 0;
        if(i<=r){
            z[i] = min(r-i+1, z[i-l]);  /// initialization, req. for linear time approach.
        }
        while(i+z[i] < n && s[z[i]] == s[i+z[i]])
            ++z[i];
        if(i+z[i]-1 > r){
            r = i+z[i]-1;
            l = i;
        }
    }
    return z;
}

const double PI = std::atan(1.0)*4;

void solve(){
    double r;
    cin>>r;
    cout<<2*PI*r;
}

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

    ll t = 1;
    //  cin>>t;
    while(t--){
        solve();
    }

    return 0;
}



Measured memory_bytes: 3804
//#include<bits/stdc++.h>
#include<iostream>
#include<iomanip>
#include<cstdio>
#include<algorithm>
#include<cmath>
#include<string>
#include<numeric>
#include<vector>
#include<set>
#include<map>
#include<unordered_map>
#include<stack>
#include<queue>
#include<list>
using namespace std;

typedef long long ll;

#define INF 1000000007

int main(){
  ll n;
  cin >> n;
  ll a[n],b[n];
  for(int i=0;i<n;i++){
    cin >> a[i];
  }
  for(int i=0;i<n;i++){
    cin >> b[i];
  }
  bool spe = true;
  if(n == 2){
    for(int i=0;i<2;i++){
      if(a[i] > b[i]){
        spe = false;
      }
    }
    if(spe) cout << "Yes" << endl;
    else cout << "No" << endl;
    return 0;
  }
  pair<ll,ll> c[n];
  for(int i=0;i<n;i++){
    c[i] = make_pair(b[i],i);
  }
  sort(c,c+n);
  ll p[n],q[n];
  for(int i=0;i<n;i++){
    p[i] = a[c[i].second];
    q[i] = b[c[i].second];
  }
  sort(a,a+n);
  sort(b,b+n);
  bool flag = false;
  for(int i=0;i<n;i++){
    if(a[i] > b[i]){
      flag = true;
    }
  }
  if(flag){
    cout << "No" << endl;
    return 0;
  }
  for(int i=0;i<n-1;i++){
    if(a[i+1] <= b[i]){
      cout << "Yes" << endl;
      return 0;
    }
  }

  for(int i=0;i<n;i++){
    c[i] = make_pair(p[i],i);
  }

  sort(c,c+n);
  vector<ll> graph[n];
  ll color[n];
  for(int i=0;i<n;i++){
    color[i] = 0;
    graph[i].push_back(c[i].second);
  }

  color[0] = 1;
  ll temp = 0;
  for(int i=0;i<n;i++){
    color[temp] = 1;
    temp = graph[temp][0];
  }
  flag = false;
  for(int i=0;i<n;i++){
    if(color[i] == 0) flag = true;
  }
  if(flag) cout << "Yes" << endl;
  else cout << "No" << endl;

  return 0;
}

Measured memory_bytes: 11136
/*
asnasncsja
asncansca
ascnasncaks
sacnjsc
*/
#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cmath>
#include <queue>
#include <cstring>
#include <string>
#include <bitset>
#include <stack>
#include <set>
#include <map>
#include <list>
using namespace std;
#define e exp(1.0)
typedef long long ll;
#define MAXN 100005
#define mod 998244353
#define INF 0x3f3f3f3f
#define fe(i,st,en) for(i = (st);i <= (en);++i)
#define fne(i,st,en) for(i = (st);i < (en);++i)
#define ri register int
#define db double
int main() {
	string s;
	cin >> s;
	int c = 0, a[4];
	for (int i = 0; s[i]; ++i)a[i] = s[i] - '0';
	int x = a[0] * 10 + a[1], y = a[2] * 10 + a[3];
	if (x <= 12 && y <= 12 && x >= 1&& y >= 1) {
		puts("AMBIGUOUS");
	}
	else if (x <= 12 && x >= 1) {
		puts("MMYY");
	}
	else if (y <= 12 && y >= 1) {
		puts("YYMM");
	}
	else {
		puts("NA");
	}
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
using namespace std;
#ifdef ENABLE_DEBUG
#define dump(a) cerr<<#a<<"="<<a<<endl
#define dumparr(a,n) cerr<<#a<<"["<<n<<"]="<<a[n]<<endl
#else
#define dump(a) 
#define dumparr(a,n) 
#endif
#define FOR(i, a, b) for(ll i = a;i < b;i++)
#define For(i, a) FOR(i, 0, a)
#define REV(i, a, b) for(ll i = b-1;i >= a;i--)
#define Rev(i, a) REV(i, 0, a)
#define REP(a) For(i, a)
#define SIGN(a) (a==0?0:(a>0?1:-1))

typedef long long int ll;
typedef unsigned long long ull;
typedef unsigned int uint;
typedef pair<ll, ll> pll;
typedef pair<ll,pll> ppll;
typedef vector<ll> vll;
typedef long double ld;
typedef pair<ld,ld> pdd;

const ll INF=(1LL<<50);
#if __cplusplus<201700L
ll gcd(ll a, ll b) {
  if(a < b) return gcd(b, a);
  ll r;
  while ((r=a%b)) {
    a = b;
    b = r;
  }
  return b;
}
#endif
template<class T>
bool chmax(T& a,const T& b){
  if(a<b){
    a=b;
    return true;
  }
  return false;
}
template<class T>
bool chmin(T& a,const T& b){
  if(a>b){
    a=b;
    return true;
  }
  return false;
}
template<class S,class T>
std::ostream& operator<<(std::ostream& os,pair<S,T> a){
  os << "(" << a.first << "," << a.second << ")";
  return os;
}
template<class T>
std::ostream& operator<<(std::ostream& os,vector<T> a){
  os << "[ ";
  REP(a.size()){
    os<< a[i] << " ";
  }
  os<< " ]";
  return os;
}

void print(const vector<ll> &p){
  REP(p.size()){
    cout<<(char)(p[i]+'a');
  }
  cout<<endl;
}
void solve(long long N){
  if(N==1){
    cout<<"a"<<endl;
    return;
  }
  vector<ll> ans(N);
  while(true){
    print(ans);
    vector<set<ll>> tmp(N);
    REP(N){
      if(i!=0){
          tmp[i]=tmp[i-1];
      }
      tmp[i].insert(ans[i]);
    }
    ++ans[N-1];
    if(ans[N-1]==N){
      break;
    }
    ll cur=N-1;
    while(ans[cur]>tmp[cur-1].size()){
      ans[cur]=0;
      ++ans[cur-1];
      --cur;
    }
  }
}

int main(){
  cout<<setprecision(1000);
    long long N;
    scanf("%lld",&N);
    solve(N);
    return 0;
}


Measured memory_bytes: 1536
#include <bits/stdc++.h>
#define ll long long
using namespace std;
const int MAXN=2000010,P=1e9+7;
int fac[MAXN],inv[MAXN];
ll s1[MAXN],s2[MAXN];
int r1,c1,r2,c2;
int qpow (int a,int b) {
	int res=1;
	while (b) {
		if (b&1) {res=(1ll*res*a)%P;}
		a=(1ll*a*a)%P,b>>=1; 
 	}
 	return res;
}
void init (int x) {
	fac[0]=inv[0]=1;
	for (int i=1;i<=x;i++) {fac[i]=(1ll*fac[i-1]*i)%P;}
	inv[x]=qpow(fac[x],P-2);
	for (int i=x-1;i>=1;i--) {inv[i]=(1ll*inv[i+1]*(i+1))%P;}
	return;
}
int c (int n,int m) {return (1ll*fac[n]*((1ll*inv[m]*inv[n-m])%P))%P;}
ll calc (int n,int m) {
	if (n==0) {return m+1;}
	if (m==0) {return n+1;}
	for (int i=0;i<=n;i++) {s1[i]=qpow(2,i);}
	for (int i=n+1;i<=n+m;i++) {s1[i]=(s1[i-1]*2-c(i-1,n)+P)%P;}
	for (int i=1;i<=m;i++) {s2[i]=0;}
	s2[m+1]=1;
	for (int i=m+2;i<=n+m;i++) {s2[i]=(s2[i-1]*2-c(i-1,i-m-2)+c(i,i-m-1)+P)%P;}
	ll res=0;
	for (int i=0;i<=n+m;i++) {
		res=(res+s1[i]-s2[i]+P)%P;
	}
	return res;
}
int main () {
	scanf("%d%d%d%d",&r1,&c1,&r2,&c2);
	init(2000000);
	printf("%d",(calc(r2,c2)+calc(r1-1,c1-1)-calc(r1-1,c2)-calc(r2,c1-1)+P+P)%P);
	return 0;
}

Measured memory_bytes: 47104
#include<bits/stdc++.h>
#define mxn 1000010
#define db double
#define LL long long
#define ldb long double
#define ull unsigned long long
#define pb push_back
#define ppb pop_back
#define pf push_front
#define pul pair<ull,LL> 
#define pii pair<int,int> 
#define mp make_pair
#define fr first
#define sc second
#define x1 faqx1
#define y1 faqy1
#define x2 faqx2
#define y2 faqy2
using namespace std;
const int mod=998244353;
template<typename T> void chkmin(T &x,T y) {if(y<x) x=y;}
template<typename T> void chkmax(T &x,T y) {if(y>x) x=y;}
template<typename T> void upd(T &x,T y) {if((x+=y)>=mod) x-=mod;}
int n,m,sl,fh;
int rd()
{
	sl=0;fh=1;
	char ch=getchar();
	while(ch<'0'||'9'<ch) {if(ch=='-') fh=-1; ch=getchar();}
	while('0'<=ch&&ch<='9') sl=sl*10+ch-'0',ch=getchar();
	return sl*fh;
}
int main()
{
	n=rd();m=rd();
	printf("%d\n",n*(n-1)/2+m*(m-1)/2);
	return 0;
}

Measured memory_bytes: 256
import itertools
N, M, Q = map(int, input().split())
q_list = [list(map(int, input().split())) for q in range(Q)]


A_list = list(itertools.combinations_with_replacement(range(1, M+1), N))
ans = 0
for A in A_list:
    # print(A[0])
    sum = 0
    for a, b, c, d in q_list:
        if A[b-1] - A[a-1] == c:
            sum += d
    ans = max(ans, sum)

print(ans)


Measured memory_bytes: 21568
#include<bits/stdc++.h>
#define range(i,a,b) for(int i = (a); i < (b); i++)
#define rep(i,b) for(int i = 0; i < (b); i++)
#define all(a) (a).begin(), (a).end()
#define debug(x) cout << "debug " << x << endl;
const int INF = 100000000;
using namespace std;

void push(int m[101][2], int cp[101][2], int i, int j, int x){
    if(cp[i + x][0] == 0){
        cp[i + x][0] = m[i][j];
    }else{
        cp[i + x][1] = m[i][j];
    }
}

int main(){
    int n, l;
    while(cin >> n >> l, n||l){
        int m[101][2] = {0};
        rep(i,n){
            int p;
            char c;
            cin >> c >> p;
            if(c == 'R') m[p][0] = i + 1;
            else m[p][0] = -1 * (i + 1);
        }

        int time = 0;
        int last_ant = -1;
        while(n){
            int cp[101][2] = {0};
            //rep(i,l + 1){ cout << m[i][0] << ' '; }cout << endl;
            rep(i,l + 1){
                rep(j,2){
                    if(m[i][j] > 0){
                        push(m, cp, i, j, 1);
                    }else if(m[i][j] < 0){
                        push(m, cp, i, j, -1);
                    }
                }
            }
            rep(i,l + 1){
                if(cp[i][0] != 0 && cp[i][1] != 0){
                    cp[i][0]*=-1;
                    cp[i][1]*=-1;
                }
            }
            if(cp[l][0] != 0){
                n--;
                if(n == 0) last_ant = cp[l][0];
                cp[l][0] = 0;
            }
            if(cp[0][0] != 0){
                n--;
                if(n == 0) last_ant = cp[0][0];
                cp[0][0] = 0;
            }
            memcpy(m, cp, sizeof(m));
            time++;
        }
        cout << time << ' ' << abs(last_ant) << endl;
    }
}

Measured memory_bytes: 3076
#include <bits/stdc++.h>
typedef long long ll;
typedef long double ld;
const int INF=1e9,MOD=1e9+7,ohara=1e6;
const ll LINF=1e18;
using namespace std;

#define rep(i,n) for(int (i)=0;(i)<(int)(n);(i)++)
#define rrep(i,a,b) for(int i=(a);i<(b);i++)
#define rrrep(i,a,b) for(int i=(a);i>=(b);i--)
#define all(v) (v).begin(), (v).end()
#define Size(n) (n).size()
#define Cout(x) cout<<(x)<<endl

ll n,cnt,ans,a[305][305],b,c,d,tmp,tmpp,m,h,w,x,y,sum,pos,flo[305][305];
ld doua;
int dy[]={1,0,-1,0};
int dx[]={0,1,0,-1};
//int dy[]={-1,0,1,-1,1,-1,0,1};
//int dx[]={-1,-1,-1,0,0,1,1,1};
string alph("abcdefghijklmnopqrstuvwxyz"),s;
bool fl;
struct edge{int to,cost;};

//-------------------------↓↓↓↓↓↓------------------------

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

    cin>>n;
    rep(i,n)rep(j,n)cin>>a[i][j];
    rep(i,n+1){
        rep(j,n+1){
            if(i!=j)flo[i][j]=LINF;
        }
    }
    rep(i,n){
        rep(j,n){
            if(i>=j)continue;
            flo[i][j]=a[i][j];
            flo[j][i]=a[i][j];
        }
    }
    rep(i,n){
        rep(j,n){
            rep(k,n){
                flo[j][k]=min(flo[j][i]+flo[i][k],flo[j][k]);
            }
        }
    }
    rep(i,n){
        rep(j,n){
            if(i>=j)continue;
            if(flo[i][j]!=a[i][j]){
                Cout(-1);
                return 0;
            }
        }
    }
    rep(i,n){
        rep(j,n){
            if(i>=j)continue;
            ll fr,to;
            fr=i;to=j;
            b=0;
            rep(k,n){
                if(fr==k||to==k)continue;
                if(flo[fr][to]==flo[fr][k]+flo[k][to])b=1;
            }
            if(!b)ans+=a[i][j];
        }
    }
    Cout(ans);
    return 0;
}


Measured memory_bytes: 1664
import java.io.PrintWriter
import java.util.*

fun main(args: Array<String>) {
    val n = readLine()!!.toInt()

    val g = Array(n + 1) { mutableMapOf<Int, Int>() }
    val edges = (1 until n).map {
        val (a, b) = readLine()!!.split(' ').map { it.toInt() }
        g[a][b] = 0
        g[b][a] = 0
        a to b
    }

    var k = 0
    val queue = ArrayDeque<Pair<Int, Int>>()
    queue.addLast(1 to 0)

    while (queue.isNotEmpty()) {
        val (current, parent) = queue.removeFirst()
        var c = 0
        for (v in g[current]) {
            if (v.key == parent) continue
            c++
            if (c == g[current][parent]) c++
            if (c > k) {
                k = c
            }
            g[current][v.key] = c
            g[v.key][current] = c
            queue.addLast(v.key to current)
        }
    }

    val pw = PrintWriter(System.out)
    pw.println(k)
    edges.forEach { pw.println(g[it.first][it.second]) }
    pw.flush()
}


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

int main(){
	int a, count;
	while(1){
		count = 0;
		cin >> a;
		if(a == 0)
			break;
		while(a != 1){
			if(a%2 == 0){
				a /= 2;
			}else{
				a = a*3+1;
			}
			count++;
		}
		cout << count << endl;
	}
	
	return 0;
}

Measured memory_bytes: 1160
#include <bits/stdc++.h>
#include <numeric>
#define rep(i, n) for(ll i=0; i < n; i++)
#define reps(i, n) for(ll i=1; i <= n; i++)
#define INF 1e9
#define ALL(v) v.begin(), v.end()
#define pb(x) push_back(x)
#define mp(x,y) make_pair(x,y)

using namespace std;
using ll=long long;

int main() {
  int n;cin >> n;
  if(n==1){cout << "Hello World"<< endl; return 0;}
  else{
    int a,b;cin >> a >> b;
    cout << a+b<<endl;
  }
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <vector>
#include <cstdlib>
#include <cstdio>
#include <cmath>
#include <algorithm>
#include <map>
#include <stack>
#include <queue>
#include <set>
#include <cstring>

using namespace std;
// ascending order
#define vsort(v) sort(v.begin(), v.end())
// descending order
#define vsort_r(v) sort(v.begin(), v.end(), greater<int>())
#define vunique(v) unique(v.begin(), v.end())
#define mp make_pair
#define ts(x) to_string(x)
typedef long long ll;
typedef pair<int, int> P;
const ll INF = 1e18;

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


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

#define fio                           \
	ios_base::sync_with_stdio(false); \
	cin.tie(NULL);                    \
	cout.tie(NULL);
#define ll long long
#define ull unsigned long long
#define ld long double
#define endl "\n"
#define ff first
#define ss second
#define pi pair<ll, ll>
#define PI 3.141592653589793238462643383279502884L
#define mp make_pair
#define pb push_back
#define fall(i, a, b) for (int i = a; i < b; i++)
#define sz(x) (ll) x.size()
#define all(x) x.begin(), x.end()
#define ed cout << "ed";
#define time_passed 1.0 * clock() / CLOCKS_PER_SEC
ll MOD = 1e9 + 7;
ll MOD1 = 1e9 + 123;
ll MOD2 = 1e9 + 321;

int main()
{
	fio;
	ll t, a, n, q, k, i, m, c, u, f, j, p, x, y, s, b, d;
cin>>n>>x>>t;
if(n%x!=0)cout<<t*(n/x+1);
else
	cout << t * (n / x );
	 return 0;
}



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

using namespace std;

//#define FILE_IO

int N;
int f[30], its[30];
char s[105];

int main()
{
    #ifdef FILE_IO
    freopen("1.in", "r", stdin);
    freopen("1.out", "w", stdout);
    #endif

    scanf("%d\n", &N);
    for(int i = 0; i < 26; i++)
        its[i] = 1 << 30;
    for(int i = 1; i <= N; i++)
    {
        scanf("%s", s);
        int M = strlen(s);
        memset(f, 0, sizeof(f));
        for(int i = 0; i < M; i++)
            f[ s[i] - 'a' ]++;
        for(int i = 0; i < 26; i++)
            its[i] = min(its[i], f[i]);
    }

    for(int i = 0; i < 26; i++)
        for(int j = 1; j <= its[i]; j++)
            printf("%c", 'a' + i);

    return 0;
}


Measured memory_bytes: 764
#include <cstdio>
#include <iostream>
#include <cstdlib>
#include <unordered_map>
#include <map>
#include <unordered_set>
#include <set>
#include <vector>
#include <string>
#include <sstream>
#include <algorithm>
#include <cmath>
#include <queue>
#include <stack>
#include <list>
#include <array>
#include <deque>
#include <bitset>
typedef long long ll;
using namespace std;
#define trace(x) cerr << #x << " is " << x << endl;
 

int main() {
    int n;
    cin >> n;
    unordered_set<int> st;
    int a;
    for (int i = 0; i < n; i++) {
        cin >> a;
        if (st.count(a)) {
            cout << "NO" <<endl;
            return 0;
        }
        st.insert(a);
    }
    cout << "YES" <<endl;
    return 0;
}

Measured memory_bytes: 8520
#include<bits/stdc++.h>
#define REP(i, n) for (int i = 0; i < n ; i++)
#define FOR(i, a, b) for (int i = (a); i < (b); i++)
#define whole(f, x, ...) ([&](decltype((x)) whole) { return (f)(begin(whole), end(whole), ## __VA_ARGS__); })(x) // decltypeで型取得、引数があればva_argsのところに入れる
#define Memset(x,y) memset(x,y,sizeof(x))
using namespace std;
typedef long long ll; // long longをllでかけるようにした
const int INF = 1e9;
const double PI = 3.1415926535;
const int MOD = 1000000007; // 計算してからmodで割る ans = (ans * a) % mod
#define int long long
template <typename T = long long > T in () { T x; cin >> x; return(x);}
// int a = in() のように使うlong long以外の型の時はstirng s = in<string>()のように型を指定する

// ここから

static const int MAX_V = 100100; // nによって変える
struct edge {int to, cost; };
typedef pair<int, int> P; // firstは最短距離, secondは頂点の番号

int V; // 頂点数
vector<edge> G[MAX_V];
int d[MAX_V]; // 距離

void dijkstra(int s) {
    priority_queue<P, vector<P>, greater<P> > que;
    fill(d, d +V, INF);
    d[s] = 0;
    que.push(P(0, s));

    while (!que.empty()){
        P p = que.top(); que.pop();
        int v = p.second;
        if (d[v] < p.first) continue; // 取り出したものが頂点の最短距離でなければ無視
        REP(i, G[v].size()){
            edge e = G[v][i];
            // 行先Aへいくためにかかるコストが、今まで見つけたAへのコストより小さければ更新            
            if(d[e.to] > d[v] + e.cost){
                d[e.to] = d[v] + e.cost;
                que.push(P(d[e.to], e.to));
            }
        }
    }
}

signed main(void){
    int e, r; cin >> V >> e >> r;
    REP(i, e){
        int s, t, d; cin >> s >> t >> d;
        G[s].push_back({t, d});
    }
    dijkstra(r);
    REP(i, V){
        if(d[i] == INF) cout << "INF" << endl;
        else cout << d[i] << endl;
    }
}


Measured memory_bytes: 19396
#include<stdio.h>
#include<iostream>
#include<algorithm>
#define N 105
using namespace std;

short line[N][N],list[N][N],ans[N][N][N][N],n,m,op,sx,sy;
char s[N][N];

int main()
{
	cin>>n>>m;
	for (short i=1;i<=n;i++) scanf("%s",s[i]+1);
	for (short i=1;i<=n;i++) for (short j=1;j<=m;j++)
	{
		line[i][j]=line[i][j-1]+(s[i][j]=='o');
		list[i][j]=list[i-1][j]+(s[i][j]=='o');
		if (s[i][j]=='E') sx=i,sy=j;
	}
	for (short i=sx;i;i--) for (short j=sy;j;j--) 
		for (short k=sx;k<=n;k++) for (short p=sy;p<=m;p++)
	{
		if (1<i && k+1<sx+i) op=max(op,ans[i-1][j][k][p]=max((int)ans[i-1][j][k][p],ans[i][j][k][p]+line[i-1][min((int)p,m-sy+j)]-line[i-1][max(j-1,p-sy)]));
		if (k<n && sx+k<n+i) op=max(op,ans[i][j][k+1][p]=max((int)ans[i][j][k+1][p],ans[i][j][k][p]+line[k+1][min((int)p,m-sy+j)]-line[k+1][max(j-1,p-sy)]));
		if (1<j && p+1<sy+j) op=max(op,ans[i][j-1][k][p]=max((int)ans[i][j-1][k][p],ans[i][j][k][p]+list[min((int)k,n-sx+i)][j-1]-list[max(i-1,k-sx)][j-1]));
		if (p<m && sy+p<m+j) op=max(op,ans[i][j][k][p+1]=max((int)ans[i][j][k][p+1],ans[i][j][k][p]+list[min((int)k,n-sx+i)][p+1]-list[max(i-1,k-sx)][p+1]));
	}
	cout<<op;
}

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

int a[5];

int main(){
	bool flag=true;
	int ans=0;
	for(int i=0;i!=5;++i){
		cin>>a[i];
		ans+=a[i]/10*10;
		a[i]%=10;
	}
	sort(a,a+5);
	for(int i=0;i!=5;++i){
		if(a[i]&&flag){ans+=a[i];flag=false;}
		else if(a[i])ans+=10;
	}
	cout<<ans<<endl;
	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <map>
#include <iomanip>
#include <cmath>
#include <cstdlib>
#include <math.h>
#include <stdlib.h>
#include <numeric>

int main(){
	int m, n;
	std::cin >> n >> m;
	char a[50][50], b[50][50];
	for(int i = 0; i < n; i++){
		for(int j = 0; j < n; j++){
			std::cin >> a[i][j];
		}
	}
	for(int i = 0; i < m; i++){
		for(int j = 0; j < m; j++){
			std::cin >> b[i][j];
		}
	}
	for(int i = 0; i < n - m + 1; i++){
		for(int j = 0; j < n - m + 1; j++){
			bool how = true;
			for(int k = 0; k < m; k++){
				for(int l = 0; l < m; l++){
					if(how){
						how = (a[i+k][j+l] == b[k][l]);
					}
				}
			}
			if(how){
				std::cout << "Yes" << std::endl;
				return 0;
			}
		}
	}
	std::cout << "No" << std::endl;
	return 0;
}



Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define ll long long int
ll ar[500009],br[500009];
int main()
{
    ll a,b,c,i,j,k;
    string s,d;
    cin>>a>>b;
    if(a<b)
    {
        for(i=1;i<=b;i++)
        {
            cout<<a;
        }
    }
    else
    {
       for(i=1;i<=a;i++)
        {
            cout<<b;
        }
    }
}


Measured memory_bytes: 256
N,T  = map(int,input().split())
AnsC = 9999
for item in range(N):
    C = input().split()
    if int(C[1]) <= T:
        AnsC = min(AnsC,int(C[0]))
        
#print(AnsC)
#print(T)
if AnsC >= 1001:
    print ("TLE")
else:
    print(AnsC)

Measured memory_bytes: 3060