akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;
#define REP(i,x,n) for(int i=x;i<(int)n;i++)
#define rep(i,n) REP(i,0,n)
#define sp(p) cout<<setprecision(16)<<fixed<<p<<endl;
#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define SORT(a) sort(all(a))
#define RSORT(a) sort(rall(a))
#define UNIQ(a) unique(all(a))
#define UNIQNUM(a) UNIQ(a)-a.begin()
#define UNIQIT(a) a.erase(UNIQ(a), a.end());
#define VOUT(v,i) rep(i,v.size())cout<<v[i]<<(i==v.size()-1?"\n":" ");
#define vout(v) VOUT(v,z);
#define vdbg(v,i) cout<<#v<<": ";for(int i=0;i<(int)v.size();i++){cout<<v[i]<<" ";}cout<<"\n";
#define vmin(v) *min_element(all(v))
#define vmax(v) *max_element(all(v))
#define vsum(v) accumulate(all(v), 0LL)
#define MOUT(m,r,c) rep(i,r){rep(j,c){cout<<m[i][j]<<" ";}cout<<endl;}
#define mout(m) MOUT(m,m.size(),m[0].size())
#define debg(a) cout<<#a<<": "<<a<<endl;
#define show(a) for(cont &y:a){for(cont &x:y){cout<<x<<" ";}cout<<endl;}
#define digit(a) to_string(a).length();
template<class T>inline int out(const T &t){ print(t); putchar('\n'); return 0; }
// template<class T>inline T gcd(T a,T b){if(b==0)return a; return(gcd(b,a%b));}
// template<class T>inline T lcm(T a,T b){return a/gcd(a,b)*b;}
bool is_palindrome(string s){return s == string(s.rbegin(),s.rend());}
#define popcount __builtin_popcount
typedef long long ll;
typedef long double ld;
typedef pair<ll,ll> P;
typedef vector<ll> V;
typedef vector<vector<ll>> VV;
// const long long MOD=1000000007;
const long long INF = 1e18;
#define EPS (1e-7)
#define PI (acos(-1))
template<class T>
inline bool chmax(T &a, T b) {
    if(a < b) { a = b; return true; }
    return false;
}
template<class T>
inline bool chmin(T &a, T b) {
    if(a > b) { a = b; return true; }
    return false;
}



int main(){
    long long N;
    scanf("%lld",&N);
    std::vector<long long> A(N);
    for(int i = 0 ; i < N ; i++){
        scanf("%lld",&A[i]);
    }
    // vector<int> v(N);
    // int ini=A[0];
    // int j=1;
    // for (long long i = 0; i < N-1; ) {
    //     if(A[i]<=A[j]){
    //         v[i]=1;
    //         j++;
    //         i++;
    //     }else if(A[i]>A[j]){
    //         v[i]=-1;
    //         j++;
    //         i++;
    //     }
    // }
    // ll ret = 1000;
    // ll stk = 0;
    // for (long long i = 0; i < N; i++) {
    //     if(v[i]==1){
    //         ret += stk*A[i];
    //         stk=0;
    //         stk = (ret/A[i]);
    //         ret -= (ret/A[i])*A[i];
    //     }else if(v[i]==-1 || i==N-1){
    //         ret += stk*A[i];
    //         stk=0;
    //     }
    // }
    // cout << ret << endl;
    ll money = 1000;
    ll stock = 0;
    for (long long i = 0; i < N; i++) {
        if (A[i] > A[i + 1] || i == N - 1) {
          money += A[i] * stock;
          stock = 0;
        } else if (A[i] < A[i + 1]) {
          money += A[i] * stock;
          stock = 0;
          stock += money / A[i];
          money -= stock * A[i];
        }
    }
    cout << money << endl;
    return 0;
}


Measured memory_bytes: 3700
# -*- coding: utf-8 -*-
import numpy as np

# スペース区切りの整数の入力
A1,B1,C1 = map(int, input().split())
A2,B2,C2 = map(int, input().split())
A3,B3,C3 = map(int, input().split())

np_arr = np.array([[A1,B1,C1], [A2,B2,C2],[A3,B3,C3]])

bingo_list=(np_arr==-1)

K= int(input())

for num in range(K):
    Z = int(input())
    bingo_list+=(np_arr==Z)





if sum(bingo_list[:,0])==3 or sum(bingo_list[:,1])==3 or sum(bingo_list[:,2])==3 or sum(bingo_list[0,:])==3 or sum(bingo_list[1,:])==3 or sum(bingo_list[2,:])==3 or (bingo_list[0,0]*1+bingo_list[1,1]*1+bingo_list[2,2]*1)==3 or (bingo_list[2,0]*1+bingo_list[1,1]*1+bingo_list[0,2]*1)==3:
    print("Yes")
else:
    print("No")


Measured memory_bytes: 12516
#include <bits/stdc++.h>
 
using namespace std;
 
#define MAX 100
 
char A[MAX][MAX],B[MAX][MAX];
 
void compress(int &h,int &w){
    int a = w,b = h;
    bool use[MAX],use2[MAX];
    vector<string> res;
 
    fill(use,use+h,true);
    fill(use2,use2+w,true);
 
    for(int i = 0 ; i < h ; i++){
	int cnt = 0;
	for(int j = 0 ; j < w ; j++){
	    if(A[i][j] != '.'){
		break;
	    }
	    cnt++;
	}
	if(cnt == w){ use[i] = false; a--; }
    }
 
    for(int i = 0 ; i < w ; i++){
	int cnt = 0;
	for(int j = 0 ; j < h ; j++){
	    if(A[j][i] != '.'){
		break;
	    }
	    cnt++;
	}
	if(cnt == h){ use2[i] = false; b--; }
    }
    for(int i = 0 ; i < h ; i++){
	if(!use[i]) continue;
	string s;
	for(int j = 0 ; j < w ; j++){
	    if(!use2[j]) continue;
	    s += A[i][j];
	}
	if(s.size() > 0){
	    res.push_back(s);
	}
    }
    h = res.size(); w = res[0].size();
    for(int i = 0 ; i < h ; i++){
	for(int j = 0 ; j < w ; j++){
	    A[i][j] = res[i][j];
	}
    }
}
 
void rotate(int &h,int &w){
    char tmp[MAX][MAX];
    for(int i = 0 ; i < h ; i++){
	for(int j = 0 ; j < w ; j++){
	    tmp[i][j] = A[i][j];
	}
    }
    for(int i = 0 ; i < h ; i++){
	for(int j = 0 ; j < w ; j++){
	    A[w-j-1][i] = tmp[i][j];
	}
    }
    int nh = w,nw = h;
    h = nh; w = nw;
}
 
int getPoint(int H,int W){
    int res = 0;
    for(int i = 0 ; i < H ; i++){
	int cnt = 0;
	for(int j = 0 ; j < W ; j++,cnt++){
	    if(B[i][j] != '#') break;
	}
	if(cnt == W){ res++; }
    }
    return res;
}
 
int getMaxScore(int h,int w,int H,int W){
    int maxPoint = -1;
    char C[MAX][MAX];
    for(int i = 0 ; i < H ; i++){
	for(int j = 0 ; j < W ; j++){
	    for(int k = 0 ; k < 4 ; k++){
		rotate(h,w);
		for(int l = 0 ; l < H ; l++){
		    for(int m = 0 ; m < W ; m++){
			C[l][m] = B[l][m];
		    }
		}
		bool ok = true;
		if(i+h > H || j+w > W) continue;
		for(int l = i ; l < i+h ; l++){
		    for(int m = j ; m < j+w ; m++){
			if(A[l-i][m-j] == '#' && B[l][m] == '#'){
			    ok = false; break;
			}
			if(A[l-i][m-j] == '#' && B[l][m] == '.'){
			    B[l][m] = A[l-i][m-j];
			}
		    }
		    if(!ok) break;
		}
		if(ok){
		    maxPoint = max(maxPoint,getPoint(H,W));
		}
		for(int l = 0 ; l < H ; l++){
		    for(int m = 0 ; m < W ; m++){
			B[l][m] = C[l][m];
		    }
		}
	    }
	}
    }
    return maxPoint;
}
 
int main(){
    int Tc,h,w,H,W;
    cin >> Tc;
    while(Tc--){
	cin >> h >> w;
	for(int i = 0 ; i < h ; i++){
	    for(int j = 0 ; j < w ; j++){
		cin >> A[i][j];
	    }
	}
	cin >> H >> W;
	for(int i = 0 ; i < H ; i++){
	    for(int j = 0 ; j < W ; j++){
		cin >> B[i][j];
	    }
	}
	compress(h,w);
	cout << getMaxScore(h,w,H,W) << endl;
    }
    return 0;
}

Measured memory_bytes: 3168
k = 72
K = 1<<k
nu = lambda L: int("".join([bin(K+a)[-k:] for a in L[::-1]]), 2)
st = lambda n: bin(n)[2:] + "0"
li = lambda s, l: [int(a, 2) if len(a) else 0 for a in [s[-(i+1)*k-1:-i*k-1] for i in range(l)]]

def grow(d, v, h):
    h += [0] * d
    f = [(-1 if (i+d) % 2 else 1) * fainv[i] * fainv[d-i] % P * h[i] % P for i in range(d+1)]
    
    for idx, a in enumerate([d+1, d * fa[v-1] * fainv[v] % P, (d * fa[v-1] * fainv[v] + d + 1) % P]):
        t = [1] * (2*d+2)
        for i in range(1, 2*d+2): t[i] = t[i-1] * (a - d + i - 1) % P
        ti = [1] * (2*d+2)
        ti[-1] = pow(t[-1], P-2, P)
        for i in range(1, 2*d+2)[::-1]: ti[i-1] = ti[i] * (a - d + i - 1) % P
        
        g = [ti[i+1] * t[i] % P for i in range(2*d+1)]
        fg = li(st(nu(f) * nu(g)), d * 2 + 2)
            
        if idx == 1:
            for i in range(d+1):
                h[i] = h[i] * (fg[d+i] * t[d+i+1] % P * ti[i] % P) % P
        elif idx == 0:
            for i in range(d):
                h[i+d+1] = fg[d+i] * t[d+i+1] % P * ti[i] % P
        elif idx == 2:
            for i in range(d):
                h[i+d+1] = h[i+d+1] * (fg[d+i] * t[d+i+1] % P * ti[i] % P) % P
    return h

# Create a table of the factorial of the first v+2 multiples of v, i.e., [0!, v!, 2v!, ..., (v(v+1))!]
def create_table(v):
    s = 1
    X = [1, v+1]
    while s < v:
        X = grow(s, v, X)
        s *= 2
    table = [1]
    for x in X:
        table.append(table[-1] * x % P)
    return table

def fact(i, table):
    a = table[i//v]
    for j in range(i//v*v+1, i+1):
        a = a * j % P
    return a

P = 10**9+7
v = 1 << 11
fa = [1] * (2*v+2)
fainv = [1] * (2*v+2)
for i in range(2*v+1):
    fa[i+1] = fa[i] * (i+1) % P
fainv[-1] = pow(fa[-1], P-2, P)
for i in range(2*v+1)[::-1]:
    fainv[i] = fainv[i+1] * (i+1) % P

T = create_table(v)

f = lambda a, b: fact(a+b+2, T) * pow(fact(a+1, T) * fact(b+1, T), P-2, P) % P
r1, c1, r2, c2 = map(int, input().split())
print((f(r2, c2) - f(r2, c1-1) - f(r1-1, c2) + f(r1-1, c1-1)) % P)


Measured memory_bytes: 4748
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const ll INF = 1LL << 60;

int main() {
    int n, m;
    cin >> n >> m;
    int *a = new int[n];
    for (int i = 0; i < n; i++) {
        cin >> a[i];
    }

    int sum = 0;
    for (int i = 0; i < n; i++) {
        sum += a[i];
    }
    int cnt = 0;
    for (int i = 0; i < n; i++) {
        if (a[i] * 4 * m >= sum) {
            cnt++;
        }
    }
    if (cnt >= m) {
        cout << "Yes" << endl;
    } else {
        cout << "No" << endl;
    }
    return 0;
}

Measured memory_bytes: 3640
def main():
	#A, B = [int(x) for x in input().split()]
	N = int(input())
	
	s = set()
	for i in range(1, 10):
		for j in range(1, 10):
			s.add(i*j)

	if N in s:
		print("Yes")
	else:
		print("No")

if __name__ == "__main__":
	main()


Measured memory_bytes: 2940
import sys
n,a,b=map(int,input().split())
if n<a+b:
    if n>=a:
        print(a)
        sys.exit()
    else:
        print(n)
        sys.exit()
nn=n//(a+b)
nnn=n%(a+b)
ans=nn*a

if nnn>=a:
    ans+=a
else:
    ans+=nnn

print(ans)

Measured memory_bytes: 3064
#include <bits/stdc++.h>
using namespace std;
int main() {
    string s; cin >> s;
    if (s[0] == 'A') cout << "T" << endl;
    else if (s[0] == 'G') cout << "C" << endl;
    else if (s[0] == 'C') cout << "G" << endl;
    else if (s[0] == 'T') cout << "A" << endl;
    return 0;
}

Measured memory_bytes: 256
$n = gets.to_i

def koch(d, p1, p2)
  if d == 0
    return
  end
  s, t, u = [], [], []
  # 繰り返し
    # 3当分
    # s,tのx座標
    s[0] = (p2[0] - p1[0]) / 3 + p1[0]
    t[0] = (p2[0] - p1[0]) / 3 * 2 + p1[0]
    # s,tのy座標
    s[1] = (p2[1] - p1[1]) / 3 + p1[1]
    t[1] = (p2[1] - p1[1]) / 3 * 2 + p1[1]
    # 正三角形作成
    u[0] = (t[0] - s[0]) * Math.cos(Math::PI / 3) - (t[1] - s[1]) * Math.sin(Math::PI / 3) + s[0]
    u[1] = (t[0] - s[0]) * Math.sin(Math::PI / 3) + (t[1] - s[1]) * Math.cos(Math::PI / 3) + s[1]
    koch(d - 1, p1, s)
    puts "#{s[0]} #{s[1]}"
    koch(d - 1, s, u)
    puts "#{u[0]} #{u[1]}"
    koch(d - 1, u, t)
    puts "#{t[0]} #{t[1]}"
    koch(d - 1, t, p2)
end


def main
  p1, p2 = [], []
  p1[0] = 0.0
  p1[1] = 0.0
  p2[0] = 100.0
  p2[1] = 0.0
  puts "#{p1[0]} #{p1[1]}"
  koch($n, p1, p2)
  puts "#{p2[0]} #{p2[1]}"
end

main



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

using namespace std;

int data[2];
int result = 0;

int main()
{
  cin >> data[0] >> data[1];
  if (data[0] == data[1])
  {
    cout << data[0] * 2;
  }
  else
  {
    result += max(data[0], data[1]);
    result += max(data[0], data[1]);
    cout << result - 1;
  }
}

Measured memory_bytes: 256
N, D = map(int, input().split())
X = [list(map(int, input().split())) for _ in range(N)]

cnt = 0
dst = 0

for i in range(N):
    for j in range(i+1, N):
        dst = 0
        for k in range(D):
            dst += (X[i][k] - X[j][k]) ** 2
        if int(dst ** 0.5) ** 2 == dst:
            cnt += 1
        
print(cnt)

Measured memory_bytes: 3064
def ketasuu(n):
    ans  = 0
    while (n >= 1):
        n = n/10
        ans += 1
    return ans

n = int(input())

k = ketasuu(n)
ans = 0
for i in range(1,k,2):
    ans += 10**i-10**(i-1)
if (k%2 == 1):
    ans += n-10**(k-1)+1

print(ans)




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

int main(){
  char s[26];
  int a[26],b[26];
  cin >> s;
  for(int i=0;i<strlen(s);i++){
    a[i] = s[i] - 'a';
    b[i] = 0;
  }
 
  for(int i=0;i<strlen(s);i++){

    b[a[i]] ++;
    //cout <<a[i]<< b[i] << endl;
  }
  bool ans=false;
  for(int i=0;i<strlen(s);i++){
    if(b[i]>=2){
      ans = true;
      break;
    }
  }
  if(ans)cout << "no" << endl;
  else cout << "yes" << endl;
}

Measured memory_bytes: 256
using System;
using System.Collections.Generic;
public class Hello{
    static string MakeEdge(int width){
        string edge = "";
        for(int i = 0;i < width + 2;i++){
            edge += "#";
        }
        return edge;
    }
    public static void Main(){
        string[] input = Console.ReadLine().Split(' ');
        int H = int.Parse(input[0]);
        int W = int.Parse(input[1]);
        
        var answers = new List<string>();
        
        answers.Add(MakeEdge(W));//蓋を作る
        for(int i = 0;i < H;i++){
            string s = Console.ReadLine();
            answers.Add("#" + s + "#");
        }
        answers.Add(MakeEdge(W));//底を作る
        //答えを出力
        foreach(string ans in answers){
            Console.WriteLine(ans);
        }
    }
}


Measured memory_bytes: 13140
#include<bits/stdc++.h>
using namespace std;
int main(){
  int n,q;
  cin >> n >> q;
  string s;
  cin >> s;
  vector<int> l(q);
  vector<int> r(q);
  vector<int> sum(n);
  int i;
  for(i=0;i<q;i++){
    cin >> l[i] >> r[i];
  }
  sum[0] = 0;
  for(i=0;i<n-1;i++){
    if(i!=0)sum[i] = sum[i-1];
    if(s[i]=='A'&&s[i+1]=='C'){
      sum[i+1]=sum[i]+1;
      i++;
    }
    if(sum[n-1]==0)sum[n-1]=sum[n-2];
  }
  int ans = 0;
  for(i=0;i<q;i++){
    if(l[i]!=1)ans = sum[r[i]-1]-sum[l[i]-2];
    else ans = sum[r[i]-1];
    if(l[i]!=1&&sum[l[i]-1]!=sum[l[i]-2])ans--;
    cout << ans << endl;
  }


}

Measured memory_bytes: 2176
#include<iostream>
#include<string>
#include<vector>
#include<cmath>
#include<cstdlib>
#include<string>
#include<algorithm>
#include<map>
#include<iomanip>
#include<limits>
#include<queue>
#include<set>
#include<cstdio>
#include<climits>
#include<cstring>

using namespace std;

const long long int MAX_N = 100000;

int main(){

	int N;

	int i4 = 0;
	int i2 = 0;
	int i1 = 0;
    cin >> N;

	for(int i = 0;i < N;i++){
		long long a;
		cin >> a;
		if(a%4 == 0){
			i4++;
		}else if(a%2 == 0){
			i2++;
		}else{
			i1++;
		}
	}

	if(i2 ==0 ){
		if(i1 <= i4 + 1){
			cout << "Yes" << endl;
		}else{
			cout << "No" << endl;
		}
	}else{
		i1++;
		if(i1<= i4+1){
			cout << "Yes" << endl;
		}else{
			cout << "No"  << endl;
		}
	}


	return 0;

}


Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
using namespace std;
int maxtime(int x) {
	// Maximum consuming time for x-minute order
	return (x + 9) / 10 * 10;
}
int remtime(int x) {
	// Remained time for x-minute order
	return maxtime(x) - x;
}
int main() {
	int A, B, C, D, E;
	cin >> A >> B >> C >> D >> E;
	int sum = maxtime(A) + maxtime(B) + maxtime(C) + maxtime(D) + maxtime(E);
	sum -= max({ remtime(A), remtime(B), remtime(C), remtime(D), remtime(E) });
	cout << sum << endl;
	return 0;
}


Measured memory_bytes: 256
#include <iostream>

using namespace std;

int main()
{
    long long l,r;;
    cin >> l >> r;
        if(l/2019!=r/2019)
            cout << 0 << endl;
        else
        {
            long long ans=999999999;
            for(long long i=l;i<=r;i++)
            {
                for(long long j=i+1;j<=r;j++)
                {
                    ans=min(i*j%2019,ans);
                }
            }
            cout << ans << endl;
        }
    return 0;
}

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

#define N 8

char s[ N ][ N ];

int
draw (
  const int x,
  const int y,
  const int p
  )
{
  int i, j, k, l;
  int res = 0;

  for ( i = -1; i <= 1; ++i )
  for ( j = -1; j <= 1; ++j )
  {
    if ( i == 0 && j == 0 ) continue ;

    for ( k = 1; ; ++k )
    {
      const int a = x + i * k;
      const int b = y + j * k;

      if ( a < 0 || b < 0 || a >= N || b >= N
        || s[ a ][ b ] == '.' )
      {
        k = 1;
        break ;
      }

      if ( s[ a ][ b ] == p )
        break ;
    }
    for ( l = 0; l < k; ++l )
    {
      const int a = x + i * l;
      const int b = y + j * l;

      s[ a ][ b ] = p;
    }
  }

  return ( res );
}

int
evaluate (
  const int x,
  const int y,
  const int p
  )
{
  int i, j, k;
  int res = 0;

  for ( i = -1; i <= 1; ++i )
  for ( j = -1; j <= 1; ++j )
  {
    if ( i == 0 && j == 0 ) continue ;

    for ( k = 1; ; ++k )
    {
      const int a = x + i * k;
      const int b = y + j * k;

      if ( a < 0 || b < 0 || a >= N || b >= N
        || s[ a ][ b ] == '.' )
      {
        k = 1;
        break ;
      }

      if ( s[ a ][ b ] == p )
        break ;
    }
    res += k - 1;
  }

  return ( res );
}

int
main (
  int   argc,
  char *argv[ ]
  )
{
  int i, j;

  for ( i = 0; i < N; ++i )
  for ( j = 0; j < N; ++j )
    scanf ( " %c", &s[ i ][ j ] );

  for ( ; ; )
  {
    int pass = 0;
    int x, y;
    int ev;

    ev = x = y = 0;
    for ( i = 0; i < N; ++i )
    for ( j = 0; j < N; ++j )
    {
      int tev;
      
      if ( s[ i ][ j ] != '.' ) continue ;
      
      tev = evaluate ( i, j, 'o' );
      if ( tev > ev )
      {
        ev = tev; x = i; y = j;
      }
    }
    if ( ev > 0 ) { draw ( x, y, 'o' ); pass = 0; }
    else ++pass;

    ev = x = y = 0;
    for ( i = N - 1; i >= 0; --i )
    for ( j = N - 1; j >= 0; --j )
    {
      int tev;
      
      if ( s[ i ][ j ] != '.' ) continue ;
      
      tev = evaluate ( i, j, 'x' );
      if ( tev > ev )
      {
        ev = tev; x = i; y = j;
      }
    }
    if ( ev > 0 ) { draw ( x, y, 'x' ); pass = 0; }
    else ++pass;

    if ( pass >= 2 )
      break ;
  }

  for ( i = 0; i < N; ++i )
  {
    for ( j = 0; j < N; ++j )
      putchar ( s[ i ][ j ] );
    puts ( "" );
  }

  return ( EXIT_SUCCESS );
}

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

using namespace std;

typedef long long ll;
typedef pair<int, int> P;

const ll MOD = ll(1e9) + 7;
const ll INF = LLONG_MAX;
const ll MAX_N = ll(1e5) + 5;
const double EPS = 10e-8;
const double PI = 3.14159265359;

#define REP(i, n) for (ll i = 0; i < n; i++)
#define REPR(i, n) for (ll i = n; i >= 0; i--)
#define FOR(i, m, n) for (ll i = m; i < n; i++)

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

int main() {
    ll a,b,c,k;
    cin >> a >> b >> c >> k;
    if(k%2==0)cout << a-b << endl;
    else cout << b-a << endl;
    return 0;
}

Measured memory_bytes: 256
n, m = map(int, input().split())

p = [0]*(n+1)
q = [False]*(n+1)

for _ in range(m) :
  v,s = input().split()
  v = int(v)
  if q[v] : continue
  if s[0] == 'A' : q[v] = True
  else : p[v] += 1

print(sum(q), sum(p[i] for i in range(n+1) if q[i]))

Measured memory_bytes: 4596
using System;
using System.Collections.Generic;
using System.Linq;

//Paiza//AtCoder用のTemplate
public class Program
{
	public static void Main(string[] args)
	{
		int C = 0;
		//A = int.Parse(Console.ReadLine());
		//B = int.Parse(Console.ReadLine());

		var param = System.Console.ReadLine().Split(' ').Select((x) => int.Parse(x)).ToList();

		int A = param[0];
		int B = param[1];

		if (1 <= A && A <= 20 && 1 <= B && B <= 20)
		{
			if (A <= B)
			{
				if (B % A == 0)
				{
					C = A + B;
				}

				else
				{
					C = B - A;
				}

			}
			Console.WriteLine(C);
		}
	}
}

Measured memory_bytes: 11220
n, k, q = map(int, input().split())
a = [int(input()) for i in range(q)]

count = [k - q] * n
for i in a:
    count[i-1] += 1

for i in range(n):
    if count[i] <= 0:
        print("No")
    else:
        print("Yes")


Measured memory_bytes: 55896
n,k = map(int,input().split())
s = [0]*n
ans=0

for i in range(k):
  d = int(input())
  m = input().split()
  m_int = [int(s) for s in m]
#  print(d)
#  print(m_int)
  
  for j in range(d):
    s[m_int[j]-1] = 1

for k in range(n):
  if s[k] == 0:
    ans += 1

print(ans)



Measured memory_bytes: 9188
#include <bits/stdc++.h>
#include <ctime>
#include <sstream>
#define weewoo ios::sync_with_stdio(false);cin.tie(0)
#define pii pair<int,int>
#define pll pair<ll,ll>
#define ld long double
#define ll long long
#define se second
#define fi first
#define ctoi(x) x-'0'
#define pi (acos(-1))
#define llputin(a,n) for(int i=0;i<n;i++){ll x;cin >> x;a.push_back(x);}
#define iputin(a,n) for(int i=0;i<n;i++){int x;cin >> x;a.push_back(x);}

#define MOD ((ll) 1e9 + (ll) 7)
using namespace std;

ll pw(ll x,ll a){
    if(a==0)
        return 1;
    ll t = pw(x,a/2);
    if(a%2==0)
        return (t*t);
    else
        return (t*t*x);
}

bool prime(int x)
{
    if(x < 2) return false;
        for(int i=2; i<= sqrt(x); i++) {
            if ((x%i) == 0) return false;
        }
    return true;
}

vector<ll>a;
int main()
{
    weewoo;
    int n;
    cin >> n;
    for(int i=0;i<n;i++){
        ll x;
        cin >> x;
        a.push_back(x);
    }
    ll mn = n+1;
    ll ans=0;
    for(int i=0;i<n;i++){
        if(a[i]<mn){
            ans++;
        }
        mn = min(mn,a[i]);
    }
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 2420
package main
import (
	"fmt"
	"math"
)

type floats []float64
func (f *floats)find(key float64)bool{
	for _, v := range *f{
		if v==key{
			return true
		}
	}
	return false
}

func main(){
	var n int
	fmt.Scan(&n)
	cnt := 0
	// 既出の素数を保存しておく

	for i:=0; i<n; i++{
		var x float64
		var primes floats
		fmt.Scan(&x)
		if !primes.find(x) && check(x){
			cnt++
			primes = append(primes, x)
		}
	}
	fmt.Println(cnt)
}


func check(x float64)bool{
	for i:=2; i<int(math.Sqrt(x))+1; i++{
		if int(x)%i==0{
			return false
		}
	}
	return true
}


Measured memory_bytes: 1768
int main(){
int H,W,i,j,k;
for(k=0;;k++){
    scanf("%d%d",&H,&W);
    if(H==0&&W==0)break;
    for(i=0;i<H;i++){
    for(j=0;j<W;j++){
        printf("#");
        
    }
    printf("\n");
}
printf("\n");
}
return 0;
}

Measured memory_bytes: 1808
#include <bits/stdc++.h>
#define dbg() cerr <<
#define name(x) (#x) << ": " << (x) << ' ' <<

using namespace std;

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

  int fst = 300000;
  int snd = 200000;
  int trd = 100000;
  int bonus = 400000;

  int x, y; cin >> x >> y;

  if (x == 1 && y == 1) {
    cout << fst + fst + bonus << endl;
  } else {
    int ans = 0;
    auto Get = [&](int x) {
      if (x > 3) return 0;
      if (x == 3) return trd;
      if (x == 2) return snd;
      if (x == 1) return fst;
      assert(false);
    };
    cout << Get(x) + Get(y) << endl; 
  }

  cerr << "Time elapsed: " << 1.0 * clock() / CLOCKS_PER_SEC << " s.\n";
}

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

// definition {{{ 1

// scaning {{{ 2
#define Scd(x) scanf("%d", &x)
#define Scd2(x,y) scanf("%d%d", &x, &y)
#define Scd3(x,y,z) scanf("%d%d%d", &x, &y, &z)

#define Scll(x) scanf("%llu", &x)
#define Scll2(x,y) scanf("%llu%llu", &x, &y)
#define Scll3(x,y,z) scanf("%llu%llu%llu", &x, &y, &z)

#define Scc(c) scanf("%c", &c);
#define Scs(s) scanf("%s", s);
#define Scstr(s) scanf("%s", &s);
// }}} 2

// constants {{{ 2
#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))
// }}} 2

// systems {{{ 2
#define Rep(x,y) for(int x = 0; x < y; x++)
#define Repe(x,y,z) for(int x = z; x < y; x++)
// }}} 2

// output {{{ 2
#define YesNo(a) (a)?printf("Yes\n"):printf("No\n");
// }}} 2

// }}} 1

int main() {

    int N,K,a[102];
    Scd2(N,K);
    Rep(i,N)Scd(a[i]);

    int dp[200002] = {};
    Rep(i,K+1){
        if( dp[i] == 0 ){
            Rep(j,N){
                dp[i+a[j]] = 1;
            }
        }
    }

    printf ( dp[K] ? "First" : "Second" );
    printf ("\n");

    return 0;
}



Measured memory_bytes: 1024
#include <iostream>
#include <complex>
#include <vector>
#include <string>
#include <algorithm>
#include <cstdio>
#include <numeric>
#include <cstring>
#include <ctime>
#include <cstdlib>
#include <set>
#include <map>
#include <unordered_map>
#include <unordered_set>
#include <list>
#include <cmath>
#include <bitset>
#include <cassert>
#include <queue>
#include <stack>
#include <deque>
#include <random>
#include <iomanip>
typedef long long int ll;
typedef long double ld;
#define rep(i,n) for(int i=0;i<n;i++)
using namespace std;
const ll MOD=1000000007;
const ll MAX_N=500010;
const ll INF=999999999999;

bool check(int n){
    int a=n%10; n/=10;
    int b=n%10; n/=10;
    int c=n%10; n/=10;
    int d=n%10; n/=10;
    int e=n%10; n/=10;
    if(a!=e) return false;
    if(b!=d) return false;
    return true;
}

int main(){
    int a,b;
    cin>>a>>b;
    int ans=0;
    for(int i=a;i<=b;i++){
        if(check(i)) ans++;
    }
    cout<<ans<<endl;
}

Measured memory_bytes: 256
using System;
using System.Collections.Generic;
using System.Text;
					
public class Program
{
	static int[] minCost;
	
	public static void Main()
	{
		int n = int.Parse(Console.ReadLine());
		
		Node[] G = new Node[n];
		minCost = new int[n];
		
		for(int i = 0; i < n; i++) {
			G[i] = new Node(i);
			minCost[i] = -1;

            var cells = Array.ConvertAll(Console.ReadLine().Split(" ".ToCharArray()), int.Parse);
			
			for(int j = 0; j < cells[1]; j++) {
				G[i].E.Add(new Edge(cells[2*j+2], cells[2*j+3]));
			}
		}
		
		PriorityQueue<Edge> PQ = new PriorityQueue<Edge>(10000, (a,b) => a.Cost - b.Cost);
		
		PQ.Enqueue(new Edge(0,0));
		
		while(PQ.Any()) {
			Edge e = PQ.Dequeue();
			if(minCost[e.Next] > e.Cost || minCost[e.Next] == -1) { 
                minCost[e.Next] = e.Cost;
			
                for(int i = 0; i < G[e.Next].E.Count; i++) {
                    G[e.Next].E[i].Cost += e.Cost;	//?\?????£?????£???£?£???????????\?°???£?????£?????£?????£?????¨?¶???£?????£????
                    if(minCost[G[e.Next].E[i].Next] == -1) PQ.Enqueue(G[e.Next].E[i]);
                }
            }
		}
		
		StringBuilder sb = new StringBuilder();
		for(int i = 0; i<n; i++) {
			sb.Append(i);
			sb.Append(" ");
			sb.Append(minCost[i]);
			sb.AppendLine();
		}
		Console.Write(sb);
	}
}

class Edge
{
	public int Next { private set; get; }
	public int Cost { set; get; }
	
	public Edge(int n, int c)
	{
		this.Next = n;
		this.Cost = c;
	}
}

class Node
{
	public int Id { private set; get; }
	public List<Edge> E;
	
	public Node (int v)
	{
		this.Id = v;
		E = new List<Edge>();
	}
}

class PriorityQueue<T>
{
    private readonly List<T> heap;
    private readonly Comparison<T> compare;
    private int size;
    public PriorityQueue() : this(Comparer<T>.Default) {} 
    public PriorityQueue(IComparer<T> comparer) : this(16, comparer.Compare) { }
    public PriorityQueue(Comparison<T> comparison) : this(16, comparison) { }
    public PriorityQueue(int capacity, Comparison<T> comparison)
    {
        this.heap = new List<T>(capacity);
        this.compare = comparison;
    }
    public void Enqueue(T item)
    {
        this.heap.Add(item);
        var i = size++;
        while (i > 0)
        {
            var p = (i - 1) >> 1;
            if (compare(this.heap[p], item) <= 0)
                break;
            this.heap[i] = heap[p];
            i = p;
        }
        this.heap[i] = item;

    }
    public T Dequeue()
    {
        var ret = this.heap[0];
        var x = this.heap[--size];
        var i = 0;
        while ((i << 1) + 1 < size)
        {
            var a = (i << 1) + 1;
            var b = (i << 1) + 2;
            if (b < size && compare(heap[b], heap[a]) < 0) a = b;
            if (compare(heap[a], x) >= 0)
                break;
            heap[i] = heap[a];
            i = a;
        }
        heap[i] = x;
        heap.RemoveAt(size);
        return ret;
    }
    public T Peek() { return heap[0]; }
    public int Count { get { return size; } }
    public bool Any() { return size > 0; }
}

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

int main(){
  int N,K; cin>>N>>K;
  vector<ll> T(N-K);
  ll q=0,ans=0;
  for(int i=1;i<=N-K;i++){
    q+=N/(K+i)*K;
    q+=min(max(0,K-1),N%(K+i));
    ans+=N-q;
    q=0;
  }
  cout<<ans<<endl;
}

Measured memory_bytes: 1024
#include<bits/stdc++.h>
using namespace std;
#define ms(x,y) memset(x, y, sizeof(x))
#define lowbit(x) ((x)&(-x))
#define sqr(x) ((x)*(x))
typedef long long LL;
typedef pair<int,int> pii;
typedef pair<LL,LL> pll;


void run_case() {
    LL a, b;
    cin >> a >> b;
    LL gcd = __gcd(a, b);
    int ans = 1;
    for(LL i = 2; i*i <= gcd; ++i) {
        if(gcd % i == 0) {
            ans++;
            while(gcd % i == 0) gcd /= i;
        }
    }
    if(gcd > 1) ans++;
    cout << ans;
}


int main() {
    //freopen("input", "r", stdin);
    ios::sync_with_stdio(false), cin.tie(0);
    cout.flags(ios::fixed);cout.precision(9);
    //int t; cin >> t;
    //while(t--)
    run_case();
    cout.flush();
    return 0;
}

Measured memory_bytes: 3608
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <iostream>
#include <string>
#include <vector>
#include <map>
#include <set>
#include <stack>
#include <list>
#include <queue>
#include <deque>
#include <algorithm>
#include <numeric>
#include <utility>
#include <complex>
#include <functional>
using namespace std;
const int MOD = 1000000007;
typedef long long ll;
typedef pair<ll, ll> p;
const int INF = (1 << 28);
const int dx[4] = {0, 1, 0, -1}, dy[4] = {-1, 0, 1, 0};
const int Dx[8] = {0, 1, 1, 1, 0, -1, -1, -1}, Dy[8] = {-1, -1, 0, 1, 1, 1, 0, -1};
#define yes cout << "Yes" << endl
#define YES cout << "YES" << endl
#define no cout << "No" << endl
#define NO cout << "NO" << endl
#define REP(i, n) for (int i = 0; i < n; i++)
#define REPR(i, n) for (int i = n; i >= 0; i--)
#define FOR(i, m, n) for (int i = m; i < n; i++)
#define INF 2e9
#define ALL(v) v.begin(), v.end()
int n;
ll a[100000];
int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    cin >> n;
    for (int i = 0; i < n; i++)
    {
        cin >> a[i];
    }
    ll t = a[1];
    for (int i = 2; i < n; i++)
    {
        t = t ^ a[i];
    }
    if (t == a[0])
        yes;
    else
        no;
}

Measured memory_bytes: 1024
//  .:::.   .:::.
// :::::::.:::::::
// :::::::::::::::
// ':::::::::::::'
//   ':::::::::'
//     ':::::'
//       ':'
#include <bits/stdc++.h>
#define rep(i,a,b) for (i=a;i<b;i++)
#define rep2(i,a,b) for (i=a;i>=b;i--)
#define mod 1000000007
#define mod2 998244353
#define FIO ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0)
#define INF  1e9+5
#define f first
#define s second
#define endl '\n'
#define ll long long
#define ii pair <int,int>
#define pll pair <ll,ll>
#define vi vector <int>
#define vl vector <ll>
#define vvi vector < vi >
#define vii vector < ii >
#define vpl vector < pll >
#define vvii vector < vii >
#define vll vector < ll >
#define vb  vector <bool>
#define pb push_back
#define mk make_pair
#define pg priority_queue<ll, vector<ll>, greater<ll>>
#define pq priority_queue<ll>
#define sz(a) a.size()
#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define cset(a) __builtin_popcountll(a)
#define FILL(a, b, T) fill_n((T *)a, sizeof(a) / sizeof(T), b)
using namespace std;
int main()
{
    FIO;
    ll t, q, maxx, n, m, k, i, j, k1, k2, k3, x, flag, ans, sum, cnt, prev, y;
    cin>>n>>m;
    char c;
    ll a[n+1][m+1], dp[n+1][m+1];
    memset(dp,0,sizeof(dp));
    dp[1][1] = 1;
    rep(i,1,n+1)
    {
        rep(j,1,m+1)
        {
            cin>>c;
            ( c == '#')?a[i][j] = 0:a[i][j] = 1;
        }
    }
    rep(i,1,n+1)
    {
        rep(j,1,m+1)
        {
            if( a[i][j] == 0)
            {
                dp[i][j] = 0;
                continue;
            }
            dp[i][j] += dp[i-1][j];
            dp[i][j] %= mod;
            dp[i][j] += dp[i][j-1];
            dp[i][j] %= mod;
        }
    }
    cout<<dp[n][m]<<endl;
    return 0;    
}
/*
axyb
abyxb
*/

Measured memory_bytes: 15872
#include<iostream>

using namespace std;

typedef long long int ll;



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

    int x, y , z;
    cin >> x >> y >> z;
    x = x- z;
    int n = (x)/(y+z);
    cout << n << endl;
}


Measured memory_bytes: 256
# include <iostream>
# include <algorithm>
# include <vector>
# include <string>
# include <set>
# include <map>
# include <cmath>
# include <iomanip>
# include <functional>
# include <tuple>
# include <utility>
# include <stack>
# include <queue>
# include <list>
# include <bitset>
# include <complex>
# include <chrono>
# include <random>
# include <limits.h>
# include <unordered_map>
# include <unordered_set>
# include <deque>
# include <cstdio>
# include <cstring>
using namespace std;
using LL = long long;
using ULL = unsigned long long;
constexpr long long MOD = 1000000000 + 7;
constexpr long long INF = 1e17 - 10;
const double PI = acos(-1);
typedef pair<LL, LL> Pll;
int h = 0, w, n = 0, m, s, ans = 0, f[900][2] = {}, a[10000000] = {}, b[10000000] = {}, sum = 0;
int flag = 0;
string str;
int main() {
	cin >> n >> m;
	for (int i = 0; i < n; i++) {
		int AA;
		cin >> AA;
		if (a[AA] == 0)
			h++;
		a[AA]++;
	}
	sort(a, a + n+1);
	int now = 0;
	while (true) {
		if (h <= m)
			break;
		for (LL i = now; i < 1000000; i++) {
			if (a[i] != 0) {
				ans += a[i];
				h--;
				a[i] = 0;
				break;
			}
			now = i;
		}
	}
	cout << ans << endl;
	return 0;
}


Measured memory_bytes: 2304
#include <iostream>
#include <vector>
#include <string>
#include <cstdio>
#include <cmath>
#include <queue>
#include <map>
#include <set>
#include <algorithm>
#include <climits>
#include <iterator>
#include <stack>
#include <deque>
#include <list>
#include <array>
#include <unordered_set>
#include <unordered_map>
using namespace std;
const int MOD = 1e9 + 7;
int main()
{
	int n;
	cin >> n;
	int dp[n][3];
	for (int i = 0; i < n; i++)
	{
		for (int j = 0; j < 3; j++)
		{
			cin >> dp[i][j];
		}
	}

	int maxans = *max_element(dp[0], dp[0] + 3);
	for (int i = 1; i < n; i++)
	{
		for (int j = 0; j < 3; j++)
		{
			if (j == 0)
				dp[i][j] += max(dp[i - 1][j + 1], dp[i - 1][j + 2]);
			else if (j == 1)
				dp[i][j] += max(dp[i - 1][j - 1], dp[i - 1][j + 1]);
			else
				dp[i][j] += max(dp[i - 1][j - 1], dp[i - 1][j - 2]);
			maxans = max(maxans, dp[i][j]);
		}
	}

	// for (int i = 0; i < n; i++)
	// {
	// 	for (int j = 0; j < 3; j++)
	// 	{
	// 		cout << dp[i][j] << " ";
	// 	}
	// 	cout << endl;
	// }

	cout << maxans;
}

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

int main() {
  char s;
  cin >> s;
  if(s>='a') cout << "a" << endl;
  else cout << "A" << endl;

}

Measured memory_bytes: 3620
using System.Collections.Generic;
using System.Linq;
using System;

public class P
{
    public int p { get; set; }
    public List<int> c { get; set; }
}

public class Q
{
    public int d { get; set; }
    public int id { get; set; }
}

public class Hello
{
    public static void Main()
    {
        var n = int.Parse(Console.ReadLine().Trim());
        var d = new Dictionary<int, P>();
        for (int i = 0; i < n; i++) d[i + 1] = new P { c = new List<int>() };
        var dn = new string[n + 1];
        Console.ReadLine();
        dn[1] = Console.ReadLine().Trim();
        for (int i = 2; i <= n; i++)
        {
            var k = int.Parse(Console.ReadLine().Trim());
            var m = Console.ReadLine().Trim();
            dn[i] = m;
            d[k].c.Add(i);
            d[i].p = k;
        }
        print(d, dn);
    }
    static void print (Dictionary<int,P> d, string[] dn)
    {
        var st = new Stack<Q>();
        st.Push(new Q { d = 0, id = 1 });
        while (st.Count() > 0)
        {
            var w = st.Pop();
            var d2 = new string('.', w.d);
            Console.WriteLine(d2 + dn[w.id]);
            var dc = d[w.id].c.Count();
            if (dc > 0)
            {
                d[w.id].c.Reverse();
                foreach (var x in d[w.id].c)
                    st.Push(new Q { d = w.d + 1, id = x });
            }
        }
    }
}


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

#define SZ(a) int((a).size())
#define _REP(_1,_2,_3,_4,name,...) name
#define _REP4(i,b,e,s) for(decltype(e) _b=(b),_e=(e),i=_b+(0<(s)?0:(s));(0<(s)?i<_e:_e<=i);i+=(s))
#define _REP3(i,b,e) for(decltype(e) _b=(b),_e=(e),i=(_b<_e?_b:_b-1);(_b<_e?i<_e:_e<=i);(_b<_e?i++:i--))
#define _REP2(i,n) for(decltype(n) i=0,_n=(n);i<_n;i++)
#define _REP1(n) for(decltype(n) _i=0,_n=(n);_i<_n;_i++)
#define REP(...) _REP(__VA_ARGS__,_REP4,_REP3,_REP2,_REP1)(__VA_ARGS__)
#define FOR(it,c) for(auto&& it=begin(c);it!=end(c);it++)
#define ROF(it,c) for(auto&& it=rbegin(c);it!=rend(c);it++)
#define EB emplace_back
#define PB push_back
#define MP make_pair
#define MT make_tuple
#define INT(n) int n;assert(0<scanf("%d",&n))
#define AI(a,size,n) array<int,size> a;REP(i,n){assert(0<scanf("%d",&a[i]));}
#define VI(v,n) vector<int> v(n);REP(i,n){assert(0<scanf("%d",&v[i]));}
#define MSET(arr,val)  memset(arr,val,sizeof(arr))

int main(){
  INT(h); INT(w); INT(d);
  vector<vector<int>> as;
  REP(h){VI(ai, w); as.PB(ai);}
  vector<int> dp(h * w + 1, 0), rs(h * w + 1, 0), cs(h * w + 1, 0);
  REP(i, h){
    REP(j, w){
      rs[as[i][j]] = i;
      cs[as[i][j]] = j;
    }
  }
  REP(i, d + 1, h * w + 1){
    dp[i] = abs(rs[i] - rs[i - d]) + abs(cs[i] - cs[i - d]) + dp[i - d];
  }
  INT(q);
  REP(q){
    INT(l); INT(r);
    printf("%d\n", dp[r] - dp[l]);
  }
  return 0;
}

Measured memory_bytes: 2560
# region header
import sys
import math
from bisect import bisect_left, bisect_right, insort_left, insort_right
from collections import defaultdict, deque, Counter
from copy import deepcopy
from fractions import gcd
from functools import lru_cache, reduce
from heapq import heappop, heappush
from itertools import accumulate, groupby, product, permutations, combinations, combinations_with_replacement
from math import ceil, floor, factorial, log, sqrt, sin, cos
from operator import itemgetter
sys.setrecursionlimit(10**7)
rs = lambda: sys.stdin.readline().rstrip()
ri = lambda: int(rs())
rf = lambda: float(rs())
rs_ = lambda: [_ for _ in rs().split()]
ri_ = lambda: [int(_) for _ in rs().split()]
rf_ = lambda: [float(_) for _ in rs().split()]
INF = float('inf')
MOD = 10 ** 9 + 7
PI = math.pi
# endregion
N = ri()
ans = 0
for n in range(1, N + 1, 2):
    tmp = 0
    for i in range(1, n + 1):
        if n % i == 0:
            tmp += 1
    if tmp == 8:
        ans += 1
print(ans)

Measured memory_bytes: 64108
/********** Raaghav Raaj (cf: raaghavraaj, cc: mothercoder27) *************/
#include<bits/stdc++.h>
using namespace std;
#define fast cin.tie(NULL); cout.tie(NULL); ios_base::sync_with_stdio(false);
#pragma optimize("-O3")

// #ifndef ONLINE_JUDGE
// #include "../Codechef/trace.h"
// #else
// #define trace(args...)
// #endif

#define int long long
#define double long double
#define vi vector<int>
#define vc vector<char>
#define pi pair<int, int>
#define pii pair<pi,int>
#define rep(i,a,b) for(int i=a; i<b; i++)
#define F first
#define S second
#define PB push_back
#define MP make_pair
#define sp " "
#define endl '\n'
#define all(v) v.begin(), v.end()
#define debug(data) for(auto it: data) cout<<it<<sp;
#define yes cout<<"YES"<<endl
#define no cout<<"NO"<<endl

const int sz = 1e10;

int gcd(int n, int m) {
	return __gcd(n, m);
}

int power(int a, int b) {
	a %= sz;
	int res = 1;
	while (b) {
		if (b & 1) res = (res * a) % sz;
		a = (a * a) % sz;
		b >>= 1;
	}
	return res;
}

int modInverse(int a) { //sz must be prime
	return power(a, sz - 2);
}

void solve() {
	int a, b, c; cin >> a >> b >> c;
	int k; cin >> k;
	if (a < b && b < c) {
		cout << "Yes" << endl; return;
	}
	rep(i, 0, k + 1) {
		b *= power(2, i);
		if (a < b && b < c) {
			// cout << i << endl;
			cout << "Yes" << endl; return;
		}
		b /= power(2, i);
	}
	rep(i, 0, k + 1) {
		c *= power(2, k - i);
		if (a < b && b < c) {
			// cout << i << endl;
			cout << "Yes" << endl; return;
		}
		c /= power(2, k - i);
	}
	rep(i, 0, k + 1) {
		b *= power(2, i); c *= power(2, k - i);
		if (a < b && b < c) {
			// cout << i << endl;
			cout << "Yes" << endl; return;
		}
		b /= power(2, i); c /= power(2, k - i);
	}
	cout << "No" << endl;
}

int32_t main() {
// #ifndef ONLINE_JUDGE
// 	freopen("input.txt", "r", stdin);
// 	freopen("output.txt", "w", stdout);
// 	freopen("tracefile.txt", "w", stderr);
// #endif
	fast;
	int T = 1;
	// cin >> T;
	rep(i, 1, T + 1) {
		// cout << "Case #" << i << ": " << endl;
		solve();
	}
}

Measured memory_bytes: 3692
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < n; i++)
#define repr(i, n) for (int i = n-1; i >= 0; i--)
#define ALL(x) x.begin(), x.end()
using ll = long long;
using pii = pair<int, int>;
using vi = vector<int>;
const int mod = 1e9+7;
const int INF = 1e9;
const int MAX = 1e6;

ll solve(ll n, ll m) {
    ll r = (n-2) * (m-2);
    if (r < 0) r *= -1;
    return r;
}

int main() {
    ll n, m;
    cin >> n >> m;
    cout << solve(n, m) << endl;
}

Measured memory_bytes: 3636
#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 repf(i,a,b) for (int i = (a); i < (b); i++)
#define repi(i,a,b) for (int i = (a); i <= (b); i++)
#define repr(i,a,b) for (int i = (a); i >= (b); i--)
#define all(x) (x).begin(),(x).end()
#define debug(x)  cout << #x << " = " << (x) << endl;
using namespace std;
using uint = unsigned int;
using ll = long long;
using ull = unsigned long long;
using vi = vector<int>;
using vvi = vector<vi>;
using pii = pair<int, int>;
using vc = vector<char>;
using vvc = vector<vc>;
using vs = vector<string>;
using tiii = tuple<int, int, int>;

int main() {
  int N, D;
  cin >> N >> D;
  
  vvi X(N,vi(D));
  rep(i,N) {
    rep(j,D) {
      cin >> X.at(i).at(j);
    }
  }
  
  vi check(161);
  repi(i,1,160) check.at(i) = i*i;
  
  int ans = 0;
  repi(i,0,N-2) {
    repi(j,i+1,N-1) {
      int d = 0;
      repi(k,0,D-1) {
        d += (X.at(j).at(k) - X.at(i).at(k))*(X.at(j).at(k) - X.at(i).at(k));
      }
      ans += count(all(check),d);
    }
  }
      
  cout << ans << endl;
}

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

#define int long long 
#define ff first
#define ss second
#define pb push_back
#define mp make_pair

#define N 100005
int mx=0;
const int  mod =1e9+7;
int n,m;
int dp[N][2];
unordered_map<int,vector<int> > adj;


int dfs(int u,int constraint,int par){
    if(dp[u][constraint]!=-1) return dp[u][constraint]; 
    //suppose initailly we are painting the curr node as white
  	//dp[node][0] means that we are painting with no constraint that is either black or white
    //dp[node][1] means that we are painting the current node as white as it's parent is painted black
    int ans=0;
    int w1=1;
    for(auto v:adj[u]){
        if(v!=par){
            w1=(w1*dfs(v,0,u))%mod;
        }
    }
    ans+=w1;
    
    if(!constraint){
        int w2=1;
        for(auto v:adj[u]){
            if(v!=par){
                w2=(w2*dfs(v,1,u))%mod;
            }
        }
        ans=(w2+ans)%mod;
    }
    

    return dp[u][constraint]=ans;



}
int32_t main(){
    int n;
    cin>>n;
    memset(dp,-1,sizeof(dp));
    for(int i=0;i<n-1;i++){
        int u,v;
        cin>>u>>v;
        adj[u].pb(v);
        adj[v].pb(u);
    }
    cout<<dfs(1,0,-1);
}

Measured memory_bytes: 17572
#include <iostream>
#include <algorithm>
#include <cstdio>
#include <cstring>
#include <cmath>
using namespace std;
int n;
long long a[55];
long long b[55];
long long c[55];
long long tot;
long long ans;
bool check(){
	for (int i=1;i<=n;i++){
		if (b[i]>=n){
			return false;
		}
	}
	return true;
}
int main(){
	cin>>n;
	for (int i=1;i<=n;i++){
		cin>>a[i];
		long long t=a[i]/n;
		ans+=t;
		b[i]=a[i]-t*n;
		c[i]=t;
		tot+=c[i];
	}
/*	for (int i=1;i<=n;i++){
		cout<<b[i]<<" ";
	}
	cout<<endl;*/
	for (int i=1;i<=n;i++){
		b[i]+=tot-c[i];
	}
	while (!check()){
		tot=0;
		for (int i=1;i<=n;i++){
			a[i]=b[i];
		}
		/*for (int i=1;i<=n;i++){
			cout<<a[i]<<" ";
		}
		cout<<endl;*/
		memset(b,0,sizeof(b));
		memset(c,0,sizeof(c));
		for (int i=1;i<=n;i++){
			long long t=a[i]/n;
			ans+=t;
			b[i]=a[i]-t*n;
			c[i]=t;
			tot+=c[i];
		}
		for (int i=1;i<=n;i++){
			b[i]+=tot-c[i];
		}
	}
	cout<<ans;
	return 0;
}

Measured memory_bytes: 256
using System;
using System.Linq;
using System.Collections.Generic;
using static System.Console;
using System.Text;
using System.IO;
using static System.Math;
namespace AtCoder
{
    class Program
    {
        static public long[] Sarray() { return ReadLine().Split().Select(long.Parse).ToArray(); }
        static public List<long> Slist() { return ReadLine().Split().Select(long.Parse).ToList(); }

        //static long Mod = (long)1e9 + 7;
        static void Main(string[] args)
        {
            //SetOut(new StreamWriter(OpenStandardOutput()) { AutoFlush = false });
            var KT = Sarray();
            var K = KT[0];
            var T = KT[1];
            var Ai = Slist();
            if (Ai.Count == 1)
            {
                WriteLine(Ai[0] - 1);
                return;
            }
            Ai.Sort();
            var f = Ai.Count - 1;
            var s = Ai.Count - 2;
            while (true)
            {
                if (Ai[f] <= 0 || Ai[s] <= 0)
                {
                    WriteLine(Max(Ai[f] - 1, 0));
                    return;
                }
                --Ai[f];
                --Ai[s];
                Ai.Sort();
            }
            //Out.Flush();
        }
    }
}


Measured memory_bytes: 13396
#include<iostream>
#include<string>
#include<algorithm>
#include<map>
#include<math.h>
#include<vector> 
#include<cstdio> 
#include<set>
#include<string.h>
#include<stdio.h>
#include<queue>
#include<cstring>
using namespace std;
int main()
{int s;
 cin>>s;
 if(s%10==9 || s/10==9){
 cout<<"Yes"<<endl;
 return 0;
 }
 cout<<"No"<<endl;
 return 0;
}

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

int main(){
  string S;cin>>S;
  int ans=1e+9;
  for(int i=0;i+2<=S.size();i++){
    int a=stoi(S.substr(i,3));
    ans=min(ans,abs(753-a));
  }
  cout<<ans<<endl;
}

Measured memory_bytes: 256
n=int(input())
a=input().split()
b=input().split()
c=input().split()
for i in range(n):
    a[i]=int(a[i])
    b[i]=int(b[i])
for i in range(n-1):
    c[i]=int(c[i])
b1=sum(b)
for i in range(n):
    if i<n-1 and a[i+1]==a[i]+1:
        s=a[i]-1
        b1+=c[s]
print(b1)

Measured memory_bytes: 3064
using System;

namespace AtCoderBeginnerContest095
{
    class ABC095B
    {
        static void Main(string[] args)
        {
            string[] s = Console.ReadLine().Split(' ');
            int N = int.Parse(s[0]);
            int X = int.Parse(s[1]);
            int min = X;
            int count = 0;
            for (int i = 0; i < N; i++)
            {
                int m = int.Parse(Console.ReadLine());
                if (m < min) min = m;
                X -= m;
                count++;
            }
            count += X / min;
            Console.WriteLine(count);
        }
    }
}


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

using namespace std;

using ll = long long int;

#define FOR(i, b, e) for (int i = (b); i < (e); ++i)
#define RFOR(i, b, e) for (int i = ((e) - 1); (b) <= i; --i)
#define REP(i, N) for (int i = 0; i < (N); ++i)
#define RREP(i, N) for (int i = ((N) - 1); 0 <= i; --i)
#define scanInt(x) int x; scanf("%d", &(x)); getchar();
#define scanLLInt(x) ll x; scanf("%lld", &(x)); getchar();
#define scanVecInt(A, N) vector<int> A(N); REP(i, N){scanf("%d", &(A[i])); getchar();}
#define scanVecLLInt(A, N) vector<ll> A(N); REP(i, N){scanf("%lld", &(A[i])); getchar();}

int main()
{
    scanInt(A);
    scanInt(B);
    scanInt(C);
    cout << min(B / A, C) << endl;
}


Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <vector>
#include <set>
#include <algorithm>
#include <cmath>
using namespace std;


int main(){
  set<int> s;
  int n;


  cin >> n;

  long temp;
  for (int i = 0; i < n; i++){
    cin >> temp;
    s.insert(temp);
  }

  if (s.size() == n){
    cout << "YES" << endl;
  } else {
    cout << "NO" << endl;
  }

  return 0;
}

Measured memory_bytes: 9600
#include <bits/stdc++.h>
using namespace std;
#define all(v) (v).begin(), (v).end()
#define lp(i, n) for (int i = 0; i < (n) ; ++i)
#define sz(v) (ll)(v).size()
#define int long long
#define mod 1000000007

void solve() {
        int n, k; cin >> n>> k;
        int sm1= 0;
        vector<int> v(k);
        lp(i, k) {
                cin >> v[i];
        }
        for (int i= 1; i< k; i++) {
                sm1= max(sm1, v[i]- v[i- 1]);
        }
        sm1= max(sm1, v[0]+ (n- v[k- 1]));
        cout << n- sm1<< "\n";
}

int32_t main(){
ios::sync_with_stdio(0), cin.tie(NULL), cout.tie(NULL);
        int t = 1;
        //cin >> t;
        while ( t-- ) {
                solve();
        }
return 0;
}




Measured memory_bytes: 1792