akhauriyash/Code-Regression huggingface dataset:
#include<stdio.h>
#include<iostream>
#include<algorithm>
#include<string>
#include<string.h>
#include<math.h>
#include<stdlib.h>
#include<vector>
#include<queue>
#include<map>
#define rep(index,num) for(int index=0;index<num;index++)
#define rep1(index,num) for(int index=1;index<=num;index++)
#define scan(argument) cin>>argument
#define prin(argument) cout<<argument<<endl
#define kaigyo cout<<endl
#define eps 1e-15
typedef long long ll;
using namespace std;
typedef pair<int,int> pint;
typedef vector<int> vint;
int INF=2e+9+1;
int main(){
	int N,K;
	int x[50],y[50];
	ll Smin=4e+18+1;
	vint xzahyo,yzahyo;
	scan(N);scan(K);
	rep(i,N){
		scan(x[i]);scan(y[i]);
		xzahyo.push_back(x[i]);
		yzahyo.push_back(y[i]);
	}
	sort(xzahyo.begin(),xzahyo.end());
	sort(yzahyo.begin(),yzahyo.end());
	for(int i=0;i<N-1;i++){
		for(int j=i+1;j<N;j++){
			int x1=min(x[i],x[j]),x2=max(x[i],x[j]);
			for(int a=0;a<N-1;a++){
				for(int b=a+1;b<N;b++){
					int y1=min(y[a],y[b]);
					int y2=max(y[a],y[b]);
					if(x1<=x[a]&&x[a]<=x2&&y1<=y[a]&&y[a]<=y2){
						ll S=(ll)(x2-x1)*(y2-y1);
						if(S>=Smin) continue;
						int insidenum=0;
						rep(k,N){
							if(x1<=x[k]&&x[k]<=x2&&y1<=y[k]&&y[k]<=y2){
								insidenum++;
							}
						}
						if(insidenum>=K){
							Smin=min(Smin,S);
						}
					}
				}
			}
		}
	}
	prin(Smin);
	return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
string s,t;
int ans;
int main(){
	cin>>s>>t;
	if(s[0]==t[0]) ans++;
	if(s[1]==t[1]) ans++;
	if(s[2]==t[2]) ans++;
	cout<<ans;
	return 0;
}

Measured memory_bytes: 256
def f(a)
  g = lambda{|a, positivep|
    total = 0
    a.inject(0){|r, v|
      if positivep
        new_v = [v, -r-1].min
        total += v - new_v
      else
        new_v = [v, -r+1].max
        total += new_v - v
      end
      positivep = !positivep
      r + new_v
    }
    total
  }
  [g.(a, true), g.(a, false)].min
end

N = gets.to_i
A = gets.split.take(N).map(&:to_i)
p f(A)


Measured memory_bytes: 11396
#include<bits/stdc++.h>
using ll= long long;
#define REP(i,n) for(ll i=0;i<ll(n);i++)
#define FOR(i,a,b) for(ll i=a;i<=ll(b);i++)
#define ALL(x) x.begin(),x.end()

#define INF (ll)1e9 //10^9:∞
#define LLINF (ll)1e12
#define MOD (ll)(1e9+7) //10^9+7:合同式の法
#define PI 3.141592653589
#define PB push_back
#define F first
#define S second
#define __MAGIC__ ios::sync_with_stdio(false);cin.tie(nullptr);

#define YESNO(T) if(T){cout<<"YES"<<endl;}else{cout<<"NO"<<endl;}
#define yesno(T) if(T){cout<<"yes"<<endl;}else{cout<<"no"<<endl;}
#define YesNo(T) if(T){cout<<"Yes"<<endl;}else{cout<<"No"<<endl;}

#define Graph vector<vector<int>>
#define PII pair<int,int>
#define VI vector<int>
#define VVI vector<vector<int>>
#define VPII vector<pair<int,int>>

#define DDD fixed<<setprecision(10)
#define endl "\n"

using namespace std;
/*..................DEFINE GLOBAL VARIABLES...................*/


/*.....................DEFINE FUNCTIONS ......................*/



/*.........................kemkemG0...........................*/
signed main() {
	__MAGIC__


	ll N,M;
	priority_queue<ll> pq;

	cin>>N>>M;

	REP(i,N){
		ll A;
		cin>>A;
		pq.push(A);
	}
	REP(i,M){
		ll now=pq.top(); pq.pop();
		pq.push(now/2LL);
	}
	ll ans=0LL;
	while(!pq.empty()){
		ans+=pq.top(); pq.pop();
	}
	cout<<ans<<endl;



		return 0;
}


Measured memory_bytes: 4288
def find(x):
    b = 0
    while True:
        right = pow(b,5)+x
        left = pow(right,1/5)
        if pow(int(left), 5)==right:
            return left, b
        right = pow(-b,5)+x
        if right>=0:
            left = pow(right,1/5)
            if pow(int(left), 5)==right:
                return left, -b
        b+=1
x = int(input())
a,b = find(x)
print(int(a),b)

Measured memory_bytes: 62604
// ~/BAU/ACM-ICPC/Teams/Rampage/Abukhadijah
// ~/Remember,remember the 6th of March
#include <functional>
#include <iomanip>
#include <stdio.h>
#include <vector>
#include <algorithm>
#include<complex>
#include <unordered_map>
#include<unordered_set>
#include <numeric>
#include <string>
#include<iostream>
#include <fstream>
#include <assert.h>
#include <ctype.h>
#include <limits.h>
#include <math.h>
#include<cmath>
#include <stdlib.h>
#include <math.h>
#include <string.h>
#include <time.h>
#include <bitset>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <sstream>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
#define endl '\n';
const double PI = acos(-1.0);
const double  EPS = 1e-11;
const ll MOD = 1000000007;
const int N = 109;
//freopen("input.txt","r",stdin);
//freopen("output.txt","w",stdout);
void fast()
{
	std::ios_base::sync_with_stdio(0);
}
int main()
{
	int x;
	cin >> x;
	if (x < 1200)
		puts("ABC");
	else if (x<2800)
		puts("ARC");
	else
		puts("AGC");

	return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#include<iostream>
#include<string>
#include<cmath>
#include<cstdio>
#include<cctype>
#include<cstring>
#include<iomanip>
#include<cstdlib>
#include<ctime>
#include<set>
#include<map>
#include<utility>
#include<queue>
#include<vector>
#include<stack>
#include<sstream>
#include<algorithm>
#define forn(i,a,b)for(int i=(a),_b=(b);i<=_b;i++)
#define fore(i,b,a)for(int i=(b),_a=(a);i>=_a;i--)
#define rep(i,n)for(int i=0,_n=n;i<n;i++)
#define ll long long
#define pii pair<int,int>
#define vi vector<int>
#define vpii vector<pii>
#define m_p make_pair
#define re return
#define pb push_back
#define si set<int>
#define ld long double
#define X first
#define Y second
#define st string
#define ull unsigned long long
#define mod 1000000007
#define INF 1000000007
#define x1 XZVJDFADSPFOE
#define y1 GASDIJSLDAEJF
#define x2 DFDAJKVOHKWIW
#define y2 PSFSAODSXVNMQ
#define LLINF 0x3f3f3f3f3f3f3f3fLL
using namespace std;
inline void read(int &x)
{
	short negative=1;
    x=0;
    char c=getchar();
    while(c<'0' || c>'9')
    {
		if(c=='-')
			negative=-1;
		c=getchar();
	}
    while(c>='0' && c<='9')
        x=(x<<3)+(x<<1)+(c^48),c=getchar();
    x*=negative;
}
ll quickpower(ll n,ll k){
	ll ans=1;
	while(k){
		if(k%2){
			ans*=n;
			ans%=mod;
		}
		n*=n;
		n%=mod;
		k/=2;
	}
	return ans;
}
string int_to_string(int n)
{
	string s="";
	while(n)
	{
		int now=n%10;
		s+=now+'0';
		n/=10;
	}
	reverse(s.begin(),s.end());
	return s;
}
int string_to_int(string s)
{
	int n=0;
	rep(i,s.size())
	{
		n*=10;
		n+=s[i]-'0';
	}
	return n;
}
int main()
{
	ios::sync_with_stdio(0);
	//think twice,code once
	int n;
	cin>>n;
	ll res=0;
	forn(i,1,n)
		forn(j,1,n)
			forn(k,1,n)
				res+=__gcd(__gcd(i,j),k);
	cout<<res<<endl;
	return 0;
}



Measured memory_bytes: 3652
#include<iostream>
#include<stdio.h>
//#include <bits/stdc++.h>
#include<vector>
#include<float.h>
#include<iomanip>
#include<algorithm>
#include<string>
#include<cstring>
#include<math.h>
#include<cmath>
#include<sstream>
#include<set>
#include<map>
#include<queue>
#include <cassert>
#include <cmath>
#include<cstdint>

#define INF 1e9
#define rep(i,n)for(int i=0;(i)<(int)(n);i++)
#define REP(i,a,b)for(int i=(int)(a);(i)<=(int)(b);i++)
#define VEC(type, c, n) std::vector<type> c(n);for(auto& i:c)std::cin>>i;
#define vec(type,n) vector<type>(n)
#define vvec(m,n) vector<vector<int>> (int(m),vector<int>(n))
#define ALL(a)  (a).begin(),(a).end()

using namespace std;
using ll = long long;
using Graph = vector<vector<int>>;
using P = pair<int,int>;

vector<int>bitSearch(int bit,int n){
    vector<int>S;
    rep(i,n)if(bit&(1<<i))S.push_back(i);
    return S;
}

int d[5*100000+1];
int main(){
    string s;cin>>s;
    bool n = false,w = false,ss = false,e = false;
    rep(i,s.size()){
        if(s[i]=='N')n = true;
        if(s[i]=='W')w = true;
        if(s[i]=='E')e = true;
        if(s[i]=='S')ss = true;
    }
    if(n&&ss&&!w&&!e)cout<<"Yes";
    else if(!n&&!ss&&w&&e)cout<<"Yes";
    else if(n&&ss&&w&&e)cout<<"Yes";
    else cout<<"No";
    cout<<endl;
}



Measured memory_bytes: 256
#include<iostream>
#include<algorithm>

using namespace std;

int main(){
    int c1, c2, c3;
    while(cin >> c1 >> c2 >> c3){
	int p = 20 - c1 - c2, res = 0;
	for(int i = 1;i <= 10;i++){
	    if(i == c1 || i == c2 || i == c3)continue;
	    if(i <= p)res++;
	}
	if(p > 3)cout << "YES" << endl;
	else cout << "NO" << endl;
    }
    return 0;
}

Measured memory_bytes: 1152
#include <stdio.h>
#pragma warning (disable:4996)
int main()
{
	int a;
	int b;
	int c;
	scanf("%d %d %d", &a, &b, &c);
	if (b - a == c - b)
	{
		printf("YES\n");
	}
	else
	{
		printf("NO\n");
	}
	return 0;
}

Measured memory_bytes: 128
import java.util.Scanner;

public class Main{	
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int n;
		int max,min;
		int sum=0,ave;
		int[] point;
		while(true){
			n = sc.nextInt();
			if(n==0){
				break;
			}
			point = new int[n];
			for(int i=0;i<n;i++){
				point[i]=sc.nextInt();
			}
			max = point[0];
			min = point[0];
			for(int i=0;i<n;i++){
				if(max<point[i])
					max=point[i];
				if(min>point[i])
					min=point[i];
			}
			sum=0;
			for(int i=0;i<n;i++){
				sum+=point[i];
			}
			sum=sum-min-max;
			ave = sum/(n-2);
			System.out.println(ave);	
		}
		sc.close();
	}
}


Measured memory_bytes: 29140
//#include <tourist>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <iostream>
#include <string>
#include <iomanip>
#include <limits>
#include <vector>
#include <map>
#include <set>
#include <stack>
#include <list>
#include <queue>
#include <tuple>
#include <deque>
#include <algorithm>
#include <numeric>
#include <iomanip>
#include <utility>
#include <complex>
#include <functional>
using namespace std;
const int MOD = 1000000007;
typedef long long ll;
typedef pair<ll, ll> p;
const int INF = (1 << 28);
const int dx[4] = {0, 1, 0, -1}, dy[4] = {-1, 0, 1, 0};
const int Dx[8] = {0, 1, 1, 1, 0, -1, -1, -1}, Dy[8] = {-1, -1, 0, 1, 1, 1, 0, -1};
#define yes cout << "Yes" << endl
#define YES cout << "YES" << endl
#define no cout << "No" << endl
#define NO cout << "NO" << endl
#define REP(i, n) for (int i = 0; i < n; i++)
#define REPR(i, n) for (int i = n; i >= 0; i--)
#define FOR(i, m, n) for (int i = m; i < n; i++)
#define INF 2e9
#define ALL(v) v.begin(), v.end()
//setprecision(15)有効数字15桁
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
ll lcm(ll a, ll b)
{
    return a * b / gcd(a, b);
}
struct Bipartite_Matching
{
    vector<vector<int> > graph;
    vector<int> match, alive, used;
    int timestamp;

    Bipartite_Matching(int n)
    {
        timestamp = 0;
        graph.resize(n);
        alive.assign(n, 1);
        used.assign(n, 0);
        match.assign(n, -1);
    }

    void add_edge(int u, int v)
    {
        graph[u].push_back(v);
        graph[v].push_back(u);
    }

    bool dfs(int v)
    {
        used[v] = timestamp;
        for (int i = 0; i < graph[v].size(); i++)
        {
            int u = graph[v][i], w = match[u];
            if (alive[u] == 0)
                continue;
            if (w == -1 || (used[w] != timestamp && dfs(w)))
            {
                match[v] = u;
                match[u] = v;
                return (true);
            }
        }
        return (false);
    }

    int bipartite_matching()
    {
        int ret = 0;
        for (int i = 0; i < graph.size(); i++)
        {
            if (alive[i] == 0)
                continue;
            if (match[i] == -1)
            {
                ++timestamp;
                ret += dfs(i);
            }
        }
        return (ret);
    }
};
int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n;
    int V;
    int a[200], b[200], c[100], d[100];
    vector<int> G[200];
    int match[200];
    bool used[200];
    cin >> n;
    V = n * 2;
    Bipartite_Matching bm(2*n);
    for (int i = 0; i < 2 * n; i++)
    {
        cin >> a[i] >> b[i];
    }
    for (int i = 0; i < n; i++)
    {
        for (int j = 0; j < n; j++)
        {
            if (a[i] < a[j + n] && b[i] < b[j + n])
            {
                bm.add_edge(i, j + n);
            }
        }
    }
    cout << bm.bipartite_matching() << "\n";
}



Measured memory_bytes: 256
#include<iostream>
#include<algorithm>
#include<vector>
#include<numeric>
#include<string>
#include<cmath>
#include<set>
#include<queue>
#include<deque>
#include<bitset>
#include<iomanip>
#include<cctype>
#include<map>
#include<cstring>
#include<bitset>
#include<cassert>

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

using namespace std;
using ll = long long int;

const int inf = 1001001000;
const long long int Inf = 1001001001001001000;



void print(vector<vector<int>> a){
	for (int i = 0; i < a.size(); i++)
	{
		for (int j=0;j<a[i].size();j++){
			cout << a[i][j] << " ";
		}
		cout << endl;
	}
}

void print(vector<vector<long long int>> a){
	for (int i=0;i<a.size();i++){
		for (int j=0;j<a[i].size();j++){
			cout << a[i][j] << " ";
		}
		cout << endl;
	}
}

void print(vector<int> a){
    int n = a.size();
    for (int j=0;j<n;j++) {
        if (j != n-1) cout << a[j] << " ";
        else cout << a[j] << endl;
    }
}

void print(vector<long long int> a){
    int n = a.size();
    for (int j=0;j<n;j++) {
        if (j != n-1) cout << a[j] << " ";
        else cout << a[j] << endl;
    }
}

void print(set<int> a){
	for (auto x:a)
		cout << x << " ";
	cout << endl;
}

int main()
{
	int k;
	cin >> k;
	int d = 1;
	int ans = 0;
	int now = 0;
	rep(i,10000000){
		now += (7 % k) * (d % k);
		now = now % k;
		d = (d * 10) % k;
		if(now == 0){
			cout << i + 1 << endl;
			return 0;
		}
	}
	cout << -1 << endl;

	return 0;
}

Measured memory_bytes: 3636
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner scanner=new Scanner(System.in);
        double r=scanner.nextDouble();
        double s=r*r*3.14159265359;
        double l=2*r*3.14159265359;
        System.out.printf("%f %f\n", s,l);
        
    }

}

Measured memory_bytes: 28244
def read_int():
    return int(input().strip())


def read_ints():
    return list(map(int, input().strip().split(' ')))


def solve():
    A, B, C, D = read_ints()
    while True:
        # health, strength = A, B
        C -= B
        if C <= 0:
            return 'Yes'
        A -= D
        if A <= 0:
            return 'No'


if __name__ == '__main__':
    print(solve())

Measured memory_bytes: 9060
using System;
using System.Linq;
public class s
{
  public static void Main()
  {
    int[] Xt=Console.ReadLine().Split(' ').Select(int.Parse).ToArray();
    if(Xt[0]<=Xt[1])Console.WriteLine(0);
    else Console.WriteLine(Xt[0]-Xt[1]);
  }
}

Measured memory_bytes: 13268
a=input()
 
b = int(a[:2])
c = int(a[2:])
 
if 0< b < 13:
    a_month_flag = 1
    
elif b == 0:
    a_month_flag = 0    
else:
    a_month_flag = 0
 
if 0< c < 13:
    b_month_flag = 1
    
elif c == 0:
    b_month_flag = 0
  
else:
    b_month_flag = 0
 
if a_month_flag ==1 and b_month_flag==1:
    print("AMBIGUOUS")
elif a_month_flag == 1 and b_month_flag == 0:
    print("MMYY")
elif a_month_flag == 0 and b_month_flag ==1:
    print("YYMM")
else:
    print("NA")

Measured memory_bytes: 9196
#pragma GCC optimize(2)
#include<bits/stdc++.h>
#include<ext/rope>
using namespace std;
using namespace __gnu_cxx;
#define int long long
const int MAXN = 2000+50;
const int MAXM = 8*15+50;
const int MOD = 1e9+7;
const double PI = acos(-1);
inline char getc(){
    static char buf[1000000],*p1=buf,*p2=buf;
    return p1==p2&&(p2=(p1=buf)+fread(buf,1,1000000,stdin),p1==p2)?EOF:*p1++;
}
inline int read(){
    int x=0,f=0; char ch=getc();
    while(!isdigit(ch)){ if(ch=='-') f=1; ch=getc(); }
    while(isdigit(ch)) x=x*10+ch-48,ch=getc();
    return f?-x:x;
}
int x[MAXN],y[MAXN],z[MAXN],g[MAXN][MAXN];
signed main(){
#ifndef ONLINE_JUDGE
    //freopen("C:\\Users\\Administrator\\Desktop\\in.txt","r",stdin);
#endif // ONLINE_JUDGE
    memset(g,-0x3f,sizeof(g));
    int n=read(),m=read(),Q=read(); bool ok=true;
    for(int i=1;i<=Q;i++){
        x[i]=read(),y[i]=read(),z[i]=read();
        for(int j=1;j<i;j++)
            if(abs(x[i]-x[j])+abs(y[i]-y[j])<abs(z[i]-z[j]))
                ok=false;
    }
    if(!ok){ puts("No");return 0; }
    int res=0;
    for(int i=1;i<=Q;i++)
        for(int j=1;j<=n;j++)
            for(int k=1;k<=m;k++)
                g[j][k]=max(g[j][k],z[i]-abs(j-x[i])-abs(k-y[i]));
    for(int i=1;i<=n;i++)
        for(int j=1;j<=m;j++)
            res+=g[i][j];
    printf("%lld\n",res);
    return 0;
}



Measured memory_bytes: 36068
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); i++)
#define rrep(i, n) for (int i = (n - 1); i >= 0; i--)
#define ALL(v) v.begin(), v.end()
using namespace std;
using P = pair<int, int>;
typedef long long ll;
ll dp[3030][3030][4];
ll T[3030][3030];

int main() {
  int R, C, K;
  cin >> R >> C >> K;
  rep(i, K) {
    int r, c;
    ll v;
    cin >> r >> c >> v;
    r--, c--;
    T[r][c] = v;
  }
  rep(i, R) {
    rep(j, C) {
      for(int k = 2; k >= 0; k--){
        dp[i][j][k + 1] = max(dp[i][j][k] + T[i][j], dp[i][j][k+1]);
      }
      rep(k, 4) {
        dp[i][j + 1][k] = max(dp[i][j][k], dp[i][j + 1][k]);
        dp[i+1][j][0] = max(dp[i][j][k], dp[i+1][j][0]);
      }
    }
  }
  ll ans = 0;
  rep(i, 4) {
    ans = max(ans, dp[R-1][C-1][i]);
  }
  cout << ans << endl;
}


Measured memory_bytes: 358684
#include<cstdio>
#include<iostream>
#include<vector>
#include<algorithm>
#include<map>
#include<set>
#include<queue>
#include<string>

using namespace std;

#define rep(i,n) for(int i=0;i<int(n);i++)
#define reps(i,n) for(int i=1;i<=int(n);i++)
#define sint(i) scanf("%d",&i);
#define sintt(i,j) scanf("%d%d",&i,&j);
#define sinttt(i,j,k) scanf("%d%d%d",&i,&j,&k);

#define INF 1010000000
int dx[]={1,0,-1,0};
int dy[]={0,1,0,-1};

class S{
	public:
	string st;
	int n;
	S(string st,int n):st(st),n(n){}
};

int main(){
	while(1){
		string a;
		cin>>a;
		
		if(a=="0")break;
		
		queue<S> que;
		que.push(S(a,0));
		
		map<string,int> visit;
		int ans=-1;
		while(1){
			if(que.empty()==1){
				break;
			}
			
			S u=que.front();
			que.pop();
			
			if(visit[u.st]==1){
				continue;
			}
			visit[u.st]=1;
			
			int r=0,g=0,b=0;
			rep(i,u.st.size()){
				if(u.st[i]=='r'){
					r++;
				}
				if(u.st[i]=='g'){
					g++;
				}
				if(u.st[i]=='b'){
					b++;
				}
			}
			if((r==0&&g==0)||(r==0&&b==0)||(b==0&&g==0)){
				ans=u.n;
				break;
			}
			
			rep(i,u.st.size()-1){
				string nstr=u.st;
				if(u.st[i]=='r' && u.st[i+1]=='g'){
					nstr[i]=nstr[i+1]='b';
				}
				if(u.st[i]=='g' && u.st[i+1]=='r'){
					nstr[i]=nstr[i+1]='b';
				}
				if(u.st[i]=='r' && u.st[i+1]=='b'){
					nstr[i]=nstr[i+1]='g';
				}
				if(u.st[i]=='b' && u.st[i+1]=='r'){
					nstr[i]=nstr[i+1]='g';
				}
				if(u.st[i]=='b' && u.st[i+1]=='g'){
					nstr[i]=nstr[i+1]='r';
				}
				if(u.st[i]=='g' && u.st[i+1]=='b'){
					nstr[i]=nstr[i+1]='r';
				}
				
				que.push(S(nstr,u.n+1));
			}
		}
		if(ans==-1){
			puts("NA");
		}else{
			printf("%d\n",ans);
		}
	}	
}

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

bool A(string S){
  for(int i=0;i<S.size()/2;i++){
    if(S.at(i)!=S.at(i+S.size()/2)){
      return 1;
    }
  }
  return 0;
}

int main(){
  string N;cin>>N;
  N.pop_back();
  if(N.size()%2){
    N.pop_back();
  }
  while(A(N)){
    N.pop_back();
    N.pop_back();
  }
  cout<<N.size()<<endl;
}

Measured memory_bytes: 3556
#include <bits/stdc++.h>
#include <math.h>
using namespace std;
int main(){
    int64_t X;
    cin>>X;
    bool S=false;
    while(S==false){
      bool T=false;
      for(int i=2;i<X;i++){if(X%i==0){T=true;}}
      if(T==false){S=true;cout<<X<<endl;return 0;}
      X++;
    }
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using lint = long long;
typedef pair<lint, lint> P;

signed main(){
  lint N, M; cin >> N >> M;
  vector<lint> a(N);
  lint sum = 0;
  for(lint i = 0; i < N; i++) {
    cin >> a[i];
    sum += a[i];
  }
  sort(a.begin(), a.end());
  vector<P> b(M);
  for(lint i = 0; i < M; i++) cin >> b[i].second >> b[i].first;
  sort(b.begin(), b.end()); reverse(b.begin(), b.end());
  lint par = 0, start = 0;
  for(lint i = 0; i < N; i++){
    if(b[start].first > a[i]){
      sum = sum - a[i] + b[start].first;
      par++;
    }
    if(par == b[start].second){
      start++; par = 0;
    }
  }
  cout << sum << endl;
}

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

typedef pair<int, int> pii;
typedef long long ll;
template<class T> using V = vector<T>;
template<class T> using VV = V<V<T>>;

#define pb push_back
#define eb emplace_back
#define mp make_pair
#define fi first
#define se second
#define rep(i,n) rep2(i,0,n)
#define rep2(i,m,n) for(int i=m;i<(n);i++)
#define ALL(c) (c).begin(),(c).end()
#define dump(x) cout << #x << " = " << (x) << endl
constexpr ll TEN(int n) { return (n == 0) ? 1 : 10 * TEN(n-1); }

template<class T, class U> void chmin(T& t, const U& u) { if (t > u) t = u; }
template<class T, class U> void chmax(T& t, const U& u) { if (t < u) t = u; }

template<class T, class U>
ostream& operator<<(ostream& os, const pair<T, U>& p) {
	os<<"("<<p.first<<","<<p.second<<")";
	return os;
}

template<class T>
ostream& operator<<(ostream& os, const vector<T>& v) {
	os<<"{";
	rep(i, v.size()) {
		if (i) os<<",";
		os<<v[i];
	}
	os<<"}";
	return os;
}

const ll MOD = 998244353;
const int MX = TEN(7) + 10;
ll inv[MX], fact[MX], ifact[MX];
ll p2[MX];

void init() {
	inv[1] = 1;
	for (int i = 2; i < MX; ++i) {
		inv[i] = inv[MOD % i] * (MOD - MOD / i) % MOD;
	}
	fact[0] = ifact[0] = p2[0] = 1;
	for (int i = 1; i < MX; ++i) {
		p2[i] = p2[i-1] * 2 % MOD;
		fact[i] = fact[i-1] * i % MOD;
		ifact[i] = ifact[i-1] * inv[i] % MOD;
	}
}

ll comb(int n, int r) {
	if (n < 0 || r < 0 || r > n) return 0;
	return fact[n] * ifact[r] % MOD * ifact[n - r] % MOD;
}

int main() {
	init();

	int N; cin >> N;
	ll all = 1;
	rep(i, N) all = all * 3 % MOD;
	ll ng = 0;

	for (int i = N / 2 + 1; i <= N; ++i) {
		ll a = comb(N, i) * p2[N-i] % MOD;
		ng += a;
		if (ng >= MOD) ng -= MOD;
	}

	ng = ng * 2 % MOD;
	all -= ng;
	if (all < 0) all += MOD;
	cout << all << endl;

	return 0;
}

Measured memory_bytes: 312704
#include "bits/stdc++.h"
using namespace std;

#define DEBUG(x) cout<<#x<<": "<<x<<endl;
#define DEBUG_VEC(v) cout<<#v<<":";for(int i=0;i<v.size();i++) cout<<" "<<v[i]; cout<<endl

typedef long long ll;
#define vi vector<int>
#define vl vector<ll>
#define vii vector< vector<int> >
#define vll vector< vector<ll> >
#define vs vector<string>
#define pii pair<int,int>
#define pis pair<int,string>
#define psi pair<string,int>
const int inf = 1000000001;
const ll INF = 1e16;
#define MOD 1000000007
#define mod 1000000009
#define pi 3.14159265358979323846
#define Sp(p) cout<<setprecision(15)<<fixed<<p<<endl;
int dx[4] = { 1,0,-1,0 }, dy[4] = { 0,1,0,-1 };
int dx2[8] = { 1,1,0,-1,-1,-1,0,1 }, dy2[8] = { 0,1,1,1,0,-1,-1,-1 };

#define N 100010
int n;
//i‚ÆM[i].second‚ðM[i].first‚Å‚Â‚È‚®
vector< vector<pii> > M(N, vector<pii>());
vector<bool> used(N, false);
vector< pair<pii, int> > r(N);
vi mincost(N, inf);

bool cmp1(pair<pii, int> a, pair<pii, int> b) {
  if (a.first.second < b.first.second) {
    return true;
  }
  else if (a.first.second > b.first.second) {
    return false;
  }
  else {
    if (a.first.first < b.first.first) {
      return true;
    }
    else if (a.first.first > b.first.first) {
      return false;
    }
    else {
      if (a.second < b.second) {
	return true;
      }
      else {
	return false;
      }
    }
  }
}


void init() {
  cin >> n;
  r.resize(n);
  for (int i = 0; i < n; i++) {
    cin >> r[i].first.first >> r[i].first.second;
    r[i].first.first--;
    r[i].first.second--;
    r[i].second = i;
  }
  sort(r.begin(), r.end());
  for (int i = 0; i < n - 1; i++) {
    int x1 = r[i].first.first, y1 = r[i].first.second;
    int x2 = r[i + 1].first.first, y2 = r[i + 1].first.second;
    int r1 = r[i].second, r2 = r[i + 1].second;
    M[r1].push_back(make_pair(min(abs(x2 - x1), abs(y2 - y1)), r2));
    M[r2].push_back(make_pair(min(abs(x2 - x1), abs(y2 - y1)), r1));
  }
  sort(r.begin(), r.end(), cmp1);
  for (int i = 0; i < n - 1; i++) {
    int x1 = r[i].first.first, y1 = r[i].first.second;
    int x2 = r[i + 1].first.first, y2 = r[i + 1].first.second;
    int r1 = r[i].second, r2 = r[i + 1].second;
    M[r1].push_back(make_pair(min(abs(x2 - x1), abs(y2 - y1)), r2));
    M[r2].push_back(make_pair(min(abs(x2 - x1), abs(y2 - y1)), r1));
  }
}



void prim(int s) {
  priority_queue<pii, vector<pii>, greater<pii> > pq;
  int used_cnt = 0;
  mincost[s] = 0;
  pq.push(make_pair(0, s));
  int i;
  while (used_cnt < n) {
    int u;
    pii f;
    while (true) {
      f = pq.top();
      pq.pop();
      u = f.second;
      if (!used[u]) {
	break;
      }
    }
    mincost[u] = f.first;
    for (i = 0; i < M[u].size(); i++) {
      int v = M[u][i].second;
      int c = M[u][i].first;
      pq.push(make_pair(c, v));
    }
    used[u] = true;
    used_cnt++;
  }
}

void ans() {
  ll sum = 0;
  for (int i = 0; i < n; i++) {
    sum += mincost[i];
  }
  cout << sum << endl;
}

void solve() {
  init();
  prim(0);
  ans();
  return;
}

int main() {
  solve();
}

/*
3
1 5
3 9
7 8

6
8 3
4 9
12 19
18 1
13 5
7 6
*/


Measured memory_bytes: 12020
import java.util.Scanner;

public class Main {
	public static void main(String args[]) {
		Scanner scan = new Scanner(System.in);
		String number = scan.next();
		int flag = 0;
		for (int l = 0; l <= 1; l++) {
			if (number.charAt(l)==number.charAt(l+1)
					&& number.charAt(l+1)==number.charAt(l+2)) {
				flag = 1;
			}
		}
		if (flag == 1) {
			System.out.println("Yes");
		} else {
			System.out.println("No");
		}
	}

}

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

typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
#define FOR(i, a, b) for (int i=a; i<(b); i++)
#define range(a) a.begin(), a.end()
#define endl "\n"
#define Yes() cout << "Yes" << endl
#define No() cout << "No" << endl
using Graph = vector<vector<int>>;
const unsigned long long mod = 1e9 + 7;
const long long INF = 1LL<<60;
const int dx[4]={1,0,-1,0};
const int dy[4]={0,1,0,-1};
void chmin(long long &a, long long b) { if (a > b) a = b; }
void chmax(long long &a, long long b) { if (a < b) a = b; }

int main(void){
	ios::sync_with_stdio(0);
	cin.tie(0);
	int a; cin>>a;
	cout<<a+a*a+a*a*a<<endl;


    return 0;
}



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

bool isPrime(int v)
{
  int i;
  
  if(v==0||v==1)
  return false;
  else if(v==2||v==3)
  return true;
  else if(v%2==0)
  return false;  
  else
  {
    for(i=3;i<sqrt(v);++i)
    if(v%i==0)
    return false;
    
    return true;
  } 
} 

int main()
{
  int x;
  
  cin>>x;
  
  while(true)
  {
    if(isPrime(x))
    {
      cout<<x;
      break;
    }
    ++x;
  }
  return 0;
}

Measured memory_bytes: 256
import numpy as np

N = int(input())
li = [[1,N]]

for i in range(2,int(np.sqrt(N))+1):
    if N%i == 0:
        li.append([i,N//i])

ans = 10**12
for i in li:
    x,y = i
    tmp = x-1+y-1
    if ans > tmp:
        ans = tmp

print(ans)


Measured memory_bytes: 14388
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define PI 3.14159265358979
#define EPS 1e-8

#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define endl "\n"
	 
const ll INF=(ll)2e18;
		
const ll mod =(ll)998244353;
const int N=2e5+5;

ll fac[300050]={0};	
long long binpow(long long a, long long b, long long m) {
    a %= m;
    long long res = 1;
    while (b > 0) {
        if (b & 1)
            res = res * a % m;
        a = a * a % m;
        b >>= 1;
    }
    return res;
}	

ll modinverse(ll a,ll m)
{
	return binpow(a,m-2,m);
}

ll ncr(ll a,ll b)
{
	return fac[a]* modinverse(fac[b],mod) %mod * modinverse(fac[a-b],mod) % mod;
}

int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	
	ll n,a,b,k;
	cin>>n>>a>>b>>k;
	
	
	
	fac[0]=1;
	
	for(ll i=1;i<=300000;i++)
	{
		fac[i]=fac[i-1]*i;
		fac[i]%=mod;
	}
	ll ans2=0;
	
	for(ll i=0;i<=n;i++)
	{
		ll val=i*a;
		
		if(k>=(i*a) && (k-i*a)%b==0)
		{
			ll val1=i;
			ll val2=(k-i*a)/b;
			ll ans1;
			if(val2>n)
				continue;
			ans1=ncr(n,val1);
			ans1*=ncr(n,val2);
			ans1%=mod;
			ans2+=ans1;
			ans2%=mod;
		}
	}
	
	cout<<ans2;
	
	
}


Measured memory_bytes: 2560
#include<bits/stdc++.h>
using namespace std;
int a[21],c[21];
bool b[21];
bool f;
int n,m,q,x,l; 
struct Point{
	  double x,y;
};
void koch(int d,Point p1,Point p2){
	 if (d==0) return;
	 Point s,u,t;
	 s.x=((p2.x-p1.x)/3.0+p1.x);
	 s.y=((p2.y-p1.y)/3.0+p1.y);
	 t.x=(p2.x-(p2.x-p1.x)/3.0);
	 t.y=(p2.y-(p2.y-p1.y)/3.0);
	 u.x=(t.x-s.x)*0.5-(t.y-s.y)*(sqrt(3)/2.0)+s.x;
	 u.y=(t.x-s.x)*(sqrt(3)/2.0)+(t.y-s.y)*0.5+s.y;
	 koch(d-1,p1,s);
	 printf("%.8f %.8f\n",s.x,s.y);
	 koch(d-1,s,u);
	 printf("%.8f %.8f\n",u.x,u.y);
	 koch(d-1,u,t);
	 printf("%.8f %.8f\n",t.x,t.y);
	 koch(d-1,t,p2);
}
int main(){
    cin>>n;
    Point p1,p2;
    p1.x=0; p2.x=100;
    p1.y=0; p2.y=0;
    printf("%.8f %.8f\n",p1.x,p1.y);
    koch(n,p1,p2);
    printf("%.8f %.8f\n",p2.x,p2.y);
	return 0;
}


Measured memory_bytes: 3208
#include <bits/stdc++.h>
#include <string.h>
using namespace std;
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define FOR(i, m, n) for(int i = m; i < n; i++) 
#define mod 1000000007
typedef long long ll;
int main(){
    int N;
    cin>>N;
    cout<<(N+1)/2<<endl;
    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int H,W;string S;
int main(){
	cin>>H>>W;
	for(int i=0;i<W+2;i++)S+="#";
	cout<<S<<endl;
	for(int i=0;i<H;i++){
		cout<<"#";string T;cin>>T;cout<<T;cout<<"#"<<endl;
	}
	cout<<S<<endl;
	return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <cmath>
#include <string.h>
#include <iomanip>
#include <math.h>
#include <algorithm>
#include <vector>
#include <map>
#include <tuple>
#include <queue>
using namespace std;

typedef long long ll;

#define INF 100000000;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define repl(i, n) for (ll i = 0; i < (ll)(n); i++)
#define rrep(i, n) for (ll i = n - 1; i >= 0; i--)
#define eps 1.0e-14;

queue<pair<int,int>> que;
string s[1005];
ll ans = 0;

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

int main(){
	int n,k; cin >> n >> k;
	int d[105];
	int a[105][105];
	int ans[105];
	rep(i,n) ans[i] = 0;
	rep(i,k){
		cin >> d[i];
		rep(j,d[i]){
			cin >> a[i][j];
			ans[a[i][j] - 1] = 1;
		}
	}
	int anss = 0;
	rep(i,n){
		if(ans[i] == 0)anss++;
	}
	cout << anss << endl;
}


Measured memory_bytes: 3716
import java.math.BigInteger;
import java.util.Scanner;

public class Main {
	public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		long a = sc.nextLong() - 1;
		long b = sc.nextLong();
		long c = sc.nextLong();
		long d = sc.nextLong();
		sc.close();

		long ac = a / c;
		long ad = a / d;
		long acd = a / lcm(c, d);
		long aa = (a - ac) + (a - ad) - (a - acd);

		long bc = b / c;
		long bd = b / d;
		long bcd = b / lcm(c, d);
		long bb = (b - bc) + (b - bd) - (b - bcd);

		System.out.println(bb - aa);
	}

	static long lcm(long x, long y) {
		return x * y / BigInteger.valueOf(x).gcd(BigInteger.valueOf(y)).longValue();
	}
}


Measured memory_bytes: 22996
#pragma GCC optimize(2)
#include<bits/stdc++.h>
using namespace std;
#define IOS ios::sync_with_stdio(0)
#define ull unsigned ll
#define uint unsigned
#define pai pair<int,int>
#define pal pair<ll,ll>
#define IT iterator
#define pb push_back
#define fi first
#define se second
#define For(i,j,k) for (int i=(int)(j);i<=(int)(k);++i)
#define Rep(i,j,k) for (int i=(int)(j);i>=(int)(k);--i)
#define endl '\n'
#define ll long long
int main()
{
    int x;
    cin>>x;
    if(x<=599)
        cout<<8<<endl;
    else if(x>=600&&x<=799)
        cout<<7<<endl;
    else if(x>=800&&x<=999)
        cout<<6<<endl;
    else if(x>=1000&&x<=1199)
        cout<<5<<endl;
    else if(x>=1200&&x<=1399)
        cout<<4<<endl;
        else if(x>=1400&&x<=1599)
        cout<<3<<endl;
        else if(x>=1600&&x<=1799)
        cout<<2<<endl;
        else if(x>=1800&&x<=1999)
        cout<<1<<endl;
}

Measured memory_bytes: 3608
H,W,M=map(int,input().split())
h,w,bomb=[0]*H,[0]*W,[]
for i in range(M):
    a,b=map(int,input().split())
    bomb.append((a-1,b-1))
    h[a-1]+=1
    w[b-1]+=1
    
max_h=max(h)
max_w=max(w)

bomb_and_max=0
for i,j in bomb:
    if h[i]==max_h and w[j]==max_w:
        bomb_and_max+=1
    
if bomb_and_max==h.count(max_h)*w.count(max_w):
    print(max_h+max_w-1)
else:
    print(max_h+max_w)

Measured memory_bytes: 109480
main = do
  line <- getLine
  let 
    func src dst
      | src == []        = dst
      | head src == '9'  = '1' : (func (tail src) dst)
      | head src == '1'  = '9' : (func (tail src) dst)
      | otherwise        = (head src) : (func (tail src) dst)
    in
      putStrLn $ func line []


Measured memory_bytes: 380
#include<bits/stdc++.h>
#define pb       push_back
#define mp       make_pair
#define mod      1000000007
#define first    ff
#define second   ss
#define pi       acos(-1.0)
#define test     int t;cin>>t;while(t--)
typedef long long ll;
using namespace std;
int a[28],b[28];

int main()
{      
     ios::sync_with_stdio(false);
     cin.tie(NULL);
     cout.tie(NULL);
     
     int n;
     cin>>n;
     cout<<!n;
    
      return 0;
      
 }       


Measured memory_bytes: 3568
package main

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

func clone(nums []int) []int {
	return append([]int{}, nums...)
}

var dp = [][]int{}

//i番目の数列を持つdp[i][]int
func dfs(pat, nums []int) {

	if len(nums) == 0 {
		dp = append(dp, pat)
		return
	}

	for i := 0; i < len(nums); i++ {
		temp := append(clone(pat), nums[i])
		nnums := append(clone(nums[:i]), nums[i+1:]...)
		dfs(temp, nnums)
	}

}

func main() {

	nextReader = newScanner()

	n := nextInt()
	p := nextInts(n)
	q := nextInts(n)

	nums := make([]int, n)
	pat := make([]int, 0, n)
	dp = make([][]int, 0, n)

	for i := 0; i < n; i++ {
		nums[i] = i + 1
	}

	dfs(pat, nums)

	a := -1
	b := -1
	for i, v := range dp {

		if reflect.DeepEqual(p, v) {
			a = i
		}
		if reflect.DeepEqual(q, v) {
			b = i
		}

		if a >= 0 && b >= 0 {
			break
		}

	}

	fmt.Println(abs(a - b))

}

/* --------------------------------------------------------------------------
 *  std.io
 * ------------------------------------------------------------------------- */
var nextReader func() string

func newScanner() func() string {
	r := bufio.NewScanner(os.Stdin)
	r.Buffer(make([]byte, 1024), int(1e+11))
	r.Split(bufio.ScanWords)
	return func() string {
		r.Scan()
		return r.Text()
	}
}
func nextString() string {
	return nextReader()
}
func nextInt64() int64 {
	v, _ := strconv.ParseInt(nextReader(), 10, 64)
	return v
}
func nextInt() int {
	v, _ := strconv.Atoi(nextReader())
	return v
}
func nextInts(n int) []int {
	r := make([]int, n)
	for i := 0; i < n; i++ {
		r[i] = nextInt()
	}
	return r
}
func nextInt64s(n int) []int64 {
	r := make([]int64, n)
	for i := 0; i < n; i++ {
		r[i] = nextInt64()
	}
	return r
}
func nextFloat64() float64 {
	f, _ := strconv.ParseFloat(nextReader(), 64)
	return f
}

func maxInt(a, b int) int {
	if a > b {
		return a
	} else {
		return b
	}
}

func max(a, b int) int {
	if a > b {
		return a
	} else {
		return b
	}
}

func min(a, b int) int {
	if a < b {
		return a
	} else {
		return b
	}
}

func mins(t ...int) int {
	if len(t) == 0 {
		return 0
	}

	min := t[0]
	for i := 1; i < len(t); i++ {
		if min > t[i] {
			min = t[i]
		}
	}
	return min
}

func abs(a int) int {
	if a >= 0 {
		return a
	} else {
		return 0 - a
	}
}


Measured memory_bytes: 8960
#include <bits/stdc++.h>
#define rep(i,m,n) for(int i=m; i<n; i++)
#define co(n) cout << n << endl
using namespace std;
int main(){
  int a, b, c;
  cin >> a >> b >> c;
  if(a==b && b==c) co(1);
  else if(a!=b && b==c) co(2);
  else if(b!=c && c==a) co(2);
  else if(c!=a && a==b) co(2);
  else co(3);
  
  return 0;
}

Measured memory_bytes: 256
#include <stdio.h>
int main(){
  int N,M,C;
  int B[20];
  int A[20][20];
  scanf("%d %d %d",&N,&M,&C);
  int i,j;
  for (i=0;i<M;i++){
    scanf("%d ",B+i);
  }
  for (i=0;i<N;i++){
    for (j=0;j<M;j++){
      scanf("%d ",A[i]+j);
    }
  }
  int sum;
  int count = 0;
  for (i=0;i<N;i++){
    sum = 0;
    for (j=0;j<M;j++){
      sum += A[i][j]*B[j];
    }
    if (sum + C > 0){
      count += 1;
    }
  }
  printf("%d\n",count);
  return 0;
}

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

using namespace std;

namespace {
    int H, W;
    vector<string> F;
    void input() {
        cin >> H >> W;
        F.resize(H);
        for (auto& L : F) cin >> L;
    }

    void solve() {
        vector<int> count(26, 0);
        for (int i = 0; i < H; i++) {
            for (int j = 0; j < W; j++) {
                int c = F[i][j] - 'a';
                count[c]++;
            }
        }
        auto f = [&]() {
            if (H % 2 == 0 && W % 2 == 0) {
                for (auto c : count) {
                    if (c % 4 != 0) return false;
                }
                return true;
            } else if (H % 2 == 0 && W % 2 == 1) {
                auto x = 0;
                for (auto c : count) {
                    if (c % 2 == 1) return false;
                    x += (c % 4);
                }
                return x <= H;
            } else if (H % 2 == 1 && W % 2 == 0) {
                auto x = 0;
                for (auto c : count) {
                    if (c % 2 == 1) return false;
                    x += (c % 4);
                }
                return x <= W;
            } else {
                assert(H % 2 == 1 && W % 2 == 1);
                auto x = 0;
                bool flag = false;
                for (auto c : count) {
                    if (c % 2 == 1) {
                        if (flag) return false;
                        flag = true;
                    }
                    x += (c % 4);
                }
                return x <= H + W - 1;
            }
        };
        cout << (f() ? "Yes" : "No") << endl;
    }
}

int main() {
    input(); solve();
    return 0;
}



Measured memory_bytes: 256
INF = int(1e18)

def merge(A, left, mid, right):
    n1 = mid - left
    n2 = right - mid
    L = [A[left + i] for i in range(n1)]
    R = [A[mid + i] for i in range(n2)]
    L.append(INF)
    R.append(INF)
    i, j = 0, 0
    count = 0
    for k in range(left, right):
        count += 1
        if L[i] <= R[j]:
            A[k] = L[i]
            i += 1
        else:
            A[k] = R[j]
            j += 1
    return count

def merge_sort(A, left, right):
    if left + 1 < right:
        mid = (left + right) // 2
        c1 = merge_sort(A, left, mid)
        c2 = merge_sort(A, mid, right)
        c = merge(A, left, mid, right)
        return c + c1 + c2
    else:
        return 0

if __name__ == '__main__':
    n = int(input())
    A = list(map(int, input().split()))
    c = merge_sort(A, 0, n)

    print(" ".join(map(str, A)))
    print(c)


Measured memory_bytes: 66604
#include<iostream>
#include<bits/stdc++.h>
using namespace std;
int main()
{
long long n,k;
 double sum=0;
cin>>n>>k;
for(long long i=1;i<=n;i++)
{
    long long y=i,count1=0;
     double d=1;
    while((y)<k)
    {
        y=y*2;
       d=d*1/(pow(0.5,1));

    }
   sum=sum+(1/(n*d));
}
printf("%.9f\n", sum);
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0; i<(n); i++)
#define FOR(i,x,n) for(int i=x; i<(n); i++)
#define ALL(n) begin(n),end(n)
#define MOD (1000000007)
#define INF (1e9)
#define INFL (1e18)

typedef long long ll;
typedef unsigned int ui;
typedef unsigned long long ull;
template<class T>using arr=vector<vector<T>>;
template<class T>void pr(T x){cout << x << endl;}
template<class T>void prvec(vector<T>& a){rep(i, a.size()-1){cout << a[i] << " ";} cout << a[a.size()-1] << endl;}
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
int type[3]={};
bool isTriangle(int a, int b, int c){
    if(a+b <= c || b+c <= a || c+a <= b) return false;
    return true;
}

void types(int a, int b, int c){
    a *= a;
    b *= b;
    c *= c;
    if(a+b == c || b+c == a || c+a == b) type[0]++;
    else if(a+b < c || b+c < a || c+a < b) type[2]++;
    else type[1]++;
}

int main()
{
    int a, b, c;
    
    while(cin >> a >> b >>c){
        if(!isTriangle(a,b,c)) break;
        types(a,b,c);
    }
    printf("%d %d %d %d\n", type[0] + type[1] + type[2], type[0], type[1], type[2]);
    return 0;}



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

signed main(){

  int n;
  cin>>n;
  vector<int> a(n),b(n);
  for(auto& ai:a)cin>>ai;
  for(auto& bi:b)cin>>bi;

  ll asum = accumulate(begin(a),end(a),0ll);
  ll bsum = accumulate(begin(b),end(b),0ll);
  ll k = bsum-asum;

  ll as = 0,bs = 0;
  auto ceil = [](auto a,auto b){return (a-1)/b+1;};
  rep(i,n){
    if(a[i]>b[i]){
      bs += a[i]-b[i];
    }
    if(a[i]<b[i]){
      as += ceil(b[i]-a[i],2ll);
    }
  }
  if(as<=k&&bs<=k)cout<<"Yes"<<endl;
  else cout<<"No"<<endl;

}

Measured memory_bytes: 384
#include <cstdio>
#include <algorithm>
using namespace std;

int N, arr[200];

int main() {
	scanf("%d", &N);
	for (int i = 0; i < 2 * N; i++)
		scanf("%d", arr + i);

	sort(arr, arr + 2 * N);

	int ans = 0;
	for (int i = 0; i < 2 * N; i += 2) {
		ans += arr[i];
	}

	printf("%d\n", ans);

	return 0;
}

Measured memory_bytes: 128
import collections

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

even = []
odd = []
for i in range(n):
    if i % 2 == 0:
        even.append(v[i])
    else:
        odd.append(v[i])
evenc = collections.Counter(even)
oddc = collections.Counter(odd)
#print(evenc, oddc)

evenm = evenc.most_common()
oddm = oddc.most_common()
if evenm[0][0] == oddm[0][0]:
    if len(oddm) == 1:
        ans = n // 2
    else:
        ans = min(n - evenm[0][1] - oddm[1][1], n - evenm[1][1] - oddm[0][1])
else:
    ans = n - evenm[0][1] - oddm[0][1]
print(ans)

Measured memory_bytes: 23664
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(n);++i)
#define all(a) (a).begin(),(a).end()
#define dunk(a) cout << (a) << endl
using namespace std;
typedef long long ll;

int main() {
	ios::sync_with_stdio(false);
	cin.tie(0);
	int a, b, c;
	cin >> a >> b >> c;

	if (c >= a && c <= b) puts("Yes");
	else puts("No");

	return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include <fstream>
#include <stdio.h>
#include <stdlib.h>
#define _USE_MATH_DEFINES
#include <math.h>
#include<string>
#include<vector>
#include<cmath>
#include<stack>
#include<queue>
#include<sstream>
#include<algorithm>
#include<map>
#include<complex>
using namespace std;


#define li			long long int
#define rep(i,to)	for(int i=0;i<((int)(to));i++)
#define repp(i,start,to)	for(int i=(int)(start);i<((int)(to));i++)
#define pb			push_back
#define sz(v)		((li)(v).size())
#define bgn(v)		((v).begin())
#define eend(v)		((v).end())
#define allof(v)	(v).begin(), (v).end()
#define dodp(v,n)		memset(v,(li)n,sizeof(v))
#define bit(n)		(1ll<<(li)(n))
#define mp(a,b)		make_pair(a,b)
#define rin	rep(i,n)
#define EPS 1e-10
#define ETOL 1e-8
#define MOD 1000000007
#define p2(a,b)		cout<<a<<"\t"<<b<<endl
#define p3(a,b,c)		cout<<a<<"\t"<<b<<"\t"<<c<<endl


int main(){
	li a,b;
	string s;
	while(cin>>a>>b){
		stringstream ss;
		ss<<(li)(a+b);
		ss>>s;
		//cout<<s<<endl;
		cout<<sz(s)<<endl;
	}
	
	return 0;
}

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

const ll MOD = 2019;


int main(){
  string s;cin >> s;
  reverse(s.begin(),s.end());
  ll n = s.size();
  vector<ll> cnt(MOD,0);

  ll x = 1;
  ll total = 0;
  ll ans = 0;
  rep(i,n){
    cnt.at(total)++;
    total += (s.at(i)-'0')*x;
    total %= MOD;
    x = x*10%MOD;
    ans += cnt.at(total);
  }
  cout << ans << endl;
  return 0;
}


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

using namespace std;

#define INF 1000000000
#define INFLL 0x3f3f3f3f3f3f3f3fLL 
#define EPS 10e-9
#define MOD 1000000007
#define mp make_pair
#define mt make_tuple
#define pb push_back
#define st first
#define nd second
#define sz(v) int(v.size())
#define all(X) (X).begin(), (X).end()
#define FOR(I, A, B) for(int I = A; I < B; I++)
#define RFOR(I, A, B) for(int I = A; I >= B; I--)

typedef long long ll;
typedef pair<int,int> ii;
typedef pair<int,ii> iii;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ii> vii;
typedef vector<vii> vvii;
typedef vector<iii> viii;
typedef vector<ll> vll;

char a[1010][1010];
bool vis[1010][1010];
int n, m;

int dirx[4] = {1,0,-1,0};
int diry[4] = {0,1,0,-1};


int main(){
	cin >> n >> m;
	queue<iii> fila;
	FOR(i,0,n){
		FOR(j,0,m){
			scanf(" %c", &a[i][j]);
			if(a[i][j] == '#'){
				fila.push(mp(0,mp(i,j)));
				vis[i][j] = true;
			}
		}
	}

	int record = 0;
	while(!fila.empty()){
		iii curr = fila.front();
		record = max(record, curr.st);
		int x = curr.nd.st, y = curr.nd.nd;
		fila.pop();
		FOR(i,0,4){
			int nx = x + dirx[i], ny = y + diry[i];
			if(nx >= 0 && nx < n && ny >= 0 && ny < m && !vis[nx][ny]){
				fila.push(mp(curr.st+1, mp(nx,ny)));
				vis[nx][ny] = true;
			}
		}
	}
	cout << record << endl;
	return 0;
}

Measured memory_bytes: 14352
#include <bits/stdc++.h>
#define rep(i,a,b) for(int i=a;i<b;i++)
#define rrep(i,b,a) for(int i=b;i>=a;i--)
#define fori(a) for(auto i : a )
#define all(a) begin(a), end(a)
#define set(a,b) memset(a,b,sizeof(a))
#define sz(a) a.size()
#define pi 3.14159
#define ll long long
#define ull unsigned long long
#define pb push_back
#define PF push_front //deque
#define mp make_pair
#define pq priority_queue
#define mod 1000000007
#define f first
#define s second
#define pii pair< int, int >
#define vi vector<int>
#define vpii vector<pii>
#define debug(v) for(auto i:v) cout<<i<<" ";
#define tc int t; cin >> t; while(t--)

using namespace std;
string repeat(string s, int n) {
    string s1 = "";
    for (int i=0; i<n;i++)
        s1+=s;
    return s1;
}
string getString(char x) {
    string s(1, x);
    return s;
}

void optimizeIO(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
}
int gcd(int a, int b){
    if (a == 0)  return b;
    return gcd(b % a, a);
}
void  solve(){
  int n;
  cin>>n;
  int a[n];
  rep(i,0,n) cin>>a[i];
  int c1=0,c2=0,c3=0;
  rep(i,0,n){
    if(a[i]%4==0) c1++;
    else if(a[i]%2==0) c2++;
    else c3++;
  }
  if(c1>=c3 || (c2==0 && c1+1==c3)) cout<<"Yes\n";
  else cout<<"No\n";
}
int main(){
    optimizeIO();
    // tc
    { solve();
    }
}


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

int main() {
  int n;
  cin >> n;
  int ts = 0;
  int hs = 0;
  string taro, hanako;
  for (int i = 0; i < n; i++) {
    cin >> taro >> hanako;
    if (taro > hanako) {
      ts += 3;
    } else if (taro == hanako) {
      ts += 1;
      hs += 1;
    } else {
      hs += 3;
    }
  }
  cout << ts << " " << hs << endl;
}



Measured memory_bytes: 3212
#include <bits/stdc++.h>
using namespace std;
typedef long long LL;
int main() {
	LL n,a,b;
	cin >> n >> a >> b;
	LL ans = n*(b-a)+2*a-2*b+1;
	ans < 0 ? ans = 0 :0;
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 256
#include <stdio.h>
int main(void){
    // Your code here!
   int A,B;
   
   scanf("%d %d",&A,&B);
   
   if( (A+B)%3==0 || A%3==0 || B%3==0 )
   {
       printf("Possible");
   }
   else
   {
       printf("Impossible");
   }
   
   
}

Measured memory_bytes: 128