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

//#define int long long
#define reps(i,s,n) for(int (i)=(s);(i)<(n);++(i))
#define rep(i,n) reps(i,0,n)
#define rept(i,n) rep(i,(n)+1)
#define repst(i,s,n) reps(i,s,(n)+1)
#define reprt(i,n,t) for(int (i)=(n);(i)>=(t);--(i))
#define repr(i,n) reprt(i,n,0)
#define each(itr,v) for(auto &(itr):(v))
#define all(c) (c).begin(),(c).end()
#define rall(c) (c).rbegin(),(c).rend()
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define tmax(x,y,z) max(x,max(y,z))
#define tmin(x,y,z) min(x,min(y,z))
#define chmin(x,y) x=min(x,y)
#define chmax(x,y) x=max(x,y)
#define ln '\n'
#define bln(i,n) (((i)==(n)-1)?'\n':' ')
#define dbg(x) cout<<#x" = "<<(x)<<ln<<flush
#define dbga(x,n) {cout<<#x" : ";for(int (i)=0;i<(n);++i){cout<<((x)[i])<<(i==((n)-1)?'\n':' ')<<flush;}}
#define zero(a) memset(a,0,sizeof(a))
#define unq(a) sort(all(a)),a.erase(unique(all(a)),a.end())

typedef long double ld;
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<string> vst;
typedef vector<bool> vb;
typedef vector<ld> vld;
typedef vector<pii> vpii;
typedef vector<pll> vpll;
typedef vector<vector<int> > mat;

const ll inf = (ll)1e9+10;
const ll linf = (ll)1e18+10;
const ll mod = (ll)(1e9+7);
const double eps = 1e-10;

ll mop(ll a,ll b) {ll res=1;a%=mod; assert(b>=0); 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;}
ll lcm(ll a,ll b) {return a*b/gcd(a,b);}

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

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

int n, m, p, x, y, b[10][10][10];
vi dx, dy, dz;
int sz;

int rec(int x, int y, int z, int c, int d) {
	int xx = x + dx[d], yy = y + dy[d], zz = z + dz[d];
	if (xx<0 || n<xx || yy<0 || n<yy || zz<0 || n<zz) return c;
	if (b[xx][yy][zz]==b[x][y][z]) return rec(xx,yy,zz,c+1,d);
	else return c;
}

bool fin() {
	rep(i,n) rep(j,n) rep(k,n)
		rep(d,sz) if (b[i][j][k]!=0 && rec(i,j,k,1,d)>=m) return 1;
	return 0;
}

signed main() {
	repst(i,-1,1) repst(j,-1,1) repst(k,-1,1) if (!(i==0 && j==0 && k==0))
		dx.pb(i), dy.pb(j), dz.pb(k);
	sz = dx.size();
	while (1) {
		cin >> n >> m >> p;
		zero(b);
		if (n==0) break;
		int wt = -1;
		rep(i,p) {
			cin >> x >> y;
			x--, y--;
			int h = 0;
			while (b[x][y][h]!=0) h++;
			// 先行白1 後攻黒-1
			b[x][y][h] = (i%2==0 ? 1 : -1);
			if (wt==-1 && fin()) wt = i;
		}
		if (wt==-1) cout << "Draw" << ln;
		else cout << (wt%2 ? "White" : "Black") << ' ' << wt+1 << ln;
	}
}


Measured memory_bytes: 3104
#include <bits/stdc++.h>
#define PI 3.14159265359
#define NIL (-1)
#define LL long long
using namespace std;
const int64_t MOD = 1e9 + 7;
const int INF = INT_MAX;

int main() {
	int W, H, x, y;
	cin >> W >> H >> x >> y;

	double ret = (double)W * H / 2.0;
	bool b = false;
	double h, w;
	h = H / 2.0;
	w = W / 2.0;

	if (((double)y == h) && ((double)x == w)) b = true;

	cout << fixed << setprecision(10) << ret << ' ';
	cout << b << endl;
}

Measured memory_bytes: 3728
#include <iostream>
#include <set>
#include <queue>
#include <vector>
#include <algorithm>
#include <math.h>
#include <cmath>
#include <string>
#include <cstring>
#include <climits>
#include <sstream>
#include <iomanip>
#include <map>
#include <stack>
#include <tuple>
#include <numeric>
#include <assert.h>
#include <functional>
#include <unordered_map>

using namespace std;

/*-----------------------------------------------------------------------------
　定義
 -------------------------------------------------------------------------------*/
#define REP(i, n)				for (int (i) = 0 ; (i) < (int)(n) ; ++(i))
#define REPN(i, m, n)			for (int (i) = m ; (i) < (int)(n) ; ++(i))
#define INF						2e9
#define MOD						(1000 * 1000 * 1000 + 7)
#define Ceil(x, n)				(((((x))+((n)-1))/n))		/* Nの倍数に切り上げ割り算 */
#define CeilN(x, n)				(((((x))+((n)-1))/n)*n)		/* Nの倍数に切り上げ */
#define FloorN(x, n)			((x)-(x)%(n))				/* Nの倍数に切り下げ */
#define IsOdd(x)				(((x)&0x01UL) == 0x01UL)			
#define IsEven(x)				(!IsOdd((x)))						
#define ArrayLength(x)			(sizeof( x ) / sizeof( x[ 0 ]))
#define	MAX_QWORD				((QWORD)0xFFFFFFFFFFFFFFFF)
#define M_PI					3.14159265358979323846
typedef long long				ll;
typedef unsigned long long int	QWORD;
typedef pair<ll, ll>			P;

/*-----------------------------------------------------------------------------
　処理
 -------------------------------------------------------------------------------*/
/* 素数判定 */
bool isPrime(ll p) 
{
	for (ll i = 2; i <= sqrt(p); i++) if (p % i == 0) return false;
	return p > 1;
}

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

	vector<int> ans;
	REP(i, 55555) {
		if (i % 5 == 1) {
			if (isPrime(i)) {
				ans.emplace_back(i);
			}
		}
	}
	REP(i, N) {
		cout << ans[i] << " ";
	}
	cout << endl;
	return 0;
}



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

using namespace std;

#define N 600000
#define INF 0x3f3f3f3f

int n,m,x,y,z,tot,f[N],head[N];
struct edge{int v,l,nxt;}e[N];

void add(int x,int y,int z){e[++tot].v=y; e[tot].l=z; e[tot].nxt=head[x]; head[x]=tot;}

void dfs(int u){
	for (int i=head[u],v;i;i=e[i].nxt)
		if (f[v=e[i].v]==INF){
			f[v]=f[u]+e[i].l;
			dfs(v);
		}
		else
			if (f[v]!=f[u]+e[i].l){puts("No"); exit(0);}
}

int main(){
	scanf("%d%d",&n,&m);
	memset(f,0x3f,sizeof f);
	while (m--){
		scanf("%d%d%d",&x,&y,&z);
		add(x,y,z); add(y,x,-z);
	}
	for (int i=1;i<=n;++i)
		if (f[i]==INF){f[i]=0; dfs(i);}
	puts("Yes");
	
	return 0;
}
			

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

typedef double du ;
typedef string st ;
typedef long long ll ;
typedef long double ld ;
typedef long long int lli ;

#define vi vector <lli>
#define loop(num) for (lli i = 0 ; i < num ; i ++ )
#define loopcin(num , ar ) for (lli i = 0 ; i < num ; i ++ ) {cin >> ar [i] ;}
#define loopcout(num , ar) for (lli i = 0 ; i < num ; i ++ ) {cout << ar [i] << ' '; }

#define forr(num1 , num2) for (lli i = num1 ; i < num2 ; i ++ )
#define forrcin(num1 , num2 , ar ) for (lli i = num1 ; i < num2 ; i ++ ) {cin >> ar [i] ;}
#define forrcout(num1 , num2 , ar) for (lli i = num1 ; i < num2 ; i ++ ) {cout << ar [i] << ' '; }

#define D2forrcin(num1_1 , num1_2 , num2_1 , num2_2 , A ) for (lli i = num1_1 ; i < num1_2 ; i ++){ for (lli j = num2_1 ; j < num2_2 ; j++){cin >> A[i][j] ;}}
#define D2forrcout(num1_1 , num1_2 , num2_1 , num2_2 , A ) for (lli i = num1_1 ; i < num1_2 ; i ++){ for (lli j = num2_1 ; j < num2_2 ; j++){cout << A[i][j] << ' ' ;}cout << endl ;}

#define YES cout << "YES" << endl
#define Yes cout << "Yes" << endl
#define NO cout << "NO" << endl
#define No cout << "No" << endl

#define F first
#define S second

#define fastio ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);

int main ()
{
    fastio
    st s ; bool t = true ;
    cin >> s ;
    forr(1 , 4)
        if (s[i] == s[i - 1])
            t = false ;
    cout << (t ? "Good" : "Bad" ) ;
    return 0 ;
}

/*___________________________________________________________________functions___________________________________________________________________________*/



Measured memory_bytes: 256
#include<iostream>
using namespace std;
#define REP(i, b, e) for ( int i = b; i < e; i++ )
#define rep(i, n) REP(i, 0, n)
#define MAX 1001

main(){
  unsigned int H, W, T[MAX][MAX][3], q, i1, j1, i2, j2;
  char ch;
  cin >> H >> W >> q;

  rep(i, H+1) rep(j, W+1) rep(k, 3) T[i][j][k] = 0;

  REP(i, 1, H+1) REP(j, 1, W+1){
      cin >> ch;
      if ( ch == 'J' ) T[i][j][0]++;
      if ( ch == 'O' ) T[i][j][1]++;
      if ( ch == 'I' ) T[i][j][2]++;
  }

  REP(i, 1, H+1) REP(j, 1, W+1) rep (k, 3) T[i][j][k] += T[i][j-1][k];
  REP(i, 1, H+1) REP(j, 1, W+1) rep (k, 3) T[i][j][k] += T[i-1][j][k];
  rep(i, q){
   cin >> i1 >> j1 >> i2 >> j2;
   rep(k, 3){
      if ( k ) cout << " ";
      cout << T[i2][j2][k] - T[i2][j1-1][k] - T[i1-1][j2][k] + T[i1-1][j1-1][k];
    }
    cout << endl;
  }
}

Measured memory_bytes: 12000
package main

import (
  "fmt"
)

func main()  {
  var (
    n int
    ans int
  )

  fmt.Scan(&n)
  ans = 0

  for a:=1;a*a<n;a++{
    if n%a == 0 {
      m:= n/a -1
      if m > a {
          ans += m
      }
    }
  }
  fmt.Println(ans)
}


Measured memory_bytes: 512
#include<bits/stdc++.h>
	using namespace std;
	#define int long long int
	#define pb push_back
	#define f first
	#define s second
	const int mod=1e9+7;
	#define all(x) x.begin(),x.end()
	#define endl '\n'
	#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0)
	//int arr[900006]
	int power(int a,int b){
		int res=1;
		while(b){
			if(b&1) res=res*a;
			a=a*a;
			b>>=1;
		}
		return res;
	}
	int32_t main(){
		IOS;
		int n;
		cin>>n;
		for(int i=0;i<=200;i++){
			for(int j=-200;j<=200;j++){
				if((i*i*i*i*i)-(j*j*j*j*j)==n){
					cout<<i<<" "<<j<<endl;
					return 0;
				}
			}
		}
		return 0;
	}



Measured memory_bytes: 3608
N, M = map(int, input().split())
A = list(map(int, input().split()))

D =[]
for _ in range(M):
    b, c =  map(int, input().split())
    D.append([b,c])

A.sort()
D.sort(key= lambda x:x[1] ,reverse=True)

s=0
for b, c in D:
    if s+b>N:
        e=N
    else:
        e=s+b
    cnt=0
    for i in range(s, e):
        if A[i]<c:
            A[i]=c
        else:
            cnt=i
            break
    if cnt>0:
        s=cnt
    else:
        s=e

print(sum(A))


Measured memory_bytes: 25672
#include <cstdlib>
#include <cctype>
#include <cstring>
#include <cstdio>
#include <cmath>
#include <algorithm>
#include <vector>
#include <string>
#include <iostream>
#include <sstream>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <fstream>
#include <numeric>
#include <iomanip>
#include <bitset>
#include <list>
#include <stdexcept>
#include <functional>
#include <utility>
#include <ctime>
#include <random>
#include <cassert>
using namespace std;
typedef long long LL;
typedef unsigned long long ULL;
#define MEM(a,b) memset((a),(b),sizeof(a))
const LL INF = 1e9 + 7;
const int N = 5e2 + 10;

int main()
{
	//freopen("input.txt", "r", stdin);
	//freopen("output.txt", "w", stdout);
	int a, b;
	cin >> a >> b;
	if (max(a, b) <= 8) puts("Yay!");
	else puts(":(");
	return 0;
}


Measured memory_bytes: 256
#include <iostream>

using namespace std;

static const int N_MAX = 100000;
static const int UNKNOWN = -1;

int scores[N_MAX][3];
long mem[N_MAX][3];
int N;

long getScore(int day, int act){
    if(mem[day][act] != UNKNOWN){
        return mem[day][act];
    }
    long score = scores[day][act];
    if(day < N-1){
        score += max(getScore(day+1, (act+1)%3), getScore(day+1, (act+2)%3));
    }
    mem[day][act] = score;
    return score;
}

int main(){
    for(int i=0;i<N_MAX;i++){
        for(int j=0;j<3;j++){
            mem[i][j] = UNKNOWN;
        }
    }
    cin >> N;
    for(int i=0;i<N;i++){
        scanf("%d%d%d", &scores[i][0], &scores[i][1], &scores[i][2]);
    }
    cout << max(getScore(0, 0), max(getScore(0, 1), getScore(0, 2))) << endl;
    return 0;
}


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

#define INF (1e9)
#define INF_LL (1e17)

using LL = long long;
using ULL = unsigned long long;

using namespace std;

#define MAX_N 100005
int N;
LL A[MAX_N];

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

  sort(A, A+N);

  LL sum = A[0];
  LL ans = 1;
  for (int i = 1; i < N; i++) {
    if(A[i] <= sum*2){
      ans++;
    }
    else{
      ans = 1;
    }
    sum += A[i];
  }

  cout << ans << endl;

  return 0;
}


Measured memory_bytes: 1024
#include <bits/stdc++.h>
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(),(x).rend()
#define sz(x) (int)((x).size())
#define debug(x) cout << #x << ":" << x << ' ';
#define debugg(x) cout << #x << ":" << x << ' ' << "\n";
#define endl "\n"
#define L(X) ((X)<<1)
#define R(X) (((X)<<1)|1)
#define M(X,Y) (((X)+(Y))>>1)

using namespace std;
using ll = long long;
using ull = unsigned long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;

const int MOD = 1e9 + 7;
const int INF = 0x3f3f3f3f;
const long long int LLINF = 0x3f3f3f3f3f3f3f3f;
const double EPS = 1e-9;
const double PI = acos(-1);

template<typename T>   T max_self(T& a, T b) { if (a < b) a = b; return a; }
template<typename T>   T min_self(T& a, T b) { if (a > b) a = b; return a; }
template<typename T>   T add(T x, T y) { return ((x % MOD)  + (y % MOD)) % MOD;}
template<typename T>   T mul(T x, T y) { return ((x % MOD) * (long long)(y % MOD)) % MOD;}
template<typename T>   T sub(T x, T y) { return add(x, -y + MOD);}
template<typename T>   T gcd(T a, T b) { return b ? gcd(b, a % b) : a;}
template<typename T>   T lcm(T a, T b) { return a / gcd(a, b) * b;}
template<typename T>   vector<T> read(vector<T>& v, int n) {v.resize(n); for (auto &x : v)cin >> x;}
template<typename T>   void trav(vector<T> &v) {for (int i = 0 ; i < (int)v.size() ; ++i) {cout << v[i]; if (i != (int)v.size() - 1) cout << ' ';}}
int lg2(long long x)   {   return 64 - __builtin_clzll(x) - 1;	}
int lg2(int x)   {   return 32 - __builtin_clz(x) - 1;	}


//Variables Declaration
const int MAXN = 1e5 + 5;
int N, K;
vector<ll> h;

ll dp[MAXN];

ll solve(int n ){

	if(dp[n]>=0 ) return dp[n];

	ll ans = LLINF;
	for (int i = 1; i <= K; ++i)
	{
		if(n-i>=1) ans = min ( ans , abs( h[n] - h[n-i]) + solve(n-i) );
	}
	return dp[n]= ans;
}

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

	memset(dp, -1, sizeof(dp));

	cin >> N >> K ;
	h.resize(N+1);

	for (int i = 1 ; i <= N ; ++i) {
		cin >> h[i];
	}
	dp[1]= 0 ;
	/*dp[1]=0;

	for (int i = 1 ; i <= n ; ++i) {
		for (int k = 1 ; k <= K ; ++k ) {
			if(i+k <= n ) dp[i + k] = min(dp[i + k], dp[i] + abs(h[i] - h [i + k]));
		}
	}

	cout  << dp[n] << endl;
	*/
	cout << solve(N) << endl;


	return 0;
}


Measured memory_bytes: 9600
#!/usr/bin/python
# -*- coding: utf-8 -*-

# def
def int_mtx(N):
    x = []
    for _ in range(N):
        x.append(list(map(int,input().split())))
    return x

def str_mtx(N):
    x = []
    for _ in range(N):
        x.append(list(input()))
    return x

def int_map():
    return map(int,input().split())

def int_list():
    return list(map(int,input().split()))

def print_space(l):
    return print(" ".join([str(x) for x in l]))

# import
import numpy as np



# main code
N,X,T = int_map()

if N%X == 0:
    print((N//X)*T)
else:
    print((N//X+1)*T)




Measured memory_bytes: 27140
def solve():
    A, B, C, X, Y = map(int, input().split())

    price_no_ab = A * X + B * Y

    if X < Y:
        price_use_ab = A * 0 + B * (Y - X) + C * 2 * X
    else:
        price_use_ab = A * (X - Y) + B * 0 + C * 2 * Y

    if X < Y:
        price_ab = C * 2 * Y
    else:
        price_ab = C * 2 * X

    # print([price_use_ab, price_no_ab, price_ab])
    return min([price_use_ab, price_no_ab, price_ab])


if __name__ == "__main__":
    result = solve()
    print(result)


Measured memory_bytes: 38384
n = gets.to_i
a = gets.split.map(&:to_i)
dp = Array.new(n + 1)
dp[0] = 1000
a << 0

1.upto(n) do |i|
  0.upto(i - 1).each do |j|
    dp[i] = [dp[j] / a[j] * a[i] + dp[j] % a[j], dp[j]].max
  end
end

puts dp[n]

Measured memory_bytes: 14408
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp> 
#include <ext/pb_ds/detail/standard_policies.hpp>
using namespace __gnu_pbds;
using namespace std;
#define getbit(n, i) (((n) & (1LL << (i))) != 0) 
#define setbit0(n, i) ((n) & (~(1LL << (i)))) 
#define setbit1(n, i) ((n) | (1LL << (i))) 
#define togglebit(n, i) ((n) ^ (1LL << (i))) 
#define lastone(n) ((n) & (-(n))) 
char gap = 32;
template<typename T> 
ostream& operator<<(ostream &os, const vector<T> &v) { 
    os << '{'; 
    for (const auto &x : v) os << gap << x;
        return os << '}'; 
}
template<typename A, typename B> 
ostream& operator<<(ostream &os, const pair<A, B> &p) {
        return os << '(' << p.first << gap << p.second << ')';
}

template <class T>
void read(T &x) {
    char c;
    for (c = getchar(); c < '0' || c > '9'; c = getchar())
        ;
    for (x = 0; c <= '9' && c >= '0'; c = getchar()) x = x * 10 + (c & 15);
}
#define ll long long 
#define lll __int128_t
#define pb push_back
#define mp make_pair
typedef pair < int,int> ii;
typedef vector<ii> vii;
typedef vector<ll>vl;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef tree<
int,
null_type,
less<int>,
rb_tree_tag,
tree_order_statistics_node_update>
ordered_set;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
ll hashPrime = 1610612741;

int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    ll i,j,k,l,n,m;
    cin >> n;
    ll data[n + 1];
    for (i = 1; i <= n;i++)
        cin >> data[i];
    ll maxi = data[1];
    ll sum = 0;
    for (i = 2; i <= n;i++){
        maxi = max(maxi, data[i]);
        sum += (maxi - data[i]);
    }
    cout << sum << "\n";
    return 0;
}

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

using namespace std;

int n, a[200011];

int main()
{
    cin>>n;
    for (int i=1;i<n;i++)
    {
        int x; cin>>x;
        a[x]++;
    }
    for (int i=1;i<=n;i++) cout<<a[i]<<'\n';
    return 0;
}


Measured memory_bytes: 4416
#include<iostream>
#include<vector>
#include<algorithm>
#include<math.h>

using namespace std;

#define INF 1000000007

int main(){
  long long h, n;
  cin >> h >> n;
  vector<long long> a(n);
  vector<long long> b(n);
  vector<long long> dp(h+1, INF);
  dp[0] = 0;
  for(long long i = 0; i < n; i++){
    cin >> a[i] >> b[i];
  }
  for(long long i = 0 ; i < n ; i++){
    for(long long j = 0; j <= h; j++){
      dp[min(h, j + a[i])] = min(dp[min(h, j + a[i])], dp[j] + b[i]);
    }
  }
  cout << dp[h] << endl;
}


Measured memory_bytes: 384
#include <vector>
#include <iostream>
#include <algorithm>

using std::cin;
using std::endl;
using std::cout;
using std::count;
using std::vector;
using std::for_each;

int main() {
	int n;
	cin >> n;
	vector<int> v(n);
	for_each(v.begin(),v.end(),[](int &_e){cin >> _e;});
	int q;
	cin >> q;
	while (q--) {
		int b;
		int e;
		int k;
		cin >> b >> e >> k;
		cout << count(v.begin() + b,v.begin() + e,k) << endl;
	}
}


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

namespace test
{
    class Program
    {
        static void Main(string[] args)
        {
            var input = ReadArrayInt();
            var A = input[0];
            var B = input[1];
            var C = input[2];
            var D = input[3];
            var E = input[4];
            var F = input[5];
            var wat = new List<int>();
            var sug = new List<int>();
            for (int i = 0; i * A * 100 <= F; i++)
            {
                for (int j = 0; j * B * 100 <= F; j++)
                {
                    var sum = A * 100 * i + B * 100 * j;
                    if (sum > F) break;
                    wat.Add(sum);
                }
            }
            for (int i = 0; i * C <= F; i++)
            {
                for (int j = 0; j * D <= F; j++)
                {
                    var sum = i * C + j * D;
                    if (sum > F) break;
                    sug.Add(sum);
                }
            }
            wat = wat.Distinct().OrderBy(i => i).ToList();
            sug = sug.Distinct().OrderBy(i => i).ToList();

            var ansW = A * 100;
            var ansS = 0;
            var ansC = 0d;

            for (int i = 0; i < wat.Count; i++)
            {
                var sugLimit = wat[i] / 100 * E;
                for (int j = 0; j < sug.Count && wat[i] + sug[j] <= F; j++)
                {
                    if (sug[j] <= sugLimit)
                    {
                        var Bc = (double)100 * sug[j] / (wat[i] + sug[j]);
                        if (Bc > ansC)
                        {
                            ansW = wat[i];
                            ansS = sug[j];
                            ansC = Bc;
                        }
                    }
                }
            }

            Console.WriteLine(ansW + ansS + " " + ansS);
            Console.ReadLine();
        }

        static string Read() { return Console.ReadLine(); }
        static int ReadInt() { return int.Parse(Read()); }
        static long ReadLong() { return long.Parse(Read()); }
        static int[] ReadArrayInt() { return Read().Split(' ').Select(s => int.Parse(s)).ToArray(); }
        static long[] ReadArrayLong() { return Read().Split(' ').Select(s => long.Parse(s)).ToArray(); }
    }
}

Measured memory_bytes: 13408
#include <stdio.h>

int main(void)
{
    int n;
    int i;

    scanf("%d", &n);
    printf("%d:", n);
    for (i = 2; i * i <= n; i++){
        while (n % i == 0){
            printf(" %d", i);
            n /= i;
        }
    }
    if (n != 1){
        printf(" %d", n);
    }
    puts("");

    return 0;
}

Measured memory_bytes: 608
#include<stdio.h>
int main()
{
	int a,b;
	scanf("%d %d",&a,&b);
		if(a==b)
		{
		printf("a == b\n");
		}
		else if(a<b)
		{
		printf("a < b\n");
		}
		else if(a>b)
		{
		printf("a > b\n");
		}



	return 0;
}

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

int main(){
  long N, K;
  cin >> N >> K;
  vector<long> A;
  for(long i=0; i<N; i++){
    long a; cin >> a;
    A.push_back(a);
  }
  sort(A.begin(), A.end());
  vector<long> C;
  long num=1;
  long tmp = A[0];
  for(long i=1; i<N; i++){
    if(tmp==A[i]){
      num++; continue;
    }
    C.push_back(num);
    tmp=A[i];
    num=1;
  }
  C.push_back(num);
  sort(C.begin(), C.end(), greater<long>());
  long count=0;
  for(long i=K; i<C.size(); i++){
    count += C[i];
  }
  cout << count << endl;
  return 0;
}

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

#define REP(i, x, n) for (int i = x; i < (int)(n); i++)
#define rep(i, n) REP(i, 0, n)
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define sz(x) (int)(x.size())
#define popcount(x) __builtin_popcount(x)
#define popcountll(x) __builtin_popcountll(x)
#define uniq(x) x.erase(unique(x.begin(), x.end()), x.end())
#define F first
#define S second
#define mp make_pair
#define eb emplace_back
#define pii pair<int, int>
#define pll pair<ll, ll>

using namespace std;

typedef long long ll;

/* --- INFやMODの値が適切か確認する --- */
// const int INF = 1 << 30;
// const ll INF = 1LL << 60;
// const ll MOD = 1000000007;

int main() {
  vector<int> a(3);
  rep(i, 3) cin >> a[i];
  sort(all(a));
  cout << ((a[0] == a[1] && a[1] != a[2]) || (a[0] != a[1] && a[1] == a[2])
               ? "Yes"
               : "No")
       << endl;
}


Measured memory_bytes: 256
function Main(input) {
  lines = input.split("\n");
  firstLine = lines[0].split(" ");
  N = +firstLine[0];
  X = +firstLine[1];
  secondLine = lines[1].split(" ");
  distanceTravelled = 0;
  numBounces= 1;
  
  for(i=0;i<secondLine.length; i++){
    distanceTravelled += +secondLine[i];
    
    if(distanceTravelled <= X){
      numBounces += 1;
    }
  }
  
  console.log(numBounces);
  
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));



Measured memory_bytes: 7372
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

public class PaizaPj
{
    

    public static void Main()
    {
        // 読込
        int N = int.Parse(Console.ReadLine().Trim());
        string S = Console.ReadLine().Trim();

        int ans = 0;
        for (int i = 0; i < S.Length-2; i++)
        {
            string sub = S.Substring(i, 3);
            if (sub.Equals("ABC"))
            {
                ans++;
            }
        }
        Console.WriteLine(ans);
        //Console.ReadLine();
    }



}


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

int main() {
    string a,b;
    cin >> a;
    cin >> b;
    if (a[0] == b[2] && a[1] == b[1] && a[2] == b[0]){
        cout << "YES" << endl;
    }else{
        cout << "NO" << endl;
    }

    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int n,K;
string s;
int main(){
  cin>>s;
  n=s.size();
  cin>>K;
  for(int i=0;i<n;i++){
    if(s[i]=='a')continue;
    
    int num='z'-s[i]+1;
    if(num<=K){
      K-=num;
      s[i]='a';
    }
  }

  K%=26;

  while(K>0){
    if(s[n-1]=='z')s[n-1]='a';
    else s[n-1]++;
    K--;
  }
  
  cout<<s<<endl;
  return 0;
}


Measured memory_bytes: 512
#include "bits/stdc++.h"
using namespace std;
using ll=long long;
#define print(n) cout<<n<<endl
#define rep(i,a,n) for(int i=a;i<n;i++)
#define ALL(s) s.begin(),s.end()
#define P pair<ll,ll>
#define vl vector<ll>
#define vi vector<int>
#define vvl vector<vector<ll>>
#define vvi vector<vector<int>>
const int M=100111;
const int inf=1000000007;
const long long INF=1e18;
int dx[4]={-1,0,1,0},dy[4]={0,-1,0,1};
int ddx[8]={1,-1,0,0,1,-1,-1,1},ddy[8]={0,0,1,-1,1,-1,1,-1};
 
int main(){
    cout << fixed << setprecision(8);
    while(1){
        double dp[101][105]={};//dp[now][turn]: nowマス目に行く時にかかったターン数turn.
        dp[0][0]=1;
        int n,t,a,b,stop[101],back[101];
        cin>>n>>t>>a>>b;
        if(n==0)break;
        rep(i,0,a)cin>>stop[i];
        rep(i,0,b)cin>>back[i];
        double ans=0;
        double prob=0.16666666666666666;
        rep(turn,0,t)rep(now,0,n){
            if(dp[now][turn]){
                rep(k,1,7){
                    //nowマスからnextマスへ進む.
                    int next=now+k;
                    if(next>n)next=n-(next-n);
                    //nextがstopの座標だった時,continue
                    bool ok=false;
                    rep(l,0,a)if(stop[l]==next)ok=true;
                    if(ok){
                        dp[next][turn+2]+=dp[now][turn]*prob;
                        continue;
                    }
                    //nextがbackの座標だった時,continue.
                    ok=false;
                    rep(l,0,b)if(back[l]==next)ok=true;
                    if(ok){
                        dp[0][turn+1]+=dp[now][turn]*prob;
                        continue;
                    }
                    //nowからnextに進む.
                    dp[next][turn+1]+=dp[now][turn]*prob;
                }
            }
        }
        rep(i,1,t+1)ans+=dp[n][i];
        print(round(ans*1000000)/1000000);
    }
}


Measured memory_bytes: 3436
import java.util.PriorityQueue
import java.util.Comparator

fun main(args: Array<String>)
{
    val (n, m) = readLine()!!.split(" ").map{ it.toInt() }
    val a = readLine()!!.split(" ").map{ it.toInt() }.map{ -1 * it }

    // val q = PriorityQueue<Int>(n)// { o1: Int, o2: Int -> o2 - o1 }
    // q.addAll(a)
    val q = PriorityQueue<Int>(a)

    var maximum: Int
    for (i in 1..m) {
        maximum = q.poll()
        q.add(maximum / 2)
    }

    var sum: Long = 0L
    for (i in 1..n) {
        sum -= q.poll().toLong()
    }

    println(sum)
}


Measured memory_bytes: 73528
arr = []
a = []
n = gets.to_i
5.times do |i|
  arr << gets.to_i
  i == 0 ? a << n : a << 0
end
min = arr.min
amari = n % min
if amari != 0
  x = n / min + 1
else
  x = n / min
end
x = x + 4
puts x


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

using namespace std;

int main(){
    int H, W;
    cin >> H >> W;
    vector<string> S(H);
    for(int i=0; i<H; ++i){
        cin >> S[i];
    }
    vector<vector<int>> cx(H, vector<int>(W, 0));
    vector<vector<int>> cy(H, vector<int>(W, 0));
    for(int y=0; y<H; ++y){
        int count = 0;
        for(int x=0; x<W; ++x){
            if(S[y][x]=='.') ++count;
            if(S[y][x]=='#'){
                for(int xx=x-1; xx>=0; --xx){
                    if(S[y][xx]=='#') break;
                    cx[y][xx] = count;
                }
                count = 0;
            }
            else if(x==W-1){
                for(int xx=x; xx>=0; --xx){
                    if(S[y][xx]=='#') break;
                    cx[y][xx] = count;
                }
            }
        }
    }

    for(int x=0; x<W; ++x){
        int count = 0;
        for(int y=0; y<H; ++y){
            if(S[y][x]=='.') ++count;
            if(S[y][x]=='#'){
                for(int yy=y-1; yy>=0; --yy){
                    if(S[yy][x]=='#') break;
                    cy[yy][x] = count;
                }
                count = 0;
            }
            else if(y==H-1){
                for(int yy=y; yy>=0; --yy){
                    if(S[yy][x]=='#') break;
                    cy[yy][x] = count;
                }
            }
        }
    }

    int M = 0;
    for(int y=0; y<H; ++y){
        for(int x=0; x<W; ++x){
            int count = cx[y][x] + cy[y][x] - 1;
            M = max(count, M);
        }
    }

    cout << M << endl;
}


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

using namespace std;


template <class T>
std::istream& operator>>(std::istream& in, std::vector<T>& data) {
    for (auto& item : data) {
        in >> item;
    }
    return in;
}

template <class T>
std::ostream& operator<<(std::ostream& out, const std::vector<T>& data) {
    bool first = true;
    for (const auto& item : data) {
        if (!first) {
            out << " ";
        }
        out << item;
        first = false;
    }
    return out;
}


int main() {
#ifdef LOCAL
    freopen("atcoder/2/input.txt", "r", stdin);
#endif

    int n;
    cin >> n;

    vector<int> nums(n);
    cin >> nums;

    auto sorted_nums = nums;
    sort(sorted_nums.begin(), sorted_nums.end());

    int counter = 0;

    for (int i = 0; i < n; ++i) {
        if (nums[i] != sorted_nums[i]) {
//            cout << i << "\n";
            ++counter;
        }

        if (counter > 2) {
            cout << "NO" << "\n";
            return 0;
        }
    }

    cout << "YES" << "\n";



    return 0;
}











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

int id[1010][1010];

inline int dis(pii a, pii b){
  return abs(a.first - b.first) + abs(a.second - b.second);
}

int main(){
  int w,h;
  while(cin >> w >> h, w){
    vector<string> g(h);
    rep(i,h)cin >> g[i];

    pii s,t;
    vector< vector<pii> > c(5);

    int cnt = 2;
    rep(i,h)rep(j,w){
      if(g[i][j] == 'S'){
	s = pii(i,j); id[i][j] = 0;
      }else if(g[i][j] == 'G'){
	t = pii(i,j); id[i][j] = 1;
      }else if(g[i][j] != '.'){
	c[g[i][j]-'1'].push_back(pii(i,j));
	id[i][j] = cnt++;
      }
    }

    pii ans = pii(1e9,1e9);
    rep(i,5){
      vector< vector<pii> > seq(6);
      seq[0].push_back(s);
      rep(j,4)seq[j+1] = c[(i+1+j)%5];
      seq[5].push_back(t);

      vector<int> d(cnt,1e8);
      d[id[s.first][s.second]] = 0;

      rep(j,5){
	for(pii a : seq[j]){
	  for(pii b : seq[j+1]){
	    int cost = d[id[a.first][a.second]] + dis(a,b);
	    chmin(d[id[b.first][b.second]], cost);
	  }
	}
      }

      ans = min(ans, pii(d[id[t.first][t.second]], i+1));
    }
    
    if(ans.first < 1e8){
      cout << ans.second << " " << ans.first << endl;
    }else{
      cout << "NA" << endl;
    }
  }

}

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

using namespace std;

int n,m,L,R;
char s[300000],a[300000][1],b[300000][1];

int main(){
	scanf("%d%d%s",&n,&m,s+1);
	for (int i=1;i<=m;++i){
		scanf("%s%s",a[i],b[i]);
	}
	int l=1,r=n; L=0;
	while (l<=r){
		int mid=(l+r)>>1;
		int x=mid;
		for (int i=1;i<=m;++i){
			if (s[x]==a[i][0]){
				if (b[i][0]=='L') --x;
				else ++x;
			}
			if (!x||x>n) break;
		}
		if (x==0){L=mid; l=mid+1;}
		else r=mid-1;
	}
	l=1,r=n; R=n+1;
	while (l<=r){
		int mid=(l+r)>>1;
		int x=mid;
		for (int i=1;i<=m;++i){
			if (s[x]==a[i][0]){
				if (b[i][0]=='L') --x;
				else ++x;
			}
			if (!x||x>n) break;
		}
		if (x>n){R=mid; r=mid-1;}
		else l=mid+1;
	}
	printf("%d\n",n-(L+(n-R+1)));
	
	return 0;
}
			

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

#define rep(i, a, b) for(int i = (int)a; i < (int)b; i++)
#define repm(i, a, b) for(int i = (int)a; i > (int)b; i--)
#define all(x) x.begin(),x.end()
#define pb push_back
#define mp make_pair
#define fi first
#define se second
typedef long long ll;
typedef long double ld;
typedef pair<ll,ll> P;
typedef pair<int,int> Pi;
#define MOD 1000000007

const int MAX_M = 100000;


int main(){
  ll n; 
  //string s;
  cin >> n;
  
  ll ans = 0;
  for(ll i = 1; i <= n; i++){
    if((i%3 != 0) && (i%5 != 0))
      ans += i;
  }
  
  cout << ans << endl;
}


Measured memory_bytes: 3620
#include <iostream>
#include <sstream>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <ctime>
#include <cstring>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <deque>
#include <map>
#include <set>
#include <bitset>
#include <numeric>
#include <utility>
#include <iomanip>
#include <algorithm>
#include <functional>
using namespace std;

#define COUT(x) cout << #x << " = " << (x) << " (L" << __LINE__ << ")" << endl
#define EACH(i, s) for (__typeof__((s).begin()) i = (s).begin(); i != (s).end(); ++i)

template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
template<class T1, class T2> ostream& operator << (ostream &s, pair<T1,T2> P)
{ return s << '<' << P.first << ", " << P.second << '>'; }
template<class T> ostream& operator << (ostream &s, vector<T> P)
{ for (int i = 0; i < P.size(); ++i) { if (i > 0) { s << " "; } s << P[i]; } return s; }
template<class T> ostream& operator << (ostream &s, vector<vector<T> > P)
{ for (int i = 0; i < P.size(); ++i) { s << endl << P[i]; } return s << endl; }
template<class T1, class T2> ostream& operator << (ostream &s, map<T1,T2> P)
{ EACH(it, P) { s << "<" << it->first << "->" << it->second << "> "; } return s << endl; }


long long N;
int main() {
    while (cin >> N) {
        long long res = 0;
        for (res = 0; res * res <= N; ++res) { }
        --res;
        cout << res * res << endl;
    }
}



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

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

    vector<string> strList(n);
    for(int i=0; i<n; i++) cin >> strList[i];

    int ans = 0;    
    for(int i=0; i<n-1; i++){
        if( strList[i].back() != strList[i+1][0] || count(strList.begin(), strList.end(), strList[i]) > 1){
            ans = 1;
            break;
        }
    }

    if(strList[n-2].back() != strList[n-1][0] || count(strList.begin(), strList.end(), strList[n-1]) > 1)  ans = 1;
    
    if(ans == 0) cout<<"Yes";
    else cout<<"No";

}

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

typedef complex<long long> point;

long double dot(point a,point b){
	// return (a*conj(b)).real();
	return a.real()*b.real()+a.imag()*b.imag();
}

long double cross(point a,point b){
	// return (a*conj(b)).imag();
	return a.real()*b.imag()-a.imag()*b.real();
}

int main(void){
	double x,y;
	int q;
	cin>>x>>y;
	point p0(x,y);
	cin>>x>>y;
	point p1(x,y);
	point p0p1=p1-p0;
	cin>>q;
	while(q--){
		cin>>x>>y;
		point p2(x,y);
		point p0p2=p2-p0;
		if(cross(p0p1,p0p2)>0)cout<<"COUNTER_CLOCKWISE"<<endl;
		else if(cross(p0p1,p0p2)<0)cout<<"CLOCKWISE"<<endl;
		else if(dot(p0p1,p0p2)<0)cout<<"ONLINE_BACK"<<endl;
		else if(norm(p0p1)<norm(p0p2))cout<<"ONLINE_FRONT"<<endl;
		else cout<<"ON_SEGMENT"<<endl;
	}
	return 0;
}

Measured memory_bytes: 3224
#include <iostream>
#include <cmath>
#include <string>
#include<set>
#include<vector>
#define MAX 5000
using namespace std;
typedef long long ll;
typedef pair<ll, ll> point;
int main(void) {
    ll i, j, h, w, d, q, num, l, r, dis[90010];
    point posi[90001];
    cin >> h >> w >> d;
    for(i=1; i<=h; i++) {
        for(j=1; j<=w; j++) {
            cin >> num;
            posi[num] = make_pair(i, j);
        }
    }
    cin >> q;
    for(i=1; i<=h*w-d; i++)
        dis[i] = 0;
    for(i=1; i<=h*w-d; i++)
        dis[i+d] = dis[i] + abs(posi[i+d].first-posi[i].first) + abs(posi[i+d].second-posi[i].second);
        
    
    for(i=0; i<q; i++) {
        cin >> l >> r;
        cout << dis[r]-dis[l] << endl;
    }
}


Measured memory_bytes: 3200
n,m = gets.split.map(&:to_i)
shop = n.times.map{gets.split.map(&:to_i)}.sort{|a,b| a[0] <=> b[0]}

ans = 0
drink = 0
shop.each do |a,b|
  if drink+b <= m
    ans += a * b
    drink += b
  else
    ans += a * (m-drink)
    drink = m
  end
  if drink == m
    break
  end
end

puts ans

Measured memory_bytes: 11128
#!/usr/bin/env python3
import sys
def input():
    return sys.stdin.readline()[:-1]

def main():
    N = int(input())
    a = list(map(int, input().split()))

    ans = 0
    n = 1
    for i in range(N):
        if a[i] != n:
            ans += 1
        else:
            n += 1
    if ans == N:
        print(-1)
    else:
        print(ans)

if __name__ == '__main__':
    main()


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

int main(){
  int n,r = 0;
  cin >> n;
  vector<int> p(n);
  for(int i = 0;i < n;i++){
    cin >> p.at(i);
  }
  sort(p.begin(),p.end());
  p.at(n-1) /= 2;
  for(int i = 0;i < n;i++){
    r += p.at(i);
  }
  cout << r << endl;
}

Measured memory_bytes: 256
#include<iostream>
#include<algorithm>
#include<vector>
#include<queue>
using namespace std;
typedef long long ll;
typedef pair<ll,ll> P;
typedef pair<P,ll> P2;
const ll inf=1744174417441744;
P2 mk_P(ll a,ll b,ll c){return P2(P(a,b),c);}
struct segtree{
private:
  vector<ll> node;
  ll siz;
public:
  segtree(int n){
    siz=1;
    while(siz<=n) siz*=2;
    node.resize(siz*2+1,inf);
  }
  void upd(ll pos,ll x){
    pos+=siz-1;
    node[pos]=x;
    while(pos>0){
      pos=(pos-1)/2;
      node[pos]=min(node[pos*2+1],node[pos*2+2]);
    }
  }
  ll get_min(ll a,ll b,ll pos,ll l,ll r){
    if(a<=l&&r<=b) return node[pos];
    if(r<=a||b<=l) return inf;
    ll mid=(l+r)/2;
    ll lb=get_min(a,b,pos*2+1,l,mid);
    ll rb=get_min(a,b,pos*2+2,mid,r);
    //cout<<l<<" "<<r<<" "<<lb<<" "<<rb<<" "<<min(lb,rb)<<endl;
    return min(lb,rb);
  }
  ll min_q(ll a,ll b){
    return get_min(a,b,0,0,siz);
  }
  void seg_debug(){
    cout<<siz<<"SIZ**"<<endl;
    for(int i=0;i<node.size();i++) cout<<(node[i]==inf?-1:node[i])<<" ";
    cout<<endl;
  }
};
int main(){
  ll n,m;
  cin>>n>>m;
  vector<P2> pv;
  for(int i=0;i<m;i++){
    ll l,r,c;
    cin>>l>>r>>c;
    pv.push_back(mk_P(l,r,c));
  }
  sort(pv.begin(),pv.end());
  segtree seg=segtree(n+5);
  for(int i=2;i<=n;i++) seg.upd(i,inf);
  seg.upd(1,0);

  //cout<<seg.get_min(1,2,7,0,2)<<endl;
  //seg.seg_debug();
  //cout<<seg.min_q(1,2)<<endl;
  for(int i=0;i<m;i++){
    P2 p=pv[i];
    ll l=p.first.first,r=p.first.second,c=p.second;
    ll min_v=seg.min_q(l,r+1);
    ll now_v=seg.min_q(r,r+1);
    seg.upd(r,min(now_v,min_v+c));
  //  cout<<l<<" "<<r<<" "<<c<<" "<<min_v<<" "<<now_v<<endl;
  }
  cout<<(seg.min_q(n,n+1)==inf?-1:seg.min_q(n,n+1))<<endl;
}


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

typedef long long LL;
typedef long double LD;
typedef pair < int, int > PII;
typedef pair < LL, LL > PLL;
typedef pair < LD, LD > PDD;

#define _upgrade ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define all(x) (x).begin(), (x).end()
#define sz(x) (int)(x).size()
template < typename _T > inline void _DBG(const char *s, _T x) { cerr << s << " = " << x << "\n"; }
template < typename _T, typename... args > void _DBG(const char *s, _T x, args... a) { while(*s != ',') cerr << *s++; cerr << " = " << x << ','; _DBG(s + 1, a...); }

#ifdef LOCAL
#define DBG(...) _DBG(#__VA_ARGS__, __VA_ARGS__)
#else
#define DBG(...) (__VA_ARGS__)
#define cerr if(0) cout
#endif

// ********************** CODE ********************** //

int main()
{
    _upgrade
    int n; cin >> n;
    cout << "ABC" << n;
	return 0;
}


Measured memory_bytes: 256
import java.util.Scanner;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    Boolean result = false;
    int t = 0;
    int x = 0;
    int y = 0;

    for (int i = 0; i < n; i++) {
      t = sc.nextInt() - t;
      x = sc.nextInt() - x;
      y = sc.nextInt() - y;

      if (x + y > t || (t % 2 == 0 && (x + y) % 2 != 0) || (t % 2 != 0 && (x + y) % 2 == 0)) {
        System.out.println("No");
        return;
      }
    }
    System.out.println("Yes");
  }
}


Measured memory_bytes: 86756
n = int(input())
info = []
for i in range(n):
    info.append(list(map(int, input().split())))
    

for i in range(n-1):
    ratio = max((info[i][0]-1)//info[i+1][0]+1, (info[i][1]-1)//info[i+1][1]+1)
    info[i+1][0]*=ratio
    info[i+1][1]*=ratio

print(sum(info[-1]))

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

using namespace std;

using ll = int64_t;
using Vi = vector<int>;
using Vl = vector<ll>;
using Pii = pair<int, int>;
using Pll = pair<ll, ll>;

constexpr int I_INF = 2147483647;
constexpr ll L_INF = 9223372036854775807LL;

//===




int main()
{
	string S;
	cin >> S;
	size_t lenS = S.size();

	bool is_ok = true;
	for (size_t i = 0; i < lenS; ++i) {
		if (i % 2 == 1) {
			if (S[i] == 'R') {
				is_ok = false;
				break;
			}
		}
		else {
			if (S[i] == 'L') {
				is_ok = false;
				break;
			}
		}
	}

	cout << (is_ok ? "Yes" : "No") << endl;

	return 0;
}

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

typedef long double ld;
typedef pair<ld, int> ld_i;

int main() {
	ld PI = acosl(-1);
	int N; cin >> N;
	vector<int> x(N), y(N);
	for (int i = 0; i < N; i++)
		cin >> x[i] >> y[i];
	for (int k = 0; k < N; k++) {
		vector<ld_i> v;
		for (int i = 0; i < N; i++) {
			if (i == k) continue;
			ld a = atan2l(x[i] - x[k], y[i] - y[k]);
			v.push_back(ld_i(a, i < k));
		}
		int n = v.size();
		sort(v.begin(), v.end());
		for (int i = 0; i < n; i++) {
			v.push_back(v[i]);
			v.back().first += PI*2;
		}
		int a = 0, b = 0, j = 0;
		bool ok = false;
		for (int i = 0; i < n; i++) {
			for (; v[j].first < v[i].first + PI; j++)
				if (v[j].second) a++;
				else b++;
			if ((a == k && b == 0) || (a == 0 && b == N - 1 - k))
				ok = true;
			if (v[i].second) a--;
			else b--;
		}
		if (!ok) {
			cout << "Impossible" << endl;
			return 0;
		}
	}
	cout << "Possible" << endl;
}

Measured memory_bytes: 3272
#include<cstring>
#include<string>
#include<vector>
#include<iostream>
#include<cstdio>
#include<cstdlib>
#include<stack>
#include<queue>
#include<cmath>
#include<algorithm>
#include<list>
#include<set>
#include<map>
#include<sstream>
#include<climits>
#define rep(X,Y) for (int (X) = 0;(X) < (Y);++(X))
#define rrep(X,Y) for (int (X) = (Y)-1;(X) >=0;--(X))
#define all(X) (X).begin(),(X).end()
#define fi first
#define sc second
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;

int main() {
  int N, A, B;
  cin >> N >> A >> B;

  ll ans = 0;
  for (int i = 1; i <= N; ++i) {
    int n = i;
    int t = 0;
    while (n > 0) {
      t += n%10;
      n /= 10;
    }
    if (A <= t && t <= B) ans += i;
  }

  cout << ans << endl;

  return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
 
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define endl "\n"
#define int long long
 
const int N=1e5+5;
 
int n, k, best=0, ans=0;
int t[N], d[N], f[N];
set<int> types;
multiset<pair<int, int> > removable;
pair<int, int> a[N];
 
int32_t main()
{
    IOS;
    cin>>n>>k;
    for(int i=1;i<=n;i++)
    {
        cin>>t[i]>>d[i];
        a[i].first=d[i];
        a[i].second=t[i];
    }
    sort(a+1, a+n+1);
    reverse(a+1, a+n+1);
    for(int i=1;i<=k;i++)
    {
        removable.insert({a[i].first, a[i].second});
        f[a[i].second]++;
        ans+=a[i].first;
        types.insert(a[i].second);
    }
    int sz=types.size();
    best=ans + sz*sz;
    for(int i=k+1;i<=n;i++)
    {
        if(types.find(a[i].second)!=types.end())
            continue;
        if(!removable.size())
            break;
        bool check=0;
        while(removable.size())
        {
            auto it=*removable.begin();
            if(f[it.second]==1)
                removable.erase(removable.find(it));
            else
            {
                check=1;
                ans-=it.first;
                f[it.second]--;
                removable.erase(removable.find(it));
                break;
            }
        }
        if(!check)
            break;
        ans+=a[i].first;
        f[a[i].second]++;
        types.insert(a[i].second);
        sz++;
        best=max(best, ans + sz*sz);
    }
    cout<<best;
    return 0;
}

Measured memory_bytes: 13056
#include <iostream>
#include <vector>
#include <limits.h>
#include <algorithm>
#include <string>
#include <math.h>
#include <limits.h>
#include <queue>
#include <map>
#include <set>
#include <iomanip>
#include <bitset>
#include <cassert>
#include <random>
#include <functional>
#include <stack>
#include <iomanip>
#include <cassert>
//#include <boost/multiprecision/cpp_int.hpp>
#include <complex>
#include <cstdio>
#include <list>
#include <bitset>

//< in.txt > out.txt
using namespace std;
//std::ios::sync_with_stdio(false);
//std::cin.tie(0);
const long long MOD = 1e9 + 7;
typedef long long ll;
typedef long double ld;
typedef pair<ll, ll> pll;
typedef pair<ld, ll> pdl;
typedef pair<ld, ld> pdd;
typedef vector<ll> VLL;
typedef vector<VLL> VVLL;
//typedef boost::multiprecision::cpp_int bigint;

//最大公約数
//O(log max(a,b))
template<class T>
T GCD(T a, T b) {
	if (b == 0)return a;
	return GCD(b, (T)(a % b));
}

int main() {
	std::ios::sync_with_stdio(false);
	std::cin.tie(0);
	ll A, B;
	cin >> A >> B;
	cout << A * B / GCD(A, B) << "\n";
	return 0;
}

Measured memory_bytes: 256
#pragma target("avx")
#pragma optimize("O3")
#include<bits/stdc++.h>
using ll = int_fast64_t;
using P = std::pair<ll,ll>;
using PP = std::pair<ll,P>;
using V = std::vector<ll>;
template<typename T> using pq = std::priority_queue<T>;
template<typename T> using rpq = std::priority_queue<T, std::vector<T>, std::greater<T>>;

#define REP(i,b,e) for(ll i=b; i<e; i++)
#define ALL(vec) vec.begin(),vec.end()
#define PRINT(vec) printf("[ ");for(auto &i:vec)printf("%ld ",i);puts("]");
#define SCAN(vec) for(auto &i:vec)scanf("%ld",&i)
#define fi first
#define se second

const int MOD = 1e9+7;
const ll INF = 1e18;
int dx[] = {0, 1, 0, -1, 1, 1, -1, -1}, dy[] = {1, 0, -1, 0, 1, -1, -1, 1};

int main(){
        int n;
        scanf("%d", &n);
        ll cnt[100010] = {}, ans = 0;
        REP(i, 0, n){
                int a;
                scanf("%d", &a);
                cnt[a]++;
                ans += a;
        }
        int q;
        scanf("%d", &q);
        while(q--){
                int b, c;
                scanf("%d %d", &b, &c);
                ans += cnt[b]*(c-b);
                printf("%ld\n", ans);
                cnt[c] += cnt[b];
                cnt[b] = 0;
        }
        return 0;
}

Measured memory_bytes: 4592
#include <iostream>
#include <vector>

class PriQueue {
public:
	int size;
	std::vector<int> tree;
	PriQueue() {
		size = 0;
	}
	void insert(int k) {
		tree.push_back(k);
		upSearch(size);
		size++;
	}
	void upSearch(int idx) {
		if (idx == 0) return;
		int p = (idx - 1) / 2;
		if (tree[p] < tree[idx]) {
			int tmp = tree[idx];
			tree[idx] = tree[p];
			tree[p] = tmp;
			upSearch(p);
		}
	}
	void getMax() {
		if (size == 0) return;
		std::cout << tree[0] << std::endl;
	}
	void deleteMax() {
		if (size == 0) return;
		tree[0] = tree[size - 1];
		tree.pop_back();
		size--;
		downSearch(0);
	}
	void downSearch(int idx) {
		int left = (idx + 1) * 2 - 1;
		int right = (idx + 1) * 2;
		int max = -1;
		if (left < size && tree[idx] < tree[left]) {
			max = left;
		}
		else {
			max = idx;
		}
		if (right < size && tree[max] < tree[right]) {
			max = right;
		}
		if (max != idx) {
			int tmp = tree[idx];
			tree[idx] = tree[max];
			tree[max] = tmp;
			downSearch(max);
		}
	}
};

int main() {
	int n, q;
	std::cin >> n >> q;
	PriQueue* pq = new PriQueue[n];
	while (q--) {
		int com, t;
		std::cin >> com >> t;
		if (com == 0) {
			int x;
			std::cin >> x;
			pq[t].insert(x);
		}
		if (com == 1) {
			pq[t].getMax();
		}
		if (com == 2) {
			pq[t].deleteMax();
		}
	}
}


Measured memory_bytes: 4220
#include<iostream>
#include<algorithm>
using namespace std;
int main()
{
	int x,y;
	while(1){
		cin >> x >> y;
		if(x==0 && y==0)break;
		if(x>y)swap(x,y);
		cout << x << " " << y << endl;
	}
	return 0;
}

Measured memory_bytes: 1160