akhauriyash/Code-Regression huggingface dataset:
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
 
public class Main {
 
    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
	
	String[] s = br.readLine().split(" ");
	int x = Integer.parseInt(s[0]);
	int y = Integer.parseInt(s[1]);

	int menseki = x*y;
	int shu = (x+y)*2;
	System.out.println(menseki + " " + shu); 
    }
}

Measured memory_bytes: 24288
using System;

namespace abc_132b
{
    class Program
    {
        static void Main(string[] args)
        {
            int index = int.Parse(Console.ReadLine());
            string[] array = Console.ReadLine().Split(' ');
            int[] inputs = new int[index];
            int[] compare = new int[3];
            int count = 0;
            for(int i = 0; i < index; i++)
            {
                inputs[i] = int.Parse(array[i]);
            }
            int x = 0;
            int y = 1;
            int z = 2;
            for (int i = 0; i < index - 2; i++)
            {
                if (inputs[y] < inputs[x] && inputs[y] < inputs[z])
                {
                    x++;
                    y++;
                    z++;
                }
                else if (inputs[y] > inputs[x] && inputs[y] > inputs[z])
                {
                    x++;
                    y++;
                    z++;
                }
                else
                {
                    count++;
                    x++;
                    y++;
                    z++;
                }
            }
            Console.WriteLine(count);
        }
    }
}


Measured memory_bytes: 13140
#include <iostream>
#include <iomanip>
#include <utility>
#include <cmath>
#include <random>
#include <vector>
#include <map>
#include <set>
#include <deque>
#include <queue>
#include <stack>
#include <string>
#include <algorithm>
using namespace std;

#define rep(i,n) for(int i = 0; i<n; ++i)
#define REP(i,n) for(int i = 1; i<=n; ++i)
#define all(x) begin(x),end(x)
typedef long long ll;
typedef pair<int,int> ip;
typedef pair<ll,ll> lp;
const int inf = 1001001000;
const ll INF = 1LL<<60;
const int MOD = (int)1e9 + 7;

int main(){
	string s,t;
	cin>>s>>t;
	map<char,int> se, te;
	vector<int> anss(s.size()), anst(t.size());
	int s_cnt = 0, t_cnt = 0;
	rep(i,s.size()){
		if(se.count(s[i])==0){
			anss[i] = s_cnt;
			se[s[i]] = s_cnt;
			++s_cnt;
		}else{
			anss[i] = se[s[i]];
		}
		if(te.count(t[i])==0){
			anst[i] = t_cnt;
			te[t[i]] = t_cnt;
			++t_cnt;
		}else{
			anst[i] = te[t[i]];
		}
	}
	rep(i,s.size()){
		if(anss[i]==anst[i])continue;
		else{
			cout<<"No"<<endl;
			return 0;
		}
	}
	cout<<"Yes"<<endl;
	return 0;
}


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

namespace _008_Sumof4Integers
{
	class Program
	{
		static void Main ( string[] args )
		{
			string inputStr;

			while ((inputStr = Console.ReadLine ()) != null)
			{
				int count = 0;
				int limit = int.Parse (inputStr);

				for (int loop = 0; loop < 10; loop++)
				{
					for (int loop2 = 0; loop2 < 10; loop2++)
					{
						for (int loop3 = 0; loop3 < 10; loop3++)
						{
							for (int loop4 = 0; loop4 < 10; loop4++)
							{
								if (loop + loop2 + loop3 + loop4 == limit)
									count++;
							}
						}
					}
				}

				Console.WriteLine (count);
			}
		}
	}
}

Measured memory_bytes: 9204
#include <stdio.h>
int main(){
int a;
int b;

while (1){
scanf("%d %d",&a,&b);
if (a == 0 && b == 0)break;
for (int i = 0;i<a;i++){
for (int j = 0;j<b;j++){
if ((i+j)%2 == 0){
printf("#");
}else{
printf(".");
}
}
printf("\n");
}
printf("\n");
}
return 0;
}


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

long long gcd(long long u, long long v){
	long long t;
	if(u > v){ t = u; u = v; v = t; }
	while(v > 0){
		u = u % v;
		t = u;
		u = v;
		v = t;
	}
	return u;
}

long long low(long long i, long long j){
	return i * j / gcd(i, j);
}

long long three_low(long long i, long long j, long long k){
	return low(i, low(j,k));
}

int main(){
	int a1, m1, a2, m2, a3, m3;
	while(cin >> a1 >> m1 >> a2 >> m2 >> a3 >> m3){
		if(!a1 && !m1 && !a2 && !m2 && !a3 && !m3) break;
		int x = 1, y = 1, z = 1;
		long long count1 = 0, count2 = 0, count3 = 0;
		do{
			x = a1 * x % m1;
			count1++;
		}while(x != 1);
		do{
			y = a2 * y % m2;
			count2++;
		}while(y != 1);
		do{
			z = a3 * z % m3;
			count3++;
		}while(z != 1);

		cout << three_low(count1, count2, count3) << endl;
	}
	return 0;
}

Measured memory_bytes: 0
using System;
//using System.Collections;
//using System.Collections.Generic;
using System.Linq;

namespace solution
{
  class Class1
  {
    static void Main()
    {
      var i = Console.ReadLine().Split().Select(int.Parse).ToArray();
      int n = i[0];
      int m = i[1];
      int l = i[2];
      int[][] A = new int[n][];
      int[][] B = new int[m][];
      long sum = 0;

      for (int x = 0; x < n; x++)
      {
        A[x] = Console.ReadLine().Split().Select(int.Parse).ToArray();
      }
      for (int x = 0; x < m; x++)
      {
        B[x] = Console.ReadLine().Split().Select(int.Parse).ToArray();
      }


      for (int w = 0; w < n; w++)
      {
        for (int x = 0; x < l; x++)
        {
          for (int y = 0; y < m; y++)
          {
            sum += A[w][y] * B[y][x];
          }
          Console.Write(sum);
          if (x != l - 1) Console.Write(" ");
          else Console.Write("\n");
          sum = 0;
        }
      }
    }
  }
}


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

#define up(__i,__start,__end) for (int __i = (__start); __i <= (__end); __i++)
#define down(__i, __start,__end) for (int __i = (__start); __i >= (__end); __i--)
#define fi first
#define se second
#define bin(__o) (1 << (__o))
#define bug(x) std::cerr<<"[ "<<(#x)<<":  "<<x<<" ]"<<std::endl
#define bugline std::cerr<<"Passing:  "<<__LINE__<<std::endl
#define bugm(...) fprintf(stderr, __VA_ARGS__)

typedef long long ll;
typedef unsigned long long ull;
typedef double db;

template<typename T> inline T max(T a, T b) {return a > b ? a : b;}
template<typename T> inline T min(T a, T b) {return a < b ? a : b;}
template<typename T> inline bool cmax(T &a, T b) {return a < b ? a = b, 1 : 0;}
template<typename T> inline bool cmin(T &a, T b) {return a > b ? a = b, 1 : 0;}

#define cadd(_x,_y) _x = add(_x, _y)
#define cpop(_x,_y) _x = pop(_x, _y)
#define cmul(_x,_y) _x = mul(_x, _y)

const int mod = 1e9 + 7;

inline int add(int a, int b) {a += b; return a >= mod ? a - mod : a;}
inline int pop(int a, int b) {a -= b; return a < 0 ? a + mod : a;}
inline int mul(int a, int b) {return (ll)a * b % mod;}

int qpow(int a, int b)  {
	int c = 1;
	while (b) {
		if (b & 1) cmul(c, a);	
		b >>= 1; cmul(a, a);
	}
	return c;
}

const int maxn = 5e5 + 5;

int n, a[maxn], fac[maxn];

int c[maxn];

inline int lowbit(int i) { return i & (-i); }

void cg(int o, int v) {
	for (int i = o; i <= n; i += lowbit(i))
		c[i] += v;
}

int get(int o) {
	int sum = 0;
	for (int i = o; i >= 1; i -= lowbit(i))
		sum += c[i];
	return sum;
}

int c2(int m) {
	return (ll)m * (m - 1) / 2 % mod;
}

int suf[maxn], pre[maxn];

int main() {
	
	scanf("%d", &n);	
	up (i, 1, n) scanf("%d", &a[i]);
	fac[0] = 1;
	up (i, 1, n) fac[i] = mul(i, fac[i - 1]);
	int ans = 0, cur = 0, all = 0, cof = 0, bs = 0;
	up (i, 1, n) all += a[i] == 0, cadd(bs, i - 1), pre[i] = 1, suf[i] = 1;
	up (i, 1, n) if (a[i] != 0) cpop(bs, a[i] - 1);
	up (i, 1, n) if (a[i] > 0) suf[a[i]] = 0, pre[a[i]] = 0;
	down (i, n, 1) suf[i] += suf[i + 1];
	up (i, 1, n) pre[i] += pre[i - 1];
	up (i, 1, n) {
		int sum = 0;
		cur += a[i] == 0;
		if (a[i] != 0) {
			cadd(sum, mul(fac[all], a[i] - 1));
			int w = get(a[i] - 1);
			cpop(sum, mul(fac[all], w));
			if (all > 0) cpop(sum, mul(pre[a[i]], mul(cur, fac[all - 1])));
			cadd(cof, suf[a[i]]);
			cg(a[i], 1);
		} else {
			if (all > 0) cadd(sum, mul(bs, fac[all - 1]));
			if (cur >= 2) cpop(sum, mul(c2(all), mul(cur - 1, fac[all - 2])));
			if (all > 0) cpop(sum, mul(cof, fac[all - 1]));
		}
		cadd(ans, mul(sum, fac[n - i]));
	}
	printf("%d\n", add(ans, fac[all]));
	
	return 0;

}

Measured memory_bytes: 9984
#include<iostream>
#include<algorithm>
using namespace std;
int main(){
  int n,cnt=0;
  pair<char,int> h[100],d[100];
  cin>>n;
  for(int i=0;i<n;i++)cin>>h[i].first>>h[i].second;
  for(int i=0;i<n;i++)d[i]=h[i];
  for(int i=0;i<n;i++)
    for(int j=n-1;j>i;j--)
      if(d[j].second<d[j-1].second)swap(d[j],d[j-1]);
  for(int i=0;i<n;i++){
    cout<<d[i].first<<d[i].second;
    i==n-1?cout<<endl:cout<<" ";
  }cout<<"Stable\n";
  for(int i=0;i<n;i++){
    int minj=i;
    for(int j=i;j<n;j++)if(h[j].second<h[minj].second)minj=j;
    swap(h[i],h[minj]);
  }
  for(int i=0;i<n;i++){
    if(h[i]!=d[i])cnt++;
    cout<<h[i].first<<h[i].second;
    i==n-1?cout<<endl:cout<<" ";
  }cnt==0?cout<<"Stable\n":cout<<"Not stable\n";
  return 0;
}

Measured memory_bytes: 3104
n = int(input())
P = list(map(int,input().split()))
count = 0

for i in range(n):
  if(i >= 2):
    if((P[i-2]<P[i-1]<P[i])or(P[i]<P[i-1]<P[i-2])): count += 1
print(count)

Measured memory_bytes: 3060
from sys import stdin
def main():
    #入力
    readline=stdin.readline
    S=readline().strip()
    N=len(S)

    for n in range(N-1,-1,-1):
        if n%2==1:
            continue
        else:
            if S[:n//2]==S[n//2:n]:
                print(n)
                break
if __name__=="__main__":
    main()

Measured memory_bytes: 3060
from collections import Counter

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

L = []
R = []
for i, j in enumerate(lis):
    L.append(i+j)
for i, j in enumerate(lis):
    R.append(i-j)
    
ref = dict(Counter(R))
ans = 0
for i in L:
    ans += ref.get(i, 0)
print(ans)


Measured memory_bytes: 55776
/*****TEMPLATE*****/
      

#include <algorithm>
#include <array>
#include <bitset>
#include <cctype> 
#include <chrono>
#include <climits>
#include <cmath>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <limits>
#include <list>
#include <map>
#include <memory>
#include <numeric>
#include <queue>
#include <random>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <string>
#include <tuple>
#include <type_traits>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>
#include <cstring>
#include <cstdio>
#include <stdio.h>
//INCLUDES
using namespace std;

#define lld long long int
#define ulld unsigned long long int
#define mod 1000000007
#define pb push_back
#define umap unordered_map
#define mp make_pair
#define fi first
#define se second 
#define rep(n) for(int i=0;i<n;i++)
#define fore(i,a,b) for(int i=a;i<=b;i++)
#define fast ios_base::sync_with_stdio(0); cin.tie(0);cout.tie(0);
//DEFINES

lld gcd(lld a,lld b){ if(a<b) { a=a+b; b=a-b; a=a-b;}while(b!=0){lld r=a%b; a=b; b=r;} return a;}
lld bs(lld arr[], lld l, lld r, lld x) { if (r >= l) {  lld mid = l + (r - l) / 2;  if (arr[mid] == x)  return mid; if (arr[mid] > x)  return bs(arr, l, mid - 1, x);  return bs(arr, mid + 1, r, x);  }  return -1; }
lld mypower(lld x, lld n){	if (n == 0)	return 1;	if (n & 1) 	return (((x * mypower(x, n / 2))%mod) * (mypower(x, n / 2)%mod)%mod);return (((mypower(x, n / 2))%mod) * (mypower(x, n / 2)%mod))%mod;}
lld modinv(lld a) { lld g = gcd(a, mod); if (g != 1) return -1;else{  return mypower(a, mod-2)%mod; } } 

//FUNCTIONS
void solve()
{
    lld n;
    cin>>n;
    lld mat[n][3];
    rep(n){
        for(lld j=0;j<3;j++)
        cin>>mat[i][j];
    }
    lld dp[n][3];
    dp[0][0]=mat[0][0];
    dp[0][1]=mat[0][1];
    dp[0][2]=mat[0][2];
    for (int i = 1; i < n; i++) {
        for(lld j=0;j<3;j++)
        {
            dp[i][j]=mat[i][j]+max(dp[i-1][(j+1)%3],dp[i-1][(j+2)%3]);
        }
    }
    cout<<max(dp[n-1][0],max(dp[n-1][1],dp[n-1][2]))<<"\n";
    return;
}
int main() 
{
    fast
    // lld t;
    // cin>>t;
    // while(t--)
    solve();
    return 0;
}



Measured memory_bytes: 8288
#include<stdio.h>

int main(void){
    int A,B,C,X;
    scanf("%d",&A);
    scanf("%d",&B);
    scanf("%d",&C);
    scanf("%d",&X);
    int count = 0;
    int sum = X;
    for(int i=0;i<=A;i++){
        for(int j=0;j<=B;j++){
            for(int k=0;k<=C;k++){
                sum = X-500*i - 100*j-50*k;
                if(sum==0){
                    count++;
                }
            }
        }
    }
    printf("%d",count);
    return 0;
}

Measured memory_bytes: 128
#include<iostream>
#include<algorithm>
#include <vector>
#include<cmath>
#include<iomanip>
#include<queue>
using namespace std;
typedef long long int lint;
int main() {
	string S;
	cin >> S;
	int Z = S.size();
	for (int ia = 0; ia < Z; ia++) {
		if (ia % 2==0) {
			cout << S.at(ia);
		}
	}
	cout << endl;
}



	


Measured memory_bytes: 512
#include<bits/stdc++.h>
using namespace std;
int main(){
  int cnt=0;
  int a,b;
  cin>>a>>b;
  if(a%3==0)cnt++;
  else if(b%3==0)cnt++;
  else if((a+b)%3==0)cnt++;
  if(cnt>0)cout<<"Possible"<<endl;
  else cout<<"Impossible"<<endl;
  return(0);
}

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

using namespace std;

#define fi first
#define se second
#define pb push_back
#define mp make_pair

#define int long long

typedef pair<int, int> ii;

const int mod = 1e9 + 7;

const int N = 1e5 + 5;

int n, m, num[N];
ii x[N];

map<int, int> mymap;

pair<ii, int> z[N];

signed main() {
    cin.tie(0), ios::sync_with_stdio(0);
    cin >> n >> m;
    for(int i = 1; i <= m; i++) {
        cin >> x[i].se >> x[i].fi;
        z[i].fi.fi = x[i].fi;
        z[i].fi.se = x[i].se;
        z[i].se = i;
    }
    sort(z + 1, z + 1 + m);
    for(int i = 1; i <= m; i++)
        mymap[z[i].fi.fi] = ++num[z[i].fi.se];
    for(int i = 1; i <= m; i++) {
        int amount = mymap[x[i].fi];
        int num1 = 0, y = x[i].se;
        while(y != 0) {
            y /= 10;
            num1++;
        }
        for(int j = 1; j <= 6 - num1; j++) {
            cout << 0;
        }
        cout << x[i].se;
        num1 = 0, y = amount;
        while(y != 0) {
            y /= 10;
            num1++;
        }
        for(int j = 1; j <= 6 - num1; j++) {
            cout << 0;
        }
        cout << amount << "\n";
    }
}


Measured memory_bytes: 12416
#include <bits/stdc++.h>
using namespace std;
int main(){
    int n,k,ans,sum;
    while(1){
        cin>>n>>k;
        if(n==0&&k==0){
            return 0;
        }
        vector<int> a(n);
        for(int i=0;i<n;i++){
            cin>>a.at(i);
        }
        ans=0;
        for(int i=0;i<k;i++){
            ans+=a.at(i);
        }
        sum=ans;
        for(int i=1;i<n-k;i++){
            sum=sum+a.at(i+k-1)-a.at(i-1);
                ans=max(ans,sum);
        }
        cout<<ans<<endl;
    }
}



Measured memory_bytes: 3112
#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <queue>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>
#include <complex>
#include <fstream>
#include <stdio.h>

using namespace std;

//conversion
//------------------------------------------
inline int toInt(string s) {int v; istringstream sin(s);sin>>v;return v;}
template<class T> inline string toString(T x) {ostringstream sout;sout<<x;return sout.str();}

//typedef
//------------------------------------------
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<double> VEC;
typedef vector<VEC> MAT;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef pair<int, PII> TIII;
typedef long long LL;
typedef vector<LL> VLL;

//container util

//------------------------------------------
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((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())
#define MT(a,b,c) MP(a, MP(b, c))
#define T1 first
#define T2 second.first
#define T3 second.second


//repetition
//------------------------------------------
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)
#define EPS 1e-8

int main(){
	while(1){
		int n,m,a;
		cin>>n>>m>>a;
		if(n==0)return 0;
		a--;
		VI v(n);
		vector<TIII> hpq;
		REP(i,n)v[i]=i+1;
		REP(i,m){
			int h,p,q;
			cin>>h>>p>>q;
			p--,q--;
			hpq.PB(MT(h,p,q));
		}
		//sort(ALL(hpq), greater<TIII>());
		SORT(hpq);
		REP(i,m){
			TIII &tmp = hpq[i];
			swap(v[tmp.T2], v[tmp.T3]);
		}
		cout<<v[a]<<endl;
	}
}

Measured memory_bytes: 1224
#include <iostream>
#include <algorithm>
#include <math.h>
using namespace std;

int main(){
    int c[3][3];
    for(int i = 0; i < 3; i++){
        for(int j = 0; j < 3; j++){
            cin >> c[i][j];
        }
    }

    int a[3][2];
    int b[2][3];
    for(int i = 0; i < 3; i++){
        for(int j = 0; j < 2; j++){
            a[i][j] = c[i][j+1] - c[i][j];
            b[j][i] = c[j+1][i] - c[j][i];
        }
    }

    bool flag = true;

    for(int i = 0; i < 2; i++){
        for(int j = 0; j < 2; j++){
            if(a[i][j]!=a[i+1][j] || b[j][i]!=b[j][i+1]) flag = false;
        }
    }

    if(flag) cout << "Yes" << endl;
    else cout << "No" << endl;
}

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

typedef long long ll;
#define vi vector<int>
#define mii map<int,int>

int gcd(int a, int b) 
{ 
    if (a == 0) 
        return b; 
    return gcd(b % a, a); 
} 

int main() {
	ll sum = 0;
	int k;
	cin >> k;
	for(int i=1;i<=k;i++) {
		for(int j=1;j<=k;j++){
			for(int l=1;l<=k;l++) {
				if(i==1 || j==1 || l==1){
					sum+=1;
					continue;
				} else if(gcd(i,j) == 1 || gcd(j,l) == 1){
					sum += 1;
					continue;
				} else {
					sum += gcd(i,gcd(j,l));
				} 
			}
		}
	}
	cout << sum << "\n";
}


Measured memory_bytes: 3624
#include <iostream>
#include <cmath>
#include <cstring>
using namespace std;
typedef long long ll;
const int MAXN = 2e5 + 5;
int main()
{
    ll n; cin >> n;
    ll a[MAXN] = {0};
    for(ll i = 1; i <= n; i++) cin >> a[i];
    ll cnt = 0;
    for(ll i = 1; i < n; i++){
    	if(a[i] > a[i + 1]){
    		cnt += a[i] - a[i + 1];
			a[i + 1] = a[i];
    	}
    }
    cout << cnt;
    return 0;
}

Measured memory_bytes: 5168
ls = [[int(_) for _ in input().split()] for _ in range(3)]

flag = [0, 0, 0, 0]

if ls[0][0] - ls[1][0] == ls[0][1] - ls[1][1] and ls[0][1] - ls[1][1] == ls[0][2] - ls[1][2]:
    flag[0] = 1

if ls[1][0] - ls[2][0] == ls[1][1] - ls[2][1] and ls[1][1] - ls[2][1] == ls[1][2] - ls[2][2]:
    flag[1] = 1

if ls[0][0] - ls[0][1] == ls[1][0] - ls[1][1] and ls[1][0] - ls[1][1] == ls[2][0] - ls[2][1]:
    flag[2] = 1

if ls[0][1] - ls[0][2] == ls[1][1] - ls[1][2] and ls[1][1] - ls[1][2] == ls[2][1] - ls[2][2]:
    flag[3] = 1

if sum(flag) == 4:
    print("Yes")
else:
    print("No")

Measured memory_bytes: 3064
//#include<bits/stdc++.h>
#include<iostream>
#include<algorithm>
#include<cmath>
#include<vector>
#include<queue>
#include<set>
#include<map>

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

using namespace std;

#define int long long
#define REP(i,s,e) for((i)=(s);(i)<(e);(i)++)
#define RREP(i,s,e) for((i)=((s)-1);(i)>=(e);(i)--)
#define FOR(i,n) for((i)=(0);(i)<(n);(i)++)
#define RFOR(i,n) for((i)=((n)-1);(i)>=(0);(i)--)
#define MOD 1000000007


signed main(){
    int X;
    cin>>X;
    int n=X/100;
    int t=X%100;
    n-=t/5;
    t%=5;
    n-=t/4;
    t%=4;
    n-=t/3;
    t%=3;
    n-=t/2;
    t%=2;
    n-=t/1;
    t%=1;
    if(n>=0) cout<<"1"<<endl;
    else cout<<"0"<<endl;
}


Measured memory_bytes: 3052
from collections import deque
h,w=map(int,input().split())
a=[list(input()) for i in range(h)]
q=deque()

for i in range(h):
    for j in range(w):
        if a[i][j]=='#':
            q.append((i,j))

ans=0
while q:
    nq=deque()
    while True:        
        y,x=q.popleft()
        for dy,dx in ((1,0),(-1,0),(0,1),(0,-1)):
            ny=dy+y
            nx=dx+x
            if 0<=ny<h and 0<=nx<w and a[ny][nx]!='#':
                a[ny][nx]='#'
                nq.append((ny,nx))
        if not q:
            ans+=1
            q=nq
            break
print(ans-1)
    

Measured memory_bytes: 114908
#include <bits/stdc++.h>
#define int long long
#define rep(i, n) for (int i = 0; i < (int)(n); i++)  //  repマクロ
#define leng(n) (int)(log10(n)+1)  //  桁数
using namespace std;

signed main() {
  int A, B, T;
  cin >> A >> B >> T;
  cout << (T / A) * B << endl;
}

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

int main() {
  double w, h, x, y, s;
  cin >> w >> h >> x >> y;
  s = w * h / 2;
  cout << fixed << setprecision(10) << s << " ";
  if(x == w/2 && y == h/2) cout << 1 << endl;
  else cout << 0 << endl;
  return 0;
}

Measured memory_bytes: 256
#include <algorithm>
#include <cmath>
#include <deque>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <tuple>
#include <vector>

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

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

    if (S.length() % 2 == 1) {
        cout << "No" << endl;
        return 0;
    }

    bool flg = true;
    for (int i = 0; i < S.length(); i += 2) {
        if (!(S[i] == 'h' && S[i + 1] == 'i')) {
            flg = false;
            break;
        }
    }

    if (flg)
        cout << "Yes" << endl;
    else
        cout << "No" << endl;

    return 0;
}

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

int n;

int main() {
	cin.sync_with_stdio(0); cin.tie(0);
    cin >> n;
    
	vector<pair<int, int>> edges;
    if (n % 2) {
		for (int i = 1; i < n; ++i) {
			for (int j = i + 1; j <= n; j++) {
				if (i + j != n) {
					edges.push_back({i, j});
				}
			}
		}
	} else {
		for (int i = 1; i < n; ++i) {
			for (int j = i + 1; j <= n; j++) {
				if (i + j != n + 1) {
					edges.push_back({i, j});
				}
			}
		}
	}
	
	cout << edges.size() << "\n";
	for (auto& i : edges) cout << i.first << " " << i.second << "\n";
    return 0;
}


Measured memory_bytes: 384
#include<iostream>
#include<iomanip>
#include<cstdlib>
#include<algorithm>
#include<vector>
#include<map>
#include<cmath>
#include<string>

#define rep(i,p) for(int i=1;i<=p;i++)
#define ll long long

using namespace std;

int main(){

ll int N;
 cin >> N;

ll int counter = 0;
ll int now = 1;
ll int a;

rep(i,N){
	cin >> a;
        if( a == now){
		now += 1;
	}
	else{
		counter += 1;
	}
}
if(counter != N){
cout << counter;
}
else{
	cout << "-1";
}












	return 0;

}



Measured memory_bytes: 256
#define _USE_MATH_DEFINES
#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;

int main() {
    int n, ans = 0;
    cin >> n;
    int l[n * 2];
    rep(i, n * 2) {
        cin >> l[i];
    }
    sort(l, l + n * 2);
    rep(i, n) {
        ans += l[i * 2];
    }
    cout << ans << endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <queue>
#include <deque>
#include <map>

#define ll long long
#define ld long double
#define COIN const int
#define ite iterator
#define PII pair<int,int>
#define PSI pair<string,int>
#define PIS pair<int,string>

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

#define ALL(c) (c).begin(), (c).end()
#define LEN(s) (s).size()
#define CLEAR(x) memset(x,0,sizeof x);

#define MP make_pair
#define pb push_back
#define pf push_front
#define ppb pop_back
#define ppf pop_front
#define X first
#define Y second

#define VI vector<int>
#define VS vector<string>
#define VII vector<PII>
#define VVI vector<VI>

#define PIII 3.1415926
#define PI 3.14
/*****************************************************************************/

using namespace std;

int main()
{
	//freopen("input.txt","r",stdin);
	//freopen("output.txt","w",stdout);
	int n,i,ans=0;
	string s;
	map <string,bool> m;
	cin >>n;
	for (i=0;i<n;i++) {
		cin >>s;
		m[s]=1;
	}
	for (map <string,bool>::iterator i=m.begin();i!=m.end();i++) {
		ans++;
	}
	cout <<ans;
}
/******************************************************************************
******************************************************************************/


Measured memory_bytes: 19224
#include <bits/stdc++.h>
#define SORT(x) sort(x.begin(),x.end())
#define ALL(x) x.begin(),x.end()
#define rep(i, n) for(int i = 0; i < n; i++)
#define reps(i, m, n) for(int i = m; i < n; i++)
#define repr(i, m, n) for(int i = m; i >= n; i--)
#define INF 1000000007 //1000000000000000003
#define PI (acos(-1))
#define MOD 1000000007
using namespace std;
typedef long long ll;

void Main(){

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

  char ans[h+2][w+2];

  rep(i,h+2){
    rep(j,w+2){
      ans[i][j]='.';
    }
  }

  reps(i,1,h+1){
    reps(j,1,w+1){
      char c;
      cin>>c;
      ans[i][j]=c;
    }
  }

  int ve1[8]={-1,-1,-1,0,0,1,1,1};
  int ve2[8]={-1,0,1,1,-1,-1,0,1};

  reps(i,1,h+1){
    reps(j,1,w+1){
      char c;
      c=ans[i][j];
      if(c=='#') cout<<'#';
      else{
        int num=0;
        rep(k,8){
          num+= ans[i+ve1[k]][j+ve2[k]]=='#';
        }
        cout<< num;
      }
    }
    cout<<"\n";
  }

}

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


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define PI acos(-1)
#define eq(x,y) (fabs((x)-(y)) < eps)
#define debug(x) cerr<<x<<endl;
#define pb push_back
#define min3(a,b,c) min(a,min(b,c))
#define max3(a,b,c) max(a,max(b,c))
using namespace std;
typedef long long ll;
typedef unsigned long long llu;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
const int inf=1e9+7;
const int nmax=1e5+10;
const int eps=1e-8;


int main()
{
    //freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);
    ios::sync_with_stdio(false);
    cin.tie(0);
    int n;
    cin>>n;
    vector<int>a(n+1) , b(n+1);
    for(int i=1;i<=n;i++){
        cin>>a[i];
        b[a[i]]=i;
    }

    for(int i=1;i<=n;i++)
        cout<<b[i]<<" ";
    cout<<"\n";




    return 0;
}


Measured memory_bytes: 1664
#include <iostream>
#include <vector>
#include<algorithm>
#include<iomanip>
#include<queue>
#include<deque>
#include<map>
#include<bitset>
#include<math.h>
using namespace std;
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define REP(i,m,n) for(int i=m;i<(int)(n);i++)
typedef long long ll;
typedef pair<int,int> pint;
const ll mod= 1e9+7;
const int inf=1e9+7;
const ll  longinf = 1LL<<60;
int dx[4]={1,0,-1,0}, dy[4]={0,1,0,-1};


int main(){
  int a,b;
  cin>>a>>b;
  int n=b-a;
  int res=0;
  rep(i,n)res+=i;
  cout<<res-a<<endl;
  return 0;
  }


Measured memory_bytes: 256
#include<iostream>
#include<algorithm>
using namespace std;
#define REP(i,b,n) for(int i=b;i<n;i++)
#define rep(i,n)   REP(i,0,n)
class state{
public:
  int p,d;
  bool operator<(const state & a)const{
    if (d != a.d)return d > a.d;
    return p < a.p;
  }
};

main(){
  int n;
  while(cin>>n&&n ){
    int num,dist=0;
    rep(i,n){
      int a,b,c;
      cin>>a>>b>>c;
      if (b+c > dist)dist=b+c,num=a;
    }
    cout <<num <<" " << dist << endl;
  }
}

Measured memory_bytes: 864
#include<stdio.h>
int main()
{
  int n;
  scanf("%d",&n);
  if(n<=1999&&n>=1800)
  {
    printf("1");
  }else if(n<=1799&&n>=1600)
  {
    printf("2");
  }else if(n<=1599&&n>=1400)
  {
    printf("3");
  }else if(n<=1399&&n>=1200)
  {
    printf("4");
  }else if(n<=1199&&n>=1000)
  {
    printf("5");
  }else if(n<=999&&n>=800)
  {
    printf("6");
  }else if(n<=799&&n>=600)
  {
    printf("7");
  }else if(n<=599&&n>=400)
  {
    printf("8");
  }
  return 0;
}

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

void leftrotate(string &s, int d)
{
    reverse(s.begin(), s.begin()+d);
    reverse(s.begin()+d, s.end());
    reverse(s.begin(), s.end());
}

void rightrotate(string &s, int d)
{
    leftrotate(s, s.length()-d);
}
int main() {
    string s,w;
    cin>>s>>w;
    for(int i=0;i<s.size();i++){
        if(s!=w) {
            rightrotate(s, 1);
        }
        if(s==w){
            cout<<"Yes";
            break;
        }
    }
    if(s!=w){
        cout<<"No";
    }
    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 ans = false;
		for (int i = 9; i > 0; i--) {
			if (n%i==0) {
				if (n/i < 10) {
					ans = true;
				}
			}
		}


		if (ans) {
			System.out.println("Yes");
		} else {
			System.out.println("No");
		}
	}
}


Measured memory_bytes: 23764
#include <bits/stdc++.h>
#include "atcoder/all"
#define rep(i,n)for(int i=0;i<(int)(n);i++)
using namespace std;
using namespace atcoder;
#define all(a) a.begin(),a.end()
typedef long long ll;
#define vi vector<ll>
typedef pair<ll,ll>P;
const ll inf=1ll<<61;

signed main(){
	int n,q;cin>>n>>q;
	dsu d(n);

	rep(i,q){
		int t,u,v;cin>>t>>u>>v;
		if(t==0){
			d.merge(u,v);
		}
		else{
			if(d.same(u,v))cout<<1<<endl;
			else cout<<0<<endl;
		}
	}
}

Measured memory_bytes: 3912
#include<cstdio>
#include<iostream>
#include<string>
#include<set>
#include<map>
#include<vector>
#include<deque>
#include<tuple>
#include<algorithm>
#include<numeric>
#include<limits>
#include<boost/multiprecision/cpp_int.hpp>
using namespace boost::multiprecision;
using namespace std;
#define BEGIN ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
#define END return EXIT_SUCCESS
#define rep(I,N) for(auto I=0;I<(N);++I)
#define up(I,A,B) for(auto I=(A);I<=(B);++I)
#define dw(I,A,B) for(auto I=(A);I>=(B);--I)
#define all(C) (C).begin(),(C).end()
#define rall(C) (C).rbegin(),(C).rend()
#define ft first
#define sd second
#define mp make_pair
#define mt make_tuple
#define pf push_front
#define pb push_back
#define lb lower_bound
#define ub upper_bound
#define rs resize
typedef long long ll;
typedef unsigned long long ull;
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 T>inline void                                      in(T &p){cin>>p;}
template<class T1,class T2>inline void                            in(T1 &p1,T2 &p2){cin>>p1>>p2;}
template<class T1,class T2,class T3>inline void                   in(T1 &p1,T2 &p2,T3 &p3){cin>>p1>>p2>>p3;}
template<class T1,class T2,class T3,class T4>inline void          in(T1 &p1,T2 &p2,T3 &p3,T4 &p4){cin>>p1>>p2>>p3>>p4;}
template<class T1,class T2,class T3,class T4,class T5>inline void in(T1 &p1,T2 &p2,T3 &p3,T4 &p4,T5 &p5){cin>>p1>>p2>>p3>>p4>>p5;}
template<class T>inline void                                      ins(T &p){for_each(all(p),in<decltype(p[0])>);}
template<class T>inline void                             out(T p){cout<<p<<endl;}
template<class T1,class T2>inline void                   out(T1 p1,T2 p2){cout<<p1<<" "<<p2<<endl;}
template<class T1,class T2,class T3>inline void          out(T1 p1,T2 p2,T3 p3){cout<<p1<<" "<<p2<<" "<<p3<<endl;}
template<class T1,class T2,class T3,class T4>inline void out(T1 p1,T2 p2,T3 p3,T4 p4){cout<<p1<<" "<<p2<<" "<<p3<<" "<<p4<<endl;}
inline                                              void out(double p){printf("%.10f\n",p);}
template<class T>inline                             void outs(T p){for_each(all(p),out<decltype(p[0])>);}
template<class T>inline void outs(vector<T> V){int n=V.size();rep(i,n)cout<<V[i]<<" \n"[i==n-1];}
inline void solve(void){
  int A,B;in(A,B);
  rep(i,1500){
    int a=i*0.08;
    int b=i*0.1;
    if(a==A&&b==B){
      out(i);
      return;
    }
  }
  out(-1);
}
int main(int argc,char**argv){
  BEGIN;
  solve();
  END;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <functional>
 
using namespace std;
using namespace __gnu_pbds;
 
typedef long long ll;
#define int long long int
typedef complex<long double> cd;
const long double pi=acos(-1);
typedef double db;
typedef long double ldb;
typedef pair <int,int> pii;
typedef pair <db,db> pdd;
typedef vector<int> vi;
//typedef vector<vector<int> > matrix;
 
#define m1 make_pair
#define pb push_back
#define flush fflush(stdout)
#define IOS std::ios::sync_with_stdio(false); cin.tie(NULL);cout.tie(NULL);
#define reset(x,v) memset(x,v,sizeof(x))
 
#define fi first
#define se second
#define endl "\n"
#define debug(x) (cerr << #x << ": " << x << "\n")
#define setbits(x) __builtin_popcount(x)
#define setbitsll(x) __builtin_popcountll(x)
#define all(x) x.begin(),x.end()
#define pii pair<int,int>
 
inline int gcd(int a,int b){if(a==0) return b;return gcd(b%a,a);}
inline int power(ll a,ll n,ll m){if(n==0)return 1;ll p=power(a,n/2,m);p=(p%m*p%m)%m;if(n%2) return (p%m*a%m)%m;else return p;}
const double EPS = 1e-9;
const ll MOD=998244353;
const ll hell=1000000007;
const int INF = 1e16;
const ll LL_INF = 0x3f3f3f3f3f3f3f3f;
template<typename T>
using ordered_set=tree<T, null_type, less<T>, rb_tree_tag,tree_order_statistics_node_update>;
 
auto seed = chrono::high_resolution_clock::now().time_since_epoch().count();
std::mt19937 rng(seed);
 
double startTime;
double getCurrentTime() {
    return ((double)clock() - startTime) / CLOCKS_PER_SEC;
}
const int dx[] = { -1, 0, 1, 0 };
const int dy[] = { 0, 1, 0, -1 };
 
const int N=200005;
int dp[10001][101];
int m;

int solve(string s)
{
    int n=s.length();
  int cr=0;int ans=0;
  for(int i=0;i<n;i++)
  {
   for(int j=0;j<s[i]-'0';j++)
   {
       ans=(ans+dp[n-i-1][(m-(cr+j)%m)%m])%hell;
   }
   cr=cr+s[i]-'0';
   cr%=m;
  }
  if(!cr)
 ans++;
ans%=hell;
return ans;

}


void solve()
{
dp[0][0]=1;

string s;
cin>>s;
cin>>m;
for(int i=1;i<=10000;i++)
{
    for(int j=0;j<m;j++)
    {
        for(int k=0;k<10;k++)
        {
           dp[i][j]=(dp[i][j]+(dp[i-1][(j-(k)%m+m)%m]))%hell;
        }
    }
}
cout<<(solve(s)-1+hell)%hell<<endl;



}

int32_t main()
{
    //IOS;
    int t;
    t=1;
    //cin>>t;
    while(t--)
    {
        
        solve();
    }
    return 0;
}


Measured memory_bytes: 11528
#include<iostream>
#include<stdio.h>
#include<algorithm>
#include<string>
#include<math.h>
#include<vector>
#include<iomanip>
using namespace std;

int main(void)
{
	string s;
	cin >> s;
	if (s[0] == 'S') { cout << "Cloudy" << endl; }
	else if (s[0] == 'C') { cout << "Rainy" << endl; }
	else { cout << "Sunny" << endl; }
	return 0;
}

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

int main() {
    int n;
    cin >> n;
    int ans = 0, c = 0;
    int h;
    cin >> h;
    for (int i = 1; i < n; i++) {
        int h1;
        cin >> h1;
        if (h >= h1)
            c++;
        else {
            ans = max(c, ans);
            c = 0;
        }
        h = h1;
    }
    ans = max(c, ans);
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define ull unsigned long long
#define MOD (int)(1e9+7)
#define ceil(x, y) (x%y==0? (x/y) : (x/y+1))
#define FOR(i, N) for(int i = 0; i < N; ++i)
#define FOR1(i, N) for(int i = 1; i <= N; ++i)
#define vi vector <int>
#define pii pair <int, int>
#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define mset(a, v) memset(a, v, sizeof(a))
#define all(v) (v).begin(), (v).end()
#define INF 2e9
#define EPS 1e-9
#define PI 3.141592653589793238
#define int long long
/*#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
typedef cc_hash_table<int, int, hash<int>> ht; // while using, comment #define int long long  */

void __print(int x) {cerr << x;}
void __print(unsigned x) {cerr << x;}
void __print(unsigned long x) {cerr << x;}
void __print(unsigned long long x) {cerr << x;}
void __print(float x) {cerr << x;}
void __print(double x) {cerr << x;}
void __print(long double x) {cerr << x;}
void __print(char x) {cerr << '\'' << x << '\'';}
void __print(const char *x) {cerr << '\"' << x << '\"';}
void __print(const string &x) {cerr << '\"' << x << '\"';}
void __print(bool x) {cerr << (x ? "true" : "false");}

template<typename T, typename V>
void __print(const pair<T, V> &x) {cerr << '{'; __print(x.first); cerr << ','; __print(x.second); cerr << '}';}
template<typename T>
void __print(const T &x) {int f = 0; cerr << '{'; for (auto &i: x) cerr << (f++ ? "," : ""), __print(i); cerr << "}";}
void _print() {cerr << "]\n";}
template <typename T, typename... V>
void _print(T t, V... v) {__print(t); if (sizeof...(v)) cerr << ", "; _print(v...);}
#ifndef ONLINE_JUDGE
#define dbg(x...) cerr << "[" << #x << "] = ["; _print(x)
#else
#define dbg(x...)
#endif
using namespace std;
long long power(long long x, unsigned long long y, unsigned int m){
    if(y == 0) return 1;
    unsigned long long p = power(x, y/2, m) % m;
    p = (p * p) % m;
    
    if(y & 1)
        return  ((x % m)*p) % m;
    else 
        return p;
}
void fun(int rank, int len){
	if(len == 1){
		cout << char(rank + 'a');
		return;
	}
	int ke_baad = power(26, len-1, LLONG_MAX);
	int temp = rank/ke_baad;
	cout << char(temp + 'a');
	fun(rank % ke_baad, len-1);

}
int32_t main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    #ifndef ONLINE_JUDGE
    	freopen("in2.txt", "r", stdin);
    	freopen("out.txt", "w", stdout);
    #endif

	int T=1;
	//cin >> T;
	FOR1(tp, T)
	{
		//cout << "Case #" << tp << ": ";
		int n; cin >> n;
		int len;
		int rank;
		for(int i = 12; i >= 1; i--){
			int p = power(26, i-1, LLONG_MAX);
			int term = 1 + 26*( (p-1) / 25);
			if(n >= term) {
				rank = n-term; // 0-indexed rank of n in string of length len
				len = i;
				break;
			}
		}
		dbg(len, rank);
		fun(rank, len);
		cout << '\n';
	}
	return 0;
}


Measured memory_bytes: 3620
a,b,c = map(int, input().rstrip().split())
a = abs(a)

if a > b * c:
    print(abs(a - b*c))
else:
    n = a // c
    surplus = a % c
    m = b - n
    if m % 2 == 0:
        print(surplus)
    else:
        print(abs(min(surplus + c, surplus - c)))

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


public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		Printer pr = new Printer(System.out);

		int n = sc.nextInt();

		int[] l = new int[2 * n];
		for (int i = 0; i < 2 * n; i++) {
			l[i] = sc.nextInt();
		}
		Arrays.sort(l);

		int ret = 0;
		for (int i = 0; i < n; i++) {
			ret += l[i * 2];
		}

		pr.println(ret);

		pr.close();
		sc.close();
	}

	@SuppressWarnings("unused")
	private static class Scanner {
		BufferedReader br;
		Iterator<String> it;

		Scanner (InputStream in) {
			br = new BufferedReader(new InputStreamReader(in));
		}

		String next() throws RuntimeException  {
			try {
				if (it == null || !it.hasNext()) {
//					it = Arrays.asList(br.readLine().split(" ")).iterator();
					it = Arrays.asList(br.readLine().split("\\p{javaWhitespace}+")).iterator();
				}
				return it.next();
			} catch (IOException e) {
				throw new IllegalStateException();
			}
		}

		int nextInt() throws RuntimeException {
			return Integer.parseInt(next());
		}

		long nextLong() throws RuntimeException {
			return Long.parseLong(next());
		}

		float nextFloat() throws RuntimeException {
			return Float.parseFloat(next());
		}

		double nextDouble() throws RuntimeException {
			return Double.parseDouble(next());
		}

		void close() {
			try {
				br.close();
			} catch (IOException e) {
//				throw new IllegalStateException();
			}
		}
	}

	private static class Printer extends PrintWriter {
		Printer(PrintStream out) {
			super(out);
		}
	}
}


Measured memory_bytes: 8532
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define rrep(i,n) for(int i = 1; i <= (n); ++i)
#define drep(i,n) for(int i = (n)-1; i >= 0; --i)
#define all(x) (x).begin(),(x).end()
#define SZ(x) ((int)(x).size())
#define bit(n) (1<<(n))
#define fi first
#define se second
#define ii(x) int x; cin >> (x)
#define ii2(x, y) int x, y; cin >> (x) >> (y)
#define ii3(x, y, z) int x, y, z; cin >> (x) >> (y) >> (z)
#define yn(x, ok, ng) cout << ((x)?(ok):(ng)) << endl
using namespace std;
typedef long long ll;
typedef long double ld;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<vi> vvi;
typedef vector<bool> vb;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
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;}
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 const INF = 1001001001;


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

string s;
cin >> s;

yn(s == "ARC", "ABC", "ARC"); 

return 0;
}

Measured memory_bytes: 3600
#include <bits/stdc++.h>
using namespace std;
using lint = long long;
#ifndef STOP_DEBUG
#define debug(...)\
    do { cerr << boolalpha << "[" << #__VA_ARGS__ << "]:";\
    debug_cerr(__VA_ARGS__); cerr << noboolalpha; } while (0)
#else
#define debug(...)
#endif
void debug_cerr(){ cerr << '\n'; }
template<class Head, class... Tail>
void debug_cerr(Head head, Tail... tail){
  cerr << ' ' << head;
  debug_cerr(tail...);
}
void chmax(lint &a, lint b) { if (a < b) a = b; }
void chmin(lint &a, lint b) { if (a > b) a = b; }
struct IoSetup{
    IoSetup(){
      ios::sync_with_stdio(false);
      cin.tie(nullptr);
      cout << fixed << setprecision(20);
      cerr << fixed << setprecision(20);
    }
} iosetup;

int main() {
  int n;
  cin >> n;
  vector<char> vec(2*n + 3);
  string a, b; cin >> a >> b;
  for (int i = 0; i < n; ++i) {
    cout << a[i];
    cout << b[i];
  }
  cout << '\n';
}


Measured memory_bytes: 256
using System;


public class C{
	
	public static void Main(){
	
		string[] args1 = Console.ReadLine().Split(' ');
		int n = Int32.Parse(args1[0]);
		int k = Int32.Parse(args1[1]);
		int kp = k;
		
		string[] args2 = Console.ReadLine().Split(' ');
		int[] underZero = new int[n+1];
		underZero[0] = 0;
		int[] overZero = new int[n+1];
		overZero[0] = 0;
		int numUnderZero = 0;
		int numOverZero = 0;
		
		for( int i = 0; i < n; i++ ){
			
			int tmp = Int32.Parse(args2[i]);
			if( tmp < 0 ){
				numUnderZero++;
				underZero[numUnderZero] = -tmp;
				
			}else if( tmp == 0 ){
				kp = k - 1;
				
			}else{
				numOverZero++;
				overZero[numOverZero] = tmp;				
				
			}
			
		}
		Array.Reverse( underZero, 1, numUnderZero );
		
		int tmpMin = Int32.MaxValue;
		for( int i = 0; i <= kp; i++ ){
			
			if( i > numUnderZero ) continue;
			if( kp - i > numOverZero ) continue;
			
			int time;
			time = 2 * underZero[i] + overZero[kp - i];			
			if( time < tmpMin ) tmpMin = time;
			time = underZero[i] + 2 * overZero[kp - i];			
			if( time < tmpMin ) tmpMin = time;		
			
		}
		Console.WriteLine(tmpMin);
		
	}
	
}

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

int main(){
   int n;
   cin >> n;
   int h[n];
   rep(i,n) cin >> h[i];
   int now = h[n-1],flag= 1;
   for(int i=n-1;0<=i;i--){
       if(h[i]<=now){
           now = h[i];
           continue;
       }
       else if(h[i]==now+1){
            now = h[i]-1;
            continue;
       }
       else flag = 0;
   }
   if(flag) cout << "Yes" << endl;
   else cout << "No " << endl;
}


Measured memory_bytes: 4028
#include<bits/stdc++.h>
#define INF 2000000000
#define MOD 1000000007
#define EPS (1e-10)

using namespace std;

int main(int argc, char *argv[]) {

	int N; cin >> N;

	if (N == 1) {
		cout << "Hello World" << endl;	
	}else {
		int a,b; cin >> a >> b;
		cout << a + b << endl;
	}
	return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <utility>
#include <ctime>
#define INF 999999999
#define mod 1000000007

#define rep(i,n) for(int i=0;i<int(n);i++)
#define rrep(i,n) for(int i=(n);i>=0;i--)
#define REP(i,a,b) for(int i=(a);i<int(b);i++)
#define all(x) (x).begin(),x.end()
#define pb push_back
#define MOD(x) (x%(mod))
using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef pair<int,int> pi;

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

void solve(string s){
  set<string>se;
  string ss,rs;
  rs=s;
  reverse(all(rs));
  se.insert(s);
  se.insert(rs);
  
  while(s.size()){
    ss+=s[0];
    s.erase(s.begin());
    se.insert(s+ss);
    se.insert(ss+s);
    
    reverse(all(s));
    se.insert(ss+s);
    se.insert(s+ss);

    reverse(all(ss));
    se.insert(ss+s);
    se.insert(s+ss);

    reverse(all(s));
    se.insert(ss+s);
    se.insert(s+ss);

    reverse(all(ss));
  }
  cout<<se.size()<<endl;
}

int main(){
  int n;
  string s;
  cin>>n;
  rep(i,n){
    cin>>s;
    solve(s);
  }
  return 0;
}

Measured memory_bytes: 3260
#include <bits/stdc++.h>
using namespace std;
int main(){
    ios_base::sync_with_stdio(false) ;
    cin.tie(NULL) ;
    int n = 0 , k = 0 , mn = INT_MAX ;
    cin >> n >> k ;
    int arr[n+1] ;
    bool TaroWins[k+1][n+1] , dp[k+1] ;
    for(int i = 1 ; i <= n ; i++)
        cin >> arr[i] ;
    sort(arr+1, arr+n+1) ;
    mn = arr[1] ;
    for(int i = 0 ; i <= k ; i++){
        dp[i] = false ;
        for(int j = 0 ; j <= n ; j++)
            TaroWins[i][j] = false ;
    }
    for(int i = 1 ; i <= k ; i++){
        if(mn > i) continue ;
        else{
            for(int j = 1 ; j <= n ; j++){
                if(i-arr[j] >= 0) dp[i] = !dp[i-arr[j]] ;
                if(dp[i]) break ;
            }
        }
        for(int j = 1 ; j <= n ; j++){
            if(mn > i){
                TaroWins[i][j] = false ;
                continue ;
            }
            if(i-arr[j] >= 0) TaroWins[i][j] = !(TaroWins[i-arr[j]][j]) ;
            TaroWins[i][j] = TaroWins[i][j] || TaroWins[i][j-1] ;
        }
    }
    /*for(int i = 1 ; i <= k ; i++){
        for(int j = 1 ; j <= n ; j++)
            cout << TaroWins[i][j] << " " ;       
        cout << dp[i] << "\n" ;
    }*/
    if(dp[k]) cout << "First" ;
    else cout << "Second" ;
}

Measured memory_bytes: 13608
#include <bits/stdc++.h>
using namespace std;
#define dump(x) cout << (x) << endl
typedef long long ll;
typedef pair<int, int> pi;
typedef vector<int> V;

int main() {
  int a, b, c, d;
  cin >> a >> b >> c >> d;
  dump(a*b >= c*d ? a*b : c*d);
  return 0;
}


Measured memory_bytes: 384
#include <stdio.h>

int main(){
  int w, h, x, y;
  scanf("%d %d %d %d", &w, &h, &x, &y);
  printf("%.12f ", 1.0 * w * h / 2);
  double gx = 1.0 * w / 2;
  double gy = 1.0 * h / 2;
  printf("%d\n", (x == gx) && (y == gy));
  return 0;
}


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

int main() {
    using namespace std;

    int n, m;
    priority_queue<pair<int, int>> cards;

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

    for (int i = 0; i < n; i++) {
        int a;
        scanf("%d", &a);
        cards.push(make_pair(a, 1));
    }

    for (int i = 0; i < m; i++) {
        int b, c;
        scanf("%d%d", &b, &c);
        cards.push(make_pair(c, b));
    }

    long long int ans = 0;
    for (int i = 0; i < n; i++) {
        auto pop_pair = cards.top();
        cards.pop();
        ans += pop_pair.first;
        if (pop_pair.second >= 2) {
            cards.push(make_pair(pop_pair.first, pop_pair.second - 1));
        }
    }
    cout << ans << endl;
}

Measured memory_bytes: 2420
#include "cstdio"

int main (){
    int i,x;
    scanf("%d",&i);
    for(int j=1;j<=i;j++){
        x=j;
        if(!(x%3)) {
            printf(" %d",j);
            continue;
        }else{
            while(x){
                if(x%10 == 3){
                  printf(" %d",j);
                  break;
                }
                x/=10;
            }
        }
    }
    printf("\n");
}

Measured memory_bytes: 2704