akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <algorithm>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <regex>
#include <numeric>
using namespace std;

/*--- Macro ---*/
#define rep(i, n) for(int i=0; i<(int)n; i++)
#define rep1(i, n) for(int i=1; i<(int)n; i++)
#define mp make_pair
#define pb push_back
#define all(a) (a).begin(), (a).end()

/*---  Type ---*/
typedef long long ll;

/*--- Constants ---*/
template <typename T> const T INF = numeric_limits<T>::max() / 10;
const int MOD = (int)1e9 + 7;

// Floating
const double EPS = 1e-11;
#define EQ0(x) (abs(x) < EPS)
#define EQ(x, y) (abs(a-b) < EPS)

// Util
int max(int a, int b, int c) {return max(a, max(b, c));}
int min(int a, int b, int c) {return min(a, min(b, c));}
ll max(ll x, ll y) {return x > y ? x : y;}
ll min(ll x, ll y) {return x < y ? x : y;}
ll max(ll a, ll b, ll c) {return max(a, max(b, c));}
ll min(ll a, ll b, ll c) {return min(a, min(b, c));}

// How to use 「map」
/*
  - 宣言
    map<{key_type}, {value_type}> salary;
  - 要素の挿入
    salary["Alice"] = 1000;
  - 要素の取得 O(logn)
    salary.at("Alice");
  - 要素の削除
    salary.erase("Alice");
  - キー検索
    salary.find("Alice"); -> true
    salary.find("Bob");   -> false
  - イテレーション
    for(auto& [key, value] : salary) {...}
 */
// -------------------------------------


// How to use 「lower_bound」, 「upper_bound」
/*
  vector<int> a = {1, 2, 3, 4, 5};
  auto iter1 = lower_bound(all(a), 3);  <- 第二引数「以上」の最小イテレータが返る
  auto iter2 = upper_bound(all(a), 3);  <- 第二引数「より大きい」最小のイテレータが返る
 */
// -------------------------------------


// How to use 「struct sort」
/*
  struct Person {
    string name;
    int age;

    Person(string _name, int _age) {
      name = _name;
      age = _age;
    }

    bool operator<(const Person &another) const {
      return age < another.age;
    }
  };

  vector<Person> people;
  people.pb(Person("Alice", 20));
  people.pb(Person("Bob", 19));
  people.pb(Person("John", 40));
  people.pb(Person("Chris", 30));
  sort(all(people));
 */
 // -------------------------------------

// -------------------------------------------------------------------------------------



int main() {
  string s, t;
  cin >> s >> t;

  int a, b;
  cin >> a >> b;

  string u;
  cin >> u;


  if (u == s) {
    cout << a-1 << " " << b << endl;
  }else {
    cout << a << " " << b-1 << endl;
  }

  return 0;
}

Measured memory_bytes: 256
// garnab27
#include <bits/stdc++.h>
#define MP make_pair
#define PB push_back
#define ll int64_t
#define F first
#define S second
#define ALL(x) (x).begin(), (x).end()
#define SZ(x) ((int)(x).size())
using namespace std;
ll modex(ll a,ll b,ll p){ll res=1;a%=p;while(b>0){if(b&1)res=(res*a)%p;a=(a*a)%p;b>>=1;}return res;}
int dx[]={1,0,-1,0,1,-1,-1,1};
int dy[]={0,1,0,-1,1,1,-1,-1};
 
 
int main(){
	ios::sync_with_stdio(0);
	cin.tie(NULL);cout.tie(NULL);	
 
	int a,b,c;
	cin>>a>>b>>c;

	cout<<c<<" "<<a<<" "<<b;
 
 
	return 0;
}

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

int main()
{
    string s;
    cin >> s;
    if(s == "Sunny"){
        cout << "Cloudy" << endl;
    }else if(s == "Cloudy"){
        cout << "Rainy" << endl;
    }else{
        cout << "Sunny" << endl;

    }

}



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

using namespace std; 

typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef vector<PII> VPII;
typedef long long LL;
typedef vector<LL> VL;
typedef vector<VL> VVL;
typedef pair<LL, LL> PLL;
typedef vector<PLL> VPLL;
typedef priority_queue<int> PQ_DESC;
typedef priority_queue<int, vector<int>, greater<int>> PQ_ASC;
typedef priority_queue<PII> PQ_DESC_PII;
typedef priority_queue<PII, vector<PII>, greater<PII>> PQ_ASC_PII;
typedef priority_queue<VL> PQ_DESC_VL;
typedef priority_queue<VL, vector<VL>, greater<VL>> PQ_ASC_VL;
typedef priority_queue<PLL> PQ_DESC_PLL;
typedef priority_queue<PLL, vector<PLL>, greater<PLL>> PQ_ASC_PLL;

#define ALL(c) (c).begin(),(c).end()
#define PB push_back
#define MP make_pair
#define SORT_ASC(c) sort(ALL(c))
//#define SORT_DESC(c) sort(ALL(c), greater<typeof(*((c).begin()))>())
#define SORT_DESC(c) sort((c).rbegin(),(c).rend())
#define REV(c) reverse((c).begin(), (c).end())
#define SIZE(a) int((a).size())

#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define ROF(i,a,b) for(int i=(b-1);i>=(a);--i)
#define REP(i,n) FOR(i,0,n)
#define PER(i,n) ROF(i,0,n)

const double EPS = 1e-10;
const double PI  = acos(-1.0);
const int LARGE_INT = 1e9+100;
const int INF = 2e9+100;
const LL INF_LL = (LL)INF*(LL)INF;
const int MOD = 1e9+7;

//debug
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;

LL modpow(LL a, LL n) {
    LL res = 1;
    while (n > 0) {
        if (n & 1) res = res * a % MOD;
        a = a * a % MOD;
        n >>= 1;
    }
    return res;
}

void Main()
{
    int n;cin>>n;
    VL a(n),b(n);
    REP(i,n){
        cin>>a[i];
    }
    REP(i,n){
        cin>>b[i];
    }
    
    PQ_DESC_VL pq;
    REP(i,n){
        pq.push({b[i],i});
    }

    LL result = 0;

    while(!pq.empty()){
        LL now = pq.top()[0];
        LL idx = pq.top()[1];
        pq.pop();

        if(now == a[idx]){
            continue;
        }

        if(now == a[idx]){
            continue;
        }
        if(now < a[idx]){
            cout<<-1<<endl;
            return;
        }

        LL prev_idx = (idx-1+n)%n;
        LL next_idx = (idx+1)%n;
        LL neighbor = b[prev_idx] + b[next_idx];

        
        LL target = max(a[idx],neighbor);
        //if(!pq.empty()){
        //    target = max(target, pq.top()[0]);
        //}

        if(neighbor + a[idx] > now){
            cout<<-1<<endl;
            return;
        }

        LL diff = now - target;
        LL count = (diff+neighbor-1)/neighbor;
        result += count;
        b[idx] = now-neighbor*count;

        
        if(b[idx] == a[idx]){
            continue;
        }
        if(b[idx] < a[idx]){
            cout<<-1<<endl;
            return;
        }

        pq.push({b[idx],idx});

    }

    cout<<result<<endl;

    
    
	return;
}

int main()
{
	cin.tie(nullptr);
	ios_base::sync_with_stdio(false);
	cout << fixed << setprecision(15);
	Main();
    return 0;
}

Measured memory_bytes: 15664
#include <bits/stdc++.h>
using namespace std;
int main(){
    int answer = 0, s = 0;
    string S;
    cin >> S;
    for (int i = 0; i < (int) S.size() ;i++) {
        if (S.at(i) == 'S') {
            s++;
        }
        if (S.at(i) == 'T' && s > 0) {
                s--;
                answer++;
        }
    }
    cout << (int)S.size() - 2 * answer << endl;
}

Measured memory_bytes: 3724
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <cstring>

#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <queue>
#include <stack>
#include <map>
#include <set>
#include <unordered_map>
#include <unordered_set>

#include <complex>

#include <functional>
#include <cassert>

typedef long long ll;
using namespace std;

#define debug(x) cerr << __LINE__ << " : " << #x << " = " << (x) << endl;


#define mod 1000000007 //1e9+7(prime number)
#define INF 1000000000 //1e9
#define LLINF 2000000000000000000LL //2e18
#define SIZE 100010


int main(){
  int n, k;
  ll ans = 0;
  
  scanf("%d%d",&n,&k);

  for(int i=k+1;i<=n;i++){
    ans += n/i * (i - k);
    
    if(k > 0)
      ans += max(0, (n % i) - (k-1));
    else
      ans += n % i;    
  }

  printf("%lld\n",ans);
  
  return 0;
}



Measured memory_bytes: 256
n,y = map(int,input().split())

bool = False
answer=[0,0,0]
for a in range(0,n+1):
    for b in range(0,n-a+1):
        c = n-a-b
        if 10000*a+5000*b+1000*c==y:
            answer=[a,b,c]
            bool=True

if bool==False:
    print(-1, -1, -1)

if bool==True:
    print(answer[0], answer[1], answer[2])



Measured memory_bytes: 3060
n,a,b,c=map(int,input().split())
L=[int(input()) for _ in range(n)]

res2=1000000000

for i in range(2**n-1):
	for j in range(2**n-1):
		x=[]
		y=[]
		z=[]
		for k in range(n):
			
			if i>>k&1:
				if j>>k&1:
					x.append(L[k])
				else:
					y.append(L[k])
			else:
				if j>>k&1:
					z.append(L[k])
		res1=abs(sum(x)-a)+abs(sum(y)-b)+abs(sum(z)-c)
		
		if len(x)==0 or len(y)==0 or len(z)==0:
			continue
	
		if len(x)>1:
			res1+=10*(len(x)-1)
		if len(y)>1:
			res1+=10*(len(y)-1)
		if len(z)>1:
			res1+=10*(len(z)-1)				
		res2=min(res1,res2)

print(res2)

Measured memory_bytes: 3064
//ΔABC 070D
#include<iostream>
#include<cstdio>
#include<fstream>
#include<algorithm>
#include<vector>
#include<map>
#include<set>
#include<queue>
#include<cmath>
#include<cstring>
#include<cstdlib>
using namespace std;
typedef long long LL;
vector<pair<int,LL> > v[111111];
LL d[111111];
void dfs(int u,int fa)
{
	int i,s;
	s=v[u].size();
	for(i=0;i<s;i=i+1)
		if(v[u][i].first!=fa){
			d[v[u][i].first]=d[u]+v[u][i].second;
			dfs(v[u][i].first,u);
		}
}
int main()
{
	int n,i,x,y,z,q,k;
	scanf("%d",&n);
	for(i=1;i<n;i=i+1){
		scanf("%d%d%d",&x,&y,&z);
		v[x].push_back(make_pair(y,z));
		v[y].push_back(make_pair(x,z));
	}
	scanf("%d%d",&q,&k);
	d[k]=0;
	dfs(k,0);
	while(q--){
		scanf("%d%d",&x,&y);
		cout<<d[x]+d[y]<<endl;
	}
	return 0;
}

Measured memory_bytes: 16128
N = int(input())
H = list(map(int, input().split()))
cnt = 1

for i in range(N):
  flg = False
  for j in range(0, i):
    if H[j] <= H[i]:
      flg = True
    else:
      flg = False
      break
  if flg == True:
    cnt += 1
        
print(cnt)

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

using namespace std;

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

int main(){
  int n,o;
  while(cin >> n,n){
    int v[25][25] = {{}};
    int x,y;
    rep(i,n){
      cin >> x >> y;
      v[x][y] = 1;
    }
    int ans = 0;
    cin >> o;
    x = 10, y = 10;
    int d;
    string s;
    rep(i,o){
      cin >> s >> d;
      if(s == "W"){
        rep(j,d){
          --x;
          ans += v[x][y];
          v[x][y] = 0;
        }
      }
      if(s == "E"){
        rep(j,d){
          ++x;
          ans += v[x][y];
          v[x][y] = 0;
        }
      }
      if(s == "S"){
        rep(j,d){
          --y;
          ans += v[x][y];
          v[x][y] = 0;
        }
      }
      if(s == "N"){
        rep(j,d){
          ++y;
          ans += v[x][y];
          v[x][y] = 0;
        }
      }
      /* cout << ans << endl; */
    }
    if(ans == n){
      cout << "Yes" << endl;
    }
    else
      cout << "No" << endl;
  }
  return 0;
}

Measured memory_bytes: 3136
color_list = [int(_) for _ in input()]

zero_start = 0
one_start = 0

for i in range(len(color_list)):
    if i % 2 == 0: #偶数番目の時
        if color_list[i] == 0:
            one_start += 1
        else:
            zero_start += 1
    else: # 奇数番目の時
        if color_list[i] == 0:
            zero_start += 1
        else:
            one_start += 1

if zero_start < one_start:
    print(zero_start)
else:
    print(one_start)


Measured memory_bytes: 3956
#include<bits/stdc++.h>
using namespace std;
#define rep(i,a) for(int i=0;i<a;i++)
#define pd(a,n) for(int i=0;i<n;i++)cout<<a[i]<<((i==n-1)?"\n":" ");cout<<endl;
#define pdd(a,n,m)for(int i=0;i<n;i++){for(int j=0;j<m;j++)cout<<a[i][j]<<" ";cout<<endl;}
#define mp make_pair
#define pb push_back
#define ll long long
#define int ll
//#define __int64 lng long
#define P pair<int,int>
#define PP pair<P,int>

int k;
int ans;

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

signed main(){
  cin>>k;
  rep(i,k){
    rep(j,k){
      rep(l,k){
        ans+=lcm(lcm(i+1,j+1),l+1);
      }
    }
  }

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


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

int main() {
  string S, T;
  cin >> S >> T;

  int count = 0;
  for (int i = 0; i < 3; i++) {
    if (S[i] == T[i]) {
      count++;
    }
  }

  cout << count << endl;
}


Measured memory_bytes: 256
import std.stdio;
import std.string;
import std.conv;
import std.typecons;
import std.algorithm;
import std.functional;
import std.bigint;
import std.numeric;
import std.array;
import std.math;
import std.range;
import std.container;

void main() {
    while(true) {
        int n = readln.chomp.to!int;
        if (n==0) break;
        (n/4).iota.map!(_ => readln.chomp.to!int).reduce!"a+b".writeln;
    }
}

Measured memory_bytes: 2300
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define ld long double
#define fi first
#define se second 
#define pb push_back
#define all(x) (x).begin() , (x).end()
#define rep(i,a,b) for( ll i = a ; i < b ; i+=1 )
#define pp pair<ll,ll> 
#define sz(v) (ll)(v.size())
#define hell (ll)1000000007
#define slld(x) scanf("%lld",&x)
const ll N = 1e5 + 5 ;
ll t = 1 ;
bool prime( ll x ){
    for( ll i = 2 ; i*i <= x ; i++ ){
        if( x%i == 0 )
            return false ;
    }
    return true ;
}
void solve() 
{
    ll a , b , c ;
    cin >> a >> b ;
    c = __gcd(a,b);
    set<ll> seta ;
    for( ll i = 1 ; i*i <= c ; i++ ){
        if( c%i == 0 ){
            seta.insert(i);
            seta.insert(c/i);
        }
    }
    ll ans = 0 ;
    for( auto i : seta ){
        if(prime(i)){
            ans++;
        }
    }
    cout << ans << "\n";
}
signed main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
//    cin >> t ;
    while(t--){
        solve();
    }
    return 0 ;
}


Measured memory_bytes: 512
n, k = map(int, input().split())
h = list(map(int, input().split()))
dp = [float('inf')] * (n + 10)
dp[0] = 0
def chmin (a, b):
    if a < b:
        return a
    else:
        return b

for i in range(n):
    if i == 0:
        continue
    if i < k:
        for j in range(i):
            dp[i] = chmin(dp[i], dp[i - j - 1] + abs(h[i] - h[i - j - 1]))
    if k <= i < n:
        for j in range(k):
            dp[i] = chmin(dp[i], dp[i - j - 1] + abs(h[i] - h[i - j - 1]))

print(dp[n - 1])

Measured memory_bytes: 56184
#include <iostream>
#include <cstdio>
#include <string>
#include <algorithm>
#include <utility>
#include <cmath>
#include <vector>
#include <stack>
#include <queue>
#define rep(i, n) for(int i = 0; i < n; i++)
using namespace std;
typedef long long ll;
ll mod = 1000000007;

int main() {
    int n;
    cin >> n;
    int p[n], a[n], b[n];
    rep(i, n) {
        cin >> p[i];
        p[i]--;
        a[i] = (i+1)*n;
        b[i] = (n-i)*n;
    }

    rep(i, n) {
        a[p[i]] += i;
    }

    rep(i, n-1) {
        cout << a[i] << " ";
    }
    cout << a[n-1] << "\n";

    rep(i, n-1) {
        cout << b[i] << " ";
    }
    cout << b[n-1];

    cout << endl;
    return 0;
}

Measured memory_bytes: 896
#include <bits/stdc++.h>
#include <math.h>
using namespace std;
int main(void){
    int n;
    cin>>n;
    int a=0;
    if(n<=9) cout<<n;
    else if(n<=99) cout<<9;
    else if(n<=999) cout<<n-90;
    else if(n<=9999) cout<<909;
    else if(n<=99999) cout<<n-10000+910;
    else if(n<=999999) cout<<90909;
}


Measured memory_bytes: 256
#include <stdio.h>
int main(int argc, char const *argv[]) {
 int i, j, box[10000];
 i = 0;
 while (i < 10000) {
  scanf("%d", &box[i]);
  if (box[i] == 0) {
   break;
  } /*else{
   printf("case %d: %d\n", i + 1, box[i]);
   i += 1;
  }*/
 i += 1;
 }
 for (j = 0; j < i; j++) {
  printf("Case %d: %d\n", j + 1, box[j]);
 }
 return 0;
}

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

int main(){
  ios_base::sync_with_stdio(false);
  stack<int> st;
  string x;
  cin >> x;
  ll xlen = x.length();
  for(ll i = 0; i < xlen; i++){
    if(!st.empty()){
      if(st.top() == 'S' && x[i] == 'T'){
	st.pop();
      }else{
	st.push(x[i]);
      }
    }else{
      st.push(x[i]);
    }

  }
  cout << st.size() << endl;
}


Measured memory_bytes: 1300
#include <cmath>
#include <cstdio>
#include <iostream>
using namespace std;
int main() {
  double x = 0, y = 0, r = 0;
  int a, b;
  while (scanf("%d,%d", &a, &b) != EOF) {
    x += a * sin(r * M_PI / 180);
    y += a * cos(r * M_PI / 180);
    r += b;
  }
  printf("%d\n%d\n", (int) x, (int) y);
  return 0;
}

Measured memory_bytes: 1192
#include <bits/stdc++.h>
#define REP(i,n) for(int i=0; i<(int)(n); ++i)

using namespace std;
struct S{
    int node, time, score;
    S(int a, int b, int c) : node(a), time(b), score(c) {}
    bool operator < (const S& s) const {
        if(time != s.time) return time > s.time;
        if(score != s.score) return score < s.score;
        return node < s.node;
    }
};

int main(){
    int n, start;
    while(cin >> n >> start){
        start--;
        int l[1000], r[1000];
        REP(i, n) cin >> l[i] >> r[i];
        int w[1000][1000];
        REP(i, n) REP(j, n) cin >> w[i][j];
        REP(k, n) REP(i, n) REP(j, n) w[i][j] = min(w[i][j], w[i][k] + w[k][j]);
        priority_queue<S> que;
        que.push(S(start, 0, 0));
        vector<int> max_score(n, 0);
        while(!que.empty()){
            S s = que.top(); que.pop();
            //cout << s.node << " " << s.time << " " << s.score << endl;
            REP(v, n){
                int nt = s.time + w[s.node][v];
                if(nt <= r[v]){
                    S ns(v, r[v], s.score + r[v] - max(nt, l[v]));
                    if(max_score[ns.node] < ns.score){
                        max_score[ns.node] = ns.score;
                        que.push(ns);
                    }
                }
            }
        }
        cout << *max_element(max_score.begin(), max_score.end()) << endl;
    }
    return 0;
}

Measured memory_bytes: 5332
#include <bits/stdc++.h>
#include <boost/multiprecision/cpp_int.hpp>

using boost::multiprecision::cpp_int;
using namespace std;

#if __has_include("print.hpp")
  #include "print.hpp"
#endif

#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define ALL(x) (x).begin(), (x).end()
#define RALL(x) (x).rbegin(), (x).rend()
#define MOD 1000000007

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; }

typedef long long ll;
typedef pair<ll, ll> p;


int main(){
  ios::sync_with_stdio(false);
  cin.tie(0);
  int x, y, z;
  cin >> x >> y >> z;
  cout << z << ' ' << x << ' ' << y << endl;
}


Measured memory_bytes: 256
#include<cstdio>
#include<functional>
#include<algorithm>
#include<string.h>
using namespace std;

int main(){

	char w[100];
	int count[30];
	for(int i=0;i<=26;i++)
		count[i]=0;

	scanf("%s",w);
	int len=strlen(w);
	for(int i=0;i<len;i++){
		count[w[i]-97]++;
		//printf("%d %d\n",i,w[i]-61);
	}
	for(int i=0;i<26;i++){
		//printf("%d",count[i]%2);
		if(count[i]%2!=0){
			printf("No");
			return 0;
		}
	}
	printf("Yes");
	return 0;
}


Measured memory_bytes: 128
#include<bits/stdc++.h>
#define INF 1e9
#define llINF 1e18
#define MOD 1000000007
#define pb push_back
#define mp make_pair 
#define F first
#define S second
#define ll long long
#define vi vector<ll>
#define vvi vector<vi>
#define BITLE(n) (1LL<<((ll)n))
#define SUBS(s,f,t) ((s).substr((f),(t)-(f)))
#define ALL(a) (a).begin(),(a).end()
#define Max(a) (*max_element(ALL(a)))
#define Min(a) (*min_element(ALL(a)))
using namespace std;

int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  string s;cin>>s;
  ll ans = 0;
  for(auto c:s)ans += (c-'0');
  if(ans%9)cout<<"No"<<endl;
  else cout<<"Yes"<<endl;
  return 0;
}


Measured memory_bytes: 3744
import java.util.Scanner;
public class Main{
    public static void main(String args[]){
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        int b = sc.nextInt();

        if(a < b){
            System.out.println("a < b");
        } else if(a > b){
            System.out.println("a > b");
        } else{
            System.out.println("a == b");
        }
    }
}


Measured memory_bytes: 26112
import java.util.Scanner;

public class Main {

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

        String onlyOne = line.replaceAll("0", "");
        System.out.println(onlyOne.length());
        
        sc.close();
	}
	
}

Measured memory_bytes: 21588
/*
  Contest 083
  A - Libra
  Rakesh Kumar --> 16/09/2020
 */

#include <bits/stdc++.h>

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

    int a = 0, b = 0, c = 0, d = 0;
    std::cin >> a >> b >> c >> d;
    if (a + b > c + d)
        std::cout << "Left" << std::endl;
    else if (a + b < c + d)
        std::cout << "Right" << std::endl;
    else
        std::cout << "Balanced" << std::endl;

    return 0;
}


Measured memory_bytes: 3612
#include<stdio.h>
int main ()
{
  int A,B,C,D,i,a=0,b=0;
  scanf ("%d %d %d %d",&A,&B,&C,&D);
  if (A>=1&&A<=100&&B>=1&&B<=100&&C>=1&&C<=100&&D>=1&&D<=100)
  {
      for (i=1;i<=100;i++)
      {
          C=C-B;
          A=A-D;
      if (C<=0)
          {
              printf ("Yes\n");
              break;
          }
      if (A<=0)
         {
           printf ("No\n");
              break;
         }
      }
  }
  return 0;
}


Measured memory_bytes: 2092
#include <bits/stdc++.h>
using namespace std ;
int main()
{
  string x ;
  cin >> x ;
  if (x[0]==x[1]&&x[0]==x[2]&&x[0]==x[3])
    cout << "No" ;
  else if((x[0]==x[1]&&x[2]==x[3])||(x[0]==x[2]&&x[1]==x[3])||(x[0]==x[3]&&x[1]==x[2]))
  cout << "Yes" ;
  else
    cout << "No" ;



  return 0 ;
}


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

typedef vector<int> VI;
typedef vector<VI> VVI;

#define PB push_back

VI PS, QS, AS, NS, cnts;
int P, Q, A, N;
int T;

VVI have_n_ts;

int p_, q_;

// p / q

constexpr int MEMO_LIMIT = 3000;
int memo[MEMO_LIMIT][MEMO_LIMIT] = {};

// require: m > n
inline int gcd(int m, int n) {
    if (m < n) return gcd(n, m);
    if (m < MEMO_LIMIT && memo[m][n]) return memo[m][n];

    int ans = __gcd(m, n);
    if (m < MEMO_LIMIT) memo[m][n] = ans;

    return ans;
}

inline void yakubun(int &p, int &q) {
    int c = gcd(p, q);
    if (c == 1) return;
    p /= c;
    q /= c;
}

inline void add(int p1, int q1, int p2, int q2, int &np, int &nq) {
    np = p1 * q2 + p2 * q1;
    nq = q1 * q2;
    if (np > 0) {
        yakubun(np, nq);
    }
}

inline void sub(int p1, int q1, int p2, int q2, int &np, int &nq) {
    add(p1, q1, -1 * p2, q2, np, nq);
}

int np, nq;
inline void dfs(int p, int q, int a, int n, int before) {
    if (a > 12000) return;

    for (int t : have_n_ts[n]) {
        cnts[t] += a <= AS[t] && p == PS[t] && q == QS[t];
    }
    
    if (n >= 7) return;

    for (int i = before; i * a <= 12000; i++) {
        add(p, q, 1, i, np, nq);
        dfs(np, nq, a * i, n + 1, i);
    }
}

int main(void) {
    have_n_ts.resize(8);
    T = 0;
    while (cin >> P >> Q >> A >> N, P) {
        yakubun(P, Q);
        PS.PB(P);
        QS.PB(Q);
        AS.PB(A);
        NS.PB(N);
        for (int i = 1; i <= N; i++) {
            have_n_ts[i].PB(T);
        }
        ++T;
    }

    cnts.resize(T);

    dfs(0, 1, 1, 0, 1);

    for (auto cnt : cnts) cout << cnt << endl;

	return 0;
}

Measured memory_bytes: 35132
#pragma GCC optimize("Ofast")  
#pragma GCC target("avx,avx2,fma")
#include<bits/stdc++.h>
using namespace std;
#define IO ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
#define int long long 
#define endl "\n"
#define all(x) (x).begin(),(x).end()
const int MOD = 1e9+7;
const int mxN = 2e6+3;

void solve(){
	int n;
	cin >> n;
	int a[n];
	for(int i = 0; i < n; ++i)cin >> a[i];
	vector<bool> isPrime(mxN, true);
	vector<int> D(mxN, 0);
	isPrime[0] = false;
	D[0] = 1;
	isPrime[1] = false;
	D[1] = 1;
	for(int i = 2; i < mxN; ++i){
		if(isPrime[i]){
			D[i] = i;
			for(int j = i * i; j < mxN; j += i){
				isPrime[j] = false;
				D[j] = i;
			}
		}
	}
	map<int, int> mp;
	set<int> st;
	bool kr = false;
	for(int i = 0; i < n; ++i){
		if((a[i] != 1) and (st.find(a[i]) != st.end())){
			kr = true;
			break;
		}
		st.insert(a[i]);
		int k = a[i];
		while(D[k] != k){
			mp[D[k]]++;
			int p = D[k];
			while(k % p == 0)k /= p;
		}
		if(k > 1 and D[k] == k)mp[k]++;
	}
			
	bool pr = true;
	if(kr == false){
		for(auto it : mp){
			if(it.second > 1){
				pr = false;
				break;
			}
		}
	}else {
		pr = false;
	}
	if(pr)cout << "pairwise coprime\n";
	else{
		int gd = a[0];
		for(int i = 1; i < n; ++i){
			gd = __gcd(gd, a[i]);
		}
		if(gd == 1)cout << "setwise coprime\n";
		else cout << "not coprime\n";
	}
}

int32_t main(){
	IO;
	
	int nT = 1;
	//cin >> nT;
	for(int i = 1; i <= nT; ++i)
		solve();
	return 0;
}


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

int main() {
  int N;
  cin >> N;
  vector<vector<int>>XY(2, vector<int>(N));
  for(int i=0; i<N; i++)cin >> XY.at(0).at(i) >> XY.at(1).at(i);
  
  //int kaijou=1;
  //for(int i=1; i<=N; i++)kaijou *=i;
  
  int kyori=0;
  double wa =0;
  
  for(int i=0; i<N; i++){
    for(int j=i+1; j<N; j++){
      kyori = (XY.at(0).at(i)-XY.at(0).at(j))*(XY.at(0).at(i)-XY.at(0).at(j)) + (XY.at(1).at(i)-XY.at(1).at(j))*(XY.at(1).at(i)-XY.at(1).at(j));
      wa += sqrtl(kyori);
    }
  }
  
  wa = wa*2/N;
  
  cout <<std::setprecision(8) << wa<< endl;
}

Measured memory_bytes: 3788
import numpy as np

N, L = map(int, input().split(" "))

del_i = np.argmin([abs(L+i-1) for i in range(1, N+1)]) + 1
#print(del_i)

tmp = [L+i-1 for i in range(1, N+1) if i != del_i ]
#print(tmp)
out = sum(tmp)
print(out)

Measured memory_bytes: 21476
#include <iostream>
#include <cstdlib>

using namespace std;

int main() {
  while( 1 ) {
    int b, r, g, c, s, t;
    int metal = 100;
    cin >> b >> r >> g >> c >> s >> t;
    if( !( b | r | g | c | s | t ) ) { break; }
    metal += ( b * 15 * ( 1 + 5 ) ); // 777 and Big bonus
    metal += ( r * 15 * ( 1 + 3 ) ); // BBB and Reg bonus
    metal += ( g * 7 );
    metal += ( c * 2 );

    int br = b * 5 + r * 3;
    metal -= ( 3 * ( t - br - s ) + 2 * br ) ;
    cout << metal << endl;
  }

  return EXIT_SUCCESS;
}

Measured memory_bytes: 1160
#include<cstdio>
#include<math.h>
#include<algorithm>
#include<vector>
#include<queue>
#include<stack>
#include<string>
#include<set>
#include<cstring>
#include<map>
 
 
using namespace std;
#define int long long int
#define rep(i,n) for(int i=0;i<n;i++)
#define INF 1001001001
#define LLINF 1001001001001001001
#define mp make_pair
#define pb push_back
#define mod 1000000007


signed main(){
    while(1){
        int n,x;
        scanf("%lld %lld",&n,&x);
        if(n==0&&x==0)break;
        int count=0;
        for(int i=1;i<=n;i++){
            for(int j=i+1;j<=n;j++){
                for(int k=j+1;k<=n;k++){
                    if(i+j+k==x)count++;
                }
            }
        }
        printf("%lld\n",count);
    }
    return 0;
}



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

#define endl '\n'
#define fi first
#define se second
#define MOD(n,k) ( ( ((n) % (k)) + (k) ) % (k))
#define forn(i,n) for (int i = 0; i < n; i++)
#define forr(i,a,b) for (int i = a; i <= b; i++)
#define all(v) v.begin(), v.end()
#define pb(x) push_back(x)

using namespace std;

typedef long long ll;
typedef long double ld;
typedef pair<int, int> ii;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ii> vii;

const int MX = 100005;
int a[MX], n, tot;

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

	cin >> n;
	for (int i = 1; i <= n; i++) {
		cin >> a[i];
		tot += abs(a[i] - a[i - 1]);
	}

	tot += abs(a[n]);

	for (int i = 1; i <= n; i++) {
		ll p = tot - abs(a[i] - a[i - 1]) - abs(a[i + 1] - a[i]) + abs(a[i + 1] - a[i - 1]);
		cout << p << endl;
	}

	return 0;
}


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

bool kaibun(string s) {
  string r = s;
  reverse(r.begin(), r.end());
  return s == r;
}

int main() {
  string s;
  cin >> s;
  
  bool y = 0;
  if (kaibun(s)) {
    int n = (s.size() - 1) / 2;
    if (kaibun(s.substr(0, n)) &&
        kaibun(s.substr(s.size() - n, n))
       ) {
      y = 1;
    }
  }
  cout << (y ? "Yes" : "No") << endl;
}


Measured memory_bytes: 256
#include <cstdio>
#include <cstring>
#include <cmath>
#include <utility>
#include <iostream>
#include <functional>
#include <bitset>
#include <algorithm>
#include <vector>
#include <forward_list>
#include <set>
#include <map>
#include <queue>
#include <deque>
#include <stack>
#define ll long long int
#define rep(i,n) for(int i=0;i<(n);i++)
using namespace std;
int mx4[] = {0,1,0,-1};
int my4[] = {1,0,-1,0};


//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


int main(){
    int k,l = 0; cin >> k;
    ll ans = 0;
    vector<int> g(k*k);
    rep(i,k){
        rep(j,k){
            g[l] = __gcd(i+1,j+1);
            l++;
        }
    }
    rep(i,k){
        rep(j,k*k){
            
            if(g[j] == 1) ans += 1;
            else ans += __gcd(g[j],i+1);
        }
    }
    cout << ans << endl;
}

Measured memory_bytes: 3620
#include<bits/stdc++.h>
using namespace std;
#define infile    freopen("/home/suryakant/input.txt","r",stdin)
#define outfile   freopen("/home/suryakant/output.txt","w",stdout)
int main()
{
	// infile,outfile;
	int a,b;cin>>a>>b;
	cout<<a*b<<"\n";
}

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

#define REP(i,n) for(int i=0;i<(n);i++)
#define REAP(i,a,n) for(int i=(a);i<(n);i++)
#define YES cout<<"Yes"<<endl
#define NO cout<<"No"<<endl
#define fr first
#define sc second
#define pb push_back
#define All(v) v.begin(),v.end()
typedef long long ll;

int main(){
    ios::sync_with_stdio(false);
    ll n,a,b;
    cin >> n >> a >> b;

    if((b-a)%2){
        ll aa = min(n-a,b-1);
        ll bb = (b-a)/2+a;
        ll cc = n-b+1+(n-a-(n-b+1))/2;
        cout << min(aa, min(bb, cc)) << endl;
    }else{
        cout << (b-a+1)/2 << endl;
    }

}


Measured memory_bytes: 256
using System;
using System.Collections.Generic;
using System.Linq;

namespace AtCoderBeginnerContest
{
    public class Program
    {
        public static void Main(string[] args)
        {
            // B

            var o = Console.ReadLine();
            var e = Console.ReadLine();
            var ret = new char[100];

            for (int i = 0; i < o.Length; i++)
            {
                ret[i * 2] = o[i];
            }
            for (int i = 0; i < e.Length; i++)
            {
                ret[i * 2 + 1] = e[i];
            }

            string s = new string(ret);

            Console.WriteLine(s.Trim('\0'));
        }
    }
}


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

#define INF 1001001001
#define LINF 1001001001001001001
#define MOD 1000000007
#define MOD2 998244353

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

#define rep(i,n) for(int i=0,_i=(n);i<_i;++i)
#define rep1(i,a,b) for(int a_=(a),b_=(b),i=a_;i<b_;++i)
#define repr(i,n) for(int _i=(n),i=_i;i>0;--i)

#define db(x) cerr<<#x<<" = "<<x<<" ";
#define db2(x,y) cerr<<"("<<#x<<", "<<#y<<") = ("<<x<<", "<<y<<") ";
#define db3(x,y,z) cerr<<"("<<#x<<", "<<#y<<", "<<#z<<") = ("<<x<<", "<<y<<", "<<z<<") ";
#define ln cout<<endl;

#define all(a)  (a).begin(),(a).end()
#define dig(n)  to_string(n).length()

#define pb push_back
#define eb emplace_back
#define mp make_pair
#define se second
#define fi first

typedef long long ll;
typedef pair<int,int> pii;
typedef pair<pii,pii> ppii;

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

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

int main(){
    bool flag=false;
    ll ans=0,sum=0;

    int n,m;
    cin >>n;
    vector<int> a(n+1);
    rep(i,n)cin>>a[i+1];

    int cnt=0,ai=1;
    while (cnt < n){
        ++cnt;
        if((ai = a[ai]) == 2){
            flag=true;
            break;
        }
    }
    

    //cout <<fixed<<setprecision(16)<< << endl;
    //cout<<ans<<endl;
    if(flag)cout << cnt <<endl;
    else cout << -1 <<endl;
    
    return 0;
}


Measured memory_bytes: 640
import bisect
n,k = map(int,input().split())
x = list(map(int,input().split()))
zero = bisect.bisect(x,0)
left = [0] + (x[:zero])[::-1]
right = [0] + x[zero:]
ans = 10**12
for i in range(min(k+1,len(left))):
  j = k-i
  if j >= len(right):
    continue
  ans = min(ans,2*right[j]-left[i],-2*left[i]+right[j])
print(ans)

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

long long dp[1<<20] = {0};
int h[1<<20];

int main(){
	ios_base::sync_with_stdio(false); cin.tie(0);
	int n, k;
	cin >> n >> k;
	for(int i = 0; i < n; i++) {
		cin >> h[i];
	}
	dp[0] = 0;
	for(int i = 1; i < n; i++) {
		dp[i] = LLONG_MAX;
		for(int j = max(0, i - k); j < i; j++) {
			dp[i] = min(dp[i], dp[j] + abs(h[i] - h[j]));
		}
	}
	cout << dp[n - 1] << endl;
} 

Measured memory_bytes: 2688
import java.util.Scanner;

public class Main {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        
        Scanner s = new Scanner(System.in);
        String dance = s.next();
        
        String output = "Yes";
        
        for (int i = 0; i < dance.length(); i ++) {
            if (i % 2 == 0
                    && dance.charAt(i) != 'R'
                    && dance.charAt(i) != 'U'
                    && dance.charAt(i) != 'D')
                output = "No";
            else if (i % 2 == 1
                    && dance.charAt(i) != 'L'
                    && dance.charAt(i) != 'U'
                    && dance.charAt(i) != 'D')
                output = "No";
        }
        
        System.out.println(output);
        
    }
    
}


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

using namespace std;

int a, b, c, a1, b1, c1, ans;

int main()
{
    cin >> a >> b >> c;
    if (a == b && b == c && a % 2 == 0)
    {
        cout << -1;
        return 0;
    }
    while (a % 2 == 0 && b % 2 == 0 && c % 2 == 0)
    {
        b1 = a / 2 + c / 2;
        a1 = b / 2 + c / 2;
        c1 = a / 2 + b / 2;
        a = a1;
        b = b1;
        c = c1;
        ans++;
    }
    cout << ans << endl;
    return 0;
}



Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <cmath>
#include <vector>
#include <queue>
#include <map>
#include <cmath>
#include <numeric>
#include <iomanip>
#include <set>
#include <string.h>

using namespace std;

typedef long long ll;

#define REP(i,n) for(ll (i)=0;(i)<(n);(i)++)
#define REP3(i,st,en) for(ll (i)=(st);(i)<(en);(i)++)

using P = pair<ll, ll>;
const int MOD = 1e9+7;
const ll INF = 1e+14;
const double PI = 3.14159265349;



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

  ll H, N;
  cin >> H >> N;
  vector<ll> A(N);
  REP(i,N) { cin >> A[i]; }

  ll sum = accumulate(A.begin(), A.end(), 0);
  cout << ((sum>=H) ? "Yes" : "No") << "\n";
  return 0;
}


Measured memory_bytes: 1024
// #define _GLIBCXX_DEBUG // for STL debug (optional)
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <string>
#include <cstring>
#include <deque>
#include <list>
#include <queue>
#include <stack>
#include <vector>
#include <utility>
#include <algorithm>
#include <map>
#include <set>
#include <complex>
#include <cmath>
#include <limits>
#include <cfloat>
#include <climits>
#include <ctime>
#include <cassert>
#include <numeric>
#include <fstream>
#include <functional>
#include <bitset>
using namespace std;
using ll = long long int;
using int64 = long long int;
 
template<typename T> void chmax(T &a, T b) {a = max(a, b);}
template<typename T> void chmin(T &a, T b) {a = min(a, b);}
template<typename T> void chadd(T &a, T b) {a = a + b;}
 
int dx[] = {0, 0, 1, -1};
int dy[] = {1, -1, 0, 0};
const int INF = 1LL << 29;
const ll LONGINF = 1LL << 60;
const ll MOD = 1000000007LL;
 
int main() {
    int S = 0, T = 0, N = 4;
    for(int i=0; i<2*N; i++) {
        int v; scanf("%d", &v);
        (i < N ? S : T) += v;
    }
    cout << max(S, T) << endl;
    return 0;
}



Measured memory_bytes: 3152
#include <algorithm>
#include <iostream>

using namespace std;

using ull = unsigned long long;
ull solve(ull n, ull a, ull b) {
  if (a > b) {
    swap(a, b);
  }

  if ((b - a) % 2 == 0) {
    return (b - a) / 2;
  }

  ull dist_l = a - 1, dist_r = n - b;
  if (dist_l < dist_r) {
    return solve(n, 1, b - dist_l - 1) + dist_l + 1;
  } else {
    return solve(n, a + dist_r + 1, n) + dist_r + 1;
  }
}

int main(int argc, const char *argv[])
{
  ull n, a, b;
  cin >> n >> a >> b;
  cout << solve(n, a, b) << "\n";
  return 0;
}

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

int main()
{
    int s;
    cin >> s;
    if (s == 0)
    {
        cout << 0 << endl;
    }
    else if (!(s % 3))
    {
        cout << 3 << endl;
    }
    else
    {
        cout << s % 3 << endl;
    }
}

Measured memory_bytes: 256
#include <stdio.h>
#include <math.h>
#define N 10000

int isprime(int);
  
int main(){
  int i = 0, j = 0, k = 0;
  int n = 0, flag = 0;
  int list[N];
  
  scanf("%d",&n);
  for(i = 0; i < n; i++){
    scanf("%d",&list[i]);
  }

  for(i = 0; i < n; i++){
    flag = isprime(list[i]);
    if(flag == 1)k++;
  }
  printf("%d\n",k);
  
  return 0;
}

int isprime(int x){
  int i = 0;
  
  if(x == 2)return 1;
  if(x < 2 || x%2 == 0)return 0;

  i = 3;
  while(i <= sqrt(x)){
    if(x%i == 0)return 0;
    i = i + 2;
  }
  return 1;
}
/*
  for(i = 0; i < n; i++){
    flag = 0;
    for(j = 2; j < list[i]; j++){
      if(list[i]%j == 0){
	flag = 1;
	k++;
	break;
      }
    }
  }
  */



Measured memory_bytes: 2100
#include <iostream>
#include <string>
#include <map>
#include <vector>
#include <stdint.h>
using namespace std;

#define REP(i, n) for(int i = 0; i < n; i++)
#define RREP(i,n) for(int i = (n)-1; i >= 0; i--)
#define FOR(i, l, r) for(int i = l; i < r; i++)
#define RFOR(i, l,r) for(int i= (l)-1; i>= (r) ; i--)

int now = 1;
int dots[2] = {2, 3}; // 0 : S , 1 : E

void rotate(char c)
{
    int n_now = now, n_dots[] = {dots[0], dots[1]};

    switch(c)
    {
        case 'N':
            n_now = dots[0];
            n_dots[0] = 7 - now;
            break;
        case 'W':
            n_now = dots[1];
            n_dots[1] = 7 - now;
            break;
        case 'E':
            n_now = 7 - dots[1];
            n_dots[1] = now;
            break;
        case 'S':
            n_now = 7 - dots[0];
            n_dots[0] = now;
            break;
        case 'L':
            n_dots[0] = 7 - dots[1];
            n_dots[1] = dots[0];
            break;
        case 'R':
            n_dots[1] = 7 - dots[0];
            n_dots[0] = dots[1];
            break;
    }
    now = n_now;
    dots[0] = n_dots[0];
    dots[1] = n_dots[1];
}

int solve(string s, int n)
{
    now = 1;
    dots[0] = 2;
    dots[1] = 3;
    int sum = now;
    REP(i, n)
    {
        rotate(s[i]);
        sum += now;
    }
    return sum;
}

int main()
{
    ios::sync_with_stdio(false);
    int n;
    while(cin >> n)
    {
        if(n == 0)
            break;
        string s;
        REP(i, n)
        {
            string tmp;
            cin >> tmp;
            s += tmp[0];
        }
        cout << solve(s, n) << endl;
    }
}

Measured memory_bytes: 3248
#include<bits/stdc++.h>
#define rep(i,a,b) for(int i=a;i<b;i++)
#define rrep(i,a,b) for(int i=a;i>=b;i--)
#define fore(i,a) for(auto &i:a)
#define all(x) (x).begin(),(x).end()
#pragma GCC optimize ("-O3")
using namespace std; void _main(); int main() { cin.tie(0); ios::sync_with_stdio(false); _main(); }
typedef long long ll; const int inf = INT_MAX / 2; const ll infl = 1LL << 60;
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; }
//---------------------------------------------------------------------------------------------------
/*---------------------------------------------------------------------------------------------------
　　　　　　　　　　　 ∧＿∧  
　　　　　 ∧＿∧ 　（´<_｀ ）　 Welcome to My Coding Space!
　　　　 （ ´_ゝ`）　/　 ⌒i     
　　　　／　　　＼　 　  |　|     
　　　 /　　 /￣￣￣￣/　　|  
　 ＿_(__ﾆつ/　    ＿/ .| .|＿＿＿＿  
　 　　　＼/＿＿＿＿/　（u　⊃  
---------------------------------------------------------------------------------------------------*/
 
 
 
 




int X;
//---------------------------------------------------------------------------------------------------
void _main() {
    cin >> X;

    string ans = "ai1333";
    rep(i, 0, X / 100) ans += "3";
    cout << ans << endl;
}


Measured memory_bytes: 3240
#include <bits/stdc++.h>
using namespace std;
#define FOR(i, s, n) for(int i = s; i < (int)n; i++)
#define per(i, n) for(int i = n; i >= 0; i--)
#define ROF(i, s, n) for(int i = s; i >= (int)n; i--)
#define FORIT(i, A) for (auto i : A)
#define PRINT(x) cout << (x) << "\n"
#define ALL(a) (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define MP make_pair
#define EACH(i, n) for (__typeof((n).begin()) i = (n).begin(); i != (n).end(); ++i)
#define SZ(a) int((a).size())
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())
#define CLR(a) memset((a), 0 ,sizeof(a))
#define NCLR(a) memset((a), -1 ,sizeof(a))
#define dump(x) cout << #x << " = " << (x) << "\n";
#define debug(x) cout << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << "\n";
#define sq(n) (n) * (n)
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef long long LL;
typedef vector<LL> VLL;
typedef vector<VLL> VVLL;
typedef unsigned int uint;
typedef unsigned long long ull;
typedef priority_queue<int> maxpq;
typedef priority_queue< int, vector<int>, greater<int> > minpq;
static const double EPS = 1e-10;
static const double PI = acos( -1.0 );
static const int mod = 1000000007;
static const int INF = 1 << 30;
static const LL LL_INF = 1152921504606846976;
static const int dx[] = { -1, 0, 1, 0, 1, -1, 1, -1 };
static const int dy[] = { 0, -1, 0, 1, 1, 1, -1, -1 };



double xa1, ya1, xa2, ya2, xb1, yb1, xb2, yb2;

int main() {
	while ( ~scanf( "%lf %lf %lf %lf %lf %lf %lf %lf", &xa1, &ya1, &xa2, &ya2, &xb1, &yb1, &xb2, &yb2 ) ) {
		bool ans = ( xa1 <= xb2 && xa2 >= xb1 && ya1 <= yb2 && ya2 >= yb1 ) || ( xa1 >= xb2 && xa2 <= xb1 && ya1 >= yb2 && ya2 <= yb1 );
		printf( "%s\n", ans ? "YES" : "NO" );
	}
	return 0;
}

Measured memory_bytes: 1196
void main() {
	auto ip = readAs!(int[]), N = ip[0], K = ip[1];
	auto arr = new bool[](N);
	foreach(i; 0..K) {
		auto d = ri;
		auto A = readAs!(int[]);
		foreach(v; A) arr[v-1] = true;
	}
	arr.count!(v => !v).writeln;
}

// ===================================

import std.stdio;
import std.string;
import std.functional;
import std.algorithm;
import std.range;
import std.traits;
import std.math;
import std.container;
import std.bigint;
import std.numeric;
import std.conv;
import std.typecons;
import std.uni;
import std.ascii;
import std.bitmanip;
import core.bitop;

T readAs(T)() if (isBasicType!T) {
	return readln.chomp.to!T;
}
T readAs(T)() if (isArray!T) {
	return readln.split.to!T;
}

T[][] readMatrix(T)(uint height, uint width) if (!isSomeChar!T) {
	auto res = new T[][](height, width);
	foreach(i; 0..height) {
		res[i] = readAs!(T[]);
	}
	return res;
}

T[][] readMatrix(T)(uint height, uint width) if (isSomeChar!T) {
	auto res = new T[][](height, width);
	foreach(i; 0..height) {
		auto s = rs;
		foreach(j; 0..width) res[i][j] = s[j].to!T;
	}
	return res;
}

int ri() {
	return readAs!int;
}

double rd() {
	return readAs!double;
}

string rs() {
	return readln.chomp;
}

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

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

int main() {
    long int a,b,c,d;
    cin >> a >> b >> c >> d;

    long int cd = c * d / gcd(c,d) ;
    
    long int n = 0;

    n += (b / c - (a - 1) / c);
    n += (b / d - (a - 1) / d);



    n -= (b / cd - (a - 1) / cd);

    n = (b-a) -n+1;

    cout << n << endl;



}

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <cstring>
#include <algorithm>
using namespace std;
int main() {
    int N;
    int K;
    int result = 0;
    std::cin >> N >> K;
    while (N > 0) {
        N /= K;
        result++;
    }
    std::cout << result;
    return 0;
}

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

using namespace std;
using uint = unsigned int;
using ll = long long;
using ull = unsigned long long;
using pii = pair<int,int>;
using pll = pair<long, long>;
template <class T> using V = vector<T>;
template <class T> using VV = V<V<T>>;
#define rep(i, n) for(ll i = 0; i<n; i++)
#define rep_s(i, start, n) for(ll i= start;  i<n; i++)
#define rep_down(i, n) for(ll i = n-1; i>=0; i--)
#define rep_down_s(i, n, start) for(ll i = n-1; i>=start; i--)
#define ALL(a) (a).begin(), (a).end()
#define ALL_str(a) (a).cbegin(), (a).cend()
#define print(ans) cout << ans << endl;
#define MOD 1000000007
string alphabet_upper = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
string alphabet_lower  = "abcdefghijklmnopqrstuvwxyz";
string numbers = "0123456789";

/*
for (iterator = hash.begin(); iterator != hash.end(); iterator++)
{
// ここで、要素毎の操作を行います。
std::pair<std::string, CMyClass> element = *iterator;

}
*/
/*
using edge = struct {int to; ll cost;};
vector<edge> tree[limit];
ll depth[limit];

void dfs(int v, int p, ll d){
  depth[v] = d;
  //cout <<"v: " << v << endl;
  for (auto &e: tree[v]){
    //cout << "e.to: " << e.to << endl;
    if (e.to == p) continue;
    dfs(e.to, v, d+e.cost);
  }
}
*/
int keta_sum(int num){
  int dig, sum = 0;
  while(num){
    dig = num % 10;
    sum = sum + dig;
    num = num / 10;
  }
  return sum;
}

ll keta_num(ll num){
  ll total = 0;
  while(num){
    num /= 10;
    total++;
  }
}


ll binary_search(ll left_key, ll border, ll low, ll high) {
     // 配列 a の左端と右端
    ll mid = (low+high)/2;
    while (high > low+1) {
       mid = (low+high)/2;
        if (left_key*mid>border) high = mid;
        else if (left_key*mid<border) low = mid;
        else {
          mid =mid-1;
          break;
        }
    }
    return mid;
}

bool IsPrime(ll a){
  ll b = sqrt(a);
  b++;
  while(b-->=2){
    if (a%b==0) return false;
  }
  return true;
}

ll gcd(ll a, ll b){
  ll tmp;
  if(a<b){
    tmp = a;
    a = b;
    b = tmp;
  }

  ll r = a % b;
  while(r!=0){
    a = b;
    b = r;
    r = a % b;
  }
  return b;
}

ll fibonacchi(ll num){
  ll f0 = 0, f1 = 1, f2;
  ll count = 0;
  while(count<num){
    f2 = f0+f1;
    f0 = f1;
    f1 = f2;
    count++;
  }
  return f2;
}

struct UnionFind {
    vector<int> par; // par[i]:iの親の番号　(例) par[3] = 2 : 3の親が2

    UnionFind(int N) : par(N) { //最初は全てが根であるとして初期化
        for(int i = 0; i < N; i++) par[i] = i;
    }

    int root(int x) { // データxが属する木の根を再帰で得る：root(x) = {xの木の根}
        if (par[x] == x) return x;
        return par[x] = root(par[x]);
    }

    void unite(int x, int y) { // xとyの木を併合
        int rx = root(x); //xの根をrx
        int ry = root(y); //yの根をry
        if (rx == ry) return; //xとyの根が同じ(=同じ木にある)時はそのまま
        par[rx] = ry; //xとyの根が同じでない(=同じ木にない)時：xの根rxをyの根ryにつける
    }

    bool same(int x, int y) { // 2つのデータx, yが属する木が同じならtrueを返す
        int rx = root(x);
        int ry = root(y);
        return rx == ry;
    }
};

int main(void){
  ll N, M, A, B, C, D, E, F, G, K,L, W, H, P, Q, R, V, X, Y;
  string S, T;
  cin >>A >> B;
  if (B>=A) cout << "unsafe" << endl;
  else cout << "safe" << endl;



}


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

signed main(){
  int n;
  string s;
  cin>>n>>s;
  int A=0,B=0;
  r(i,n){
    if('A'<=s[i]&&s[i]<='M')A++;
    if('N'<=s[i]&&s[i]<='Z')A--;
    if('a'<=s[i]&&s[i]<='m')B++;
    if('n'<=s[i]&&s[i]<='z')B--;
  }
  cout<<abs(A)+abs(B)<<endl;
  if(A>0){
    r(i,abs(A))cout<<'A';
  }
  if(A<0){
    r(i,abs(A))cout<<'Z';
  }
  if(B>0){
    r(i,abs(B))cout<<'a';
  }
  if(B<0){
    r(i,abs(B))cout<<'z';
  }
  cout<<endl;
}



Measured memory_bytes: 3292