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

using namespace std;

int main() {
    char a[10000], b[10000];
    cin >> a >> b;
    if (strlen(a) > strlen(b)) {
        cout << "GREATER" << endl;
        return 0;
    } else if (strlen(a) < strlen(b)) {
        cout << "LESS" << endl;
        return 0;
    } else {
        for (int i = 0; i < strlen(a); i++) {
            if ((int) a[i] > (int) b[i]) {
                cout << "GREATER" << endl;
                return 0;
            } else if ((int) a[i] < (int) b[i]) {
                cout << "LESS" << endl;
                return 0;
            }
        }
        cout << "EQUAL" << endl;
        return 0;
    }

    return 0;
}

Measured memory_bytes: 256
import sys
di = {1:".,!? ",2 :"abc",3:"def",4:"ghi",5:"jkl",6:"mno",7:"pqrs",8:"tuv",9:"wxyz"}
b = input()

for j in range(b):
    a = raw_input()
    count = 0
    le = 999
    for letter in a:
        if(letter == "0"):
            if(le == 999):
                pass
            else:
                sys.stdout.write(di[le][(count-1)%len(di[le])])
                count = 0
                le = 999
        else:
            le = int(letter)
            count += 1
    print ""

Measured memory_bytes: 6248
#pragma GCC optimize("Ofast")
#include<bits/stdc++.h>
using namespace std;
using ll=long long;
using datas=pair<ll,ll>;
using ddatas=pair<double,double>;
using tdata=pair<ll,datas>;
using vec=vector<ll>;
using mat=vector<vec>;
using pvec=vector<datas>;
using pmat=vector<pvec>;
#define For(i,a,b) for(i=a;i<(ll)b;i++)
#define bFor(i,a,b) for(i=a;i>=(ll)b;i--)
#define rep(i,N) For(i,0,N)
#define rep1(i,N) For(i,1,N)
#define brep(i,N) bFor(i,N-1,0)
#define all(v) (v).begin(),(v).end()
#define allr(v) (v).rbegin(),(v).rend()
#define vsort(v) sort(all(v))
#define vrsort(v) sort(allr(v))
#define endl "\n"
#define pb push_back
#define output(v) do{bool f=0;for(auto outi:v){cout<<(f?" ":"")<<outi;f=1;}cout<<endl;}while(0)
const ll mod=1000000007;
const ll inf=1LL<<60;
const double PI = acos(-1);
const double eps = 1e-9;
template<class T> inline bool chmax(T& a,T b){bool x=a<b;if(x)a=b;return x;} 
template<class T> inline bool chmin(T& a,T b){bool x=a>b;if(x)a=b;return x;} 

void startupcpp(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  cout<<fixed<<setprecision(15);
}

double distance(ddatas& x,ddatas& y){
  double a=x.first-y.first,b=x.second-y.second;
  return sqrt(a*a+b*b);
}

ll modinv(ll a) {
  ll b=mod,u=1,v=0,t;
  while(b){
    t=a/b;
    a-=t*b; swap(a,b);
    u-=t*v; swap(u,v);
  }
  return (u+mod)%mod;
}

ll moddevide(ll a,ll b){return (a*modinv(b))%mod;}

vec modncrlistp,modncrlistm;

ll modncr(ll n,ll r){
  ll i,size=modncrlistp.size();
  if(size<=n){
    modncrlistp.resize(n+1);
    modncrlistm.resize(n+1);
    if(!size){
      modncrlistp[0]=modncrlistm[0]=1;
      size++;
    }
    For(i,size,n+1){
      modncrlistp[i]=modncrlistp[i-1]*i%mod;
      modncrlistm[i]=modinv(modncrlistp[i]);
    }
  }
  return modncrlistp[n]*modncrlistm[r]%mod*modncrlistm[n-r]%mod;
}

ll modpow(ll a,ll n){
  ll res=1;
  while(n){
    if(n&1)res=res*a%mod;
    a=a*a%mod;
    n>>=1;
  }
  return res;
}

ll gcd(ll a,ll b){if(!b)return a;return (a%b==0)?b:gcd(b,a%b);}
ll lcm(ll a,ll b){return a/gcd(a,b)*b;}

ll countdigits(ll n){
  ll ans=0;
  while(n){n/=10;ans++;}
  return ans;
}

ll sumdigits(ll n){
  ll ans=0;
  while(n){ans+=n%10;n/=10;}
  return ans;
}
void judgement(int a){
  if(a){
    cout<<"Yes"<<endl;
  }else{
    cout<<"No"<<endl;
  }
  if(a){
    cout<<"YES"<<endl;
  }else{
    cout<<"NO"<<endl;
  }
}

int main(){
  ll i,j,N,W,x;
  cin>>N>>W;
  vec fib(W,1);
  For(i,2,W)fib[i]=fib[i-1]+fib[i-2];
  mat v(N+1,vec(W,0));
  v[0][0]=1;
  rep(i,N){
    rep(j,W){
      v[i+1][j]=v[i][j]*fib[j]%mod*fib[W-j-1]%mod;
    }
    rep(j,W-1){
      x=fib[j]*fib[max(0LL,W-j-2)];
      v[i+1][j]+=v[i][j+1]*x%mod;
      v[i+1][j]%=mod;
      v[i+1][j+1]+=v[i][j]*x%mod;
      v[i+1][j+1]%=mod;
    }
  }
  cin>>x;
  cout<<v[N][x-1]%mod<<endl;
  return 0;
}

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

#define DICE_SIZE 6

#define TOP    0
#define FRONT  1
#define RIGHT  2
#define LEFT   3
#define BACK   4
#define BOTTOM 5

using namespace std;

class Dice {
	private:
		int number[DICE_SIZE];
		int work_space[DICE_SIZE];

		void reset_number(int, int, int, int, int, int);

	public:
		Dice(int *);
		void turn(char);
		void turn_horizon();
		int peek(int);
		void set_top(int);
		int get_position(int);
		bool equals(Dice *);
};

Dice::Dice(int *number) {
	for (int i = 0; i < DICE_SIZE; i++) this->number[i] = number[i];
}

void Dice::turn(char direction) {
	for (int i = 0; i < DICE_SIZE; i++) work_space[i] = number[i];

	switch (direction) {
		case 'N':
			reset_number(work_space[1], work_space[5], work_space[2], work_space[3], work_space[0], work_space[4]);
			break;			
		case 'E':
			reset_number(work_space[3], work_space[1], work_space[0], work_space[5], work_space[4], work_space[2]);
			break;
		case 'S':
			reset_number(work_space[4], work_space[0], work_space[2], work_space[3], work_space[5], work_space[1]);
			break;
		case 'W':
			reset_number(work_space[2], work_space[1], work_space[5], work_space[0], work_space[4], work_space[3]);
			break;
	}
}

void Dice::turn_horizon() {
	for (int i = 0; i < DICE_SIZE; i++) work_space[i] = number[i];

	reset_number(work_space[0], work_space[3], work_space[1], work_space[4], work_space[2], work_space[5]);
}

int Dice::peek(int position) {
	return number[position];
}

int Dice::get_position(int num) {
	for (int i = 0; i < DICE_SIZE; i++) {
		if (number[i] == num) return i;
	}
}

void Dice::reset_number(int num0, int num1, int num2, int num3, int num4, int num5) {
	number[0] = num0;
	number[1] = num1;
	number[2] = num2;
	number[3] = num3;
	number[4] = num4;
	number[5] = num5;
}

void Dice::set_top(int num) {
	int current_position = get_position(num);

	if (current_position == RIGHT || current_position == LEFT) {
		while (peek(TOP) != num) {
			turn('W');
		}
	} else {
		while (peek(TOP) != num) {
			turn('N');
		}
	}
}

bool Dice::equals(Dice *dice) {
	bool eql_flg = true;
	for (int i = 0; i < DICE_SIZE; i++) {
		if (peek(i) != dice->peek(i)) {
			eql_flg = false;
			break;
		}
	}

	return eql_flg;
}

bool check_all_pattern(Dice *dice1, Dice *dice2) {
	bool eql_flg = false;

	for (int i = 0; i < DICE_SIZE; i++) {
		dice1->set_top(dice1->peek(i));

		for (int j = 0; j < DICE_SIZE; j++) {
			dice2->set_top(dice2->peek(j));

			for (int k = 0; k < 4; k++) {
				if (dice1->equals(dice2)) {
					eql_flg = true;
					goto RETURN;
				}

				dice2->turn_horizon();
			}
		}
	}

	RETURN:
		return eql_flg;
}

int main() {
	int n;
	int number[DICE_SIZE];
	
	cin >> n;
	Dice *dices[n];

	for (int i = 0; i < n; i++) {
		for (int j = 0; j < DICE_SIZE; j++) cin >> number[j];

		dices[i] = new Dice(number);
	}

	bool is_along_flg = true;
	for (int i = 0; i < n; i++) {
		for (int j = 0; j < n; j++) {
			if (i == j) continue;

			if (check_all_pattern(dices[i], dices[j])) {
				is_along_flg = false;
				goto END;
			}
		}
	}

	END:
		cout << (is_along_flg ? "Yes" : "No") << endl;

	return 0;
}



Measured memory_bytes: 3108
#include<iostream>
#include<algorithm>
#include<cstdio>
#include<cstring>
#include<cmath>
using namespace std;
int fa[300010];
int find(int x)
{
	return fa[x]==x?x:fa[x]=find(fa[x]);
}
bool merge(int x,int y)
{
	int f1=find(x);
	int f2=find(y);
	if(f1==f2)return false;
	fa[f2]=f1;
	return true;
}
int gcd(int a,int b)
{
	return b==0?a:gcd(b,a%b);
}
int n,m,k,Mod;
int U[50010],V[50010],C[50010];
bool vis[2][1000010];
int main()
{
	scanf("%d %d %d %d",&n,&m,&k,&Mod);
	for(int i=0;i<n*6;i++)
		fa[i]=i;
	int g=Mod;
	for(int i=1;i<=m;i++)
	{
		scanf("%d %d %d",&U[i],&V[i],&C[i]);
		if(i>1)g=gcd(g,abs(C[i]-C[1]));
	}
	Mod=gcd(Mod,3*g);
	int z=C[1]%g;
	for(int i=1;i<=m;i++)
	{
		int u=U[i];
		int v=V[i];
		int c=(C[i]-z)/g;
		for(int p=0;p<2;p++)
			for(int q=0;q<3;q++)
			{
				merge((u-1)*6+p*3+q,(v-1)*6+(p^1)*3+(2*q+c)%3);
				merge((v-1)*6+p*3+q,(u-1)*6+(p^1)*3+(2*q+c)%3);
			}
	}
	for(int p=0;p<2;p++)
	{
		int cur=(p+1)*z%Mod;
		while(!vis[p][cur]){
			vis[p][cur]=true;
			cur=cur*4%Mod;
		}
	}
	while(k--)
	{
		int s,t,r;
		scanf("%d %d %d",&s,&t,&r);
		bool flag=false;
		for(int p=0;p<2;p++)
			for(int q=0;q<3;q++)
				if(vis[p][(z+r-q*g%Mod+Mod)%Mod]
				&&find((t-1)*6)==find((s-1)*6+p*3+q))
					flag=true;
		if(flag)printf("YES\n");
		else printf("NO\n");
	}
	return 0;
}

Measured memory_bytes: 4096
n, m = map(int, input().split())
tmp = [list(map(int, input().split())) for i in range(m)]
city = [[] for i in range(n+1)]
answers = [''] * m

for i, (pref, year) in enumerate(tmp):
    city[pref].append([year, i])

for i in range(n+1):
    for j, (year, index) in enumerate(sorted(city[i])):
        ans = str(i).zfill(6) + str(j+1).zfill(6)
        answers[index] = ans

print(*answers, sep='\n')

Measured memory_bytes: 56624
#include <stdio.h>

int main(void) {
  int a, b, c, d, e;
  scanf("%d%d%d%d%d", &a, &b, &c, &d, &e);
  if(a < 0) printf("%d\n", -a * c + d + b * e);
  else printf("%d\n", (b - a) * e);
  return 0;
}


Measured memory_bytes: 2688
#include <bits/stdc++.h>
 
using namespace std;
 
struct Primal_Dual
{
  const int INF = 1 << 30;
  typedef pair< int, int > Pi;
 
  struct edge
  {
    int to, cap, cost, rev;
  };
  vector< vector< edge > > graph;
  vector< int > potential, min_cost, prevv, preve;
 
  Primal_Dual(int V) : graph(V) {}
 
  void add_edge(int from, int to, int cap, int cost)
  {
    graph[from].push_back((edge) {to, cap, cost, (int) graph[to].size()});
    graph[to].push_back((edge) {from, 0, -cost, (int) graph[from].size() - 1});
  }
 
  int min_cost_flow(int s, int t, int f)
  {
    int V = graph.size(), ret = 0;
    priority_queue< Pi, vector< Pi >, greater< Pi > > que;
    potential.assign(V, 0);
    preve.assign(V, -1);
    prevv.assign(V, -1);
 
    while(f > 0) {
      min_cost.assign(V, INF);
      que.push(Pi(0, s));
      min_cost[s] = 0;
 
      while(!que.empty()) {
        Pi p = que.top();
        que.pop();
        if(min_cost[p.second] < p.first) continue;
        for(int i = 0; i < graph[p.second].size(); i++) {
          edge &e = graph[p.second][i];
          int nextCost = min_cost[p.second] + e.cost + potential[p.second] - potential[e.to];
          if(e.cap > 0 && min_cost[e.to] > nextCost) {
            min_cost[e.to] = nextCost;
            prevv[e.to] = p.second, preve[e.to] = i;
            que.push(Pi(min_cost[e.to], e.to));
          }
        }
      }
      if(min_cost[t] == INF) return -1;
      for(int v = 0; v < V; v++) potential[v] += min_cost[v];
      int addflow = f;
      for(int v = t; v != s; v = prevv[v]) {
        addflow = min(addflow, graph[prevv[v]][preve[v]].cap);
      }
      f -= addflow;
      ret += addflow * potential[t];
      for(int v = t; v != s; v = prevv[v]) {
        edge &e = graph[prevv[v]][preve[v]];
        e.cap -= addflow;
        graph[v][e.rev].cap += addflow;
      }
    }
    return ret;
  }
};
 
void solve()
{
  int N;
  cin >> N;
  if(N == 0) return;
  int X[100][3];
  int sub = 0;
  for(int i = 0; i < N; i++) {
    for(int j = 0; j < 3; j++) cin >> X[i][j];
    sub += X[i][0] * X[i][1] * X[i][2];
    sort(X[i], X[i] + 3);
  }
  Primal_Dual flow(N + N + 2);
  for(int i = 0; i < N; i++) {
    for(int j = 0; j < N; j++) {
      bool check = true;
      for(int k = 0; k < 3; k++) if(X[i][k] >= X[j][k]) check = false;
      if(check) {
        flow.add_edge(i, N + j, 1, X[i][0] * X[i][1] * X[i][2] * -1);
      }
    }
  }
  int S = N + N, T = N + N + 1;
  for(int i = 0; i < N; i++) flow.add_edge(S, i, 1, 0);
  for(int i = 0; i < N; i++) flow.add_edge(i + N, T, 1, 0);
  for(int i = 0; i < N; i++) flow.add_edge(i, T, 1, 0);
  cout << sub + flow.min_cost_flow(S, T, N) << endl;
  solve();
}
 
int main()
{
  cin.tie(0);
  ios::sync_with_stdio(false);
  solve();
}

Measured memory_bytes: 4148
#include <cstdio>
#include <cstring>
#include <vector>
#include <queue>
#include <string>
#include <algorithm>
#include <iostream>
#include <string>
#include <map>
#include <set>
#include <functional>
#include <iostream>
#define MOD 1000000007LL
using namespace std;
typedef long long ll;
typedef pair<int,int> P;

ll n,m;

bool C(ll v){
	ll nm=m;
	if(v>n){
		nm-=(v-n)*2LL;
	}
	return nm>=v*2LL;
}

int main(void){
	scanf("%lld%lld",&n,&m);
	ll l=0,r=n+m;
	while(l+1<r){
		ll mid=(l+r)/2LL;
		if(C(mid))l=mid;
		else r=mid;
	}
	printf("%lld\n",l);
	return 0;
}


Measured memory_bytes: 256
import java.util.*;
import java.math.BigInteger;

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

    while(sc.hasNext()){
      String[] s = sc.next().split("\\+|=");
      int ans = -1;

      for(int i=0;i<10;i++){
        if(i == 0 && ( s[0].length() > 1 && s[0].charAt(0) == 'X' ||
                       s[1].length() > 1 && s[1].charAt(0) == 'X' ||
                       s[2].length() > 1 && s[2].charAt(0) == 'X' )) continue;
        BigInteger a = new BigInteger(s[0].replaceAll("X",""+i));
        BigInteger b = new BigInteger(s[1].replaceAll("X",""+i));
        BigInteger c = new BigInteger(s[2].replaceAll("X",""+i));

        if(a.add(b).equals(c)){
          ans = i;
          break;
        }
      }

      if(ans == -1) System.out.println("NA");
      else System.out.println(ans);
    }
  }
}

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

// ----------- define --------------
#define int long long
#define ii pair<int,int>
#define fi first
#define sc second
#define all(x) (x).begin(),(x).end()
// ---------------------------------

void MAIN() {
  int n; cin >> n;
  map<int, int> m;
  for (int i = 1; i <= n; i++) {
    int t; cin >> t;
    m[t]++;
  }
  vector<ii> v;
  for (auto &i : m) {
    if (i.sc >= 2) v.push_back(ii(i.fi, i.sc));
  }
  sort(all(v), greater<ii>());
  if (v.empty()) {
    cout << 0 << '\n';
    return;
  }
  if (v[0].sc >= 4) {
    cout << v[0].fi * v[0].fi << '\n';
    return;
  }
  if (v.size() < 2) {
    cout << 0 << '\n';
    return;
  }
  cout << v[0].fi * v[1].fi << '\n';
}

signed main() {
  ios::sync_with_stdio(0); cin.tie(0);
  int T = 1;
  // cin >> T;
  while (T--) MAIN();
}


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

typedef long long ll;
typedef long long LL;
typedef pair<int,int> ii;
typedef vector<ii> vii;
typedef vector<int> vi;

#ifdef DEBUG
    #define cek(x) cout<<x
#else
    #define cek(x) if(false){}
#endif // DEBUG

#define fi first
#define se second
#define INF 1000000000
#define INFLL 1000000000000000000LL
#define EPS 1e-9
#define PI acos(-1.0)
#define pb push_back
#define TC() while(tc--)
#define FOR(i,n) for(int i=0;i<n;i++)
#define FORN(i,n) for(int i=0;i<=n;i++)
#define REP(i,a,b) for(int i=a;i<b;i++)
#define REPN(i,a,b) for(int i=a;i<=b;i++)
#define reset(a,b) memset(a,b,sizeof(a))
#define sc(x) scanf("%d",&x)

int main(void){
    #ifdef ccsnoopy
        freopen("D:/Code/in.txt","r",stdin);
    #endif
    int n;
    sc(n);
    int arr[230];
    n*=2;

    FOR(i,n){
        sc(arr[i]);
    }

    sort(arr, arr + n);
    int tot = 0;
    for(int i = 0;i<n;i+=2){
        tot+=arr[i];
    }

    cout<<tot<<endl;


    return 0;
}





Measured memory_bytes: 256
import java.util.*;
class Main{
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    boolean check = true;
    for(int a = 1; a < 10; a++ ){
      for( int b = 1; b < 10; b++) {
        if( (a * b)== N ) {
          check = false;
        }
      }
    }
    if(check) {
      System.out.println("No");
    }else{
      System.out.println("Yes");
    }
    
  }
}


Measured memory_bytes: 23124
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

public class MainClass
{
	public const long Giri = 1000000007;

	public static void Main(string[] args)
	{
		int x = Console.ReadLine().ToInt();
		
		long r = 0;
		for(int i = 1; i <= x; i++)
		{
			r += i;
			if(r >= x)
			{
				Console.WriteLine(i);
				return;
			}
		}
		
	}
	
	static long GCD(long a, long b)
	{
		var v = new[] { a, b };
		while (v[1] != 0) { v = new[] { v[1], v[0] % v[1] }; }
		return v[0];
	}
	public static string[] Input() { return Console.ReadLine().Split(' '); }
	public static int Clamp(int val, int max, int min = 0) { return Math.Min(max, Math.Max(min, val)); }
}

public static class Smarter
{
	public static int ToInt(this string str) { return int.Parse(str); }
	public static long ToLong(this string str) { return long.Parse(str); }
	public static int[] ToInt(this string[] str)
	{
		int[] r = new int[str.Length];
		for(int i = 0; i < str.Length; i++) r[i] = str[i].ToInt();
		return r;
	 }
	
}

Measured memory_bytes: 13140
#include<iostream>

#include <vector>
#include <list>
#include<stack>
#include<queue>
#include<array>

#include <set>
#include<map>

#include<string>
#include<stdlib.h>

#include<algorithm>
#include <functional>
#include<math.h>

#include<fstream>
#include<iomanip>

using namespace std;
using ll = long long;
using ld = long double;
using pii = pair<int,int>;

#define FOR(k,m,n) for(ll (k)=(m);(k)<(n);(k)++)
#define REP(i,n) FOR((i),0,(n))
#define WAITING(str) int str;std::cin>>str;
#define DEBUGING(str) cout<<str<<endl

constexpr int INF = (1 << 30);
constexpr ll INFL = (1ll << 60);
constexpr ll MOD = 1000000007;// 10^9+7


//変数
int N;






//サブ関数
//入力
void input()
{
	cin >> N;
}

int str_sum(int a, int b) {
	int res = 0;
	for (char c : to_string(a)) {
		res += c - '0';
	}
	for (char c : to_string(b)) {
		res += c - '0';
	}
	return res;
}

//計算
void calc()
{
	int res = 99999;
	FOR(i,1, N) {
		res = min(res, str_sum(i, N - i));
	}
	cout << res << endl;
}


//出力
void output()
{

}


//デバッグ
void debug()
{
	int N;
	cin>>N;
}


//メイン関数
int main()
{
	input();
	calc();
	output();
	debug();
	
	return 0;
}


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

int main(void) {
  int n;
  scanf("%d", &n);
  unsigned long long* a;
  a = (unsigned long long*)malloc(sizeof(unsigned long long) * n);
  int i;
  for(i=0; i<n; i++) {
    scanf("%llu", &a[i]);
  }
  unsigned long long sum = 0;
  unsigned long long former = 0;
  for(i=n-2; i>=0; i--) {
    former += a[i+1];
    former %= 1000000007;
    sum += a[i] * former;
    sum %= 1000000007;
    // printf("i=%d, former=%llu, sum=%llu\n", i, former, sum);
  }
  printf("%llu\n", sum);
  return 0;
}


Measured memory_bytes: 3288
N = gets.to_i
wer = Hash.new(0)
gets.split.map do |ar|
  a = ar.to_i
  if a % 4 == 0
    wer[4] += 1
  elsif a % 2 == 0
    wer[2] += 1
  else
    wer[0] += 1
  end
end
# p wer
if wer[4] == 0
  puts wer[0] >= 1 ? "No" : "Yes"
else
  wer[0] += 1 if wer[2] >= 1
  puts wer[0] - wer[4] > 1 ? "No" : "Yes"
end

Measured memory_bytes: 8452
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using static System.Console;

class Program
{
    static void Main(string[] args)
    {
        var D = int.Parse(ReadLine());

        var ans = "Christmas" + ((25 - D > 0) ? Enumerable.Repeat(" Eve", 25 - D).Aggregate((s, e) => s + e) : "");

        WriteLine(ans);
    }
}


Measured memory_bytes: 28260
/* {{{ */
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
    ($($r:tt)*) => {
        let s = {
            use std::io::Read;
            let mut s = String::new();
            std::io::stdin().read_to_string(&mut s).unwrap();
            s
        };
        let mut iter = s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
}

macro_rules! input_inner {
    ($iter:expr) => {};
    ($iter:expr, ) => {};
    ($iter:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($iter, $t);
        input_inner!{$iter $($r)*}
    };
}

macro_rules! read_value {
    ($iter:expr, ( $($t:tt),* )) => {
        ( $(read_value!($iter, $t)),* )
    };
    ($iter:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($iter, $t)).collect::<Vec<_>>()
    };
    ($iter:expr, chars) => {
        read_value!($iter, String).chars().collect::<Vec<char>>()
    };
    ($iter:expr, usize1) => {
        read_value!($iter, usize) - 1
    };
    ($iter:expr, $t:ty) => {
        $iter.next().unwrap().parse::<$t>().expect("Parse error")
    };
}
/* }}} */

fn main() {
    input! {
        n: usize,
        k: i64,
        q: usize,
        aa: [usize1;q]
    }
    let mut v = vec![0;n];
    for a in aa {
        v[a] += 1;
    }
    for p in v {
        if p > (q as i64) - k {
            println!("Yes");
        } else {
            println!("No");
        }
    }
}
/* vim:set foldmethod=marker: */


Measured memory_bytes: 6780
#include <iostream>
#include <algorithm>
#include <string>
#include <cmath>
#include <vector>
#include <regex>
#include <map>
#include <set>
#include <iomanip>

using namespace std;
using ll = long long;

int main() {
    int N,M;
    cin >> N >> M;
    
    int A;
    int K;
    map<int,int> mp;
    for(int i=0;i<N;i++){
        cin >> K;
        for(int j=0;j<K;j++){
            cin >> A;
            mp[A]++;
        }
    }
    
    int ans = 0;
    for(int i=0;i<=M;i++){
        if(mp[i]==N){
            ans++;
        }
    }
    
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 256
M, D = map(int, input().split())

cnt = 0
for i in range(1, M+1):
    for j in range(22, D+1):
        listD = [int(c) for c in str(j)]
        if listD[0] * listD[1] == i and listD[1] >= 2:
            cnt += 1

print(cnt)

Measured memory_bytes: 3060
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        while (sc.hasNextInt()) {
            char[] s = sc.next().toCharArray();
            int ans = 0;
            for (char c : s) {
                if ( c == '1' ) {
                    ans++;
                }
            }
            System.out.println(ans);
        }
    }
}


Measured memory_bytes: 22996
package main

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

func nextInt() int {
	sc.Scan()
	i, e := strconv.Atoi(sc.Text())
	if e != nil {
		panic(e)
	}
	return i
}

var sc = bufio.NewScanner(os.Stdin)

func main() {
	// Code for C - pushpush
	var N int
	fmt.Scanf("%d", &N)

	sc.Split(bufio.ScanWords)
	var a int
	//b := make([]int, 0)
	var b [1000000]int
	var left int = 499999
	var right int = 500000
	var flag int = 0
	for i := 0; i < N; i++ {
		a = nextInt()
		if i%2 == 0 {
			//b = append(b, a)
			b[right] = a
			right++
			if i != 0 {
				flag = 1
			}
		} else {
			//list := []int{a}
			//b = append(list, b...)
			b[left] = a
			left--
			flag = 0
		}
	}

	if flag == 1 {
		for i := right - 1; left < i; i-- {

			fmt.Printf("%d", b[i])
			if i > left+1 {
				fmt.Printf(" ")
			} else {
				fmt.Printf("\n")
			}
		}
	} else {
		for i := left + 1; i < right; i++ {
			fmt.Printf("%d", b[i])
			if i < right-1 {
				fmt.Printf(" ")
			} else {
				fmt.Printf("\n")
			}
		}
	}
}


Measured memory_bytes: 14968
import java.util.*;
class Main {
  public static void main(String[] args) {
	Scanner sc = new Scanner(System.in);
    
    long X = sc.nextLong(); //next(文字列), nextDouble, nextLine(1行)とか

    long money = 100;
    int year = 0;
    while(money < X){
      money *=1.01;
      year++;
    }
    System.out.println(year);
        
  }
}


Measured memory_bytes: 35812
using System;

namespace B___ROT_N
{
    class Program
    {
        static void Main(string[] args)
        {
            var n = int.Parse(Console.ReadLine());
            var s = Console.ReadLine();
            var a = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
            for (var i = 0; i < s.Length; i++)
            {
                var b =(Convert.ToInt32(s[i]) - 65 + n) % 26;
                Console.Write(a[b]);
            }
            Console.WriteLine();
        }
    }
}

Measured memory_bytes: 11316
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.LinkedList;

public class Main {

	public static void initiallize(char data[]) {
		for (int i = 0; i < data.length; ++i) {
			data[i] = '\0';
		}
	}

	public static void main(String[] args) {
		LinkedList<Character> stack = new LinkedList<Character>();
		char[] data = new char[10000];
		String str = "";
		int match;

		BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
		try {
			while (true) {
				int k = 0;
				int tmp = k;
				initiallize(data);
				stack.clear();

				while (true) {
					int i;
					str = reader.readLine();
					for (i = 0; i < str.length(); ++i) {
						data[i + tmp] = str.charAt(i);
						++k;
					}
					tmp = k;
					if (data[tmp - 1] == '.') {
						break;
					}
				}

				if (data[0] == '.') {
					break;
				}
				match = -1;
				for (int i = 0; i < data.length; ++i) {
					if (data[i] == '(' || data[i] == '[') {
						stack.addFirst(data[i]);
					} else if (data[i] == ')') {
						if (stack.isEmpty()) {
							match = 0;
						} else {
							if (stack.getFirst() != '(') {
								match = 0;
							}
							stack.removeFirst();
						}
					} else if (data[i] == ']') {
						if (stack.isEmpty()) {
							match = 0;
						} else {
							if (stack.getFirst() != '[') {
								match = 0;
							}
							stack.removeFirst();
						}
					} else if (data[i] == '.') {
						if (stack.isEmpty()) {
							match = 1;
						} else {
							match = 0;
						}
					}
					if (match != -1) {
						break;
					}
				}
				if (match == 1) {
					System.out.println("yes");
				} else {
					System.out.println("no");
				}
			}
		} catch (IOException ioe) {

		} finally {
			try {
				reader.close();
			} catch (IOException ie) {

			}
		}
	}
}



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

using namespace std;

#define INF 1000000007
#define LINF (1LL << 60)

typedef long long i64;
typedef pair<i64,i64> P;

inline i64 mod(i64 a, i64 m) { return (a % m + m) % m; }

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



int n, a,b;
string s;
void solve(){
	cin >> n >> a >> b;
	cin >> s;
	
	int cnt = 0, cnt2 = 0;
	for(int i = 0; i < n; i++){
		if(s[i] == 'c'){
			cout << "No" << endl;
			continue;
		}
		if(s[i] == 'a'){
			if(cnt < a+b){
				cout << "Yes" << endl;
				cnt++;
			}
			else cout << "No" << endl;
		}
		else{
			if(cnt < a+b && cnt2 < b){
				cout << "Yes" << endl;
				cnt++;
				cnt2++;
			}
			else cout << "No" << endl;
		}
	}
}

int main(){
	std::cin.tie(0);
	std::ios::sync_with_stdio(false);
	int t = 1;
	//cin >> t;
	while(t--){
		solve();
	}
	
	return 0;
}


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

int main() {
	int count = 0;
	string S;
	cin >> S;
	if (S.at(0) == 'R') {
		count++;
		if (S.at(1) == 'R') {
			count++;
			if (S.at(2) == 'R') {
				count++;
			}
		}
	}
	else {
		if (S.at(1) == 'R') {
			count++;
			if (S.at(2) == 'R') {
				count++;
			}
		}
		else {
			if (S.at(2) == 'R') {
				count++;
			}
		}
	}
	cout << count << endl;
}

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

#define MOD 1000000007

vector<int> X[100005];
long long dp[100005][2];

long long solve(int i, int par, int col)
{
    if(dp[i][col] != -1)
        return dp[i][col];
    
    long long ans = 1;
    
    if(col == 0)
    {
        for(auto x : X[i])
            if(x != par)
                ans = ans * (solve(x, i, 0) + solve(x, i, 1)) % MOD;
    }
    else
    {
        for(auto x : X[i])
            if(x != par)
                ans = ans * solve(x, i, 0) % MOD;
    }
    
    return dp[i][col] = ans;
}

int main() {

    ios::sync_with_stdio(0);
    cin.tie(NULL), cout.tie(NULL);
    
    int N;
    cin >> N;
    
    for(int i=1; i<=N-1; i++)
    {
        int x, y;
        cin >> x >> y;
        
        X[x].push_back(y);
        X[y].push_back(x);
    }
    
    memset(dp, -1, sizeof(dp));
    
    cout << (solve(1, 0, 0) + solve(1, 0, 1)) % MOD << "\n";
    return 0;
}

Measured memory_bytes: 15616
#include <iostream>
#include <vector>
#include <cassert>
#include <algorithm>
#include <functional>

using namespace std;
int Count=0;
vector<vector<int>> gragh;
vector<int> reg;
int n;
void dfs(int x){
   // cout<<x<<endl;
   reg[1]=1;
    bool h=true;
    for(int i=1;i<=n;i++){
        if(reg[i]==0){
            h=false;
        }
    }
             //   cout<<gragh[x].size()<<endl;

    if(h){
        Count++;
        return;
    }else{
        for(int i=0;i<gragh[x].size();i++){
            
            if(reg[gragh[x][i]]==0){
                reg[gragh[x][i]]=1;
              //  cout<<"from"<<x<<"to"<<gragh[x][i]<<endl;
                dfs(gragh[x][i]);
                reg[gragh[x][i]]=0;
            }
        }
    }
    return;
}
int main(){
    int m;
    cin >> n >> m;
    gragh.resize(n+2);
    reg.resize(n+2);
    for(int i=0;i<m;i++){
        int x,y;
        cin >> x >> y;
        gragh[x].push_back(y);
      //  cout<<"njkd"<<endl;
        gragh[y].push_back(x);
        
    }
    
    dfs(1);reg[1]=1;
    cout<<Count<<endl;
}

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

using namespace std;

typedef long long ll;

int main(){
  ll a[26]={0};
  string str;
  cin>>str;
  for(int i=0; i<str.size(); i++){
    a[str[i]-'a']++;
  }
  bool isB=true;
  for(int i=0; i<26&&isB; i++){
    if(a[i]%2==1){
      isB=false;
    }
  }
  cout<<(isB?"Yes":"No");
  return 0;
}

Measured memory_bytes: 256
import sys
input = sys.stdin.readline
n = int(input())
a = [list(map(int,input().split())) for i in range(n)]
league = [0]*(n+1)
cnt = 0

while True:
  topop = []
  if cnt == 0:
    for i,player in enumerate(a):
      x = player[-1]
      if league[x] == i+1:
        topop.append(x)
        topop.append(i+1)
      else:
        league[i+1] = x
  else:
    for player in popped:
      if a[player-1] == []:
        continue
      x = a[player-1][-1]
      if league[x] == player:
        topop.append(x)
        topop.append(player)
      else:
        league[player] = x
  popped = []
  if topop == []:
    print(-1)
    exit()
  for t in topop:
    if a[t-1] == []:
      print(-1)
      exit()
    a[t-1].pop()
    popped.append(t)
  cnt += 1
  if not any(a[i] for i in range(n)):
    break
print(cnt)


Measured memory_bytes: 35064
#include<cstdio>
using namespace std;
int n,m,cnt=-1;
char a[10][10];
int main()
{
	scanf("%d%d",&n,&m);
	for(int i=1;i<=n;++i) scanf("%s",a[i]+1);int na=1,nb=1;
	for(int i=1;i<=n;++i) for(int j=1;j<=m;++j) if(a[i][j]=='#') ++cnt;
	while(na!=n||nb!=m) {
		if(a[na][nb+1]=='#') {++nb;--cnt;}
		else if(a[na+1][nb]=='#') {++na;--cnt;}
		else {printf("Impossible\n");return 0;}
	}
	if(!cnt) printf("Possible\n");
	else printf("Impossible\n");
	return 0;
}

Measured memory_bytes: 128
#include<bits/stdc++.h>
using namespace std;
int main()
{
	string str; cin >> str;
	bool one = false, two = false;
	for(int i=0; i<str.size(); i++)
	{
		if(str[i] == 'A') one = true;
		if(str[i] == 'B') two = true;
	}
	if(one && two) cout << "Yes";
	else		   cout << "No";
	cout << '\n';
	return 0;
}

Measured memory_bytes: 256
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time

sys.setrecursionlimit(10**7)
inf=10**20
mod=10**9+7

def LI(): return list(map(int,input().split()))
def I(): return int(input())
def LS(): return input().split()
def S(): return input()

def main():
  n,m=LI()

  l=[]
  for i in range(m):
    a,b=LI()
    l.append([i,a,b,0])

  l=sorted(l,key=lambda x:[x[1],x[2]])

  a=l[0][1]
  b=1
  l[0][3]=b

  for i in range(1,len(l)):
    if a==l[i][1]:
      b+=1
    else:
      a=l[i][1]
      b=1
    l[i][3]=b

  l=sorted(l,key=lambda x:x[0])

  for x in l:
    print(str(x[1]).zfill(6)+str(x[3]).zfill(6))

main()


Measured memory_bytes: 42692
N, Q = map(int, input().split())
S= input()

count=[]
ans=0
for i in range (N):
  if i!=0 and S[i-1]=="A" and S[i]=="C":
    ans+=1
    count.append(ans)
  else:
    count.append(ans)
#print(count)

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

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

using ll = long long;

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

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

    ll a, b; cin >> a >> b;
    ll g = gcd(a, b);

    ll count = 1;
    for (ll i = 2; i*i <= g; ++i) {
        if (g % i == 0) {
            ++count;
            while(g % i == 0) g /= i;
        }
    }
    if (g != 1) ++count;

    cout << count << endl;

    return 0;
}

Measured memory_bytes: 384
#include <math.h>
#include <iostream>
using namespace std;

int main() {
    long n, d;
    cin >> n >> d;
    int cnt =0;
    for (int i=0; i<n; i++) {
        long x, y;
        cin >> x >> y;
        if (sqrt(x*x + y*y) <= d) cnt++;
    }
    cout << cnt << endl;
}

Measured memory_bytes: 3644
#include<iostream>
#include<vector>
#include<algorithm>
#include<cmath>
#include<iomanip>

using namespace std;

int main()
{
    double N,all=1;
    cin>>N;
    vector<double>x(N),y(N),tem(N);
    for(int i=0;i<N;i++){
        cin>>x[i]>>y[i];
        tem[i]=i;
        all*=i+1;
    }
    double sum=0;
    do{
        for(int i=0;i<N-1;i++){
            sum+=sqrt(pow(x[tem[i+1]]-x[tem[i]],2)+pow(y[tem[i+1]]-y[tem[i]],2));
        }
    }while(next_permutation(tem.begin(),tem.end()));
    sum/=all;
    cout<<setprecision(12)<<sum<<endl;
}

Measured memory_bytes: 256
#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 INF 2e9
#define ALL(v) v.begin(), v.end()
using namespace std;
typedef long long ll;

int main()
{
    string T;

    cin >> T;

    ll q;
    for(int i=0; i<T.length(); i++){
        if(T[i]=='?') T[i]='D';
    }

    cout << T;
}

Measured memory_bytes: 3724
#include <bits/stdc++.h>
#define syosu(x) fixed<<setprecision(x)
using namespace std;
typedef long long ll;
typedef unsigned int uint;
typedef unsigned long long ull;
typedef pair<int,int> P;
typedef pair<double,double> pdd;
typedef pair<ll,ll> pll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<double> vd;
typedef vector<vd> vvd;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef vector<string> vs;
typedef vector<P> vp;
typedef vector<vp> vvp;
typedef vector<pll> vpll;
typedef pair<int,P> pip;
typedef vector<pip> vip;
const int inf=1<<29;
const ll INF=1ll<<60;
const double pi=acos(-1);
const double eps=1e-9;
const ll mod=1e9+7;
const int dx[4]={-1,0,1,0},dy[4]={0,-1,0,1};

int dfs(int &I,string &s){
	I++;
	if(isdigit(s[I])){
		int x=0;
		while(isdigit(s[I])){
			x=10*x+(s[I]-'0');
			I++;
		}
		I++;
		return x/2+1;
	}
	else{
		vi a;
		while(s[I]!=']'){
			a.push_back(dfs(I,s));
		}
		sort(a.begin(),a.end());
		int n=a.size(),res=0;
		for(int i=0;i<=n/2;i++) res+=a[i];
		I++;
		return res;
	}
}

int solve(string s){
	int I=0;
	return dfs(I,s);
}

int main(){
	ios::sync_with_stdio(0);
	cin.tie(0);
	int n;
	cin>>n;
	for(int i=0;i<n;i++){
		string s;
		cin>>s;
		cout<<solve(s)<<endl;
	}
}


Measured memory_bytes: 3292
#include<bits/stdc++.h>
#define rep(i,a,b) for(int i=int(a);i<int(b);++i)
using namespace std;
typedef long long ll;
int INF = (1LL << 30) - 1;
int MOD = 1e9+7;
main(){
    int W,H,N;
    cin >> W >> H >> N;
    ll minx = W,maxx = 0,miny = H,maxy = 0;
    rep(i,0,N){
        ll a,b,c;
        cin >> b >> c >> a;
        if(a == 1)maxx = max(maxx,b);
        if(a == 2)minx = min(minx,b);
        if(a == 3)maxy = max(maxy,c);
        if(a == 4)miny = min(miny,c);
    }
    /*
    if(minx == W)minx = 0;
    if(maxx == 0)maxx = W;
    if(miny == H)miny = 0;
    if(maxy == 0)maxy = H;
    */
    //cout << minx << " " << maxx << " " << miny << " " << maxy << endl;
    ll ans = (minx - maxx) * (miny - maxy);
    if(maxx > minx || maxy > miny)cout << 0 << endl;
    else cout << ans << endl;
}

Measured memory_bytes: 256
alphabet = 'abcdefghijklmnopqrstuvwxyz'
dic = {}
for ch in alphabet:
    dic[ch] = 0
    
while True:
    try:
        st = raw_input()
    except EOFError:
        break

    for ch in st:
        try:
            dic[ch.lower()] +=1
        except:
            pass
for k in sorted(dic.keys()):
    print k +' : ' + str(dic[k])

Measured memory_bytes: 4208
#include<bits/stdc++.h>
#include<iomanip>
using namespace std;
#define rep(i,n) for(int i=0;i<n;i++)
typedef long long ll;
typedef long  l;
typedef pair<int,int> pl;
const ll INF=100000000000000001;
const double PI=3.141592653589;


int main(){
  double a,b,x,ans;cin>>a>>b>>x;

  if(a*a*b/2<x){
    ans=PI/2-atan(a*a*a/(2*(a*a*b-x)));
    ans=ans*180/PI;
  }else{
    ans=PI/2-atan(2*x/(a*b*b));
    ans=ans*180/PI;
  }
  cout<<fixed<<setprecision(6)<<ans<<endl;

  return 0;
}


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

#include <algorithm>
#include <vector>
#include <cstdio>
#include <random>
#include <functional>


int main() {
    int N;
    int d[110];
    cin >> N;
    for (int i = 0; i < N; ++i) cin >> d[i];

    int num[110] = {0};  // バケット
    for (int i = 0; i < N; ++i) {
        num[d[i]] = 1;  // d[i] が 1 個増える
    }

    int res = 0;  // 答えを格納
    for (int i = 1; i <= 100; ++i) {  // 1 <= d[i] <= 100 なので 1 から 100 まで探索
        if (num[i]) {  // 0 より大きかったら
            ++res;
        }
    }
    cout << res << endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <cmath>
#include <map>
#include <queue>
#include <iomanip>
#define MOD 1000000007
typedef long long ll;
using namespace std;

int main(){
  ll a,b,c;
  cin>>a>>b>>c;
  ll ans=0;
  if(c<=b){
    cout<<c+b<<endl;
    return 0;
  }

  ans=b*2;
  c-=b;
  if(c<=a){
    cout<<ans+c<<endl;
    return 0;
  }

  cout<<ans+a+1<<endl;


  return 0;
}


Measured memory_bytes: 256
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <string.h>
#define ll long long
#define rep(i,n) for(ll i=0;i<(n);i++)
#define max(p,q) ((p)>(q)?(p):(q))
#define min(p,q) ((p)<(q)?(p):(q))
#define chmax(a,b) ((a)=(a)>(b)?(a):(b))
#define chmin(a,b) ((a)=(a)<(b)?(a):(b))
#define abs(p) ((p)>=(0)?(p):(-(p)))
#define swap(a,b) do{ll w=a;a=b;b=w;}while(0)
#define swapd(a,b) do{double w=a;a=b;b=w}while(0)
#define in(a) scanf("%lld", &(a))
#define ind(a) scanf("%lf", &(a))
#define put(a) printf("%lld\n", (a))
#define putd(a) printf("%.15f\n", (a));
//def   puts(a) printf("%s\n", a) 文字はこっち
int cmp(const void *a, const void *b);
//your code here!

int main(void){
    double T, X;
    ind(T); ind(X);
    putd(T/X);
    return 0;
}

int cmp(const void *a, const void *b){
    ll A=*(ll *)a, B=*(ll *)b;
    if(A==B)return 0;
    else return A>B ? 1:-1;//昇順ソート
}


Measured memory_bytes: 128
# -*- coding: utf-8 -*-
s = input()
k = int(input())

if len(set(s)) == 1:
    print(len(s) * k // 2)
    exit()

count = []
tmp = 0
for i in range(len(s) - 1):
    if s[i] == s[i + 1]:
        tmp += 1
    if s[i] != s[i + 1]:
        count.append(tmp + 1)
        tmp = 0
count.append(tmp + 1)
#print(count)

flag = True
ans = 0
if s[0] == s[-1] and (count[-1] > 1 or count[0] > 1) and (count[-1] + count[0]) % 2 == 0:
    flag = False
if s[0] == s[-1]:
    if count[-1] == 1 and count[0] == 1:
        ans += k - 1
        flag = False
    else:
        ans += k - 1
        if count[-1] >= count[0]:
            count[-1] -= 1
        else:
            count[0] -= 1
#print(flag)
#print(ans)
#print(count)
for i in range(len(count)):
    if count[i] > 1:
        ans += (count[i] // 2) * k
if s[0] == s[-1] and count[-1] >= 1 and flag:
    #print("B")
    ans += 1
print(ans)


Measured memory_bytes: 3064
((stdin) => {
	let [n, a] = stdin.split('\n');
	let r = BigInt(1);
	a = a.split(' ');
	a.sort();
	for (let i = 0; i < +n && r != 0 && r <= BigInt(10 ** 18); i++) {
		r *= BigInt(+a[i]);
	}
	if (r > BigInt(10 ** 18)) {
		r = -1;
	}
	console.log(`${r}`);
})(require("fs").readFileSync("/dev/stdin", "UTF-8"));

Measured memory_bytes: 41180
#include <bits/stdc++.h>
#define _GLIBCXX_DEBUG
using namespace std;
using ll = long long;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep2(i, s, n) for (int i = (s); i < (int)(n); i++)
int main() {
  int N, K;
  cin >> N >> K;
  int sum = 1;
  rep(i, N) {
    if(sum < K) {
      sum *= 2;
    }
    else {
      sum += K;
    }
  }
  cout << sum << endl;
}

Measured memory_bytes: 3616
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <vector>
#define rep(it, ifrom, ito) for (auto it = ifrom; it != ito; ++it)

using namespace std;

int main(int argc, char* argv[]) {
    bool debug = argc == 2 && (strcmp(argv[1], "debug") == 0);
    int H, W, K;
    scanf("%d %d %d", &H, &W, &K);

    if (debug) {
        printf("H=%d, W=%d, K=%d\n", H, W, K);
    }

    // [a, b]を自由に塗って良いときのパターン数fillpattern[b - a]
    vector<int64_t> fillpattern0(W, 0); // b-1 ~ bなし
    vector<int64_t> fillpattern1(W, 0); // b-1 ~ bあり
    fillpattern0[0] = 1;
    fillpattern1[0] = 0;
    rep(w, 1, W) {
        fillpattern0[w] = fillpattern0[w - 1] + fillpattern1[w - 1];
        fillpattern1[w] = fillpattern0[w - 1];
    }
    if (debug) {
        rep(w, 0, W) {
            printf("fillpattern[w=%d] 0:%d 1:%d sum:%d\n", fillpattern0[w], fillpattern1[w], fillpattern0[w] + fillpattern1[w]);
        }
    }

    auto pat = [&](int a, int b) -> int64_t {
        int idx = b - a;
        if (0 <= idx && idx < W) {
            return fillpattern0[idx] + fillpattern1[idx];
        }
        return 1;
    };

    vector<vector<int64_t>> table(H + 1);
    rep(h, 0, H + 1) {
        table[h].assign(W, 0);
    }
    table[0][0] = 1;

    constexpr int64_t MOD = 1000000007;
    rep(h, 0, H) {
        if (debug) {
            printf("h=%d ", h);
        }
        rep(w, 0, W) {
            int next = 0;
            {
                // 真上からくる
                next = (next + table[h][w] * pat(0, w - 1) * pat(w + 1, W - 1)) % MOD;
            }
            if (0 <= w - 1) {
                // 左からくる
                next = (next + table[h][w - 1] * pat(0, w - 2) * pat(w + 1, W - 1)) % MOD;
            }
            if (w + 1 < W) {
                // 右からくる
                next = (next + table[h][w + 1] * pat(0, w - 1) * pat(w + 2, W - 1)) % MOD;
            }
            table[h + 1][w] = next;
            if (debug) {
                printf("%d ", next);
            }
        }
        if (debug) {
            printf("\n");
        }
    }

    printf("%d\n", table[H][K-1]);

    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define fi first
#define se second
#define Mp make_pair
#define pb push_back

using ll = long long;
using db = double;
using pii = pair<int, int>;
using vi = vector<int>;
mt19937 mrand(time(0));
ll get(ll r) { return ((ll)mrand() * mrand() % r + r) % r; }
ll get(ll l, ll r) { return get(r - l + 1) + l; }

const int P = 998244353;
int n, m, po[200100], sg[3][200100], f[3][200100];
signed main() {
	scanf("%d", &n);
	ll nw = (ll)(1e18) % P; po[0] = 1;
	for(int i = 1; i <= n; i++) po[i] = po[i - 1] * nw % P;
	for(int o = 0; o < 3; o++) {
		scanf("%d", &m);
		vector<vi> G(n + 1);
		for(int i = 1; i <= m; i++) {
			int x, y; scanf("%d %d", &x, &y);
			x > y ? swap(x, y) : void();
			G[x].pb(y);
		}
		for(int i = n; i; i--) {
			set<int> mex;
			for(int j : G[i])
				mex.insert(sg[o][j]);
			while(mex.count(sg[o][i]))
				sg[o][i]++;
		}
		for(int i = 1; i <= n; i++)
			(f[o][sg[o][i]] += po[i]) %= P;
	}

	ll ans = 0;
	for(int i = 0; i < 500; i++)
		for(int j = 0; j < 500; j++)
			(ans += 1ll * f[0][i] * f[1][j] % P * f[2][i ^ j] % P) %= P;
	printf("%lld\n", ans);
	fprintf(stderr, "time=%.4f\n", (db)clock()/CLOCKS_PER_SEC);
	return 0;
	/* 取模直接除，爆零两行泪
	 * 不开ll见祖宗
	 */
}

Measured memory_bytes: 9564
#include <iostream>
#include <vector>
#include <string>
#include <cstdlib>
#include <algorithm>
#include <cstdio>
#include <cstring>
#include <stack>
#include <math.h>
#include <map>
#define Z class
#define ln cout<<'\n'
#define ll long long
#define rep(i, n) for(int i = 0; i < (n); ++i)
//ASCII a=97, A=65
// int H[N]; rep(i,N) scanf("%d", &H[i]);
// int max_x = *std::max_element(x.begin(), x.end());
// int min_y = *std::min_element(y.begin(), y.end());
using namespace std;
template<class T> inline bool chmax(T& a, T b){ if(a < b) { a=b; return 1; }return 0;}
template<class T> inline bool chmin(T& a, T b){ if(a > b) { a=b; return 1; }return 0;}
template<Z A>void pr(A a){cout<<a;ln;}
template<Z A,Z B>void pr(A a,B b){cout<<a<<' ';pr(b);}
template<Z A,Z B,Z C>void pr(A a,B b,C c){cout<<a<<' ';pr(b,c);}
template<Z A,Z B,Z C,Z D>void pr(A a,B b,C c,D d){cout<<a<<' ';pr(b,c,d);}
template<Z A>void PR(A a,ll n){rep(i,n){if(i)cout<<' ';cout<<a[i];}ln;}

int GCD(int a, int b) { return b ? GCD(b, a%b) : a; }
const long long INF = 1LL << 60;

int main(){
    int A; cin >> A;
    int X,Y; Y=A%10; X=A/10;
    if(X==9 || Y==9) pr("Yes");
    else pr("No");
}



Measured memory_bytes: 256
#define _USE_MATH_DEFINES
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
using P   = pair<ll, ll>;
using mat = vector<vector<ll>>;

void IOS() { ios::sync_with_stdio(false), cin.tie(0); }

const ll INF = 1e16;
const ll MOD = 1e9 + 7;
const ld EPS = 1e-10;

template <typename T> void dump(T x) { cout << x << endl; }
void dumpf(ld x, int t) { cout << setprecision(t) << fixed << x << endl; }
template <typename A, size_t N, typename T>
void Fill(A (&array)[N], const T &val) {
	fill((T *)array, (T *)(array + N), val);
}

inline ll mod(ll a, ll b) {
	if (a > 0) return a % b;
	if (a % b == 0) return 0;
	ll x = -a / b + 1;
	a += x * b;
	return a % b;
}

// ll dx[4] = {1, 0, -1, 0};
// ll dy[4] = {0, 1, 0, -1};
#include <bits/stdc++.h>

struct UnionFind {
  private:
	std::vector<int> rank, par, col;
	int n_;

  public:
	UnionFind(int n) : n_(n) {
		rank.resize(n, 1);
		par.resize(n);
		for (int i = 0; i < n; ++i) {
			par[i] = i;
		}
		col.resize(n, 1);
	}
	int root(int i) {
		while (par[i] != i) {
			i = par[i];
		}
		return i;
	}
	bool isSame(int x, int y) { return root(x) == root(y); }
	void unite(int x, int y) {
		if (isSame(x, y)) return;
		x = root(x), y = root(y);
		if (rank[x] < rank[y]) {
			par[x] = y;
			col[y] += col[x];
		} else {
			if (rank[x] == rank[y]) rank[x]++;
			par[y] = x;
			col[x] += col[y];
		}
	}
	int cnt(int x) {
		x = root(x);
		return col[x];
	}
};

int main() {
	IOS();
	ll n, m;
	cin >> n >> m;
	vector<P> a(m);
	vector<ll> ans(m + 1);
	for (int i = 0; i < m; i++) {
		cin >> a[i].first >> a[i].second;
		a[i].first--;
		a[i].second--;
	}
	UnionFind uf(n);
	ans[m] = n * (n - 1) / 2;
	for (int i = m - 1; i >= 0; i--) {
		ll x = uf.cnt(a[i].first);
		ll y = uf.cnt(a[i].second);
		if (!uf.isSame(a[i].first, a[i].second)) {
			ans[i] = ans[i + 1] - x * y;
		} else {
			ans[i] = ans[i + 1];
		}
		uf.unite(a[i].first, a[i].second);
	}
	for (int i = 1; i <= m; i++) {
		dump(ans[i]);
	}
}

Measured memory_bytes: 4864
#include <bits/stdc++.h>
using namespace std;
int x, y, s;
int main() {
    while(true) {
        scanf("%d%d%d", &x, &y, &s);
        if (x==0&&y==0&&s==0) break;
        int res = 0;
        x += 100; y += 100;
        for (int i=1; i<s; i++) {
            for (int j=1; j<s; j++) {
                if (i*x/100+j*x/100 == s) {
                    res = max(res, i*y/100+j*y/100);
                }
            }
        }
        printf("%d\n", res);
    }
}

Measured memory_bytes: 1188
#include <cstdio>
#include <iostream>

using namespace std;

#define MAX_LENGTH 100


int main() {
    char S[MAX_LENGTH + 1];
    int K;
    int i = 0;
    int count = 0;

    cin >> K;
    scanf("%s", S);

    while (S[i] != '\0') {
        count++;
        i++;
    }

    if (count <= K) {
        printf("%s\n", S);
    } else {
        for (int i = 0; i < K; i++) {
            printf("%c", S[i]);
        }
        printf("...\n");
    }

    return 0;
}

Measured memory_bytes: 3672
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
using vll = vector<ll> ;
#define all(v) v.begin(),v.end()

int main(){
  long double A,B,H,M;
  cin>>A>>B>>H>>M;
  long double a,b;
  a = 2*acos(-1)*(H*60+M)/720;
  b = 2*acos(-1)*M/60;
  cout<<setprecision(15)<<sqrt(A*A+B*B-2*A*B*cos(abs(a-b)));
}

Measured memory_bytes: 4172