akhauriyash/Code-Regression huggingface dataset:
#pragma GCC optimize("O3")
#include <bits/stdc++.h>
#include <atcoder/all>
#define ll long long
#define rep(i,n) for(ll i=0;i<(n);i++)
#define pll pair<ll,ll>
#define pii pair<int,int>
#define pq priority_queue
#define pb push_back
#define eb emplace_back
#define fi first
#define se second
#define endl '\n'
#define ios ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0);
#define lb(c,x) distance(c.begin(),lower_bound(all(c),x))
#define ub(c,x) distance(c.begin(),upper_bound(all(c),x))

using namespace std;

using namespace atcoder;

const ll INF=1e15;

int main(){
    int n,k;
    cin >> n >> k;
    vector<vector<int>> num(n,vector<int>(n));
    mcf_graph<int,ll> mcf(2*n+2);
    int S=2*n,T=2*n+1;
    rep(i,n){
        rep(j,n){
            cin >> num[i][j];
            mcf.add_edge(i,n+j,1,INF-num[i][j]);
        }
        mcf.add_edge(S,i,k,0);
        mcf.add_edge(n+i,T,k,0);
    }
    auto mcf2=mcf;
    ll flow = 0, cost = 0;
    for(auto p:mcf2.slope(S, T)){
        ll tmp = p.first * INF - p.second;
        if(tmp > cost){
            cost = tmp;
            flow = p.first;
        }
    }
    mcf.flow(S, T, flow);
    
    vector<string> field(n, string(n,'.'));
    
    
    for(auto e:mcf.edges())
        if(e.from != S && e.to != T && e.flow == 1)
            field[e.from][e.to - n] = 'X';
    
    cout << cost << endl;
    for(auto row:field)cout << row << endl;
    
    return 0;
}

Measured memory_bytes: 4152
import java.util.Scanner;

public class Main{
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int[] num = new int[n];
        int i;
        int j;
        int count=0;
        for(i=0;i<n;i++){
            num[i]=sc.nextInt();
        }
        for(int k=0;k<n;k++) {
            for (j = n - 1; j > 0; j--) {

                    if(num[j]<num[j-1]) {
                        int a = num[j];
                        num[j] = num[j - 1];
                        num[j - 1] = a;
                        count=count+1;
                    }
            }
        }
        for(i=0;i<n;i++) {
            if(i==n-1) System.out.println(num[i]);
            else System.out.printf("%d ",num[i]);

        }
        System.out.println(count);
    }
}


Measured memory_bytes: 26704
#include<stdio.h>
#include<string.h>

int main()
{
	int now=0, wri=1, sta[65536][5], X, Y, tx, ty, kx, ky, in[52][52];
	static char ch[51][51][51][51];
	int i, j, k, dtx, dty, dkx, dky;
	scanf("%d %d", &X, &Y);
	while(X!=0 && Y!=0)
	{
		scanf("%d %d", &tx, &ty);
		scanf("%d %d", &kx, &ky);
		for(i=0;i<=Y+1;i++)
		{
			for(j=0;j<=X+1;j++)
			{
				if(i==0 || i==Y+1 || j==0 || j==X+1) in[i][j]=1;
				else scanf("%d", &in[i][j]);
			}
		}
		sta[0][0] = ty;
		sta[0][1] = tx;
		sta[0][2] = ky;
		sta[0][3] = kx;
		sta[0][4] = 0;
		ch[ty][tx][ky][kx] = '1';
		
		while(1)
		{
			ty = sta[now][0];
			tx = sta[now][1];
			ky = sta[now][2];
			kx = sta[now][3];

			if(sta[now][4]>100 || now == wri)
			{
				printf("NA\n");
				break;
			}
			
			if(ty == ky && tx == kx)
				{
					printf("%d\n", sta[now][4]);
					break;
				}
			
			for(k=0;k<4;k++)
			{
				dty = 0;
				dtx = 0;
				dky = 0;
				dkx = 0;
				
				if(k==0)
				{
					if(in[ty-1][tx] == 0) dty = -1;
					if(in[ky+1][kx] == 0) dky = 1;
				}
				if(k==1)
				{
					if(in[ty+1][tx] == 0) dty = 1;
					if(in[ky-1][kx] == 0) dky = -1;
				}
				if(k==2)
				{
					if(in[ty][tx-1] == 0) dtx = -1;
					if(in[ky][kx+1] == 0) dkx = 1;
				}
				if(k==3)
				{
					if(in[ty][tx+1] == 0) dtx = 1;
					if(in[ky][kx-1] == 0) dkx = -1;
				}
				if(ch[ty + dty][tx + dtx][ky+dky][kx+dkx] != '1')
				{
					ch[ty + dty][tx + dtx][ky+dky][kx+dkx] = '1';
					sta[wri][0] = ty + dty;
					sta[wri][1] = tx + dtx;
					sta[wri][2] = ky + dky;
					sta[wri][3] = kx + dkx;
					sta[wri][4] = sta[now][4] + 1;
					if(wri==65535) wri=0;
					else wri++;
				}
			}
			if(now==65535) now=0;
			else now++;
		}
		now=0;
		wri=1;
		memset(ch, '0', sizeof(ch));
		scanf("%d %d", &X, &Y);
	}
	return 0;
}

Measured memory_bytes: 8512
#include <bits/stdc++.h>
 
using namespace std;
 
int h[100002];
int n, a, b;
 
bool ok(int t){
	long long q = 0;
	for(int i = 1; i <= n; ++i){
		if (1ll * a * t < h[i]) return false;
		long long x = h[i] - 1ll * b * t;
		if (x > 0) q += (x - 1) / (a - b) + 1;
		if (q > t) return false; 
	}
	return true;
}
 
int main(){
	scanf("%d%d%d",&n,&a,&b);
	for(int i = 1; i <= n; ++i) scanf("%d",&h[i]);
	int l = 1, r = 1e9;
	while (l <= r){
		int md = (l + r) >> 1;
		if (ok(md)) r = md - 1;
		else l = md + 1;
	}
	printf("%d",l);
	return 0;
}

Measured memory_bytes: 640
#include<bits/stdc++.h>
#define rep(i,a,b) for(int i=a;i<b;i++)
#define rrep(i,a,b) for(int i=a;i>=b;i--)
#define fore(i,a) for(auto &i:a)
#define all(x) (x).begin(),(x).end()
//#pragma GCC optimize ("-O3")
using namespace std; void _main(); int main() { cin.tie(0); ios::sync_with_stdio(false); _main(); }
typedef long long ll; const int inf = INT_MAX / 2; const ll infl = 1LL << 60;
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; }
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
void _main()
{
    string s, t;
    cin >> s >> t;
    sort(s.begin(), s.end());
    sort(t.begin(), t.end(), greater<char>());
    cout << (s < t ? "Yes" : "No") << endl;
}


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


public class C
{
	public static void Main()
	{
		string[] args = Console.ReadLine().Split(' ');
		int N = Int32.Parse(args[0]);
		int Y = Int32.Parse(args[1]);
		
		for(int i = 0; i <= Y/10000; i++)
		{
			int rest1 = Y - 10000 * i;
			int tmp = N - i;
			for(int j = 0; j <= rest1/5000; j++)
			{
				int rest2 = rest1 - 5000 * j;
				int k = tmp - j;
				if((rest2/1000) == k)
				{
					Console.WriteLine("{0} {1} {2}", i, j, k);
					return;					
				}				
			}			
		}
		
		Console.WriteLine("-1 -1 -1");
	}	
}





Measured memory_bytes: 13140
#include <bits/stdc++.h>
#define ll long long int
#define pll pair<ll, ll> 
#define pii pair<int, int> 
#define ff first
#define ss second
#define mp make_pair
#define pb push_back

using namespace std;

ll MOD = 1e9+7;

ll pwr(ll x, ll y) {
	ll res = 1;
	x = x%MOD;
	while (y > 0) {
		if (y&1) res = (res*x)%MOD;

		y = y>>1;
		x = (x*x)%MOD;
	}
	return res;
}

inline ll addmod(ll a, ll b){
	return ((a+b)%MOD);
}

inline ll mulmod(ll a, ll b){
	return ((a*b)%MOD);
}

class BIT {
	int *bit;
	int N;

public:
	void update(int x, int val) {
		int ind = x;
		while (ind <= N) {
			bit[ind] += val;
			ind += (ind & (-ind));
		}
	}

	BIT(int ar[], int n) {
		bit = new int[n+1];
		N = n+1;
		for (int i = 1; i < N; i++) bit[i] = 0;
		for (int i = 1; i < N; i++) update(i, ar[i-1]);
	}

	int getSum(int x) {
		if (x < 0) return 0;

		int ind = x+1;
		int sum = 0;
		while (ind > 0) {
			sum += bit[ind];
			ind = (ind & (ind-1));
		}
		return sum;
	}

	int getValue(int x) {
		return getSum(x) - getSum(x-1);
	}

	void changeElem(int x, int val) {
		update(x+1, val-getValue(x));
	}
};

int bsh(int val, int ar[], int n) {		// return ind such that val >= ar[ind] and val < ar[ind+1]
	int a = 0, b = n - 1, c = (a+b)/2;
	if (val < ar[0]) return -1;
	if (val >= ar[b]) return b;

	while (!(val >= ar[c] && val < ar[c+1])) {
		if (val < ar[c]) b = c;
		else {
			if (b-a == 1 && c == a) a = b;
			else a = c;
		}
		c = (a+b)/2;
	}
	return c;
}

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

	int n; cin >> n;
	int a = 0, b = 0, c = 0, d = 0;
	for (int i = 0; i < n; i++) {
		string s; cin >> s;
		if (s == "AC") a++;
		else if (s == "WA") b++;
		else if (s == "TLE") c++;
		else d++;
	}
	printf("AC x %d\nWA x %d\nTLE x %d\nRE x %d\n", a, b, c, d);
}



Measured memory_bytes: 3748
#include <bits/stdc++.h>
#define int long long
#define double long double
#define rep(i, a, n) for(int i = (int)(a);(i) < (int)(n);++(i))
#define repe(i, a, n) for(int i = (int)(a);(i) <= (int)(n);++(i))
#define repif(i, a, x) for(int i = (int)(a);(x);++(i))
#define repr(i, a, n) for(int i = ((int)(a)-1);(i) >= (int)(n);--(i))
#define reper(i, a, n) for(int i = (int)(a);(i) >= (int)(n);--(i))
#define SZ(x) ((int)(x).size())
#define ALL(x) begin(x), end(x)
#define CEIL(x) ((int)ceil(((double)x)))
#define POW(x, y) ((int)pow(x, y))
#define UNIQUE(x) (x).erase(unique(ALL((x))), end(x))
#define gcd(x, y) __gcd(x, y)
#define lcm(x, y) ((x)/gcd(x,y)*(y))
#define isin(x, l, r) ((l) <= (x) and (x) < (r))
#define fcout(n) cout << fixed << setprecision(n)
#define rcout(n) cout << right << setw(n)
#define pb push_back
#define eb emplace_back
#define lb lower_bound
#define ub upper_bound
#define PI (acosl(-1))
#define EPS (1e-10)
#define INF LLONG_MAX
#define INF32 INT32_MAX
#define MOD 1000000007LL
using namespace std;
using VI = vector<int>;
using VVI = vector<vector<int>>;
using PII = pair<int, int>;
using TIII = tuple<int, int, int>;
using VPII = vector<pair<int, int>>;
using VTIII = vector<tuple<int, int, int>>;
using Complex = complex<double>;
template<typename T, template<typename> typename C = less> using PQ = priority_queue<T, vector<T>, C<T>>;
template<typename T> inline bool chmax(T& a, const T& b, bool t = false){ if(a<b or (t and a==b)){ a=b; return true; } return false; }
template<typename T> inline bool chmin(T& a, const T& b, bool t = false){ if(a>b or (t and a==b)){ a=b; return true; } return false; }


int n;


map<int, int> factorize(int n){
    map<int, int> ret;
    for(int i = 2;i*i <= n;++i) while(n%i == 0) ret[i]++, n/=i;
    if(n != 1) ret[n]++;
    return ret;
}


signed main(){
    cin >> n;

    auto f = factorize(n);

    cout << n << ':';
    for(auto p : f){
        rep(i, 0, p.second) cout << ' ' << p.first;
    }
    cout << endl;

    return 0;
}


Measured memory_bytes: 3104
#include<stdio.h>

#define N 110
#define Initial 0
#define Medium 1
#define End 2

void Root(int,int);

int Graph[N][N];
int Ver[N];
int Disc[N];
int Fin[N];
int count;

int main(){
  int loop;
  int i,j;
  int vertex,adjacent,adnum;

  scanf("%d",&loop);
  for(i=1;i<loop+1;i++){
    scanf("%d %d",&vertex,&adjacent);

    for(j=1;j<adjacent+1;j++){

      scanf("%d",&adnum);

      if(adnum!=0){
	Graph[vertex][adnum]=1;
      }

      else{
	Graph[vertex][adnum]=0;
      }
    }
    
  }
  
  for(i=1;i<loop+1;i++){
    Ver[i]=Initial;
  }

  count=0;

  for(i=1;i<loop+1;i++){
    
    if(Ver[i]==Initial){
      Root(i,loop+1);
    }
  }

  for(i=1;i<loop+1;i++){
    printf("%d %d %d\n",i,Disc[i],Fin[i]);
  }

  return 0;
}

void Root(int num,int plusloop){
  int i;
  
  Ver[num]=Medium;

  count++;

  Disc[num]=count;

  for(i=1;i<plusloop;i++){

    if(Graph[num][i]==Initial){
      continue;
    }
    
    if(Ver[i]==Initial){
      Root(i,plusloop);
    }
  }

  Ver[num]=End;

  count++;
  
  Fin[num]=count;
}



Measured memory_bytes: 2056
N=io.read"*n"
t={}
for i=1,N do
	n=io.read"*n"
	t[n]=(t[n]or 0)+1
end
Q=io.read"*n"

s=0
for k,v in pairs(t)do
	s=s+k*v
end

for i=1,Q do
	B=io.read"*n"
	C=io.read"*n"
	
	if(t[B])then
		s=s-t[B]*B+t[B]*C
		t[C]=(t[C]or 0)+t[B]
		t[B]=nil
	end
	
	print(s)
 
end

Measured memory_bytes: 4168
H,W = map(int,input().split())
S = [input() for _ in range(H)]
from scipy.sparse.csgraph import floyd_warshall as fw

edge = [[float('inf')]*(H*W) for _ in range(H*W)]
def encode(i,j):
    return i*W+j

for i in range(H):
    for j in range(W):
        if S[i][j]=='#':
            continue
        for (dx,dy) in [(-1,0),(1,0),(0,-1),(0,1)]:
            if 0<=i+dx<=H-1 and 0<=j+dy<=W-1:
                if (dx,dy)==(0,0):
                    continue
                if S[i+dx][j+dy]=='.':
                    edge[encode(i,j)][encode(i+dx,j+dy)] = 1

cost = fw(edge)
ans = 0
for i in range(H*W):
    for j in range(H*W):
        if cost[i][j]==float('inf'):
            continue
        ans = max(ans,cost[i][j])
ans = int(ans)
print(ans)

Measured memory_bytes: 28796
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define FOR(i, a, b) for(int i=(a);i<(b);++i)
#define rep(i, n) FOR(i, 0, n)
#define whole(x) (x).begin(),(x).end()
#define UNIQUE(v) v.erase(unique(v.begin(), v.end()), v.end())
using P = pair<int, int>;
#define debug(var) cerr << "[" << #var << "] " << var << endl
#define chmin(x, y) x = min(x, y)
const ll mod = 1000000007;
const int dx[] = {-1,0,1,0};
const int dy[] = {0,-1,0,1};


int main(){
    int a, b, t;
    cin >> a >> b >> t;
    int ans = t/a * b;
    
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 256
import java.io.*;
import java.util.*;
public class Main {
	
	public static void main(String[] args) {
	
		MyScanner sc = new MyScanner();
	int n=sc.nextInt();
	int x[]=new int[n];
	int y[]=new int[n];
	int h[]=new int[n];
	int ansx=0;
	int ansy=0;
	int ansh=0;
	
	for (int i = 0; i < n; i++) {
		x[i]=sc.nextInt();
		y[i]=sc.nextInt();
		h[i]=sc.nextInt();
	}
	int tall=0;
	boolean top;
	
	for (int i = 0; i <= 100; i++) {
		for (int j = 0; j <= 100; j++) {
			top=true;
			for (int k = 0; k < n; k++) {
				if(h[k]!=0) {
					if(tall==0) {
						tall=Math.abs(i-x[k])+Math.abs(j-y[k])+h[k];
					}else if(tall!=Math.abs(i-x[k])+Math.abs(j-y[k])+h[k]){
						top=false;
						
					}
				
				}
				
				if(k==n-1&&top){
					for(int g=0;g<n;g++) {
						if(h[g]!=Math.max(tall-Math.abs(i-x[g])-Math.abs(j-y[g]),0)) {
						top=false;
						
						}
					}
					if(top){
					ansx=i;
					ansy=j;
					ansh=tall;
				
					}
				}
				if(k==n-1){
					tall=0;
				}
			}
			
		}
	}
	System.out.println(ansx+" "+ansy+" "+ansh);
		
	}
	
	
	
//----------------------------------------------------------
	static int l_min(int[] a) {
		Arrays.sort(a);
		return a[0];
	}
	static int l_max(int[] a) {
		int l=a.length;
		Arrays.sort(a);
		return a[l-1];
	}
	public static PrintWriter out;

	public static class MyScanner {
		BufferedReader br;
		StringTokenizer st;

		public MyScanner() {
			br = new BufferedReader(new InputStreamReader(System.in));
		}

		String next() {
			while (st == null || !st.hasMoreElements()) {
				try {
					st = new StringTokenizer(br.readLine());
				} catch (IOException e) {
					e.printStackTrace();
				}
			}
			return st.nextToken();
		}

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

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

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

		String nextLine() {
			String str = "";
			try {
				str = br.readLine();
			} catch (IOException e) {
				e.printStackTrace();
			}
			return str;
		}

	}
	

}


Measured memory_bytes: 22852
#include <bits/stdc++.h>
using namespace std;
 
#define ll long long int
#define rep(i, n) for(int i = 0; i < n; i++)
#define repp(i, n) for(int i = 1; i <= n; i++)
#define sort(v) sort((v).begin(), (v).end())
#define pb push_back
#define mp make_pair
#define riverse(v) reverse((v).begin(), (v).end())
using vi = vector<int>;
using vs = vector<string>;
using vvi = vector<vi>;
using vll = vector<ll>;
const int MOD = 1e9+7;
vi alphabet = {'a','b','c','d','e','f','g','h','i','j','k','l','m',
               'n','o','p','q','r','s','t','u','v','w','x','y','z'};
 
int main() {
	int N,K;
  	cin >> N>>K;
  	vi x(N);
  	rep(i,N) cin >> x[i];
  	int sum = 0;
  	for(int y:x){
    	sum += min(y,K-y);
    }
  	cout << 2*sum << endl;
}

Measured memory_bytes: 256
#
# 　　  ⋀_⋀　 
#　　  (･ω･)  
# .／ Ｕ ∽ Ｕ＼
#  │＊　合　＊│
#  │＊　格　＊│ 
#  │＊　祈　＊│ 
#  │＊　願　＊│ 
#  │＊　　　＊│ 
#      ￣
#
import sys
sys.setrecursionlimit(10**6)
input=sys.stdin.readline
from math import floor,sqrt,factorial,hypot,log #log2ないｙｐ
from heapq import heappop, heappush, heappushpop
from collections import Counter,defaultdict,deque
from itertools import accumulate,permutations,combinations,product,combinations_with_replacement
from bisect import bisect_left,bisect_right
from copy import deepcopy
from fractions import gcd
from random import randint
def ceil(a,b): return (a+b-1)//b
inf=float('inf')
mod = 10**9+7
def pprint(*A): 
    for a in A:     print(*a,sep='\n')
def INT_(n): return int(n)-1
def MI(): return map(int,input().split())
def MF(): return map(float, input().split())
def MI_(): return map(INT_,input().split())
def LI(): return list(MI())
def LI_(): return [int(x) - 1 for x in input().split()]
def LF(): return list(MF())
def LIN(n:int): return [I() for _ in range(n)]
def LLIN(n: int): return [LI() for _ in range(n)]
def LLIN_(n: int): return [LI_() for _ in range(n)]
def LLI(): return [list(map(int, l.split() )) for l in input()]
def I(): return int(input())
def F(): return float(input())
def ST(): return input().replace('\n', '')
def main():
    N,A,B,C,D,E=map(int,open(0).read().split())
    last_A = ceil(N,A)
    last_B = max(ceil(N,B)+1, last_A+1)
    last_C = max(ceil(N,C)+2, last_B+1)
    last_D = max(ceil(N,D)+3, last_C+1)
    last_E = max(ceil(N,E)+4, last_D+1)
    print(last_E)

    

if __name__ == '__main__':
    main()

Measured memory_bytes: 64108
N = int(input())
A = [0]*(N+1)
for x in range(1, 101):
    for y in range(1, 101):
        for z in range(1, 101):
            i = x**2 + y**2 + z**2 + x*y + y*z + z*x
            if i < N+1:
                A[i] += 1
for i in range(1, N+1):
    print(A[i])

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

#define REP(i, n ,N) for(ll i = (n); i < (N); i++)
#define RREP(i, n ,N) for(ll i = (N-1); i >= (n); i--)
#define p(s) cout<<(s)<<endl
#define p2(a, b) cout<<(a)<<" "<<(b)<<endl
using namespace std;
typedef long long ll;
ll mod = 1e9+7;
ll inf = 1e18;

ll N, K;
ll A[200010];
ll ans = inf;
int main(){
	cin >> K >> N;
	REP(i, 0, N){
		cin >> A[i];
	}
	REP(i,0,N-1){
		ans = min(ans, min(K + A[i] - A[(i+1)%N], K - A[i] + A[(i+1)%N]));
	}
	ans = min(ans, A[N-1] - A[0]);
	p(ans);
	return 0;
}


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

 int main(){

  int a,b,c;
  cin>>a>>b>>c;

  if(a>b) swap(a,b);
  if(b>c) swap(b,c);
  if(a>b) swap(a,b);

  cout<<a<<" "<<b<<" "<<c<<endl;

  return 0;
  }


Measured memory_bytes: 3096
#include <bits/stdc++.h>
using namespace std::literals::string_literals;
using i64 = long long;
using std::cout;
using std::endl;
using std::cin;

template<typename T>
std::vector<T> make_v(size_t a){return std::vector<T>(a);}

template<typename T,typename... Ts>
auto make_v(size_t a,Ts... ts){
  return std::vector<decltype(make_v<T>(ts...))>(a,make_v<T>(ts...));
}

int main() {
	int n, q; scanf("%d%d", &n, &q);
	std::vector<int> s(n), t(n), x(n);
	std::vector<std::pair<int, int>> X, Y;
	for(int i = 0; i < n; i++) {
		scanf("%d%d%d", &s[i], &t[i], &x[i]);
		
		X.push_back({s[i] - x[i], i});
		Y.push_back({t[i] - x[i], i});
	}
	sort(begin(X), end(X)); sort(begin(Y), end(Y));
	
	int curX = 0, curY = 0;
	std::set<std::pair<int, int>> st;
	while(q--) {
		int D; scanf("%d", &D);
		
		while(curX < X.size() and X[curX].first <= D) {
			int p = X[curX++].second;
			
			st.insert({x[p], p});
		}
		while(curY < Y.size() and Y[curY].first <= D) {
			int p = Y[curY++].second;
			
			st.erase({x[p], p});
		}
		
		if(st.empty()) printf("-1\n");
		else printf("%d\n", (*begin(st)).first);
	}
	return 0;
}


Measured memory_bytes: 16100
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
const int N = 1e6+1;
vector<bool> primes(N,true);
void soe()
{
	for(int i = 2; i * i <= N;++i){
		if(primes[i] == true){
			for(int j = i*i; j < N;j+=i)
				primes[j] = false;
		}
	}
}
int main()
{
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	soe();
	int n;
	cin >> n;
	int gc;
	vector<int> freq(1e6+1,0);
	for(int i = 1; i <= n;++i){
		int x;
		cin >> x;
		++freq[x];
		if(i == 1)
			gc = x;
		else
			gc = __gcd(gc,x);
	}
	int flag = 1;
	for(int i = 2; i < N;++i){
		if(primes[i]){
			int cnt = 0;
			for(int j = i; j < N;j+=i){
					cnt += freq[j];
					if(cnt > 1){
						flag = 0;
						break;
					}
				}
			}
			if(flag == 0)
				break;
	}
	if(flag == 1)
		cout << "pairwise coprime\n";
	else if(gc == 1)
		cout << "setwise coprime\n";
	else
		cout << "not coprime\n";
}



Measured memory_bytes: 7088
//In The Name Of Allah
#include<bits/stdc++.h>
using namespace std;
#define int long long
#define sz(x) (int)(x.size())
#define double long double 
#define fi first
#define se second
#define pii pair<int, int>

signed main() {
	ios::sync_with_stdio(false); cin.tie(nullptr);
  int n, L;
  cin >> n >> L;
  int a[n + 1];
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
  }
  int idx = -1, mx = 0;
  for (int i = 1; i < n; i++) {
    if (a[i] + a[i + 1] >= mx) {
      mx = a[i] + a[i + 1];
      idx = i;
    }
  }
  if (mx < L) {
    cout << "Impossible\n";
  } else {
    cout << "Possible\n";
    for (int i = 1; i < idx; i++) {
      cout << i << "\n";
    }
    for (int i = n - 1; i >= idx; i--) {
      cout << i << "\n";
    }
  }
}



Measured memory_bytes: 1664
//A,Elebereth Gilthoniel mantae!
//For Temeria!
#include<iostream>
#include<algorithm>
#include<cmath>
#include<string>
#include<vector>
#include<set>
#include<cstdio>
#include<map>
#include<stack>
#include<queue>
#include<cstring> 
using namespace std;

int main()
{
 	//freopen("","r",stdin);
	//freopen("","w",stdout);
	string s;cin>>s;for(int i=0;i<s.size()-1;i++)
	{
		if(s[i]=='A' and s[i+1]=='C')
		{
			cout<<"Yes";return 0;
		}
	} cout<<"No";
	return 0;
}

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

using namespace std;

int main() {
    int N;
    cin >> N;
    vector <int> H;
    for (int i = 0; i < N; ++i) {
        int h;
        cin >> h;
        H.push_back(h);
    }
    H[0]--;
    for (int i = 1; i < N - 1; ++i) {
        if (H[i - 1] > H[i + 1] || H[i - 1] > H[i]) {
            cout << "No" << endl;
            return 0;
        } else if (H[i - 1] <= H[i] - 1) {
            H[i]--;
        }
    }
    if (H[H.size() - 1] < H[H.size() - 2]) {
        cout << "No" << endl;
        return 0;
    }
    cout << "Yes" << endl;
    return 0;
}

Measured memory_bytes: 892
S = input()
if (S[0] == S[1] and S[2] == S[3]) or (S[0] == S[2] and S[1] == S[3]) or (S[0] == S[3] and S[1] == S[2]):
  if S[0] == S[1] == S[2] == S[3]:
    print("No")
  else:
    print("Yes")
else:
  print("No")

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

int main() {
  int n,x,y=0;
  cin >> n;
  x=n;
  while (x>0) {
    y+=x%10;
    x/=10;
  }
  if (n%y==0) cout << "Yes\n";
  else cout << "No\n";
}

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

int top, S[1000];

void push(int);
int pop(void);

int main()
{
  int x, y;
  char s[100];
  top = 0;
  
  while( scanf("%s", s) != EOF )
    {
      if ( s[0] == '+' )
	{
	  x = pop();
	  y = pop();
	  push(x+y);
	}
      else if ( s[0] == '-' )
	{
	  y = pop();
	  x = pop();
	  push(x-y);
	}
      else if ( s[0] == '*' )
	{
	  x = pop();
	  y = pop();
	  push(x*y);
	}
      else
	{
	  x = atoi(s);
	  push(x);
	}
    }

      printf("%d\n",pop());
  
  return 0;
}

void push(int x)
{
  S[++top] = x;
}

int pop(void)
{
  top--;
  return S[top+1];
}



Measured memory_bytes: 2084
import java.util.*;

public class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);

		while(true){
			int n=sc.nextInt(), m=sc.nextInt();
			if(n==0 && m==0) break;

			int[][] moneyMap = new int[m+1][m+1];
			int[][] timeMap = new int[m+1][m+1];

			while(n-- > 0){
				int a=sc.nextInt(), b=sc.nextInt();
				moneyMap[a][b] = moneyMap[b][a] = sc.nextInt();
				timeMap[a][b] = timeMap[b][a] = sc.nextInt();
			}

			int k = sc.nextInt();
			while(k-- > 0){
				int p=sc.nextInt(), q=sc.nextInt(), r=sc.nextInt();
				System.out.println(r==0 ? minCost(p,q,moneyMap) : minCost(p,q,timeMap));
			}
		}
	}

	static int minCost(int s,int g,int[][] map){
		Queue<State> open = new PriorityQueue<State>();
		Set<State> closed = new HashSet<State>();

		State st = new State(0,s);
		open.add(st);
		State ans = null;
		while(!open.isEmpty()){
			st = open.poll();
			if(closed.contains(st)) continue;
			closed.add(st);
			if(st.n == g){
				ans = st;
				break;
			}
			open.addAll(st.nexts(map));
		}
		return ans.cost;
	}

	static class State implements Comparable<State>{
		int cost;
		int n;

		State(int cost,int n){
			this.cost = cost;
			this.n = n;
		}

		List<State> nexts(int[][] map){
			List<State> sts = new ArrayList<State>();
			for(int i=1;i<map.length;i++){
				if(n == i) continue;
				if(map[n][i] > 0) sts.add(new State(cost+map[n][i],i));
			}
			return sts;
		}

		public int compareTo(State st){
			return cost - st.cost;
		}

		public boolean equals(Object o){
			State st = (State)o;
			return this.n == st.n;
		}

		public int hashCode(){
			return n;
		}
	}
}

Measured memory_bytes: 14000
#include<stdio.h>

int main(void){

    int x,y;

    scanf("%d %d",&x,&y);

    while(x!=0 && y!=0){
         if(x>y){
           x=x-y;
         }else{
           y=y-x;
         }
    }

    if(x==0){
      printf("%d\n",y);
    }else{
      printf("%d\n",x);
    }

    return 0;
}

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

#define lli long long int
#define REP(i,s,n) for(int i=s;i<n;i++)
#define NUM 2520
#define INF (1LL<<50)
#define DEBUG 0
#define mp(a,b) make_pair(a,b)
#define SORT(V) sort(V.begin(),V.end())
#define PI (3.141592653589794)
#define TO_STRING(VariableName) # VariableName
#define LOG(x) if(DEBUG)cout<<TO_STRING(x)<<"="<<x<<" "<<endl;
#define LOG2(x,y) if(DEBUG)cout<<TO_STRING(x)<<"="<<x<<" "<<TO_STRING(y)<<"="<<y<<endl;
#define LOG3(x,y,z) if(DEBUG)cout<<TO_STRING(x)<<"="<<x<<" "<<TO_STRING(y)<<"="<<y<<" "<<TO_STRING(z)<<"="<<z<<endl;
#define LOG4(w,x,y,z) if(DEBUG)cout<<TO_STRING(w)<<"="<<w<<" "<<TO_STRING(x)<<"="<<x<<" "<<TO_STRING(y)<<"="<<y<<" "<<TO_STRING(z)<<"="<<z<<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; }



void func(long long N, long long M){

    lli cnt=0;
    lli left=1,right=N;
    set<lli> ls;
    if(N%2==0)ls.insert(N/2);
    REP(i,0,M){
    	
    	if(N%2==0){
        	lli t = min(right-left,N-right+left);
            if(ls.find(t)!=ls.end())left++;
        }
        cout<<left<<" "<<right<<endl;
        lli length = min(right-left,N-right+left);
        ls.insert(length);
        left++,right--;

    }
}

int main(){
    // cout << fixed << setprecision(5);

    long long N;
    scanf("%lld",&N);
    long long M;
    scanf("%lld",&M);
    func(N, M);
    return 0;
}


Measured memory_bytes: 7896
n=input()
a=('+','-')
flag=0
for i in range(2):
  for j in range(2):
    for k in range(2):
      siki=n[0]+a[i]+n[1]+a[j]+n[2]+a[k]+n[3]
      if eval(siki)==7 and flag==0:
        print(siki+'=7')
        flag=1

Measured memory_bytes: 3188
#include<bits/stdc++.h>
#define ll long long
using namespace std;
const int N = 1e5+7;
int main()
{
    int n, k;
    ll ans1 = 0, ans2 = 0;
    scanf("%d%d", &n, &k);
    for(int i = 1; i <= n; i++)
    {
        if(i%k==0)
        {
            ans1++;
        }
        else if(2*(i%k)%k==0)
        {
            ans2++;
        }
    }
    printf("%lld\n", ans1*ans1*ans1+ans2*ans2*ans2);
    return 0;
}


Measured memory_bytes: 256
#include <cstdio>
#include <string>
#include <iostream>

using namespace std;

int main(){
	char Temp='\0';
	bool Flag=true;
	for(int i=0;i<3;i++){
		string Input="";
		cin>>Input;
		//printf("Input=%s\n",Input.c_str());
		if(i!=0){
			if(Temp!=Input[0]){
				Flag=false;
				break;
			}
		}
		Temp=Input[(int)Input.size()-1];
		//printf("Temp=%c\n",Temp);
	}
	cout<<(Flag==true?"YES":"NO")<<endl;
	return 0;
}

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

int main() {
  char s ;
  cin >> s;

  if (s == 'a' || s == 'i' || s == 'u' || s == 'e' || s == 'o') {
     cout << "vowel" << endl;
   }
  else {
     cout << "consonant" << endl;
   }



}


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

#define reps(i,s,n) for(int i = s; i < n; i++)
#define rep(i,n) reps(i,0,n)
#define ALL(v) v.begin(), v.end()
#define SZ(x) ((int)(x).size())
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }

int check(ll a, ll b, ll c){
    if (b > a && c > b){
        return 1;
    } else {
        return 0;
    }
}
    
int main() {
    ll A, B, C, K;
    cin >> A >> B >> C >> K;
    
    ll K2 = 1;
    rep(i, K)K2 *= 3;
    rep(bbb, K2){
        ll a = A, b = B, c = C;
        ll bit = bbb;
        if (check(a, b, c)){
            cout << "Yes";           
            return 0;
        }
            
        rep (i, K){
            if (bit%3==0){
                a *= 2;
            } else if (bit%3 == 1){
                b *= 2;
            } else {
                c *= 2;
            }
            if (check(a, b, c)){
                cout << "Yes";           
                return 0;
            }
            bit /= 3;
        }
    }   
    cout << "No";           
    return 0;
}



Measured memory_bytes: 3632
eval'N,M,*A='+`dd`.split*?,
d=[0]
N.times{|i|
	A.map{|a|
		d[i]&&d[j=i+[0,2,5,5,4,5,6,3,7,6][a]]=[d[j]||0,d[i]*10+a].max
	}
}
p d[N]


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

template<typename T>
T gcd(T a, T b) {
    if (b == 0) {
        return a;
    } else {
        return gcd(b, a % b);
    }
}

template<typename T>
T lcm(T a, T b) {
  return a * b / gcd(a, b);
}

void Main() {
  long long a, b;
  cin >> a >> b;

  cout << lcm(a, b) << endl;
}

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


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

const int MAXN = 200005;

struct node {
	int to, next;
} edge[MAXN*2];
int head[MAXN], top = 0;
inline void push(int i, int j)
{ edge[++top] = (node){j, head[i]}, head[i] = top; }

int n, m;
char str[MAXN];
int cnt[MAXN][2];
int stk[MAXN], stk_top = 0;
int vis[MAXN];

int main()
{
	scanf("%d%d", &n, &m);
	scanf("%s", str+1);
	for (int i = 1; i <= m; i++) {
		int u, v;
		scanf("%d%d", &u, &v);
		if (u != v) push(u, v), push(v, u);
		else push(u, v);
	}
	for (int i = 1; i <= n; i++) {
		for (int j = head[i]; j; j = edge[j].next) {
			int to = edge[j].to;
			if (str[to] == 'A') cnt[i][0]++;
			else cnt[i][1]++;
		}
		if (cnt[i][1] == 0 || cnt[i][0] == 0) {
			stk[++stk_top] = i;
			vis[i] = 1;
		}
	}
	// cout << cnt[7][0] << " " << cnt[7][1] << endl;
	while (stk_top) {
		int nd = stk[stk_top--], id;
		if (str[nd] == 'A') id = 0;
		else id = 1;
		for (int i = head[nd]; i; i = edge[i].next) {
			int to = edge[i].to;
			if (vis[to]) continue;
			if ((--cnt[to][id]) == 0)
				stk[++stk_top] = to, vis[to] = 1;
		}
	}
	for (int i = 1; i <= n; i++)
		if (!vis[i]) {
			cout << "Yes" << endl;
			return 0;
		}
	cout << "No" << endl;
	return 0;
}


Measured memory_bytes: 6912
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<(n);i++)
typedef long long ll;
int main(){
	bool prime[10001];
	int n;
	rep(i,10001)prime[i]=true;;
	prime[0]=prime[1]=false;
	for(int i=2;i<=10000;i++)if(prime[i])for(int j=2*i;j<=10000;j+=i)prime[j]=false;
	while(cin>>n){
		for(int i=n;i>=2;i--){
			if(prime[i]&&prime[i-2]){
				cout<<i-2<<" "<<i<<endl;
				break;
			}
		}
	}
}

Measured memory_bytes: 1172
//Create Time: 2018-04-14 23:03:43
#include <iostream>
#include <cstdio>
#include <cstring>
#include <string>
#include <cmath>
#include <algorithm>
#include <vector>
#include <cstdlib>
#include <sstream>
#include <fstream>
#include <functional>
#include <list>
#include <deque>
#include <queue>
#include <stack>
#include <map>
#include <set>
#include <bitset>
#include <cctype>
#include <ctime>
#include <utility>
#include <complex>
#include <cassert>
#include <climits>
using namespace std;
#define snuke(i,x) for (__typeof((x).begin()) i = (x).begin(); i != (x).end(); ++i)
#define rep(i,a,n) for (int i=(a);i<(n);i++)
#define per(i,n,a) for (int i=(n)-1;i>=(a);i--)
#define OUT(x) std::cout<<(#x)<<":"<<(x)<<std::endl
#define TST(x) std::cout<<(#x)<<":"<<(x)<<" "
#define SZ(v) ((int)(v).size())
#define all(v) (v).begin(), (v).end()
#define unq(x) sort(all(x)),(x).erase(unique(all(x)),(x).end())
#define mem(f,x) memset((f), (x), sizeof(f))
#define clr(f) mem(f,0)
#define x first
#define y second
#define mp make_pair
#define pb push_back
#define DEBUG
template<class T> void rd(T&ret){ret=0;bool ok=0,u=0;for(;;){int c=getchar();if(c>='0'&&c<='9')ret=(ret<<3)+(ret<<1)+c-'0',ok=1;else if(c=='-')u=1;else if(ok){if(u)ret*=-1;return;}}}
long long powmod(long long p,long long n,long long mod){long long ret=1;for(;n;n>>=1){if(n&1)ret=ret*p%mod;p=p*p%mod;}return ret;}
template <class T> bool chmin(T& a, const T &b) {return b < a? a = b, 1: 0;}
template <class T> bool chmax(T& a, const T &b) {return b > a? a = b, 1: 0;}
int gcd(int a,int b){return b?gcd(b,a%b):a;}
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<pii > vii;
/****head****/
const int N=200009;
int n,an[N];
multiset<int> up;
multiset<int,greater<int> > down;
void upd(){
    while(SZ(up)<SZ(down)+1){
        int t=*down.begin();
        up.insert(t);
        down.erase(down.begin());
    }
    while(SZ(up)>SZ(down)+1){
        int t=*up.begin();
        down.insert(t);
        up.erase(up.begin());
    }
}
int main(){
    cin>>n;
    rep(i,0,n)scanf("%d",an+i);
    rep(i,1,n){
        up.insert(an[i]);
    }
    upd();
    printf("%d\n",*up.begin());
    rep(i,1,n){
        auto it=up.find(an[i]);
        if(up.end()==it){
            it=down.find(an[i]);
            down.erase(it);
        }else up.erase(it);
        
        if(an[i-1]>=*up.begin()) up.insert(an[i-1]);
        else down.insert(an[i-1]);
        upd();

        // for(int i:up)TST(i);
        // for(int j:down)TST(j);
        // puts("");

        printf("%d\n",*up.begin());
    }
    return 0;
}


Measured memory_bytes: 12416
#include<bits/stdc++.h>
#include <array>
using namespace std;
using ULL = unsigned long long;
using UL = unsigned;
using LL = long long;
#define rep(i, n) for(UL i = 0; i < (n); i++)

struct Problem {

	void Solve() {
		vector<UL> N(4); rep(i, 4) cin >> N[i];
		sort(N.begin(), N.end());
		if (N == vector<UL>({ 1,4,7,9 })) cout << "YES" << endl;
		else cout << "NO" << endl;
	}

	Problem();
};
int main() {
	unique_ptr<Problem> p(new Problem());
	p->Solve();
	return 0;
}
Problem::Problem() {
	cout << fixed << setprecision(10);
}

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

int main(){
    int N;
    double x;
    double ans = 0;
    cin >> N;
    for (int i = 0; i < N; i++) {
        cin >> x;
        ans += 1 / x;
    }
    cout << 1/ans << endl;
    
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> P;

#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 repr(i, n) for(int i = n; i >= 0; i--)
#define reprl(i, n) for(ll i = n; i >= 0; i--)
#define fori(i, m, n) for(int i = m; i < (int)n; i++)
#define forl(i, m, n) for(ll i = m; i < (ll)n; i++)
#define all(v) v.begin(), v.end()
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);
}
bool isLowerCase(char c){
  return (c>='a'&&c<='z');
}
const string yesno(bool ans){
  return (ans?"Yes":"No");
}
int main() {
  int x;cin>>x;
  int cnt500=0,cnt5=0;
  cnt500=x/500;
  x%=500;
  cnt5=x/5;
  ll ans=cnt500*1000+cnt5*5;
  cout<<ans<<endl;
  return 0;
}


Measured memory_bytes: 256
def solve():
    S = input()
    if len(S) % 2 == 1 or len(S) == 0:
        print('No')
        exit()
    for i in range(len(S)):
        if i % 2 == 0:
            if S[i] != 'h':
                print('No')
                exit()
        else:
            if S[i] != 'i':
                print('No')
                exit()
    print('Yes')


if __name__ == '__main__':
    solve()


Measured memory_bytes: 3060
// AOJ 1386 Starting a Scenic Railroad Service
// 2018.2.6 bal4u

#include <stdio.h>

int a[200002], b[200002];
int imos[200002], imos1[200002], imos2[200002];

//#define getchar_unlocked()  getchar()
int in()
{
	int n = 0;
	int c = getchar_unlocked();
	do n = (n<<3)+(n<<1) + (c & 0xf), c = getchar_unlocked();
	while (c >= '0');
	return n;
}

int main()
{
	int n, i, s1, s2, t, max;

	n = in();
	max = 0;
	for (i = 0; i < n; i++) {
		int _a, _b;
		a[i] = _a = in(), b[i] = _b = in();
		if (_b > max) max = _b;
		imos [_a]++, imos [_b]--;
		imos1[_a]++, imos2[_b]++;
	}

	s1 = s2 = 0;
    for (i = 1; i <= max; i++) {
        imos [i] += imos [i-1];
		if (imos[i] > s2) s2 = imos[i];
        imos1[i] += imos1[i-1];
        imos2[i] += imos2[i-1];
    }
    for (i = 0; i < n; i++) {
		t = imos1[b[i]-1] - imos2[a[i]];
		if (t > s1) s1 = t;
    }
    printf("%d %d\n", s1, s2);
	return 0;
}


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

using namespace std;

#define INF ((1<<30)-1)  //int32_t
#define MOD 1000000007
#define MOD2 

#define all(a)  (a).begin(),(a).end()

#define mkp make_pair
#define pb push_back

typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;

int main(){

    bool flag=true;

    ll ans=INF,change=0;
    
    int n;
    string s;
    cin >>n>>s;

    for (int i = 1; i < n; i++){
        if(s[i] == 'E')change++;
    }

    ans = change;
    //cout <<change << " ";

    for (int i = 1; i < n; i++){
        if(s[i-1] == 'W')change++;
        if(s[i] == 'E')change--;
        //cout <<change << " ";
        ans = min(change,ans);
    }
    //puts("");

    //cout <<fixed<<setprecision(16)<< << endl;
    cout <<ans << endl;

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



Measured memory_bytes: 900
#include <iostream>
using namespace std;
typedef long long  ll;
#define rep(i,s,n)for(ll i=s;i<n;i++)
#define repe(i,s,n)for(ll i=s;i<=n;i++)
static const double PI = 3.1415926535897932384626433;
static const ll LL_MAX = (ll)1 << 62;
static const ll MOD = 1000000007;

ll y_1[300000];
ll x1[300000];
ll y2[300000];
ll x2[300000];
ll a[501][501] = {};

int main() {
	ll h, w; cin >> h >> w;
	repe(i, 1, h)repe(j, 1, w)cin >> a[i][j];

	ll cnt = 0;
	repe(i, 1, h)rep(j, 1, w) {
		if (a[i][j] & 1) {
			a[i][j]--;
			a[i][j + 1]++;
			y_1[cnt] = i;
			x1[cnt] = j;
			y2[cnt] = i;
			x2[cnt] = j + 1;
			cnt++;
		}
	}

	rep(i, 1, h) {
		if (a[i][w] & 1) {
			a[i][w]--;
			a[i + 1][w]++;

			y_1[cnt] = i;
			x1[cnt] = w;
			y2[cnt] = i + 1;
			x2[cnt] = w;
			cnt++;
		}
	}
	cout << cnt << endl;
	rep(i, 0, cnt) {
		cout << y_1[i] << " " << x1[i] << " " << y2[i] << " " << x2[i] << endl;
	}

	return 0;
}

Measured memory_bytes: 12288
#include<bits/stdc++.h>
using namespace std;
int a[505][505];
int h,w;
struct node
{
    int x1,y1;
    int x2,y2;
}s[500*502];
bool f(int x,int y)
{
    if(x>=1&&x<=h&&y>=1&&y<=w)
        return true;
    return false;
}
int main()
{
    scanf("%d%d",&h,&w);
    for(int i=1;i<=h;i++)
        for(int j=1;j<=w;j++) scanf("%d",&a[i][j]);
    int ans=0;
    for(int i=1;i<=h;i++)
    {
        for(int j=1;j<=w;j++)
        {
            if(a[i][j]%2==0) continue;
            if(f(i,j+1))
            {
                s[ans].x1=i;
                s[ans].y1=j;
                s[ans].x2=i;
                s[ans].y2=j+1;
                ans++;
                a[i][j+1]++;
                a[i][j]--;
            }
            else if(f(i+1,j))
            {
                s[ans].x1=i;
                s[ans].y1=j;
                s[ans].x2=i+1;
                s[ans].y2=j;
                ans++;
                a[i+1][j]++;
                a[i][j]--;
            }
        }
    }
    printf("%d\n",ans);
    for(int i=0;i<ans;i++) printf("%d %d %d %d\n",s[i].x1,s[i].y1,s[i].x2,s[i].y2);
}


Measured memory_bytes: 6912
'use strict';

function Main(input) {
  const list = input.split(' ');
  let dis_a_c = Math.abs(Number(list[2]) - Number(list[0]));
  let dis_a_b = Math.abs(Number(list[1]) - Number(list[0]));
  let dis_b_c = Math.abs(Number(list[2]) - Number(list[1]));
  let okdis = Number(list[3]);

  if(dis_a_c <= okdis) {
    console.log('Yes')
  }
  else if(dis_a_b <= okdis && dis_b_c <= okdis) {
    console.log('Yes');
  }
  else {
    console.log('No');
  }
  
}
 
Main(require("fs").readFileSync("/dev/stdin", "utf8"));

Measured memory_bytes: 22964
#include <iostream>
#include <algorithm>
#include <cstdio>
#include <cmath>
#include <vector>
#include <map>
#include <set>
#include <string>
#include <stack> // s.top()
#include <bitset>
#include <queue> // s.front()
using namespace std;

typedef long long Int;
typedef pair<Int,Int> P;
#define print(x) cout<<(x)<<endl

#define INF10 10000000000
#define INF5 100000
#define EPS 1e-10
#define MOD 1000000007


int main() {
	string b;
	cin >> b;
	if (b[0] == 'A')print("T");
	else if (b[0] == 'T')print("A");
	else if (b[0] == 'G')print("C");
	else print("G");






	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0; i<(n); i++)
int n, m;
string s;
map<string, int> mp;
int main(){
	cin.tie(0);
	ios::sync_with_stdio(false);
	cin >> n;
	rep(i,n){
		cin >> s;
		m = max(m, ++mp[s]);
	}
	for(auto p: mp) if(p.second == m) cout << p.first << '\n';
}

Measured memory_bytes: 23808
#include <iostream>
#include <algorithm>
#include <cstring>
#include <cstdio>
#include <vector>
#include <queue>
#include <stack>
#include <cstdlib>
#include <iomanip>
#include <cmath>
#include <cassert>
#include <ctime>
#include <map>
#include <set>
using namespace std;
#define lowbit(x) (x&(-x))
#define max(x,y) (x>=y?x:y)
#define min(x,y) (x<=y?x:y)
#define MAX 100000000000000000
#define MOD 1000000007
#define pi acos(-1.0)
#define ei exp(1)
#define PI 3.141592653589793238462
#define ios() ios::sync_with_stdio(true)
#define INF 1044266558
#define mem(a) (memset(a,0,sizeof(a)))
typedef long long ll;
map<int,int>m;
int n,ans,x;
int main()
{
	while(scanf("%d",&n)!=EOF)
	{
		m.clear();
		ans=0;
		for(int i=0;i<n;i++)
		{
			scanf("%d",&x);
			if(!m[x]) ans++;
			else ans--;
			m[x]^=1;
		}
		printf("%d\n",ans);
	}
	return 0;
}

Measured memory_bytes: 4992
def main():
    import sys
    input = sys.stdin.readline
    sys.setrecursionlimit(10000000)
    from collections import Counter, deque
    #from collections import defaultdict
    from itertools import combinations, permutations
    #from itertools import accumulate, product
    from bisect import bisect_left,bisect_right
    from math import floor, ceil
    #from operator import itemgetter

    #mod = 1000000007

    N, W = map(int, input().split())
    w = [0]*N
    v = [0]*N
    for i in range(N):
        w[i], v[i] = map(int, input().split())
    dp = [[0]*(W+1) for _ in range(N+1)]
    for i in range(N):
        for j in range(W+1):
            if w[i]<=j:
                dp[i+1][j] = max(dp[i][j], dp[i][j-w[i]]+v[i])
            else:
                dp[i+1][j] = dp[i][j]
    print(dp[N][W])
    

if __name__ == '__main__':
    main()

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

using namespace std;
typedef long long ll;

int main(void) {
    ll A, B;
    cin >> A >> B;

    if((A + B) % 2 != 0) {
        cout << "IMPOSSIBLE" << endl;
    } else {
        cout << (A + B) / 2 << endl;
    }
}

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

typedef long long int ll;
ll MOD = 1000000007;
ll INFL = 1ll << 60;
ll INF = 1 << 28;

// ====================================================================

int main() {
  string s;
  cin >> s;
  cout << s[0] << s.size() - 2 << s[s.size() - 1] << endl;
}


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

int D, N;

int main() {
	cin >> D >> N;
	if (D == 0) {
		if (N < 100) {
			cout << N << endl;
		}
		else {
			cout << 101 << endl;
		}
		
	}
	else if (D == 1) {
		if (N < 100) {
			cout << N * 100 << endl;
		}
		else {
			cout << 101 * 100 << endl;
		}
	}
			
	else if (D == 2) {
		if (N < 100) {
			cout << N * 100 * 100 << endl;
		}
		else {
			cout << 101 * 100 * 100 << endl;
		}
		
	}
}


Measured memory_bytes: 3600
import math
import itertools
N=int(input())
Plist=tuple(map(str,input().split()))
Qlist=tuple(map(str,input().split()))

#number=math.fractorial(N)
s_number=""

for i in range(1,N+1):
    s_number+=str(i)
    
#print(s_number)

#Plistを調べる
j=0


for i in itertools.permutations(s_number):
    #print(i)
    #print(j)
    
    if i==Plist:
        a=j
    j+=1
    
#Qlistを調べる    
j=0

for i in itertools.permutations(s_number):
    #print(i)
    #print(j)
    
    if i==Qlist:
        b=j
    j+=1
    
print(abs(a-b))
    

Measured memory_bytes: 3188
N, M = (int(i) for i in input().split())  

def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)

    divisors.sort(reverse=True)
    return divisors
  
div = make_divisors(M)

for d in div:
    if int(M/d) >= N:
        print(d)
        break

Measured memory_bytes: 3060
#include <bits/stdc++.h>
using namespace std;
#define all(x) (x).begin(), (x).end()
#define SZ(X) ((int)(X).size())
#define endl "\n";
int main()
{
	ios::sync_with_stdio(0);
	cin.tie(0);
	// freopen("input.txt", "r", stdin);
	// freopen("output.txt", "w", stdout);
    int x,y,z,a,b;
    cin>>x>>y>>z;
    a=x-z;
    b=y+z;
    cout<<a/b;


   return 0;
}


Measured memory_bytes: 3588
import java.util.Scanner;

public class Main {

    
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int a = scanner.nextInt();
        int b = scanner.nextInt();
        
        if(a==1&&b==2 || b==1 &&a==2){
            System.out.println("3");
        } else if(a==1 && b == 3 || a==3&&b==1){
        System.out.println("2");
     } else if(a==2 && b==3||a==3&&b==2){
            System.out.println("1");
    }
    }
    
}


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

const int INF = 1e+8;
int n, X[5][5][5][5] = {0};
char dp[(1<<25)/2];

void init(){
	for(int i=0 ; i < (1<<25)/2 ; i++ ){
		dp[i] = -1;
	}
	for(int ly = 0 ; ly < 5 ; ly++ ){
		for(int lx = 0 ; lx < 5 ; lx++ ){
			for(int ry = ly ; ry < 5 ; ry++ ){
				for(int rx = lx ; rx < 5 ; rx++ ){
					for(int y = ly ; y <= ry ; y++ ){
						for(int x = lx ; x <= rx ; x++ ){
							X[ly][lx][ry][rx] |= (1 << (y * 5 + x));
						}
					}
				}
			}
		}
	}
}

void set(int bits, char k){
	if( bits % 2 == 0 ){
		dp[bits/2] = ((0xf << 4) & dp[bits/2]) | k;
	}else{
		dp[bits/2] = (0xf & dp[bits/2]) | (k << 4);
	}
}

int get(int bits){
	if( bits % 2 == 0 ){
		return dp[bits/2] & 0xf;
	}else{
		return (dp[bits/2] >> 4) & 0xf;
	}
}

int solve(int bits){
	if( bits == 0 ) return 0;
	if( get(bits) != 0xf ) return get(bits);
	
	int sx, sy;
	for(int i=0 ; i < 25 ; i++ ){
		if( bits & (1 << i) ){
			sx = i % 5; sy = i / 5; break;
		}
	}
	int res = INF;
	for(int y = sy ; y < 5 ; y++ ){
		for(int x = sx ; x < 5 ; x++ ){
			int next = bits ^ X[sy][sx][y][x];
			res = min(res, solve(next)+1 );
		}
	}
	set(bits, res);
	return res;
}
 
int main(){
	init();
	while( cin >> n , n ){
		int bits = 0;
		for(int i=0 ; i < 25 ; i++ ){
			int e = 0;
			if( i % 5 < n && i / 5 < n ){
				cin >> e;
			}
			bits = (bits << 1) + e;
		}
		int ans = solve(bits);
		for(int i=0 ; i < ans ; i++ )
			cout << "myon";
		cout << endl;
	}
}

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

int main() {
  int N, K;
  cin >> N >> K;
  vector<int> vec(N);
  for (int i = 0; i < N; i++) cin >> vec.at(i);

  int ans = 0;
  for (int i = 0; i < N; i++) {
    if (vec.at(i) >= K) {
    ans++;
    }
  }
  cout << ans << endl;
}

Measured memory_bytes: 640