akhauriyash/Code-Regression huggingface dataset:
import java.io.BufferedReader;
import java.io.Closeable;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.ListIterator;
import java.util.Map.Entry;


import java.util.PriorityQueue;
import java.util.Random;
import java.util.StringTokenizer;
import java.util.TreeMap;
import java.util.TreeSet;


public class Main {
	
	public static void main(String[] args) throws IOException {	
		try(final Scanner sc = new Scanner(System.in)){
			System.out.println(sc.next().replace('?', 'D'));
			
		}
	}

	public static class Scanner implements Closeable {
		private BufferedReader br;
		private StringTokenizer tok;

		public Scanner(InputStream is) throws IOException {
			br = new BufferedReader(new InputStreamReader(is));
		}

		private void getLine() throws IOException {
			while(!hasNext()){
				tok = new StringTokenizer(br.readLine());
			}
		}

		private boolean hasNext() {
			return tok != null && tok.hasMoreTokens();
		}

		public String next() throws IOException {
			getLine();
			return tok.nextToken();
		}

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

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

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

		public int[] nextIntArray(int n) throws IOException {
			final int[] ret = new int[n];
			for(int i = 0; i < n; i++){
				ret[i] = this.nextInt();
			}
			return ret;
		}

		public long[] nextLongArray(int n) throws IOException {
			final long[] ret = new long[n];
			for(int i = 0; i < n; i++){
				ret[i] = this.nextLong();
			}
			return ret;
		}

		public void close() throws IOException {
			br.close();
		}
	}
}


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

int main() {
  int X, N;
  cin >> X >> N;
  vector<int> P(N);
  for (int i=0; i<N; i++){
    cin >> P.at(i);
  }
    bool small = true;
    bool big = true;
  int i=-1;
  int w;
  while(small && big){
    i++;
    small = false;
    big = false;
    for (int j=0; j<N; j++){
      if (X-i == P.at(j))
        small = true;
      if (X+i == P.at(j))
        big = true;
    }
  }
  if (small)
    cout << X+i << endl;
  else
    cout << X-i << endl;

    return 0;
}

Measured memory_bytes: 3624
#include <iostream>
#include <algorithm>
#include <vector>

using namespace std;

int main() {
	int n; cin >> n;
	vector<int> a(n);
	int maxn, maxi = 0;
	for (int i = 0; i < n; ++i) {
		cin >> a[i];
		if (maxi < a[i]) maxi = a[i], maxn = i;
	}
	sort(a.begin(), a.end());
	for (int i = 0; i < n; ++i) {
		if (i == maxn) cout << a[n - 2] << endl;
		else cout << maxi << endl;
	}

	return 0;
}

Measured memory_bytes: 2432
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <stack>
#include <queue>
#include <set>
#include <cmath>
#include <map>
using namespace std;
#define MOD 1000000007
#define ADD(X,Y) ((X) = ((X) + (Y)%MOD) % MOD)
typedef long long i64; typedef vector<int> ivec; typedef vector<string> svec;

int H, W;
char A[105][105];
short dp[102][102][102][102];
int acc[105][105];
int ey = 0, ex = 0;

int isect(int ya1, int yb1, int xa1, int xb1, int ya2, int yb2, int xa2, int xb2)
{
	ya1 = max(ya1, ya2);
	xa1 = max(xa1, xa2);
	yb1 = min(yb1, yb2);
	xb1 = min(xb1, xb2);
	if (ya1 >= yb1 || xa1 >= xb1) return -1;
	//printf("%d\n", acc[yb1][xb1] - acc[yb1][xa1] - acc[ya1][xb1] + acc[ya1][xa1]);
	return acc[yb1][xb1] - acc[yb1][xa1] - acc[ya1][xb1] + acc[ya1][xa1];
}

int solve(int ya, int yb, int xa, int xb)
{
	if (xa >= xb || ya >= yb) return 0;
	//printf("%d %d %d %d\n", ya, yb, xa, xb);

	if (dp[ya][yb][xa][xb] == -1) {
		int byb = H - (ey - ya), bya = yb - ey - 1;
		int bxb = W - (ex - xa), bxa = xb - ex - 1;
	//	printf("%d %d %d %d\n", bya, byb, bxa, bxb);
		int ans = 0;
		if (ya > 0) {
			int tmp = isect(ya - 1, ya, xa, xb, bya, byb, bxa, bxb);
			if (tmp >= 0) ans = max(ans, solve(ya - 1, yb, xa, xb) + tmp);
		}
		if (xa > 0) {
			int tmp = isect(ya, yb, xa - 1, xa, bya, byb, bxa, bxb);
			if (tmp >= 0) ans = max(ans, solve(ya, yb, xa - 1, xb) + tmp);
		}

		if (yb < H) {
			int tmp = isect(yb, yb + 1, xa, xb, bya, byb, bxa, bxb);
			if (tmp >= 0) ans = max(ans, solve(ya, yb + 1, xa, xb) + tmp);
		}
		if (xb < W) {
			int tmp = isect(ya, yb, xb, xb + 1, bya, byb, bxa, bxb);
			if (tmp >= 0) ans = max(ans, solve(ya, yb, xa, xb + 1) + tmp);
		}

		dp[ya][yb][xa][xb] = (short)ans;
	}
	return (int)dp[ya][yb][xa][xb];
}

int main()
{
	scanf("%d%d", &H, &W);
	for (int i = 0; i < H; ++i) scanf("%s", &(A[i]));

	for (int i = 0; i < H; ++i) for (int j = 0; j < W; ++j) if (A[i][j] == 'E') {
		ey = i; ex = j;
	}
	for (int i = 0; i <= H; ++i) {
		for (int j = 0; j <= W; ++j) {
			acc[i][j] = 0;
			if (i > 0 && j > 0 && A[i - 1][j - 1] == 'o') acc[i][j] = 1;
		}
	}
	for (int i = 0; i <= H; ++i) {
		for (int j = 1; j <= W; ++j) {
			acc[i][j] += acc[i][j - 1];
		}
	}
	for (int i = 1; i <= H; ++i) {
		for (int j = 0; j <= W; ++j) {
			acc[i][j] += acc[i - 1][j];
		}
	}
	for (int i = 0; i <= H; ++i) {
		for (int j = 0; j <= H; ++j) {
			for (int k = 0; k <= W; ++k) {
				for (int l = 0; l <= W; ++l) dp[i][j][k][l] = -1;
			}
		}
	}
	int ret = solve(ey, ey + 1, ex, ex + 1);
	printf("%d\n", ret);
	return 0;
}


Measured memory_bytes: 208000
#include <bits/stdc++.h>
#define fi first
#define se second
#define forn(i,n) for(int i=0; i< (int)n; ++i)
#define for1(i,n) for(int i=1; i<= (int)n; ++i)
#define fore(i,l,r) for(int i=(int)l; i<= (int)r; ++i)
#define ford(i,n) for(int i=(int)(n) - 1; i>= 0; --i)
#define fored(i,r,l) for(int i=(int)r; i>= (int)l; --i)
#define pb push_back
#define el '\n'
#define d(x) cout<< #x<< " " << x<<el
#define INF (1LL<<62)

using namespace std;

typedef long long ll;
typedef pair<int,int> ii;
typedef pair<long long,long long> pll;
typedef tuple<long double,int,int> tdii;
const double PI = atan(1)*4;
const int MAXN = 1e3 + 10;
const int MOD = 1e9+7;
const double EPS = 1e-9;
int dp[MAXN][MAXN];
int h, w, u, v, ans;
bool seen[MAXN];
char g[MAXN][MAXN];

int main (){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL); cout.tie(NULL);
    cin>>h>>w;
    for1(i,h){
        for1(j,w){
            cin>>g[i][j];
        }
    }
    g[0][0] = '.';
    forn(i,h+1){
        g[0][i] = g[i][0] = '.';
    }
    dp[1][1] = 1;
    for1(i,h){
        for1(j,w){
            if(i==1 && j==1) continue;
            if(g[i][j]=='.') dp[i][j] = (g[i-1][j]=='.' ? dp[i-1][j] : 0) +(g[i][j-1]=='.' ? dp[i][j-1] : 0 );
            dp[i][j] %= MOD;
        }
    }
    cout<<dp[h][w]<<el;

}


Measured memory_bytes: 5376
#include <iostream>
#include <string>
 
using namespace std;
int main(){
string s;
cin >> s;
 
int ans=0;
char x = s[0];
for(auto i=s.begin();i<s.end();i++){
if((*i)==x){
continue;
}else{
x=(*i);
ans++;
}
}
cout << ans;
 
return 0;}

Measured memory_bytes: 512
#include <algorithm>
#include <complex>
#include <cstdlib>
#include <ctime>
#include <time.h>
#include <iomanip>
#include <iostream>
#include <map>
#include <math.h>
#include <queue>
#include <random>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
#include <numeric>
#include <limits>
#include <type_traits>

using namespace std;
#define SAY_YES cout << "YES" << endl;
#define SAY_Yes cout << "Yes" << endl;
#define SAY_NO cout << "NO" << endl;
#define SAY_No cout << "No" << endl;
#define IFYES(TRUE_OR_FALSE)   \
    if (TRUE_OR_FALSE)         \
    {                          \
        cout << "YES" << endl; \
    }                          \
    else                       \
    {                          \
        cout << "NO" << endl;  \
    }
#define IFYes(TRUE_OR_FALSE)   \
    if (TRUE_OR_FALSE)         \
    {                          \
        cout << "Yes" << endl; \
    }                          \
    else                       \
    {                          \
        cout << "No" << endl;  \
    }
#define IFyes(TRUE_OR_FALSE)   \
    if (TRUE_OR_FALSE)         \
    {                          \
        cout << "yes" << endl; \
    }                          \
    else                       \
    {                          \
        cout << "no" << endl;  \
    }
#define DEBUG_OUTPUT_ARRAY(XXX, ONE)                            \
    for (int i = 0; i < (ONE); i++)                             \
    {                                                           \
        cout << "DEBUG: i = " << i << " -> " << XXX[i] << endl; \
    }
#define DEBUG_OUTPUT_ARRAY2(XXX, ONE, TWO)                             \
    for (int i = 0; i < (ONE); i++)                                    \
    {                                                                  \
        cout << "<<< i = " << i << " >>>" << endl;                     \
        for (int j = 0; j < (TWO); j++)                                \
        {                                                              \
            cout << "DEBUG: j = " << j << " -> " << XXX[i][j] << endl; \
        }                                                              \
    }
#define DEBUG_OUTPUT_ARRAY2_BOX(XXX, ONE, TWO) \
    for (int i = 0; i < (ONE); i++)            \
    {                                          \
        cout << i << "  ";                     \
        for (int j = 0; j < (TWO); j++)        \
        {                                      \
            cout << XXX[i][j] << " ";          \
        }                                      \
        cout << endl;                          \
    }

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


const long long int mod = 1000000007;
const long long int INF = 1e18;

long long int N,M,A[200200]={},memo[10]={},res=0,cou=0,num;
string S;
int main()
{
    cout << fixed << setprecision(18);
	cin>>N;
	for(long long int i = 0; i < N; i++){
		cin>>A[i];
		memo[min(A[i]/400,8LL)]++;
	}
	
	for(long long int i = 0; i <= 7; i++){
		if(memo[i]>0){res++;}
	}
	cout<<max(res,1LL)<<" "<<max(1LL,res+memo[8])<<endl;
}


Measured memory_bytes: 256
import java.awt.Point;
import java.util.ArrayList;
import java.util.Scanner;

public class Main {

	static Scanner sc = new Scanner(System.in);
	static int[] DR = { 1, 0, -1, 0 };
	static int[] DC = { 0, 1, 0, -1 };

	public static void main(String[] args) throws Exception {
		while (true) {
			int W = sc.nextInt();
			if (W == 0) break;
			int H = sc.nextInt();
			boolean[][] f = new boolean[H + 2][W + 2];
			ArrayList<Point> ps = new ArrayList<Point>();
			for (int i = 0; i < H; ++i) {
				char[] line = sc.next().toCharArray();
				for (int j = 0; j < W; ++j) {
					if (line[j] == '@') {
						ps.add(new Point(i + 1, j + 1));
					} else if (line[j] == '.') {
						f[i + 1][j + 1] = true;
					}
				}
			}
			int ans = 1;
			while (!ps.isEmpty()) {
				ArrayList<Point> next = new ArrayList<Point>();
				for (Point p : ps) {
					for (int i = 0; i < 4; ++i) {
						int nr = p.x + DR[i];
						int nc = p.y + DC[i];
						if (f[nr][nc]) {
							++ans;
							f[nr][nc] = false;
							next.add(new Point(nr, nc));
						}
					}
				}
				ps = next;
			}
			System.out.println(ans);
		}
	}
}

Measured memory_bytes: 29304
import sys

n=int(input())
a=list(map(int,input().split()))
b=list(map(int,input().split()))

sum_a=sum(a)
sum_b=sum(b)
c=[]
cnt=0
ans=0
d=0
if(sum_a<sum_b):
    print(-1)
else:
    for i in range(n):
        if a[i]<b[i]:
            cnt+=1
            d+=(b[i]-a[i])
        else:
            c.append(a[i]-b[i])
    if cnt==0:
        print(cnt)
        sys.exit()
    cc=sorted(c,reverse=True)
    cc_sum=0
    for i in range(n):
        cc_sum+=cc[i]
        if cc_sum>d:
            cnt+=(i+1)
            break
    print(cnt)

Measured memory_bytes: 24252
#include <iostream>

int d[35][35];
int c[510][510];
int a[3][35];

int main(){
    int n, c;
    std::cin >> n >> c;
    for(int i = 0; i < c; i++){
        for(int j = 0; j < c; j++){
            std::cin >> d[i][j];
        }
    }
    for(int i = 0; i < n; i++){
        for(int j = 0; j < n; j++){
            int t;
            std::cin >> t;
            a[(i+j)%3][t-1]++;
        }
    }
    int ans = 1e9;
    for(int i = 0; i < c; i++){
        for(int j = 0; j < c; j++){
            if(i == j) continue;
            for(int k = 0; k < c; k++){
                int count = 0;
                if(i == k || j == k) continue;
                int t[3] = {i, j, k};
                for(int l = 0; l < c; l++){
                    for(int m = 0; m < 3; m++){
                        count += d[l][t[m]]*a[m][l];
                    }
                }
                ans = std::min(ans, count);
            }
        }
    }
    std::cout << ans << std::endl;
}


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

int main(void){
 
    string s;
    cin >> s;
    
    if(s == "SUN"){
        cout << 7 <<endl;
    }
    else if(s == "MON"){
        cout << 6 << endl;
    }
    else if(s == "TUE"){
        cout << 5 <<endl;
    }
    else if(s == "WED"){
        cout << 4 <<endl;
    }
    else if(s == "THU"){
        cout << 3 <<endl;
    }
    else if(s == "FRI"){
        cout << 2 <<endl;
    }
    else{
        cout << 1 <<endl;
    }
}

Measured memory_bytes: 3592
#include <iostream>
using namespace std;
#define MAX 100005
#define NIL -1

struct Node {
  int p, l, r;
};

Node T[MAX];
int n, D[MAX];

void print(int u) {
  int i, c;
  cout << "node " << u << ": ";
  cout << "parent = " << T[u].p << ", ";
  cout << "depth = " << D[u] << ", ";

  if (T[u].p == NIL) {
    cout << "root, ";
  } else if (T[u].l == NIL) {
    cout << "leaf, "; 
  } else {
    cout << "internal node, ";
  }

  cout << "[";

  for (i = 0, c = T[u].l; c != NIL; i++, c = T[c].r) {
    if (i) {
      cout << ", ";
    }
    cout << c;
  }
  cout << "]" << endl;
}

void rec(int u, int p) {
  D[u] = p;
  if (T[u].r != NIL ) {
    rec(T[u].r, p);
  }
  if (T[u].l != NIL) {
    rec(T[u].l, p + 1);
  }
}

int main() {
  int i, j, d, v, c, l, r;
  cin >> n;
  for (i = 0; i < n; i++) {
    T[i].p = T[i].l = T[i].r = NIL;
  }

  for (i = 0; i < n; i++) {
    cin >> v >>d;
    for (j = 0; j < d; j++) {
      cin >> c;
      if (j == 0) {
        T[v].l = c;
      } else {
        T[l].r = c;
      }
      l = c;
      T[c].p = v;
    }
  }

  for (i = 0; i < n; i++) {
    if (T[i].p == NIL) {
      r = i;
    }
  }

  rec(r, 0);

  for (i = 0; i < n; i++) {
    print(i);
  }

  return 0;
}



Measured memory_bytes: 7744
pub fn read<T: std::str::FromStr>() -> T {
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).ok();
    s.trim().parse().ok().unwrap()
}

pub fn read_vec<T: std::str::FromStr>() -> Vec<T> {
    read::<String>()
        .split_whitespace()
        .map(|e| e.parse().ok().unwrap())
        .collect()
}

pub fn read_vec2<T: std::str::FromStr>(n: usize) -> Vec<Vec<T>> {
    (0..n).map(|_| read_vec()).collect()
}

pub fn read_col<T: std::str::FromStr>(n: usize) -> Vec<T> {
    (0..n).map(|_| read()).collect()
}

fn main() {
    let n: usize = read();
    let mat: Vec<Vec<u64>> = read_vec2(n);
    let mut ans: u64 = 0;
    for i in 0..n {
        for j in i + 1..n {
            let mut b = true;
            for k in 0..n {
                if i == k || k == j {
                    continue;
                }
                if mat[i][j] > mat[i][k] + mat[k][j] {
                    println!("-1");
                    return;
                }
                if mat[i][j] == mat[i][k] + mat[k][j] {
                    b = false;
                }
            }
            if b {
                ans += mat[i][j];
            }
        }
    }

    println!("{}", ans);
}


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

void b_comparison(void) {
	string a, b;
	string o_msg="EQUAL";
	cin >> a >> b;
	if (a.size() > b.size()) o_msg = "GREATER";
	else if (a.size() < b.size()) o_msg = "LESS";
	else {
		for (int i = 0; i < a.size(); i++) {
			if (a[i] == b[i])     continue;
			else if (a[i] > b[i]) {
				o_msg = "GREATER";
				break;
			}
			else {
				o_msg = "LESS";
				break;
			}
		}
	}
	cout << o_msg << endl;
}

int main()
{
	b_comparison();
    return 0;
}

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

#define ll long long
#define vi vector<int>
#define REP(i, n) for (int i = 0; i < n; i++)
#define check cout << "OK" << endl

int main() {
  REP(i, 5) {
    int a;
    cin >> a;
    if (a == 0)
      cout << i + 1 << endl;
  }

  return 0;
}

Measured memory_bytes: 3524
while True :
	a = raw_input().split()
	x = int(a[0])
	y = int(a[1])
	if x == 0 and y == 0 :
		break
	elif x < y :
		print u"%d %d" % (x, y)
	else :
		print u"%d %d" % (y, x)

Measured memory_bytes: 6324
#include<bits/stdc++.h>
#define pb push_back
#define F first
#define S second
using ll = long long;
#define ull unsigned ll
#define endl "\n"
#define vi vector<int>
#define vl vector<ll>
#define all(v) (v).begin(),(v).end()
#define mst(a,b) memset(a,b,sizeof(a))
#define pii pair<int,int>
#define pll pair<ll,ll>
#define ppi pair<int, pii>
#define mt make_tuple
#define eb emplace_back
using namespace std;

const int N = 5e5 + 5, mod = 1e9 + 7;
const int inf = 1e9;

void solve(){
    int r, g, b, k;
    cin >> r >> g >> b >> k;
    while(r >= g){
        g *= 2;
        k--;
    }
    while(g >= b){
        b *= 2;
        k--;
    }
    if(k < 0){
        cout << "No" << endl;
        return;
    }
    cout << "Yes" << endl;
}

int main(){
    ios_base::sync_with_stdio(0);
    cin.tie(0);//cout.tie(0);
    //freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);
    ll t,p;
    t=1;
    //cin>>t;
    for(p=1;p<=t;p++){
        solve();
    }
    return 0;
}


Measured memory_bytes: 3644
#include <bits/stdc++.h>
#define rep(i, start, end) for (long long i = start; i < end; ++i)
#define all(x) (x).begin(), (x).end()
#define len(x) ((long long)(x).size())
#define g(a, b) __gcd((a), (b))
#define l(a, b) ((a) / __gcd((a), (b)) * (b))
using namespace std;
using ll = long long;
using ld = long double;
using vll = vector<ll>;
using vllvll = vector<vll>;
template<class T>void print1d(T x,ll n=-1){if(n==-1)n=x.size();rep(i,0,n){cout<<x[i]<<' ';}cout<<'\n';}
template<class T>void print2d(T x,ll r=-1,ll c=-1){if(r==-1)r=x.size();if(c==-1)c=x[0].size();rep(i,0,r)print1d(x[i],c);}
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; }
template<class T, class U>T rem(T a, U b) { return a - b*floor(a/b); }
template<class T>ld deg2rad(T deg) { return M_PI * deg / 180.0; }
template<class T>ld rad2deg(T rad) { return 180.0 * rad / M_PI; }
const long double pi = M_PI;
const long long big = 1LL << 50;
const long long inf = 1LL << 60;
const long long mod = 1e9 + 7;


int main()
{

    ll N;
    cin >> N;
    vll A(N);
    rep(i, 0, N) cin >> A[i];
    vll counts(110000, 0);
    counts[0] = 3;
    ll ans = 1;
    rep(i, 0, N) {
        ans = ans*counts[A[i]] % mod;
        counts[A[i]]--;
        counts[A[i]+1]++;
    }
    cout << ans << endl;
}



Measured memory_bytes: 1920
#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cmath>
#include<string>
#include<vector>
#include<list>
#include<set>
#include<map>
#include<queue>
#include<stack>
#include<cctype>
#include<climits>
#include<bitset>
#include<bits/stdc++.h>
#define ld long double
#define ll long long int
#define ull unsigned long long intS
#define rep(i,n) for(int i=0;i<n;i++)
#define fin(ans) cout<<(ans)<<endl
#define in(n) cin>>n>>
#define INF INT_MAX
#define vi vector<int>
#define vc vector<char>
#define vs vector<string>
#define vpii vector<pair<int,int> >
#define vvi vector<vector<int> >
#define vvc vector<vector<char> >
#define vvs vector<vector<string> >
#define P 1000000007
using namespace std;
template<class T> inline bool chmax(T& a,T b){if(a<b){a=b;return 1;}return 0;}
template<class T> inline bool chmin(T& a,T b){if(a>b){a=b;return 1;}return 0;}
const long long LLINF=1LL<<60;
//set<int>::iterator it;


int main(void){ios::sync_with_stdio(false);cin.tie(0);
//////////////////////////////////////////////////////
    
    
       int n,a,b,sum;
    
    cin >> n >> a >> b;
    
    sum = a*n;
    
    if (sum < b){
    
        cout << sum << endl;
    }else {
    
        cout << b << endl;
    
    }
    
    /*79
    string s;
    
    cin >> s;
    
    if ((s[0]==s[1] && s[1]==s[2])||(s[1]==s[2] && s[2]==s[3])){
    
        cout << "Yes" << endl;
    
    }else{
        
        cout << "No" << endl;
        
    }
    
    */
    
    /*78
    char x,y;
    
    cin >> x >> y;
    
    if((x-y)>0){
        
        cout << '>' << endl;
        
    }else if (x==y){
        
        cout << '=' << endl;
        
    }else{
        
        cout << '<' << endl;
        
    }
    */
    
    /*int s[3][2];
    
    rep(i,3){
        rep(j,3){
            
            cin >> s[i][j];
            
        }
    }
    
    if ((s[0][0]==s[2][1])&&(s[1][0]==s[1][1])&&(s[2][0]==s[0][1])){
    
    cout << "Yes" << endl;
    
    }else{
    
    cout << "No" << endl;
    
    }
    */
/////////////////////////////////////////////////////
return 0;}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define endl '\n'
#define ll long long
#define double long double
using namespace std;
const ll inf = 1000000000000000000;
const ll mod = 1000000007;

ll s, fact[200005], ans, kol;
ll bin_pow(ll elem, ll step) {
    if (step == 0)
        return 1;
    if (step == 1)
        return elem;
    if (step % 2 == 0) {
        ll p = bin_pow(elem, step / 2);
        p %= mod;
        return ((p * p) % mod);
    }
    else
        return (((bin_pow(elem, step - 1) % mod) * elem) % mod);
}
ll inv(ll x) {
    return (bin_pow(x, mod - 2));
}
ll cnk(ll n, ll k) {
    return ((((fact[n] * inv(fact[n - k])) % mod) * inv(fact[k])) % mod);
}

int main() {
    ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
    cin >> s;
    fact[0] = fact[1] = 1;
    for (ll i = 2; i <= 200000; ++i)
        fact[i] = (fact[i - 1] * i) % mod;
    kol = 1;
    while (kol * 3 <= s) {
        ans += cnk(kol + s - kol * 3 - 1, s - kol * 3);
        //cout << ans << endl;
        ans %= mod;
        ++kol;
    }
    cout << ans;
    return 0;
}


Measured memory_bytes: 5136
#include "bits/stdc++.h"
#define rep(i,n) for(int i=0;i<(n);i++)
using namespace std;
int A[5];
 
 int main()
 {
	 cin >> A[0]>>A[1]>>A[2]>>A[3]>>A[4];
	 int ans;
	 rep(i, 5)
	 {
		 if (A[i] == 0) 
{ ans = i+1;
		 break;
}
	}
	 cout << ans << endl;
	return 0;
}


Measured memory_bytes: 3584
import sys
input = sys.stdin.readline
from operator import itemgetter
sys.setrecursionlimit(10000000)
INF = 10**30
from collections import deque

def main():
    n, m = list(map(int, input().strip().split()))
    G = [[] for i in range(n)]
    for i in range(m):
        a, b = list(map(int, input().strip().split()))
        G[a-1].append(b-1)
        G[b-1].append(a-1)
    q = deque()
    q.append((0, -1))
    visited = [False] * (n)
    shirube = [-1] * n
    visited[0] = True
    while len(q) != 0:
        src, prev = q.popleft()
        # print(src, prev)
        shirube[src] = prev
        for node in G[src]:
            if not visited[node]:
                visited[node] = True
                q.append((node, src))
    # print(G)
    print('Yes')
    for i in range(1, n):
        print(shirube[i]+1)


if __name__ == '__main__':
    main()


Measured memory_bytes: 94800
n, k, q = map(int, input().split())
A = [int(input()) for _ in range(q)]
C = {i: 0 for i in range(1, 1 + n)}
for a in A:
    C[a] += 1
for i in range(1, 1 + n):
    p = k - (q - C[i])
    print("Yes" if p > 0 else "No")


Measured memory_bytes: 19084
n = int(input())
x = list(map(int,input().split()))
m,k = map(int,input().split())
a = list(map(int,input().split()))
b = []
x2 = []
c = []
for i in range(1,n):
  b.append(i-1)
  x2.append(x[i]-x[i-1])
for i in range(m):
  to = a[i]-1
  b[to],b[to-1] = b[to-1],b[to]
c = [-1] * (n-1)
for i in range(n-1):
  c[b[i]] = i
for i in range(60):
  x3 = [0]*(n-1)
  if k&(1<<i):
    for i in range(n-1):
      x3[c[i]] = x2[i]
    x2 = x3
  c2 = [-1] * (n-1)
  for i in range(n-1):
    c2[i] = c[c[i]] 
  c = c2
s = x[0]
print(s)
for i in x2:
  s += i
  print(s)

Measured memory_bytes: 109140
import java.util.HashSet;
import java.util.Scanner;
import java.util.Set;

public class Main {

	public static void main(final String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		Set<String> S = new HashSet<>();
		for(int i = 0; i < N; i++) {
			S.add(sc.next());
		}
		sc.close();
		System.out.println(S.size());
	}
}


Measured memory_bytes: 66540
#include<bits/stdc++.h>
using namespace std;
#define int long long
#define itn int
#define mod 1000000007
#define INFi 2147483647
#define INFl 9223372036854775807LL
#define fi first
#define se second
#define be begin()
#define en end()
int abs(int a,int b){
    return max(a,b)-min(a,b);
}
signed main(){
// __builtin_ctz(N); Nを２で何回割り切れるかを返す
//(n+1)*n/2; １からNまでの総和を求める式
    cin.tie(0);
    ios::sync_with_stdio(false);
    int a,b;
    cin>>a>>b;
    if(a*500>=b) cout<<"Yes";
    else cout<<"No";
    cout<<"\n";
}


Measured memory_bytes: 256
# でつoO(YOU PLAY WITH THE CARDS YOU'RE DEALT..)
import sys
def main(N, A, X):
    # dp[i][j][k] = i番目のカードまで見て、k枚使って合計がjになる組み合わせの数
    dp = [[[0] * (N + 1) for __ in range(A * N + 5)] for _ in range(N + 1)]
    dp[0][0][0] = 1
    for i in range(1, N + 1):
        x = X[i - 1]
        for j in range(A * N + 1):
            for k in range(i + 1):
                dp[i][j][k] += dp[i - 1][j][k]
                if j >= x and k >= 1:
                    dp[i][j][k] += dp[i - 1][j - x][k - 1]

    ans = 0
    for n in range(1, N + 1):
        ans += dp[N][A * n][n]
    print(ans)

if __name__ == '__main__':
    input = sys.stdin.readline
    N, A = map(int, input().split())
    *X, = map(int, input().split())
    main(N, A, X)


Measured memory_bytes: 135736
package main

import (
	"bufio"
	"fmt"
	"os"
)

var sc = bufio.NewScanner(os.Stdin)

// 1行読み込み
func nextLine() string {
	sc.Scan()
	return sc.Text()
}

func main() {
	// scannerの挙動を改行区切り → 空白区切りに変更
	sc.Split(bufio.ScanWords)
	name := nextLine()
	fmt.Println(name[0:3])
}

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

int main(){
  int K, A, B; cin>> K>> A>> B;
  
  bool ans = false;
  for(int i = A; i <= B; i++){
    if(i % K == 0)
      ans = true;
  }
  
  if(ans){
    cout << "OK" << endl;
  }else{
    cout << "NG" << endl;
  }
}

Measured memory_bytes: 3592
k,n = map(int,input().split())
li = list(map(int,input().split()))
ali = []
for i in range(n-1):
    ali.append(li[i+1] - li[i])
a = ali.index(max(ali))
if li[a] + k - li[a+1] <= li[n-1] - li[0]:
    print(li[a] + k - li[a+1])
else:
    print(li[n-1] - li[0])

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

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

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

	cout << endl;
}


Measured memory_bytes: 256
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.Scanner;

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

    static class DMatchMatching {
        int[] cnt = new int[10];
        int[] memo = new int[10000 + 1];

        public void solve(int testNumber, Scanner in, PrintWriter out) {
            int n = Integer.parseInt(in.next());
            int M = Integer.parseInt(in.next());
            Arrays.fill(cnt, 1 << 29); // INF
            int[] use = new int[]{1 << 29, 2, 5, 5, 4, 5, 6, 3, 7, 6};
            while (in.hasNext()) {
                int x = Integer.parseInt(in.next());
                cnt[x] = use[x];
            }
            Arrays.fill(memo, -1);
            StringBuilder ans = new StringBuilder();
            while (n > 0) {
                for (int i = 9; i > 0; i--) {
                    if (dfs(n - cnt[i]) + 1 == dfs(n)) {
                        n -= cnt[i];
                        ans.append(i);
                        break;
                    }
                    if (i == 1) return;
                }
            }
            out.println(ans);
        }

        int dfs(int n) {
            if (n < 0) return -2;
            if (n == 0) return 0;
            if (memo[n] == -1) {
                for (int i = 1; i < 10; i++) {
                    memo[n] = Math.max(memo[n], dfs(n - cnt[i]) + 1);
                }
            }
            return memo[n];
        }

    }
}



Measured memory_bytes: 23892
#include<bits/stdc++.h>
using namespace std;
#define int long long
signed main(){
  int n,m;
  while(cin>>n>>m,n||m){
    int o[n];
    for(int i=0;i<n;i++) cin>>o[i];
    int d[m];
    for(int i=0;i<m;i++) cin>>d[i];
    int ans=0,pos=0;
    while(pos<n-1){
      pos+=d[ans++];
      pos+=o[pos];
    }
    cout<<ans<<endl;
  }
  return 0;
}

Measured memory_bytes: 3064
#include <bits/stdc++.h>
#define REP(i, n) for(int i = 0; i < (n); i++)
#define REP1(i, n) for(int i = 1; i <= (n); i++)
#define REPD(i,a,b) for (int i=(a);i<(b);i++)
#define ALL(v) (v).begin(), (v).end()
using namespace std;
typedef long long ll;
typedef vector<string> vs;
typedef vector<bool> vb;
typedef vector<vb> vvb;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef set<int> si;
typedef vector<ll> vll;
typedef vector<vll> vvll;
typedef pair<int, int> pi;
typedef queue<int> qi;
typedef queue<pi> qpi;
typedef pair<ll, ll> pll;
typedef queue<pll> qpll;
typedef vector<pi> vpi;
typedef vector<pll> vpll;
const int mod = 1000000007;
const int INF = 1001001001;
// 小数点　<< fixed << setprecision(0) <<
// sort降順　sort(ALL(),greater<int>());
// 円周率　M_PI
// 文字判定　isupper islower
// 順列　do {} while(next_permutation(ALL(X)));
// 最大値　LLONG_MAX
// a内でx以上　auto iter = lower_bound(ALL(a), x);
// a内でxより大きい　auto iter = upper_bound(ALL(a), x);
int dx[8] = {1, 0, -1, 0, 1, 1, -1, -1};
int dy[8] = {0, 1, 0, -1, 1, -1, 1, -1};
struct edge {
    int from; //出発点
    int to;   //到達点
    int cost; //移動コスト
};
typedef struct edge se;
typedef vector<edge> ve;
unsigned euclidean_gcd(unsigned a, unsigned b) {
  if(a < b) return euclidean_gcd(b, a);
  unsigned r;
  while ((r=a%b)) {
    a = b;
    b = r;
  }
  return b;
}

int main() {
  int n,m,x;
  cin >> n >> m >> x;
  vi c(n);
  vvi a(n,vi(m));
  REP(i,n) {
    cin >> c[i];
    REP(j,m) {
      cin >> a[i][j];
    }
  }
  int ans_cost=INF;
  REP(i,1<<n) {
    vi check(n,0);
    int temp_cost=0;
    REP(j,n) {
      if((i>>j)&1) {
        temp_cost+=c[j];
        REP(k,m) {
          check[k]+=a[j][k];
        }
      }
    }
    bool flg=true;
    REP(l,m) {
      if(check[l]<x) flg=false;
    }
    if(flg) {
      ans_cost=min(ans_cost,temp_cost);
    }
  }
  if(ans_cost==INF) {
    cout << "-1" << endl;
  } else {
    cout << ans_cost << endl;
  }
  return 0;
}


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

typedef long long ll;

int main(){
	static ll n;
	static ll a[100010];
	scanf("%lld",&n);
	for(int i = 0 ; i < n ; i ++){
		scanf("%d",&a[i]);
	}
	
	static ll b[100010];
	sort(a,a+n);
	reverse(a,a+n);
	ll ret = 0;
	if(n%2 == 0){
		for(int j = 0 ; j+1 < n/2 ; j ++){
			ret += 2*a[j];
			ret -= 2*a[n-1-j];
		}
		ret += a[n/2-1];
		ret -= a[n/2];
	}
	else {
		for(int j = 0 ; j < n/2 ; j ++){
			ret += 2*a[j];
		}
		ret -= a[n/2];
		ret -= a[n/2+1];
		for(int j = n/2+2 ; j < n ; j ++){
			ret -= 2*a[j];
		}
		ll ret2 = ret;
		ret = 0;
		for(int j = 0 ; j+1 < n/2 ; j ++){
			ret += 2*a[j];
		}
		ret += a[n/2-1];
		ret += a[n/2];
		for(int j = n/2+1 ; j < n ; j ++){
			ret -= 2*a[j];
		}
		ret = max( ret , ret2 );
	}
	cout << ret << endl;
}
	

Measured memory_bytes: 1152
fn main(){
    let n: i32 = read();
    let a: i32 = read();
    let b: i32 = read();
    let s: String = read();
    let mut kokunai: i32 = 0;
    let mut kaigai: i32 = 0;
    for c in s.chars() {
        if c == 'a' && a + b > kokunai + kaigai {
            kokunai += 1;
            println!("Yes");
        } else if c == 'b' && a + b > kokunai + kaigai && b > kaigai {
            kaigai += 1;
            println!("Yes");
        } else {
            println!("No");
        }
    } 
}

use std::io::stdin;
use std::io::Read;
use std::str::FromStr;

pub fn read<T: FromStr>() -> T {
    let cin = stdin();
    let cin = cin.lock();
    let token: String = cin
        .bytes()
        .map(|c| c.expect("failed to read char") as char)
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect();
    token.parse().ok().expect("failed to parse token")
}


Measured memory_bytes: 2244
n = int(input())
p = [int(i) for i in input().split()]
num = 0
for i in range(n-2):
    if p[i] < p[i+1] and p[i+1] < p[i+2]:
        num+=1
    if p[i] > p[i+1] and p[i+1] > p[i+2]:
        num+=1
print(num)

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

#define forn(i, a, b) for (int i = a; i <= b; ++i)
#define forr(i, a, b) for (int i = a; i >= b; --i)

using namespace std;

const int N = (int)1e5 + 1;
const int INF = 1e9 + 7;

typedef long long ll;
typedef long double ld;

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

int n, m;
int main (){
  scanf ("%d %d", &n, &m);
  if (n == 1 && m == 1) return printf ("1\n"), 0;
  if (n == 1 && m != 1) return printf ("%d\n", m - 2), 0;
  if (n != 1 && m == 1) return printf ("%d\n", n - 2), 0;
  else {
    n -= 2;
    m -= 2;
    ll ans = n * 1ll * m;
    printf ("%lld\n", ans);
  }
  return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include<algorithm>
//#include<bits/stdc++.h>
using namespace std;
#define ll long long int
#define pb emplace_back
#define mp make_pair
#define MOD (int) 1e9+7
#define for0(i, n) for (int i = 0; i < n; i++)
#define ff first
#define ss second
#define endl "\n"
#define bits(n) __builtin_popcount(n)
#define ini(a, i) memset(a, i, sizeof(a))

int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	ll t;
	// cin >> t;
	t  = 1;
	while (t--)
	{
		ll n, x, t;
		cin >> n >> x >> t;
		// ll arr[n];
		// for (ll i = 0; i < n; i++) cin >> arr[i];
		ll a = n / x;
		if (n % x == 0)
		{
			cout << a * t << endl;
		}
		else
		{
			cout << (a + 1)*t << endl;
		}
	}
	return 0;
}


Measured memory_bytes: 3608
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <cmath>
using namespace std;
int main()
{
    int n,k,a,w,i;
    scanf("%d%d",&n,&k);
    for(i=0;i<n;i++)
    {
        scanf("%d",&a);
        if(a==1) w=i+1;
    }
    int ans=0;
    if((w-1)%(k-1)+(n-w)%(k-1)!=0)
        ans=((w-1)%(k-1)+(n-w)%(k-1)-1)/(k-1)+1;
    ans+=(w-1)/(k-1)+(n-w)/(k-1);
        printf("%d\n",ans);
    return 0;
}


Measured memory_bytes: 128
#include <iostream>
#include <vector>
#include <algorithm>
#include <string.h>
#include <iomanip>
#include <math.h>
#include <string>
#include <queue>
#include <map>
#include <set>
#include <functional>

using namespace std;

typedef long long int ll;
typedef std::pair<int, int> pii;
typedef std::pair<ll, int> pli;
typedef std::pair<ll, ll> pll;

#define FOR(i,n,m) for(ll i=(ll)(m);i<(ll)(n);++i)
#define REP(i,n) FOR(i,n,0)
#define IREP(i,n) for(ll i=(ll)(n);i>=0;--i)
#define OF64 std::setprecision(10)

const ll MOD = 1000000007;
const ll INF = (ll)1e15;

struct Data
{
	int p;
	int y;
	int i;
};

int P[100005];
int Y[100005];
string ID[100005];

vector<Data> D[100005];

string getID(int p, int y)
{
	string ps, ys;
	REP(i, 6)
	{
		if (p != 0)
		{
			ps = (char)(p % 10 + '0') + ps;
			p /= 10;
		}
		else
		{
			ps = '0' + ps;
		}

		if (y != 0)
		{
			ys = (char)(y % 10 + '0') + ys;
			y /= 10;
		}
		else
		{
			ys = '0'+ys;
		}
	}
	return ps + ys;
}

int main()
{
	int N, M;
	cin >> N >> M;
	REP(i, M)
	{
		int p, y;
		cin >> p >> y;
		p--; y--;
		Data d;
		d.p = p; d.y = y; d.i = i;
		D[p].push_back(d);

	}
	REP(i, N)
	{
		sort(D[i].begin(), D[i].end(), [](Data a, Data b) {return a.y < b.y; });
		REP(j, D[i].size())
		{
			ID[D[i][j].i] = getID(D[i][j].p + 1, j + 1);
		}
	}

	REP(i, M)
	{
		cout << ID[i] << endl;
	}
	return 0;
}

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

using namespace std;

using ll = long long;
using ld = long double;

using vi = vector<int>;
using vvi = vector<vi>;
using vll = vector<ll>;
using vvll = vector<vll>;
using vb = vector<bool>;
using vs = vector<string>;
using vld = vector<ld>;
using vvld = vector<vld>;

typedef pair<ll, ll> P;

#define bit(n) (1LL << (n))

//#define int long long

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

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

#define FOR(i, a, b) for (ll i = (a); i < (b); i++)
#define FORm(i, m) for (auto i = m.begin(); i != m.end(); i++)

template <class T>
inline void chmax(T& a, T b) {
  a = std::max(a, b);
}
template <class T>
inline void chmin(T& a, T b) {
  a = std::min(a, b);
}

#define mod (ll)(1e9 + 7)
const long long INF = 1LL << 60;

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

  ll n;
  cin >> n;
  vll a(n + 1);
  rep(i, n + 1) {
    cin >> a[i];
  }

  if (n == 0) {
    if (a[0] == 1) {
      cout << 1 << endl;
    } else {
      cout << -1 << endl;
    }
    return 0;
  }

  vll sum_leaf(n + 2);
  for (int i = n; i >= 0; i--) {
    sum_leaf[i] = sum_leaf[i + 1] + a[i];
  }

  vll num_node(n + 1);
  num_node[0] = 1;
  REP(i, n + 1) {
    num_node[i] = min(sum_leaf[i], (num_node[i - 1] - a[i - 1]) * 2);

    if (num_node[i] < a[i]) {
      cout << -1 << endl;
      return 0;
    }
  }

  cout << accumulate(all(num_node), 0ll) << endl;

  return 0;
}


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

int main(){
  ll n;
  cin >> n;
  
  bitset<1000000001> a(0);
  for(ll i=0; i<n; i++){
    ll tmp;
    cin >> tmp;
    if(a[tmp] == 1){
      a.reset(tmp);
    }
    else{
      a.set(tmp);
    }
  }
  cout << a.count() << endl;
}
    

Measured memory_bytes: 122368
#include <iostream>

using namespace std;

int main() {
    int r, g, b;

    cin >> r >> g >> b;

    if ((100 * r + 10 * g + b) % 4 == 0) {
        cout << "YES" << endl;
    } else {
        cout << "NO" << endl;
    }

    return 0;
}

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

#define rep(i, a) for (int i = 0; i < (a); ++i)
#define REP(i, a, b) for (int i = (a); i < (b); ++i)
#define FORV(a, A) for (auto& a : A)

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

// auto mod int
const int mod = 1000000007;

struct mint {
  ll x;  // typedef long long ll;
  mint(ll x = 0) : x((x % mod + mod) % mod) {}
  mint operator-() const { return mint(-x); }
  mint& operator+=(const mint a) {
    if ((x += a.x) >= mod) x -= mod;
    return *this;
  }
  mint& operator-=(const mint a) {
    if ((x += mod - a.x) >= mod) x -= mod;
    return *this;
  }
  mint& operator*=(const mint a) {
    (x *= a.x) %= mod;
    return *this;
  }
  mint operator+(const mint a) const {
    mint res(*this);
    return res += a;
  }
  mint operator-(const mint a) const {
    mint res(*this);
    return res -= a;
  }
  mint operator*(const mint a) const {
    mint res(*this);
    return res *= a;
  }
  mint pow(ll t) const {
    if (!t) return 1;
    mint a = pow(t >> 1);
    a *= a;
    if (t & 1) a *= *this;
    return a;
  }

  // for prime mod
  mint inv() const { return pow(mod - 2); }
  mint& operator/=(const mint a) { return (*this) *= a.inv(); }
  mint operator/(const mint a) const {
    mint res(*this);
    return res /= a;
  }
};

// combination mod prime
mint choose(int n, int r) {
  mint x = 1, y = 1;
  rep(i, r) {
    x *= n - i;
    y *= i + 1;
  }
  return x / y;
}

void Main() {
  int n, a, b;
  cin >> n >> a >> b;
  mint ans = 2;
  ans = ans.pow(n);
  ans -= 1;
  ans -= choose(n, a);
  ans -= choose(n, b);
  cout << ans.x << 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;

typedef long long ll;

mt19937 rnd(chrono::high_resolution_clock::now().time_since_epoch().count());

const int inf = 1e9 + 7;
const int mod = 1e9 + 7;

inline void add(int &a, int b) {
  a += b;
  if (a >= mod) a -= mod;
  if (a < 0) a += mod;
}

inline int mul(int a, int b) {
  return (a * (ll) b) % mod;
}

inline int pw(int x, int n) {
  int res = 1;
  while (n > 0) {
    if (n % 2) {
      res = mul(res, x);
      n--; 
    } else {
      x = mul(x, x);
      n /= 2;
    }
  }
  return res;
}

const int N = 1e5 + 7;

bool dp[N];

int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int n, k;
  cin >> n >> k;
  vector <int> a(n);
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  sort(a.begin(), a.end());
  int mn = a[0];
  for (int i = 0; i < mn; i++) {
    dp[mn] = true;
  }
  for (int i = 0; i < N; i++) {
    for (int j = 0; j < n; j++) {
      if (i + a[j] < N) {
        if (!dp[i]) {
          dp[i + a[j]] = true;
        }
      }
    }
  }
  cout << (dp[k] ? "First\n" : "Second\n");
  return 0;
}

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

int main(){
 int a;
 cin >> a;
 cout << a+a*a+a*a*a << endl;
}

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

typedef int64_t Int;
#define all(x) (x).begin(), (x).end()
 
const double EPS = 1e-10;
const Int INF = 1e18;
const int inf = 1e9;
const Int mod = 1e9+7;

bool print_space_enable = false;
void print() { 
    cout << endl; 
    print_space_enable = false;
}

template <class Head, class... Tail>
void print(Head&& head, Tail&&... tail) {
    if (print_space_enable) cout << " ";
    cout << fixed << setprecision(15) << head;
    print_space_enable = true;
    print(std::forward<Tail>(tail)...);
}

template<typename T>
void print(vector<T> v) {
    for (size_t i = 0; i < v.size(); i++) {
        if (i > 0) std::cout << " ";
        std::cout << v[i];
    }
    std::cout << std::endl;
}

int main() {
    Int x;
    cin >> x;
    print(10 - x / 200);
    return 0;
}

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


int main () {
  int A, B;
  cin >> A >> B;
  if (A == B) cout << "Draw" << endl;
  else if (A == 1) cout << "Alice" << endl;
  else if (B == 1) cout << "Bob" << endl;
  else if (B < A) cout << "Alice" << endl;
  else cout << "Bob" << endl;
}

Measured memory_bytes: 3632
import math

X=int(input())

def judge(x):
    judge=True
    h=int(math.sqrt(x))
    for i in range(2,h+1):
        r=x%i
        if r==0:
            judge=False
            break
    
    return judge

ans=X
while True:
    if judge(ans):
        print(ans)
        break
    else:
        ans+=1









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

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

typedef long long ll;
typedef pair<ll,ll> pll;
int main(int argc, char const *argv[])
{
    cin.tie(0);
   	ios::sync_with_stdio(false);
    int M; cin >> M;
    vector<pll> v;
    ll keta = 0;
    ll souwa = 0;
    REP(i, M) {
        pll tmp; cin >> tmp.first >> tmp.second;
        v.push_back(tmp);
    }
    for (auto x:v) {
        keta += x.second;
        souwa += x.first*x.second;
    }
    cout << keta - 1 + (souwa -1) / 9 << endl;
    return 0;
}


Measured memory_bytes: 6384
#include <cstdio>
#include <iostream>
#include <iomanip>

#include <string>
#include <cmath>
#include <algorithm>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <tuple>

using namespace std;
typedef long long ll;

#define MAX_N 10000
int a[MAX_N];

int main() {

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

  // input
  string S;
  cin >> S;

  // -----------------------------

  if (S == "SUN") cout << 7 << endl;
  else if (S == "MON") cout << 6 << endl;
  else if (S == "TUE") cout << 5 << endl;
  else if (S == "WED") cout << 4 << endl;
  else if (S == "THU") cout << 3 << endl;
  else if (S == "FRI") cout << 2 << endl;
  else if (S == "SAT") cout << 1 << endl;

  return 0;
  
}


Measured memory_bytes: 256
#define LOCAL

#undef _GLIBCXX_DEBUG

#include <bits/stdc++.h>
using namespace std;

#define IOS ios::sync_with_stdio(false);cin.tie(0)
#define all(x) x.begin(), x.end()
#define ff first
#define ss second
#define MOD 1000000007LL
#define LLINF 100000000000000005LL
#define INF (int)1e9+1

// Copied from Gennady-Korotkevich's template

template <typename A, typename B>
string to_string(pair<A, B> p);

template <typename A, typename B, typename C>
string to_string(tuple<A, B, C> p);

template <typename A, typename B, typename C, typename D>
string to_string(tuple<A, B, C, D> p);

string to_string(const string& s) {
	return '"' + s + '"';
}

string to_string(const char* s) {
	return to_string((string)s);
}

string to_string(bool b) {
	return (b ? "true" : "false");
}

string to_string(vector<bool> v) {
	bool first = true;
	string res = "{";
	for (int i = 0; i < static_cast<int>(v.size()); i++) {
		if (!first) {
			res += ", ";
		}
		first = false;
		res += to_string(v[i]);
	}
	res += "}\n";
	return res;
}

template <size_t N>
string to_string(bitset<N> v) {
	string res = "";
	for (size_t i = 0; i < N; i++) {
		res += static_cast<char>('0' + v[i]);
	}
	return res;
}

template <typename A>
string to_string(A v) {
	bool first = true;
	string res = "{";
	for (const auto& x : v) {
		if (!first) {
			res += ", ";
		}
		first = false;
		res += to_string(x);
	}
	res += "}\n";
	return res;
}

template <typename A, typename B>
string to_string(pair<A, B> p) {
	return "(" + to_string(p.first) + ", " + to_string(p.second) + ")";
}

template <typename A, typename B, typename C>
string to_string(tuple<A, B, C> p) {
	return "(" + to_string(get<0>(p)) + ", " + to_string(get<1>(p)) + ", " + to_string(get<2>(p)) + ")";
}

template <typename A, typename B, typename C, typename D>
string to_string(tuple<A, B, C, D> p) {
	return "(" + to_string(get<0>(p)) + ", " + to_string(get<1>(p)) + ", " + to_string(get<2>(p)) + ", " + to_string(get<3>(p)) + ")";
}

template <typename A, typename B, typename C, typename D, typename E>
string to_string(tuple<A, B, C, D, E> p) {
	return "(" + to_string(get<0>(p)) + ", " + to_string(get<1>(p)) + ", " + to_string(get<2>(p)) + ", " + to_string(get<3>(p)) + "," + to_string(get<4>(p)) + ")";
}

void debug_out() {
	cerr << endl;
}

template <typename Head, typename... Tail>
void debug_out(Head H, Tail... T) {
	cerr << " " << to_string(H);
	debug_out(T...);
}

#ifdef LOCAL
#define debug(...) cerr << "\n[" << #__VA_ARGS__ << "]:\n", debug_out(__VA_ARGS__)
#else
#define debug(...) 42
#endif

// End of Gennady-Korotkevich's template 

using llong = long long;
using PII = pair<int, int>;

llong gcd(llong a, llong b) {
	return b == 0 ? a : gcd(b, a % b);
}
llong lcm(llong a, llong b) {
	return a * b / gcd(a, b);
}

int main() {
	IOS;
	llong a, b; cin >> a >> b;
	cout << lcm(a, b);
}

Measured memory_bytes: 3664
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
 
const ll mod = 1e9 + 7;

int main() {
  ll n, k;
  cin >> n >> k;
  vector<pair<ll, ll>> a(n);
  for (auto &i : a) {
    cin >> i.first >> i.second;
  }
  sort(a.begin(), a.end());
  ll c = 0;
  for (int i = 0; i < n; i++) {
    c += a[i].second;
    if (k <= c) {
      cout << a[i].first << endl;
      return 0;
    }
  }
  return 0;
}


Measured memory_bytes: 4832