akhauriyash/Code-Regression huggingface dataset:
#include "bits/stdc++.h"
using namespace std;

using VS = vector<string>;    using LL = long long;
using VI = vector<int>;       using VVI = vector<VI>;
using PII = pair<int, int>;   using PLL = pair<LL, LL>;
using VL = vector<LL>;        using VVL = vector<VL>;

#define ALL(a)  begin((a)),end((a))
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define EB emplace_back
#define MP make_pair
#define SZ(a) int((a).size())
#define SORT(c) sort(ALL((c)))
#define RSORT(c) sort(RALL((c)))
#define UNIQ(c) (c).erase(unique(ALL((c))), end((c)))
#define FOR(i, s, e) for (int(i) = (s); (i) < (e); (i)++)
#define FORR(i, s, e) for (int(i) = (s); (i) > (e); (i)--)
#define debug(x) cerr << #x << ": " << x << endl
const int INF = 1e9;                          const LL LINF = 1e16;
const LL MOD = 1000000007;                    const double PI = acos(-1.0);
int DX[8] = { 0, 0, 1, -1, 1, 1, -1, -1 };    int DY[8] = { 1, -1, 0, 0, 1, -1, 1, -1 };

/* -----  __MAKE_TIME__  Problem: __PROBLEM__ / Link: __CONTEST_URL__  ----- */
/* ------問題------
-----問題ここまで----- */
/* -----解説等-----
----解説ここまで---- */

LL N;

LL ans = 0LL;

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

	cin >> N;
  VI a(N);
FOR(i,0,N)cin>>a[i];
SORT(a);
ans=a[N-1]-a[0];

	cout << ans << "\n";

	return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
using uint = unsigned int;
using ll = long long;
using ull = unsigned long long;

#define FOR(i,a,b) for (int i = a; i < b; ++i)
#define FORR(i,a,b) for (int i = b - 1; i >= a; --i)
#define REP(i,n) FOR(i,0,n)
#define REPR(i,n) FORR(i,0,n)

int main() {
	string S, T;
	cin >> S >> T;

	int ans = 10000;
	REP(i, S.length() - T.length() + 1) {
		string s = S.substr(i, T.length());
		int cnt = 0;
		REP(j, T.length()) {
			if (s[j] != T[j]) ++cnt;
		}

		ans = min(ans, cnt);
	}

	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 3604
#include<bits/stdc++.h>
using namespace std;
const int maxn = 100000+10;
priority_queue<int> dis;
int main()
{
    int N,M,a;
    cin>>N>>M;
    for(int i=0;i<N;++i)
    {
        cin>>a;
        dis.push(a);
    }
    for(int i=0;i<M;++i)
    {
        a = dis.top();
        dis.pop();
        dis.push(a/2);
    }
    long long ans=0;
    while(!dis.empty())
        {
            ans =ans + dis.top();
            dis.pop();
        }
    cout<<ans<<endl;
    return 0;
}


Measured memory_bytes: 1020
import java.util.Scanner;

class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    long acum = 1;
    boolean cs = false;
    for(int i = 0; i < n; i++) {
      try {
        acum = Math.multiplyExact(acum, sc.nextLong());      
      } catch(ArithmeticException e) {
        cs = true;
      }
    }
    sc.close();
    if(acum != 0 && (acum > 1000000000000000000L || cs)) {
      System.out.println("-1");
    } else {
      System.out.println(acum);
    }
  }
}

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

int main() {
  int n;
  std::cin >> n;
  std::vector<int> min(n), max(n);
  for (int i = 0; i < n; ++i) {
    std::cin >> min[i] >> max[i];
  }
  std::sort(min.begin(), min.end());
  std::sort(max.begin(), max.end());
  int ans;
  if (n % 2 == 1) {
    ans = max[n / 2] - min[n / 2] + 1;
  } else {
    double m1 = (max[n / 2 - 1] + max[n / 2]) / 2.0;
    double m2 = (min[n / 2 - 1] + min[n / 2]) / 2.0;
    ans = (m1 - m2) * 2 + 1;
  }
  std::cout << ans << std::endl;
  return 0;
}


Measured memory_bytes: 4792
#include<bits/stdc++.h>
using namespace std;
char s[100];
int main(){
 	 cin>>s;
  	if(s[0]=='S'){
     	cout<<"Cloudy"; 
    }
  	else if(s[0]=='R'){
     	cout<<"Sunny"; 
    }
  	else cout<<"Rainy";
}

Measured memory_bytes: 764
#include <stdio.h>
int main(void){
    int d;
    scanf("%d",&d);
    if (d==25){
        printf("Christmas\n");
    } else if (d==24){
        printf("Christmas Eve\n");
    } else if (d==23){
        printf("Christmas Eve Eve\n");
    } else {
        printf("Christmas Eve Eve Eve\n");
    }
	return 0 ;
}

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

using namespace std;
typedef long long ll;

ll count(const vector<ll>& v, ll x){
    ll ret = 0;
    for(ll y : v){
        ret += (ll)(y >= x);
    }
    return ret;
} 

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

    vector<ll> d(n + 1, 0);
    for(int i = 2; i <= n; ++i){
        int k = i;
        for(int j = 2; j <= i; ++j){
            while(k % j == 0){
                d.at(j)++;
                k /= j;
            }
        }
    }

    ll ans = 0;
    ans += count(d, 74);
    ans += count(d, 24) * (count(d, 2) - 1);
    ans += count(d, 14) * (count(d, 4) - 1);
    ans += count(d, 4) * (count(d, 4) - 1) * (count(d, 2) - 2) / 2;
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 384
#include<stdio.h>
int main(void)
{
	int a[6],i,c,n;
	c=0;
	n=0;
	for(i=1;i<=5;i++){
		scanf("%d",&a[i]);
		if(a[i]<40){
			a[i]=40;
			c=c+a[i];
		}
		else{
			c=c+a[i];
		}
	}
	n=c/5;
	printf("%d\n",n);
	return 0;
}

Measured memory_bytes: 1028
public class Main {

	public static void main(String[] args) {

		java.util.Scanner scan = new java.util.Scanner(System.in);
	
	
		int k = scan.nextInt();
		int a = scan.nextInt();
		int b = scan.nextInt();
		
		for ( int i = a ; i <= b ; i++) {
			if (i % k == 0) {
				System.out.println("OK");
				break;
			} else if (i == b) {
				System.out.println("NG");
			}
		}
	}

}

Measured memory_bytes: 35728
import sys
sys.setrecursionlimit(10**6)

debug_mode = True if len(sys.argv) > 1 and sys.argv[1] == "-d" else False
if debug_mode:
    import os
    infile = open(os.path.basename(__file__).replace(".py", ".in"))

    def input():
        return infile.readline()


# ==============================================================

from math import sqrt


def main():
    Q = int(input().strip())
    AB = [list(map(int, input().strip().split())) for _ in range(Q)]
    for a, b in AB:
        a, b = min((a, b)), max((a, b))
        cnt = 0
        if a == b:
            cnt = 2 * (a - 1)
        elif a + 1 == b:
            cnt = 2 * (a - 1)
        else:
            ab = a * b
            c = int(sqrt(ab)) if sqrt(ab) > int(sqrt(ab)) else int(sqrt(
                ab)) - 1
            if c * (c + 1) >= ab:
                cnt = 2 * (c - 1)
            elif c * (c + 1) < ab:
                cnt = 2 * c - 1
        print(cnt)


main()

# ==============================================================

if debug_mode:
    infile.close()


Measured memory_bytes: 3064
#include <bits/stdc++.h>
  
using namespace std;
 
#define endl "\n"
#define JAM(x) cout<< #x <<" = "<<x<<"\n"

 
typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef pair<int,int> PII;
typedef vector<PII> VPI;
 
const int INF=2e9;
const int MX=100005;
const int MOD=1000000007;
const double PI=acos(-1.0);



long long int power(long long int a,long long int b)
{
    a %= MOD;
    long long int res = 1;
    while (b > 0) {
        if (b & 1)
            res = res * a % MOD;
        a = a * a % MOD;
        b >>= 1;
    }
    return res;
}
bool isprime(int n)
{
    if(n==1)
    return 0;
    int i;
    for(i=2;i*i<=n;i++)
    {
        if(n%i==0)
        return false;
    }
    return true;
}




/*_______________________________________________*/





int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    string s;
    cin>>s;
    int n=s.length();
    if(s[n-1]=='s')
    s+="es";
    else
    s+="s";
    cout<<s;
    
}


Measured memory_bytes: 3652
#include <bits/stdc++.h>
int arr[1002];
using namespace std;
int main()
{
    int n,k;
    scanf("%d%d",&n,&k);
    for(int i=0;i<n;++i)scanf("%d",&arr[i]);
    sort(arr,arr+n);
    int sum=0;
    for(int i=0;i<k;++i)sum+=arr[i];
    printf("%d\n",sum);
    return 0;
}


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

int main(void){
    long n, v;
    cin >> n;
    long count=0;
    for(long i=0; i<n; i++){
        cin >> v;
        while(v%2==0){
            count++;
            v/=2;
        }
    }
    cout << count << endl;
    return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int a[2][105];
int main(){
	int n;
	cin>>n;
	for(int i=1;i<=2;i++){
		for(int j=1;j<=n;j++){
			cin>>a[i][j];
		}
	}
	for(int i=1;i<=2;i++){
		for(int j=1;j<=n;j++){
			a[i][j]+=max(a[i-1][j],a[i][j-1]);
		}
	}
	cout<<a[2][n]<<endl;
	return 0;
}


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

using namespace std;

int main() {
	char n;
	long long sum = 0;
	while (1) {
		n = cin.get();
		if (!(n<='9'&&n>='0'))
			break;
		sum += n-'0';
		//cout << sum << endl;
	}

	if (sum % 9 == 0)
		cout << "Yes" << endl;
	else
		cout << "No" << endl;
	return 0;
}

Measured memory_bytes: 3628
////////////////////////////////////////////////////////////////////
// This source code is for Visual Studio
////////////////////////////////////////////////////////////////////
#include <iostream>
#include <string>
#include <vector>
#include <list>
#include <queue>
#include <map>
#include <set>
#include <algorithm>
#include <sstream>
#include <iterator>
#include <stack>
#include <functional>
#include <iomanip>
#include <string>
#include <cstring>
#include <deque>
#include <math.h>

#define	numberof(a)	(sizeof(a) / sizeof(a[0]))
#define	INF		UINT64_MAX
#define Rep(i,n) for(int i = 0; i < (n); ++i )

using namespace std;

typedef vector< vector<int> > MAT;
typedef pair<int, int> PINT;
typedef long long ll;
typedef uint32_t u32;
typedef uint64_t u64;
typedef int32_t s32;
typedef int64_t s64;

//constant
//--------------------------------------------
const double EPS = 1e-10;
const double PI  = acos(-1.0);

struct edge
{
	ll from;
	ll to;
	ll cost;
};

int main()
{
	ll N = 0;
	ll ret = 0;

	cin >> N;

	ret = (ll)sqrt(N);
	ret = ret * ret;

	cout << ret << endl;

	return 0;
}





Measured memory_bytes: 256
#include<iostream>
#include<string>
#include<algorithm>
#include <string.h>
#include <stdio.h>
#include <math.h>
#include <set>
#include <queue>
#include <stack>
#include <map>

using namespace std;
typedef long long LL;
const int INF = int(1e9);

double A,B,C,D,E,F;
double Ai,Bi;
double maxx1 = -1,maxx2 = 1;

int main()
{
    cin>>A>>B>>C>>D>>E>>F;
    Ai = A*E; Bi = B*E;
    double tan,kefan,sum;

    for(int a = 0;a*A*100<=F;a++)
    for(int b = 0;b*B*100<=F-a*A*100;b++)
    for(int c = 0;c*C<=F-a*A*100-b*B*100;c++)
    for(int d = 0;d*D<=F-a*A*100-b*B*100-c*C;d++)
    {
        tan = c*C+d*D;
        sum = A*a*100+B*b*100+tan;
        kefan = Ai*a+Bi*b;
        //cout<<a<<"->"<<b<<" "<<c<<" "<<d<<endl;
       // cout<<sum<<" "<<tan<<" "<<kefan<<endl;
        if(kefan<tan||sum>F)continue;

        if(sum!=0&&tan/sum>maxx2/maxx1){
            maxx1 = sum;
            maxx2 = tan;
        }
    }
    cout<<int(maxx1)<<" "<<int(maxx2)<<endl;
    return 0;
}


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

int main(int argc, char *argv[])
{
    int i, s=0, n;
    string mir; 
    cin >> mir;
    n = mir.size();
    for(i=0;i<n/2;i++)
    {
        if(mir[i]=='b' && mir[n-i-1]=='d') s++;
        if(mir[i]=='d' && mir[n-i-1]=='b') s++;
        if(mir[i]=='p' && mir[n-i-1]=='q') s++;
        if(mir[i]=='q' && mir[n-i-1]=='p') s++;               
    }
    if(s == n/2 && n%2==0) cout << "Yes" << endl;
    else cout << "No" << endl;
    system("PAUSE");
    return EXIT_SUCCESS;
}


Measured memory_bytes: 760
#include<bits/stdc++.h>
using namespace std;
#define arep(i,x,n) for(int i=int(x);i<(int)(n);i++)
#define rep(i,n) for(long long i = 0;i < n;++i)
#define pi 3.141592653589793
#define eps 0.00000001
#define INF 1e9+7  
using ll = long long; 
using P=pair<int,int>;
using lP=pair<ll,ll>;
using fP=pair<double,double>;

char a[105][105];
int main(){
    int h,w;
    cin>>h>>w;
    rep(i,h){
        rep(j,w){
            cin>>a[i][j];
        }
    }
    vector<int>row;
    rep(i,h){
        bool ok=true;
        rep(j,w){
            if(a[i][j]=='#'){
                ok=false;
                break;
            }
        }
        if(!ok)row.push_back(i);
    }
    vector<int>line;
    rep(i,w){
        bool ok=true;
        rep(j,h){
            if(a[j][i]=='#'){
                ok=false;
                break;
            }
        }
        if(!ok)line.push_back(i);
    }
    for(int x:row){
        for(int y:line){
        cout<<a[x][y];
    }
        cout<<endl;
    }
    return 0;
}

Measured memory_bytes: 256
# -*- coding: utf-8 -*-
"""
Created on Sat Apr 27 21:06:24 2019

@author: yuta
"""

N = int(input())
V = list(map(int,input().split()))
C = list(map(int,input().split()))

def main(n,v,c):
    value = [0]*n
    for i in range(n):
        value[i] = v[i] - c[i]
    
    count = 0
    for j in range(n):
        if value[j] > 0:
            count += value[j]
    print(count)
main(N,V,C)

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

using namespace std;

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    
    int_fast32_t n;
    string s;

    cin >> n >> s;

    vector<int_fast32_t> pr, pg, pb;

    for(int_fast32_t i = 0; i < n; ++i) {
        switch(s.at(i)) {
            case 'R':
                pr.emplace_back(i);
                break;
            case 'G':
                pg.emplace_back(i);
                break;
            case 'B':
                pb.emplace_back(i);
                break;
        }
    }

    int_fast64_t ans = pr.size() * pg.size() * pb.size();

    for(int_fast32_t i: pr) {
        for(int_fast32_t j: pg) {
            if(i < j) {
                if(2 * i - j >= 0 && s.at(2 * i - j) == 'B') --ans;
                if(2 * j - i < n && s.at(2 * j - i) == 'B') --ans;
                if((j - i) % 2 == 0 && s.at((i + j) / 2) == 'B') --ans;
            }
            if(i > j) {
                if(2 * j - i >= 0 && s.at(2 * j - i) == 'B') --ans;
                if(2 * i - j < n && s.at(2 * i - j) == 'B') --ans;
                if((i - j) % 2 == 0 && s.at((i + j) / 2) == 'B') --ans;
            } 
        }
    }

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

    return 0;
}

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

int main() {
  int H, W;
  cin >> H >> W;
  
  char array1[H][W];
  for (int i=0; i<H; i++){
    for (int j=0; j<W; j++){
      cin >> array1[i][j];
    }
  }
  
  char array2[H+2][W+2];
  for (int i=0; i<H+2; i++){
    for (int j=0; j<W+2; j++){
      array2[i][j]='#';
    }
  }
  
  for (int i=0; i<H; i++){
    for (int j=0; j<W; j++){
      array2[i+1][j+1]=array1[i][j];
    }
  }
  
  for (int i=0; i<H+2; i++){
    for (int j=0; j<W+2; j++){
      cout << array2[i][j] ;
    }
    cout << endl;
  }
}

Measured memory_bytes: 256
//itp1_topic10_c
#include<bits/stdc++.h>
using namespace std;
 
int main(){
  //小数点以下12ケタを表示させるためのおまじない
  cout<<fixed<<setprecision(12);
 
 
  while(1){
    int n;
    double s[1000];
    double sum=0;
 
    cin>>n;
     
    if(n==0){
      break;
    }
     
    for(int i=0;i<n;i++){
      cin>>s[i];
    }
   
    for(int i=0;i<n;i++){
      sum+=s[i];
    }
   
    double avg=sum/n;
 
    double ans=0;
   
    for(int i=0;i<n;i++){
      ans+=pow(s[i]-avg,2);
    }
 
    ans=sqrt( ans/n );
   
    cout<<ans<<endl;
  }
  return 0;  
}


Measured memory_bytes: 3276
#include <bits/stdc++.h>
    using namespace std;
    
    typedef long long ll;
    typedef pair<long long , long long> pair_t;
    
    ll gcd(ll a, ll b) {
        if (b == 0)
            return a;
        else
            return gcd (b, a % b);
    }
    ll lcm(ll a, ll b) {
        return a / gcd(a, b) * b;
    }
    int main(){
        ll n , l , a, b , c , d , e , f , g , na , nb;
        
        cin >> a >> b  >> c >> d;
        ll ans = 0;
        if(c == 1 || d == 1){
            cout << 0 << endl;
            return 0;
        }
        if(a == b){
            if(a % c == 0 || a % d == 0){
                cout << 0 << endl;
            }else{
                cout << 1 << endl;
            }
            return 0;
        }
        if( c % d == 0 || d % c == 0){
            if(c == d){
                e = c;
            }else if(c % d == 0){
                e = d;
            }else{
                e = c;
            }
            nb = b / e;
            na = a / e;
        }else{
            l = lcm(c , d);
            nb =   b / c ;
            nb +=  b / d ;
            nb -=  b / l ;
            na =   a / c ;
            na +=  a / d ;
           na -=  a / l ;
        }
        //cout << nb << ":" << na << endl;
        ans = (b - nb) - (a - na);
        if(a % c != 0 && a % d != 0){
            ans += 1;
        }
        cout << ans << endl;
        
        return 0;
        
    }

Measured memory_bytes: 256
import numpy as np
from numba import njit


@njit(cache=True)
def solve(dp, N, n1, n2, n3):

    if dp[n1][n2][n3] >= 0.0:
        return dp[n1][n2][n3]
    if n1 == n2 == n3 == 0:
        return 0.0

    cnt = n1 + n2 + n3
    ret = 0
    if n3 >= 1:
        ret += solve(dp, N, n1, n2 + 1, n3 - 1) * n3
    if n2 >= 1:
        ret += solve(dp, N, n1 + 1, n2 - 1, n3) * n2
    if n1 >= 1:
        ret += solve(dp, N, n1 - 1, n2, n3) * n1

    ret = (ret + N) / cnt
    dp[n1][n2][n3] = ret
    return ret


def main():
    N = int(input())
    A = list(map(int, input().split()))

    dp = np.full((N + 1, N + 1, N + 1), -1, dtype=np.float64)

    a1, a2, a3 = 0, 0, 0
    for i in range(N):
        if A[i] == 1:
            a1 += 1
        elif A[i] == 2:
            a2 += 1
        elif A[i] == 3:
            a3 += 1

    print(solve(dp, N, a1, a2, a3))


if __name__ == '__main__':
    main()


Measured memory_bytes: 323360
#include <cstdio>
#include <iostream>
#include <iomanip>
#include <vector>
#include <algorithm>
#include <map>

#define MAX_INT 2147483647
#define PI 3.141592653589793238462643383279502884L

#define long long long int

using std::vector;
using std::map;
using std::string;
using std::pair;
using std::cin;
using std::cout;

// @author: pashka

int main() {
    std::ios::sync_with_stdio(false);

    int n;
    cin >> n;
    map<int, int> a;
    for (int i = 0; i < n; i++) {
        int x;
        cin >> x;
        a[x]++;
    }

    int res = 0;
    for (auto item : a) {
        if (item.second > 0) {
            res = std::max(res, a[item.first - 1] + item.second + a[item.first + 1]);
        }
    }
    cout << res << "\n";

    return 0;
}

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


def solve(N: int, M: int, A: "List[int]"):
    costs = [10**18, 2, 5, 5, 4, 5, 6, 3, 7, 6]
    cand = [(i, costs[i]) for i in A]
    cand.sort(reverse=True)
    digits = [-1 * 10**16 for i in range(N+1)]
    digits[0] = 0
    for i in range(1, N+1):
        r = -1 * 10**16
        for c in cand:
            if i - c[1] >= 0:
                r = max(r, digits[i - c[1]] + 1)
        digits[i] = r
    digit = digits[N]
    lastCost = N
    result = 0
    # print(digits)
    for i in range(digit):
        for c in cand:
            if lastCost - c[1] >= 0 and digits[lastCost - c[1]] == digits[lastCost] - 1:
                result = result*10 + c[0]
                lastCost = lastCost - c[1]
                # print(f"lastCost:{lastCost} result:{c[0]} cost:{c[1]}")
                break
    print(result)
    return


# Generated by 1.1.3 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    M = int(next(tokens))  # type: int
    A = [int(next(tokens)) for _ in range(M)]  # type: "List[int]"
    solve(N, M, A)


if __name__ == '__main__':
    main()


Measured memory_bytes: 3424
#include <bits/stdc++.h>
using namespace std;
#define repex(i, a, b, c) for(int i = a; i < b; i += c)
#define repx(i, a, b) repex(i, a, b, 1)
#define rep(i, n) repx(i, 0, n)
#define repr(i, a, b) for(int i = a; i >= b; i--)
int road[55];

int main(){

    // 1. 入力情報.
    int N, M;
    scanf("%d %d", &N, &M);
    
    // 2. 道路の本数を計算.
    rep(i, M){
        int a, b;
        scanf("%d %d", &a, &b);
        road[a]++;
        road[b]++;
    }
    
    // 3. 出力.
    repx(i, 1, N + 1) printf("%d\n", road[i]);
    return 0;

}

Measured memory_bytes: 256
import java.util.*;

class Main {
	Scanner sc;
	
	private void calc() {
		sc = new Scanner(System.in);
		int a1 = sc.nextInt();
		int a2 = sc.nextInt();
		int a3 = sc.nextInt();
		if (a1+a2+a3 > 21) System.out.println("bust");
		else System.out.println("win");
	}

	public static void main(String[] args) {
		new Main().calc();
	}
}

Measured memory_bytes: 21844
package main

import "fmt"

func main() {
	var a, b int
	fmt.Scanf("%d %d", &a, &b)

	if a == 1 {
		a = 14
	}

	if b == 1 {
		b = 14
	}

	if a > b {
		fmt.Println("Alice")
	} else if a < b {
		fmt.Println("Bob")
	} else {
		fmt.Println("Draw")
	}
}

Measured memory_bytes: 512
#include <iostream>
#include <cmath>

using namespace std;

int n, k, x, y;

int solve() {
	return x * min(n, k) + y * max(0, n-k);
}

void input() {
	cin >> n >> k >> x >> y;
}

int main() {
	input();
	cout << solve() << endl;
}

Measured memory_bytes: 256
# -*- coding: utf-8 -*-
from math import sqrt
from collections import deque

def inpl(): return list(map(int, input().split()))
W, H = inpl()
while H:
    G = []
    for h in range(H):
        tmp = []
        for w, x in enumerate(inpl()):
            tmp.append(x==1)
            if x == 2:
                s = (h, w)
            if x == 3:
                g = (h, w)
        G.append(tmp)

    Q = deque()
    Q.append([s, 0, []])
    found = False
    while Q:
        s, turn, deleated = Q.popleft()
        for h, w in deleated:
            G[h][w] = False
        for dh, dw in [[0, 1], [0, -1], [1, 0], [-1, 0]]:
            if found:
                break
            h, w = s
            for step in range(30):
                nh, nw = h+dh, w+dw
                if not ((0 <= nh < H) & (0 <= nw < W)):
                    break
                if (nh, nw) == g:
                    print(turn+1)
                    found = True
                    break
                elif G[nh][nw] == True:
                    if turn != 9 and step > 0:
                        Q.append([(h, w), turn+1, deleated + [(nh, nw)]])
                    break
                h, w = nh, nw

        for h, w in deleated:
            G[h][w] = True
        if found:
            break
    else:
        print(-1)
    W, H = inpl()



Measured memory_bytes: 15964
/*
* @Author: wxyww
* @Date: 2020-03-27 12:30:08
* @Last Modified time: 2020-03-27 12:42:34
*/
#include<cstdio>
#include<iostream>
#include<cstdlib>
#include<cmath>
#include<ctime>
#include<bitset>
#include<cstring>
#include<algorithm>
#include<string>
#include<queue>
#include<vector>
using namespace std;
typedef long long ll;
const int N = 1010;
ll read() {
	ll x=0,f=1;char c=getchar();
	while(c<'0'||c>'9') {
		if(c=='-') f=-1;
		c=getchar();
	}
	while(c>='0'&&c<='9') {
		x=x*10+c-'0';
		c=getchar();
	}
	return x*f;
}
ll a[N][N];
ll prime[10010],tot,vis[10010];
void pre() {
	for(int i = 2;i <= 10000;++i) {
		if(!vis[i]) 
			prime[++tot] = i;
		for(int j = 1;j <= tot && prime[j] * i <= 10000;++j) {
			vis[prime[j] * i] = 1;
			if(i % prime[j] == 0) break;
		}
	}
}
ll gcd(ll x,ll y) {
	return !y ? x : gcd(y,x % y);
}
ll lcm(ll x,ll y) {
	return x * (y / gcd(x,y));
}
int main() {
	int n = read();
	if(n == 2) {
		puts("4 7\n23 10");return 0;
	}

	pre();
	for(int i = 1;i <= n;++i) {
		for(int j = 1;j <= n;++j) {
			if(!((i + j) & 1)) {
				int k1 = (i + j + 1) >> 1;
				int k2 = ((i - j + n + 1) >> 1) + n;
				a[i][j] = prime[k1] * prime[k2];
			}
		}
	}


	for(int i = 1;i <= n;++i) {
		for(int j = 1;j <= n;++j) {
			if((i + j) & 1) {
				ll L = 1;
				if(i + 1 <= n)
					L = lcm(L,a[i + 1][j]);
				// cout<<L<<endl;
				if(j + 1 <= n)
					L = lcm(L,a[i][j + 1]);
				if(i - 1)
					L = lcm(L,a[i - 1][j]);
				if(j - 1)
					L = lcm(L,a[i][j - 1]);

				a[i][j] = L + 1;
			}
		}
	}

	// puts("!!!");

	for(int i = 1;i <= n;++i) {
		for(int j = 1;j <= n;++j)
			printf("%lld ",a[i][j]);
		puts("");
	}

	return 0;
}

Measured memory_bytes: 9216
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
using namespace std;
using ll = long long;
//using P = pair<int,int>;
//pow(x,n)
//cout << fixed << setprecision(桁数);

int main() {

///B問題

    int64_t n;
    cin >> n;
    int64_t jou=n/15;
    int64_t amari=n%15;
    int64_t sum=60*jou*jou;
    if(amari==1) sum+=(jou)*15+1;
    else if(amari==2 || amari==3) sum+=(jou)*15*2+3;
    else if(amari==4 || amari==5 || amari==6) sum+=(jou)*15*3+7;
    else if(amari==7) sum+=(jou)*15*4+14;
    else if(amari==8 || amari==9 || amari==10) sum+=(jou)*15*5+22;
    else if(amari==11 || amari==12) sum+=(jou)*15*6+33;
    else if(amari==13) sum+=(jou)*15*7+46;
    else if(amari==14) sum+=(jou)*15*8+60;
    cout << sum << endl;


/*
    int n;
    cin >> n;
    string s;
    cin >> s;
    for(int i=1;i<=n;++i){
        for(int j=i+1;j<=n;++j){
            for(int k=j+1;k<=n;++k){

            }
        }
    }
    */
}

Measured memory_bytes: 3636
#include <bits/stdc++.h>
using namespace std;
using ll = int64_t;
using PLL = pair<ll, ll>;
template <typename T> using V = vector<T>;
template <typename T> using VV = V<V<T>>;

VV<int> mat;
int N;

bool solve() {
    cin >> N;
    mat = VV<int>(N, V<int>(N));
    
    if(N == 1) return true;
    if(N & 1) return false;
    if(N == 2) {
        mat[0][1] = 1;
        mat[1][0] = 2;
        return true;
    }

    V<int> nodes(N - 1);

    auto update = [&](int num, int r, int c) {
        mat[r][c] = num;
        mat[c][r] = num + N - 1;
    };

    iota(nodes.begin(), nodes.end(), 1);
    for(int num = 1; num <= N - 1; num++) {
        int dflt = num - 1;
        update(num, 0, nodes[dflt]);
        for(int j = 1; j <= N / 2; j++) {
            int r_idx = (dflt + j) % nodes.size();
            int c_idx = (dflt - j + nodes.size()) % nodes.size();
            update(num, nodes[r_idx], nodes[c_idx]);
        }
    }

    return true;
}

bool verify() {
    V<int> ok_v(2 * N - 1);
    iota(ok_v.begin(), ok_v.end(), 0);
    for(int i = 0; i < N; i++) {
        V<int> nlis;
        for(int j = 0; j < N; j++) {
            nlis.push_back(mat[i][j]);
            nlis.push_back(mat[j][i]);
        }
        sort(nlis.begin(), nlis.end());
        auto ite = unique(nlis.begin(), nlis.end());
        nlis.erase(ite, nlis.end());
        if(ok_v != nlis) return false;
    }
    return true;
}

int main() {
    if(solve()) {
        cout << "Yes" << endl;
        // cout << verify() << endl;
        for(auto &&ele : mat) for(int i = 0; i < N; i++) cout << ele[i] + 1 << " \n"[i + 1 == N];
    } else {
        cout << "No" << endl;
    }
    return 0;
}



Measured memory_bytes: 3940
#include <bits/stdc++.h>
#define fi first
#define se second
#define pb push_back
#define fio ios::sync_with_stdio(0),cin.tie(0),cout.tie(0)
using namespace std;
typedef pair<int,int> pii;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef long long ll;

struct node {
	int c[2] = {-1,-1};
};

vector<node> t = {};

int add(const string& s, int i, int v) {
	if(v == -1) {
		v = t.size();
		t.push_back(node());
	}
	if(s.size() != i) {
		int tmp = add(s,i+1,t[v].c[s[i]-'0']);
		t[v].c[s[i]-'0'] = tmp;
	}
	return v;
}

vector<int> depths;

void search(int loc, int depth) {
	if(loc == -1) {
		depths.push_back(depth);
	} else {
		search(t[loc].c[0],depth+1);
		search(t[loc].c[1],depth+1);
	}
}

int main() {
	t.push_back((node){});
	int n;
	ll l;
	cin >> n >> l;
	for(int i = 0; i < n; ++i) {
		string s;
		cin >> s;
		add(s,0,0);
	}
	search(0,0);
	ll gr = 0;
	for(int d : depths) {
		ll sz = l - d + 1;
		if(sz == 0) continue;
		ll p = 1;
		while(sz%(p*2) == 0) {
			p *= 2;
		}
		gr ^= p;
	}
	if(gr == 0) cout << "Bob\n";
	else cout << "Alice\n";
}

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

int main()
{
	int N;
	cin >> N;
	rep(i,N)
	{
		ll a;
		cin >> a;
		A.push_back(a);
	}
	sort(A.begin(), A.end());
	reverse(A.begin(), A.end());
	ll ans = A[0];
	int idx = 1;
	N -= 2;
	while(N > 0)
	{
		if (N == 1)
		{
			ans += A[idx];
			N--;
		}
		else
		{
			ans += A[idx] * 2;
			N -= 2;
			idx++;
		}
	}
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 5264
N = int(input())
S = []
T = []
for i in range(N):
    s,t =  input().split()
    t = int(t)
    S.append(s)
    T.append(t)
# N,M = map(int, input().split())
# A = list(map(int, input().split()))

X = input()

ans = 0
for i in range(N):
    if S[i] == X:
        ans = i+1
print(sum(T[ans:]))


Measured memory_bytes: 3060
import java.util.*;

class Main{
	public static void main(String args[]){
		Scanner sc = new Scanner(System.in);
		String b = sc.next();
		if(b.equals("A"))System.out.print("T");
		else if(b.equals("T"))System.out.print("A");
		else if(b.equals("C"))System.out.print("G");
		else if(b.equals("G"))System.out.print("C");
	}
}


Measured memory_bytes: 24276
X = int(input())
M = []
for i in range(120):
    M.append(i**5)
for i in range(120):
    for j in range(120):
      if(M[i] - M[j] == X):
          A = i
          B = j
      elif(M[i] + M[j] == X):
          A = i
          B = -1*j

print(A,B)


Measured memory_bytes: 9192
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef unsigned int uint;
typedef unsigned char uchar;
typedef unsigned long long ull;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<int> vi;

#define REP(i,x) for(int i=0;i<(int)(x);i++)
#define REPS(i,x) for(int i=1;i<=(int)(x);i++)
#define RREP(i,x) for(int i=((int)(x)-1);i>=0;i--)
#define RREPS(i,x) for(int i=((int)(x));i>0;i--)
#define FOR(i,c) for(__typeof((c).begin())i=(c).begin();i!=(c).end();i++)
#define RFOR(i,c) for(__typeof((c).rbegin())i=(c).rbegin();i!=(c).rend();i++)
#define ALL(container) (container).begin(), (container).end()
#define RALL(container) (container).rbegin(), (container).rend()
#define SZ(container) ((int)container.size())
#define mp(a,b) make_pair(a, b)
#define pb push_back
#define eb emplace_back
#define UNIQUE(v) v.erase( unique(v.begin(), v.end()), v.end() );
#define __builtin_popcount __builtin_popcountll

template<class T> bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T> bool chmin(T &a, const T &b) { if (a>b) { a=b; return 1; } return 0; }
template<class T> ostream& operator<<(ostream &os, const vector<T> &t) {
    os<<"["; FOR(it,t) {if(it!=t.begin()) os<<","; os<<*it;} os<<"]"; return os;
}
template<class T> ostream& operator<<(ostream &os, const set<T> &t) {
    os<<"{"; FOR(it,t) {if(it!=t.begin()) os<<","; os<<*it;} os<<"}"; return os;
}
template<class S, class T> ostream& operator<<(ostream &os, const map<S, T> &t) {
    os<<"{"; FOR(it,t) {if(it!=t.begin()) os<<","; os<<*it;} os<<"}"; return os;
}
template<class S, class T> ostream& operator<<(ostream &os, const pair<S,T> &t) { return os<<"("<<t.first<<","<<t.second<<")";}
template<class S, class T> pair<S,T> operator+(const pair<S,T> &s, const pair<S,T> &t){ return pair<S,T>(s.first+t.first, s.second+t.second);}
template<class S, class T> pair<S,T> operator-(const pair<S,T> &s, const pair<S,T> &t){ return pair<S,T>(s.first-t.first, s.second-t.second);}

const int INF = 1<<28;
const double EPS = 1e-8;
const int MOD = 1000000007;

int T, h, w, n;

int main(int argc, char *argv[]){
    ios::sync_with_stdio(false);
    while(cin >> h >> w){
        vector<string> s(h);
        REP(i, h) {
            cin >> s[i];
        }
        vector<vi> dp(h + 1, vi(w + 1, 0));
        dp[1][1] = 1;
        REPS(i, h) {
            REPS(j, w) {
                if (s[i - 1][j - 1] == '.') {
                    dp[i][j] = (dp[i][j] + dp[i][j - 1]) % MOD;
                    dp[i][j] = (dp[i][j] + dp[i - 1][j]) % MOD;
                }
            }
        }
        cout << dp[h][w] << endl;
    }
    return 0;
}


Measured memory_bytes: 5248
#include<stdio.h>
#include<string.h>
#define LEN 1000005
typedef struct pp{
  char name[100];
  int t;
}P;

P Q[LEN+1];

int main(){
  int elaps=0,c;
  int i,q,n,sum=0;
  P u;

  scanf("%d %d", &n, &q);
  for ( i = 1; i <= n; i++){
    scanf("%s", Q[i].name);
    scanf("%d", &Q[i].t);
  }

  i=1;
  sum=n;

  while(1){
    if(Q[i].t<=q){
      sum--;
      elaps+=Q[i].t;
      printf("%s %d\n",Q[i].name,elaps);
      if(sum==0)break;
    }
    else{
      elaps+=q;
      Q[i].t-=q;
      Q[i+sum].t=Q[i].t;
      strcpy(Q[i+sum].name,Q[i].name);
    }
    i++;
  }
  return 0;
}



Measured memory_bytes: 20928
#include <stdio.h>
#include <algorithm>
#include <utility>
#include <functional>
#include <cstring>
#include <queue>
#include <stack>
#include <cmath>
#include <iterator>
#include <vector>
#include <string>
#include <set>
#include <iostream>
#include <random>
#include <map>
#include <iomanip>
#include <stdlib.h>
#include <list>
#include <typeinfo>
#include <list>
#include <set>
#include <cassert>
#include <fstream>
#include <unordered_map>
#include <cstdlib>
#include <complex>
#include <cctype>
#include <bitset>
using namespace std;

using ll = long long;
using vll = vector<long long>;
using pll = pair<long long, long long>;
#define rep(i,n) for(long long i(0);(i)<(n);(i)++)


void solve(std::string S){
    if(S <= "2019/04/30")
        cout << "Heisei"<<endl;
    else
        cout << "TBD"<<endl;
}

int main(){
    std::string S;
    std::cin >> S;
    solve(S);
    return 0;
}


Measured memory_bytes: 256
import bisect

N, K = map(int, input().split())
d = []


for i in range(N):
    a, b = map(int, input().split())
    d.append([a,b])

d.sort()

l = [0] * N
l[0] = d[0][1]

for i in range(1, N):
    l[i] = d[i][1]+ l[i-1]

pos = bisect.bisect_left(l, K)
print(d[pos][0])

Measured memory_bytes: 24320
import java.util.Scanner;
import java.util.HashMap;
import java.util.List;
import java.util.Arrays;
import java.util.ArrayList;
import java.lang.Math;

public class Main {

    static Scanner sc = new Scanner(System.in);

    public static void main(String[] args) {
        int n = sc.nextInt();
        int m = sc.nextInt();
        int[][] lr = new int[m][2];
        for (int i = 0; i < m; i++) {
            lr[i][0] = sc.nextInt();
            lr[i][1] = sc.nextInt();
        }
        int maxl = lr[0][0];
        int minr = lr[0][1];
        for (int i = 1; i < m; i++) {
            if (maxl < lr[i][0]) {
                maxl = lr[i][0];
            }
            if (minr > lr[i][1]) {
                minr = lr[i][1];
            }
        }
        if (minr - maxl > 0) {
            System.out.println(minr - maxl + 1);
        } else if (minr - maxl == 0) {
            System.out.println(1);
        } else {
            System.out.println(0);
        }
    }

}


Measured memory_bytes: 88680
import std.stdio;
import std.conv;
import std.string;
import std.typecons;
import std.algorithm;
import std.array;
import std.range;
import std.math;
import std.regex : regex;
import std.container;
import std.bigint;


void main()
{
	auto n = readln.chomp.to!int;
  auto t = readln.chomp.split.map!(to!int);
  auto a = readln.chomp.split.map!(to!int);

  auto res1 = new int[](n);
  res1[0] = t[0];
  foreach (i; 1..n) {
    if (t[i] - t[i-1]) {
      res1[i] = t[i];
    } else {
      res1[i] = 1;
    }
  }
  auto res2 = new int[](n);
  res2[$-1] = a[$-1];
  foreach_reverse (i; 0..n-1) {
    if (a[i] - a[i+1]) {
      res2[i] = a[i];
    } else {
      res2[i] = 1;
    }
  }

  long sum = 1;
  foreach (i; 0..n) {
    auto diff = min(t[i], a[i]) - max(res1[i], res2[i]) + 1;
    if (diff < 0) diff = 0;
    sum = (sum*diff)% 1_000_000_007;
  }
  writeln(sum);
}


Measured memory_bytes: 7752
function Main(input) {
  const isUpperCase = c => {
    return /^[A-Z]+$/g.test(c)  
  }
  var tmp = input.trim();
  if (isUpperCase(tmp)){
    console.log('A');}
    else {console.log('a')};
  }

  Main(require("fs").readFileSync("/dev/stdin", "utf8"));

Measured memory_bytes: 29684
//keep trying :)
#include <bits/stdc++.h>
#define float long double
#define int long long
#define ll long long
#define PB push_back
#define MP make_pair
#define ss second
#define ff first
#define PI 3.14159265
#define MXX 9*(1e18)
#define fastrack ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
using namespace std;
void PT(int a);
void PT1(int a);
const int M = 3*(1e5) + 7, mod = 1e9 + 7;
const int inf = 1000000000000000000;

signed main(){
    fastrack;
    //int tt; cin >> tt; while(tt--)
    {
        int n;
        cin >> n;
        int a[n + 5] = {};
        for(int i = 1; i <= n; i++)
            cin >> a[i];
        sort(a + 1, a + n + 1);
        int ans = 1;
        for(int i = 1; i <= n; i++){
            if(a[i] > ((float)inf / ans))
                return cout << -1 << "\n", 0;
            else
                ans *= a[i];
        }
        cout << ans << "\n";
    }
    return 0;
}

void PT(int a){
    cout << a << "\n";
}

void PT1(int a){
    cout << a << " ";
}


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

int sgn(int x)
{
    if (x < 0)
        return -1;
    return 1;
}

int32_t main()
{
    ios::sync_with_stdio(0);
    int a, b;
    cin >> a >> b;
    if (a == 0 || b == 0 || (a < 0 && b > 0))
    {
        cout << "Zero\n";
        return 0;
    }
    int ans = 1;
    for (int i = a; i <= b; ++i)
        ans *= sgn(i);
    if (ans == 1)
        cout << "Positive\n";
    else
        cout << "Negative\n";
    return 0;
}

Measured memory_bytes: 256
import sys,collections as cl,bisect as bs
sys.setrecursionlimit(100000)
input = sys.stdin.readline
mod = 10**9+7
Max = sys.maxsize
def l(): #intのlist
    return list(map(int,input().split()))
def m(): #複数文字
    return map(int,input().split())
def onem(): #Nとかの取得
    return int(input())
def s(x): #圧縮
    a = []
    if len(x) == 0:
        return []
    aa = x[0]
    su = 1
    for i in range(len(x)-1):
        if aa != x[i+1]:
            a.append([aa,su])
            aa = x[i+1]
            su = 1
        else:
            su += 1
    a.append([aa,su])
    return a
def jo(x): #listをスペースごとに分ける
    return " ".join(map(str,x))
def max2(x): #他のときもどうように作成可能
    return max(map(max,x))
def In(x,a): #aがリスト(sorted)
    k = bs.bisect_left(a,x)
    if k != len(a) and a[k] ==  x:
        return True
    else:
        return False

def pow_k(x, n):
    ans = 1
    while n:
        if n % 2:
            ans *= x
        x *= x
        n >>= 1
    return ans

"""
def nibu(x,n,r):
    ll = 0
    rr = r
    while True:
        mid = (ll+rr)//2

    if rr == mid:
        return ll
    if (ここに評価入れる):
        rr = mid
    else:
        ll = mid+1
"""

def Topo_sort(x,y):
    co = cl.Counter(n for m in x.values() for n in m)
    S = cl.deque([i for i in range(y) if co[i] == 0])
    while S:
        n = S.popleft()
        yield n
        for i in x[n]:
            co[i] -= 1
            if co[i] <= 0:
                S.append(i)
    """
    if sum(co.values()) != 0:
        print(1)
        exit()
    else:
        print(0)
        exit()
    """
    #閉路検出(1が存在,0が存在しない)
# g = cl.defaultdict(set)に有向グラフを作成し(g[~] != ~ ,yはノード数) リストが帰ってくる


    #閉路検出(1が存在,0が存在しない)
# g = cl.defaultdict(set)に有向グラフを作成し(g[~] != ~ ,yはノード数) リストが帰ってくる






n,k = m()

g = cl.defaultdict(set)

gb = cl.defaultdict(set)
for i in range(k):
    a,b = m()
    a -= 1
    b -= 1
    g[a].add(b)
    gb[b].add(a)

ans = [None for i in range(n)]

for opt in range(n):
    for start in g[opt]:
        cost = [-1]*n
        cost[start] = 0
        de = [start]
        po = []
        fl = True

        while len(de) > 0 and fl:
            po = []
            for i in de:
                for j in g[i]:
                    if cost[j] < 0:
                        cost[j] = cost[i] + 1
                        po.append(j)
                        if j == opt:
                            fl = False
            de = po

        if cost[opt] >= 0 and cost[opt] < len(ans):
            p = opt
            ans = [p+1]
            while p != start:
                for e in gb[p]:
                    if cost[p] == cost[e] + 1:
                        p = e
                        ans.append(p+1)
                        break
if ans[0] == None:
    print(-1)
else:
    print(len(ans))
    for i in ans:
        print(i)



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

int main(void){
	int n, x;

	while(cin >> n >> x){

		int ans = 0;
		if(n == 0 && x == 0) break;

		for(int i=1; i<=n; i++){
			for(int j=i+1; j<=n; j++){
				for(int k=j+1; k<=n; k++){
					if(i+j+k == x) ans++;
				}
			}
		}

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


	return 0;
}

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

//type
#define ll long long
typedef pair<int, int> P;
//定数
#define INF 1000000000000 //10^12:∞
#define MOD 1000000007    //10^9+7:合同式の法
#define MAXR 100000       //10^5:配列の最大のrange
//略記
#define PB push_back //挿入
#define MP make_pair //pairのコンストラクタ
#define F first      //pairの一つ目の要素
#define S second     //pairの二つ目の要素
#define Z class
// OTHER
// xの二乗を返す (関数テンプレート版)
template <typename T>
T square(T x) { return x * x; }
template <class T>
T GCD(T a, T b)
{
    T r;
    while (a)
        r = b, b = a, a = r % a;
    return b;
}
template <class T>
T LCM(T a, T b) { return a / GCD(a, b) * b; }

#define chmax(x, y) (x = max(x, y))
#define chmin(x, y) (x = min(x, y))
// loop
#define rep(i, n) for (ll i = 0; i < (n); i++)
#define repe(i, n) for (ll i = 0; i <= (n); i++)
#define repd(i, n) for (ll i = n; i >= 0; i--)
#define FOR(i, a, b) for (ll i = a; i <= (b); i++)
#define FORD(i, a, b) for (ll i = a; i >= (b); i--)
#define FORA(i, I) for (const auto &i : I)

// vector
#define ALL(x) x.begin(), x.end()
typedef vector<int> vi;
typedef vector<string> vs;
typedef vector<vi> vvi;
typedef vector<ll> vl;
#define ERASE(x) x.erase(unique(ALL(x)), x.end()); // erase same elements
#define VEC(type, c, n)     \
    std::vector<type> c(n); \
    for (auto &i : c)       \
        std::cin >> i;

// input
#define INIT                          \
    std::ios::sync_with_stdio(false); \
    std::cin.tie(0);
#define VAR(type, ...) \
    type __VA_ARGS__;  \
    MACRO_VAR_Scan(__VA_ARGS__);
template <typename T>
void MACRO_VAR_Scan(T &t)
{
    std::cin >> t;
}
template <typename First, typename... Rest>
void MACRO_VAR_Scan(First &first, Rest &... rest)
{
    std::cin >> first;
    MACRO_VAR_Scan(rest...);
}

// output
template <typename T>
void MACRO_OUT(const T t) { std::cout << t; }

#define OUT(...) MACRO_OUT(__VA_ARGS__);
#define SP std::cout << " ";
#define TAB std::cout << "\t";
#define BR std::cout << "\n";
#define ENDL std::cout << std::endl;

#define YES() printf("YES\n")
#define NO() printf("NO\n")
#define isYES(x) printf("%s\n", (x) ? "YES" : "NO")
#define Yes() printf("Yes\n")
#define No() printf("No\n")
#define yes() printf("yes\n")
#define no() printf("no\n")
#define ln cout << '\n'
template <Z A>
void pr(A a)
{
    cout << a;
    ln;
}
template <Z A, Z B>
void pr(A a, B b)
{
    cout << a << ' ';
}

double ans = 0;
bool check = 0;
bool boo = 0;
string s, t;
int N = 3;
vector<int> v(N);
ll a, b, c, d, n, k, m = 1000000;
ll minn = INF, maxx = 0;
int x = 0, y = 0;
int sum;
char ch;

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
// cout << (conditon ? (result:  == 1 ): (==0)) << endl; <- output result of if
// long long 型が表せる値の上限はおよそ 9 × 10＾18 です．
int main()
{
    INIT;
    cin >> s;
    rep(i, s.length())
    {
        sum += s[i] - 48;
    }
    n = stoi(s);
    if (n % sum == 0)
        Yes();
    else
        No();

    return 0;
}


Measured memory_bytes: 3628
A, B=map(int,input().split())
Ans = 0

N = A % 3
if N==0:
  Ans = 1
  
N = B % 3
if N==0:
  Ans = 1

N = (A+B) % 3
if N==0:
  Ans = 1

if Ans==1:
  print('Possible')
else:
    print('Impossible')


Measured memory_bytes: 3060
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <deque>
#include <fstream>
#include <functional>
#include <iostream>
#include <istream>
#include <iterator>
#include <sstream>
#include <list>
#include <map>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <utility>
#include <vector>
#include <iomanip>
#define BR "\n"
#define REP(i,n) for(int (i)=0;(i)<(n);++(i))
#define ALL(cont) begin(cont),end(cont)
#define AS_MOD(a,b) ((((a) % (b) ) + (b)) % (b))
#define FEACH(it,cont) for(auto (it) = begin(cont); it!=end(cont);++it)
#define FEACHR(it,cont) for(auto (it) = rbegin(cont); it!=rend(cont);++it)
#define pb push_back
#define pob pop_back
#define fi first
#define se second
#define getll() ([](){ll s;scanf("%lld", &s);return s;})()
#define getld() ([](){ld s;scanf("%Lf", &s);return s;})()
#define prl(P) printf("%lld", P)
#define prd(P) printf("%.10Lf", P)
#define pr(P) printf(P)
#define MAX(V, T) V=max(V,T)

#define DumpArray(cont,from,to) for(int __i=from;__i<to;++__i) {cout<<"(" <<__i<<": " << cont[__i]<<")";} cout<<endl;

using namespace std;
typedef long long ll;
typedef long double ld;
int N;
vector<int> D;
int main() {
    cin >> N;
    D.resize(N);
    REP(i,N)
        cin >> D[i];
    sort(ALL(D));
    cout<<D[N/2]-D[N/2-1]<<endl;
    return 0;
}


Measured memory_bytes: 640
#include <bits/stdc++.h>
#define int long long
#define rep(i,n) for(int i=0;i<n;i++)
#define Rep(i,a,b) for(int i=a;i<b;i++)
#define REP(i,a,b) for(int i=a;i<=b;i++)
#define rev(i,n) for(int i=n-1;i>=0;i--)
#define vi vector<int>
#define pb push_back
#define pi pair<int,int>
#define vp vector<pair<int,int> >
#define mp make_pair
#define all(v) (v).begin(),(v).end()
#define fi first
#define se second

using namespace std;

signed main(){
    double d,n,b;
    cin>>d>>n>>b;
    vector<pair<double,double>> v(n);
    rep(i,n){
        double p,h;
        cin>>p>>h;
        v[i]=mp(p,h);
    }
    double ans=DBL_MAX;
    rep(k,b+1){
        double l=d/(k+1);
        double vx=l/2;
        int c=0;
        rep(i,n){
            while((c+1)*l<v[i].fi)c++;
            double x=v[i].fi-c*l;
            if((x*l-x*x)/(2*vx)<v[i].se){
                vx=(x*l-x*x)/(2*v[i].se);
            }
        }
        ans=min(ans,vx+l*l/(4*vx));
    }
    printf("%f\n",sqrt(ans));
    return 0;
}


Measured memory_bytes: 3284
#include <iostream>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <algorithm>
#include <climits>

using namespace std;

long long a, b;
int k;

int main() {

	cin >> a >> b >> k;

	for (int i = 0; i < k; ++i)
	{
		if (i%2 == 0)
		{
			if (a&1)
				--a;
			
			b += a/2;
			a >>= 1;
		} else {
			if (b&1)
				--b;

			a += b/2;
			b >>= 1;
		}
	}
	cout << a << " " << b << endl;

	return 0;
}

Measured memory_bytes: 256
#include <iostream>
using namespace std;
#define rep(i, n) for(int i = 0; i < (n); i++)

int a[60], b[60], c[60], d[60];

int main(void)
{
  int ans = 0;
  int n, m, q; cin >> n >> m >> q;
  rep(i,  q) {
    cin >> a[i] >> b[i] >> c[i] >> d[i];
  }
    int itr[12], k[12];
    for(int i = 0; i <= 11; i++) k[i] = m;
    itr[0] = 1;
    for(itr[1] = itr[0]; itr[1] <= k[1]; itr[1] ++) {
    for(itr[2] = itr[1]; itr[2] <= k[2]; itr[2] ++) {
    for(itr[3] = itr[2]; itr[3] <= k[3]; itr[3] ++) {
    for(itr[4] = itr[3]; itr[4] <= k[4]; itr[4] ++) {
    for(itr[5] = itr[4]; itr[5] <= k[5]; itr[5] ++) {
    for(itr[6] = itr[5]; itr[6] <= k[6]; itr[6] ++) {
    for(itr[7] = itr[6]; itr[7] <= k[7]; itr[7] ++) {
    for(itr[8] = itr[7]; itr[8] <= k[8]; itr[8] ++) {
    for(itr[9] = itr[8]; itr[9] <= k[9]; itr[9] ++) {
    for(itr[10] = itr[9]; itr[10] <= k[10]; itr[10] ++) {

    // edit here.
      
    int p = 0;
    rep(i, q) {
      if(itr[b[i]] - itr[a[i]] == c[i]) p += d[i];
    }
    if(p > ans) ans = p;
    
    } // itr[10]
    } // itr[9]
    } // itr[8]
    } // itr[7]
    } // itr[6]
    } // itr[5]
    } // itr[4]
    } // itr[3]
    } // itr[2]
    } // itr[1]
    cout << ans << endl;
}


Measured memory_bytes: 3636