akhauriyash/Code-Regression huggingface dataset:
import std.stdio;
import std.string;
import std.conv;

int main()
{
    int n;
    while (true) {
        n = readln().chomp().to!int();
        if (n == 0) break; 
        int num[101][101];
        for (int i = 0; i < n; i++) {
            string[] str = readln().chomp().split();
            for (int j = 0; j < n; j++)
                num[i][j] = str[j].to!int();
        }
        for (int i = 0; i < n; i++)
            num[n][i] = num[i][n] = 0;
        num[n][n] = 0;
        
        for (int i = 0; i < n; i++)
            for (int j = 0; j < n; j++) {
                num[i][n] += num[i][j];
                num[n][i] += num[j][i];
            }
        for (int i = 0; i < n; i++)
            num[n][n] += num[n][i];

        for (int i = 0; i < n + 1; i++) {
            for (int j = 0; j < n; j++) {
                writef("%5d", num[i][j]);
            }
            writefln("%5d", num[i][n]);
        }
    }

    return 0;
}

Measured memory_bytes: 1104
/*-----------------------------------------------,
|  __                                       __   |
| |  |--.-----.---.-.----.----.-----.-----.|  |_ |
| |  _  |  -__|  _  |  __|  __|  -__|  _  ||   _||
| |_____|_____|___._|____|____|_____|   __||____||
|                                   |__|         |
`-----------------------------------------------*/
#include<algorithm>
#include<array>
#include<bitset>
#include<cmath>
#include<complex>
#include<deque>
#include<functional>
#include<iomanip>
#include<iostream>
#include<iterator>
#include<map>
#include<numeric>
#include<queue>
#include<set>
#include<stack>
#include<string>
#include<unordered_map>
#include<unordered_set>
#include<utility>
#include<vector>
typedef long long lint; using namespace std;
#define INF 1000000000000
#define MOD 10000007
#define rep(counter, limit) for (long long counter = 0; counter < limit; counter++)
int gcd(int a, int b) { if (a % b == 0) { return(b); } else { return(gcd(b, a % b)); } }
int lcm(int a, int b) { return a * b / gcd(a, b); }
bool primenum(int a) { if (a == 1) { return false; }if (a == 2) { return true; }if (a % 2 == 0) { return false; }for (int i = 3; i < sqrt(a) + 1; i += 2) { if (a != i) { if (a % i == 0) { return false; } } }return true; }
struct setupios{setupios(){cin.tie(0);ios::sync_with_stdio(0); /*cout<<fixed<<setprecision(20);*/};}setupios;
int main() {

  int ans=0,a,b,c,ax,bx,cx;cin>>a>>b>>c;
  if(a%2==0 and a==b and b==c){
    cout<<-1<<endl;
    return 0;
  }
  while(true){
    if(!(a%2==0 and b%2==0 and c%2==0)){
      cout<<ans<<endl;
      return 0;
    }
    ax=a/2;
    bx=b/2;
    cx=c/2;
    a=bx+cx;
    b=ax+cx;
    c=ax+bx;
    ans++;
  }

}


Measured memory_bytes: 256
/*
  AtCoder Beginner Contest 085
  B - Kagami Mochi
*/

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

int N;
vector<int> d;

int main() {
  scanf("%d", &N);

  int buf;
  int count = 0;
  for (int i = 0; i < N; ++i) {
    scanf("%d", &buf);
    if (find(d.begin(), d.end(), buf) == d.end()) {
      ++count;
      d.push_back(buf);
    }
  }

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

Measured memory_bytes: 256
#include<stdio.h>
int main(){
  int num[5],i,j,work;
  for(i =0;i <5;i++){
    scanf("%d", &num[i]);
  }
  for(i =0;i <5;i++){
    for(j =0;j <4;j++){
      if(num[j] < num[j+1]){
	work =num[j];
	num[j] =num[j+1];
	num[j+1] =work;
      }
    }
  }
  for(i =0;i <5;i++){
    printf("%d",num[i]);
    if(i !=4){
      printf(" ");
    }
  }
  printf("\n");
  return(0);
}

Measured memory_bytes: 600
#include <iostream>
#include <string>

using namespace std;

int main(){

  string a, b;
  cin >> a >> b;
  int dp[a.size() + 1][b.size() + 1];


  for(int i = 0; i <= a.length(); i++){
    dp[i][0] = i;
  }
  for(int i = 0; i <= b.length(); i++){
    dp[0][i] = i;
  }

  for(int i = 1; i <= a.length(); i++){
    for(int j = 1 ;j <= b.length(); j++){
      if(a[i-1] == b[j-1]){
        dp[i][j] = min(dp[i-1][j] + 1, min(dp[i][j-1] + 1, dp[i-1][j-1]));
      }
      else{
        dp[i][j] = min(dp[i-1][j] + 1, min(dp[i][j-1] + 1, dp[i-1][j-1] + 1));
      }
    }
  }

  cout << dp[a.length()][b.length()] << '\n';

  return 0;
}



Measured memory_bytes: 7052
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define pp pair<int,int>
#define ll long long
#define ld long double
int inf=100000000;
ll INF=5000000000000000000;
ll MOD=1000000007;


int main() {
    while (true){
    int n;
    cin >> n;
    if (n==0) break;
    vector<pp> a(n);
    int y,u,t;
    rep(i,n){
        cin >> t >> y >> u;
        a.at(i).first=y+u;
        a.at(i).second=t;
    }
    sort(a.begin(),a.end());
    reverse(a.begin(),a.end());
    cout << a.at(0).second << " " << a.at(0).first << endl;
}
}



Measured memory_bytes: 3172
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define FOR(i, s, e) for (int i = (int)(s); i <= (int)(e); i++)
#define printYesNo(is_ok) puts(is_ok ? "Yes" : "No");
#define SORT(v) sort(v.begin(), v.end());
#define RSORT(v) sort(v.rbegin(), v.rend());
#define REVERSE(v) reverse(v.begin(), v.end());

template <typename T>
void printlnVector(T v)
{
  rep(i, v.size())
  {
    cout << v[i] << endl;
  }
}

template <typename T>
void printVector(T v)
{
  rep(i, v.size())
  {
    cout << v[i] << " ";
  }
  cout << endl;
}

int main()
{
  int N;
  cin >> N;
  long long sum = 0;
  vector<long long> A(N), D1(N), D2(N);
  rep(i, N)
  {
    cin >> A[i];
    sum += A[i];
    D1[i] = A[i];
    D2[i] = A[i];
  }

  REVERSE(D2);
  rep(i, N - 1)
  {
    D1[i + 1] += D1[i];
    D2[i + 1] += D2[i];
  }

  long long harf = sum / 2;
  long long ans = INT64_MAX;

  rep(i, N)
  {
    if (sum % 2 == 0 && D1[i] == harf)
    {
      ans = 0;
      break;
    }
    else if (D1[i] > harf)
    {
      for (int length = -1; length < 2; length++)
      {
        long long target = harf + length;
        ans = min(ans, abs(D1[i] - target) + abs(sum - D1[i] - target));
      }
      break;
    }
  }

  rep(i, N)
  {
    if (D2[i] > harf)
    {
      for (int length = -1; length < 2; length++)
      {
        long long target = harf + length;
        ans = min(ans, abs(D2[i] - target) + abs(sum - D2[i] - target));
      }
      break;
    }
  }

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

Measured memory_bytes: 4992
#include<bits/stdc++.h>
using namespace std;
#define FAST ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
long long mx(long long a,long long b){if(a>b)return a;else return b;}
long long mn(long long a,long long b){if(a<b)return a;else return b;}
long long cei(long long a,long long b){if(a%b==0)return a/b;else return (a/b+1);}
const int MOD=1e9+7;
long long po(long long a,long long b){long long res=1;while(b>0){res=(res*a);res%=MOD;b--;}return res;}
int main()
{
int n;
cin>>n;
string a;
cin>>a;
int rcount=0;
int count=0;
vector<int>rindices;
for(int i=0;i<n;i++)
{
if(a[i]=='R'){rcount++;rindices.push_back(i);}
}
int j=rindices.size()-1;
int i=0;
rcount--;
while(i<n&&j>=0)
{
if(a[i]=='W'&&rindices[j]>rcount){count++;j--;}
i++;
}
if(rcount==-1||rcount==n)cout<<0<<endl;
else
cout<<count<<endl;
}

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

int main(){
  int wc, k, mid,len;
  char str[10];
  scanf("%s", str);
  
  len=strlen(str);
  // printf("%d\n",len);

  
  if(len%2==1){

    wc=len/2+1;
    
    mid=len/2;
    if(str[mid]=='w' || str[mid]=='i')wc--;
  
    for(k=0; k<mid; k++){
      
      if(str[k]==str[len-k-1] && str[k]!='(' && str[k]!=')')wc--;
      else if(str[k]=='(' && str[len-k-1]==')')wc--;
      else if(str[k]==')' && str[len-k-1]=='(')wc--;

    }

  }else{
    
    wc=len/2;
    
    mid=len/2;
    
    for(k=0; k<mid; k++){

      if(str[k]==str[len-k-1] && str[k]!='(' && str[k]!=')')wc--;
      else if(str[k]=='(' && str[len-k-1]==')')wc--;
      else if(str[k]==')' && str[len-k-1]=='(')wc--;
      
    }
  }
  printf("%d\n", wc);
  
  return 0;
}

Measured memory_bytes: 536
#include<bits/stdc++.h>
using namespace std;
#define rep(i,n); for(int i = 0;i < (int)(n);i++)
#define all(x) (x).begin(),(x).end()
typedef long long ll;
int main(){
    string s;
    cin >> s;
    ll sum = 0;
    ll n = s.size();
    rep(i,n)sum += s[i]-'0';
    if(sum%9==0)cout << "Yes" << endl;
    else cout << "No" << endl;
    //cout << sum << endl;
    return 0;
}

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

#define REP(i,n) for(int i=0;i<(int)(n);i++)
#define ALL(x) (x).begin(), (x).end()

using namespace std;

template <typename T> T &chmin(T &a, const T &b) {return a = min(a, b);}
template <typename T> T &chmax(T &a, const T &b) {return a = max(a, b);}

using ll = long long;
using ld = long double;

const int INF = 1e9;
const ld eps = 1e-9, pi = acos(-1.0);

int N;
using pii = pair<int, int>;
int num[100005];

int main(){
	cin >> N;
	vector<pii> req; 
	REP(cnt, N) {
		int a, b;
		cin >> a >> b;
		num[a]++; num[b+1]--;
	}
	num[0]++; num[100002]--;
	REP(i, N+2) num[i+1] += num[i];
	int res = 0;
	REP(i, N+2) if(num[i] >= i) res = max(res, i);
	cout << res-1 << endl;
	return 0;

}

Measured memory_bytes: 3500
#include <algorithm>
#include <bitset>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <fstream>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>

using namespace std;

typedef long long ll;
typedef pair<int,int> PP;

/*
 freopen("input","r",stdin);
 freopen("output","w",stdout);
*/

vector<vector<int>> G;
vector<set<int>> RG;
int R[100010];

int main() {
    ios::sync_with_stdio(false);
    cin.tie(NULL);
    int N, m;
    memset(R, 0, sizeof(R));
    cin >> N >> m;
    G.resize(N);
    RG.resize(N);
    for (int i = 0;i < m;i++) {
        int a, b;
        cin >> a >> b;
        a--;
        b--;
        G[b].push_back(a);
        RG[a].insert(b);
    }
    queue<int> M;
    for (int i = 0;i < N;i++) {
        if (RG[i].empty()) M.push(i);
    }
    int sol = 0;
    while (!M.empty()) {
        int a = M.front();
        sol = max(sol, R[a]);
        M.pop();
        for (const int b : G[a]) {
            R[b] = max(R[b], R[a] + 1);
            RG[b].erase(a);
            if (RG[b].empty()) M.push(b);
        }
    }
    cout << sol << endl;
    return 0;
}


Measured memory_bytes: 15616
#include <iostream>
using namespace std;
typedef long double ld;
typedef long long ll;
ll n,a[100000],ans=1;
int main(void){
    cin>>n;
    for(int i=0;i<n;i++){
        cin>>a[i];
        if(a[i]==0){
            cout<<0<<endl;
            return 0;
        }
    }
    for(int i=0;i<n;i++){
        if(ans>1000000000000000000/a[i]){
            cout<<-1<<endl;
            return 0;
        }
        ans*=a[i];
    }
    cout<<ans<<endl;
}


Measured memory_bytes: 4416
class UnionFind:
    def __init__(self, size):
        self.data = [-1] * size

    def find(self, x):
        if self.data[x] < 0:
            return x
        else:
            self.data[x] = self.find(self.data[x])
            return self.data[x]

    def union(self, x, y):
        x, y = self.find(x), self.find(y)
        if x != y:
            if self.data[y] < self.data[x]:
                x, y = y, x
            self.data[x] += self.data[y]
            self.data[y] = x
        return (x != y)

    def same(self, x, y):
        return (self.find(x) == self.find(y))

    def size(self, x):
        return -self.data[self.find(x)]


N, M = map(int, input().split())
uf = UnionFind(N + M + 1)
used = set()
for i in range(1, N + 1):
    K, *L = map(int, input().split())
    for l in L:
        uf.union(i, l + N)
        used.add(l)

if uf.size(1) - len(used) == N:
    print("YES")
else:
    print("NO")


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

using namespace std;
#define EPS (1e-7)
#define INF (1e9)


typedef long long  ll;
#define endl '\n'




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


const int MOD = 1000000007;
const long double PI = (acos(-1));
const int MAX = 1000001;
long long fac[MAX], finv[MAX], inv[MAX];

//////////////////////////////////////////


void COMinit() {
   fac[0] = fac[1] = 1;
   finv[0] = finv[1] = 1;
   inv[1] = 1;
   for (int i = 2; i < MAX; i++){
       fac[i] = fac[i - 1] * i % MOD;
       inv[i] = MOD - inv[MOD%i] * (MOD / i) % MOD;
       finv[i] = finv[i - 1] * inv[i] % MOD;
   }
}

long long  a, b;
void Input() {

    cin >> a >> b;
}



void Solve() {


    long long  g = __gcd(a, b);



    cout << (a*b) / g << endl;

}

int main() {

  cin.tie(0);
  ios::sync_with_stdio(false);
  Input();
  Solve();


  return 0;

}



Measured memory_bytes: 256
#include <bits/stdc++.h>
#define ll long long
#define ull unsigned ll
#define ld long double
#define pll pair<ll, ll>
#define pii pair<int, int>
#define f first
#define se second
#define pb push_back
#define ft fflush(stdout)
 
 
using namespace std;
 
 
const int N = 3e5 + 123;
const int PLS = 3e5 + 123;
const ll mod = 1e9 + 7;
const ll inf = 1e16;


ll n, m, blackdown[N], blackup[N], ans[N], blackdown1[N], blackup1[N], ans1[N], tto[N];
vector <ll> g[N], pmult[N], smult[N];


void dfs(ll u, ll p = -1) {
    blackdown[u] = blackdown1[u] = 1;
    for (int i = 0; i < g[u].size(); i++) {
        if (g[u][i] == p)
            continue;
        ll to = g[u][i];
        dfs(to, u);
        blackdown[u] = (blackdown[u] * (blackdown[to] + 1)) % m;
        pmult[u].pb(blackdown[u]);
        tto[to] = pmult[u].size() - 1;
        // blackdown1[u] = (blackdown1[u] * (blackdown1[to] + 1));
    }
    blackdown[u] = blackdown1[u] = 1;
    for (int i = g[u].size() - 1; i >= 0; i--) {
        if (g[u][i] == p)
            continue;
        ll to = g[u][i];
        blackdown[u] = (blackdown[u] * (blackdown[to] + 1)) % m;
        smult[u].pb(blackdown[u]);
        // blackdown1[u] = (blackdown1[u] * (blackdown1[to] + 1));
    }
    reverse(smult[u].begin(), smult[u].end());
}


ll get(ll u, ll to) {
    if (pmult[u].size() == 1)
        return 1;
    if (tto[to] == 0)
        return smult[u][1];
    if (tto[to] == pmult[u].size() - 1)
        return pmult[u][pmult[u].size() - 2];
    return (pmult[u][tto[to] - 1] * smult[u][tto[to] + 1]) % m;
}


void dfss(ll u, ll p=-1) {
    if (p != -1) {
        // blackup1[u] = (1 + blackup1[p] * ((blackdown1[p] / (blackdown1[u] + 1)) % m)) % m;
        // ans1[u] = (blackup1[u] * blackdown[u]) % m;
        blackup[u] = (1 + blackup[p] * get(p, u)) % m;
        ans[u] = (blackdown[u] * blackup[u]) % m;
        // cout << u << " " << blackdown[u] << " " << blackdown1[u] << " " << blackup[u] << " " << blackup1[u] << " " << m << endl;
    } else {
        // cout << blackdown[u] << endl;
        blackup1[u] = blackup[u] = 1;
        ans1[u] = ans[u] = blackdown[u];
    }
    for (int i = 0; i < g[u].size(); i++)
        if (g[u][i] != p)
            dfss(g[u][i], u);
}


int main() {
    ios_base::sync_with_stdio(NULL);
    cin.tie(NULL); cout.tie(NULL);
    cin >> n >> m;
    ll u, v;
    for (int i = 1; i < n; i++) {
        cin >> u >> v;
        g[u].pb(v);
        g[v].pb(u);
    }
    dfs(1);
    dfss(1);
    for (int i = 1; i <= n; i++)
        cout << ans[i] << "\n";
}

Measured memory_bytes: 52480
#include <bits/stdc++.h>
#include <atcoder/mincostflow.hpp>
using namespace std;
using namespace atcoder;
using ll = long long;

const int HW = 50;
string arr[HW];

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

	int h, w;
	cin >> h >> w;
	int n = h*w;

	mcf_graph<int, int> g(n+2);
	int s = n, t = n+1;

	int tot = 0;
	for (int y = 0; y < h; ++y) {
		cin >> arr[y];
		for (int x = 0; x < w; ++x) {
			int ind = x+y*w;
			if (arr[y][x] == 'o') {
				g.add_edge(s, ind, 1, x+y);
				++tot;
			}
			if (arr[y][x] != '#') {
				g.add_edge(ind, t, 1, h+w-(x+y));
			}
		}
	}

	for (int y = 0; y < h; ++y) {
		for (int x = 0; x < w; ++x) {
			if (arr[y][x] == '#') continue;

			int ind = x+y*w;
			if (x+1 < w && arr[y][x+1] != '#') {
				g.add_edge(ind, ind+1, tot, 0);
			}
			if (y+1 < h && arr[y+1][x] != '#') {
				g.add_edge(ind, ind+w, tot, 0);
			}
		}
	}
	auto res = g.flow(s, t);
	cout << -(res.second - tot*(h+w)) << '\n';
}


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

int main(){
    int n;
    cin>>n;
    vector<int> a(n);
    rep(i,n) cin>>a[i];
    sort(a.begin(),a.end());
    int sum=0;
    rep(i,n){
        for(int j=i+1;j<n;j++){
            for(int k=j+1;k<n;k++){
                if(a[k]<a[i]+a[j]) sum++;
            }
        }
    }
    cout<<sum<<endl;
    
    
    return 0;
}


Measured memory_bytes: 256
#include <stdio.h>

main(){
  int n, sum, i, temp;

  while(1){
    scanf("%d", &n);
    if(n==0) break;

    sum=0;

    for(i=0;i<n/4;i++){
      scanf("%d", &temp);
      sum+=temp;
    }

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

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

using namespace std;

#ifdef DEBUG_MODE
	#define DBG(n) n;
#else
	#define DBG(n) ;
#endif
#define REP(i,n) for(ll (i) = (0);(i) < (n);++i)
#define PB push_back
#define MP make_pair
#define FI first
#define SE second
#define SHOW1d(v,n) {for(int W = 0;W < (n);W++)cerr << v[W] << ' ';cerr << endl << endl;}
#define SHOW2d(v,i,j) {for(int aaa = 0;aaa < i;aaa++){for(int bbb = 0;bbb < j;bbb++)cerr << v[aaa][bbb] << ' ';cerr << endl;}cerr << endl;}
#define ALL(v) v.begin(),v.end()
#define Decimal fixed<<setprecision(20)
#define INF 1000000000
#define MOD 1000000007

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

string str;
int n;
ll ans;
unordered_map<string,ll> mp;

char A[31];

void dfs2(int a,int b){
	if(a + b == n){
		ans += mp[A];
		return;
	}
	int now = a + b;
	A[a] = str[2*n-now-1];
	dfs2(a+1,b);
	A[a] = '-';
	A[30-b] = str[2*n-now-1];
	dfs2(a,b+1);
	A[30-b] = '-';
}

void dfs(int a,int b){
	if(a + b == n){
		mp[A]++;
		return;
	}
	int now = a + b;
	A[a] = str[now];
	dfs(a+1,b);
	A[a] = '-';
	A[30-b] = str[now];
	dfs(a,b+1);
	A[30-b] = '-';
}


int main(){
	cin >> n >> str;
	REP(i,31)A[i] = '-';
	dfs(0,0);
	DBG(cout << "!!!" << endl;)
	REP(i,31)A[i] = '-';
	dfs2(0,0);
	cout << ans << endl;
	return 0;
}


Measured memory_bytes: 69492
import java.util.Arrays;
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		int[] b = new int [a];
		for(int i = 0;i<a;i++) {
			b[i] = sc.nextInt();
		}
		int[] c = b.clone();
		Arrays.sort(c);
		int ookii = c[a/2-1];
		int tiisai = c[a/2];
		for(int i=0;i<a;i++) {
			if(b[i]<=ookii) {
				System.out.println(tiisai);
			}else{
				System.out.println(ookii);
			}
		}
	}
}

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

int main()
{
	ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
    int k,n,mx=0,zb=0;
    cin >> k >> n;
    vector<int> v(n);
    for (int i=0;i<n;i++)
    {
        cin >> v[i];
        if(i>0)
            mx=max(mx,v[i]-v[i-1]);
    }
    mx=max(mx,k-v[n-1]+v[0]);
    cout << k-mx;
}


Measured memory_bytes: 1024
#abc 054 C
n,m = map(int, input().split()) #  N頂点 ,M辺
connect = [[] for i in range(n)]
for i in range(m):
    a,b = map(int, input().split())
    connect[a-1].append(b -1)
    connect[b -1].append(a -1)
#print(connect)
import itertools 

state = list(itertools.permutations(list(range(n)) ,n ))
def abc054c(i):#
    counter = 1
    if i[0] != 0:
        return 0
    for j,k  in enumerate(i):
        if j == n -1:
            pass
        elif i[j +1] in connect[k]:
            pass
        else:
            counter = 0
            break
    return counter
total = 0
for  i in state:
    total += abc054c(i)
    
print(total)    
    

Measured memory_bytes: 8052
#include<bits/stdc++.h>
using namespace std;
#define ll long long 
#define rep(i,n) for(int i=0;i<n;i++)
#define INF 999999999
const int mod = 1000000007;
ll cnt = 0;

int main (){
    ll a[5];
    ll mini=INF;
 for(int i=0;i<5;i++){
     cin >> a[i];
     if(a[i] % 10 != 0 ){
         mini = min(mini,a[i] % 10);
     }
 }

int ans =0;
for(int i=0;i<5;i++){
    if(a[i] % 10 != 0){
        ans+=( (a[i]+10)/10 )*10;
    }else{
        ans+=a[i];
    }
}
 if(mini == INF){
     mini = 0;
 }
if(mini != 0){
cout << ans-10+mini << endl;
return 0;
}
cout << ans << endl;
  


}

Measured memory_bytes: 256
N = int(input())
A = list(input().split())
B = list(input().split())
#print (N, '\n', A, '\n', B)

def Levonas(a,b):
    if a-b < 0:
        return (0,b-a,a)
    else:
        return (a-b, 0, b)

i = 0
j = N-1
su = 0

while i <= j:
    te1 = Levonas(int(A[i]), int(B[i]))
    A[i] = te1[0]
    B[i] = te1[1]
    su = su + te1[2]
    te2 = Levonas(int(A[i+1]), int(B[i]))
    A[i+1] = te2[0]
    B[i] = te2[1]
    su = su + te2[2]
    i = i+1
    #print(i)
    #print("     ", A)
    #print("     ", B)
    te3 = Levonas(int(A[j+1]), int(B[j]))
    A[j+1] = te3[0]
    B[j] = te3[1]
    su = su + te3[2]
    te4 = Levonas(int(A[j]), int(B[j]))
    A[j] = te4[0]
    B[j] = te4[1]
    su = su + te4[2]
    j = j - 1
    #print(j)
    #print("     ", A)
    #print("     ", B)
    
while i <= j:
    if int(A[i])-int(B[i]) < 0:
        B[i] = int(B[i])-int(A[i])
        su = su + int(A[i])
        A[i] = 0
        if int(A[i+1])-int(B[i]) < 0:
            B[i] = int(B[i])-int(A[i+1])
            su = su + int(A[i+1])
            A[i+1] = 0
        else:
            su = su + int(B[i])
            A[i+1] = int(A[i+1])-int(B[i])
            B[i] = 0
    else:
        su = su + int(B[i])
        B[i] = 0
    i = i+1
    print(B)
    if int(A[j+1])-int(B[j]) < 0:
        B[j] = int(B[j])-int(A[j+1])
        su = su + int(A[j+1])
        A[j]=0
        if int(A[j])-int(B[j]) < 0:
            B[j] = int(B[j])-int(A[j])
            su = su + int(A[j])
            A[j] = 0
        else:
            su = su + int(B[j])
            A[j] = int(A[j])-int(B[j])
            B[j] = 0
        
    else:
        su = su + int(B[j])
        B[j] = 0
    j = j-1
    print(B)

print(su)


Measured memory_bytes: 25216
#define _USE_MATH_DEFINES
#define _CRT_SECURE_NO_WARNINGS
#include <bits/stdc++.h>
using namespace std;

/*BigInteger
#include <boost/multiprecision/cpp_dec_float.hpp>
#include <boost/multiprecision/cpp_int.hpp>
#include <boost/rational.hpp>
namespace xxx = boost::multiprecision;
using Bint = xxx::cpp_int;
using Real = xxx::number<xxx::cpp_dec_float<1024>>;
*/

#define int long long
#define pb(x) push_back(x)
#define m0(x) memset((x), 0LL, sizeof(x))
#define mm(x) memset((x), -1LL, sizeof(x))

//container
#define ALL(x) (x).begin(), (x).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define EACH(i, c) for (typeof((c).begin()) i = (c).begin(); i != (c).end(); ++i)
#define EXIST(s, e) ((s).find(e) != (s).end())
#define UNIQUE(v) (v).erase(unique((v).begin(), (v).end()), (v).end());
#define PERM(c) \
  sort(ALL(c)); \
  for (bool c##p = 1; c##p; c##p = next_permutation(ALL(c)))

// debug
#define GET_VAR_NAME(variable) #variable
#define test(x) cout << GET_VAR_NAME(x) << " = " << x << endl;

// bit_macro
#define Bit(n) (1LL << (n))
#define Bitset(a, b) (a) |= (1LL << (b))
#define Bitunset(a, b) (a) &= ~(1LL << (b))
#define Bitcheck(a, b) ((((a) >> (b)) & 1LL) == 1LL)
#define Bitcount(a) __builtin_popcountll((a))

//typedef
typedef long long lint;
typedef unsigned long long ull;
typedef complex<long double> Complex;
typedef pair<int, int> P;
typedef tuple<int, int, int> TP;
typedef vector<int> vec;
typedef vector<vec> mat;

//constant
constexpr int INF = (int)1e18;
constexpr int MOD = (int)1e9 + 7;
constexpr double PI = (double)acos(-1);
constexpr double EPS = (double)1e-10;
constexpr int dx[] = {-1, 0, 0, 1, 0, -1, -1, 1, 1};
constexpr int dy[] = {0, -1, 1, 0, 0, 1, -1, 1, -1};

//
template <typename T>
void chmax(T &a, T b) { a = max(a, b); }
template <typename T>
void chmin(T &a, T b) { a = min(a, b); }
//
inline int toInt(string s) {
  int v;
  istringstream sin(s);
  sin >> v;
  return v;
}
template <class T>
inline string toString(T x) {
  ostringstream sout;
  sout << x;
  return sout.str();
}

//
struct Accelerate_Cin {
  Accelerate_Cin() {
    cin.tie(0);
    ios::sync_with_stdio(0);
    cout << fixed << setprecision(20);
  };
} Accelerate_Cin;

signed main() {
  int N, K;
  string s;
  cin >> N >> K >> s;
  for (int i = 0; i < N; i++) {
    if (i != K - 1) {
      cout << s[i];
    } else {
      int tmp = s[i] - 'A';
      cout << (char)('a' + tmp);
    }
  }

  cout << endl;
  return 0;
}


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

using namespace std;

const int ms = 90000 + 17;
pair<int, int> arr[ms];
int dp[ms];

int dist(int x, int y)
{
    return abs(arr[x].first - arr[y].first) + abs(arr[x].second - arr[y].second);
}

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

    int h, w, d;
    cin >> h >> w >> d;

    for(int i = 1; i <= h; ++i)
    {
        for(int j = 1; j <= w; ++j)
        {
            int x;
            cin >> x;

            arr[x] = make_pair(i, j);
        }
    }

    int q;
    cin >> q;

    for(int i = d; i <= h * w; ++i)
    {
        dp[i] = dp[i - d] + dist(i, i - d);
    }

    for(int i = 1; i <= q; ++i)
    {
        int l, r;
        cin >> l >> r;

        if(l == r)
            cout << 0 << '\n';
        else
        {
            cout << dp[r] - dp[l] << '\n';
        }
    }
}


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

// 総数を1000000007（素数）で割った余り
const long long mod = 1e9 + 7;

using ll = long long;
using pii  = pair<int, int>;
using pll = pair<ll, ll>;
#define ull unsigned long long
#define ld long double
#define vi vector<int>
#define vll vector<ll>
#define vc vector<char>
#define vs vector<string>
#define vpii vector<pii>
#define vpll vector<pll>

#define rep(i, n) for (int i = 0, i##_len = (n); i < i##_len; i++)
#define rep1(i, n) for (int i = 1, i##_len = (n); i <= i##_len; i++)
#define repr(i, n) for (int i = ((int)(n)-1); i >= 0; i--)
#define rep1r(i, n) for (int i = ((int)(n)); i >= 1; i--)

#define sz(x) ((int)(x).size())
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()

#define SORT(v, n) sort(v, v + n);
#define VSORT(v) sort(v.begin(), v.end());
#define RSORT(x) sort(rall(x));
#define pb push_back
#define mp make_pair

#define INF (1e9)
#define PI (acos(-1))
#define EPS (1e-7)

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

int main(){
    int n;
    cin >> n;
    vi a(n);
    rep(i, n) cin >> a[i];
    map<int, int> b;
    ll ans = 0;
    rep(i, n) {
        int wa = i + a[i];
        int sa = i - a[i];
        ans += b[sa];
        b[wa]++;
    }
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 21052
#include <iostream>
#include <string>
#include <queue>
#include <utility>
#include <algorithm>
#include <numeric>
#include <set>
#include <climits>
#include <map>

using namespace std;

long long a[200000];
int ind_a[200000];
int main(){
  int N;
  cin >> N;
  for(int i = 0; i < N; i++){
    cin >> a[i];
  }
  for(int i = 0; i < N; i++){
    ind_a[a[i] - 1] = i;
  }

  set <int> used_inds;
  long long ans = 0;
  for(int i = 0; i < N; i++){
    long long left_border;
    long long right_border;
    long long cur_ind = ind_a[i];
    auto left_it = used_inds.lower_bound(cur_ind);
    auto right_it = used_inds.lower_bound(cur_ind + 1);

    if(left_it == used_inds.begin()){
      left_border = -1;
    } else {
      if(left_it == used_inds.end() || *left_it > cur_ind){
        left_it --;
      }
      left_border = *left_it;
    }
    if(right_it == used_inds.end()){
      right_border = N;
    } else {
      right_border = *right_it;
    }
    ans += (cur_ind - left_border) * (right_border - cur_ind) * ((long long)i + 1);

    //cout << i << " " << left_border << " " << right_border << endl;
    //cout << ans << endl;

    used_inds.insert(cur_ind);
  }

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


Measured memory_bytes: 11904
#include<bits/stdc++.h>
using namespace std;
//define
#define int long long
#define rep(x,y) for(int i=x;i<y;i++)
#define REP(x,y) for(int j=x;j<y;j++)
#define all(x) x.begin(),x.end()
#define pb() push_back()
#define mod 100000007
#define elif else if
#define str string
//main
signed main(){
  int N,M,O,P,Q,count=0,count2=0,count3=0;
  double D=0;
  int c='A'-'a';
  //char C;
  str S,T;
  cin>>N>>M;
  while(N<=M){
    count++;
    N*=2;
  }
  cout<<count<<endl;
}


Measured memory_bytes: 256
#include <cstdio>
#include <iostream>
#include <cmath>
#include <cstring>
#include <sstream>
#include <algorithm>
#include <cstdlib>
#include <map>
#include <queue>
#include <utility>
#include <vector>
#include <set>
#include <memory.h>
#include <iomanip>
#include <bitset>
#include <list>
#include <stack>
#include <deque>

using namespace std;

#define mod 1000000007

#define INIT 2 * (long long int)pow(10, 12)

int main()
{
	int n, m;
	cin >> n >> m;
	vector<pair<pair<int, int>, long long int> > edge;
	for(int i = 0; i < m; i++){
		int a, b;
		long long int c;
		cin >> a >> b >> c;
		edge.push_back(make_pair(make_pair(a, b), -c));
	}
	vector<long long int> distance(n + 1, INIT);
	distance[1] = 0;
	for(int i = 0; i < n - 1; i++){
		for(int j = 0; j < m; j++){
			int a = (edge[j].first).first;
			int b = (edge[j].first).second;
			long long int c = edge[j].second;
			if(distance[b] > distance[a] + c){
				distance[b] = distance[a] + c;
			}
		}
	}
	vector<bool> negative(n + 1, false);
	for(int i = 0; i < m; i++){
		int a = (edge[i].first).first;
		int b = (edge[i].first).second;
		long long int c = edge[i].second;
		if(distance[b] > distance[a] + c) negative[b] = true;
		if(negative[a]) negative[b] = true;
	}
	if(negative[n]) cout << "inf" << endl;
	else cout << -distance[n] << endl;
	return 0;
	return 0;
}

Measured memory_bytes: 256
# D - Blue and Red Balls

# 青いボールを並べる→赤いボールを青いボールの間に挿入する→残りの赤いボールを両端に置く

N, K = map(int, input().split())
MOD = 10**9 + 7

# nCkを漸化式で求め、メモしておく
combinations_table = [[0]*(N+1) for _ in range(N+1)]
for idx in range(N+1):
    combinations_table[0][idx] = 1
    combinations_table[idx][0] = 1
    combinations_table[idx][1] = idx
for n in range(2, N+1):
    for k in range(2, n+1):
        combinations_table[n][k] = combinations_table[n-1][k-1] + combinations_table[n-1][k]

# 連続した同色のボールの数nと、それらを何分割するか示すaを与えると、分割のパターン数を返す関数
def separate_balls(n,a):
    return combinations_table[n-1][a-1]

ans_list = []
for n_separate in range(1,K+1):
    if N-K < n_separate-1: # 赤いボール不足でi分割不可
        ans_list.append(0)
    elif n_separate == 1:
        ans_list.append(N-K+1)
    else:
        tmp_blue = separate_balls(K, n_separate) % MOD  # K個の青いボールをi分割するパターン数
        tmp_red = 0
        for n_red_ball in range(n_separate-1, N-K+1): # 青いボールの分割に使う赤いボールの個数
            tmp_red_inner = separate_balls(n_red_ball, n_separate-1)  # j個の赤いボールをi-1分割して青いボールの隙間に入れるパターン数
            tmp_red_side = N-K-n_red_ball+1 # N-K-j個の赤いボールを両端に置くパターン数
            tmp_red += (tmp_red_inner * tmp_red_side) % MOD
        ans_list.append((tmp_blue * tmp_red) % MOD)  # 青いボールの置き方*赤いボールの置き方

for x in ans_list:
    print(x)


Measured memory_bytes: 356560
#include <iostream>
#include <sstream>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <algorithm>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cctype>
#include <cmath>
#include <tuple>
#include <cassert>

using namespace std;

#define all(c) (c).begin(), (c).end()
#define iter(c) __typeof((c).begin())
#define cpresent(c, e) (find(all(c), (e)) != (c).end())
#define tr(c, i) for (iter(c) i = (c).begin(); i != (c).end(); ++i)
#define pb(e) push_back(e)
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define rep(i,n)   FOR(i,0,n)
#define mp(a,b) make_pair((a), (b))
#define mt(a,b,c) make_tuple((a),(b),(c))

typedef long long ll;

int main(){
    string s; cin >> s;
    vector<int> v(256);
    rep(i,256) v[i] = 0;
    rep(i,4) v[s[i]]++;
    int c=0;
    rep(i,256) if(v[i]==2) c++;
    if(c==2) cout << "Yes" << endl;
    else cout << "No" << endl;
    return 0;
}

Measured memory_bytes: 256
/*
    アリナ・グレイはかわいい
*/

#include<bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int,int>;
#define itn int
#define endl "\n"

int main(void){
    int h,w,k;
    cin >> h >> w >> k;
    string s[1004];
    int mn = 1LL<<30;
    
    for(int i = 0;i < h;i++)cin >> s[i];
    
    for(int i = 0;i < (1 << (h-1));i++){
        int sum = 0,a[h];
        for(int j = 0;j < h;j++){
            a[j] = sum;
            if(i & (1 << j))sum++;
        }
        sum++;
        int num = sum-1,b[h];
        
        for(int p = 0;p < h;p++)b[p] = 0;
        for(int p = 0;p < w;p++){
            for(int q = 0;q < h;q++){
                b[a[q]] += (s[q][p]-'0');
            }
            for(int q = 0;q < sum;q++){
                if(b[q] > k){
                    num++;
                    for(int l = 0;l < sum;l++)b[l] = 0;
                    for(int l = 0;l < h;l++)b[a[l]] += (s[l][p]-'0');
                    break;
                }
            }
            for(int l = 0;l < sum;l++)if(b[l] > k)num = 1LL<<30;
        }
        mn = min(mn,num);
    }
    cout << mn << endl;
}


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

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

  map<string, int> mp;

  for (int i = 0; i < n; i++) {
    string s;
    cin >> s;
    mp[s]++;
  }

  int mx = 0;

  for (const auto& e : mp) {
    mx = max(mx, e.second);
  }

  for (const auto& e : mp) {
    if (e.second == mx) {
      cout << e.first << endl;
    }
  }
}


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

using namespace std;

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

	vector<string> titleList;
	vector<int> lengthList;
	for (int i = 0; i < n; i++) {
		string title;
		int length;
		cin >> title >> length;
		titleList.push_back(title);
		lengthList.push_back(length);
	}
	string lastTitle;
	cin >> lastTitle;

	int total = -1;
	for (int i = 0; i < n; i++) {
		if (total >= 0) {
			total += lengthList[i];
		}
		else if(titleList[i] == lastTitle){
			total = 0;
		}
	}
	cout << total << endl;

	return 0;
}

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

int main(){
    int n;cin >> n;
    double jpy = 0,btc = 0;
    rep(i,n){
        double x;cin >> x;
        string u; cin >> u;
        if(u == "JPY")jpy += x;
        else btc += x;
    }
    btc *= 380000.0;
    double ans = jpy + btc;
    printf("%.6f\n",ans);
    return 0;
}

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

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n;cin>>n;
    int t[100005][3];
    for(int i=0;i<n;i++)cin>>t[i][0]>>t[i][1]>>t[i][2];
    int d[2][3];
    rep(i,2)rep(j,3)d[i][j]=0;
    d[0][0]=d[0][1]=d[0][2]=0;
    for(int i=0;i<n;i++)for(int j=0;j<3;j++)for(int k=0;k<3;k++){
        if(j!=k)d[(i+1)&1][k]=max(d[(i+1)&1][k],d[i&1][j]+t[i][k]);
    }
    int res=0;
    for(int i=0;i<3;i++) res=max(res,d[n&1][i]);
    cout<<res<<endl;
    return 0;
}


Measured memory_bytes: 1408
package main

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

func main() {
	io := newIo()
	defer io.Flush()
	N := io.NextInt()
	A := make([]int, N)
	sum := 0
	powSum := 0
	for i := range A {
		A[i] = io.NextInt()
		sum += A[i]
		powSum += int(math.Pow(float64(A[i]), float64(2)))
	}
	average := int(math.Floor(float64(sum)/float64(N) + 0.5))
	result := int(math.Pow(float64(average), float64(2)))*N - (2 * sum * average) + powSum
	fmt.Println(result)
}

type io struct {
	reader    *bufio.Reader
	writer    *bufio.Writer
	tokens    []string
	nextToken int
}

func newIo() *io {
	return &io{
		reader: bufio.NewReader(os.Stdin),
		writer: bufio.NewWriter(os.Stdout),
	}
}

func (io *io) Flush() {
	err := io.writer.Flush()
	if err != nil {
		panic(err)
	}
}

func (io *io) NextLine() string {
	var buffer []byte
	for {
		line, isPrefix, err := io.reader.ReadLine()
		if err != nil {
			panic(err)
		}
		buffer = append(buffer, line...)
		if !isPrefix {
			break
		}
	}
	return string(buffer)
}

func (io *io) Next() string {
	for io.nextToken >= len(io.tokens) {
		line := io.NextLine()
		io.tokens = strings.Fields(line)
		io.nextToken = 0
	}
	r := io.tokens[io.nextToken]
	io.nextToken++
	return r
}

func (io *io) NextInt() int {
	i, err := strconv.Atoi(io.Next())
	if err != nil {
		panic(err)
	}
	return i
}

func (io *io) NextFloat() float64 {
	i, err := strconv.ParseFloat(io.Next(), 64)
	if err != nil {
		panic(err)
	}
	return i
}

func (io *io) PrintLn(a ...interface{}) {
	fmt.Fprintln(io.writer, a...)
}

func (io *io) Printf(format string, a ...interface{}) {
	fmt.Fprintf(io.writer, format, a...)
}

func (io *io) PrintIntLn(a []int) {
	b := []interface{}{}
	for _, x := range a {
		b = append(b, x)
	}
	io.PrintLn(b...)
}

func (io *io) PrintStringLn(a []string) {
	b := []interface{}{}
	for _, x := range a {
		b = append(b, x)
	}
	io.PrintLn(b...)
}

func log(name string, value interface{}) {
	fmt.Fprintf(os.Stderr, "%s=%+v\n", name, value)
}


Measured memory_bytes: 640
package main

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

const MaxBuf = 200100
var buf []byte
var sc = bufio.NewScanner(os.Stdin)

func init() {
   sc.Split(bufio.ScanWords)
   sc.Buffer(buf,MaxBuf)
}

func readString() string {
   sc.Scan()
   return sc.Text()
}

func readInt64() int64 {
   sc.Scan()
   r,_ := strconv.ParseInt(sc.Text(),10,64)
   return r
}

func readInt() int {
   sc.Scan()
   r,_ := strconv.Atoi(sc.Text())
   return r
}

func main() {
	n := readInt()
	k := readInt()
	q := readInt()
	l := make([]int,n)
	for i := 0; i < q ; i++ {
		l[readInt()-1]++
	}

	ans := make([]byte,0)
	yes := "Yes\n"
	no := "No\n"
	for _,v := range l {
		if k - q + v > 0 {
			ans = append(ans,yes...)
		} else {
			ans = append(ans,no...)
		}
	}
	fmt.Print(string(ans))
}

Measured memory_bytes: 5632
import java.util.*;
 
public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int a = Integer.parseInt(sc.next());
        int b = Integer.parseInt(sc.next());
        System.out.println(max(a+b, max(a-b, a*b)));
    }
    public static int max(int x, int y) {
        if(x >= y) return x;
        else return y;
    }
}

Measured memory_bytes: 23892
#include <stdint.h>
#include <stdio.h>
#define BUF_SIZE 256

#define UTIL_SWAP(x, y)                                                                                                                    \
  do {                                                                                                                                     \
    typeof(x) _a = x;                                                                                                                      \
    x = y;                                                                                                                                 \
    y = _a;                                                                                                                                \
  } while (0)

uint32_t selection_sort(int32_t buf[], size_t size)
{
  uint32_t count = 0;

  uint32_t i;
  for (i = 0; i < size; i++) {
    uint32_t min_idx = i;
    uint32_t j;
    for (j = i + 1; j < size; j++) {
      if (buf[j] < buf[min_idx]) {
        min_idx = j;
      }
    }

    if (i != min_idx) {
      UTIL_SWAP(buf[i], buf[min_idx]);
      count++;
    }
  }

  return count;
}
#define UTIL_PRINT_ARRAY(arr, size)                                                                                                        \
  do {                                                                                                                                     \
    uint16_t i;                                                                                                                            \
    for (i = 0; i < size; i++) {                                                                                                           \
      if (i != 0) printf(" ");                                                                                                             \
      printf("%d", arr[i]);                                                                                                                \
    }                                                                                                                                      \
    printf("\n");                                                                                                                          \
  } while (0)

#if !defined(TEST)
int32_t main(void)
{
  int32_t num;
  scanf("%d", &num);
  int32_t buf[BUF_SIZE];
  uint32_t i;
  for (i = 0; i < num; i++) {
    scanf("%d", &buf[i]);
  }

  uint32_t count = selection_sort(buf, num);

  UTIL_PRINT_ARRAY(buf, num);
  printf("%d\n", count);

  return 0;
}
#endif

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

int main(){
    string b; cin >> b;

    if (b == "A") {
        cout << "T";
    } else if (b=="C") {
        cout << "G";
    } else if (b=="G"){
        cout << "C";
    } else {
        cout << "A";
    }

    return 0;
}

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

#define endl '\n'

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

    int x, y, z;
    cin >> x >> y >> z;
    int res = 0;
    x -= z;
    while(true) {
        x -= y;
        x -= z;
        if(x < 0) break;
        res++;
    }
    cout << res;

    return 0;
}

Measured memory_bytes: 256
#include <map>
#include <set>
#include <iostream> 
#include <queue>
#include <memory.h>
#include <math.h>
#include <string>
#include <algorithm>
using namespace std;

const int mod = 1e9 + 7;

const int N = 105;
const int M = 4e4 + 5;

int dp[N][2][M];

int add(int x, int y) {
	int ret = (x + y);
	if (ret < 0) {
		ret += mod;
	}
	if (ret >= mod) {
		ret -= mod;
	}
	return ret;
}
int mul(int x, int y) {
	return (long long)x*y%mod;
}

int cc[M];

void solve() {
	int n, k;
	scanf("%d %d", &n, &k);
	int SQ = sqrt(n);
	while ((SQ + 1)*(SQ + 1) <= n) ++SQ;
	for (int i = 1; i <= SQ; ++i) {
		++dp[1][0][i];
	}
	for (int st = SQ + 1; st <= n;) {
		int l = st, r = n, mid;
		int v = n / st;
		while (l < r) {
			mid = (l + r + 1) / 2;
			if (n / mid != v) {
				r = mid - 1;
			}
			else {
				l = mid;
			}
		}
		dp[1][1][v] = l - st + 1;
		cc[v] = l - st + 1;
		st = l + 1;
	}
	int tmp1[M], tmp2[M];
	int maxi = n / (SQ + 1);
	for (int ind = 2; ind <= k; ++ind) {
		//만약 bit == 0 이라면 우선적으로 1부터 SQ까지 모든 값이 똑같이 더해지게 된다. 
		//bit==0 이라면 bit==1 에 대해서는 상태 dp[ind][1][x]에 dp[ind-1][0][x]의 값이 더해지게 된다.
		//만약 bit==1 이라면 사실 dp[ind][0][y] (1<=y<=x)까지 모두 dp[ind-1][1][x]의 값이 더해지게 된다.
		int sum = 0;
		memset(tmp1, 0, sizeof(tmp1));
		memset(tmp2, 0, sizeof(tmp2));

		for (int x = 1; x <= SQ; ++x) {
			sum = add(sum, dp[ind - 1][0][x]);
			tmp2[maxi] = add(tmp2[maxi], dp[ind - 1][0][x]);
			tmp2[x -1] = add(tmp2[x-1], -dp[ind - 1][0][x]);
		}
		tmp1[0] = sum;
		for (int x = 1; x <= SQ; ++x) {
			tmp1[0] = add(tmp1[0], dp[ind - 1][1][x]);
			tmp1[x + 1] = add(tmp1[x + 1], -dp[ind - 1][1][x]);
		}
		for (int x = 1; x <= SQ; ++x) {
			tmp1[x] = add(tmp1[x], tmp1[x - 1]);
			dp[ind][0][x] = tmp1[x];
		}

		for (int x = maxi; x >= 1; --x) {
			tmp2[x] = add(tmp2[x], tmp2[x + 1]);
			dp[ind][1][x] = mul(tmp2[x], cc[x]);
		}
	}
	int ret = 0;
	for (int x = 1; x <= SQ; ++x) {
		ret = add(ret, dp[k][1][x]);
		ret = add(ret, dp[k][0][x]);
	}
	printf("%d\n", ret);
}
int main() {
	//freopen("input.txt", "r", stdin);
	solve();
}

Measured memory_bytes: 32640
// Created by ahmed_drawy on 11/09/19.
///dp educational contest atcoder
#include <bits/stdc++.h>
#include <string.h>
#pragma clang diagnostic push
#pragma ide diagnostic ignored "OCUnusedMacroInspection"
using namespace std;
#define lp(i,start , end)       for(int i = start ; i<end ; ++i)
#define lllp(i,start , end)       for(ll i = start ; i<end ; ++i)
#define inN(arr ,  n) for(int i = 0 ; i< n ; ++i)  cin>>arr[i];
#define Rlp(i,start , end)      for(int i = start ; i>end ; --i)
#define all(v)                   ((v).begin(),(v).end())
#define sz(v)                  (int)((v).size())
#define clr(v,d)                memset(v , d , sizeof(v))
#define inf 0x3f3f3f3f
//#define dbg (v)    for(auto it : v)cout<<it<<' ';
typedef long long               ll;
typedef vector<int>             vi;
typedef vector  <ll>            vll;
typedef vector<vector<int> >    adj;
typedef pair<int ,int>          pii;
const double EPS =1e-7;
const int OO = 1e6;
#define endl '\n'
#define cint(c) (int)c -'0';
#define itc(c) (char)c +'A';
bool sortpair( const pair<int , int> & x, const pair<int , int> & y){
    return  x.first != y.first ? x.first < y.first : x.second > y.second ;
}
int dcomp(double x , double y){
    return fabs(x-y) <= EPS? 0: x>y?1:-1;
}

void smile() {
    ios_base::sync_with_stdio(0); cin.tie(NULL); cout.tie(NULL);
#ifndef ONLINE_JUDGE
  //  freopen("/home/tw3/Desktop/Desktop/training/in.txt", "r", stdin);
//    freopen("/home/tw3/Desktop/Desktop/training/out.txt" , "w" , stdout);
#endif
}
#define fastin smile()

int n , m;
const int N = 1e5 +3;
vector<int>g[N];
int dp[N];
int solve(int node ){
    if(node == n)return 0;
    int &ret = dp[node];
    if(~ret)
        return ret;
    ret =0 ;
    for(auto it : g[node]){
        ret = max(ret , 1+ solve(it));
    }

    return ret;



}
//bool visited[5005];
int parent[N] ;
int cnt =0, mx = 0 ;
void dfs(int x ) {

    parent[x] = 1;

    for (auto it : g[x]) {
        auto v = it;
       if (parent[v] == 0 || parent[v] == 2) {
           cnt++;
            dfs(v);
//            cnt++;
        }
    }
    parent[x] = 2; ///finished and no cycle
    mx = max(cnt , mx);
    cnt--;
}
int main() {
    fastin;
    cin >> n >> m;
    lp(i,0,m){
        int x , y ;cin >> x>>y;
        --x, --y;
        g[x].push_back(y);
    }
    clr(dp , -1);
    int ans = 0 ;
    for (int j = 0; j < n; ++j) {
        if(dp[j] ==-1)
            ans = max(ans , solve(j));
    }
    cout <<ans;

}

Measured memory_bytes: 7552
// " --- IN THE NAME OF ALLAH --- " // ;)
// -------------------------------- // ;)

#include <bits/stdc++.h>
#include <iostream>
#include <algorithm>
#include <iomanip>
#include <string>
#include <vector>
#include <queue>
#include <deque>
#include <set>
#include <map>
#include <math.h>
#include <cmath>
#include <list>
#include <stack>
#include <bitset>
using namespace std;

typedef pair <long long int, long long int> pii;
typedef long double ld;
typedef long long int lli;
#define recout(x) return cout << (x), 0
#define re(x) return(x)
#define _f first
#define _s second
#define fast ios::sync_with_stdio(false), cin.tie(0), cout.tie(0)
#define stp(x) cout << setprecision(x) << fixed; 
const lli N = 1e6, N2 =  5e3 + 10, mod = 1e9 + 7, inf = 1e10;
const ld PI = 3.1415926535897932;
lli a[N], dp[N];
bool mark[N], vis[N];
//ld dou[N];
//vector <lli> v[N];
//queue <lli> q[N];
pii p[N];
//lli val[N];
//pair <ld, pii> p_3[N];
//string s[N];
//set <lli> s[N];
//char c[N];

int main() {
	fast;
	lli n, sum = 0;
	cin >> n;
	for (lli i = 0; i < n; i++) {
		lli a, b;
		cin >> a >> b;
		dp[i] = a + b;
		sum += b;
	}
	sum = -sum;
	sort (dp, dp + n, greater<lli>());
	for (lli i = 0; i < n; i += 2) {
		sum += dp[i];
	}
	recout(sum);
}


Measured memory_bytes: 2304
#include <bits/stdc++.h>
#define rep(i,x) for(int i=0; i<(int) (x); i++)
using namespace std;

int main()
{
	int n;
	cin >> n;
	int a[205];
	rep(i,n)
		cin >> a[i];

	int j = 0;
	bool end = false;
	while (true)
	{
		rep(i,n)
		{
			if(a[i]%2 != 0)
				end = true;
		}
		if(end)
			break;
		rep(i, n)
			a[i] /= 2;
		j++;
	}
	cout << j;
	return 0;
}

Measured memory_bytes: 256