akhauriyash/Code-Regression huggingface dataset:
import java.util.Scanner;
import java.util.Queue;
import java.util.ArrayDeque;
 
public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		//初期化と入力
		int h = sc.nextInt();
		int w = sc.nextInt();
		int[] c = new int[2];
		int[] d = new int[2];
		char[][] s = new char[h+4][w+4];
		c[0] = sc.nextInt()+2;
		c[1] = sc.nextInt()+2;
		d[0] = sc.nextInt()+2;
		d[1] = sc.nextInt()+2;
		for(int i = 0; i < h+4; i++) {
			for(int j = 0; j < w+4; j++) {
				s[i][j] = '0';
			}
		}
		for(int i = 0; i < h; i++) {
			String temp = sc.next();
			for(int j = 0; j < w; j++) {
				s[i+2][j+2] = temp.charAt(j);
			}
		}
		boolean[][]	 check = new boolean[h+4][w+4];
		for(int i = 0; i < h+4; i++) {
			for(int j = 0; j < w+4; j++) {
				check[i][j] = true;
			}
		}
		Queue<Integer> kohoy = new ArrayDeque<>();
		Queue<Integer> kohox = new ArrayDeque<>();
		Queue<Integer> searchy = new ArrayDeque<>();
		Queue<Integer> searchx = new ArrayDeque<>();
		kohoy.add(c[0]-1);
		kohox.add(c[1]-1);
		int ans = 0;
		//ここまで初期化と入力↑
		
		while(true) {
			//ワープ候補先を（１回目はスタート地点）を探索
			while(true) {
				//System.out.println(kohoy.peek()+" "+kohox.peek());
				if(kohoy.peek()==null) {
					break;
				}
				run(s,check,kohoy.poll(),kohox.poll(),searchy,searchx);
				//System.out.println(kohoy.peek()+" "+kohox.peek());
			}
			/*for(int i = 0; i < h + 4; i++) {
				for(int j = 0; j < w + 4; j++) {
					if(check[i][j]==true) {
						System.out.print('a');
					}else {
						System.out.print('b');
					}
				}System.out.println();
			}*/
			//System.out.println();
			//ゴールが探索済みなら終了
			if(!check[d[0]-1][d[1]-1]) {
				break;
			}
			//探索した場所（serachy,searchx)からワープ先候補を探してキュー(kohoy,kohox)に入れる
			while(true) {
				if(searchy.peek()==null) {
					break;
				}
				warp(s,check,kohoy,kohox,searchy,searchx);
			}
			//探索する地点とワープ先がなくなって、ゴールが未探索ならばゴール不可能で終了
			if(searchy.peek()==null && kohoy.peek()==null && check[d[0]-1][d[1]-1]) {
				ans = -1;
				break;
			}
 
			++ans;
		}
		System.out.println(ans);
		
	}
	//候補キューから探索開始地点を取り出して探索．探索した場所を探索済みキューに入れる
	public static void run(char[][] map,boolean[][] check,int y, int x,Queue<Integer> sy,Queue<Integer> sx) {
		check[y][x] =false;
		sy.add(y);
		sx.add(x);
		if(map[y+1][x] == '.' && check[y+1][x] == true) {
			run(map,check,y+1,x, sy,sx);
		}if(map[y-1][x] == '.' && check[y-1][x] == true) {
			run(map,check,y-1,x, sy,sx);
		}if(map[y][x+1] == '.' && check[y][x+1] == true) {
			run(map,check,y,x+1, sy,sx);
		}if(map[y][x-1] == '.' && check[y][x-1] == true) {
			run(map,check,y,x-1, sy,sx);
		}
	}
	//探索済みキューから取り出しワープできる場所を探して候補キューに入れる．
	public static void warp(char[][] map,boolean[][] check,Queue<Integer> kohoy,Queue<Integer> kohox,Queue<Integer> sy,Queue<Integer> sx) {
		int y = sy.poll();
		int x = sx.poll();
		for(int i = 0; i < 5; i++) {
			for(int j = 0; j < 5; j++) {
				if(map[y-2+i][x-2+j] == '.' && check[y-2+i][x-2+j] == true) {
					kohoy.add(y-2+i);
					kohox.add(x-2+j);
					//System.out.println("a"+(y-2+i)+" "+(x-2+j));
				}
			}
		}
	}
}

Measured memory_bytes: 64576
#ifdef DEBUG
#define _GLIBCXX_DEBUG
#endif

#include <bits/stdc++.h>

using namespace std;

mt19937 mrand(random_device{} ()); 

int rnd(int x) {
  return mrand() % x;
}

typedef long double ld;
typedef long long ll;

#ifdef DEBUG
#define eprintf(...) fprintf(stderr, __VA_ARGS__), fflush(stderr)
#else
#define eprintf(...) ;
#endif

#define pb push_back
#define mp make_pair
#define sz(x) ((int) (x).size())
#define TASK "text"

const int inf = (int) 1.01e9;
const ld eps = 1e-9;
const ld pi = acos((ld) -1.0);

void precalc() {
}

const int maxn = 15;
int xs[maxn], ys[maxn], a[maxn];

int n;

int read() {
  if (scanf("%d", &n) < 1) {
    return 0;
  }
  for (int i = 0; i < n; ++i) {
    scanf("%d%d%d", xs + i, ys + i, a + i);
  }
  return 1;
}

long long sum[1 << maxn];
ld dp[1 << maxn];

ld ans[1 << maxn];

ld dist[maxn][maxn];

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

  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < n; ++j) {
      int dx = xs[i] - xs[j], dy = ys[i] - ys[j];
      dist[i][j] = sqrt((ld) dx * dx + (ld) dy * dy);
    }
  }

  ans[0] = inf;
  for (int mask = 1; mask < (1 << n); ++mask) {
    int id = __builtin_ctz(mask);
    sum[mask] = sum[mask ^ (1 << id)] + a[id];

    if (mask == (1 << id)) {
      dp[mask] = 0;
    } else {
      dp[mask] = 1e18;
      for (int i = 0; i < n; ++i) {
        if (!((mask >> i) & 1)) {
          continue;
        }
        for (int j = 0; j < n; ++j) {
          if (i == j || !((mask >> j) & 1)) {
            continue;
          }
          dp[mask] = min(dp[mask], dp[mask ^ (1 << i)] + dist[i][j]);
        }
      }
    }

    ans[mask] = (sum[mask] - dp[mask]) / __builtin_popcount(mask);
    for (int x = mask; x; x = ((x - 1) & mask)) {
      ans[mask] = max(ans[mask], min(ans[x], ans[mask ^ x]));
    }
  }
  printf("%.18f\n", (double) ans[(1 << n) - 1]);
}

int main() {
  precalc();
#ifdef LOCAL
  freopen(TASK ".out", "w", stdout);
  assert(freopen(TASK ".in", "r", stdin));
#endif

  while (1) {
    if (!read()) {
      break;
    }
    solve();
#ifdef DEBUG
    eprintf("Time %.2f\n", (double) clock() / CLOCKS_PER_SEC);
#endif
  }
  return 0;
}


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

using namespace std;

int main(int argc, char *argv[]) {
  int n, m;
  cin >> n >> m;
  int k = 1;
  for (int i = 0; i < m; i++, k *= 2);
  cout << ((n - m) * 100 + m * 1900) * k << endl;
  return 0;
}


Measured memory_bytes: 256
import java.util.*;

public class Main {


    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int m = sc.nextInt();
        int[] h = new int[n];
        for (int i = 0; i < n; i++) {
            h[i] = sc.nextInt();
        }
        boolean[] q = new boolean[n];
        for(int i=0; i<m; i++) {
            int a = sc.nextInt() - 1;
            int b = sc.nextInt() - 1;
            if(h[a] < h[b]) {
                q[a] = true;
            } else if (h[a] > h[b]) {
                q[b] = true;
            } else {
                q[a] = true;
                q[b] = true;
            }
        }
        int res = 0;
        for(int i=0; i<n; i++) {
            if(!q[i]) res++;
        }

        System.out.println(res);
    }
}

Measured memory_bytes: 59368
#!/usr/bin/env python3
#ABC107 B

h,w = map(int,input().split())

a = [list(input()) for _ in range(h)]
ans = [['.']*w for _ in range(h)]
for i in range(h):
    for j in range(w):
        if a[i][j] == '.':
            for k in range(h):
                if a[k][j] == '.':
                    continue
                else:
                    break
            else:
                for k in range(h):
                    ans[k][j] = None
            for k in range(w):
                if a[i][k] == '.':
                    continue
                else:
                    break
            else:
                for k in range(w):
                    ans[i][k] = None
        if a[i][j] == '#':
            ans[i][j] = '#'
for i in range(h):
    ans[i] = [i for i in ans[i] if i]
for i in range(h):
    if len(ans[i]) != 0:
        print(''.join(ans[i]))


Measured memory_bytes: 44780
import java.util.HashSet;
import java.util.Scanner;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		int b = sc.nextInt();
		sc.close();

		HashSet<Integer> group1 = new HashSet<Integer>();
		HashSet<Integer> group2 = new HashSet<Integer>();
		HashSet<Integer> group3 = new HashSet<Integer>();

		group1.add(1);
		group1.add(3);
		group1.add(5);
		group1.add(7);
		group1.add(8);
		group1.add(10);
		group1.add(12);

		group2.add(4);
		group2.add(6);
		group2.add(9);
		group2.add(11);

		group3.add(2);


		HashSet<Integer> agroup = null;

		if(group1.contains(a)){
			agroup = group1;
		}else if(group2.contains(a)){
			agroup = group2;
		}else if(group3.contains(a)){
			agroup = group3;
		}

		String yorn = "No";
		if(agroup.contains(b)){
			yorn = "Yes";
		}

		System.out.println(yorn);
	}
}

Measured memory_bytes: 23764
#include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define ld long double
#define mt make_tuple
#define show(x) cout<<x<<'\n'
#define showh(x) cout<<x<<' '
#define go(i,a,n) for(ll i=a;i<n;i++)
#define gor(i,a,n) for(ll i=n-1;i>=a;i--)
#define pb push_back
#define mp make_pair
#define mod 1000000007
bool prime[100001];
bool ispoweroftwo(ll x)
{
    return x && !(x & (x-1));
}
ll xorcal(ll n)
{
    if(n%4==0)
        return n;
    if(n%4==1)
        return 1;
    if(n%4==2)
        return n+1;
    if(n%4==3)
        return 0;
}
void sieve(ll n)
{
    memset(prime,true,sizeof(prime));
    prime[0]=false;
    prime[1]=false;
    for(ll i=2;i*i<=n;i++)
    {
        if(prime[i]==true)
        {
            for(ll j=i*i;j<=n;j+=i)
            {
                prime[j]=false;
            }
        }
    }
    show(prime[89]);
}
bool isprime(ll n)
{
    if (n<=1) return false;
    if (n<=3) return true;

    if(n%2==0 or n%3==0) return false;

    for(ll i=5;i*i<=n;i+=6)
    {
        if(n%i==0 or n%(i+2)==0) return false;
    }
    return true;
}

ll modinverse(ll a,ll m)
{
    ll m0 = m;
    ll y = 0, x = 1;

    if (m == 1)
      return 0;

    while (a > 1)
    {
        ll q = a / m;
        ll t = m;

        m = a % m; a = t;
        t = y;

        y = x - q * y;
        x = t;
    }

    if (x < 0)
       x += m0;

    return x;
}

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

ll power(ll A, ll B)
{
    if (A == 0)
        return 0;
    if (B == 0)
        return 1;

    ll y;
    if (B % 2 == 0) {
        y = power(A, B / 2);
        y = (y * y) % mod;
    }

    else {
        y = A % mod;
        y = (y * power(A, B - 1) % mod) % mod;
    }

    return (ll)((y + mod) % mod);
}

int main()
{
    ios_base::sync_with_stdio(false);
    string s;
    cin>>s;
    sort(s.begin(),s.end());
    if(s[1]==s[0] and s[1]==s[2] and s[2]==s[3])
    {
        show("No");
    }
    else if(s[0]==s[1] and s[2]==s[3])
    {
                show("Yes");

    }
    else
    {
        show("No");
    }
    return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <vector>
#include <queue>
#include <stack>
#include <string>
#include <iomanip>
#include <map>
#include <set>
#include <cmath>
#include <cstdio>
using namespace std;
#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define FOR(i,m,n) for(int (i)=(m);(i)<(n);(i)++)
#define All(v) (v).begin(),(v).end()
typedef long long ll;

int main(){
    int N;cin >> N;
    vector<int> A(N);
    rep(i,N)cin >> A[i];
    ll res = 0;
    for(int i=0;i<N-1;i++){
        res+=A[i]/2;
        A[i]%=2;
        if(A[i]&&A[i+1]){
            A[i]--;A[i+1]--;
            res++;
        }
    }
    res+=A[N-1]/2;
    cout << res << endl;
    return 0;
}

Measured memory_bytes: 640
#include <iostream>
#include <algorithm>
#include <stack>
#include <queue>
#include <vector>
#include <utility>
#include <map>
#include <string>
#include <math.h>
using namespace std;


int main() {

    int N;
    cin >> N;
    int A[N];
    for(int i=0;i<N;i++){
        cin >> A[i];
    }
    map<int,int>mp;
    for(int i=0;i<N;i++){
        mp[A[i]]++;
        if(mp[A[i]]>=2){
            cout << "NO" << endl;
            return 0;
        }
    }
    cout << "YES" << endl;
    
    return 0;
}

Measured memory_bytes: 10368
S = input()
A = int(S[0])
B = int(S[1])
C = int(S[2])
D = int(S[3])

idx = [0, 1, 2]
output = []
for i in range(1 << len(idx)):
    ops = ['+', '+', '+']
    if A+B+C+D == 7: 
        print(A,ops[0],B,ops[1],C,ops[2],D,'=7',sep='')
        exit()
    
    ans = A
    for j in range(len(idx)):
        if ((i >> j) & 1) == 1:
            ops[j] = '-'
    
    if ops[0] == '+' : ans += B
    else : ans -= B
    
    if ops[1] == '+' : ans += C
    else : ans -= C
    
    if ops[2] == '+' : ans += D
    else : ans -= D
    
    if ans == 7:
        print(A,ops[0],B,ops[1],C,ops[2],D,'=7',sep='')
        exit()
        

Measured memory_bytes: 3064
import java.io.File;
import java.io.FileNotFoundException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) throws FileNotFoundException {

		Scanner scan = new Scanner(System.in);
		//Scanner scan = new Scanner(new File("D:\\UserArea\\J0124567\\Downloads\\0530-input.txt"));

		while (scan.hasNext()) {
			int n = scan.nextInt();
			int m = scan.nextInt();
			if (n == 0)
				break;
			River r = new River(n, m);
			for (int i = 0; i < n; i++) {
				int k = scan.nextInt();
				for (int j = 0; j < k; j++)
					r.addStone(i, j, scan.nextInt(), scan.nextInt());
			}
			System.out.println(r.min());
		}
		scan.close();
		System.exit(0);
	}
}

class River {
	private class Stones {
		List<Integer> x = new ArrayList<Integer>();
		List<Integer> d = new ArrayList<Integer>();
	}

	int M;
	Stones[] stones;

	public River(int n, int m) {
		M = m;
		stones = new Stones[n];
		for (int i = 0; i < n; i++)
			stones[i] = new Stones();
	}

	int currLeast = Integer.MAX_VALUE;

	public int min() {
		for (int i = 0; i < stones[0].x.size(); i++) {
			int cost = this.jump(0, i, 0, M);
			if (currLeast > cost)
				currLeast = cost;
		}
		if (M > 0)
			for (int i = 0; i < stones[1].x.size(); i++) {
				int cost = this.jump(1, i, 0, M - 1);
				if (currLeast > cost)
					currLeast = cost;
			}

		return currLeast;
	}

	int[][][] result = new int[151][11][76];

	private int jump(int n, int k, int past, int mr) {
		if ((n >= stones.length - 1) || (n >= stones.length - 2 && mr > 0)) {
//			if (past < currLeast)
//				currLeast = past;
			return 0;
		}
		if (result[n][k][mr] != 0)
			return result[n][k][mr];

		int min = Integer.MAX_VALUE;
		if (past < currLeast) {
			for (int i = 0; i < stones[n + 1].x.size(); i++) {
				int mycost = (stones[n].d.get(k) + stones[n + 1].d.get(i))
						* (stones[n].x.get(k) - stones[n + 1].x.get(i));
				mycost = Math.abs(mycost);
				int cost = jump(n + 1, i, past + mycost, mr);
				if (cost != Integer.MAX_VALUE && cost + mycost < min)
					min = cost + mycost;
			}

			if (mr > 0 && n < stones.length - 2)
				for (int i = 0; i < stones[n + 2].x.size(); i++) {
					int mycost = (stones[n].d.get(k) + stones[n + 2].d.get(i))
							* (stones[n].x.get(k) - stones[n + 2].x.get(i));
					mycost = Math.abs(mycost);
					int cost = jump(n + 2, i, past + mycost, mr - 1);
					if (cost != Integer.MAX_VALUE && cost + mycost < min)
						min = cost + mycost;
				}
		}
		result[n][k][mr] = min;
		return min;
	}

	public void addStone(int n, int k, int x, int d) {
		stones[n].x.add(x);
		stones[n].d.add(d);
	}
}

Measured memory_bytes: 54172
n, k = map(int, input().split())
h = list(map(int, input().split()))
inf = 10 ** 10
dp = [inf for _ in range(n)]
dp[0] = 0
for i in range(1, n):
    for j in range(1, k+1):
        if i - j >= 0:
            dp[i] = min(dp[i], dp[i-j] + abs(h[i] - h[i-j]))
#print(dp)
print(dp[n-1])

Measured memory_bytes: 56032
#include<cstdio>
#include<algorithm>


using namespace std;

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


int main(){
	
	int N,A,B,C,X;
	int Y[111];
	int i,y;
	
	
	
	while(true){
		scanf("%d %d %d %d %d",&N,&A,&B,&C,&X);
		if((N|A|B|C|X)==0)return 0;
		
		rep(i,N)scanf("%d",&Y[i]);
		y=0;
		
		
		rep(i,10002){
			if(i==10001)break;
			if(X==Y[y]){
				y++;
				if(y==N)break;
			}
			
			X=(A*X+B)%C;

		}
		
		if(i==10001)puts("-1");
		else printf("%d\n",i);
	
	
	}
	
	
	
		

}

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

int main() {
	int N;
  	cin>> N;
  	
  	if(N%10==3){
     	cout<<"bon"<<endl; 
    }
  	else if(N%10==0||N%10==1||N%10==6||N%10==8){
     	cout<<"pon"<<endl;
    }
  	else{
     	cout<<"hon"<<endl; 
    }
  	
}

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

#define fi first
#define se second
#define all(x) (x).begin(), (x).end()
#define pb push_back
#define endl '\n'

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

const int INF = 1e9;
const int MOD = 1e9 + 7;
const int MAXN = 405;

int main() {
	ios::sync_with_stdio(0); cin.tie(0);
	int x; cin >> x;
	if(x >= 30) cout << "Yes";
	else cout << "No";
}


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

using namespace std;
using ll = long long;
using vec = vector<ll>;
using mat = vector<vec>;
using vec_b = vector<bool>;
using vec_str = vector<string>;

#define INF (1LL << 60)
#define MOD 1000000007

#define REP(i,m,n) for(ll (i)=(m),i##_len=(n);(i)<(i##_len);++(i))
#define FORR(i,v) for(auto (i):v)
#define ALL(x) (x).begin(), (x).end()
#define _PR(x) cout << (x) << endl
#define _PS(x) cout << (x) << " "
#define SZ(x) ((ll)(x).size())
#define MAX(a,b) (((a)>(b))?(a):(b))
#define MIN(a,b) (((a)<(b))?(a):(b))
#define pb push_back
#define mp make_pair

int main()
{
    ll H1, M1, H2, M2, K;
    cin >> H1 >> M1 >> H2 >> M2 >> K;

    ll minute = (H2 - H1) * 60 + M2 - M1;
    _PR(MAX(0,minute-K));

    return 0;
}

/*



*/

Measured memory_bytes: 3596
#include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define fast ios_base::sync_with_stdio(false);  cin.tie(NULL); cout.tie(NULL);
#define scan(a,n) for(long int index=0;index<n;index++) cin>>a[index];
#define print(a,n) for(long int index=0;index<n;index++) cout<<a[index]<<" ";cout<<endl;
#define mod 1000000007
#define pb push_back
#define mp make_pair
#define ss second
#define ff first
#define vli vector<long long int>
#define vlli vector<pair<long long int,long long int>>
#define vsi vector<string>
#define vci vector<char>


 
int main() {
   #ifndef ONLINE_JUDGE
    freopen("input.txt","r",stdin);
    freopen("output.txt","w",stdout);
    #endif
    fast;
     ll n;
     cin>>n;
     ll a=0,b=0,c=0,d=0;
     string s;
     while(n--){
      cin>>s;
      if(s[0]=='A') a++;
        if(s[0]=='W') b++;
          if(s[0]=='T') c++;
            if(s[0]=='R') d++;

     }
     cout<<"AC x "<<a<<endl;
     cout<<"WA x "<<b<<endl;
     cout<<"TLE x "<<c<<endl;
     cout<<"RE x "<<d<<endl;


   }
 
  


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

using namespace std;
using ll = long long;


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

    vector<ll> ok;
    ll sum = 0;
    for (int i = 1; i <= n; ++i) {
        if (i % 15 == 0) continue;
        if (i % 3 == 0) continue;
        if (i % 5 == 0) continue;
        ok.push_back(i);
    }
    cout << accumulate(all(ok), 0ll) << endl;
}


Measured memory_bytes: 11420
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back
#define mp make_pair
#define pll pair<ll,ll>
#define mod 1000000007

int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(0);cout.tie(0);
    int n,m;
    cin>>n>>m;
    char a[n][m];
    for(int i=0;i<n;i++)
        for(int j=0;j<m;j++)
            cin>>a[i][j];
    int dp[n][m]={0};
    memset(dp,0,sizeof(dp));
    for(int i=0;i<m;i++){
        if(a[0][i]=='.'){
            dp[0][i]=1;
        }
        else{
            break;
        }
    }
    for(int i=0;i<n;i++){
        if(a[i][0]=='.'){
            dp[i][0]=1;
        }
        else{
            break;
        }
    }
    for(int i=1;i<n;i++){
        for(int j=1;j<m;j++){
            if(a[i][j]=='.'){
                dp[i][j] = (dp[i-1][j]%mod+dp[i][j-1]%mod)%mod;
            }
            else{
                dp[i][j]=0;
            }
        }
    }
    cout<<dp[n-1][m-1]<<endl;
}


Measured memory_bytes: 5120
#include<bits/stdc++.h>
#define bye return 0
#define Yes cout << "Yes" << "\n"
#define No  cout << "No" << "\n"
#define YES cout << "YES" << "\n"
#define NO cout << "NO" << "\n"
using namespace std;
int main(){
	ios::sync_with_stdio(false);
    cin.tie(NULL);
    string s;
    char c;
    
    cin >> s;

    if(s[0] == s[2]){
    	Yes;
    }else{
    	No;
    }
    

   bye;

}


Measured memory_bytes: 256
from collections import Counter

N = int(input())
XY = [list(map(int, input().split())) for _ in range(N)]
XY.sort()
diff = []
for i in range(N):
    xi, yi = XY[i]
    for j in range(i+1, N):
        xj, yj = XY[j]
        diff.append((xj-xi, yj-yi))
c = Counter(diff)
print(N-max(c.values()) if c else N)

Measured memory_bytes: 3564
N = int(input())
B = list(map(int, input().split()))
# print(N, B)

ans = 0
last = 10**5
for i in range(N - 1):
    b = B[i]
    ans += min(last, b)
    last = b
    if i == N - 2:
        ans += b
print(ans)


Measured memory_bytes: 38384
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define ll long long
#define rep(i,l,r)for(ll i=(l);i<(r);i++)
#define max(p,q)((p)>(q)?(p):(q))
#define min(p,q)((p)<(q)?(p):(q))

int main(){
	ll w,a,b;
	scanf("%lld%lld%lld",&w,&a,&b);
	printf("%lld",a+w<b?b-(a+w):b+w<a?a-(b+w):0);
}

Measured memory_bytes: 128
import java.util.*;
public class Main {
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int cnt = 0;
        int A = sc.nextInt();
        int B = sc.nextInt();
        int C = sc.nextInt();
        int X = sc.nextInt();
        for(int i = 0; i <= A; i++){
            for(int j = 0; j <= B; j++){
                for(int k = 0; k <= C; k++){
                    if((500*i) + (100*j) + (50*k) == X){
                        cnt++;
                    }
                }
            }
        }
        System.out.println(cnt);
    }
}


Measured memory_bytes: 23764
#include<bits/stdc++.h>
using namespace std;
int main()
{
	int a,b;
	int s=1;
	scanf("%d %d",&a,&b);
	if(a!=0)
	{
		for(int i=0;i<a;i++)
		{
			s*=100;
		}
		if(b==100)
		{
			b=101;
		}
		printf("%d",s*b);
	}
	else
	{
		if(b==100)
		{
			b=101;
		}
		printf("%d",b);
	}
	return 0;
}

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

int main() {

    while(1){

        string s1,s2;

        cin >> s1;

        if(s1[0] == '.' && s1.size() == 1){
            break;
        }

        cin >> s2;

        string::iterator itr1 = s1.begin(),itr2 = s2.begin();

        bool firstdiff = false;

        bool is_into_quotation = false;

        string ans = "INCOLLECT";

        while(1){

            if(*itr1 == '"' && *itr2 == '"'){
                if(is_into_quotation){
                    is_into_quotation = false;
                }
                else{
                    is_into_quotation = true;
                }
            }

            if(*itr1 != *itr2){
                if(is_into_quotation && !firstdiff){

                    while(*itr1 != '"'){
                        itr1++;
                    }

                    while(*itr2 != '"'){
                        itr2++;
                    }

                    is_into_quotation = false;


                    firstdiff = true;
                }
                else{
                    ans = "DIFFERENT";
                    break;
                }
            }

            itr1++; itr2++;

            if(itr1 == s1.end() && itr2 == s2.end()){
                if(firstdiff){
                    ans = "CLOSE";
                }
                else{
                    ans = "IDENTICAL";
                }
                break;
            }

        }

        cout << ans << endl;

    }

    return 0;
}

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


void solve(long long X, long long Y, long long Z){
  cout << ((X-Z)/(Y+Z)) << endl;
}

// Generated by 1.1.7.1 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
int main(){
    long long X;
  scanf("%lld",&X);
  long long Y;
  scanf("%lld",&Y);
  long long Z;
  scanf("%lld",&Z);
    solve(X, Y, Z);
    return 0;
}


Measured memory_bytes: 3636
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int a, b, c, d;
  cin >> a >> b >> c >> d;
  
  if(a + b == c + d)
    cout << "Balanced" << endl;
  else if(a + b <= c + d)
    cout << "Right" << endl;
  else
    cout << "Left" << endl;
}


Measured memory_bytes: 256
#include<deque>
#include<queue>
#include<vector>
#include<algorithm>
#include<iostream>
#include<set>
#include<cmath>
#include<tuple>
#include<string>
#include<chrono>
#include<functional>
#include<iterator>
#include<random>
#include<unordered_set>
#include<array>
#include<map>
#include<iomanip>
#include<assert.h>
using namespace std;
typedef long long int llint;
typedef long double lldo;
#define mp make_pair
#define mt make_tuple
#define pub push_back
#define puf push_front
#define pob pop_back
#define pof pop_front
#define fir first
#define sec second
#define res resize
#define ins insert
#define era erase
//cout<<setprecision(20)
//cin.tie(0);
//ios::sync_with_stdio(false);
const llint mod=1000000007;
const llint big=2.19e15+1;
const long double pai=3.141592653589793238462643383279502884197;
const long double eps=1e-15;
template <class T,class U>void mineq(T& a,U b){if(a>b){a=b;}}
template <class T,class U>void maxeq(T& a,U b){if(a<b){a=b;}}
llint gcd(llint a,llint b){if(a%b==0){return b;}else return gcd(b,a%b);}
llint lcm(llint a,llint b){return a/gcd(a,b)*b;}
template<class T> void SO(T& ve){sort(ve.begin(),ve.end());}
template<class T> void REV(T& ve){reverse(ve.begin(),ve.end());}
int LBI(vector<int>&ar,int in){return lower_bound(ar.begin(),ar.end(),in)-ar.begin();}
int UBI(vector<int>&ar,int in){return upper_bound(ar.begin(),ar.end(),in)-ar.begin();}
int main(void){
	//EEEWWW
	int n,ans=0,dp=0;cin>>n;
	string str;cin>>str;
	for(auto it:str){
		if(it=='E'){
			ans++;
			mineq(ans,dp);
		}else{
			dp++;
		}
	}
	cout<<ans<<endl;
	return 0;
}


Measured memory_bytes: 900
#pragma region

#include "bits/stdc++.h"
using namespace std;
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define _rep3(i, begin, end) for (register int i = (begin), i##_end = (end); i < i##_end; i++)
#define _irep3(i, begin, end) for (register int i = (end)-1, i##_begin = (begin); i >= i##_begin; i--)
#define _rep2(i, n) _rep3(i, 0, n)
#define _irep2(i, n) _irep3(i, 0, n)
#define _overload3(_1, _2, _3, name, ...) name
#define rep(...) _overload3(__VA_ARGS__, _rep3, _rep2, )(__VA_ARGS__)
#define irep(...) _overload3(__VA_ARGS__, _irep3, _irep2, )(__VA_ARGS__)
#define out(x) cout << (x) << '\n';
#define debug(x) cerr << #x << " = " << (x) << " (line: " << __LINE__ << ") " << endl;
typedef long long ll;

template <typename T>
istream &operator>>(istream &is, vector<T> &vec) {
  for (auto &v : vec) is >> v;
  return is;
}
template <typename T>
ostream &operator<<(ostream &os, const vector<T> &vec) {
  os << "vec[ ";
  rep(i, vec.size()) i == 0 ? os << vec[i] : os << ", " << vec[i];
  os << " ]";
  return os;
}

#pragma endregion

#define MOD 1000000007
#define INF 2147483647

int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  cout << fixed << setprecision(10);

  ll N, M;
  cin >> N >> M;
  vector<ll> p(M);
  vector<string> S(M);
  rep(i, M) cin >> p[i] >> S[i];

  vector<bool> ac(N, false);
  vector<ll> pe(N, 0);

  rep(i, M) {
    int prob = p[i] - 1;
    if (S[i] == "AC") {
      ac[prob] = true;
    } else {
      if (!ac[prob]) pe[prob]++;
    }
  }

  ll ans1 = 0, ans2 = 0;
  rep(i, N) {
    if (ac[i]) {
      ans1++;
      ans2 += pe[i];
    }
  }

  cout << ans1 << " " << ans2 << "\n";
}


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

int main() {
    int R, C, K;
    cin >> R >> C >> K;
    static ll v[3005][3005];
    rep(i, K) {
        int r, c, va;
        cin >> r >> c >> va;
        r--, c--;
        v[r][c] = va;
    }

    static ll dp[3005][3005][4];
    rep(i, R) rep(j, C) rep(k, 3) dp[i][j][k] = -INF;
    dp[0][0][0] = 0;

    rep(i, R) {
        rep(j, C) {
            for (int k = 2; k >= 0; --k) {
                if (dp[i][j][k] >= 0) {
                    dp[i][j][k + 1] = max(dp[i][j][k + 1], dp[i][j][k] + v[i][j]);
                }
            }
            rep(k, 4) {
                if (dp[i][j][k] >= 0) {
                    if (i + 1 < R)
                        dp[i + 1][j][0] = max(dp[i + 1][j][0], dp[i][j][k]);
                    if (j + 1 < C)
                        dp[i][j + 1][k] = max(dp[i][j + 1][k], dp[i][j][k]);
                }
            }
        }
    }

    ll ans = -INF;
    rep(k, 4) ans = max(ans, dp[R - 1][C - 1][k]);
    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 355528
n,m,x=list(map(int,input().split()))
a=list(map(int,input().split()))
# for 0
c1=0
for i in range(x,n+1):
    if i in a:
        c1+=1
# for n
c2=0
for i in range(x,0,-1):
    if i in a:
        c2+=1
print(min(c1,c2))


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

#define F first
#define S second
#define MP make_pair
#define pb push_back
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()
#define LCM(a, b) (a) / __gcd((a), (b)) * (b)
#define CEIL(a, b) (a)/(b)+(((a)%(b))?1:0)
#define ln '\n'

using namespace std;
using LL = long long;
using ldouble = long double;
using P = pair<int, int>;
using LP = pair<LL, LL>;

static const int INF = INT_MAX;
static const LL LINF = LLONG_MAX;
static const int MIN = INT_MIN;
static const LL LMIN = LLONG_MIN;
static const int MOD = 1e9 + 7;
static const int SIZE = 200005;

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

vector<LL> Div(LL n) {
    vector<LL> ret;
    for(LL i = 1; i * i <= n; ++i) {
        if(n % i == 0) {
            ret.pb(i);
            if(i * i != n) ret.pb(n / i);
        }
    }
    sort(all(ret));
    return ret;
}

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

    string s, t;
    cin >> s >> t;
    vector<int> al[26];
    for(int i = 0; i < s.size(); ++i) {
        al[s[i] - 'a'].pb(i);
    }

    LL res = 0;
    int np = -1;
    for(int i = 0; i < t.size(); ++i) {
        int tmp = t[i] - 'a';
        int p = upper_bound(all(al[tmp]), np) - al[tmp].begin();
        if(p == al[tmp].size()) {
            res += s.size();
            np = 0;
            p = lower_bound(all(al[tmp]), np) - al[tmp].begin();
            if(p == al[tmp].size()) {
                cout << -1 << endl;
                return 0;
            }
        }
        np = al[tmp][p];
    }
    cout << res + np + 1 << endl;

    return 0;
}



Measured memory_bytes: 1228
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.List;
import java.util.StringTokenizer;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        MyScanner in = new MyScanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        C solver = new C();
        solver.solve(1, in, out);
        out.close();
    }

    static class C {
        public void solve(int testNumber, MyScanner in, PrintWriter out) {
            int N = in.nextInt();
            int M = in.nextInt();
            List<C.City> list = new ArrayList<>();
            List<C.City> list2 = new ArrayList<>();
            for (int i = 0; i < M; i++) {
                int P = in.nextInt();
                int Y = in.nextInt();
                C.City c = new C.City(i, P, Y);
                list.add(c);
                list2.add(c);
            }
            list2.sort((o1, o2) -> Integer.compare(o1.Y, o2.Y));
            int[] nos = new int[N + 1];
            for (C.City city : list2) {
                city.no = ++nos[city.P];
            }
            for (C.City city : list) {
                out.printf("%06d%06d\n", city.P, city.no);
            }
        }

        static class City {
            int i;
            int P;
            int Y;
            int no;

            City(int i, int P, int Y) {
                this.i = i;
                this.P = P;
                this.Y = Y;
            }

        }

    }

    static class MyScanner {
        private BufferedReader in;
        private StringTokenizer st;

        public MyScanner(InputStream stream) {
            in = new BufferedReader(new InputStreamReader(stream));
        }

        public String next() {
            while (st == null || !st.hasMoreTokens()) {
                try {
                    String rl = in.readLine();
                    if (rl == null) {
                        return null;
                    }
                    st = new StringTokenizer(rl);
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return st.nextToken();
        }

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

    }
}



Measured memory_bytes: 113016
/******tech_knight18_@7******/
/*I'm_not_the_only_traveller*/
/*who_has_not_repaid_his_debt*/
/*Take_me_back_to_The_Night_We_Met*/
#include<bits/stdc++.h>
using namespace std;
#define lld               long long int
#define ld                long double
#define pb                push_back
#define ppb               pop_back
#define mp                make_pair
#define F                 first
#define S                 second
#define nl                '\n'
#define all(c)            (c).begin(),(c).end()
#define rall(c)           (c).rbegin(),(c).rend()
#define sz(c)             (c).size()
#define tr(x,a)           for(auto &a : x)
#define psnt(x,a)         (x).find(a)!=(x).end()
#define vpsnt(x,a)        find(all(x),a)!=(x).end()
#define lexichar(x,y)     lexicographical_compare(x,x+strlen(x),y,y+strlen(y)) //modify the ranges
#define lexistr(x,y)      lexicographical_compare(x.begin(),x.end(),y.begin(),y.end()) 
#define MOD               1000000007
#define pi                3.1415926536
#define tod               1
#define itr(i,a,b)        for(lld i=a;i<=b;i++)
#define itrn(i,a,b)       for(lld i=a;i>=b;i--)
#define iot(n)            for(lld i=0;i<n;i++)
#define pls(n,arr)        lld arr[n]; iot(n)  cin>>arr[i];
#define bye               fflush(stdout)

typedef pair<lld,lld>     pii;
typedef pair<string,lld>  psi;
template <typename T>
bool mycomp(T x,T y){ 
   return (x==y);  //give your condition here
}
bool paircomp(const pair<lld,lld> &x,const pair<lld,lld> &y){ 
return x.second<y.second;
}

int main(){
       ios_base::sync_with_stdio(false);
             cin.tie(0);
            cout.tie(0);
      lld t=1; cin>>t;  
      map<string,lld> mp;
      while(t--){
         string s; cin>>s;
         mp[s]++;
      }
      cout<<"AC "<<"x "<<mp["AC"]<<nl;
      cout<<"WA "<< "x "<<mp["WA"]<<nl;
      cout<<"TLE "<<"x "<<mp["TLE"]<<nl;
      cout<<"RE "<<"x "<<mp["RE"]<<nl;
}


Measured memory_bytes: 3668
#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
const int INF = 1e9;
const ll LINF = 1e18;
template<class S,class T> ostream& operator << (ostream& out,const pair<S,T>& o){ out << "(" << o.first << "," << o.second << ")"; return out; }
template<class T> ostream& operator << (ostream& out,const vector<T> V){ for(int i = 0; i < V.size(); i++){ out << V[i]; if(i!=V.size()-1) out << " ";} return out; }
template<class T> ostream& operator << (ostream& out,const vector<vector<T> > Mat){ for(int i = 0; i < Mat.size(); i++) { if(i != 0) out << endl; out << Mat[i];} return out; }
template<class S,class T> ostream& operator << (ostream& out,const map<S,T> mp){ out << "{ "; for(auto it = mp.begin(); it != mp.end(); it++){ out << it->first << ":" << it->second; if(mp.size()-1 != distance(mp.begin(),it)) out << ", "; } out << " }"; return out; }

/*
 <url:>
 問題文============================================================
 =================================================================
 解説=============================================================
 ================================================================
 */
int main(void) {
    cin.tie(0); ios_base::sync_with_stdio(false);
    ll A,B,C; cin >> A >> B >> C;
    ll K; cin >> K;
    ll M = max({A,B,C});
    ll TM = M*pow(2,K);
    ll sum = TM + A+B+C-M;
    cout <<sum << endl;
    return 0;
}


Measured memory_bytes: 512
#include <stdio.h>
#include <stdlib.h>
int main(){
  int s=1e9,n,l,i;
  scanf("%d%d",&n,&l);
  for(i=1;i<=n;i++)if(abs(s)>abs(l+i-1))s=l+i-1;
  printf("%d",(n*(l*2+n-1))/2-s);
  return 0;
}

Measured memory_bytes: 128
// ====================================
//   author: M_sea
//   website: https://m-sea-blog.com/
// ====================================
#include <bits/stdc++.h>
#define file(x) freopen(#x".in","r",stdin); freopen(#x".out","w",stdout)
#define debug(...) fprintf(stderr,__VA_ARGS__)
using namespace std;
typedef long long ll;

int read() {
	int X=0,w=1; char c=getchar();
	while (c<'0'||c>'9') { if (c=='-') w=-1; c=getchar(); }
	while (c>='0'&&c<='9') X=X*10+c-'0',c=getchar();
	return X*w;
}

const int N=200000+10;

int n;
struct node { int x,y; } a[N];

ll yui() {
	int rmin=1e9,rmax=0,bmin=1e9,bmax=0;
	for (int i=1;i<=n;++i) {
		rmin=min(rmin,a[i].x),rmax=max(rmax,a[i].x);
		bmin=min(bmin,a[i].y),bmax=max(bmax,a[i].y);
	}
	return 1ll*(rmax-rmin)*(bmax-bmin);
}

ll ui() {
	sort(a+1,a+n+1,[](node p,node q) { return p.x<q.x;} );
	int rmin=a[1].x,rmax=0,bmin=1e9,bmax=0,minb=1e9;
	for (int i=1;i<=n;++i) rmax=max(rmax,a[i].y);
	for (int i=1;i<=n;++i) {
		bmin=min(bmin,a[i].y),bmax=max(bmax,a[i].y);
		minb=min(minb,max(a[n].x,bmax)-min(a[i+1].x,bmin));
	}
	return 1ll*(rmax-rmin)*minb;
}

int main() {
	n=read();
	for (int i=1;i<=n;++i) {
		a[i].x=read(),a[i].y=read();
		if (a[i].x>a[i].y) swap(a[i].x,a[i].y);
	}
	printf("%lld\n",min(yui(),ui()));
	return 0;
}

Measured memory_bytes: 5332
#include <iostream>
#include <cstdio>
#include <map>
#include <string>
//#include<con>
typedef int ll;
typedef long long int li;
const ll MAXN=2e5+51,MOD=998244353;
ll length;
ll pw[MAXN],prefix[MAXN],suffix[MAXN];
char s[MAXN],t[MAXN];
inline ll read()
{
    register ll num=0,neg=1;
    register char ch=getchar();
    while(!isdigit(ch)&&ch!='-')
    {
        ch=getchar();
    }
    if(ch=='-')
    {
        neg=-1;
        ch=getchar();
    }
    while(isdigit(ch))
    {
        num=(num<<3)+(num<<1)+(ch-'0');
        ch=getchar();
    }
    return num*neg;
}
int main()
{
    length=read(),scanf("%s%s",s,t),pw[0]=1,prefix[0]=t[0]-'a';
    for(register int i=1;i<length;i++)
    {
        pw[i]=(li)pw[i-1]*26%MOD;
        prefix[i]=(t[i]-'a'+(li)prefix[i-1]*26%MOD)%MOD;
    }
    for(register int i=length-1,j=0;i>=0;i--,j++)
    {
        suffix[i]=(suffix[i+1]+(li)pw[j]*(s[i]-'a')%MOD)%MOD;
    }
    for(register int i=0,j=length-1;i<length;i++,j--)
    {
        if(suffix[i]==prefix[j])
        {
            return printf("%d\n",(length<<1)-j-1),0;
        }
    }
    printf("%d\n",length<<1);
}

Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <map>
#include <set>
#include <vector>
#include <stack>
#include <queue>
#include <bitset>
#include <algorithm>
#include <numeric>
#include <functional>
using namespace std;

#define Rep(b, e, i) for(int i = b; i <= e; i++)
#define Repr(e, b, i) for(int i = e; i >= b; i--)
#define rep(n, i) Rep(0, n-1, i)
#define repr(n, i) Repr(n-1, 0, i)
#define all(v) (v).begin(), (v).end()
#define pb(x) push_back(x)
#define uniq(x) (x).erase(unique(all(x)),(x).end())

typedef long long ll;
typedef pair<ll, ll> llP;
typedef pair<int, int> intP;
typedef std::priority_queue<int> IntPrioQueue; //Z->A
typedef std::priority_queue<int, std::vector<int>, std::greater<int> > IntReversePrioQueue; //A->Z

const int MAX = 100010;
const double PI = 3.14159265358979323846;
const double EPS = 1e-12;
const int INF = 1<<29;
const int MOD = 1000000007;

int dx4[4]={1,0,-1,0};
int dy4[4]={0,1,0,-1};
int dx8[8]={1,0,-1,1,-1,1,0,-1};
int dy8[8]={1,1,1,0,0,-1,-1,-1};

int as[MAX];

void solve(void){
    int N;
    cin >> N;
    rep(N, i) scanf("%d", &as[i]);
    sort(as, as+N);
    int dif = INF, y = -1;
    rep(N-1, i) {
        if (dif > abs(as[N-1] - as[i] - as[N-1]/2)) {
            y = as[i];
            dif = abs(as[N-1] - as[i] - as[N-1]/2);
        }
    }
    cout << as[N-1] << " " << y << '\n';
}

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


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

#define _USE_MATH_DEFINES
#include<cstdio>
#include <cstring>
#include <cmath>
#include <cstdlib>
#include <deque>
#include <algorithm>
#include <functional>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <utility>
#include <vector>
#include <iterator>
#include<iomanip>
#include<unordered_set>
#include<bitset>
#include<complex>

using namespace std;

#define rep(i,a,b) for(int i=(a), i##_len=(b);i<i##_len;i++)
#define rrep(i,a,b) for(int i=(b)-1;i>=(a);i--)
#define all(c) begin(c),end(c)

#define int ll
#define SZ(x) ((int)(x).size())
#define pb push_back
#define mp make_pair

//typedef unsigned long long ull;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<ll, int> pli;
typedef pair<double, double> pdd;
typedef vector< vector<int> > mat;

template<class T> bool chmax(T &a, const T &b) { if (a < b) { a = b; return true; } return false; }
template<class T> bool chmin(T &a, const T &b) { if (b < a) { a = b; return true; } return false; }

const int INF = sizeof(int) == sizeof(long long) ? 0x3f3f3f3f3f3f3f3fLL : 0x3f3f3f3f;
const int MOD =  (int)1e9 + 7;
const double EPS = 1e-9;



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

	int N;
	int ans = 0;

	cin >> N;

	int cnt = 1;
	while (N != 0)
	{
		ans += cnt;
		N /= 2;
		cnt *= 2;
	}

	cout << ans << endl;

	return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<algorithm>
#include<string>
#include<vector>
#include<cstdlib>
#include<queue>
#include<cmath>
#include<cstdio>

using namespace std;

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


int main(){
    const double PI=3.14159265358979323846;
    double a, b, h, m;
    cin >> a >> b >> h >> m;
    double da = (2 * PI) / (12 * 60);
    double db = (2 * PI) / 60;
    double tha = da * (60 * h + m);
    double thb = db * m;
    double th = max(tha, thb) - min(tha, thb);
    th = min(2 * PI - th, th);
    // cout << tha<< " " << thb << endl;
    // cout << th << endl;

    double ans = sqrt(a * a + b * b - 2 * cos(th) * a * b);
    printf("%.15lf\n", ans);

}


Measured memory_bytes: 4156
#include<cstdio>
#include<algorithm>
using namespace std;
#define MAXN 200010
int p[MAXN],n,T[MAXN],f[MAXN];
bool check(int a,int b,int c)
{
	return (a<b&&b<c)||(b<c&&c<a)||(c<a&&a<b);
}
int main()
{
	int x;
	scanf("%d",&n);
	for(int i=1;i<=n;i++)
	{
		scanf("%d",&x);
		p[x]=i;
	}
	for(int i=n-1;i;i--)
		if(T[i+1]==0)
		{
			if(p[i]>p[i+1])
				T[i]=1,f[i]=i+1;
		}
		else
		{
			if(check(p[f[i+1]],p[i],p[i+1]))
				T[i]=T[i+1],f[i]=f[i+1];
			else T[i]=T[i+1]+1,f[i]=i+1;
		}
	printf("%d\n",T[1]);
}


Measured memory_bytes: 2560
#include <bits/stdc++.h>
const int N = 2e5+10;
const int M =1e9+7;
#define int long long int
using namespace std;
#define fast ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define pb push_back
#define MAX 1e15+1
#define pi  pair<int,int>




int a[4];

signed main(){
    fast;
    int n;
    cin>>n;
    string s,t;
    cin>>s>>t;
    string ans="";
    string p="ab";
    for(int i=0;i<n;i++){
        p[0]=s[i];
        p[1]=t[i];
        ans+=p;

    }
    cout<<ans;


  return 0;



    
 
    
 
 
}



Measured memory_bytes: 256
from collections import deque
K=int(input())
d=deque([_ for _ in range(1,10)])
if K<=9:
  print(K)
  exit()
i=0
while True:
  a=d.popleft()
  i+=1
  if i==K:
    print(a)
    exit()
  if a%10!=0 and a%10!=9:
    d.extend([10*a+(a%10)+i for i in range(-1,2)])
  elif a%10==0:
     d.extend([10*a+i for i in range(2)])
  elif a%10==9:
     d.extend([10*a+i for i in range(8,10)])

Measured memory_bytes: 12008
w, h, n = map(int, input().split())
xys = sorted([list(map(int, input().split())) for _ in range(n)])
y_max = [0]
for _, y in reversed(xys):
  y_max.append(max(y_max[-1], y))
xs = [0] + [x for x, _ in xys]
print(min([xs[i] + y_max[n - i] for i in range(n + 1)]))


Measured memory_bytes: 28444
package main

import (
	"fmt"
)

func Reverse(s string) string {
	r := []rune(s)
	for i, j := 0, len(r)-1; i < j; i, j = i+1, j-1 {
		r[i], r[j] = r[j], r[i]
	}
	return string(r)
}

func main() {
	var n int
	fmt.Scan(&n)
	if n == 0 {
		fmt.Println(0)
		return
	}

	t := 1
	rans := ""
	for n != 0 {
		if n%(2*t) != 0 {
			n -= t
			rans += "1"
		} else {
			rans += "0"
		}
		t *= -2
	}
	fmt.Println(Reverse(rans))
}


Measured memory_bytes: 512
import numpy as np
import itertools
N, M, X = map(int, input().split())
A = np.zeros((N,M))
C = np.zeros(N)
loop = itertools.product(range(0, 2), repeat=N)
minE = 100000000000
for i in range(N):
    c, *a = map(int, input().split())
    C[i] = c
    A[i] = np.array(a)
for num in loop:
    l = np.array(num)
    if(np.sum(l) == 0):
        continue
    cost = np.dot(C, l)
    hemi = np.dot(l, A)
    if(np.all(hemi >= X)):
        if(minE > cost):
            minE = cost
if(minE == 100000000000):
    print("-1")
else:
    print(int(minE))
        

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

int main()
{
#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif

	int a, b, x = 0, y = 0, z = 0; cin >> a >> b;
	int sum = 0;
	if (b > 100 || a > 100)
	{
		cout << "No" << endl;
	}
	if (b % 2 == 1)
	{
		printf("No\n");
		return 0;
	}

	if (b % a == 0)
	{
		x = b / a;
		sum = 4 * x;
		if (sum == b)
		{
			printf("Yes\n");
			return 0;
		}
	}

	if (b == a * 2)
	{
		std::cout << "Yes" << endl;
		return 0;
	}
	y = b / 2;
	if (y > a)
	{
		z = y - a;
		sum = 4 * z;
		a = a - z;
		for (int i = 0; i < a; ++i)
		{
			sum += 2;
		}
		if (sum == b)
		{
			printf("Yes\n");
			return 0;
		}
	}

	cout << "No" << endl;
	return 0;
}

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

int main() {
  int n,t;
  cin >> n;
  int a[101];
  a[0]=0;
  for(int i=1;i<=n;i++){
    cin >> t;
    a[i]=a[i-1]+t;
  }
  int min=a[n];
  for(int i=0;i<=n;i++){
    if(min>abs(a[n]-2*a[i]))min=abs(a[n]-2*a[i]);
  }
  cout << min << endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
const int maxn = 5000, mod = 1e9 + 7;
int n, s[maxn + 10], f[maxn + 10][maxn + 10], sz[maxn + 10];
int ans;
vector<int> g[maxn + 10];

void merge(int x, int y) {
	static int tmp[maxn + 10];
	memset(tmp, 0, sizeof tmp);
	for (int i = 1; i <= sz[x]; ++i)
		for (int j = 1; j <= sz[y]; ++j) {
			(tmp[i + j] += 1ll * f[x][i] * f[y][j] % mod) %= mod;
			tmp[i] -= 1ll * f[x][i] * f[y][j] % mod * s[j] % mod;
			tmp[i] = (tmp[i] + mod) % mod;
		}
	sz[x] += sz[y];
	for (int i = 1; i <= sz[x]; ++i) f[x][i] = tmp[i];
}

void dfs(int p, int fa) {
	f[p][sz[p] = 1] = 1;
	for (int i = 0; i < (int)g[p].size(); ++i) {
		int e = g[p][i];
		if (e != fa) {
			dfs(e, p); merge(p, e);
		}
	}
}

int main() {
	scanf("%d", &n);
	for (int i = 1; i < n; ++i) {
		int l, r; scanf("%d%d", &l, &r);
		g[l].push_back(r); g[r].push_back(l);
	}
	s[0] = 1;
	for (int i = 2; i <= n; i += 2) s[i] = 1ll * s[i - 2] * (i - 1) % mod;
	dfs(1, 0);
	for (int i = 1; i <= n; ++i)
		(ans += 1ll * f[1][i] * s[i] % mod) %= mod;
	printf("%d", ans);
}


Measured memory_bytes: 97280
#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
using namespace std;

int main() {
    int N; cin >> N;
    vector<int> A(N);
    for(int i = 0; i < N; i++) cin >> A[i];
    int res = 1;
    for(int item : A) res = res / __gcd(res, item) * item;
    cout << res << endl;
}

Measured memory_bytes: 1196
#include <stdio.h>

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

Measured memory_bytes: 128
#include <iostream>

using namespace std;

int main()
{
    int n;
    cin>>n;
    long long int sum = 0;
    for(int i = 1; i <= n; i++) {
            if(i % 3 == 0 || i % 5 == 0)
                continue;
        sum = sum + i;
    }
    cout<<sum;
    return 0;
}


Measured memory_bytes: 3192