akhauriyash/Code-Regression huggingface dataset:
#pragma GCC optimize ("O3")
#include <bits/stdc++.h>
#define endl "\n"
#define sz(x) ((ll)(x).size())
#define pb push_back
#define all(x) (x).begin(),(x).end()
#define prt(x) cout << (x)
#define prtl(x) cout << (x) << endl
#define rep(i,a,b) for(ll i=a; i<b; i++)
#define rrep(i,a,b) for(ll i=a; i>b; i--)
#define mp(a, b) make_pair(a, b)
#define chmin(x, y) x = min(x, y)
#define chmax(x, y) x = max(x, y)
#define debug(v) cout << #v<< ": " << v <<endl;
#define fst first
#define snd second
using namespace std;
using vi = vector<int>;
using vll = vector<long long int>;
using vb = vector<bool>;
using vvb = vector<vector<bool>>;
using vc = vector<char>;
using vvi = vector<vector<int>>;
using vvll = vector<vector<long long int>>;
using vvc = vector<vector<char>>;
using ll = long long int;
using P = pair<long long int, long long int>;
using Map = map<long long int, long long int>;
ll INF = 1LL<<60;
ll M = 1000000007;

int main(){
    ll x; cin >> x;
    ll y = x/200;
    prtl(10-y);
}


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

#define rep(i,n) for(int (i)=0;(i)<(int)(n);(i)++)
#define rept(i,n) for(int (i)=0;(i)<=(int)(n);(i)++)
#define reps(i,s,n) for(int (i)=(s);(i)<(int)(n);(i)++)
#define repst(i,s,n) for(int (i)=(s);(i)<=(int)(n);(i)++)
#define repr(i,n) for(int (i)=(n);(i)>=0;(i)--)
#define each(itr,v) for(auto (itr):(v))
#define all(c) (c).begin(),(c).end()
#define pb push_back
#define mp(x,y) make_pair((x),(y))
#define fi first
#define se second
#define chmin(x,y) x=min(x,y)
#define chmax(x,y) x=max(x,y)
#define ln "\n"
#define show(x) cout << #x << " = " << x ln
#define dbg(x) cout<<#x"="<<x ln

typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<vector<int> > mat;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;

const int inf = (int)1e9;
const ll linf = (ll)1e18;
const int mod = (int)(1e9+7);
const int dx[] = {0, 1, 0, -1};
const int dy[] = {1, 0, -1, 0};
const int ddx[] = {0, 1, 1, 1, 0, -1, -1, -1};
const int ddy[] = {1, 1, 0, -1, -1, -1, 0, 1};

struct oreno_initializer {
	oreno_initializer() {
		cin.tie(0);
		ios::sync_with_stdio(0);
	}
} oreno_initializer;

// ━━━━☆・‥…━━━☆・‥…━━━☆・‥…━━━☆・‥…━━━☆・‥…━━━☆・‥…━━━☆・‥…━━━☆・‥…━━━☆・‥…
// .｡.:( ^ω^)・ﾟ＋.｡.:( ^ω^)・ﾟ＋.｡.:( ^ω^)・ﾟ＋.｡.:( ^ω^)・ﾟ＋.｡.:( ^ω^)・ﾟ＋
// ・‥…━━━☆・‥…━━━☆・‥…━━━☆・‥…━━━☆・‥…━━━☆・‥…━━━☆・‥…━━━☆・‥…━━━☆・‥…━━━☆・

char a, b;

int main() {
	cin >> a >> b;
	
	if (a=='H') cout << b << ln;
	else {
		if (b=='H') cout << 'D' << ln;
		else cout << 'H' << ln;
	}
}

Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <functional>
#include <vector>
#include <cstdio>
#include <string>
#include <cmath>
#include <cfloat>
#include <map>
#include <queue>
#include <stack>
using namespace std;
int main(){

	int t;
	int n;
	while(cin>>t,t!=0){
		cin>>n;
		int s,f;
		int x=0;
		for(int i=0;i<n;i++){
			cin>>s>>f;
			x+=f-s;
		}
		if(x>=t)
			cout<<"OK"<<endl;
		else
			cout<<t-x<<endl;
	}
	
	
}

Measured memory_bytes: 1160
h,w = map(int, raw_input().split(" "))
c = []
for i in range(10):
    c.append(map(int, raw_input().split(" ")))

'''
def change(number):
    if number == -1:
        return 10
'''


a = []
for i in range(h):
    a.append(map(int, raw_input().split(" ")))

route = range(10)

def minroute(nowplace,d,passway,k):
    passp = passway[:]
    passp.append(nowplace)
    d1 = d + c[nowplace][1]
    for i in range(10):
        if (i in passp) or (c[nowplace][1] <= c[nowplace][i]): continue
        else:
            dk = minroute(i,d+c[nowplace][i],passp,k)
            if d1 > dk:
                d1 = dk
    return d1


for i in range(10):
    if i == 1:
        route[1] = 0
        continue
    route[i] = minroute(i,0,[1],i)

mp = 0
for l in a:
    for i in l:
        if i == -1:
            mp += 0
        else:
            mp += route[i]

print mp


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

int main(){

  char memo[27];
  char S[27];
  scanf("%s", S);
  strcpy(memo, S);


  for(int i=0;i<strlen(S);i++){
    for(int j=i+1;j<strlen(memo);j++){
//      printf("%d-%d\n", i, j);
      if(S[i] == memo[j] && i!=j ){
        printf("no\n");
        return 0;
      }
    }
  }

  printf("yes\n");
  return 0;

}

Measured memory_bytes: 128
#include <iostream>
#include <algorithm>
#include <iterator>
#include <numeric>
#include <vector>

using namespace std;

int main() {
  int64_t N, K;
  cin >> N >> K;
  vector<int64_t> H(N);
  copy_n(istream_iterator<int64_t>(cin), N, H.begin());
  int64_t result = 0LL;
  if (K < N) {
    nth_element(H.begin(), H.begin() + (N - K), H.end());
    result = accumulate(H.begin(), next(H.begin(), (N - K)), 0LL);
  }
  cout << result << endl;
  return 0;
}


Measured memory_bytes: 1792
#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cstring>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <unordered_map>
#include <ctime>
#include <list>
#include <numeric>
#include <utility>
#include <ctime>
#define INF 1000000000
#define LINF 9000000000000000000
#define mod 1000000007
 
#define rep(i,n) for(int i=0;i<int(n);i++)
#define rrep(i,n) for(int i=n-1;i>=0;i--)
#define REP(i,a,b) for(int i=(a);i<int(b);i++)
#define all(x) (x).begin(),x.end()
#define pb push_back
#define mp make_pair
#define MOD(x) (x%(mod))
 
using namespace std;
 
typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef pair<int,int> pi;

int dx[4]={1,0,-1,0};
int dy[4]={0,1,0,-1};
bool debug=false;
 
/*---------------------------------------------------*/

int str_to_int(string s){
    int ret = 0;
    rep(i, s.size()){
        if(i == 0){
            ret += s[0] - '0';
        }else{
            ret *= 10;
            ret += s[i] - '0';
        }
    }
    return ret;
}

int main(){
    string s, ss;
    cin >> s >> ss;
    int a = str_to_int(s + ss);
    int b = str_to_int(ss + s);
    bool ok = false;
    for(int i = 1; i * i < 100105; i++){
        if(a == i * i || b == i * i)ok = true;
    }
    if(ok)cout << "Yes" << endl;
    else cout << "No" << endl;
    return 0;
}


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

int main()
{
  int n;
  scanf("%d",&n);
  long long sum = 0;
  for(int i = 1; i <= n; i++){
  	if(i % 3 != 0 && i % 5 != 0)
      sum += i;
  } 
  printf("%lld\n",sum);
}


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

#define ll long long
#define ar array

int main(){
	ios::sync_with_stdio(0);
	cin.tie(0);
	string s;
	cin >> s;
	sort(s.begin() , s.end());
	if (s[0] == s[2])
		cout << "No";
	else
		cout << "Yes";
	return 0;
	
	
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
const int N = 505;
int n, X[N], C[N], A[N * N];
int main()
{
    scanf("%d", &n);
    for (int i = 1; i <= n; i++)
    {
        scanf("%d", &X[i]);
        if (A[X[i]])
            return !printf("No\n");
        A[X[i]] = i;
    }
    for (int i = 1; i <= n * n; i++)
        if (!A[i])
        {
            int id = -1;
            for (int j = 1; j <= n; j++)
                if (C[j] < j - 1 && i < X[j] && (id == -1 || X[j] < X[id]))
                    id = j;
            if (id == -1)
                for (int j = 1; j <= n; j++)
                    if (C[j] >= j - 1 && C[j] < n - 1 && i > X[j])
                        id = j;
            if (id == -1)
                return !printf("No\n");
            A[i] = id;
            C[A[i]] ++;
        }
    printf("Yes\n");
    for (int i = 1; i <= n * n; i++)
        printf("%d ", A[i]);
    return 0;
}

Measured memory_bytes: 2176
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
	Scanner sc = new Scanner(System.in);
	while(sc.hasNextInt()) {
		int x = sc.nextInt();
		int y = sc.nextInt();
		if(x==0 && y==0) {
			break;
		}else if(x>y){
			System.out.println(y +" "+x);
		}else {
			System.out.println(x + " " + y);
		}
	}

	}

}



Measured memory_bytes: 35228
a, b, c = map(int,input().split())

c0 = set()
a2 = a%b
c0.add(a2)
if a2 == c:
    ans = 'YES'
else:
    ans = 'NO'
while True:
    a2 += a%b
    a2 %= b
    if a2 == c:
        ans = 'YES'
        break
    if a2 in c0:
        break
    c0.add(a2)

print(ans)
# print(c0)

Measured memory_bytes: 3064
#include <iostream>
using namespace std;
long long a,b,c,d,e,t;
long long gcd(long long b,long long d){
	if(d==0) return b;
	else return gcd(d,b%d);
}
int main(){
	cin>>t;
	while(t--){
		cin>>a>>b>>c>>d;
		e=gcd(b,d);
		//cout<<a-(a-c-1)/e*e<<' ';
		cout<<((a-(a-c-1)/e*e-b<0||a<b||d<b)?"No":"Yes")<<endl;
	}
}


Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <vector>
#include <set>
#include <queue>
#include <algorithm>
#include <utility>
#include <cmath>
using namespace std;
using ll=long long;
using P=pair<int,int>;
#define rep(i,a,b) for(ll i=a;i<ll(b);i++)
#define repr(i,a,b) for(ll i=a;i>=ll(b);i--)
#define endl '\n'
#define ALL(x) x.begin(),x.end()
#define ALLR(x) x.rbegin(),x.rend()
#define INF 1e9
#define DEBUG(x) cout<<"debug: "<<x<<endl
template<class T> inline bool chmin(T& a,T b){if(a>b){a=b;return 1;}return 0;}
template<class T> inline bool chmax(T& a,T b){if(a<b){a=b;return 1;}return 0;}

string s;
int main(){
    cin >> s;
    if(s[2] == s[3]){
        if(s[4] == s[5]){
            cout << "Yes" << endl;
            return 0;
        }
    }
    cout << "No" << endl;
    return 0;
}


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

int main() {
	int N;
  	cin >> N;
  
  	vector<int> vec(N);
  
  	for(int i = 0; i < N; i++) {
    	cin >> vec.at(i);
    }
  
  	sort(vec.begin(),vec.end());
  
  	cout << vec.at(N - 1) - vec.at(0) << endl;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define ll long long
using namespace std;
const int N=1e5+5;

int n,now,cnt[3];

int main(){
	scanf("%d",&n);
	for(int i=1,j;i<=n;i++){
		scanf("%d",&now),j=0;
		if(!(now&1)) now>>=1,j++;
		if(!(now&1)) now>>=1,j++;
		cnt[j]++;
	}
	
	if(cnt[2]>=cnt[0]||(!cnt[1]&&cnt[0]==cnt[2]+1)) puts("Yes");
	else puts("No");
	return 0;
}

Measured memory_bytes: 256
#include <stdio.h>
#include <stdlib.h>
const int MAX = 1e5+1;

int cmp(const void *a, const void *b){
  return *(int*)a - *(int*)b;
}

int main() {
  int n,a[MAX][2],i;
  
  scanf("%d",&n);
  for(i=0;i<n;i++){
    scanf("%d",&a[i][0]);
    a[i][1] = i+1;
  }
  
  qsort(a,n,sizeof(int)*2,cmp);
  for(i=0;i<n;i++)
    printf("%d ",a[i][1]);
  printf("\n");
  
  return 0;
}

Measured memory_bytes: 1788
#include<stdio.h>
int main()
{
	char s[4],t[4];
	int i,c;
	scanf("%s %s",s,t);
	c=0;
	for(i=0;i<3;i++){
		if(s[i]==t[i]) c++;
	}
	printf("%d\n",c);
	return 0;
}


Measured memory_bytes: 1708
import java.util.*;
public class Main{
public static void main(String[]args){
Scanner sc=new Scanner(System.in);
  int N=sc.nextInt();
  int count =0;
  int[]NN={1,2,3,4,5,6,7,8,9,10,12,14,15,16,18,20,21,24,25,27,28,30,32,35,36,40,42,45,
           48,49,54,56,63,64,72,81};
  
  myLabel:for(int i=0;i<NN.length;i++){
    
if(NN[i]==N){
  System.out.println("Yes");
  break;
  }else{
count++;
}
  }
  if(count==36){
System.out.println("No");
  }
}
}
	


Measured memory_bytes: 21716
n,a,b = (int(i) for i in input().split())
count = 0

for i in range(1,n+1):
    si = str(i)
    if len(si) == 1:
        s = int(si[0])
    elif len(si) == 2:
        s = int(si[0])+int(si[1])
    elif len(si) == 3:
        s = int(si[0])+int(si[1])+int(si[2])
    else:
        s = int(si[0])+int(si[1])+int(si[2])+int(si[3])

    if a <= s and s <= b:
        count += i
print(count)


Measured memory_bytes: 3064
N,M,C = (int(i) for i in input().split())
b = [int(i) for i in input().split()]
cnt = 0
for n in range(N):
  a = [int(i) for i in input().split()]
  total = C
  for m in range(M):
    total += a[m] * b[m]
  if total > 0:
    cnt += 1
print(cnt)

Measured memory_bytes: 3060
x, y, a, b ,c=map(int,input().split())
p=list(map(int,input().split()))
q=list(map(int,input().split()))
r=list(map(int,input().split()))
sm=0
p.sort()
q.sort()
r.sort(reverse=True)

p=p[(a-x):]
q=q[(b-y):]
p.extend(q)
p.sort()

idx=0
for i in range(len(p)):
    if p[i]>r[idx]:
        break
    else:
        p[i]=r[idx]
        idx+=1
        if c==idx:
            break

print(sum(p))

Measured memory_bytes: 29536
#include<iostream>
#include<cstdio>
#include<algorithm>

using namespace std;

int main(){
  int i,j,sum,sumb,n;
  sum=0;
  sumb=0;

  for(i=0;i<4;i++){cin >> n;
  sum+=n;
  }

  for(i=0;i<4;i++){cin >> n;
    sumb+=n;}

  int xmax=0;  
  xmax=max(sum,sumb);

  cout << xmax << endl;




}

Measured memory_bytes: 0
fun main(args: Array<String>) {
    agc032a()
}

fun agc032a() {
    val n = readLine()!!.toInt()
    val bList = readLine()!!.split(" ").map { it.toInt() }
        .toMutableList()

    if (bList.withIndex().any { iv ->
            val (index, b) = iv
            index + 1 < b
        }) return println(-1)

    val manipulation = mutableListOf<Int>()
    while (bList.isNotEmpty()) {
        val target = bList.withIndex().findLast { iv ->
            val (index, b) = iv
            index + 1 == b
        }
        if (target != null) {
            bList.removeAt(target.index)
            manipulation.add(target.value)
        } else return println(-1)
    }

    println(manipulation.reversed().joinToString(System.lineSeparator()))
}


Measured memory_bytes: 37928
#include<bits/stdc++.h>
using namespace std;
int main(){
    int n;
    cin  >> n;
    vector<int> a(n);
    for(int i = 0; i < n; i++){
        cin >> a[i];
    }
    reverse(a.begin(),a.end());
    for(int i = 0; i < n; i++){
        cout << a[i];
        if(i != n-1) cout << " ";
    }
    cout << endl;
}


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

int h,w;
char data[2002][2002];	// y x

int rl[2002][2002];
int ud[2002][2002];

int main(){
	cin >> h >> w;
	
	for(int i=0;i<2002;++i){
		for(int j=0;j<2002;++j){
			rl[i][j] = ud[i][j] = 0;
			data[i][j] = '#';
		}
	}
	
	for(int i=1;i<=h;++i){
		for(int j=1;j<=w;++j){
			cin >> data[i][j];
		}
	}
	
	for(int i=1;i<=h;++i){
		for(int j=1;j<=w;++j){
			if(data[i][j] == '#') continue;
			int k = j;
			while(data[i][k] != '#'){
				k++;
			}
			for(int l=j;l<k;++l){
				rl[i][l] = k-j;
			}
			j=k-1;
//			cout << i << " " << j << " " << k << endl;
		}
	}
	
	for(int i=1;i<=w;++i){
		for(int j=1;j<=h;++j){
			if(data[j][i] == '#') continue;
			int k = j;
			while(data[k][i] != '#'){
				k++;
			}
			for(int l=j;l<k;++l){
				ud[l][i] = k-j;
			}
			j=k-1;
		}
	}
	
	int res = 0;
	for(int i=1;i<=w;++i){
		for(int j=1;j<=h;++j){
//			cout << res <<" " << j << " " <<i <<" " << ud[j][i] << " " << rl[j][i] <<endl;;
			res = max(res,ud[j][i]+rl[j][i]-1);
		}
	}
	/*
	for(int i=1;i<=h;++i){
		for(int j=1;j<=w;++j){
			cout << ud[i][j] ;
		}cout << endl;
	}*/
	
	cout << res << endl;
	
	
	
	return 0;
}


Measured memory_bytes: 35456
n=int(input())
#n,k=map(int,input().split())
v=list(map(int,input().split()))
l=list()
prev=0
for i in v:
  if prev!=i:
    l.append(i)
    prev=i
n=len(l)
if n==1:
  print(1000)
else: 
  d=list()
  if l[0]>l[1]:
      d.append(l[0])
  if l[0]<l[1]:
      d.append(l[0])
  for i in range(1,n-1):
    if l[i-1]<l[i] and l[i+1]<l[i]:
      d.append(l[i])
    if l[i-1]>l[i] and l[i+1]>l[i]:
      d.append(l[i])
  if l[-1]>l[-2]:
      d.append(l[-1])
  if l[-1]<l[-2]:
      d.append(l[-1])
  #print(d)
  n=len(d)
  p=1000
  if n>1:
    i=1
    while(i<n):
      if d[i-1]<d[i]:
        z=(p//d[i-1])*d[i]
        r=p%d[i-1]
        i+=2
        if z+r>p:
        	p=z+r
      else:
        i+=1
    print(p)
  else:
    print(p)
    




Measured memory_bytes: 9284
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
ll n,m,k;
cin>>n>>m>>k;
ll a[n+1]={};
ll b[m+1]={};
ll r=0;
a[0]=0;
b[0]=0;
for(ll i=1; i<=n; i++){
cin>>r;
a[i]=a[i-1]+r;
}
for(ll i=1; i<=m; i++){
cin>>r;
b[i]=b[i-1]+r;
}
ll ca=0;
ll ans=0;
for(ll i=0; i<=n; i++){
ll t = k-a[i];
if(t<0&&i==0){
for(ll g=1; g<=m; g++){
if(b[g]<=k){
ans++;}
else{
goto asd;}}}
else if(t<0) continue;
else if(t==0){
ans=max(ans,i);}
else{
ll left = -1; //「index = 0」が条件を満たすこともあるので、初期値は -1
    ll right = m+1; // 「index = a.size()-1」が条件を満たさないこともあるので、初期値は a.size()
 
    /* どんな二分探索でもここの書き方を変えずにできる！ */
    while (right - left > 1) {
        ll mid = left + (right - left) / 2;
       // cout << left << " " << right << endl;
        if (t >= b[mid]) left = mid;
        else right = mid;
       // cout << left << " " << right << endl;
    }
 
    /* left は条件を満たさない最大の値、right は条件を満たす最小の値になっている */
   
ll p = right-1;
ans =max(ans , p+i);}}
asd:
cout << ans << endl;}


Measured memory_bytes: 6676
#include <iostream>
using namespace std;
int main(void){
    // Your code here!
    string a, b, c;
    int d, e;
    cin >> a >> b >> c;
    d = a.size()-1;
    e = b.size()-1;
    if(a.at(d)==b.at(0)&&b.at(e)==c.at(0)){
        cout << "YES" << endl;
    }
    else
        cout << "NO" << endl;
}

Measured memory_bytes: 256
#include<iostream>
#include<string>
using namespace std;
int main() {
    string str;
    int sum;
    while (cin >> str) {
        if (str == "0") { return 0; }
        sum = 0;
        for (int i = 0; i < str.size(); i++) {
            sum += str[i] - 48;
        }
        cout << sum << endl;
    }
}


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

string s ;

int k ;

vector < string > lis ;

int main(){
	#define NAME ""
	//freopen( NAME".inp" , "r" , stdin ) ; freopen( NAME".out" , "w" , stdout ) ;

	ios_base :: sync_with_stdio(false) ; 

	cin >> s ;

	int len = (int)s.size() ;

	cin >> k ;

	for (int i = 0; i < len; ++ i){
		string foo = "" ;
		for (int j = 1; j <= min(len - i, k); ++ j){
			foo = foo + s[i + j - 1] ;
			lis.push_back(foo) ;
		}
	}

	sort(lis.begin(), lis.end()) ;

	if(k == 1) return cout << lis[0] , 0 ;

	int cnt = 1 ;

	for (int i = 1; i < (int)lis.size(); ++ i) {
		if(lis[i] != lis[i - 1]) cnt ++ ;
		if(cnt == k) return cout << lis[i], 0 ;
	}

	return 0 ;
}

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

int main() {
  int m, k;
  cin >> m >> k;

  if(m==1){
    if(k==0) cout << "0 0 1 1" << endl;
    else cout << -1 << endl;
    return 0;
  }

  if(k>=(1<<m)){
    cout << -1 << endl;
    return 0;
  }

  rep(i, (1<<m)){
    if(i!=k) cout << i << " ";
  }
  cout << k << " ";
  for(int i=(1<<m)-1;i>-1; i--){
    if(i!=k) cout << i << " ";
  }
  cout << k << endl;

  return 0;
}

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

int main(){
    int N;
    cin >> N;

    int h[N];
    for(int i = 0; i < N; i++)cin >> h[i];

    int ans = 0;
    for(int i = 0; i < N; i++){
        int j = i;
        //for(int p = 0; p < N; p++)cout << h[p] << " : ";
        //cout << endl;
        while(1){
            if(h[j] == 0)break; 
            h[j]--;
            if(j >= N - 1 || h[j + 1] == 0){
                j = i;
                ans++;
            }
            else j++;
        }
    }
    cout << ans;
}

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

///Author:Refat(BSMRSTU)///

#define ll long long
#define ull unsigned long long
#define ff first
#define ss second
#define pb push_back
#define vi vector<int>
#define pii pair<int,int>
#define pil pair<int,ll>
const int N = 1e5 + 5;
const int M = 1e9 + 7;
const double pi=2*acos(0.0);
const double esp=1e-9;
int Set(int N,int pos) {
    return N=N | (1<<pos);
}
int reset(int N,int pos) {
    return N= N & ~(1<<pos);
}
bool check(int N,int pos) {
    return (bool)(N & (1<<pos));
}
int main() {
    /// freopen("input.txt","r",stdin);
    /// freopen("output.txt","w",stdout);
    int test=1,n;
    ///scanf("%d",&test);
    for(int cs=1; cs<=test; cs++) {
            scanf("%d",&n);
      for(int i=1;i<=9;i++){
        if(n%i==0&&(n/i)<=9){
            printf("Yes\n");
            return 0;
        }
      }
      printf("No\n");
    }
    return 0;
}



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

int main() {
  int N;
  cin >> N;
  vector<int> a(N);
  for(int i=0; i<N; i++) {
    cin >> a[i];
  }
  sort(a.begin(), a.end());
  cout << a[N-1] - a[0];
}

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

int main() {
  // ここにプログラムを追記
  int M = 0, N = 0; //変数宣言
   
  cin >> M;		//入力
  
  N = 24 + (24 - M);	//演算
  
  cout << N << endl;	//出力
}

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

int main() {
  char N[5];
  scanf("%s", N);
  if (N[0] == N[1] && N[1] == N[2]) {
    cout << "Yes";
  }
  else if (N[1] == N[2] && N[2] == N[3]) {
    cout << "Yes";
  }
  else
  {
    cout << "No";
  } 
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < n; ++i)
#define rep2(i,s,n) for (int i = s; i < n; ++i)
#define all(a) a.begin(),a.end()
#define tmax(a,b,c) max(a,max(b,c))
#define tmin(a,b,c) min(a,min(b,c))
#define pb push_back
using namespace std;
using ll = long long;
using P = pair<int,int>;
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;}
const int inf = 1001001001;

struct Edge {
    int to,len;
};

int main() {
    int n;
    cin >> n;
    vector<vector<Edge>> tree(n);
    rep(i,n-1) {
        int u,v,w;
        cin >> u >> v >> w;
        u--; v--;
        tree[u].pb(Edge{v,w});
        tree[v].pb(Edge{u,w});
    }
    vector<int> ans(n,-1);
    queue<int> q;
    ans[0] = 0;
    q.push(0);
    while(!q.empty()) {
        int now = q.front();
        q.pop();
        for(auto e : tree[now]) {
            if(ans[e.to] != -1) continue;
            int l = e.len;
            if(l%2 == 0) ans[e.to] = ans[now];
            else ans[e.to] = 1-ans[now];
            q.push(e.to);
        }
    }
    rep(i,n) cout << ans[i] << endl;
}

Measured memory_bytes: 6784
#include<stdio.h>  

#include<stdbool.h>

#include<string.h>

int main(){

	int n,m,k;	int max;

	int j;

	scanf("%d%d%d",&n,&m,&k);

	if(m>n)

	max=m;

	else 

	max=n;

	if(k%max==0)

    j=k/max;

    else 

    j=k/max+1;

    printf("%d",j);

    

	

}

Measured memory_bytes: 128
#include<cstdio>
#include<cstring>
#include<algorithm>
#define rep(i,a) for( int i = 0; i != (a); ++i )

int n, c;
int a[30], b[31];
int adv[30][1<<16], dp[31][1<<16];

int bitCount( int bits )
{
	int ret = 0;
	while( bits > 0 )
	{
		ret += bits&1;
		bits >>= 1;
	}

	return ret;
}

int main()
{
	while( scanf( "%d%d", &n, &c ), n|c )
	{
		memset( a, 0, sizeof( a ) );
		memset( b, 0, sizeof( b ) );
		memset( dp, -1, sizeof( dp ) );

		rep( i, n )
		{
			rep( j, 16 )
			{
				int t;
				scanf( "%d", &t );
				if( t )
					a[i] |= 1<<j;
			}
		}

		rep( i, c )
		{
			rep( j, 16 )
			{
				int t;
				scanf( "%d", &t );
				if( t )
					b[i] |= 1<<j;
			}
		}

		dp[0][0] = 0;

		rep( i, n ) rep( j, 1<<16 )
		{
			if( dp[i][j] < 0 )
				continue;

			int x = j|a[i];
			rep( k, c+1 )
				dp[i+1][x^(x&b[k])] = std::max( dp[i+1][x^(x&b[k])], dp[i][j]+bitCount( x&b[k] ) );
		}

		printf( "%d\n", *std::max_element( dp[n], dp[n+1] ) );
	}

	return 0;
}

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

int main(){
    int n,a,b;
    cin >> n ;
    cout << 48-n << endl;

    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define repd(i,a,b) for (int i=(a);i<(b);i++)
#define rep(i,n) repd(i,0,n)
#define all(x) (x).begin(),(x).end()
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; }
typedef long long ll;
const long long INF = 1LL << 60;
int main()
{
    int N;
    cin >> N;
    vector<int> a(N);
    rep(i, N) cin >> a[i];
    sort(all(a));
    cout << a[N - 1] - a[0] << endl;
    return 0;
}

Measured memory_bytes: 256
#include <stdio.h>

int main(){
   int i,n,k;
   long a[200000];

   scanf("%d %d",&n,&k);
   for (i=0;i<n;i++) scanf("%ld",&a[i]);
   for (i=k;i<n;i++)
      if (a[i-k]<a[i]) puts("Yes");
      else             puts("No");
   return 0;
}


Measured memory_bytes: 3180
import sys
input=sys.stdin.readline

n,m,c = map(int, input().split())
b = list(map(int, input().split()))
a = [0]*n
for i in range(n):
    a[i] = list(map(int, input().split()))

ans = 0
for i in range(n):
    k = 0
    for j in range(m):
        k += a[i][j]*b[j]
    k += c
    if k > 0:
        ans += 1
print(ans)


Measured memory_bytes: 3064
h,w=map(int,input().split())

a=[]
for _ in range(h):
    a+=list(input())

four=(h//2)*(w//2)
two=h%2*w//2+w%2*h//2
one=(h%2)*(w%2)

import collections
c = collections.Counter(a)

#print(four,two,one)
d=list(c.values())
d.sort()

for item in d:
    if item==1:
        if one==1:
            one-=1
        else:
            print("No")
            exit()
    elif item==2:
        if two>0:
            two-=1
        else:
            print("No")
            exit()
    elif item==3:
        if one==1 and two>0:
            one-=1
            two-=1
        else:
            print("No")
            exit()
    else:
        if item%2==1:
            if one==0:
                print("No")
                exit()
            else:
                item-=1
                one-=1
        #print(item,four,two,one)
        while item>=4 and four>0:
            item-=4
            four-=1
        #print(item,four,two,one)
        
        while item>=2:
            item-=2
            two-=1
        #print(item,four,two,one)
    
if one==0 and two==0 and four==0:
    print("Yes")
else:
    print("No")
        





Measured memory_bytes: 39152
using System;

namespace Testcode
{
    class Program
    {
        static void Main(string[] args)
        {
           string[] c = Console.ReadLine().Split();
           int a = int.Parse(c[0]);
           int b = int.Parse(c[1]);
           
           if (a < b)
           {
               Console.WriteLine("a < b"); 
           }
           else if (a > b)
           {
               Console.WriteLine("a > b");
           }
           else if (a == b)
           {
               Console.WriteLine("a == b");
           }
        }
    }
}



Measured memory_bytes: 17980
#include <bits/stdc++.h>
#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 namespace std;
using P = pair<int, int>; 
using ll = long long;

int main()
{
  int a;
  cin >> a;
  rep(i, 26){
    rep(j, 26){
      if(i * 4 + j * 7 == a){
        cout << "Yes" << endl;
        return 0;
      }
    }
  }
  cout << "No" << endl;
  return 0;
}


Measured memory_bytes: 3660
n = int(input())
l = [input() for i in range(n)]
d = {k: 0 for k in ['AC', 'WA', 'TLE', 'RE']}
for s in l:
    d[s] += 1
for s in ['AC', 'WA', 'TLE', 'RE']:
    print('{} x {}'.format(s, d[s]))

Measured memory_bytes: 16188
using System;
    class Program
    {
        static void Main(string[] args)
        {

           
            string[] W =new string[3]{"Sunny", "Cloudy", "Rainy"};

            string w = Console.ReadLine();

            switch(w)
            {
                case "Sunny":
                    Console.WriteLine("Cloudy");
                    break;
                case "Cloudy":
                    Console.WriteLine("Rainy");
                    break;
                case "Rainy":
                    Console.WriteLine("Sunny");
                    break;

            }

          
            Console.ReadLine();
           
        }
    }

Measured memory_bytes: 11092
#include <bits/stdc++.h>
#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++)
#define chmax(a, b) a = max(a, b)
using namespace std;

int		main(void)
{
	ios::sync_with_stdio(0);
	cin.tie(0);
	int n, num;
	cin >> n;
	vector<int> v(n);
	rep(i, n) cin >> v.at(i);
	sort(v.begin(), v.end());
	num = v.at(0);
	v.erase(v.begin());
	int level = 1;
	rep(i, n - 1) {
		if (num < v.at(i)) {
			level++;
			num = v.at(i);
		}
	}
	cout << level << "\n";
}


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

int main(){
    int a,b,c,d;
    cin>>a>>b>>c>>d;
    if((a+b)==(c+d))cout<<"Balanced";
    else if((a+b)>(c+d))cout<<"Left";
    else cout<<"Right";
}

Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <iomanip>
#include <stdlib.h>
#include <string.h>
#include <cstring>
#include <cmath>
#include <map>
#include <queue>
#include <deque>
#include <stack>
#include <set>
#include <stdio.h>
#include <tuple>
#include <bitset>
#include <cfloat>
#include <fstream>
#include <limits.h>
#include <list>
#include <math.h>
#include <random>
#include <unordered_map>
#include <unordered_set>
#include <bitset>
#include <numeric>
#include <utility>
#include <sstream>

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

using namespace std;
#define ll long long
#define rep(i, n) for (ll i = 0; i < (n); i++)
#define FOR(i,a,b) for(ll i=(a);i<(b);i++)
#define FORR(i,a,b)for(ll i=(a);i<=(b);i++)
#define repR(i,n) for(ll i=n;i>=0;i--)
#define P pair<ll, ll>
#define sz(x) (ll)x.size()
#define ALL(x) (x).begin(),(x).end()
#define ALLR(x) (x).rbegin(),(x).rend()
#define VE vector<ll>
#define COUT(x) cout<<(x)<<endl
#define MA map<ll,ll>
#define SE set<ll>
#define PQ priority_queue<ll>
#define PQR priority_queue<ll,VE,greater<ll>>
#define COUT(x) cout<<(x)<<endl
#define YES(n) cout << ((n) ? "YES" : "NO"  ) << endl
#define Yes(n) cout << ((n) ? "Yes" : "No"  ) << endl

ll gcd(ll a, ll b) {
	if (a < b)swap(a, b);
	if (b == 0) return a;
	return gcd(b, a % b);
}
ll lcm(ll a, ll b) {
	ll g = gcd(a, b);
	return a / g * b;
}
bool prime(ll n) {
	for (ll i = 2; i <= sqrt(n); i++) {
		if (n%i == 0)return false;
	}
	return n != 1;
}


const long long MOD = 1000000007;
const long long INF = 1e9;
const long long LINF = 1LL << 50;
#define int long long

signed main() {
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	int n; cin >> n;
	int a = 1; int b = 1;
	rep(i, n) {
		int x, y; cin >> x >> y;
		int tmp = max((a+x-1)/ x, (b+y-1) / y);
		a = tmp * x; b = tmp * y;
	}
	cout << a + b << endl;
	return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main(){
    int A,B;
    cin>>A;
    cin>>B;
      if(A==1 and B==2||B==1 && A==2)
          cout<<"3";
      else if(A==2 && B==3||B==2 && A==3)
           cout<<"1";
          
      else if(A==3 && B==1||B==3 && A==1)
           cout<<"2";
          return 0;}

Measured memory_bytes: 384
/*
Author: Racer5x
 ***************************************   UNAUTHORISED COPYING OF CODE PROHIBITED   **********************************
*/
 
// #pragma GCC optimize("O3")
// #pragma GCC optimize("Ofast")
// #pragma GCC optimize("unroll-loops")
// #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
 
#include<bits/stdc++.h>
#define int         long long
#define double      long double
#define pb          emplace_back
#define pf          emplace_front
#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 rall(a)     (a).rbegin(),(a).rend()
#define x           first
#define y           second
#define endl        '\n'
#define hell        998244353 
#define PI          3.141592653589
#define tezz        ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define MAX         2000000000000000000
#define M           1000000007
using namespace std;

int dp[200005];
int h[200005];
int a[200005];
 
signed main()
{
    tezz
    
    int n;
    cin>>n;

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

    vi st(2*n, 0);

    //dp[i] stores max summation when flower of height i is choosen
    for(int flower = 0; flower<n; flower++){
        int height = h[flower], beauty = a[flower];

        int l = 0, r = height;
        int mx = 0;
        for(l+=n, r+=n; l<r; l>>=1, r>>=1){
            if(l&1) mx = max(mx, st[l++]);
            if(r&1) mx = max(mx, st[--r]);
        }
        dp[height] = mx + beauty;
        height--;

        //insertion in seg tree
        for(st[height += n] = mx + beauty; height > 1; height>>=1) st[height>>1] = max(st[height], st[height^1]);
    }

    int ans = 0;
    for(int i=0;i<=n;i++) ans = max(ans, dp[i]);

    cout<<ans;
} 

Measured memory_bytes: 8192
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pli = pair<ll, int>;
#define rep(i, j) for(int i=0; i < (int)(j); i++)
#define repeat(i, j, k) for(int i = (j); i < (int)(k); i++)
#define debug(x) cerr << #x << " : " << x << endl
template<class T> ostream& operator << (ostream &os , const vector<T> &v) { for(const T &t : v) os << "\t" << t; return os << endl; }

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

    ll N, L, T; cin >> N >> L >> T;
    vector<ll> X(N), W(N);
    rep(i, N) cin >> X[i] >> W[i];
    ll w = W[0];
    // 蟻0を時計回りに固定
    if(W[0] == 2) {
        rep(i, N) {
            W[i] = W[i] == 1 ? 2 : 1;
            X[i] = L - X[i];
        }
    }
    ll roll = T / L, left = T % L, sum = 0;
    // 衝突回数計算
    repeat(i, 1, N) {
        if(W[i] != W[0]) {
            sum += roll * 2;
            ll d = (X[i] - X[0] + L) % L;            
            if(left * 2 >= d) sum += 1;
            if(left * 2 - d >= L) sum += 1;
        }
        sum %= N;
    }
    // 蟻本方式に動いて移動先計算
    rep(i, N) {
        X[i] += (W[i] == 1 ? left : -left) + L;
        X[i] %= L;        
    }
    // 正しい座標に戻す
    if(w == 2) rep(i, N) X[i] = (L - X[i]) % L;

    ll i = (w == 1 ? sum : N - sum + N) % N; // i番目の蟻が，蟻本方式での0番目の蟻の移動先にいる

    ll x0 = X[0];
    sort(begin(X), end(X));
    
    ll ii = find(begin(X), end(X), x0) - begin(X);
    if(w == 1) while(ii < N - 1 and X[ii + 1] == X[ii]) ii++;    
    
    ll i2 = (ii - i + N) % N; // 0番目の蟻はi2番目の蟻の移動先にいる

    rep(j, N) {
        cout << X[(i2 + j) % N] << endl;
    }    

    return 0;
}


Measured memory_bytes: 2816
from collections import defaultdict 
import sys
import math 
import random
def get_array(): return list(map(int , sys.stdin.readline().strip().split()))
def get_ints(): return map(int, sys.stdin.readline().strip().split())
def input(): return sys.stdin.readline().strip()

cnt = 0
n = int(input())
for i in range(1,n):
    if n%i==0:
        cnt += (n//i-1)
    else:
        cnt += n//i  
print(cnt)

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

using namespace std;

int main() {
    int N;
    cin >> N;

    // Name, Score, Index
    tuple <string, int, int> resteraunts[N];
    string temps;
    int tempi;
    for (int i = 0; i < N; i++)
    {
        cin >> temps >> tempi;
        resteraunts[i] = make_tuple(temps, tempi, i + 1);
    }

    sort (resteraunts, resteraunts + N,
            [](tuple<string, int, int> const &t1, tuple<string, int, int> const &t2) {
                if (get<0>(t1) == get<0>(t2))
                {
                    return get<1>(t1) > get<1>(t2);
                } else {
                    return get<0>(t1) < get<0>(t2);
                }
            }
    );

    for (int i = 0; i < N; i++)
    {
        cout << get<2>(resteraunts[i]) << "\n";
    }
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int const nax = 3e5 + 10;

inline long long fif (long long x) {

    return x * x * x * x * x;
}

inline bool is_fif (long long v) {
    long long ret = pow(v, 0.2);

    return fif(ret) == v;
}


int main () {

    long long x;

    scanf("%lld", &x);

    const int t = -1000;
    for (long long b = t ; ; ++ b) {
        long long res = x + fif(b);

        if (is_fif(res)) {
          ///  fprintf(stderr, "%lld\n", fif((long long)pow(res, 0.2)) - fif(b));
            return !printf("%lld %lld\n", (long long)pow(res, 0.2) ,b);
        }
    }

}
/*
    Good Luck
        -Lucina
*/


Measured memory_bytes: 4252
#include <iostream>
using namespace std;
int main() {
    string x; cin >> x;
    int ans = x.size(), s = 0;
    for (char c : x) {
        if (c == 'S') s++;
        else if (s > 0) { s--; ans -= 2; }
    }
    cout << ans << endl;
}


Measured memory_bytes: 640
import java.io.BufferedReader;
import java.io.InputStreamReader;

public class Main {

	static int[] S ;
	public static void main(String[] args) throws Exception {
		// TODO 自動生成されたメソッド・スタブ

		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		String W = in.readLine();
		String[] Ws = W.split(" ");

		int K = Integer.parseInt(Ws[0]);
		int N = Integer.parseInt(Ws[1]);

		W = in.readLine();
		Ws = W.split(" ");
		long[] A = new long[Ws.length];
		long[] B = new long[Ws.length];

		for (int i = 0; i < Ws.length; i++) {
			A[i] = Long.parseLong(Ws[i]);
		}

		long max = 0;
		int maxI = 0;
		long sum = 0;
		for (int i = 0; i < Ws.length; i++) {
			if(i==0){
				B[i] = K - A[N-1] + A[0];
				max = B[i];
				maxI = i;
			}else{
				B[i] = A[i] - A[i-1];
				if(max < B[i]){
					max = B[i];
					maxI = i;
				}
			}

		}

		System.out.println(K-max);




	}

}


Measured memory_bytes: 52236
#AGC017A

def f():
 res=1
 for x in a:
  if x%2==0:
   res*=1
  else:
   res=0
   return res
 return res

n,p=map(int,raw_input().split())
a=map(int,raw_input().split())

if f()==1 and p==0:
 print 2**n
elif f()==1 and p==1:
 print 0
else:
 print 2**(n-1)


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

#define F first
#define S second
#define PB push_back

using namespace std;

typedef long long LL;
typedef pair<int, int> PII;
typedef priority_queue<int> HEAP;
typedef priority_queue<int, vector<int>, greater<int> > RHEAP;

const int N = 500010, M = 50;

int n, m;
char s[N];
set<int> S[M];

int get(int l, int r, int i)
{
	auto it = S[i].lower_bound(l);
	if (it == S[i].end() || *it > r) return 0;
	else return 1;
}

int main()
{
	scanf("%d%s%d", &n, s + 1, &m);
	for (int i = 1; i <= n; i ++ ) S[s[i] - 'a'].insert(i);
	
	while (m -- )
	{
		int t;
		scanf("%d", &t);
		
		if (t == 1)
		{
			int i;
			char c[5];
			scanf("%d%s", &i, c);
			
			S[s[i] - 'a'].erase(i);
			s[i] = c[0];
			S[c[0] - 'a'].insert(i);
		}
		else
		{
			int l, r;
			scanf("%d%d", &l, &r);
			
			int res = 0;
			for (int i = 0; i < 26; i ++ ) res += get(l, r, i);
			printf("%d\n", res);
		}
	}
	return 0;
}

Measured memory_bytes: 24320
#include <bits/stdc++.h>
using namespace std;
/*#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
template<typename T> using gpp_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
template<typename T, typename L> using gpp_map = tree<T, L, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
template<typename T> using gpp_multiset = tree<T, null_type, less_equal<T>, rb_tree_tag, tree_order_statistics_node_update>;*/
struct fast_ios { fast_ios(){ cin.tie(0); ios::sync_with_stdio(false); cout << fixed << setprecision(20); }; } fast_ios_;
#define FOR(i, begin, end) for(int i=(begin);i<(end);i++)
#define REP(i, n) FOR(i,0,n)
#define IFOR(i, begin, end) for(int i=(end)-1;i>=(begin);i--)
#define IREP(i, n) IFOR(i,0,n)
#define Sort(v) sort(v.begin(), v.end())
#define Reverse(v) reverse(v.begin(), v.end())
#define all(v) v.begin(),v.end()
#define SZ(v) ((int)v.size())
#define Lower_bound(v, x) distance(v.begin(), lower_bound(v.begin(), v.end(), x))
#define Upper_bound(v, x) distance(v.begin(), upper_bound(v.begin(), v.end(), x))
#define Max(a, b) a = max(a, b)
#define Min(a, b) a = min(a, b)
#define bit(n) (1LL<<(n))
#define bit_exist(x, n) ((x >> n) & 1)
#define debug(x) cout << #x << "=" << x << endl;
#define vdebug(v) { cout << #v << "=" << endl; REP(i_debug, v.size()){ cout << v[i_debug] << ","; } cout << endl; }
#define mdebug(m) { cout << #m << "=" << endl; REP(i_debug, m.size()){ REP(j_debug, m[i_debug].size()){ cout << m[i_debug][j_debug] << ","; } cout << endl;} }
#define Return(ans) { cout << (ans) << endl; return 0; }
#define pb push_back
#define f first
#define s second
#define int long long
#define INF 1000000000000000000
template<typename T> istream &operator>>(istream &is, vector<T> &v){ for (auto &x : v) is >> x; return is; }
template<typename T> ostream &operator<<(ostream &os, vector<T> &v){ for(int i = 0; i < v.size(); i++) { cout << v[i]; if(i != v.size() - 1) cout << endl; }; return os; }
template<typename T1, typename T2> ostream &operator<<(ostream &os, pair<T1, T2> p){ cout << '(' << p.first << ',' << p.second << ')'; return os; }
template<typename T> void Out(T x) { cout << x << endl; }
template<typename T1, typename T2> void Ans(bool f, T1 y, T2 n) { if(f) Out(y); else Out(n); }

using vec = vector<int>;
using mat = vector<vec>;
using Pii = pair<int, int>;
using PiP = pair<int, Pii>;
using PPi = pair<Pii, int>;
using bools = vector<bool>;
using pairs = vector<Pii>;

//int dx[4] = {1,0,-1,0};
//int dy[4] = {0,1,0,-1};
//char d[4] = {'D','R','U','L'};

const int mod = 1000000007;
//const int mod = 998244353;
//#define Add(x, y) x = (x + (y)) % mod
//#define Mult(x, y) x = (x * (y)) % mod



signed main(){

    string S; cin >> S;
    string ans(SZ(S), 'x');
    Out(ans);

    return 0;
}


Measured memory_bytes: 256
n=int(input())
a=list(map(int,input().split()))
limit=100000
count=[]
for i in range(limit):
  count.append(0)
for i in range(n):
  count[a[i]]+=1
x=count[0]+count[1]+count[2]
maxx=x
for i in range(limit-3):
  x+=count[i+3]-count[i]
  maxx=max(maxx,x)
print(maxx)

Measured memory_bytes: 13964
#include <functional>
#include <algorithm>
#include <iostream>
#include <numeric>
#include <iomanip>
#include <utility>
#include <cstdlib>
#include <sstream>
#include <bitset>
#include <vector>
#include <cstdio>
#include <ctime>
#include <queue>
#include <deque>
#include <cmath>
#include <stack>
#include <list>
#include <map>
#include <set>

using namespace std;

typedef vector<int> vi;
typedef pair<int,int> pii;
typedef long long ll;

#define dump(x)  cerr << #x << " = " << (x) << endl
#define rep(i,n) for(int i=0;i<(n);i++)
#define all(a)  (a).begin(),(a).end()
#define pb push_back


int main() {
    int l;
    while(cin>>l){
        if(l==0)break;
        
        int sum=0;
        int ans=999999;
        rep(i,12){
            int a,b;
            cin>>a>>b;
            sum+=a-b;
            if(l<=sum)ans=min(ans,i+1);
        }
        
        if(ans==999999)cout<<"NA"<<endl;
        else cout<<ans<<endl;
    }
}

Measured memory_bytes: 1160
#include<bits/stdc++.h>
#define rep(i,n) for (int i=0; i<n; i++)
#define REP(i,x,n) for (int i=x; i<n; i++)
using namespace std;
using vi = vector<int>;
using vvi = vector<vi>;
using ll = long long;
const int mod =1'000'000'007;

int main(){
    int n;
    cin >> n;
    vi a(n);
    rep(i,n-1){
        int ai;
        cin >> ai;
        a.at(ai-1)++;
    }
    rep(i,n) cout << a.at(i) << endl;
    return 0;
}


Measured memory_bytes: 3964
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair< ll, ll > Pi;
#define rep(i,n) for(int i=0;i<(n);i++)
#define rep2(i,n) for(int i=1;i<=(n);i++)
#define rep3(i,i0,n) for(int i=i0;i<(n);i++)
#define pb push_back
#define mod 1000000007
const ll INF = 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; }
ll gcd(ll a, ll b) {return b?gcd(b,a%b):a;}
ll lcm(ll a, ll b) {return a/gcd(a,b)*b;}
#define all(x) x.begin(), x.end()
#define mp make_pair
bool compare(Pi a, Pi b) {
    if(a.first != b.first){
        return a.first < b.first;
        
    }else{
        return a.second < b.second;
    }
}


bool In_map(ll y,ll x,ll h,ll w){
    if(y<0 || x<0 || y>=h || x>=w){
        return 0;
    }else{
        return 1;
    }
}
const vector<ll> dx{1,0,-1,0};
const vector<ll> dy{0,1,0,-1};


int main() {
    ll x;
    cin >>x;
    if(x<1200){
        cout<<"ABC"<<endl;
    }else{
        cout<<"ARC"<<endl;
    }
    
  


    return 0;
    

}

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

int x;
int main() {
	scanf("%d",&x);
	printf("%lld\n",360/gcd(360,x));
}

Measured memory_bytes: 3824
#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cstring>
#include<cmath>
#include<set>
#include<map>
#include<queue>
#include<bitset>
#include<ctime>
using namespace std;
typedef long long ll;
#define sqr(x) ((x)*(x))
#define mp make_pair
#define int long long
#define PI pair<int,int>
inline char gc(){
    static char buf[100000],*p1=buf,*p2=buf;
    return p1==p2&&(p2=(p1=buf)+fread(buf,1,100000,stdin),p1==p2)?EOF:*p1++;
}
#define gc getchar
inline int read(){
    int x = 0; char ch = gc(); bool positive = 1;
    for (; !isdigit(ch); ch = gc())	if (ch == '-')	positive = 0;
    for (; isdigit(ch); ch = gc())	x = x * 10 + ch - '0';
    return positive ? x : -x;
}
inline void write(int a){
    if(a>=10)write(a/10);
    putchar('0'+a%10);
}
inline void writeln(int a){
    if(a<0){
    	a=-a; putchar('-');
    }
    write(a); puts("");
}
int n,k,ans;
signed main(){
	n=read(),k=read();
	for(int b=1;b<=n;b++){
		for(int divide=0;divide<=n;divide++){
			ll down=max(1ll,divide*b+k),up=(divide+1)*b-1;
			if (down>n)break;
			up=min(up,n);
			if (down<=up)
				ans+=up-down+1;
		}
	}
	write(ans);
}

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


int main(){
  int min;
  int N,A,B,C,D;

  cin >> N >> A >> B >> C >> D;

  if(N%A == 0){
  min = N/A * B;
  }
  else {
    min = (N/A + 1) * B;
  }

  if(N%C == 0){
    if(min > N/C*D){
      min = N/C * D;
    }
  }
  else {
    if(min > (N/C + 1) * D){
      min = (N/C + 1) * D;
    }
  }

  
  cout << min << endl;
  return 0;
}



Measured memory_bytes: 3120
#include<bits/stdc++.h>
using namespace std;
#define itn int
#define int long long
#define mod 1000000007
#define fi first
#define se second
#define be begin()
#define en end()
#define re reverse
#define Set setprecision 
const int INFi=2147483647;
const long long INFl=9223372036854775807LL;
template<typename T> T abs(T a,T b){
    return max(a,b)-min(a,b);
}
template<typename T> T lcm(T a,T b){//�Ǿ����ܿ�
  return (a*b)/gcd(a,b);
}
int  gcd(int a,int b){//��������
  int c=a%b;
  while(true){
    if(c==0) break;
    a=b;
    b=c;
    c=a%b;
  }
  return b;
}
bool IsPrime(int num){
    if (num < 2) return false;
    else if (num == 2) return true;
    else if (num % 2 == 0) return false;
    double sqrtNum = sqrt(num);
    for(int i=3;i<=sqrtNum;i+=2){
	if(num%i==0){
	    return false;
	}
    }
  return true;
}
int a[100000000];
signed main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n,k;
    int b;
    int sum=0;
    cin>>n>>k;
    for(int i=0;i<n;i++){
      cin>>b;
      a[b]++;
    }
    sort(a,a+n,greater<int>());
    for(int i=k;i<=n;i++){
      sum+=a[i];
    }
    cout<<sum<<"\n";
}
    


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

int main() {
  int N, K;
  cin >> N >> K;
  vector<int> p(N);
  for(int i=0; i<N; i++){
    cin >> p.at(i);
  }
  
  sort(p.begin(),p.end());
  int ans=0;
  for(int i=0;i<K;i++){
    ans += p.at(i);
  }
  cout << ans << endl;
}


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

string ABC = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";

int index(char letter) {
    rep(i, ABC.size()) {
        if (letter == ABC[i]) return i;
    }
    return 0;
}

int main() {
    int n;
    string s;
    cin >> n >> s;
    rep(i, s.size()) { s[i] = ABC[(index(s[i]) + n) % ABC.size()]; }
    cout << s << endl;
    return 0;
}

Measured memory_bytes: 256