akhauriyash/Code-Regression huggingface dataset:
#pragma GCC optimize("O3")
#include<bits/stdc++.h> 
using namespace std;
using ll=long long;
using P=pair<ll,ll>;
template<class T> using V=vector<T>; 
#define fi first
#define se second
#define all(v) (v).begin(),(v).end()
const ll inf=(1e18);
const ll mod=998244353;
//const ll mod=1000000007;
ll GCD(ll a,ll b) {return b ? GCD(b,a%b):a;}
ll LCM(ll c,ll d){return c/GCD(c,d)*d;}
struct __INIT{__INIT(){cin.tie(0);ios::sync_with_stdio(false);cout<<fixed<<setprecision(15);}} __init;
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 (a>b) { a=b; return 1; } return 0; }
int main(){
   ll n,k;
   cin>>n>>k;
   V<ll> a(n);
   for(int i=0;i<n;i++)cin>>a[i];
   if(k==0){
       cout<<*max_element(all(a))<<"\n";
       return 0;
   }
   ll l=0,r=1000000007;
   while(r-l>1){
       ll mid=(l+r)/2;
       ll cnt=0;
       for(int i=0;i<n;i++){
            cnt+=(a[i]-1)/mid;
       }
       if(k>=cnt)r=mid;
       else l=mid;
   }
   cout<<r<<"\n";
}


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

isEnd = False
sum = [0]*n

for x in range(1,100):
    x2 = x*x
    for y in range(1,100):
        sum_xy = x2 + y*(x+y)
        if sum_xy > n:
            break
        for z in range(1,100):
            tmp = sum_xy + z*(x+y+z)
            if tmp > n:
                break
            if tmp <= n:
                sum[tmp-1]+=1
for s in sum:
    print (s)

Measured memory_bytes: 68488
#include <stdio.h>

int a[1010];
int main(){
	int n;
	scanf("%d",&n);
	for(int i=0;i<n;i++)scanf("%d",a+i);
	int q;
	scanf("%d",&q);
	while(q--){
		int e,l,r;
		scanf("%d%d%d",&e,&l,&r);
		int ans=a[l];
		for(int i=l;i<r;i++){
			if(e){
				if(ans<a[i])ans=a[i];
			}else{
				if(ans>a[i])ans=a[i];
			}
		}
		printf("%d\n",ans);
	}
}


Measured memory_bytes: 2108
#pragma GCC optimize ("O3")
#pragma GCC target ("sse4")
#pragma GCC optimize("Ofast")
#pragma GCC target("avx,avx2,fma")
#include <bits/stdc++.h>
using namespace std;
#define FAST  ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#include <ext/pb_ds/assoc_container.hpp> 
#include <ext/pb_ds/tree_policy.hpp> 
using namespace __gnu_pbds; 
#define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update> 
#define ll long long int 
#define ar array
#define pb push_back
#define fi(a,b) for(ll i=a;i<(b);i++)
#define fj(a,b) for(ll j=a;j<(b);j++)
#define fk(a,b) for(ll k=a;k<(b);k++)
//hash base 177013
const int mod=1e9+7;
ll binpow(ll a,ll b)
{
	ll res=1;
	while(b)
	{
		if(b&1){
			res=((res%mod)*(a%mod))%mod;
		}
		a=((a%mod)*(a%mod))%mod;
		b=b>>1;
	}
	return res%mod;
}
const int mxn=1e6+3;
vector<ll> fact(mxn),inv(mxn);
void facto()
{
	fact[0]=fact[1]=1;
	fi(2,mxn)
	{
		fact[i]=(fact[i-1]*i)%mod;
		//assert(fact[i]>=0&&fact[i]<=mod);
	}
	inv[0]=inv[1]=1;
	fi(2,mxn)
	{
		inv[i]=binpow(fact[i],mod-2)%mod;
		//assert(inv[i]>=0&&inv[i]<=mod);
	}	
}

ll ncr(ll a,ll b)
{
	//assert(a-b>=0);
	return (((fact[a]*inv[b])%mod)*inv[a-b]%mod)%mod;
}

int main()
{
	FAST;
	facto();
	//#ifndef ONLINE_JUDGE
	//	freopen("input.txt","r",stdin);
	//	freopen("output.txt","w",stdout);
	//#endif
	//ll testcase;
	//cin>>testcase;
	//while(testcase--)
	{
		int s;
		cin>>s;
		int len=s/3;
		if(len%3!=0)
		{
			len++;
		}
		ll ans=0;
		fi(1,len+1)
		{
			ll rem=s-3*i;
			if(rem<0) break;
			//cout<<i<<' '<<rem<<'\n';
			ans=(ans+ncr(rem+i-1,i-1))%mod;
		}
		cout<<ans;
		
		
	}
}


Measured memory_bytes: 18692
#include <bits/stdc++.h>
using namespace std;
using ull = unsigned long long; using ll = long long; using ld = long double;
using pi = pair<int, int>; using pll = pair<ll, ll>;
using vi = vector<int>; using vvi = vector<vi>; using vl = vector<ll>; using vvl = vector<vl>;
template<typename T> using minQ = priority_queue<T, vector<T>, greater<T>>;

#define endl '\n'
#define ALL(a)       (a).begin(),(a).end()
#define FOR(i,a,b)   for(ll i = (ll)(a); i < (ll)(b); ++i)
#define FORO(i,a,b)  for(ll i = (ll)(a); i <= (ll)(b); ++i)
#define RFOR(i,a,b)  for(ll i = (ll)(b) - 1; i >= (ll)(a); --i)
#define RFORO(i,a,b) for(ll i = (ll)(b); i >= (ll)(a); --i)
#define REP(i,n)     for(ll i = 0; i < (ll)(n); ++i)
#define REPO(i,n)    for(ll i = 1; i <= (ll)(n); ++i)
#define RREP(i,n)    for(ll i = (ll)(n) - 1; i >= 0; --i)
#define RREPO(i,n)   for(ll i = (ll)(n); i >= 1; --i)
#define SORT(a)      sort(ALL(a))
#define UNIQ(a)      a.erase(unique(ALL(a)), a.end())
#define SUNIQ(a)     SORT(a), UNIQ(a)
#define MINI(a,b)    a=min(a,(b))
#define MAXI(a,b)    a=max(a,(b))

const ll mod = 1e9 + 7;
const int INF = 1e9 + 10;
const ll LINF = 1000000000000000000ll;
const ld eps = 1e-8;
const ld PI = acosl(-1);

ll Nll() { ll a; cin >> a; return a; }
ld Nld() { ld a; cin >> a; return a; }
int Ni() { int a; cin >> a; return a; }
char Nc() { char a; cin >> a; return a; }
string Ns() { string a; cin >> a; return a; }

template <typename T>
void O(const T &a) { cout << a << endl; }
template <typename T>
void O(T &&a) { cout << a << endl; }
template <typename T>
void Os(const vector<T> &v) { REP(i, v.size() - 1) cout << v[i] << " \n"[i + 1 == (ll)v.size()]; }
template <typename T>
void Os(vector<T> &&v) { REP(i, v.size() - 1) cout << v[i] << " \n"[i + 1 == (ll)v.size()]; }
template <typename T>
void Is(vector<T> &v) { for (auto& t : v) cin >> t; }

void yes(bool f) { cout << (f ? "yes" : "no") << endl; }
void Yes(bool f) { cout << (f ? "Yes" : "No") << endl; }
void YES(bool f) { cout << (f ? "YES" : "NO") << endl; }

struct Edge {
	int from, to;
	Edge() {}
	Edge(int f, int t) : from(f), to(t) {}
};
using Edges = vector<Edge>;
using Graph = vector<Edges>;

void solve();

int main() { ios::sync_with_stdio(false), cin.tie(0); cout << fixed << setprecision(20); solve(); }

//-----------------------------------------------template-------------------------------------------------------------

//-----------------------------------------------library-------------------------------------------------------------

void solve()
{
	int A = Ni(), B = Ni(), C = Ni(), D = Ni();
	O(max(0, min(B, D) - max(A, C)));
}


Measured memory_bytes: 256
#include<iostream>
#include<vector>
#include<string>
#include<bitset>
#include<algorithm>
#include<map>
#include<queue>
#include<cmath>
#define rep(i,n) for(int i=0;i<n;i++)

using namespace std;

int main() {
	long long n,x;
	cin >> n;
	x = n;
	string name;
	while (n > 0) {
		name += 'a' + (n-1) % 26;
		//cout <<"余り"<< (n-1)% 26 << endl;
		n = (n-1)/ 26;
		//cout <<"n="<< n << endl;
	}
	reverse(name.begin(), name.end());
	cout << name << endl;
	return 0;
}

Measured memory_bytes: 3572
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
template <class T>
using vc = vector<T>;
template <class T>
using vvc = vector<vector<T>>;
using vl = vector<ll>;

const ll MOD = 1e9 + 7;
const ll INF = 1e14;
const long double EPS = 1e-11;

#define eb emplace_back
#define all(x) (x).begin(), (x).end()
#define rep(i, n) for (int i = 0; i < (n); i++)
#define repr(i, n) for (int i = (n)-1; i >= 0; i--)
#define repe(i, l, r) for (int i = (l); i < (r); i++)
#define reper(i, l, r) for (int i = (r)-1; i >= (l); i--)

void init() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(15);
}
//--------------------------------------------------------------------------------//

struct FenwickTree {
    typedef ll T;
    vector<T> v;
    void init(ll n) { v.assign(n, T()); }
    void add(ll i, T x) {
        for (; i < (ll)v.size(); i |= i + 1) v[i] += x;
    }
    T sum(ll i) const {  //[0, i)
        T r = T();
        for (--i; i >= 0; i = (i & (i + 1)) - 1) r += v[i];
        return r;
    }
    T sum(ll left, ll right) const {  //[left, right)
        return sum(right) - sum(left);
    }
};

int main() {
    init();
    ll N;
    cin >> N;
    vl AA(N), BB(N);
    rep(i, N) cin >> AA[i];
    rep(i, N) cin >> BB[i];
    rep(i, N) if (i % 2 == 1) swap(AA[i], BB[i]);
    ll ans = 1e9;
    rep(i, 1 << N) {
        vc<pair<ll, ll>> R, B;
        rep(j, N) {
            ll p = (i >> j) & 1;
            if (p == 0)
                R.eb(AA[j], j);
            else
                B.eb(BB[j], j);
        }
        if (R.size() != (N + 1) / 2) continue;
        sort(all(R)), sort(all(B));

        vc<pair<ll, ll>> X;
        rep(j, N / 2) X.eb(R[j]), X.eb(B[j]);
        if (N % 2) X.eb(R[N / 2]);
        bool isok = true;
        // cout << "dddd" << endl;
        repe(i, 1, N) {
            // cout << X[i].first - X[i - 1].first << endl;
            if (X[i].first - X[i - 1].first < 0) {
                isok = false;
                break;
            }
        }
        if (!isok) continue;

        ll tmp = 0;
        vc<ll> K(N);
        rep(i, N) K[i] = X[i].second;

        FenwickTree ft;
        ft.init(N + 1);
        rep(i, N) {
            tmp += i - ft.sum(K[i]);
            ft.add(K[i], 1);
        }
        // cout << "YES  " << tmp << endl;
        ans = min(ans, tmp);
    }
    if (ans == 1e9) ans = -1;
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <string>
#include <cmath>
#include <ctype.h>
#include <map>
#include <vector>
#include <stdlib.h>
#include <stdio.h>
#include <cctype>
#include <queue>
#include <set>
#include <list>
#define PI 3.141592653
#define rep(i,a,n) for(int i=a;i<(int)n;++i)
#define SZ(x) ((int)(x).size())	//size() unsigned -> int
#define DescSort(a) sort(a.begin(),a.end(),std::greater<int>())

using namespace std;
typedef long long ll;
const ll INF = 1e9 + 7;

int main() {
	int n, t;
	cin >> n >> t;
	vector<ll> x(n);
	rep(i, 0, n)cin >> x[i];
	int ans = 0;
	rep(i, 1, n) {
		if (x[i-1] + t <= x[i]) ans += t;
		else {
			ans += x[i] - x[i - 1];
		}
	}
	ans += t;
	cout << ans << endl;
}

Measured memory_bytes: 1792
i,k,n,m,a[1001],c[1001];main(){for(scanf("%d%d",&n,&m);i<n;scanf("%d",a+i++));for(;m--;k=0){scanf("%d",&i);for(;k<n;k++)if(a[k]<=i)c[k]++,k=n;}for(;--n+1;)if(c[n]>k)k=c[n],i=n;printf("%d\n",i+1);exit(0);}

Measured memory_bytes: 604
n,x = map(int,input().split())
lst = list(map(int, input().split()))
 
lst.append(x)
lst.sort()
 
dif_lst = []
for i in range(len(lst)-1):
    dif = lst[i+1] - lst[i]
    dif_lst.append(lst[i+1] - lst[i])
dif_lst.sort()

lst = dif_lst
while True:
    dif_lst = [lst[0]]
    for i in range(len(lst)-1):
        dif = lst[i+1] - lst[i]
        if dif == 0:
            continue
        else:
            dif_lst.append(lst[i+1] - lst[i])
    dif_lst.sort()
    if dif_lst[0] == 1:
        print(1)
        break
    elif len(dif_lst) == 1:
        print(dif_lst[0])
        break
    lst = dif_lst

Measured memory_bytes: 14480
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.StringTokenizer;

public class Main {
	static int [][]memo ;
    static char [][]a ;
    public static int dp(int i ,int j) {
    	if(i==a.length-1 && j==a[0].length-1)return 1;
    	if (i==a.length || j==a[0].length) return 0;
        if(a[i][j]=='#')return 0;
        if(memo[i][j]!=-1)return memo[i][j];
        int r ; int d;
        if ( memo[i+1][j]!= -1)
        	r = memo[i+1][j];
        else {
         r= memo[i+1][j] = dp(i+1,j);
        }
        if (memo[i][j+1]!= -1)
        	d= memo[i][j+1];
        else {
         d=memo[i][j+1]=dp(i, j+1);
        }
         
     
        return (int) ((r+d)%(Math.pow(10, 9)+7));
    }
    
	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		   StringTokenizer st = new StringTokenizer(br.readLine());
			int h = Integer.parseInt(st.nextToken());
			int w = Integer.parseInt(st.nextToken());
			a= new char[h][w];
			memo=new int [h+1][w+1];
			
			for (int i = 0; i < h; i++) {
				a[i]= br.readLine().toCharArray();
				Arrays.fill(memo[i], -1);
			}
			Arrays.fill(memo[h], -1);
			
			System.out.println(dp(0, 0));

	}

}


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

#define REP(i ,n) for(int i=0 ;i < n; i++)
#define REPB(i ,n) for(int i=n; i >= 0; i--)
#define FOR(i ,m ,n) for(int i=m; i < n; i++)
#define FORB(i, m, n) for(int i=m; i>= m; i--)
#define ll long long
#define pb push_back
#define popb pop_back
using namespace std;

int main(){
      int D;
      cin >> D;
      string ans;
      if(D == 22){
          ans = "Christmas Eve Eve Eve";
        }else if(D == 23){
            ans = "Christmas Eve Eve";
          }else if(D == 24){
              ans = "Christmas Eve";
            }else{
                ans = "Christmas";
              }
              cout << ans << endl;
              return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main(void){
	int h,n;
	int x,y;
	int now,next;
	int box[10001][4];
	int dp[10001][16];
	int msk2[4]={1,2,4,8};
	int msk[4]={3,6,12,15};
	int i,j,k;
	int a,b;
	int MAX;
	cin>>h>>n;
	for(i=0;i<h;i++){
		for(j=0;j<4;j++){
			box[i][j]=0;
		}
	}
	for(i=0;i<n;i++){
		cin>>x>>y;
		box[y][x]++;
	}
	for(i=0;i<h;i++){
		for(j=0;j<16;j++){
			dp[i][j]=0;
		}
	}
	for(i=0;i<h-1;i++){
		for(j=0;j<16;j++){
			now=0;	next=0;
			for(k=0;k<4;k++){
				now+=box[i][k]*msk2[k];
				next+=box[i+1][k]*msk2[k];
			}
			now|=j;
			//cout<<"NOW="<<now<<" "<<"NEXT="<<next<<endl;
			for(k=0;k<16;k++)	dp[i+1][k]=max(dp[i+1][k],dp[i][j]);
			for(k=0;k<4;k++){
				a=now&msk[k];
				b=next&msk[k];
				//cout<<"A="<<a<<" "<<"B="<<b<<endl;
				if((now&msk[k])==0){
					if((next&msk[k])==0){
						//cout<<"YEAR"<<endl;
						if(k==3)	dp[i+1][next|msk[k]]=max(dp[i+1][next],dp[i][now]+2);
						else		dp[i+1][next|msk[k]]=max(dp[i+1][next],dp[i][now]+1);
					}
				}
			}
		}
	}
	// for(i=0;i<h;i++){
		// for(j=0;j<4;j++){
			// if(j)	cout<<" ";
			// cout<<box[i][j];
		// }
		// cout<<endl;
	// }
	// cout<<endl;
	// for(i=0;i<h;i++){
		// cout<<"I="<<i<<" ";
		// for(j=0;j<16;j++){
			// if(j)	cout<<" ";
			// cout<<dp[i][j];
		// }
		// cout<<endl;
	// }
	MAX=INT_MIN;
	for(i=0;i<16;i++)	MAX=max(MAX,dp[h-1][i]);
	cout<<MAX<<endl;
	return 0;
}
	


Measured memory_bytes: 3900
n, m, c = map(int, input().split())
blist = list(map(int, input().split()))
ans = 0
for i in range(n):
  alist = list(map(int, input().split()))
  score = 0
  for j in range(m):
    score += alist[j] * blist[j]
  score += c
  if (score > 0):
    ans += 1
print(ans)

Measured memory_bytes: 3060
#include <iostream>
#include <fstream>
#include <set>
#include <map>
#include <string>
#include <vector>
#include <bitset>
#include <algorithm>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <cassert>
#include <queue>

#define mp make_pair
#define pb push_back


typedef long long ll;
typedef long double ld;

using namespace std;


int main() {
	int n;
	string s, t;
	cin >> n;
	cin >> s >> t;
	for (int i = n; i < 2 * n; ++i) {
		int k = 2 * n - i;
		if (s.substr(n - k) == t.substr(0, k)) {
			cout << i << "\n";
			return 0;
		}
	}
	cout << 2 * n << "\n";
	return 0;
}




Measured memory_bytes: 384
#include <stdio.h>
int main(){
  int a=0 ,b=0 ,o=0 ,ab=0 ,nam;
  char s[2];
  while( scanf( "%d %s" ,&nam ,s ) != EOF ){

    if( s[1] == 'A' && s[2] == 'B' ){
      ab++;
    }

    else if( s[1] == 'A' ){
      a++;
    }

    else if( s[1] == 'B' ){
      b++;
    }

    else if( s[1] == 'O' ){
      o++;
    }

    if( s == "AB" ){
      ab++;
    }
  }

  printf( "%d\n" ,a );
  printf( "%d\n" ,b );
  printf( "%d\n" ,ab );
  printf( "%d\n" ,o );

  return 0;
}

Measured memory_bytes: 592
#include <vector>
#include <map>
#include <set>
#include <stack>
#include <queue>
#include <algorithm>
#include <utility>
#include <functional>
#include <sstream>
#include <iostream>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>
#include <climits>
#include <fstream>
using namespace std;
inline int toInt(string s) { int v; istringstream sin(s); sin >> v; return v;}
template<class T> inline string toStr(T x) { ostringstream sout; sout << x; return sout.str();}
typedef vector<int> vi;
typedef vector<vi>  vvi;
typedef vector<string> vs;
typedef pair<int, int> pii;
typedef long long ll;
#define ALL(a) (a).begin(),(a).end()
#define RALL(a) (a).rbegin(),(a).rend()
#define FOR(i,a,b) for(int i=(a);i<=(b);++i)
#define REP(i,n) FOR(i,0,(n)-1)
const double EPS = 1e-12;
const double PI = acos(-1.0);
const int INF = INT_MAX/10;

int main() {
	int n, m;
	while(cin >> n, n) {
		vvi isFriend(n, vi(n));

		cin >> m;
		REP(i, m) {
			int a, b;
			cin >> a >> b;
			isFriend[a-1][b-1] = isFriend[b-1][a-1] = 1;
		}

		vi visited(n, 0);
		visited[0] = 1;
		queue<pii> Q;
		Q.push(pii(0, 0));
		int ans = 0;
		while(!Q.empty()) {
			pii p = Q.front();
			Q.pop();

			if(p.second == 2) {
				break;
			}

			REP(i, n) {
				if(!visited[i] && isFriend[p.first][i]) {
					ans++;
					visited[i] = 1;
					Q.push(pii(i, p.second+1));
				}
			}
		}

		cout << ans << endl;
	}

	return 0;
}

Measured memory_bytes: 2124
#define _USE_MATH_DEFINES
#define INF 100000000
#include <iostream>
#include <cstdio>
#include <sstream>
#include <cmath>
#include <cstdlib>
#include <algorithm>
#include <queue>
#include <stack>
#include <limits>
#include <map>
#include <string>
#include <cstring>
#include <set>
#include <deque>
#include <bitset>
#include <list>

using namespace std;

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

static const double EPS = 1e-8;

bool is_cm[1441];

int main(){
  int channel_num;
  int watch_begin_time;
  int watch_end_time;
  
  while(~scanf("%d %d %d",&channel_num,&watch_begin_time,&watch_end_time)){
    if(channel_num == 0 
       && watch_begin_time == 0
       && watch_end_time == 0) break;


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

    int watch_begin_minute
      = (watch_begin_time / 100) * 60 + watch_begin_time % 100;
    int watch_end_minute
      = (watch_end_time / 100) * 60 + watch_end_time % 100;

    for(int i=0;i<channel_num;i++){
      int cm_num;
      scanf("%d",&cm_num);

      int org = watch_begin_minute;
      for(int cm_idx=0;cm_idx<cm_num;cm_idx++){
	int cm_begin_time;
	int cm_end_time;
	scanf("%d %d",&cm_begin_time,&cm_end_time);
	int cm_begin_minute 
	  = (cm_begin_time/100) * 60 + cm_begin_time % 100;
	int cm_end_minute 
	  = (cm_end_time/100) * 60 + cm_end_time % 100;

	for(int time = org;time < cm_begin_minute;time++){
	  is_cm[time] = false;
	}

	org = cm_end_minute;

	if(cm_idx == cm_num -1){
	  for(int time = org;time < watch_end_minute;time++){
	    is_cm[time] = false;
	  }
	}
      }
    }

    
    int res = 0;
    int duration = 0;
    for(int time = watch_begin_minute;time<=watch_end_minute;time++){
      res = max(res,duration);
      if(is_cm[time]){
	duration = 0;
	// printf("%d\n",is_cm[time]);
	continue;
      }
      duration++;
    }

    res = max(res,duration);
    printf("%d\n",res);
  }
}

Measured memory_bytes: 1188
#include <iostream>
#include <math.h>

using namespace std;

int main()
{
    int com, n, q, x, y, p, t, i, j;
    long long s;
    int a[100000], b[100000];
    j = 0;
    cin >> n >> q;
    for(i = 0; i < n; i++){
            a[i] = 0;
    }
    for(i = 0; i < q; i++){
        cin >> com >> x >> y;
        if(com==0){
            a[x]+=y;
        }
        if(com==1){
            s=0;
            for(p=x;p<y+1;p++){
                    s+=a[p];
            }
            if(com==1){
                j++;
                b[j]=s;
            }
        }
    }
    for(i=1;i<j+1;i++){
            cout<<b[i]<<endl;
    }
    return 0;
}

Measured memory_bytes: 3648
import sys
c = [list(map(int, input().split())) for i in range(3)]

for a1 in range(0, c[0][0] + 1):
    b1 = c[0][0] - a1
    a2 = c[1][0] - b1
    a3 = c[2][0] - b1
    b2 = c[0][1] - a1
    if a2 + b2 != c[1][1]:
        continue
    if a3 + b2 != c[2][1]:
        continue
    b3 = c[0][2] - a1
    if a2 + b3 != c[1][2]:
        continue
    if a3 + b3 != c[2][2]:
        continue
    print('Yes')
    sys.exit()

print('No')

Measured memory_bytes: 3064
#include<bits/stdc++.h>
#define ll long long
#define pb push_back
#define rep(i,a,b) for(i=a;i<b;i++)
#define all(v) (v).begin(),(v).end()
#define mod 10e9
using namespace std;
void cicada()
{
    ll i,j,k,l,m,n;
    cin>>n>>m;
    j=0;
    rep(i,0,m)
    {
        ll a;
        cin>>a;
        j+=a;
    }
    if(j>=n)
    cout<<"Yes";
    else
    cout<<"No";
}
int main()
{
    ll test=1;
    while(test--)
    {
        cicada();
    }
}

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

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

int main(){
  ll n;
  cin>>n;
  // 1. while(n%k == 0)n/=k;
  // 2. const. n%k!=0 --> (n-k)%k != 0
  // 3. therefore. n%=k

  // if n%k==0:
  //   such k is at most O(sqrt n) patterns
  //   brute force is ok
  // else:
  //   only task is n%k ?= 1
  //   n-1 = 0 (mod k)
  //   list up all divisor of (n-1)

  vector<ll> divisor;
  for(ll x=1; x*x<=n; x++){
    if(n%x != 0)continue;
    divisor.push_back(x);
    if(x*x != n)divisor.push_back(n/x);
  }
  vector<ll> divisor2;
  for(ll x=1; x*x<=(n-1); x++){
    if((n-1)%x != 0)continue;
    divisor2.push_back(x);
    if(x*x != n-1)divisor2.push_back((n-1)/x);
  }
  ll ans = 0;
  for(ll x : divisor){
    ll t = n;
    ll k = x;
    if(k==1)continue;
    while(t%k==0)t/=k;
    t %= k;
    if(t==1)ans++;
  }
  sort(divisor.begin(), divisor.end());
  set<ll> S(divisor.begin(), divisor.end());
  for(ll x : divisor2){
    ll t = n;
    ll k = x;
    if(k==1)continue;
    if(S.count(k))continue;
    while(t%k==0)t/=k;
    t %= k;
    if(t==1)ans++;
  }
  cout<<ans<<endl;
  return 0;
}



Measured memory_bytes: 640
import java.math.BigInteger;
import java.util.Scanner;
public class Main
{
	public static void main(String[] args) 
	{
		Scanner in=new Scanner(System.in);
		for(;;)
		{
			double n=in.nextDouble();
			if(n<0)
				return;
			int bs4=(int) (n*16);
			if(bs4/16.0!=n||bs4>=4096)
				System.out.println("NA");
			else 
			{
				//BigInteger b=new BigInteger(bs4+"");
				String st=Integer.toString(bs4,2);
				while(st.length()<12)
					st="0"+st;
				StringBuilder sb=new StringBuilder();
				sb.append(st);
				sb.insert(8,".");
				System.out.println(sb);
			}
		}
	}
}

Measured memory_bytes: 13000
#!/usr/bin/env python3
import sys


def solve(K: int, S: int):
    count = 0
    for x in range(K+1):
        for y in range(K+1):
            if 0 <= S - x - y <= K:
                count += 1
    print(count)
    return


# Generated by 1.1.7.1 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    K = int(next(tokens))  # type: int
    S = int(next(tokens))  # type: int
    solve(K, S)

if __name__ == '__main__':
    main()


Measured memory_bytes: 3060
import Control.Monad
import Control.Applicative
import Data.List
import Data.Array
import Data.Array.IO
import Data.Maybe
import Data.Bits
import Data.Ord
import qualified Data.ByteString.Char8 as BS
import qualified Data.Set as Set
import Debug.Trace

modifyArray arr i f = readArray arr i >>= \x -> writeArray arr i (f x)

listToTuple2 [a,b] = (a,b)
listToTuple3 [a,b,c] = (a,b,c)
listToTuple4 [a,b,c,d] = (a,b,c,d)

getWords = getLine >>= return . words

readIntBS = fst . fromJust . BS.readInt


main :: IO ()
main = do
  (n,m,query) <- listToTuple3 . map read . words <$> getLine :: IO (Int,Int,Int)

  dat <- map (listToTuple2 . map readIntBS . BS.words) <$> (replicateM m BS.getLine) :: IO [(Int,Int)]

  arr <- newArray ((0,0),(n,n)) 0 :: IO (IOArray (Int,Int) Int)

  forM_ dat $ \(l,r) -> do
    modifyArray arr (l,r) (+1)

  forM_ [0..n] $ \l -> do
    forM_ [1..n] $ \r -> do
      ((+) <$> readArray arr (l,r-1) <*> readArray arr (l,r)) >>= \x -> writeArray arr (l,r) x

  forM_ [1..n] $ \l -> do
    forM_ [0..n] $ \r -> do
      ((+) <$> readArray arr (l-1,r) <*> readArray arr (l,r)) >>= \x -> writeArray arr (l,r) x


  replicateM query $ do
    (p,q) <- listToTuple2 . map readIntBS . BS.words <$> BS.getLine :: IO (Int,Int)

    a <- readArray arr (q,q)
    b <- readArray arr (p-1,q)
    c <- readArray arr (q,p-1)
    d <- readArray arr (p-1,p-1)

    print $ a - b - c + d
  
  return ()


Measured memory_bytes: 68092
#include <cstdio>
#include <algorithm>
#include <set>
#include <utility>
typedef long long int64;
static const int MAXN = 1e5 + 4;

int h, w, n;
int r[MAXN], c[MAXN];

std::set<std::pair<int, int>> painted, check;
int64 ans[10] = { 0 };

int main()
{
    scanf("%d%d%d", &h, &w, &n);
    for (int i = 0; i < n; ++i) {
        scanf("%d%d", &r[i], &c[i]);
        painted.insert(std::make_pair(r[i], c[i]));
        for (int rr = std::max(1, r[i] - 2); rr <= std::min(h - 2, r[i]); ++rr)
            for (int cc = std::max(1, c[i] - 2); cc <= std::min(w - 2, c[i]); ++cc)
                check.insert(std::make_pair(rr, cc));
    }

    for (auto p : check) {
        int ct = 0;
        for (int i = 0; i < 3; ++i)
            for (int j = 0; j < 3; ++j)
                ct += painted.count(std::make_pair(p.first + i, p.second + j));
        ans[ct] += 1;
    }
    ans[0] += (int64)(h - 2) * (w - 2) - (int64)check.size();
    for (int i = 0; i <= 9; ++i) printf("%lld\n", ans[i]);

    return 0;
}


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

using namespace std;

#define mod 1000000007

int main()
{
	string s;
	cin >> s;
	int gcnt = 0, pcnt = 0;
	for(int i = 0; i < s.length(); i++){
		if(s[i] == 'g') gcnt++;
		else pcnt++;
	}
	cout << max(0, (gcnt - pcnt) / 2) << endl;
}

Measured memory_bytes: 512
// #pragma GCC target("avx,avx2,fma")
// #pragma GCC optimization ("Ofast")
// #pragma GCC optimization ("unroll-loops")
#include <bits/stdc++.h>

using namespace std;
// #include <ext/pb_ds/assoc_container.hpp>
// #include <ext/pb_ds/tree_policy.hpp>
// using namespace __gnu_pbds;
// template <typename T>
// using o_set = tree <T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
// #define sfind(i) find_by_order(i)
// #define ord(i) order_of_key(i)
typedef long long ll;
typedef pair<int , int> pii;
typedef pair<ll, ll> pll;
typedef vector<pii> vii;
typedef vector<pll> vll;
using cd = complex<double>;
const double pi = acos(-1);
#define mod 1000000007
#define rep(i, a, b) for(ll i = a; i < b; i++)
#define repc(i, a, b, c) for (ll i = a; (c > 0 ? i < b : i > b) and c != 0; i += c)
#define vi vector<int>
#define vl vector<ll>
#define _max(vec) (*max_element(all(vec)))
#define _min(vec) (*min_element(all(vec)))
#define fi first
#define si second
#define pb push_back
#define all(name) name.begin(), name.end()
#define ral(name) name.rbegin(), name.rend()
#define fact(n) rep(i, 1, n+1)ft.pb((ft[i-1]*i)%mod)
#define mod_in(a) power(a, mod - 2)
#define ncr(n, r) (n>=r?((ft[n]*mod_in((ft[r]*ft[(n)-(r)])%mod))%mod):0LL)
#define deb(x) cerr << "[" << #x << " " << x << "]" << endl;
#define endl '\n'  //....????
#define int ll
vector<ll> ft(1, 1LL);


/*======================================================================*/
void solve(){
    int n, d, c = 0;
    cin >> n >> d;
    rep(i, 0, n){
        int a, b;
        cin >> a >> b;
        if(a*a + b*b <= d*d)c++;
    }
    cout << c;
}
signed main() {
	cin.sync_with_stdio(0); cin.tie(0);
	cin.exceptions(cin.failbit);
    int t = 1;
    //cin >> t;
    while(t--){
        solve();
    }
}

Measured memory_bytes: 3636
#include<stdio.h>
int main()
{
    char a,b;
    while(scanf("%c %c",&a,&b)!=EOF)
    {
        getchar();
        if(a=='H'&&b=='H')
            printf("H\n");
        else if(a=='H'&&b=='D')
            printf("D\n");
        else if(a=='D'&&b=='H')
            printf("D\n");
        else //if(a=='D'&&b=='D')
            printf("H\n");
    }
    return 0;
}

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

int main() {
  int N;
  cin >> N;
  int tmpn = N, sumn=0;
  for (int i=0; i<9; i++) {
    sumn += tmpn % 10;
    tmpn /= 10;
  }
  if (N % sumn) cout << "No" << endl;
  else cout << "Yes" << endl;
}


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


vector<vector<int>> combination;
void go(int length, int position, int value, vector<int> value_container){
    value_container.push_back(value);
    if (length <= position){
        combination.push_back(value_container);
        return;
    } else {
        go(length, position+1, 1, value_container);
        go(length, position+1, 0, value_container);
    }
}

int main(){
    int h,w,k;cin>>h>>w>>k;
    vector<string> mat(h);
    for(int i=0;i<h;i++){
        cin >> mat[i];
    }
    vector<int> height_value_container_1, height_value_container_2, width_value_container_1, width_value_container_2;
    go(h, 1, 0, height_value_container_1);
    go(h, 1, 1, height_value_container_2);
    auto combination_height = combination;

    combination = {};
    go(w, 1, 0, width_value_container_1);
    go(w, 1, 1, width_value_container_2);
    auto combination_width = combination;

    long long acc = 0;
    for (auto h_comb : combination_height){
        for (auto w_comb : combination_width){
            int red_count = 0;
            for (int i=0;i<h;i++){
                for (int j=0;j<w;j++){
                    if (mat[i][j] == '#' && h_comb[i] == 0 && w_comb[j] == 0){
                        red_count++;
                    }
                }
            }
            if (red_count == k){
                acc++;
            }

        }
    }
    cout << acc << endl;

}

Measured memory_bytes: 3672
#include <iostream>

using namespace std;

int main(){
	int r; cin >> r;
	if(r<1200){
		cout << "ABC" << endl;
		return 0;
	}
	if(r<2800 and r>=1200){
		cout << "ARC" << endl;
	}
	if(r>=2800){
		cout << "AGC" << endl;
	}
}


Measured memory_bytes: 256
#include<iostream>
#include<algorithm>
#include<cstdio>
#include<cmath>
#include<vector>
#include<utility>
#include<queue>
#include<deque>
#include<stack>
#include<set>
#include<map>
#include<bitset>
#include<string>
#define mod 1000000007
typedef long long ll;
using namespace std;

int N;

// next := sの中に登場していないアルファベットのうち最小のもの
void dfs(string s, char next){
    if(s.size() == N){
        cout << s << "\n";
        return;
    }else{
        for(char c='a';c<=next;c++){
            if(c != next){
                dfs((string)(s+c),next);
            }else{
                dfs((string)(s+c), (char)(next+1));
            }
        }
    }
}

int main(){
    cin >> N;
    dfs("",'a');
    return 0;
}

Measured memory_bytes: 1536
//In the name of ALLAH the most merciful the most beneficial

#include<cstdio>
#include<cstring>
#include<bits/stdc++.h>
#include<iostream>
#include<math.h>
#include<fstream>
#define sc(x) scanf("%d",&x)
#define ll long long
#define FOR(i,a,b) for(int i=a;i<b;i++)
#define FORd(i,a,b) for(int i=a;i>b;i--)
#define ff first
#define ss second
#define sz(x) x.size()
#define pb push_back

using namespace std;

typedef pair<int,int> pii;
typedef vector<pii> vii;
const int con = 1e6+7;
static const int INF = 0x3f3f3f3f;
static const int MOD = 1e9+7;


int val(int n){
    
    if(n%2 == 0)
        return n/2;
    return 3*n+1;
}

int main(){
/*
    clock_t start,end;
    start = clock();*/
    
    ll arr[3];
    FOR(i,0,3)
        cin >> arr[i];
    
    sort(arr,arr+3);
    if(arr[2]%2 == 0)
        cout << 0;
    else
        cout << arr[0]*arr[1];
    
    
    
/*  end = clock();
    double time = double(end-start)/(double)CLOCKS_PER_SEC;
    cout <<fixed<< time/1000 << "sec";*/
}

Measured memory_bytes: 256
#include<stdio.h>
#include<string.h>
int main()
{
     char a1[10],a2[10],a3[10] ;
	 scanf("%s %s %s",a1,a2,a3);
     int l1,l2,l3;
     l1=strlen(a1);
     l2=strlen(a2);
     l3=strlen(a3);
     char x,y1,y2,z;
     x=a1[l1-1];
     y1=a2[0];
     y2=a2[l2-1];
     z=a3[0];
     if(x==y1&&y2==z)printf("YES\n");
     if(x!=y1||y2!=z)printf("NO\n");
	 return 0;    
}

Measured memory_bytes: 128
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<ll> vi;
typedef vector<vector<ll>> vvi;
typedef pair<ll,ll> pii;
typedef vector<pii> vpii;
#define REP(i,n) FOR(i,0,n)
#define FOR(i,a,b) for(ll i=a;i<b;i++)
#define PB push_back
#define LB lower_bound
#define UB upper_bound
#define PQ priority_queue
#define UM unordered_map
#define US unordered_set
#define ALL(a) (a).begin(),(a).end()
const ll INF = (1ll << 60);

int main() {
  vi L(87);
  L[0]=2; L[1]=1;
  FOR(i,2,87) L[i]=L[i-1]+L[i-2];
  ll N; cin>>N;
  cout<<L[N]<<endl;
}


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

using namespace std;

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

#define int ll

const ll mod = 1e9 + 7;


main(){
	int k;
	cin >> k;
	int a[] = {1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51};

	cout << a[k-1] << endl;
	return 0;
}


Measured memory_bytes: 3592
fn main() {
    let mut sc = Scanner::new();
    let n = sc.read::<usize>();
    let x = sc.read::<usize>();

    let mut top = x;
    let mut right = n - x;
    let mut ans = top + right;
    while top > 0 && right > 0 {
        if top < right {
            ans += (right / top) * 2 * top;
            right %= top;
            if right == 0 {
                ans -= top;
            }
        } else {
            ans += (top / right) * 2 * right;
            top %= right;
            if top == 0 {
                ans -= right;
            }
        }
    }
    println!("{}", ans);
}

struct Scanner {
    ptr: usize,
    length: usize,
    buf: Vec<u8>,
    small_cache: Vec<u8>,
}

impl Scanner {
    fn new() -> Scanner {
        Scanner { ptr: 0, length: 0, buf: vec![0; 1024], small_cache: vec![0; 1024] }
    }

    fn load(&mut self) {
        use std::io::Read;
        let mut s = std::io::stdin();
        self.length = s.read(&mut self.buf).unwrap();
    }

    fn byte(&mut self) -> u8 {
        if self.ptr >= self.length {
            self.ptr = 0;
            self.load();
            if self.length == 0 {
                self.buf[0] = b'\n';
                self.length = 1;
            }
        }

        self.ptr += 1;
        return self.buf[self.ptr - 1];
    }

    fn is_space(b: u8) -> bool { b == b'\n' || b == b'\r' || b == b'\t' || b == b' ' }

    fn read<T>(&mut self) -> T where T: std::str::FromStr, T::Err: std::fmt::Debug, {
        let mut b = self.byte();
        while Scanner::is_space(b) {
            b = self.byte();
        }

        for pos in 0..self.small_cache.len() {
            self.small_cache[pos] = b;
            b = self.byte();
            if Scanner::is_space(b) {
                return String::from_utf8_lossy(&self.small_cache[0..(pos + 1)]).parse().unwrap();
            }
        }

        let mut v = self.small_cache.clone();
        while !Scanner::is_space(b) {
            v.push(b);
            b = self.byte();
        }
        return String::from_utf8_lossy(&v).parse().unwrap();
    }
}



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

# define x first    
# define y second
# define mp make_pair
// everything go according to my plan      
# define pb push_back
# define sz(a) (int)(a.size())
# define vec vector         
// shimkenttin kyzdary, dzyn, dzyn, dzyn...
# define y1    Y_U_NO_y1
# define left  Y_U_NO_left
# define right Y_U_NO_right  

using namespace std;

typedef pair <int, int> pii; 
typedef long long ll;
typedef long double ld;

const int Mod = (int)1e9 + 7;
const int MX = 1073741822;
const ll MXLL = 4e18;
const int Sz = 1110111;
// a pinch of soul
inline void Read_rap () {
  ios_base :: sync_with_stdio(0);
  cin.tie(0); cout.tie(0);
}
inline void randomizer3000 () {
  unsigned int seed;
  asm ("rdtsc" : "=A"(seed));
  srand (seed);
}
void files (string problem) {   
  if (fopen ((problem + ".in").c_str(),"r")) {
    freopen ((problem + ".in").c_str(),"r",stdin);
    freopen ((problem + ".out").c_str(),"w",stdout);
  }
}
void localInput(const char in[] = "s") { 
  if (fopen (in, "r")) {
    freopen (in, "r", stdin);
  }
  else
    cerr << "Warning: Input file not found" << endl;
}                     
int n;

int a[Sz];
           
int median() {      
  double sum = accumulate (a + 1, a + n + 1, 0);
  return round (sum / n);
}
int main()
{
  # ifdef Local
    //localInput();
  # endif
  Read_rap();
  cin >> n;
  for (int i = 1; i <= n; i++)
    cin >> a[i];

  int x = median();
  ll ans = 0;
  for (int i = 1; i <= n; i++)
    ans += abs (a[i] - x) * abs (a[i] - x);

  cout << ans;

  return 0;
}






// Coded by Z..



Measured memory_bytes: 256
import java.util.*;
import static java.lang.System.*;

public class Main {
	static Scanner sc = new Scanner(System.in);
	public static void main(String[] args) {
		int n = sc.nextInt();
		TreeMap<String,Integer> map = new TreeMap<>();
		List<String> key = new ArrayList<>();
		
		String s;
		int a;
		
		for (int i=0; i<n; i++) {
			s = sc.next();
			a = sc.nextInt();
			if (!map.containsKey(s)) {
				map.put(s,a);
				key.add(s);
			}
			else {
				map.put(s,map.get(s)+a);
			}
		}
		
		key.sort(Comparator.comparingInt(String::length)
				.thenComparing(Comparator.naturalOrder()));
				
		key.forEach(e->out.println(e+" "+map.get(e)));
		
	}
}


Measured memory_bytes: 50308
n, m = map(int, input().split())

la = [list(input()) for i in range(n)]
lb = [list(input()) for i in range(m)]
c = 0
t = False

for i in range(n-m+1):
    for j in range(n-m+1):
        if la[i][j] == lb[0][0]:
            t = True
            for k in range(m):
                for l in range(m):
                    if la[i+k][j+l] != lb[k][l]:
                        t = False
                        break
                if t == False:
                    break
            if t == True:
                break
        if t == True:
            break
    if t == True:
        break

if t == True:
    print("Yes")
else:
    print("No")

Measured memory_bytes: 3064
#include <iostream>
using namespace std;
int main(void){
    int i,j,k,x,n,count=0;
    while(true){
        count=0;
        cin >> n >> x;
        if(n==0&&x==0){
            break;
        }
        for(i=1;i<=n-2;i++){
            for(j=i+1;j<=n-1;j++){
                for(k=j+1;k<=n;k++){
                    if(i+j+k==x){
                        count++;
                    }
                }
            }
        }
    cout << count << endl;
    }
}


Measured memory_bytes: 3076
//Robs Code
#include<bits/stdc++.h>
#define speed ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define ll long long int
#define fri(l,k) for (i=l;i<=k;i++)
#define frj(l,k) for (j=l;j>=k;j--)
#define all(x) x.begin(),x.end()
#define ed cout<<"\n";
#define pb push_back
#define pii pair<ll,ll>
#define _1 first
#define _2 second
#define maxi 100000007
/**********************************************************/
using namespace std;
ll i,j,k,n,m,q,t,a,b,c,cnt,sum,tot;
int main() 
{
    speed;
    cin>>a>>b>>c;
    cout<<min(b/a,c);
    return 0;
}


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

using namespace std;

vector<int> primes;
vector<bool> isPrime;

int main() {
  isPrime.assign(555556, true);
  for (int i = 2; i <= 55555; i++) {
    if (isPrime[i]) {
      if (i % 5 == 1) primes.push_back(i);
      for (int j = 2 * i; j <= 55555; j += i) {
        isPrime[j] = false;
      }
    }
  }

  int n;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    if (i) printf(" ");
    printf("%d", primes[i]);
  }
  printf("\n");
  return 0;
}


Measured memory_bytes: 384
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main(){
	int a, b, c;
	cin >> a >> b >> c;
	vector<int> numbers;
	numbers.push_back(a);
	numbers.push_back(b);
	numbers.push_back(c);
	sort(numbers.begin(),numbers.end());//???????????????
	cout << numbers[0]  << " " << numbers[1] <<  " " << numbers[2] << endl;
}

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

using namespace std;

double Rec(int c1,int c2,int c3);

int n;
double Dp[330][330][330];

int main()
{
    memset(Dp,-1,sizeof(Dp));

    int a;
    int c1 = 0;
    int c2 = 0;
    int c3 = 0;

    cin>>n;

    for(int i=0;i<n;i++)    scanf("%d",&a) , a==1 ? c1++ : a==2 ? c2++ : c3++ ;

    printf("%.10f",Rec(c1,c2,c3));

}

double Rec(int c1,int c2,int c3)
{
    if(!c1&&!c2&&!c3)   return 0.0;

    if(Dp[c1][c2][c3]==Dp[c1][c2][c3])  return Dp[c1][c2][c3];

    double p1 = 1.0*c1/n;
    double p2 = 1.0*c2/n;
    double p3 = 1.0*c3/n;

    double p = p1 + p2 + p3;
    double q = 1.0 - p;

    double Res1 = ( c1 ? p1*(1.0+Rec(c1-1,c2,c3)) : 0.0 );
    double Res2 = ( c2 ? p2*(1.0+Rec(c1+1,c2-1,c3)) : 0.0 );
    double Res3 = ( c3 ? p3*(1.0+Rec(c1,c2+1,c3-1)) : 0.0 );

    double Res4 = Res1 + Res2 + Res3;

    if(c1+c2+c3==n) return Dp[c1][c2][c3] = Res4;

    double Res5 = (Res4+q)/(1-q);

    return Dp[c1][c2][c3] = Res5;
}


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

#define MAXLEN 1200

int main() {
    string input;
    getline(cin, input);
    int N = input.size();
    int d = 'A' - 'a';
    for (int i = 0; i < N; i++) {
        char output;
        if (input[i] >= 'a' && input[i] <= 'z') {
            output = input[i] + d;
        } else if (input[i] >= 'A' && input[i] <= 'Z') {
            output = input[i] - d;
        } else {
            output = input[i];
        }
        cout << output;
    }
    cout << endl;
    return 0;
}


Measured memory_bytes: 3212
#include <stdio.h>

int main(void)
{
	int n;
	int pay = 100000;
	int zei;
	int i;
	
	scanf("%d", &n);
	for (i = 0; i < n; i++){
		zei = pay / 20;
		pay += zei;
		if (pay % 1000 != 0){
			pay /= 1000;
			pay *= 1000;
			pay += 1000;
		}
	}
	
	printf("%d\n", pay);
	
	return (0);
}

Measured memory_bytes: 0
#include <stdio.h>

int tri(int X,int Y,int Z){
    int s,s2=X+Y+Z,x,y,z;
    if(s2%2)return 0;
    s=s2/2;
    x=s-Y;
    y=s-Z;
    z=s-X;
    if(x<1||y<1||z<1) return 0;
    if(x!=y){
        if(y==z||z==x){
            return 3;
        }else{
            return 6;
        }
    }else{
        if(y==z){
            return 1;
        }else{
            return 3;
        }
    }
}

int f(int n){
    int X=2,XX=4,Y,YY,Z,ZZ,count=0,n2=2*n;
    while(XX+8<=n2){
        Y=2;
        YY=4;
        while(Y<=X && XX+YY+4<=n2){
            Z=2;
            ZZ=4;
            if((X+Y)%2){
                Z=3;
                ZZ=9;
            }
            while(Z<=Y && XX+YY+ZZ<=n2){
                if(XX+YY+ZZ==n2){
                    count +=tri(X,Y,Z);
                    break;
                }
                ZZ+=4*Z+4;
                Z+=2;
            }
            YY+=2*Y+1;
            Y+=1;
        }
        XX+=2*X+1;
        X+=1;
    }
    return count;
}

int main(){
    int i,n;
    scanf("%d",&n);
    for(i=1;i<=n;i++){
        printf("%d\n",f(i));
    }
    return 0;
}


Measured memory_bytes: 1676
#include<stdio.h>
#include<string>
#include<math.h>
#include<stdlib.h>
#include<set>
#include<bitset>
#include<map>
#include<vector>
#include<string.h>
#include<algorithm>
#include<iostream>
#include<queue>
#include<deque>
#include<stack>
#include<cmath>
#include<ctime>
#include<complex>
#include<list>
#include<limits.h>
using namespace std;

int a,b;

int main(){
	scanf("%d%d",&a,&b);
	if((a+b)%2==0) printf("%d\n",(a+b)/2);
	else puts("IMPOSSIBLE");
	return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define ld long double
#define mod 1000000007
#define f(i,a,b) for(ll i=a;i<b;i++)
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define ii pair<ll,ll>
#define vii vector<ii>
#define F first
#define S second
#define pb push_back
#define mp make_pair
#define MAX 1e9
 
ll modpow(ll base, ll exp, ll modulus) {base %= modulus;ll result = 1;while (exp > 0) {if (exp & 1) result = (result * base) % modulus;base = (base * base) % modulus;exp >>= 1;}return result;}
const ld pi=acos(-1);

int main(){
    IOS;
    string s,t;cin>>s>>t;
    ll a,b;cin>>a>>b;
    string x;cin>>x;
    if(x==s)a--;
    else b--;
    cout<<a<<" "<<b;
    return 0;  
} 

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

namespace ABC154
{
    public class QuestionA
    {
        public static void Main(string[] args)
        {
            var st = Console.ReadLine().Split();
            var ab = Console.ReadLine().Split().Select(int.Parse).ToArray();

            var (s, t) = (st[0], st[1]);
            var (a, b) = (ab[0], ab[1]);
            var u = Console.ReadLine();

            if (s == u)
            {
                a--;
            }
            else
            {
                b--;
            }

            Console.WriteLine($"{a} {b}");
        }
    }
}


Measured memory_bytes: 28188
#if 0
cat <<EOF >mistaken-paste
#endif
// thx Ebi-chan!

#pragma GCC diagnostic ignored "-Wincompatible-pointer-types"
#define _USE_MATH_DEFINES

#include <stdio.h>
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
#include <stdbool.h>
#include <math.h>
#include <time.h>

#define FOD  998244353
typedef uint64_t ull;
typedef  int64_t sll;

#define N_MAX 1048576

ull n;

ull bitpow (ull a, ull x, ull modulo) {
	ull result = 1;
	while (x) {
		if (x & 1) {
			result *= a;
			result %= modulo;
		}
		x /= 2;
		a = (a * a) % modulo;
	}
	return result;
}

sll a[N_MAX + 5];

ull dp[100000], dq[100000];

ull solve () {
	sll i, j, ki, li;
	sll result = 0;
	double dresult = 0;
	sll maybe = 0;
	sll sum = 0;
	sll item;
	sll *dpcell;

	for (i = 0; i < n; i++) {
		sum += a[i];
	}

	dp[0] = dq[0] = 1;
	for (i = 0; i < n; i++) {
		for (j = sum; j >= 0; j--) {
			dp[j] *= 2;
			if (j >= a[i]) {
				dp[j] += dp[j - a[i]];
				dq[j] += dq[j - a[i]];
			}

			dp[j] %= FOD;
			dq[j] %= FOD;
		}
	}

	for (j = sum; j * 2 >= sum; j--) {
		result += dp[j];
		result %= FOD;
	}
	if (sum % 2 == 0) {
		result += (FOD - dq[sum / 2]) * 2;
	}
	result *= 3;
	result %= FOD;
	if (sum % 2 == 0) {
		result = (result + dq[sum / 2] * 3) % FOD;
	}

	result = (FOD + bitpow(3, n, FOD) - result) % FOD;

	printf("%lld\n", result);

	return 0;
}

int32_t main (int argc, char *argv[]) {
	int32_t i, j;

	scanf("%llu", &n);
	for (i = 0; i < n; i++) {
		scanf("%lld", &a[i]);
	}

	solve();

	return 0;
}


Measured memory_bytes: 1536
#include <cassert>
#include <cstdio>
#include <cmath>
#include <iostream>
#include <iomanip>
#include <sstream>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <numeric>
#include <algorithm>

using namespace std;
using lint = long long;
constexpr int MOD = 1000000007, INF = 1010101010;
constexpr lint LINF = 1LL << 60;

template <class T>
ostream &operator<<(ostream &os, const vector<T> &vec) {
	for (const auto &e : vec) os << e << (&e == &vec.back() ? "" : " ");
	return os;
}

#ifdef _DEBUG
template <class T>
void dump(const char* str, T &&h) { cerr << str << " = " << h << "\n"; };
template <class Head, class... Tail>
void dump(const char* str, Head &&h, Tail &&... t) {
	while (*str != ',') cerr << *str++; cerr << " = " << h << "\n";
	dump(str + (*(str + 1) == ' ' ? 2 : 1), t...);
}
#define DMP(...) dump(#__VA_ARGS__, __VA_ARGS__)
#else 
#define DMP(...) ((void)0)
#endif

int main() {

	cin.tie(nullptr);
	ios::sync_with_stdio(false);

	int N;
	cin >> N;

	cout << fixed << setprecision(10) << (N + 1) / 2 * 1.0 / N << "\n";

	return 0;
}

Measured memory_bytes: 256