akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;

int main()
{
    ll N;
    cin >> N;
    vector<ll> P(N, 0);
    vector<ll> Q(N, 0);
    for (int i = 0; i < N; i++)
    {
        cin >> P[i];
        --P[i];
    }
    for (int i = 0; i < N; i++)
    {
        cin >> Q[i];
        --Q[i];
    }

    map<vector<ll>, ll> ord;
    vector<ll> seq(N);

    ll iter = 0;
    for (ll i = 0; i < N; i++)seq[i] = i;

    do{
        ord[seq] = iter++;
    }while(next_permutation(seq.begin(),seq.end()));

    cout << abs(ord[P] - ord[Q]);
    return 0;
}

Measured memory_bytes: 9912
# ABC113C - ID
import sys
input = sys.stdin.readline

def main():
    N, M = map(int, input().split())
    ans, A, cnt = [""] * M, [], 1
    for i in range(M):
        p, y = map(int, input().split())
        A += [(p, y, i)]
    A.sort()
    ans[A[0][2]] = "{:06}{:06}".format(A[0][0], cnt)
    prev = A[0][0]
    for p, _, i in A[1:]:
        if prev == p:
            cnt += 1
        else:
            cnt = 1
        ans[i] = "{:06}{:06}".format(p, cnt)
        prev = p
    print(*ans, sep="\n")


if __name__ == "__main__":
    main()

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

int main(){
  map<int, int> mp;
  int X,N;cin>>X>>N;
  for(int i=0; i<N; i++){
    int f;cin>>f;mp[f]++;
  }
  int i,j;
  i=j=X;
  while(1){
    if(mp.find(i)==mp.end()){
      cout<<i<<endl;
      break;
    }
    if(mp.find(j)==mp.end()){
      cout<<j<<endl;
      break;
    }
    i--;j++;
  }
}

Measured memory_bytes: 3624
n, k = list(map(int, input().split(" ")))
L = [0]*n

for v in range(k):
    d_ = int(input())
    d__ = input()
    d_l = list(map(int, d__.split(" ")))
    for v in range(d_):
        m = d_l[v]
        L[m-1] += 1
print(L.count(0))

Measured memory_bytes: 9188
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/detail/standard_policies.hpp>
#define ll  long long 
#define ull unsigned long long int
#define boost ios_base::sync_with_stdio(false);	cin.tie(NULL);	cout.tie(NULL)
#define vi vector<int>
#define P push_back
#define F first
#define S second
#define debug(x) cout<<x<<" "
#define pi vector<pair<int,int> >
#define all(a) a.begin(),a.end()
#define int ll
using namespace std;
using namespace __gnu_pbds;
typedef tree <int, null_type,less<int>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;
ll const mod=1e9+7;
int powi(int i,int b){
    int res=1;
    while(b){
        if(b&1)res*=i,res%=mod;
        b>>=1;
        i*=i;
        i%=mod;
    }
    return res;
}
// map<int,int> m;
// ll fact(int n){
// 	//if(n==0)return 0;
// 	if(n<=1)return 1;
// 	if(m[n]!=0)return m[n];
// 	return m[n]=(n*fact(n-1))%mod;
//}
// int ncr(int n,int r){
//     int h=fact(n);
//     int v=fact(r);
//     int j=fact(n-r);
//     v*=j;
//     v%=mod;
//     v=powi(v,mod-2);
//     return (h*v)%mod;
// }
// vi ar(2000000);
// vi sz(2000000);
// int root(int a){
//     if(ar[a]==a)return a;
//     return ar[a]=root(ar[a]);
// }
// int merge(int a,int b){
//     int h=root(a),j=root(b);
//     int ans=sz[h]*sz[j];
//     sz[j]+=sz[h];
//     if(h!=j){
//         ar[h]=j;
//     }
//     return ans;
// } 
void solve(){
    int n;
    cin>>n;
    vi a(n);
    for(int i=0;i<n;i++){
        cin>>a[i];
    }
    int lef=0;
    int ans=0,cur=0;
    for(int i=0;i<n;i++){
        if(cur&a[i]){
            //debug(i);
            ans+=((i-lef)*(i-lef+1))/2;
            while(lef<i&&(cur&a[i])){
                cur^=a[lef];
                lef++;
            }
            ans-=((i-lef)*(i-lef+1))/2;
            cur|=a[i];
        }else cur|=a[i];
    }
    ans+=((n-1-lef+1)*(n-1-lef+2))/2;
    cout<<ans;
}
signed main(){
    boost;
    int t=1;
    //cin>>t;
    for(int _=1;_<=t;_++){
        //cout<<"Case #"<<_<<": ";
        solve();
        cout<<"\n";
    }
    
    return 0;
}

Measured memory_bytes: 1792
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int,int> P;
typedef pair<ll,ll> l_l;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vl;
typedef vector<P> vp;
#define pb push_back
#define sz(x) (int)(x).size()
#define fi first
#define se second
#define rep(i,n) for(int i = 0; i < (n); ++i)
#define rrep(i,n) for(int i = 1; i <= (n); ++i)
#define drep(i,n) for(int i = (n)-1; i >= 0; --i)
const int INF=1001001000;
const int mINF=-1001001000;
const ll LINF=1010010010010010000;
template<class T> inline bool chmin(T& a, T b) {
if (a > b) {
a = b;
return true;
}
return false;
}
template<class T> inline bool chmax(T& a, T b) {
if (a < b) {
a = b;
return true;
}
return false;
}
//グリッド：（典型）dp,dfs,bfs,最短経路,その他
l_l dp[55][55];
int main(){
    ll n,a,b;cin>>n>>a>>b;
    vl v(n);rep(i,n)cin>>v[i];
    rep(i,55){
        rep(j,55){
            dp[i][j]={0,0};
        }
    }
    dp[0][0]={0,1};
    rep(i,n){
        rep(j,n){
            if(dp[i+1][j].fi<dp[i][j].fi){
                dp[i+1][j].fi=dp[i][j].fi;
                dp[i+1][j].se=dp[i][j].se;
            }
            else if(dp[i+1][j].fi==dp[i][j].fi){
                dp[i+1][j].se+=dp[i][j].se;
            }
            if(dp[i+1][j+1].fi<dp[i][j].fi+v[i]){
                dp[i+1][j+1].fi=dp[i][j].fi+v[i];
                dp[i+1][j+1].se=dp[i][j].se;
            }
            else if(dp[i+1][j+1].fi==dp[i][j].fi+v[i]){
                dp[i+1][j+1].se+=dp[i][j].se;
            }
        }
    }
    ld mx=0;
    rrep(i,n){
        if(i<a||i>b)continue;
        chmax(mx,(ld)dp[n][i].fi/i);
    }
    ll ans=0;
    rrep(i,n){
        if(i<a||i>b)continue;
        if((ld)dp[n][i].fi/i==mx) ans+=dp[n][i].se;
    }
    cout<<fixed<<setprecision(10);
    cout<<mx<<endl;
    cout<<ans<<endl;
    return 0;
}

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

int main() {
	int n;
	cin >> n;
	
	long long a[n];
	for(int i=0; i<n; i++){
		cin >> a[i];
	}
	
	if(n%2==0){
		for(int i=n-1; i>=0; i--){
			if(i%2==1){
				cout << a[i];
				if(i!=n-2){cout<<" ";}
			}
	
		}
		for(int i=0; i<n; i++){
			if(i%2==0){
				cout << a[i];
				if(i!=n-2){cout<<" ";}
			}


		}
	}
	if(n%2==1){
		for(int i=n-1; i>=0; i--){
			if(i%2==0){
				cout << a[i];
				if(i!=n-2){cout<<" ";}				
			}

		}
		for(int i=0; i<n; i++){
			if(i%2==1){
				cout << a[i];
				if(i!=n-2){cout<<" ";}
			}
			
		}
	}
	
	cout<<endl;
	return 0;
}

Measured memory_bytes: 3712
"""
入力例 1 
11 3 2
ooxxxoxxxoo
->6
入力例 2 
5 2 3
ooxoo
->1
->5

入力例 3 
5 1 0
ooooo
->
入力例 4 
16 4 3
ooxxoxoxxxoxoxxo
->11
->16
"""
n,k,c = map(int,input().split())
s = input()
r=[0]*n
l=[0]*n
ki=0
ci=100000
for i in range(n):
    ci += 1
    if s[i]=='x':
        continue
    if ci > c:
        ci = 0
        ki+=1
        l[i]=ki
    if ki == k:
        break

ki=k
ci=100000
for i in range(n):
    ci += 1
    if s[n-1-i]=='x':
        continue
    if ci > c:
        ci = 0
        r[n-1-i]=ki
        ki-=1
    if ki == 0:
        break
ret=[]
for i in range(n):
    if r[i]==l[i] and r[i]!=0:
        ret.append(i+1)
# print(l)
# print(r)
for i in range(len(ret)):
  print(ret[i])
  



Measured memory_bytes: 28568
let fst3 (a,b,c) = a
let () = Scanf.scanf "%d %d" @@ fun n m ->
  let es = Array.init m (fun _ -> Scanf.scanf " %d %d" @@ fun a b -> a-1, b-1) in
  Scanf.scanf " %d" @@ fun q ->

  let qa =
    let t = Array.init 11 (fun _ -> []) in
    for i = 0 to q-1 do
      Scanf.scanf " %d %d %d" @@ fun v d c ->
      t.(10-d) <- (i, v-1, c) :: t.(10-d)
    done;
    Array.map List.rev t
  in

  let color = Array.make n (-1, 0, -1) in
  qa.(0) |> List.iter (fun (i, v, c) -> color.(v) <- i, c, 0);
  for r = 1 to 10 do
    Array.sort (fun (a,b) (c,d) ->
      min (fst3 color.(a)) (fst3 color.(b)) - min (fst3 color.(c)) (fst3 color.(d))) es;
    Array.iter (fun (u, v) ->
      let iu, cu, ru = color.(u) in
      let iv, cv, rv = color.(v) in
      if iu > iv && ru < r then color.(v) <- (iu, cu, ru+1);
      if iv > iu && rv < r then color.(u) <- (iv, cv, rv+1);
    ) es;
    qa.(r) |> List.iter (fun (i, v, c) ->
      let ia, _, _ = color.(v) in
      if i > ia then color.(v) <- (i, c, r));
  done;

  Array.iter (fun (_, c, _) -> Printf.printf "%d\n" c) color

Measured memory_bytes: 28160
#include<iostream>
#include<vector>
#include<algorithm>
#include<map>
#include<queue>
#include<cmath>

using namespace std;


int main(){
    int T;
    cin >> T;
    if(T % 1000 == 0){
        cout << "0" << endl;
    }else{
        cout << 1000 - (T % 1000) << endl;
    }

    return 0;
}


Measured memory_bytes: 3680
#E
H,W,K = map(int,input().split())
S = [list(str(input())) for _ in range(H)]
inf = float("inf")

ans = inf
T = 2**(H-1)
for i in range(T):
    b = bin(i)
    b = b.lstrip("0b")
    blist = list(b)
    lb = len(b)
    clist = blist[::-1]
    while lb < H-1:
        clist.append("0")
        lb+=1
    
    r = clist.count("1")
    count = r
    nw = [0]*(r+1)
    for w in range(W):
        nind = 0
        for h in range(H):
            if h > 0:
                if clist[h-1] == "1":
                    nind+=1

            if S[h][w] == "1":
                nw[nind]+=1
        
        if w == 0:
            pass
        else:
            for k in nw:
                if k > K:
                    count+=1
                    nw = [0]*(r+1)
                    
                    nind = 0
                    for h in range(H):
                        if h > 0:
                            if clist[h-1] == "1":
                                nind+=1

                        if S[h][w] == "1":
                            nw[nind]+=1
                    
                    if max(nw) > K:
                        count = inf
                    
                    break
    
    ans = min(ans,count)
    
print(ans)
        
        
        
    






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

using namespace std;

int a, b, h;

void init()
{
	scanf("%d", &a);
	scanf("%d", &b);
	scanf("%d", &h);		
	if (h % 2 == 0)
		{
			int res = 0;
			int s = a + b;
			s = s * h;
			res = s / 2;
			printf("%d\n", res);
		}	
		else {
			printf("0\n");
		}
}

int main()
{

	//#ifndef ONLINE_JUDGE
		//freopen("input.txt","r",stdin);
		//freopen("output.txt","w",stdout);
	//#endif

	init();

	return 0;
}

Measured memory_bytes: 256
N,K=map(int,input().split())
s=input()
l=[]
index=0
pre='1'
for i in range(len(s)):
    if s[i]!=pre:
        l.append(i-index)
        pre=s[i]
        index=i
else:
    l.append(i-index+1 if i!=index else 1)
    if s[-1]=='0':
        l.append(0)
Max=sum(l[:min(2*K+1,len(l))])
cur=Max
for i in range(2*K+1,len(l)):
    cur=cur+l[i]-l[i-2*K-1]-l[i-2*K] if i%2 else cur+l[i]
    if cur > Max:
        Max=cur
print(Max)

Measured memory_bytes: 4476
#include <stdio.h>

int main(void)
{
  int a, b, c;
  int i;
  int cnt = 0;

  scanf("%d %d %d", &a, &b, &c);
  
  for ( i = a; i <= b; i++ ) {
    if ( c % i == 0 ) {
      cnt++;
    }
  }

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

Measured memory_bytes: 596
#include <bits/stdc++.h>
#define rep(i,n) for (int i=0; i<(n); ++i)
using namespace std;
using ll=long long;
int main(){
    int n;
    cin>>n;
    int cnt=0;
    rep(i,n){
        int a; cin>>a;
        if(a%2==1)cnt++;
    }
    if(cnt%2==1)cout<<"NO"<<endl;
    else cout<<"YES"<<endl;
}

Measured memory_bytes: 256
#include<iostream>
#include<cstdio>
#include<string>
#include<cstring>
#include<cstdlib>
#include<algorithm>
#include<cmath>
#include<vector>
#include<stack>
#include<queue>
using namespace std;
typedef long long int ll;

vector<int> a;

int main(void){
	for(int i = 0; i < 3; i++){
		int input;
		cin >> input;
		a.push_back(input);
	}
	sort(a.begin(), a.end());
	if(a[0] == 5 && a[1] == 5 && a[2] == 7) cout << "YES" << endl;
	else cout << "NO" << endl;
	return 0;
}


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

#define ll          long long
#define mp	    make_pair
#define pb          push_back
#define pii         pair<int,int>
#define vi          vector<int>
#define vii         vector<pii>
#define mi          map<int,int>
#define mii         map<pii,int>
#define all(a)      (a).begin(),(a).end()
#define x           first
#define y           second
#define sz(x)       (int)x.size()
#define endl        '\n'
#define hell        1000000007
#define lbnd        lower_bound
#define ubnd        upper_bound
#define bs          binary_search
#define gcd(a,b)    __gcd((a),(b))
#define lcm(a,b)    ((a)*(b)) / gcd((a),(b))
#define rep(i,a,b)  for(int i=a;i<b;i++)
using namespace std;
void solve(){
	int n;
	cin>>n;
	if(n==3 || n==5 || n== 7)
		cout << "YES"<<endl;
	else cout<<"NO" <<endl;
}
signed main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    int t;
    t =1;
    //cin>>t;
    while(t--){
        solve();
    }
    return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <limits.h>
#include <string>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <algorithm>

using namespace std;

int main()
{

	int k, x;


	cin >> k >> x;

	int start;
	int end;

	start = max(-1000000, x - k + 1);
	end = min(1000000, x + k - 1);

	cout << start;
	for (int i = start+1; i <= end; i++) {

		cout << " " << i;
	}

	cout << endl;





}



Measured memory_bytes: 256
# -*- coding: utf-8 -*-

import sys

def input(): return sys.stdin.readline().strip()
def list2d(a, b, c): return [[c] * b for i in range(a)]
def list3d(a, b, c, d): return [[[d] * c for j in range(b)] for i in range(a)]
def list4d(a, b, c, d, e): return [[[[e] * d for j in range(c)] for j in range(b)] for i in range(a)]
def ceil(x, y=1): return int(-(-x // y))
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(N=None): return list(MAP()) if N is None else [INT() for i in range(N)]
def Yes(): print('Yes')
def No(): print('No')
def YES(): print('YES')
def NO(): print('NO')
sys.setrecursionlimit(10 ** 9)
INF = 10 ** 18
MOD = 10 ** 9 + 7

N = INT()

# 例外処理
if N == 3:
    print(2, 5, 63)
    exit()

# ・全体のgcdが1になるように2と3を含める
# ・要素は全て2か3の倍数を使う
# ・全体の合計は6の倍数にする
# ・これでgcd(総和, 各要素)は常に2か3になる
A = [2, 4, 3, 9]

li1, li2, li3 = [], [], []
for a in range(5, 30001):
    # 9は既に使用済
    if a == 9:
        continue
    # 3の倍数で奇数(mod6で3)
    if a % 3 == 0 and a % 2 == 1:
        li1.append(a)
    # 3の倍数で偶数(mod6で0)
    elif a % 6 == 0:
        li2.append(a)
    # 3の倍数ではなくて偶数(mod6で2,4)
    elif a % 3 != 0 and a % 2 == 0:
        li3.append(a)

# リスト1,3はペアで使うとmod6で0にできる
while li1 and len(A) + 2 <= N:
    A.append(li1.pop())
    A.append(li1.pop())
while li3 and len(A) + 2 <= N:
    A.append(li3.pop())
    A.append(li3.pop())
# リスト2は元々mod6で0なので1つずつ使える
while li2 and len(A) + 1 <= N:
    A.append(li2.pop())
print(*A)


Measured memory_bytes: 4820
# coding: utf-8

N = int(input())
a = [int(x) for x in input().split()]
a.sort(reverse = True)

alice_point = 0
bob_point = 0
for index in range(N):
	if index % 2 == 0:
		alice_point += a[index]
	else:
		bob_point += a[index]

print(alice_point - bob_point)

Measured memory_bytes: 3060
#include <iostream>
#include <string>
#include <vector>

using namespace std;

int main(void) {
    string w;
    cin >> w;

    vector<int> cnt(26);
    for(int i=0; i<w.size(); i++) {
        cnt[w[i]-'a']++;
    }

    for(int i=0; i<26; i++) {
        if(cnt[i]%2) {
            cout << "No" << endl;
            return 0;
        }
    }
    cout << "Yes" << endl;
    return 0;
}


Measured memory_bytes: 256
import sys

readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
read = sys.stdin.buffer.read
sys.setrecursionlimit(10 ** 7)
INF = float('inf')

N = int(readline().rstrip())
pos = (0, 0)
used_time = 0
for _ in range(N):
    t, x, y = map(int, readline().split())
    cost = abs(pos[0] - x) + abs(pos[1] - y)
    available = t - used_time
    # print("cost: {}".format(cost))
    # print("available: {}".format(available))
    if cost > available or ((cost - available) % 2 != 0):
        print('No')
        quit()
    used_time = t
    pos = (x, y)
print('Yes')

Measured memory_bytes: 3064
#include <iostream>
#include <algorithm>
#include <vector>
#include <set>
#include <queue>
#include <map>
#include <string.h>
#include <math.h>
#include <stdio.h>
#include <deque>
#include <bits/stdc++.h>
//#include "D:\C++\test_lib_projects\testlib.h"
using namespace std;
#define ll long long
#define pii pair<int,int>

bool debug=true;
/*
   Write In New Computer
    By XiaoGeNintendo
	     gwq2017
	Type:
*/

int n;
int a[200005];
map<int,int> mp;
int dp[200005];
int main(int argc,char* argv[]){
	scanf("%d",&n);
	for(int i=0;i<n;i++){
		scanf("%d",&a[i]);
	}
	
	for(int i=0;i<n;i++){
		if(mp.count(a[i]-1)){
			dp[i]=dp[mp[a[i]-1]]+1;
			//cout<<i<<" pos "<<a[i]<<" inherit from "<<mp[a[i]-1]<<" which is "<<dp[mp[a[i]-1]]<<endl;
		}else{
			dp[i]=0;
		}
		mp[a[i]]=i;
	}
	
	int mx=0;
	for(int i=0;i<n;i++){
		mx=max(mx,dp[i]);
	}
	
	cout<<n-mx-1;
	return 0;
}


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

#define pb 		push_back
#define mp 		make_pair
#define prior   priority_queue
#define MOD 	1000000007
#define INF64 	(long long)1e18
#define INF 	(int)1e9
#define PI 		3.1415926535897932384626433832795 
#define ll      long long
#define ld		long double
#define ret     return
#define NUM 	1000001
const int SIZE = 2e5+4;
void fastio(){
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
}
void input(){
	#ifndef ONLINE_JUDGE
	freopen("input.txt","r",stdin);
	freopen("output.txt","w",stdout);
	#endif
}

void swap(int& a, int& b){
	int t=a;
	a = b;
	b = t;
}


void solveTest(){
	string s;
	cin>>s;
	set<char> st = {'A','C','G','T'};
	int mx = 0;
	int cnt=0;
	for(int i=0;i<s.length();i++){
		if(st.find(s[i])!=st.end()){
			cnt++;
		}
		else{
			mx = max(cnt,mx);
			cnt=0;
		}
		mx = max(cnt,mx);
	}
	cout<<mx<<endl;
	return ;
}

int main(){
	fastio();
	//input();

	int t=1;
	//cin>>t;
	while(t--){
		solveTest();

	}
	
	return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <sstream>
#include <fstream>
#include <string>
#include <vector>
#include <deque>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <algorithm>
#include <functional>
#include <utility>
#include <bitset>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <cstdio>

using namespace std;

#define REP(i, n) for (int i = 0; i < n; i++) 
#define REP2(i, n) for (int i = n - 1; i >= 0; i--)

int main() {
	ios::sync_with_stdio(false);
	cin.tie(0);
    string s;
    cin >> s;
    int l = s.length();
    int a, z;
    REP(i, l) {
        if (s[i] == 'A') {
            a = i;
            break;
        }
    }

    REP2(i, l) {
        if (s[i] == 'Z') {
            z = i;
            break;
        }
    }

    cout << z - a + 1 << endl;
}

Measured memory_bytes: 720
// atc.cpp : This file contains the 'main' function. Program execution begins and ends there.
//

#include <iostream>
#include <vector>
#include <string>
#include    <algorithm>
using namespace std;


int main()
{
    int d, n;
    cin >> d >> n;

    int o = 1;

    for (int i = 0; i < d; i++) {
        o = o * 100;
    }

    int o2 = o * n;
    if (n == 100) o2 = o2 + o;
    printf("%d\n", o2);


    return 0;

}


Measured memory_bytes: 256
require "pp"

n = gets.to_i
s = []
n.times {s.push(gets.chomp)}

puts s.map{|str| str.split("").sort.join}
.sort
.group_by{|item| item}
.map{|k,v| v.size}
.map{|n| n * (n-1) / 2}
.inject(:+)

Measured memory_bytes: 48232
#include <bits/stdc++.h>
#include <boost/range/adaptor/reversed.hpp>
#include <boost/range/algorithm/sort.hpp>
#include <boost/range/irange.hpp>

using namespace std;
using boost::irange;
using boost::sort;
using boost::adaptors::reversed;

int main() {
    long n;
    cin >> n;
    string s;
    while (n != 0) {
        if (n % 26 == 0) {
            s.push_back('z');
            n = n / 26 - 1;
        } else {
            s.push_back('a' + (n % 26) - 1);
            n = n / 26;
        }
    }
    string ans(s.rbegin(), s.rend());

    cout << ans << endl;
}


Measured memory_bytes: 3596
#include "bits/stdc++.h"
#include<vector>
#include<iostream>
#include<queue>
#include<algorithm>
#include<map>
#include<set>
#include<iomanip>
#include<assert.h>
#include<unordered_map>
#include<unordered_set>
#include<string>
#include<stack>
#include<complex>
#include<memory>

#pragma warning(disable:4996)
using namespace std;
using ld = long double;
template<class T>
using Table = vector<vector<T>>;
const ld eps=1e-9;
using ll = long long int;

using Graph=vector<vector<int>>;
	
#define WHATS(var)cout<<__LINE__<<' '<<#var<<"="<<var<<endl;
	
template<class S, class T> ostream& operator <<(ostream &os, const pair<S, T> v){
	os << "( " << v.first << ", " << v.second << ")"; return os;
}
template<class T> ostream& operator <<(ostream &os, const vector<T> &v){
	for(int i = 0; i < v.size(); i++){if(i > 0){os << " ";} os << v[i];} return os;
}
template<class T> ostream& operator <<(ostream &os, const vector<vector<T>> &v){
	for(int i = 0; i < v.size(); i++){if(i > 0){os << endl;} os << v[i];} return os;
}
template<class T> ostream& operator <<(ostream &os, const vector<set<T>> &v){
	for(int i = 0; i < v.size(); i++){if(i > 0){os << endl;} os << v[i];} return os;
}
template<class T> ostream& operator <<(ostream &os, const set<T> &v){
	int i=0;
	for(auto it:v){
		if(i > 0){os << ' ';}
		os << it;
		i++;
	} 
	return os;
}

#include<random>
const int mod=1e9+7;

vector<vector<ll>>memo(51,vector<ll>(51));
vector<vector<ll>>sums(51,vector<ll>(51));

void init(){
    for(int i=1;i<=50;++i){
        for(int j=1;j<=i;++j){
            ll answer=1;
            for(int k=0;k<j;++k){
                answer*=i-k;
                answer/=k+1;
            }
            memo[i][j]=answer;
        }
    }
    for(int i=0;i<=50;++i){
        for(int j=1;j<=50;++j){
            if(j!=1)sums[i][j]+=sums[i][j-1];
            sums[i][j]+=memo[i][j];
        }
    }
    //WHATS(sums)
}
vector<int> simulate(vector<int>v,int K){
    while(K--){
        auto nv(v);
        vector<int>pluss(v.size()+1);
        for(int i=0;i<v.size();++i){
            int l=max(0,i-v[i]);
            int r=min(int(v.size()),i+v[i]+1);
            pluss[l]++;
            pluss[r]--;
        }
        int sum=0;
        for(int i=0;i<v.size();++i){
            sum+=pluss[i];
            nv[i]=sum;
        }
        v=nv;
        //WHATS(v);
    }
    return v;
    
}
void solve(){
    ll A,V,B,W;cin>>A>>V>>B>>W;
    ll T;cin>>T;
    bool ok=true;
    if(V<=W){
        ok=false;
    }else{
        ll dis=abs(A-B);
        if(dis<=(V-W)*T){
            ok=true;
        }else{
            ok=false;
        }
    }
    if(ok)cout<<"YES"<<endl;
    else cout<<"NO"<<endl;
}
int main() {
	ios::sync_with_stdio(false);
	cin.tie();
    solve();
	return 0;
}

Measured memory_bytes: 3696
#include<iostream>
#include<algorithm>
#include<string>
#include<cstdlib>
#include<map>
#include<iomanip>
#include<sstream>
#include<vector>
#include<stack>
#include<math.h>
#include<queue>
#include<complex>
using namespace std;

long long int solve(long long int n){
	if(n==2){return 3;}
	else if(n==4||n==6||n==9||n==11){return 2;}
	else{return 1;}
}

int main() {
	long long int n=0,m,a,b,c,d,e;
	long double z,w;
	string str,str2,str3;
	char ch;
	long long int x[130]={};
	cout << fixed << setprecision(10);
	cin>>a>>b;
	if(solve(a)!=solve(b)){cout<<"No";}
	else{
		cout<<"Yes";
	}
	




	cout<<endl;
} 


Measured memory_bytes: 256
S = input()

if S == "SUN" :
    S = 7
elif S == "MON" :
    S = 6
elif S == "TUE" :
    S = 5
elif S == "WED" :
    S = 4
elif S == "THU" :
    S = 3
elif S == "FRI" :
    S = 2
else :
    S = 1

print(S)

Measured memory_bytes: 2940
import java.util.HashSet;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);
		HashSet<Integer> h = new HashSet<Integer>();
		int n = sc.nextInt();
		for(int i = 0; i < n; i++) {
			h.add(sc.nextInt());
		}
		System.out.println(h.size());
		sc.close();
	}
}

Measured memory_bytes: 23508
#include <bits/stdc++.h>
using namespace std;
#define all(x) (x).begin(),(x).end()
using ll = long long;
#define vl vector<long long>
#define vvl vector<vector<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++)
using pll = pair<long long,long long>;
#define cY cout<<"Yes"<<endl
#define cN cout<<"No"<<endl
const long long INF = 1LL << 60;
const long long MOD = 1000000007;

//最大最小の入れ替え
template<class T> inline bool chmin(T& a, T b) {
    if (a > b) {
        a = b;
        return true;
    }
    return false;
}
template<class T> inline bool chmax(T& a, T b) {
    if (a < b) {
        a = b;
        return true;
    }
    return false;
}

//約数列挙
vector<long long> divisor(long long n) {
    vector<long long> ret;
    for (long long i = 1; i * i <= n; i++) {
        if (n % i == 0) {
            ret.push_back(i);
            if (i * i != n) ret.push_back(n / i);
        }
    }
    sort(ret.begin(), ret.end()); // 昇順に並べる
    return ret;
}
//以上テンプレ
ll nCr(ll n, ll r) {
    ll ans = 1;
    for (int i = n; i > n - r; --i) {
        ans = ans*i;
    }
    for (int i = 1 ; i < r + 1; ++i) {
        ans = ans / i;
    }
    return ans;
}


int main(){
    ll N;
    cin>>N;
    ll count=0;
    if(N==100000){
        cout<<90909<<endl;
    }
    else if(N>=1000){
        count+=909;
        if(N>9999) count+=N-9999;
        cout<<count<<endl;
    }else if(N>=10){
        count+=9;
        if(N>99) count+=N-99;
        cout<<count<<endl;
    }else{
        cout<<N<<endl;
    }
    }


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

int main(){
	int i,j,k,n,m,l,f,x,y,z; string s;
	cin >> n >> k;
	j = 1;
	rep(i, n){
		if(j <= k){
			j *= 2;
		}else{
			j += k;
		}
	}
	cout << j << endl;
}	

Measured memory_bytes: 256
n = int(input())
if n < 112:
  print(111)
elif n < 223:
  print(222)
elif n < 334:
  print(333)
elif n < 445:
  print(444)
elif n < 556:
  print(555)
elif n < 667:
  print(666)
elif n < 778:
  print(777)
elif n < 889:
  print(888)
else:
  print(999)

Measured memory_bytes: 3060
import java.util.*;
import java.io.*;

public class Main{
	void solve(){

		Scanner cin = new Scanner(System.in);
		while(true)
		{
			int n = cin.nextInt();
			if(n==0) return;
			int[] time = new int[n*2];
			for(int i=0;i<2*n;i++){
				time[i] = gettime(cin.next()) + (i+1) % 2;
			}
			Arrays.sort(time);
			int ret = 0;
			int now = 0;
			for(int a : time){
				if(a%2==1) now++;
				else now--;
				ret= Math.max(ret, now);
			}
			System.out.println(ret);
		}
	}

	int gettime(String s){
		int ret = 0;
		ret += s.charAt(0) - '0';
		ret *= 10;
		ret += s.charAt(1) - '0';
		ret *= 10;
		ret += s.charAt(3) - '0';
		ret *= 10;
		ret += s.charAt(4) - '0';
		ret *= 10;
		ret += s.charAt(6) - '0';
		ret *= 10;
		ret += s.charAt(7) - '0';
		ret *= 10;
		return ret;
	}

	public static void main(String[] args){
		new Main().solve();
	}
}

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

int main(){
    double r;
    cin >> r;
    cout << setprecision(20) << 2 * acos(-1) * r << endl;
    return 0;
}

Measured memory_bytes: 3788
#include <iostream>
#include<iomanip>
#include <set>
#include <vector>
#include <map>
#include <string>
#include <cstring>
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <queue>
#include <stack>
using namespace std;

const int NN=1e5+10;

int n;
int a[NN];
int b[NN];
int ans[NN];



int main()
{
    long long x,y;
    scanf("%lld%lld",&x,&y);
    if(abs(x-y)>=2){
        printf("Alice\n");
    }
    else{
        printf("Brown\n");
    }
}





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

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

#ifdef LOCAL
#define show(x) cerr << __LINE__ << " : " << #x << " = " << (x) << endl
#else
#define show(x) true
#endif

using namespace std;
using ll = long long;
template<class T>
using V = vector<T>;

template<class T, class U>
void chmin(T &t, const U u) { if (t > u) t = u; }

template<class T, class U>
void chmax(T &t, const U u) { if (t < u) t = u; }

const int INF = (1 << 30) - 1;
const ll INFL = (ll) 5e15;
const int MOD = 1e9 + 7;

class score {
public:
    int solves;
    int time;
    int team;

    bool operator<(score s) const {
        if (solves < s.solves) return true;
        else if (solves == s.solves) {
            if (time > s.time) return true;
            else if (time == s.time) {
                if (team < s.team) return true;
            }
        }

        return false;
    }
};

class Solver {
public:
    bool solve() {
        cin >> M >> T >> P >> R;
        if (M == 0) return false;
        scores.resize(T);
        REP(i, T) {
            scores[i].team = i + 1;
        }
        penalty.resize(T + 1, V<int>(P + 1));
        REP(i, R) {
            int m, t, p, j;
            cin >> m >> t >> p >> j;
            if (j == 0) {
                scores[t - 1].solves++;
                scores[t - 1].time += m + penalty[t][p] * 20;
            } else {
                penalty[t][p]++;
            }
        }
        sort(scores.rbegin(), scores.rend());

        REP(i, T - 1) {
            cout << scores[i].team;
            if (scores[i].solves == scores[i + 1].solves && scores[i].time == scores[i + 1].time) {
                cout << "=";
            } else {
                cout << ",";
            }
        }
        cout << scores[T - 1].team << endl;

        return true;
    }

private:
    int M, T, P, R;

    V<score> scores;// ans, time, team
    V<V<int>> penalty;
};

int main() {

    while (Solver().solve());

    return 0;
}



Measured memory_bytes: 3076
from collections import Counter

if __name__ == '__main__':

    n = int(input())
    A = list(map(int,input().split()))

    #全体の数
    d = Counter(A)
    
    d2 = dict()
    #この時の組み合わせの合計
    for k,v in d.items():
        d2[k] = (v*(v-1)) // 2
    ans_sum = sum(d2.values())

    #結果表示
    for i in A:
        ans = 0
        if i in d2:
            #あるならば
            tmp = d[i] - 1
            before= d2[i]
            after = (tmp*(tmp-1)) //2
            ans = ans_sum - (before-after)
            print(ans)
        else:
            #ないならば
            print(ans_sum)


Measured memory_bytes: 34236
x, y = map(int, input().split())
li = list(map(int, input().split()))

if y == 0:
    print(x)
    quit()

ans=[]
for i in range(-101,201):
    if not i in li:
        ans.append(abs(i - x))

if not x - min(ans) in li:
    print(x-min(ans))
elif not min(ans) + x in li:
    print(min(ans) + x)

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

int main(){
    int N,ans;
    int Alice = 0;
    int Bob = 0;
    cin >> N;
    int a[110];
    for (int i=1; i<=N; i++){
        cin >> a[i];
    }
    sort(a+1, a+N+1, greater<int>());
    for (int i=1; i<=N; i++){
        if (i % 2 == 1) {
            Alice += a[i];
        }
        else {
            Bob += a[i];
        }
    }
    ans = Alice - Bob;
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#define ll long long int
#define trace(x) cerr<<#x<<" : "<<x<<endl;
#define jaldi ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
using namespace std;

int main()
{
    jaldi
    ll h,a;
    cin>>h>>a;
    ll ans = ceil((double)h/a);
    cout<<ans;
    return 0;
}

Measured memory_bytes: 256
#define _USE_MATH_DEFINES
#include <algorithm>
#include <cstdio>
#include <functional>
#include <iostream>
#include <cfloat>
#include <climits>
#include <cstring>
#include <cmath>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <time.h>
#include <vector>
using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> i_i;
typedef pair<ll, int> ll_i;
typedef pair<double, int> d_i;
typedef pair<ll, ll> ll_ll;
typedef pair<double, double> d_d;
struct edge { int u, v; ll w; };

ll MOD = 1000000007;
ll _MOD = 1000000009;
double EPS = 1e-10;

int main() {
	int N; cin >> N;
	set<string> s;
	while (N--) {
		string U; cin >> U;
		s.insert(U);
	}
	int M; cin >> M;
	bool locked = true;
	while (M--) {
		string T; cin >> T;
		if (s.count(T)) {
			locked = !locked;
			cout << (locked ? "Closed by " : "Opened by ");
		}
		else cout << "Unknown ";
		cout << T << endl;
	}
}

Measured memory_bytes: 1232
#include<bits/stdc++.h>
#define ll long long 
using namespace std;
int main()
{
  int count=0;
ll n,d;
cin>>n>>d;
  while(n--)
  {
  ll x,y;
    cin>>x>>y;
    if(x<0)x=-x;
    if(y<0)y=-y;
   double dd=sqrt(x*x+y*y);
    // cout<<dd<<endl;
    if(dd<=d)count++;
  }
  cout<<count;
}

Measured memory_bytes: 3676
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#define rep(i, n)   for(int i = 0; i < (n); i++)
using namespace std;

int main(){
    int n,l;    cin >> n >> l;
    vector<string>s(n);
    rep(i, n)   cin >> s[i];
    sort(s.begin(), s.end());
    string ans;
    rep(i, n){
        ans += s[i];
    }
    cout << ans << endl;
}


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

int main() {
	int X, Y, x, y, r;
	cin >> X >> Y >> x >> y >> r;

	if (x + r <= X && x - r >= 0 && y + r <= Y && y - r >= 0) {
		cout << "Yes" << endl;
	}
	else {
		cout << "No" << endl;
	}
}

Measured memory_bytes: 1156
#include <iostream>
#include <string>
#define int long long
using namespace std;

signed main(){
	int m,n;
	string name[] = {"","Man","Oku","Cho","Kei","Gai","Jo","Jou","Ko","Kan","Sei","Sai","Gok","Ggs","Asg","Nyt","Fks","Mts"};
	while(cin >> m >> n,m){
		int num[19] = {};
		num[0] = 1;
		for(int i = 0;i < n;i++){
			int next[19] = {};
			for(int j = 0;j < 18;j++){
				next[j] += num[j] * m;
				next[j + 1] = next[j] / 10000;
				next[j] %= 10000;
				num[j] = next[j];
			}
		}
		for(int i = 17;i >= 0;i--) if(num[i]) cout << num[i] << name[i];
		cout << endl;
	}
	return 0;
}

Measured memory_bytes: 3168
n,x=map(int,input().split())
hoge=list(map(int,input().split()))
ans=0
for i in range(n-1):
  if(hoge[i]>=x):
    ans+=hoge[i]-x
    hoge[i]=x
  if(hoge[i+1]>=x):
    ans+=hoge[i+1]-x
    hoge[i+1]=x
  if(hoge[i]+hoge[i+1]>=x):
    ans+=hoge[i+1]-(x-hoge[i])
    hoge[i+1]=x-hoge[i]
print(ans)

Measured memory_bytes: 14252
/* ****devACE**** */

#include<bits/stdc++.h>
#define ll          long long
#define pb          push_back
#define    endl        '\n'
#define pii         pair<ll int,ll int>
#define vi          vector<ll int>
#define all(a)      (a).begin(),(a).end()
#define F           first
#define S           second
#define sz(x)       (ll int)x.size()
#define hell        1000000007
#define rep(i,a,b)    for(ll int i=a;i<b;i++)
#define lbnd        lower_bound
#define ubnd        upper_bound
#define bs          binary_search
#define mp          make_pair
using namespace std;

#define N  100005

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    int TESTS=1;
//    cin>>TESTS;
    while(TESTS--)
    {
        int n;
        cin>>n;
        cout<<n*n*n;
    }
    return 0;
}

Measured memory_bytes: 256
s = [5,7,5,7,7]


def solve(n):
    num = [len(input()) for _ in range(n)]

    for i in range(n):
         c = 0
         k = 0
         for j in range(i,n):
             c+= num[j]
             if c==s[k]:
                 k+=1
                 c = 0
                 if k == 5:
                     print(i+1)
                     return
             if c > s[k]:
                 break


while 1:
    n = int(input())
    if n == 0:
        break
    solve(n)


Measured memory_bytes: 5612
K, S = map(int, input().split())

l = max(S-K*2, 0)
h = min(K, S)

res = 0
for i in range(l, h+1):
    x = S-i
    ll = max(x-K, 0)
    hh = min(h, x)
    res += hh-ll+1

print(res)

Measured memory_bytes: 9080
#include <bits/stdc++.h>
#define rep(i,N) for (int i = 0; i < (N); ++i)
#define all(v) v.begin(), v.end()
using namespace std;
using ll = long long;
using P = pair<int, int>;
const int inf{int(1e9)};
int main(void){
  int A, B;
  cin >> A >> B;
  for (int i = 1; i < 2000; i++){
    int x = int(i * 0.08);
    int y = int(i * 0.1);
    if (x == A && y == B){
      cout << i << endl;
      return 0;
    }
  }
  cout << -1 << endl;
  return 0;
}


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

int main() {
	vector <int> x(5);
	
	for (int i = 0; i < 5; i++) {
		cin >> x.at(i);
		if (x.at(i) != i + 1) {
			cout << i + 1 << endl;
		}
	}
	
}

Measured memory_bytes: 3584
import Control.Applicative
import Control.Monad
import Data.ByteString.Char8 (ByteString)
import qualified Data.ByteString.Char8 as B
import Data.List
import Data.Char (isSpace)
import Data.Vector (Vector, (!), (//))
import qualified Data.Vector as V
import Data.Vector.Mutable (IOVector, STVector)
import qualified Data.Vector.Mutable as VM

main :: IO ()
main = do
  [n, k] <- g
  v <- f
  solve n k v
  where
    f = readiv B.readInt <$> B.getLine
    g = map read <$> words <$> getLine

solve :: Int -> Int -> Vector Int -> IO ()
solve n k v = do
  mv <- V.thaw v
  forM_ [k .. n-1] $ \i -> do
    x <- VM.read mv (i - k)
    y <- VM.read mv i
    putStrLn $ if x < y then "Yes" else "No"

readiv :: Integral a =>  (ByteString -> Maybe (a, ByteString)) -> ByteString -> Vector a
readiv f = V.unfoldr $ \s -> do
  (n, s') <- f s
  return (n, B.dropWhile isSpace s')


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

int main() {
    vector<int> a(3);
    cin >> a[0] >> a[1] >> a[2];
    sort (a.begin(), a.end());
    int ans = a[2] - a[1] + a[2] - a[0];
    if (ans & 1) cout << (ans+3)/2 << endl;
    else cout << ans/2 << endl;
}

Measured memory_bytes: 3560
#include <vector>
#include <iostream>
#include <cmath>
#include <iomanip>
#include <string>
#include <utility>
#include <stack>
#include <numeric>
#include <random>
#include <algorithm>
#include <queue>
#include <functional>
#include <iterator>
#include <list>
#include <unordered_map>
using namespace std;

#define rep(i, b, e) for(i = b; i < e; ++i)
#define repr(i, b, e) for (i = b; i >= e; --i)
#define ull unsigned long long int
#define ll long long int
#define pint pair<int, int>

#define M_DEBUG 1
#define PI 3.141592653589793

#define E '\n'

#define print(x) cout << (x) << endl;
#define printa(x,n) for(int i = 0; i < n; i++){ cout << (x[i]) << "\n";}
#define INF (1e18)

const ll MAX = 1000000000;
const ll MOD = 1e9 + 7;

ull a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z;

ll aabs(ll a) {
    if (a < 0) return -a;
    return a;
}

//fast power
ll calc(ll a, ll b) {
    if (b == 0) return 1;
    else if (b % 2 == 0) {
        ll d = calc(a, b / 2);
        return (d * d) % MOD;
    }
    else return (a * calc(a, b - 1)) % MOD;
}

//fast combination
ll comb(ll n, ll a) {
    ll b = 1, c = 1;
    for (ll i = 1; i <= a; ++i) {
        b = b * i % MOD;
        c = c * (n - i + 1) % MOD;
    }

    return c * calc(b, MOD - 2) % MOD;
}

int main(void) {
    cin >> a >> b;

    double eight = 0.08f, ten = 0.1f;

    ll ea = (a / eight), tb = (b / ten);

    ll lim = (ea > tb) ? ea : tb;
    ll llim = ea;
    if (lim == ea)
        llim = tb;

    for (i = tb; i < tb + 10; ++i) {
        double cc = (i * eight), dd = (i * ten);
        float intea = 0;
        float fraca = modf(cc, &intea);
        float inteb = 0;
        float fracb = modf(dd, &inteb);

        //cout << cc << ' ' << dd << endl;
        //cout << intea << ' ' << inteb << endl;
        
        if (intea >= a && inteb >= b && intea < a + 1 && inteb < b + 1) {
            cout << i << endl;
            return 0;
        }
    }

    cout << -1 << endl;
    return 0;
}



Measured memory_bytes: 256
#include"iostream"
#include<stdlib.h>
#include<stdio.h>
#include<time.h>
#include<list>
#include<map>
#include<algorithm>
#include<string>
#include <queue> 
#include <sstream>
#include <fstream>
#include<cmath>
#include"bits/stdc++.h"
#define LL long long
using namespace std;
#define INF 1000000000





LL A,B,C,D,E,F,N,M,xx[100000],W;
LL a,c;
vector<LL>x,y;
double ans;
string s;
int main() {
  
	cin>>A>>B>>C>>D>>E>>F;

	for(int i=0;i*A*100<=F;i++){
		for(int j=0;i*A*100+j*B*100<=F;j++){
			x.push_back(100*(A*i+B*j));

		}
	}

	for(int i=0;i*C<=F;i++){
		for(int j=0;i*C+j*D<=F;j++){

			y.push_back(C*i+D*j);

		}
	}
	double maxRate = 0.0;
	LL maxWater = 0, maxSuger = 0;

	for(int i=0;i<x.size();i++){
		for(int j=0;j<y.size();j++){
				if(maxRate < (double)(100 * y[j]) / (double)(x[i] + y[j]) && x[i] + y[j] <= F && y[j] <= E * x[i] / 100){
				maxRate = (double)(100 * y[j]) / (double)(x[i] + y[j]);
				maxWater = x[i];
				maxSuger = y[j];

				
			}
		}
	}

	if(maxSuger == 0){
		cout << 100 * A << " " << maxSuger << endl;
	}
	else cout << maxWater + maxSuger << " " << maxSuger << endl;

	return 0;
}

Measured memory_bytes: 2420
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);
		int x = sc.nextInt();
		int a = sc.nextInt();
		//int r = sc.nextInt();

		if (x < a) {
			System.out.print("0");
		} else {
			System.out.print("10");
		}
	}
}

Measured memory_bytes: 21844
n = int(input())
a = list(map(int, input().split()))

a.sort()
a.reverse()
t = n - 1
ans = 0
for i in range(n):
    lim = 2
    if i == 0:
        lim = 1
    for j in range(lim):
        if t > 0:
            ans += a[i]
            t -= 1
print(ans)

Measured memory_bytes: 31440
using System;

public class SmallOrLarge
{
    //?????????????????§?°????????????????
    static void Main(string[] args)
    {
        /*---??£?¨???¨---*/
        int num1;
        int num2;
        string[] num_unit;
        /*---??£?¨???¨---*/

        /*??°???????????????????????§??????*/
        num_unit = Console.ReadLine().Split(' ');
        num1 = int.Parse(num_unit[0]);
        num2 = int.Parse(num_unit[1]);

        /*????????????????????????????????????????????§??¶????????????*/
        if (num1 > num2)
        {
            Console.WriteLine("a > b");
        }
        else if (num1 < num2)
        {
            Console.WriteLine("a < b");
        }
        else
        {
            Console.WriteLine("a == b");
        }
    }
}

Measured memory_bytes: 8864
#include<stdio.h>
int main(void){
   int a,b,amari,motoa,motob,k,ire;
   while(scanf("%d",&a)!=EOF){
   scanf("%d",&b);
      if(a>b)
      ire=a,a=b,b=ire;
   motoa=a,motob=b;
      for(amari=1,k=0;amari!=0;k++){
         if(k!=0)
         a=b,b=amari;
      amari=a%b;
      }
      if(amari==0){
      printf("%d %d\n",b,motoa/b*motob);
      }
   }
   return 0;
   }

Measured memory_bytes: 596
#!python3

import sys
iim = lambda: map(int, sys.stdin.readline().rstrip().split())
from operator import sub

def resolve():
    it = map(int, sys.stdin.read().split())
    N = next(it)

    M = 10**9+1
    data = [[M, -M], [M, -M]]
    for x, y in zip(it, it):
        for i, x in enumerate([x+y, x-y]):
            for j, f in enumerate([min, max]):
                data[i][j] = f(data[i][j], x)

    print(max(map(lambda x: abs(sub(*x)), data)))



if __name__ == "__main__":
    resolve()


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

ll merge(ll a, ll b) {
  if(a + b <= 9) return a + b;
  else return (a + b)/10 + ((a + b) % 10);
}

ll dfs(vector<P> v) {
  if(v.size() == 1 && v[0].second == 1) return 0;
  ll res = 0;
  vector<P> u;
  int p = 0;
  while(p < v.size()) {
    if(v[p].second > 1) {
      u.push_back(P(merge(v[p].first,v[p].first),v[p].second/2));
      if(v[p].first >= 5) res += (v[p].second/2) *2;
      else res += v[p].second/2;
      if(v[p].second % 2) u.push_back(P(v[p].first,1));
      p++;
    } else if(p+1 < v.size() && v[p+1].second == 1) {
      u.push_back(P(merge(v[p].first,v[p+1].first),1));
      if(v[p].first + v[p+1].first <= 9) res += 1;
      else res += 2;
      p += 2;
    } else {
      u.push_back(v[p]);
      p++;
    }
  }
  return res + dfs(u);
}

int main(){
  int m;
  cin >> m;
  vector<P> v(m);
  rep(i,m) cin >> v[i].first >> v[i].second;
  cout << dfs(v) << endl;
  return 0;
}

Measured memory_bytes: 498920
import java.util.Scanner;

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

        int K = sc.nextInt();
        int S = sc.nextInt();

        sc.close();

        
        int ans = 0;
        
        for(int X = 0; X <= K; X++) {
            for (int Y = 0; Y <= K; Y++) {
                int Z = 0;
                Z = S - X - Y;
                if(Z >= 0 && Z <= K) {
                    ans++;
                }
                
            }
        } 
        System.out.println(ans);
    }
}

Measured memory_bytes: 23252
#include <iostream>
#include <cstdio>
#include <cmath>
#include <string>
#include <cstring>
#include <algorithm>
#include <iomanip>
#include <cstdlib>
#include <cctype>
#define ll long long
#define PI 3.14159265358979323846
using namespace std;
const int maxn = 1e6+7;

int main(){
	int a,b;
	cin>>a>>b;
	ll sum0=a+b,sum1=a-b,sum2=a*b;
	ll res=sum0;
	if(sum0>res){
		res=sum0;
	}
	if(sum1>res){
		res=sum1;
	}
	if(sum2>res){
		res=sum2;
	}
	cout<<res<<endl;
	return 0;
}


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

using namespace std;
#ifdef _DEBUG
#define _GLIBCXX_DEBUG
#include "dump.hpp"
#else
#define dump(...)
#endif

#define int long long
#define ll long long
#define DBG 1
#define rep(i, a, b) for (int i = (a); i < (b); i++)
#define rrep(i, a, b) for (int i = (b)-1; i >= (a); i--)
#define loop(n) rep(loop, (0), (n))
#define all(c) begin(c), end(c)
const int INF = sizeof(int) == sizeof(long long) ? 0x3f3f3f3f3f3f3f3fLL : 0x3f3f3f3f;
const int MOD = (int)(1e9) + 7;
#define fi first
#define se second
#define pb push_back
#define eb emplace_back
using pii = pair<int, int>;
// template<class T> ostream &operator<<(ostream &os,T &t){dump(t);return os;}
template <typename T, typename S>istream &operator>>(istream &is, pair<T, S> &p) { is >> p.first >> p.second; return is; }
template <typename T, typename S>ostream &operator<<(ostream &os, pair<T, S> &p) { os << p.first << " " << p.second; return os; }

template <typename T> void printvv(const vector<vector<T>> &v) {
	cerr << endl;
	rep(i, 0, v.size()) rep(j, 0, v[i].size()) {
		if (typeid(v[i][j]).name() == typeid(INF).name() and v[i][j] == INF) {
			cerr << "INF";
		}
		else
			cerr << v[i][j];
		cerr << (j == v[i].size() - 1 ? '\n' : ' ');
	}
	cerr << endl;
}

#ifndef _DEBUG
#define printvv(...)
#endif
void YES(bool f) { cout << (f ? "YES" : "NO") << endl; }
void Yes(bool f) { cout << (f ? "Yes" : "No") << endl; }
template <class T> bool chmax(T &a, const T &b) { if (a < b) { a = b; return true; }return false; }
template <class T> bool chmin(T &a, const T &b) { if (a > b) { a = b; return true; }return false; }

signed main(signed argc, char *argv[]) {
	cin.tie(0);
	ios::sync_with_stdio(false);
	cout << fixed << setprecision(12);

	int H, W; cin >> H >> W;
	int N; cin >> N;
	int sr, sc; cin >> sr >> sc;
	sr--, sc--;
	string S; cin >> S;
	string T; cin >> T;
	auto inrange = [&](int x, int y) { return 0 <= x and x < H and 0 <= y and y < W; };
	bool ans = true;
	int dx[] = { 1, 0, -1, 0 }, dy[] = { 0, 1, 0, -1 };
	char dir[] = { 'D','R','U','L' };
	char rid[] = { 'U','L','D','R' };
	rep(k, 0, 4) {
		int x = sr, y = sc;
		rep(i, 0, N) {
			if (S[i] == dir[k]) {
				x += dx[k];
				y += dy[k];
				if (not inrange(x, y)) {
					ans = false;
				}
			}
			if (T[i] == rid[k]) {
				int xx = x - dx[k];
				int yy = y - dy[k];
				if (inrange(xx, yy)) {
					x = xx;
					y = yy;
				}
			}
		}
	}
	YES(ans);

	return 0;
}


Measured memory_bytes: 920