akhauriyash/Code-Regression huggingface dataset:
#include<bits/stdc++.h>
using namespace std;
#define gc getchar_unlocked
#define fo(i,n) for(int i=0;i<n;i++)
#define Fo(i,k,n) for(i=k;k<n?i<n:i>n;k<n?i+=1:i-=1)
#define ll long long
#define si(x)	scanf("%d",&x)
#define sl(x)	scanf("%lld",&x)
#define ss(s)	scanf("%s",s)
#define pi(x)	printf("%d\n",x)
#define pl(x)	printf("%lld\n",x)
#define ps(s)	printf("%s\n",s)
#define deb(x) cout << #x << "=" << x << endl
#define deb2(x, y) cout << #x << "=" << x << "," << #y << "=" << y << endl
#define pb push_back
#define mp make_pair
#define F first
#define S second
#define all(x) x.begin(), x.end()
#define clr(x) memset(x, 0, sizeof(x))
#define sortall(x) sort(all(x))
#define tr(it, a) for(auto it = a.begin(); it != a.end(); it++)
#define PI 3.1415926535897932384626
#define wi(t) int t;cin>>t;while(t--)
typedef pair<int, int>	pii;
typedef pair<ll, ll>	pl;
typedef vector<int>		vi;
typedef vector<ll>		vl;
typedef vector<pii>		vpii;
typedef vector<pl>		vpl;
typedef vector<vi>		vvi;
typedef vector<vl>		vvl;
mt19937_64 rang(chrono::high_resolution_clock::now().time_since_epoch().count());
int rng(int lim) {
	uniform_int_distribution<int> uid(0,lim-1);
	return uid(rang);
}
int mpow(int base, int exp); 
void ipgraph(int n, int m);
void dfs(int u, int par);

const int mod = 1000000007;
const int N = 3e5, M = N;
//=======================

vi g[N];
int a[N];

void solve()
    {
    int x,y;
    cin>>x>>y;
    cout<<x+y/2<<endl;
  
  
  
    }

int main() {
    ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
    srand(chrono::high_resolution_clock::now().time_since_epoch().count());

   // wi(t)
    {
      solve();
    }

    return 0;
}

int mpow(int base, int exp) {
  base %= mod;
  int result = 1;
  while (exp > 0) {
    if (exp & 1) result = ((ll)result * base) % mod;
    base = ((ll)base * base) % mod;
    exp >>= 1;
  }
  return result;
}

void ipgraph(int n, int m){
	int i, u, v;
	while(m--){
		cin>>u>>v;
    u--, v--;
		g[u].pb(v);
		g[v].pb(u);
	}
}

void dfs(int u, int par){
	for(int v:g[u]){
		if (v == par) continue;
		dfs(v, u);
	}
}







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

int main(){
  int n;
  cin >> n;
  vi a(n+1);
  rep(i,n){
    int x;
    cin >> x;
    a[i+1]=x;
  }
  
  int  m=0;
  vi b(n+1);
  for(int i=n;i>0;i--){
    for(int j=2*i;j<=n;j+=i){
      a[i]^=b[j];
    }
    if(a[i]){
      m++;
      b[i]++;
    }
  }
  
  cout<<m << "\n";
  rep(i,n+1){
    if(b[i]) cout << i << ' ';
  }
  
  return 0;
}

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

int main(void) {
	int a = 0;
	int N = 0;
	long long temp = 0;
	std::vector<long long> permute;
	std::vector<long long> permute1;
	std::vector<long long> permute2;
	
	std::cin >> N;

	for (auto i = 0; i < N; i++) {
		permute.push_back(i + 1);
	}
	for (auto i = 0; i < N; i++) {
		std::cin >> temp;
		permute1.push_back(temp);
	}
	for (auto i = 0; i < N; i++) {
		std::cin >> temp;
		permute2.push_back(temp);
	}

	
#define b temp

	std::sort(permute.begin(),permute.end());
	int i = 0;
	do {
		i++;
		if (permute == permute1) {
			a = i;
		}
		if (permute == permute2) {
			b = i;
		}
	} while ( std::next_permutation( permute.begin(), permute.end() ) );
	std::cout << std::abs(a - b);
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
 
#define ll long long
#define vvi vector< vector<int> >
#define vi vector<int>
#define All(X) X.begin(),X.end()
#define FOR(i,a,b) for(int i=(int)(a);i<(int)(b);i++)
#define REP(i,n) for(int i=0;i<(int)(n);i++)
#define pb push_back
#define pii pair<int,int>
#define mp make_pair
#define pi 3.14159265359
#define shosu(X) fixed << setprecision(X)
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
ll lcm(ll a,ll b){return a/gcd(a,b)*b;}
 
int main(){
int k,s;
cin >> k >> s;
int ans = 0;
REP(i,k+1){
REP(j,k+1){
if(0 <= s - i - j && s - i - j <= k) ans++;
}
}
cout << ans << endl;
}

Measured memory_bytes: 256
l = ['q', 'w', 'e', 'r', 't', 'a', 's', 'd', 'f', 'g', 'z', 'x', 'c', 'v', 'b']
while 1:
    a = 0
    s = raw_input()
    if s == "#":
        break;
    b = -1
    for c in s:
        if b == -1:
            b = c in l
            continue
        a += b != (c in l)
        b = c in l
    print a

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

using namespace std;

#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define REP(i,n) FOR(i,0,n)

int culc1();
int culc2();
int culc3();
int culc4();

int n;
string str;
int cur;

int main() {
	cin >> n;
	while (n--) {
		cin >> str;
		cur = 0;
		cout << culc1() << endl;
	}
	return 0;
}


int culc1() {
	int val = culc2();
	while (str[cur] == '+' || str[cur] == '-') {
		char op = str[cur++];
		int val2 = culc2();

		if (op == '+') val += val2;
		else val -= val2;
	}
	return val;
}

int culc2() {
	int val = culc3();
	while (str[cur] == '*' || str[cur] == '/') {
		char op = str[cur++];
		int val2 = culc3();
		
		if (op == '*') val *= val2;
		else val /= val2;
	}
	return val;
}

int culc3() {
	if (isdigit(str[cur])) return culc4();
	cur++;
	int res = culc1();
	cur++;
	return res;
}

int culc4() {
	int num = str[cur++] - '0';
	while (isdigit(str[cur]))
		num = num*10 + str[cur++] - '0';
	return num;
}

Measured memory_bytes: 1204
#include<iostream>
#include<string>
#include<queue>
#include<fstream>
#include<cstring>
#include<algorithm>
using namespace std;
int sand[1005][1005];
bool used[1005][1005];
const int MAX=1007;
queue<int> q1,q2;

int main(){
	string sa;
	int i,j,k,l;
	int n,m;
	int a,b,c,d;
	cin>>n>>m;
	for(i=0;i<n;i++){
		cin>>sa;
		for(j=0;j<m;j++){
			if(sa[j]=='.'){
				for(k=-1;k<=1;k++){
					for(l=-1;l<=1;l++){
						if(i+k>0 && i+k<n-1 && j+l>0 && j+l<m-1){
							if(used[i+k][j+l])continue;
							used[i+k][j+l]=true;
							q1.push((i+k)*MAX+(j+l));
						}
					}
				}
				continue;
			}
			for(char ca='1',k=1;k<10;k++,ca++){
				if(sa[j]==ca){
					sand[i][j]=k;
					break;
				}
			}
		}
	}
	memset(used,false,sizeof(used));
	for(i=0;;i++){
		a=q1.size();
		for(j=0;j<a;j++){
			c=q1.front(),q1.pop();
			b=c/MAX,c%=MAX;
			if(sand[b][c]==0)continue;
			if(used[b][c])continue;
			d=0;
			for(k=-1;k<=1;k++){
				for(l=-1;l<=1;l++){
					if(sand[b+k][c+l]==0)d++;
				}
			}
			if(d<sand[b][c])continue;
			used[b][c]=true;
			q2.push(b*MAX+c);
			for(k=-1;k<=1;k++){
				for(l=-1;l<=1;l++){
					if(sand[b+k][c+l]==0)continue;
					q1.push((b+k)*MAX+(c+l));
				}
			}
		}
		if(q2.empty())break;
		while(!q2.empty()){
			c=q2.front(),q2.pop();
			b=c/MAX,c%=MAX;
			sand[b][c]=0;
		}
	}
	cout<<i<<endl;
	return 0;
}

Measured memory_bytes: 8440
n = int(input())

t = list(map(int, input().split()))

m = int(input())

res = []
for i in range(m):
    tmp = t[:]
    p, x = list(map(int, input().split()))
    tmp[p-1] = x
    res.append(sum(tmp))

for i in range(m):
    print(res[i])

Measured memory_bytes: 3060
n,a,b=map(int,input().split())
t=n-b
if (a-b)%2==0:
    print(abs((a-b)//2))
elif abs(a-b)==1:
    if t>a-1:
        print(a)
    else:
        print(t+1)
elif t>a-1:
    print(a+(n-(t+a))//2)
else:
    print(t+1+(n-(t+a))//2)

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

using namespace std;

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

  for (int i = 0; i < N; i++) {
    int a;
    cin >> a;
  }

  for (int count = 1; count <= N; count++) {
    if (K + (K - 1) * (count - 1) >= N) {
      printf("%d\n", count);
      break;
    }
  }

  return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<cstdio>
#include<string>
#include<algorithm>
#include<utility>
#include<numeric>
#include<vector>
#include<map>
#include<unordered_map>
#include<set>
#include<tuple>
#include<stack>
#include<queue>
#include<functional>
#include<iterator>
#include<cmath>
#include<cctype>

using namespace std;

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

const int INF = 1e9;
const ll LINF = 1e18;

struct edge{int to,cost;};

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

	int n;
	cin >> n;
	
	int a;
	vector<int> o,e;
	for(int i=1;i<=n;i++){
		cin >> a;
		if(i%2 == 1) o.push_back(a);
		else		e.push_back(a);
	}
	if(n%2 == 0){
		for(auto i=e.rbegin();i!=e.rend();i++){
			cout << *i << " ";
		}
		for(auto i=o.begin();i!=o.end();i++){
			cout << *i << (i==o.end()-1?"\n":" ");
		}
	}
	else{
		for(auto i=o.rbegin();i!=o.rend();i++){
			cout << *i << " ";
		}
		for(auto i=e.begin();i!=e.end();i++){
			cout << *i << (i==e.end()-1?"\n":" ");
		}
	}
	return 0;
}

Measured memory_bytes: 3188
#include<stdio.h>

int main(void)
{
	int a;
	int b;
	int c;
	int d;
	int e;

	scanf("%d %d %d",&a,&b,&c);
	//scanf("%d",&b);
	//scanf("%d",&c);
		
	if(a < b){
		d = b;
		e = a;
		}
	else{
		d = a;
		e = b;
		}
	if(d < c){
			printf("%d %d %d\n",e,d,c);
	}else if(c < e){            
			printf("%d %d %d\n",c,e,d);
	}else {
			printf("%d %d %d\n",e,c,d);
		}
	
	return 0;
}

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

using namespace std;
int main(){
    int N;
    cin >> N;
    vector<long long> l(N);
    for(int i = 0; i < N; i++) cin >> l.at(i);
    int ans = 0;
    rep(i, N) rep(j,N) rep(k,N){
        if(!(i <= j && j <= k)) continue;
        if(!(l.at(i) + l.at(j) > l.at(k) && l.at(j) + l.at(k) > l.at(i) && l.at(k) + l.at(i) > l.at(j))) continue;
        if(l.at(i) == l.at(j) || l.at(j) == l.at(k) || l.at(k) == l.at(i)) continue;
        ans++;
    }
    cout << ans << endl;
    return 0;
}



Measured memory_bytes: 3608
s = input()
a = 0
z = 0
s_num = len(s)
for i in range(s_num):
    if s[i] == 'A':
        a += i
        break
for i in range(s_num - 1, 0, -1):
    if s[i] == 'Z':
        z += i
        break
print(z - a + 1)

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

int main(){
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    string s;
    cin>>s;
    int n = s.size();
    for(int i = 0 ; i < n ; i++){
        cout<<'x';
    }
    cout<<'\n';
}

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

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

    ll ans;
    cin >> ans;
    rep(i, n - 1) {
        ll t;
        cin >> t;
        ans = ans / __gcd(ans, t) * t;
    }

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


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const long long int MOD = 1000000007;
const long long  INF = 1LL << 60;

int main(void){
    ll N, A, B; cin >> N >> A >> B;
    
    ll ans = 0;
    ans += (N / (A + B)) * A;
    if (N % (A + B) <= A) ans += N % (A + B);
    if (N % (A + B) > A)  ans += A;
    
    cout << ans << endl;
}


Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <stack>
#include <queue>
#include <algorithm>
#include <string>
#include <bitset>
#include <map>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <sstream>
#include <fstream>
//#include <tuple>
#include <set>
#include <string.h>
#include <functional>

#define X first
#define Y second
#define MP make_pair
//#define MT make_tuple
#define REP(i, a, n) for(int (i) = (a); (i) < (n); ++(i))
#define FOR(i, n) REP(i, 0, n)
typedef long long ll;
using namespace std;
const int MAX = 500;

template<class T, class U>
void convert(T &t, U &u)
{
	stringstream ss;
	ss << t;
	ss >> u;
}

int main()
{
	int n;
	while ( cin >> n ){
		if ( n == -1 ) break;

		double x = 1.00000000000, y = 0.00000000000;
		double bottom = 1.0000000000;
		double tan = 1.00000000000 / bottom;
		double angle = 0.00000000000;

		--n;

		while(n > 0){
			y += 1.0000000000000 * sin( angle + ( 90.000000000000 * 3.1415926535 / 180.00000000000 ) );
			x += 1.0000000000000 * cos( angle + ( 90.000000000000 * 3.1415926535 / 180.00000000000 ) );

			angle += atan( tan );

			bottom = sqrt( (y - 0.00000000000) * (y - 0.00000000000) + (x - 0.00000000000) * (x - 0.00000000000) );
			tan = 1.000000000000 / bottom;

			--n;
		}

		printf("%0.2f\n", x);
		printf("%0.2f\n", y);

	}
	return 0;
}

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

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

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

/*-------------------------------------------------*/

int main(){
  int n, ans = 0;
  cin >> n;
  vector<int> l(n);
  rep(i, n) cin >> l[i];

  sort(all(l));
  for(int i = 0; i < n; i++){
    for(int j = i+1; j < n; j++){
      for(int k = j+1; k < n; k++){
        if(l[i] == l[j] ||
           l[j] == l[k] ||
           l[k] == l[i]) continue;

          if(l[i] + l[j] > l[k]) ans++;
      }
    }
  }

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

Measured memory_bytes: 3628
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

int main(void){
  int N,D;
  char str[100],*p;
  
  fgets(str,sizeof(str),stdin);
  p=strtok(str," \n");
  N=atoi(p);
  p=strtok(NULL," \n");
  D=atoi(p);
  
  if(N%(2*D+1)==0){
    printf("%d\n",N/(2*D+1));
  }else{
    printf("%d\n",N/(2*D+1)+1);
  }
  
  return 0;
}

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

#define rep(i, n) for (int i = 0; i < (n); i++)
using namespace std;
typedef long long ll;
const int INF = 1e9;

ll a, b, n, c1, c2, ans = 0;

ll f(ll x) { return floor(a * x / b) - a * floor(x / b); }

ll g(ll x) {
  ll l = 0, r = n;
  rep(i, 100) {
    c1 = (l * 2 + r) / 3;
    c2 = (r * 2 + l) / 3;
    f(c1) < f(c2) ? l = c1 : r = c2;
  }
  return f(l);
}

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

  ll l = 0, r = n;
  rep(i, 100) {
    c1 = (l * 2 + r) / 3;
    c2 = (r * 2 + l) / 3;
    g(c1) < g(c2) ? l = c1 : r = c2;
  }
  if (f(0) > f(r)) r = 0;
  else if (f(n) > f(r)) r = n;
  cout <<  f(r) << endl;
  return 0;
}


Measured memory_bytes: 3600
#include <iostream>
#include <vector>
#include <cmath>
#define EPS 1.0e-9
#define inf 1000000000

using namespace std;
struct edge{
	int toi, toj;
	double cost;
	edge(int a, int b, double c){
		toi = a, toj = b, cost = c;
	}
};

int n;
double r, th;
int x[25], y[25];
vector<edge> G[25][25];
double dp[10005][25][25];

double dot(double x1, double y1, double x2, double y2)
{
	return x1 * x2 + y1 * y2;
}

double norm(double x, double y)
{
	double d2 = x*x + y*y;
	if(d2 == 0) return 0.0;
	return sqrt(d2);
}

int main(void)
{
	cin >> n >> r >> th;
	for(int i = 0; i < n; i++) cin >> x[i] >> y[i];
	
	double lcos = cos(th * M_PI / 180.0);
	
	double dx1, dx2, dy1, dy2;	
	for(int i = 0; i < n; i++){
		for(int j = 0; j < n; j++){
			if(i == j) continue;
			for(int k = 0; k < n; k++){
				if(j == k) continue;
				
				dx1 = x[j]-x[i], dy1 = y[j]-y[i];
				dx2 = x[k]-x[j], dy2 = y[k]-y[j];
				if( dot(dx1, dy1, dx2, dy2) / norm(dx1, dy1) / norm(dx2, dy2) >= lcos){
					G[i][j].push_back( edge(j, k, norm(dx2, dy2) ) );
				}
			}
		}
	}
	
	
	for(int i = 0; i <= r; i++){
		for(int j = 0; j < n; j++){
			for(int k = 0; k < n; k++){
				dp[i][j][k] = inf;
			}
		}
	}
	for(int i = 1; i < n; i++) dp[1][0][i] = norm(x[i]-x[0], y[i]-y[0]);
	
	
	for(int i = 1; i < r; i++){
		for(int j = 0; j < n; j++){
			for(int k = 0; k < n; k++){
				for(int l = 0; l < G[j][k].size(); l++){
					dp[i+1][G[j][k][l].toi][G[j][k][l].toj] = min(dp[i+1][G[j][k][l].toi][G[j][k][l].toj], dp[i][j][k] + G[j][k][l].cost);
				}
			}
		}
	}
	
	int ans = 0;
	for(int i = r; i >= 0; i--){
		for(int j = 0; j < n; j++){
			for(int k = 0; k < n; k++){
				if(dp[i][j][k] <= r){
					ans = i;
					goto end;
				}
			}
		}
	}
	end:;
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 52136
#include <iostream>
#include <queue>
#include <vector>
#define mx 3*200005
//#define mn -(1long long << 50)
using namespace std;
priority_queue <long long , vector<long long> , greater<long long> > q1;
priority_queue <long long> q2;
long long sum1[mx],sum2[mx];
long long arr[mx];
int main()
{
    int n;
    cin >> n;
    for(int i=0;i<3*n;i++)
        cin >> arr[i];
    for (int i=0 ; i<3*n-1 ; i++)
    {
        sum1[i] = (i > 0 ? sum1[i-1] : 0)+arr[i];
        q1.push(arr[i]);
        if(q1.size() <= n) continue;
        sum1[i]-=q1.top();
        q1.pop();
    }

    for (int i=3*n-1 ; i >= 0 ; i--)
    {
        sum2[i] =arr[i]+ sum2[i+1];
        q2.push(arr[i]);
        if (q2.size() <= n) continue;
        sum2[i]-=q2.top();
        q2.pop();
    }
    long long ans=-(1LL << 50);

    for (int i=n-1 ; i < 2*n ; i++)
        ans=max(sum1[i]-sum2[i+1],ans);

    cout << ans << endl;
}


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

using namespace std;

#define int long long
#define ll long long
typedef pair<int, int> P;
#define mod 998244353
#define INF (1LL<<60)

#define rep(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)
#define YES puts("YES\n")
#define Yes puts("Yes\n")
#define NO  puts("NO\n")
#define No  puts("No\n")
int gcd(int a, int b) { return b ? gcd(b, a % b) : a; }


signed main() {

	int N;
	cin >> N;
	vector<int> p(N);
	rep(i, N) cin >> p[i];

	vector<int> copy(N);
	rep(i, N) copy[i] = p[i];

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

	int a = 0;
	rep(i, N) {
		if (p[i] != copy[i]) a++;
	}
	if (a == 0 || a == 2) YES;
	else NO;

	return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<string>
#include<vector>
#include<cmath>
#include<algorithm>
#define lli long long int
#define uli unsigned long long int
#define inf 999999999999999999
#define rep(i,m,n) for(lli i = m;i < n;i++)
#define per(i,m,n) for(lli i=m-1;i>=n;i--)
#define st(n) sort(n.begin(), n.end())
#define rev(n) reverse(n.begin(),n.end())
#define ou(S) cout << S << endl
using namespace std;
int main(){
  int a,b;
  cin>>a>>b;
  if(a==1)a=14;
  if(b==1)b=14;
  if(a>b)cout<<"Alice"<<endl;
  else if(b>a)cout<<"Bob"<<endl;
  else cout<<"Draw"<<endl;
}

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

#define fi first
#define se second
typedef long long ll;
const int N = 2e5 +7;

char s[109];
int main()
{
    int k;
    scanf("%d",&k);
    scanf("%s",s);
    int n = strlen(s);
    if(n<=k)
        printf("%s\n",s);
    else{
            for(int i = 0; i < k; i++)
            printf("%c",s[i]);
           printf("...\n");

    }
}


Measured memory_bytes: 3764
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

public class AtCoderA
{
    static void Main()
    {
        var sc = new Scanner();

        int n = sc.NextInt();
        int m = sc.NextInt();

        List<int>[] from = new List<int>[n + 1];

        for (int i = 0; i < n + 1; i++)
        {
            from[i] = new List<int>();
        }

        for (int i = 0; i < m; i++)
        {
            int a = sc.NextInt();
            int b = sc.NextInt();

            from[a].Add(b);
            from[b].Add(a);
        }

        int[] answer = new int[n + 1];
        answer[1] = 1;

        Queue<int> que = new Queue<int>();
        que.Enqueue(1);
        while (que.Count > 0)
        {
            var num = que.Dequeue();

            var nextList = from[num];
            foreach (var next in nextList)
            {
                if (answer[next] == 0)
                {
                    answer[next] = num;
                    que.Enqueue(next);
                }
            }
        }

        Console.WriteLine("Yes");
        for (int i = 2; i <= n; i++)
        {
            Console.WriteLine(answer[i]);
        }
    }

    class Scanner
    {
        private string[] _line;
        private int _index;
        private const char Separator = ' ';

        public Scanner()
        {
            _line = new string[0];
            _index = 0;
        }

        public string Next()
        {
            while (_index >= _line.Length)
            {
                _line = Console.ReadLine().Split(Separator);
                _index = 0;
            }

            return _line[_index++];
        }

        public int NextInt() => int.Parse(Next());
        public long NextLong() => long.Parse(Next());
        public double NextDouble() => double.Parse(Next());
        public decimal NextDecimal() => decimal.Parse(Next());
        public char NextChar() => Next()[0];
        public char[] NextCharArray() => Next().ToCharArray();

        public string[] Array()
        {
            _line = Console.ReadLine().Split(Separator);
            _index = _line.Length;
            return _line;
        }

        public int[] IntArray() => Array().Select(int.Parse).ToArray();
        public long[] LongArray() => Array().Select(long.Parse).ToArray();
        public double[] DoubleArray() => Array().Select(double.Parse).ToArray();
        public decimal[] DecimalArray() => Array().Select(decimal.Parse).ToArray();
    }
}

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

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

const double PI = 3.14159265358979323846;
const double EPS = 1e-12;
const ll INF = 1LL<<29;
const ll mod = 1e9+7;

#define rep(i, a, b) for(ll (i) = (a); (i) < (b);++i)

int main() {
	ll N, Q;
	cin >> N;
	ll a[N];
	rep(i,0,N) cin >> a[i];
	cin >> Q;
	ll x[Q], y[Q];
	rep(i,0,Q) {
		cin >> x[i] >> y[i];
		x[i]--;
		y[i]--;
	}

	ll b[N];
	rep(i,0,N) b[i] = a[i];

	sort(b, b+N);
	int clear = 0;
	rep(i,0,N) {
		if (a[i] == b[i]) clear++;
	}
	if (clear == N) {
		cout << 0 << endl;
		return 0;
	}

	rep(i,0,Q) {
		if (a[x[i]] == b[x[i]]) { --clear; }
		if (a[y[i]] == b[y[i]]) { --clear; }
		if (a[x[i]] == b[y[i]]) { ++clear; }
		if (a[y[i]] == b[x[i]]) { ++clear; }
		swap(a[x[i]], a[y[i]]);
		if (clear == N) { cout << i+1 << endl; return 0; }
	}
	cout << -1 << endl;
	return 0;
}



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

int main(int argc, char *argv[]){
    int N;
    std::cin >> N;
    std::vector<long int>H(N);
    for(auto &h: H){
        std::cin >> h;
    }

    int step = 0;
    int maxStep = 0;
    long int lastH = H[0], newH;
    for(int i=1; i<N; ++i){
        newH = H[i];
        if(newH <= lastH){
            ++step;
        }else{
            if(maxStep < step){
                maxStep = step;
            }
            step = 0;
        }
        lastH = newH;
    }
    if(maxStep < step){
        maxStep = step;
    }

    std::cout << maxStep << std::endl;
    return 0;
}


Measured memory_bytes: 1024
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define int long long
#define double long double
#define rep(i,s,n) for(int i = (s); i < (n); i++)
#define all(v) begin(v), end(v)
#define allg(v) begin(v), end(v), greater<int>()



signed main() {
  cin.tie(nullptr);
  ios::sync_with_stdio(false);
  
  string s;
  ll n;
  
  cin >> s;
  
  //vector<ll> a(n);  rep(i, 0, n) cin >> a[i];
  
  bool a = (s.at(2) == s.at(3));
  bool b = (s.at(4) == s.at(5));
    
  cout << (a and b ?"Yes" :"No") << "\n";
  
  //cout << fixed << setprecision(10) << n << "\n";

}


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

#define CHMAX(a,b) a = std::max(a,b)
#define CHMIN(a,b) a = std::min(a,b)
#define CHABS(a) a = std::abs(a) 
#define COUT(a) std::cout << a << std::endl
#define CERR(a) std::cerr << a << std::endl
#define FOR(n) for(lli i = 0; i < n; i++)

using namespace std;
using lli = long long int;
using pll = pair<lli, lli>;
using tlll = tuple<lli, lli, lli>;
using vll = vector<lli>;

lli mod197 = 1000000007LL;
lli INF = 10000000000000;

// ax + by = gcd(a,b) 最大公約数
template< typename T >
T extgcd(T a, T b, T& x, T& y) {
	T d = a;
	if (b != 0) {
		d = extgcd(b, a % b, y, x);
		y -= (a / b) * x;
	}
	else {
		x = 1;
		y = 0;
	}
	return d;
}


int main(void) {

	int n, k;
	cin >> n >> k;

	COUT(((n + 1) / 2 >= k ? "YES" : "NO"));


	return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define ll long long int
int main(){
    string s;
    cin>>s;
    vector<char>v;
    for(int i=0;i<s.length();i++){
        if(s[i]==',')v.push_back(' ');
        else v.push_back(s[i]);
    }
    for(int i=0;i<v.size();i++)cout<<v[i];
}

Measured memory_bytes: 256
#include <set>
#include <map>
#include <queue>
#include <deque>
#include <stack>
#include <cstdio>
#include <string>
#include <cmath>
#include <cstring>
#include <iostream>
#include <algorithm>

#define x first
#define y second

//#define int long long

using namespace std;

//typedef int long long;
typedef pair<int,int>PII;

const int maxn = 2e5 + 10;

int t,n,m;


int main(void) {
	scanf("%d",&n);
	for(int i = -120; i <= 120; i ++) {
		for(int j = -120; j <= 120; j ++) {
			if(pow(i,5) - pow(j,5) == n) {
				printf("%d %d\n",i,j);
				return 0;
			}
		}
	}
	return 0;	
} 

Measured memory_bytes: 4208
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using str = string;
typedef vector<string> vs;
typedef vector<bool> vb;
typedef vector<char> vc;
typedef vector<ll> vll;
typedef vector<vll> vvll;
typedef vector<vs> vvs;
typedef vector<vc> vvc;
typedef vector<vb> vvb;
using P = pair<ll,ll>;
#define REP(i, n) for (ll i = 0; i < (int)(n); i++)
#define RREP(i, n) for (ll i = (int)(n)-1; i > -1 ; i--)
#define IN(T, x) T x;cin >> x;
#define AIN(T, a, n) vector<T> a(n);REP(i, n){cin >> a[i];}
#define A2IN(T1, a, T2, b, n) vector<T1> a(n);vector<T2> b(n);REP(i, n){cin >> a[i] >> b[i];}
#define ALL(a) (a).begin(),(a).end()
#define SORT(a) sort(ALL(a))
#define RSORT(a) SORT(a);reverse(ALL(a))
#define pb push_back
#define mp make_pair
#define PF first
#define PS second
template<class T>bool chmax(T &a,const T &b){if(a<b){a=b;return 1;}return 0;}
template<class T>bool chmin(T &a,const T &b){if(b<a){a=b;return 1;}return 0;}
template<typename A, size_t N, typename T>void Fill(A (&array)[N], const T &val){fill( (T*)array, (T*)(array+N), val );}
#define OUT(x) cout << x << endl;
#define OUTD(x) cout << fixed << x << endl;
#define BOUT(b) if(b){OUT("Yes");}else{OUT("No");}
const ll MOD = 100000007;
const ll INF = 10e9;
#define PI 3.14159265369;
ll dx[4] = {1,-1,0,0};
ll dy[4] = {0,0,1,-1};
ll ddx[8] = {1,1,1,-1,-1,-1,0,0};
ll ddy[8] = {0,1,-1,0,1,-1,1,-1};


int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  
  IN(ll,N);
  IN(ll,D);
  ll count = 0;
  vll X2(130);
  REP(i,130)
    X2.at(i) = (i+1)*(i+1);
  vvll X(N,vll(D));
  REP(i,N){
    REP(j,D){
      ll x;
      cin >> X.at(i).at(j);
    }
  }
  REP(i,N-1){
    for(ll j = i + 1; j < N;j++){
      ll sum = 0;
      REP(k,D){
      	sum += (X.at(i).at(k) - X.at(j).at(k))*(X.at(i).at(k) - X.at(j).at(k));
      }
      REP(k,130){
        if(X2.at(k) == sum){
          count++;
        }
      }
    }
  }
  OUT(count);
}



Measured memory_bytes: 256
#include <iostream>
#include <fstream>
#include <cstdio>
#include <cstring>
#include <queue>
#include <stack>
#include <vector>
#include <map>
#include <set>
#include <cmath>
#include <algorithm>
#include <functional>
#define inf 0x7fffffff
using namespace std;
typedef long long ll;
const int MAXN=1e5+10;
const int MAX=1e5+10;
const double eps=1e-6;
 
int a,b,c,d,e,f;
int v=0,val=0;
double p,t;
bool vis[3010][3010];
 
void dfs(double temp,int x,int y){
	if(x+y>f)
		return;
	if(temp>t)
		return;
	if(temp>p){
		p=temp;
		v=x;
		val=y;
		//cout<<temp<<" "<<x<<" "<<y<<endl;
	}
	if(y+c<=f&&!vis[x][y+c]){
		vis[x][y+c]=1;
		dfs((double)(y+c)/(x+c+y),x,y+c);
	}
	if(y+d<=f&&!vis[x][y+d]){
		vis[x][y+d]=1;
		dfs((double)(y+d)/(x+d+y),x,y+d);
	}
	if(x+a<=f&&!vis[x+a][y]){
		vis[x+a][y]=1;
		dfs((double)(y)/(x+a+y),x+a,y);
	}
	if(x+b<=f&&!vis[x+b][y]){
		vis[x+b][y]=1;
		dfs((double)(y)/(x+b+y),x+b,y);
	}
}
 
int main(){
    #ifdef ONLINE_JUDGE
    #else
    //freopen("in.txt","r",stdin);
    //freopen("out.txt","w",stdout);
    #endif
 
    cin>>a>>b>>c>>d>>e>>f;
    a=a*100;b=b*100;
    t=(double)e/(100+e);
    p=0;
    //printf("%lf\n",t);
    dfs(0,0,0);
    if(p==0)
    	cout<<a<<" "<<0<<endl;
    else
    	cout<<v+val<<" "<<val<<endl;
 
    return 0;	
}

Measured memory_bytes: 6400
/*Template by hemnath_d(Enlightened by chamow)*/
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define ld long double
#define vec vector<ll>
#define pll pair<ll,ll>
#define fastread ios_base::sync_with_stdio(false); cin.tie(NULL);
#define pb push_back
#define mp make_pair
#define fx first
#define sx second
#define inf 100000000000000
#define minf -100000000000000
#define maxi 100005

int main()
{
    fastread;
    int n;
    string s;
    cin>>n>>s;
    //precompute
    int totSize = 2e5 + 1;
    vector<int> preComp(totSize);
    preComp[0] = 0;
    for(int i = 1; i < preComp.size(); i++) {
    	preComp[i] = 1 + preComp[i % __builtin_popcount(i)];
    }
    int cnt = 0;
    for(int i = 0; i < n; i++) {
    	if(s[i] == '1') {
    		cnt++;
    	}
    }
    //Ans for cnt - 1
    long long rans = 0, cur = 1;
    for(int i = n - 1; i >= 0 && cnt > 1; i--) {
    	if(s[i] == '1') {
    		rans = (rans + cur) % (cnt - 1);
    	}
    	cur = (cur * 2) % (cnt - 1);
    	//cout<<"rans "<<i<<" "<<rans<<endl;
    }
    //Ans for cnt + 1
    long long ians = 0;
    cur = 1;
    for(int i = n - 1; i >= 0; i--) {
    	if(s[i] == '1') {
    		ians = (ians + cur) % (cnt + 1);
    	}
    	cur = (cur * 2) % (cnt + 1);
    }
    vector<int> ans;
    int cura = 1, curb = 1;
    for(int i = n - 1; i >= 0; i--) {
    	if(s[i] == '1') {
    		long long tans = rans - cura + cnt - 1;
    		//cout<<i<<" "<<tans<<" "<<rans<<" "<<cura<<endl;
    		tans = tans % (cnt - 1);
    		tans = 1 + preComp[tans];
    		if(cnt <= 1) {
    			ans.push_back(0);
    		}
    		else {
    			ans.push_back(tans);
    		}
    	}
    	else {
    		long long tans = ians + curb;
    		tans = tans % (cnt + 1);
    		tans = 1 + preComp[tans];
    		ans.push_back(tans);
    	}
    	if(cnt > 1) {
    		cura = (cura * 2) % (cnt - 1);
    	}
    	curb = (curb * 2) % (cnt + 1);
    }
    reverse(ans.begin(), ans.end());
    for(int i = 0; i < ans.size(); i++) {
    	cout<<ans[i]<<endl;
    }
    return 0;
}

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

int main(){
  int N,i;
  cin >> N;          
  vector<int> d(N);

  for(i=0;i<N;i++)
  cin >> d.at(i);

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

  cout << d.at(N/2) - d.at(N/2-1) << endl;
}

Measured memory_bytes: 640
N, H = map(int,input().split())
L = []
maxi = 0
for _ in range(N):
    a,b = map(int,input().split())
    maxi = max(maxi, a)
    L.append(b)
 
L = sorted([x for x in L if x > maxi],reverse=True)
throw = 0
for i in range(len(L)):
    throw += L[i]
    if throw >= H:
        print(i + 1)
        quit()
from math import ceil
print(ceil((H - throw) / maxi) + len(L))
    


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

#define int long long
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define REP(i, n) FOR(i, 0, n)
#define ALL(a) (a).begin(), (a).end()
#define SZ(a) (signed)((a).size())
#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 SORT(c) sort((c).begin(), (c).end())

using namespace std;

typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;

const int MOD = 1000000007;

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

signed main(void) {
    ios::sync_with_stdio(false);
    cout.setf(ios::fixed, ios::floatfield);
    cout.precision(10);
    cin.tie(0);

    int n;
    cin >> n;
    VI s(n);
    REP(i, n) {
        char c;
        cin >> c;
        s[i] = (c == 'o' ? 0 : 1);
    }

    REP(x, 2) {
        REP(y, 2) {
            bool f = true;
            VI ans(n);
            ans[0] = x;
            ans[1] = y;
            int t;
            FOR(i, 2, n+2) {
                if (s[(i - 1)%n] == 0) {
                    if (ans[(i - 1)%n] == 0) {
                        t = 0;
                    } else {
                        t = 1;
                    }
                } else {
                    if (ans[(i - 1)%n] == 0) {
                        t = 1;
                    } else {
                        t = 0;
                    }
                }
                if(i<n){
                    ans[i] = (ans[(i - 2)%n] + t) % 2;
                }else{
                    if(ans[i%n] != (ans[(i - 2)%n] + t) % 2){
                        f = false;
                    }
                }
            }
            if(f){
                REP(i,n){
                    cout << (ans[i]==0?'S':'W');
                }
                cout << endl;
                return 0;
            }
        }
    }

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


Measured memory_bytes: 1904
#include <bits/stdc++.h>
#define INT long long
#define P 998244353
using namespace std;
INT a, b, s;
int main()
{
    ios::sync_with_stdio(false);
    cin>>a>>b;
    for(int i = 1 ; i < b-a ; i++ )
        s += i;
    cout<<s-a<<endl;
    return 0;
}



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

int main(){
  int x, a, b;
  cin >> x >> a >> b;
  if(a-b >= 0) cout << "delicious\n" << endl;
  else if(b <= a+x) cout << "safe\n" << endl;
  else cout << "dangerous\n" << endl;
}


Measured memory_bytes: 256
#include<stdio.h>
#include<iostream>
#include<string.h>
#include<string>
#include<queue>
#include<utility>
#include<vector>
#include<map>
#include<functional>
#include<algorithm>
typedef long long ll;
using namespace std;

int main(){
  int N;
  string tmp;
  double okane;
  double sum=0;
  cin >> N;
  for(int i=0;i<N;i++){
    cin >> okane;
    cin >> tmp;
    if(tmp == "BTC"){
      okane *= 380000;
    }
    sum += okane;
  }
  cout << sum << endl;
  return 0;
}

Measured memory_bytes: 888
#include <iostream>
#include <vector>
#include <map>

using namespace std;
typedef long long ll;
#define REP(i,n) for (ll i = 0; i < (n); ++i)


struct mint{
    static const long long MOD = 998244353LL;

    long long v;

    mint() : v(0) {}
    mint(long long x){
        x = x % MOD;
        if(x < 0){ x += MOD; }
        v = x;
    }
    mint& operator+=(mint a){
        v += a.v;
        if(v >= MOD){ v -= MOD; }
        return *this;
    }
    mint& operator*=(mint a){
        v *= a.v;
        v %= MOD;
        return *this;
    }
    mint& operator-=(mint a){
        v -= a.v;
        if(v < 0){ v += MOD; }
        return *this;
    }
    mint& operator/=(mint a){
        return (*this) *= a.inv();
    }

    mint operator*(mint a) const{
        return mint(v) *= a;
    }

    mint operator+(mint a) const {
        return mint(v) += a;
    }

    mint operator-(mint a) const {
        return mint(v) -= a;
    }

    mint operator/(mint a) const {
        return mint(v) /= a;
    }

    mint pow(long long k) const {
        mint res(1),tmp(v);
        while(k){
            if(k&1) res *= tmp;
            tmp *= tmp;
            k >>= 1;
        }
        return res;
    }
    mint inv(){return pow(MOD - 2); }

    static mint comb(long long n, int k){
        mint res(1);
        for(int i = 0; i < k; ++i){
            res *= mint(n - i);
            res /= mint(i + 1);
        }
        return res;
    }

    static mint factorial(long long n){
        mint res(1);
        for(int i = n; i > 1; --i){
            res *= mint(i);
        }
        return res;
    }

    bool operator<(const mint &a) const {
        return v < a.v;
    };
};

mint operator*(long long l, mint r){ return r * l; }

std::ostream& operator<<(std::ostream& stream, const mint& m){
    stream << m.v;
    return stream;
}

int main(){
    ll n;
    cin >> n;
    vector<ll> d(n);
    map<ll, ll> num;
    REP(i, n){
        cin >> d.at(i);
        num[d.at(i)]++;
    }
    if(d.at(0) != 0){
        cout << 0 << endl;
        return 0;
    }
    mint ans = 1;
    for(auto it = num.begin(); it != num.end(); ++it){
        if(it->first == 0){
            if(it->second > 1){
                cout << 0 << endl;
                return 0;
            }else{
                continue;
            }
        }
        if(num.count(it->first - 1) == 0){
            cout << 0 << endl;
            return 0;
        }else{
            REP(j, it->second){
                ans *= num[it->first - 1];
            }
        }
    }
    cout << ans << endl;
    return 0;
}


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

long long n, w, dp[110][100100], a[110], b[110];

long long solve(int i, long long c){
	
	if(i == n || c <= 0) return 0;
	
	if(dp[i][c] == -1) dp[i][c] = max(c < a[i] ? 0 : (solve(i + 1, c - a[i]) + b[i]), solve(i + 1, c));
	
	return dp[i][c];
}

int main(){
	
	scanf("%lld %lld", &n, &w);
	
	for(int i = 0; i < n; i++) scanf(" %lld %lld", &a[i], &b[i]);
	
	for(int i = 0; i < n + 1; i++) for(int j = 0; j < w + 1; j++) dp[i][j] = -1;
	
	printf("%lld\n", solve(0, w));
	
	return 0;
}


Measured memory_bytes: 82616
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Scanner;

public class Main{
	public static void main(String[] args){
      InputStream inputStream = System.in;
      OutputStream outputStream = System.out;
      Scanner sc = new Scanner(inputStream);
      PrintWriter out = new PrintWriter(outputStream);
      int A = Integer.parseInt(sc.next());
      int B = Integer.parseInt(sc.next());
      int C = Integer.parseInt(sc.next());
      int D = Integer.parseInt(sc.next());
      
      if(A + B < C + D){
      	out.println("Right");
      }else if(A + B > C + D){
      	out.println("Left");
      }else{
      	out.println("Balanced");
      }  
      out.close();
    }
}

Measured memory_bytes: 21844
using System;
using System.Collections.Generic;

class Program
{
	static void Main(string[] args)
	{
		string[] input = Console.ReadLine().Split(' ');
		int n = int.Parse(input[0]);
		input = Console.ReadLine().Split(' ');
		long[] A = new long[n];
		for(int i=0;i<n;i++)
		{
			A[i] = long.Parse(input[i]);
			if(A[i]==0)
			{
				Console.WriteLine(0);
				return;
			}
		}
		long ans = 1;
		try
		{
          checked{
			for(int i=0;i<n;i++)
			{
				ans *= A[i];
				if(ans > 1000000000000000000)
				{
					ans = -1;
					break;
				}
			}
          }
		}
		catch (System.OverflowException e)
		{
			ans = -1;
		}

		Console.WriteLine(ans);
	}

}



Measured memory_bytes: 41716
#include <bits/stdc++.h>
#define rep(i,n) for(int i = 0; i < (n); i++)
#define For(i,start,end) for(i64 i = start; i < end; i++)
#define newline std::cout<<'\n';
#define newlinedx(num) for(int i=0;i<num;i++)std::cout<<'\n';
using namespace std;
typedef long long ll;
typedef unsigned long ul;

using i8  = int8_t;
using u8  = uint8_t;
using i16 = int16_t;
using u16 = uint16_t;
using i32 = int32_t;
using u32 = uint32_t;
using i64 = int64_t;
using u64 = uint64_t;
using f32 = float;
using f64 = double;
using ui = uint64_t;

//----------------library in this time--------------------------------
template <class T>
T gcd(const T a,const T b) {
    return (b == 0) ? a : gcd (b, a % b);
}
template <class T>
T lcm(const T a, const T b) {
    return a * b / gcd(a,b);
}
template <class T>
inline T ave(const T a, const T b) {
    return (a + b) / 2.0f;
}

long long squareTwo(const long long a,const long long b) {
    return (b == 1) ? a : squareTwo(a * 2, b - 1);
}

template <class T>
inline T Max(const T a,const T b) {
    return (a >= b) ? a : b;
}

template <class T>
inline T Min(const T a,const T b) {
    return (a <= b) ? a : b;
}


//------------------------main function-------------------------------
void Main(){
    int n; cin >> n;
    cout << n * n * 3 << endl;
}

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

Measured memory_bytes: 256
#include<cstdio>
#include<cstring>
#include<algorithm>
#include<functional>
using namespace std;
int main(void)
{
	int i,y,x,d;
	int sum; 
	while(scanf("%d",&d)!=EOF) {
		sum=0;
		for(i=0;i<600;i+=d) sum+=(i*i)*d;
		printf("%d\n",sum);
	}
	return 0;
}

Measured memory_bytes: 1024
'''بِسْمِ اللَّهِ الرَّحْمَٰنِ الرَّحِيمِ'''
#codeforces
gi = lambda : list(map(int,input().split()))
if sum(list(map(int, list(input())))) % 9:
	print("No")
else:
	print("Yes")

Measured memory_bytes: 11992
import math

a, b, c = [int(arg) for arg in input().split()]
s = a * b * math.sin(math.pi * c / 180) / 2
l = a + b + math.sqrt(a**2 + b**2 - 2 * a * b * math.cos(math.pi * c / 180))
h = 2 * s / a
print(s)
print(l)
print(h)



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

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

int main()
{
    int h1, m1, h2, m2, k;
    cin >> h1 >> m1 >> h2 >> m2 >> k;

    int h = h2 - h1; //起きてる時

    int m = m2 - m1;
    if (m < 0)
    {
        m = 60 + m;
        h--;
    }

    int result = h * 60 + m;

    cout << result - k << endl;
    return 0;
}

Measured memory_bytes: 3624
# coding: utf-8
# Your code here!

import sys
sys.setrecursionlimit(10**6)
readline = sys.stdin.readline 

n = int(input())
a = [int(i) for i in readline().split()]
b = [int(i) for i in readline().split()]
pb = [(bi,i) for i,bi in enumerate(b)]

sa = sorted(a)
sb = sorted(b)
pb.sort()

na = [a[i] for bi,i in pb]


ok = 1
for i,j in zip(sa,sb):
    if i > j: ok = 0

for i,j in zip(sa[1:],sb):
    if i <= j: break
else:
    #sa => na が巡回置換か？
    d = {ai:i for i,ai in enumerate(sa)}
    ra = [d[ai] for ai in na]
    
    #print(ra,ok)    
    now = 0
    for i in range(n-1):
        now = ra[now]
        #print(now)
        if now == 0:
            break
    else: ok = 0    


    

#print(a,b,sa,sb,na)

if ok: print("Yes")    
else: print("No")
    
    
    
    
    
    

Measured memory_bytes: 37488
import java.util.*;

public class Main{  
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        Map<String,Integer> sales = new HashMap<>();
        
        int n = sc.nextInt();
        
        for(int i=0; i<n; i++){
            int a = sc.nextInt();
            
            switch(a){
                case 0:
                    sales.put(sc.next(),sc.nextInt());
                    break;
                case 1:
                    System.out.println(sales.get(sc.next()));
                    break;                     
            }
        }
    }
}


Measured memory_bytes: 194264
#include <iostream>
#include <utility>
#include <map>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <array>
#include <math.h>
#include <numeric>
#include <sstream>
#include <queue>
const int INF = 1e9;
const int MOD = 1e9+7;
const long long LINF = 1e18;
#define dump(x)  cout << 'x' << ' = ' << (x) << ` `;
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n) for(int i=0;i<(n);++i)
#define REPR(i,n) for(int i=n;i>=0;i--)
#define FOREACH(x,a) for(auto& (x) : (a) )
typedef long long ll;
using namespace std;
int main(int argc, char const *argv[]) {
    int n;
    cin >> n;
    vector<int> a(n);
    int odd = 0;
    REP(i,n) {
        cin >> a[i];
        if (a[i]%2 == 1) odd++;
    }
    if (odd%2 == 0) cout << "YES" << std::endl;
    else cout << "NO" << std::endl;
    return 0;
}

Measured memory_bytes: 640
#pragma GCC optimize("Ofast")
#include <bits/stdc++.h>
#define rep(i,n) for (int i=0; i<(n); ++i)
using namespace std;
typedef long long ll;
const int INF = 1001001001;

int main() {
    ll N, Q, ans=0;    

    cin >> N;

    vector<int> A(N), a(100001, 0);

    rep(i,N) {
        cin >> A[i];
        a[A[i]]++;
        ans += A[i];
    }

    cin >> Q;

    vector<int> B(Q), C(Q);

    rep(i,Q) {
        cin >> B[i] >> C[i];
        ans += (C[i]-B[i])*a[B[i]];
        a[C[i]] += a[B[i]];
        a[B[i]] = 0;
        cout << ans << endl;
    }



    return 0;
    
}

Measured memory_bytes: 4752
#include <bits/stdc++.h>
using namespace std;
struct Fast {Fast() {std::cin.tie(0); ios::sync_with_stdio(false);}} fast;
using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>;
using pii = pair<int, int>;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define all(x) (x).begin(),(x).end()
#define pb push_back
#define mp make_pair
#define MOD 1000000007



int main() {
    int A, B;
    cin >> A >> B;
    if (A > B) cout << 2 * A - 1 << endl;
    else if (A < B) cout << 2 * B - 1 << endl;
    else cout << 2 * A << endl;
}


Measured memory_bytes: 256
#include<stdio.h>

static const int MAX = 500;
static const int INFTY = (1<<21);

main(){
  int n, i, j;
  int M[MAX][MAX];
  int  k, c, u, v;
  int minv;
  int d[MAX];
  int vis[MAX],a = 0,b;
  b=kansu(a);
  if(b == 0){
  scanf("%d", &n);
  for ( i = 0; i< n; i++ ){
    for ( j = 0; j < n; j++ ){
      M[i][j] = INFTY;
    }
  }

  for ( i = 0; i < n; i++ ){
    scanf("%d %d", &u, &k);
    for ( j = 0; j < k; j++ ){
      scanf("%d %d", &v, &c);
      M[u][v] = c;
    }
  }

  for ( i = 0; i < n; i++ ) {
    d[i] = INFTY;
    vis[i] = 0;
  }

  d[0] = 0;
  if(b == 0){
  while(1){
    minv = INFTY;
    u = -1;
    for ( i = 0; i < n; i++ ){
      if ( minv > d[i] && !vis[i] ){
	u = i;
	minv = d[i];
      }
    }
    if ( u == -1 ) break;
    vis[u] = 1;
    for ( v = 0; v < n; v++ ){
      if ( !vis[v] && M[u][v] != INFTY ){
	if ( d[v] > d[u] + M[u][v] ){
	  d[v] = d[u] + M[u][v];
	}
      }
    }
  }
  }
  for ( i = 0; i < n; i++ ){
    printf("%d %d\n", i, (d[i]==INFTY?-1:d[i]));
  }

  return 0;
}}
int kansu(int a){
 int b=0,c=1;
 if(b == 0);
  if(c == 1);
   return a;
}


Measured memory_bytes: 2052
N, M = map(int, input().split())

num = [0] * N

P = [list(map(int,input().split())) for i in range(M)]

for i in range(M + 1):
    if i == M:
        if N == 1:
            print("".join([str(n) for n in num]))
            break
        elif num[0] == 0:
            num[0] = 1
            print("".join([str(n) for n in num]))
            break
        else:
            print("".join([str(n) for n in num]))
            break
    elif P[i][0] == 1 and P[i][1] == 0:
        if N == 1:
            continue
        else:
            print(-1)
            break
    elif num[P[i][0] - 1] == 0 or num[P[i][0] - 1] == P[i][1]:
        num[P[i][0] - 1] = P[i][1]
    else:
        print(-1)
        break



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

typedef long int lint;
typedef long long int llint;
typedef pair<int, int> pii;
typedef pair<int, string> pis;
typedef pair<long, long> pll;

#define EACH(i, c) for (__typeof((c).begin()) i = (c).begin(); i != (c).end(); ++i)
#define ALL(c) (c).begin(), (c).end()
#define FOR(i, s, e) for (int i = (s); i < (int)(e); ++i)
#define REP(i, n) FOR(i, 0, n)
#define endl '\n'
#define mod 1000000007
#define INF 1000000000
#define fk first
#define sv second

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

template<typename T>
void print(const std::vector<T>& v, char sep=' ') {
  for (int i = 0; i < (int)v.size(); i++) {
    if (i != 0) cout << sep;
    cout << v[i];
  }
  cout << endl;
}

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

  int n, m;
  cin >> n >> m;
  int stx[n], sty[n], cx[m], cy[m];

  REP(i, n){
    cin >> stx[i] >> sty[i];
  }
  REP(i, m){
    cin >> cx[i] >> cy[i];
  }

  REP(i, n){
    int dis = INF;
    int res;
    REP(j, m){
      int num = abs(stx[i] - cx[j]) + abs(sty[i] - cy[j]);
      if (dis > num){
        dis = num;
        res = j + 1;
      }
    }
    cout << res << endl;
  }
}



Measured memory_bytes: 256
#!/usr/bin/env python3

import sys
import math

DEBUG = False

def read(t):
    return t(sys.stdin.readline().rstrip())


def read_list(t, sep = " "):
    return [t(s) for s in sys.stdin.readline().rstrip().split(sep)]


def dprint(*args, **kwargs):
    if DEBUG:
        print(*args, **kwargs)
    return


def main():
    r = read(int)
    print(2 * r * math.pi)


if __name__ == "__main__":
    main()


Measured memory_bytes: 9200
import java.util.Scanner;

public class Main {
	public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		String input = sc.next();
		if (a >= 3200) {
			System.out.println(input);
		} else {
			System.out.println("red");
		}
	}
}

Measured memory_bytes: 35788