akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <string>
#include <map>
#include <algorithm>
#include <vector>

#define ll long long

int main()
{
    std::string S;
    std::cin >> S;

    bool A = false;
    bool B = false;

    for(int i=0; i < 3; i++) {
        if(S[i] == 'A') A = true;
        if(S[i] == 'B') B = true;
    }

    if(A == true and B == true) std::cout << "Yes" << std::endl;
    else std::cout << "No" << std::endl;
}

Measured memory_bytes: 3612
#include <cstdio>
#include <algorithm>
#include <cstring>
#include <set>
#include <iostream>
#include <stack>
#include <vector>
#include <string>
#include <map>
#include <cmath>
#include <queue>
#include <random>
#include <chrono>
using namespace std;

typedef long long LL;

const LL mod = 998244353;

const int maxn = 4005;
LL c[maxn][maxn];
LL dp[maxn][maxn];
void add(LL &a, LL b){
    a += b;
    if(a >= mod)
        a -= mod;
}

void init(){
    c[0][0] = 1;
    for(int i = 1;i < maxn;i++){
        c[i][0] = c[i][i] = 1;
        for(int j = 1;j < i;j++){
            c[i][j] = (c[i - 1][j] + c[i - 1][j - 1]) % mod;
        }
    }
}

LL solve(int n, int n1, int n2){
    LL ans = 0;
    LL now = 1;
    for(int j = 0;j <= n1;j++, now = now * 2 % mod){
        if(j + n2 == 0)
            continue;
        LL tmp = c[n1][j] * now % mod;
        tmp = tmp * c[n + n2 - 1][j + n2 - 1] % mod; 
        add(ans, tmp);
    }
    return ans;
} 

int main(){
    init();
    int K, N;
    cin >> K >> N;
    for(int i = 2;i <= 2 * K;i++){
        int l = max(1, i - K);
        int r = min(K, i - 1);
        int len = (r - l + 1);
        if(len & 1){
            int n1 = len / 2;
            int n2 = K - len;
            LL ans = solve(N, n1, n2);
            add(ans, solve(N - 1, n1, n2)); 
            cout << ans << endl;
        }else{
            int n1 = len / 2;
            int n2 = K - len;
            LL ans = solve(N, n1, n2); 
            cout << ans << endl;
        }
    } 
    return 0;
}


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

int main() { 
  int H, W, K;
  cin >> H >> W >> K;
  
  vector<string> c(H);
  
  for (int i=0; i<H; i++) {
    cin >> c.at(i);
  }
  
  int ans = 0;
  int m = 5;
  //cout << "(1<<" << m << "):" << (1<<m) << endl;
  //cout << "(1<<" << H << "):" << (1<<H) << endl;
  for (int is=0; is<(1<<H); is++) {
    for (int js=0; js<(1<<W); js++) {
      int b = 0;
      for (int i=0; i<H; i++) {
        //cout << is << ">>" << i << ": " << (is>>i) << " -> " << (is>>i&1) << endl;
        for (int j=0; j<W; j++) {
          //cout << js << ">>" << j << ": " << (js>>j) << " -> " << (js>>j&1) << endl;
          
          if ((is>>i&1) || (js>>j&1)) continue;
          if (c[i][j] == '#') b++;
        }
      }
      if (b == K) ans++;
    }
  }
  
  cout << ans << endl;
}


Measured memory_bytes: 3624
#include<bits/stdc++.h>
using namespace std;
int main(){
	long long k,a,b,ans=0;
	cin>>k>>a>>b;
	if(k<a)cout<<k+1<<endl,exit(0);
	ans=a;k-=a-1;
	ans+=max(2ll,b-a)*(k/2);
	ans+=k%2;cout<<ans<<endl;
	return 0;
}


Measured memory_bytes: 256
using namespace std;

#include <bits/stdc++.h>

#define fi first
#define se second
#define pb push_back
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()

const int N = 2e4 + 3;
int ans = 0, q = 0;

void solve() {
    string s;
    cin >> s;
    for (int i = 0; i < s.size(); i++) {
        printf("%c", s[i]);
        if (i == 3)
            printf(" ");
    }
    printf("\n");
}

int main() {
    #ifdef _DEBUG27_
        if (1)
            freopen("input.txt", "r", stdin);
    #else
        if (0) {
            freopen("weapons.in", "r", stdin);
            freopen("weapons.out", "w", stdout);
        }
    #endif

    solve();

    #ifdef _DEBUG27_
        cout << endl << "Time: " << clock() / 1000.0 << " ms";
    #endif
    return 0;
}

/** CLEARING BUFFER

    cout << VAL << flush;

    OR

    printf(VAL);
    fflush(stdout);
*/


Measured memory_bytes: 256
#include<bits/stdc++.h>
typedef long long ll;
const int INF = 1e9;
const int MOD = 1e9 + 7;
using namespace std;

//ループマクロ
#define FOR(i , a , b)  for(int i = (a) ; i < (b) ; i++)
#define REP(i , n)      for(int i = 0 ; i < n ; i++)
#define REPR(i , n)     for(int i = n ; 0 <= i ; i--)
#define ROP(i, n)       for(int i = 1 ; i <= n ; i++)

//入出力
#define SCOUT(x) cout << (x) << " "
#define VECCIN(x) for(auto& ele : (x) ) cin >> ele
#define VECOUT(x) for(auto& ele : (x) ) cout << ele << " "; cout << endl;

//その他
#define ALL(obj) (obj).begin() , (obj).end() 
#define SORT(obj) sort(ALL(obj))
#define GSORT(obj) sort(ALL(obj) , greater<int>())
#define VLL vector<long long>
#define M map<int, int>
#define S set<int>
#define V vector<int>
#define P pair<int,int>
#define PQ priority_queue<int>
#define PQG priority_queue<int , V , greater<int>>

int main(void) {

	ios::sync_with_stdio(false);	cin.tie(0);
    int X, Y, A, B, C;  cin >> X >> Y >> A >> B >> C;
    V p(A); VECCIN(p);
    V q(B); VECCIN(q);
    V r(C); VECCIN(r);

    GSORT(p);  GSORT(q);  GSORT(r);
    V kp;
    REP(i, X)  kp.push_back(p[i]);
    REP(i, Y)  kp.push_back(q[i]);

    SORT(kp);
    int r_ite = 0;
    ll ans = 0;
    for(int i = 0 ; i < X + Y ; i++){
      if(r_ite < C && kp[i] < r[r_ite])   ans += r[r_ite++];
      else                                ans += kp[i];
    }

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


Measured memory_bytes: 2552
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
typedef pair<int,int> P;
int N,W,D,p,s;
vector<P> v;
int main(){
	while(cin >> N >> W >> D && W>0){
		v.push_back(P(W,D));
		for(int i=0;i<N;i++){
			cin >> p >> s;
			p--;
			P piece = v[p];
			v.erase(v.begin()+p);
			int x = piece.first,y = piece.second;
			s %= (x+y);
			if(s<x){
				if(s<=x/2){
					v.push_back(P(s,y));
					v.push_back(P(x-s,y));
				}else{
					v.push_back(P(x-s,y));
					v.push_back(P(s,y));
				}
				continue;
			}
			s -= x;
			if(s<y){
				if(s<=y/2){
					v.push_back(P(x,s));
					v.push_back(P(x,y-s));
				}else{
					v.push_back(P(x,y-s));
					v.push_back(P(x,s));
				}
				continue;
			}
			s -= y;
			if(s<x){
				if(s<=x/2){
					v.push_back(P(s,y));
					v.push_back(P(x-s,y));
				}else{
					v.push_back(P(x-s,y));
					v.push_back(P(s,y));
				}
				continue;
			}
			s -= x;
			if(s<y){
				if(s<=y/2){
					v.push_back(P(x,s));
					v.push_back(P(x,y-s));
				}else{
					v.push_back(P(x,y-s));
					v.push_back(P(x,s));
				}
				continue;
			}
		}
		vector<int> ans;
		for(auto x:v) ans.push_back(x.first*x.second);
		sort(ans.begin(),ans.end());
		for(int i=0;i<=N;i++) cout << ans[i] << (i!=N? " ":"\n");
		v.clear();
	}
}


Measured memory_bytes: 3012
#include<iostream>
#include<cstdio>
#include<queue>
#include<cstring>
#include<cmath>
#include<stack>
#include<algorithm>
#define rg register
#define ll long long
#define LDB long double
#define ull unsigned long long
#define view(i,x) for(rg int i=hd[x];i!=-1;i=e[i].nt)
#define go(i,x,a) for(rg int i=a;i<x;i++)
#define inf 0x3f3f3f3f
#define INF 0x7fffffff
using namespace std;

int a[10] ;

inline int rd(){
	int ret=0,af=1; char gc=getchar();
	while(gc < '0' || gc > '9'){ if(gc=='-') af=-af; gc=getchar(); }
	while(gc >= '0' && gc <= '9') ret=ret*10+gc-'0',gc=getchar();
	return ret*af;
}

int main(){
	go(i,5,1) a[i]=rd();
	sort(a+1,a+5);
	if(a[1] == 1 && a[2] == 4 && a[3] == 7 && a[4] == 9) puts("YES");
	else puts("NO");
	return 0;
}//Faze


Measured memory_bytes: 256
import java.util.Arrays;
import java.util.Scanner;

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

		int n = sc.nextInt();
		int a[] = new int[n];
		int copy[] = new int[n];

		for (int i = 0; i < n; i++) {
			a[i] = sc.nextInt();
			copy[i] = a[i];
		}
		Arrays.sort(copy);

		for (int i = 0; i < n; i++) {
			int remove = a[i];

			if (remove == copy[n - 1]) {
				System.out.println(copy[n - 2]);
			} else {
				System.out.println(copy[n - 1]);
			}
		}
	}
}

Measured memory_bytes: 110584
#include <iostream>
#include <string>
using namespace std;
 
int main(){
  int a, b, c;
  cin >> a >> b;
  
  c = a * b;
  if (c % 2 == 0) 
  {
    cout << "Even " << endl;
  }else{
    cout << "Odd " << endl;
  }
}

Measured memory_bytes: 256
import java.util.Scanner;

public class Main {
	private static final int INF = Integer.MAX_VALUE;
	public static void main(String[] args) {
		// TODO Auto-generated method stub
				Scanner sc = new Scanner(System.in);
				int n = 0;
				int op_num = 0;
				n  = sc.nextInt();
				op_num = sc.nextInt();
				String[] op = new String[op_num+1];
				for (int i = 0 ; i < op.length; i++) {
					op[i] = sc.nextLine();
				}
				//get datag
				int[][] data = new int[op_num][3];
				for (int i = 1, n1 =0; i<= op_num; i++,n1++) {
					if(data[n1][0] == 0) {
						String[] Split = op[i].split(" ");
						data[n1] = new int[Split.length];
						for(int j = 0;j<Split.length;j++)
							data[n1][j] = Integer.parseInt(Split[j]);
					}else {
						String[] Split = op[i].split(" ");
						data[n1] = new int[Split.length];
						for(int j = 0;j<Split.length;j++)
							data[n1][j] = Integer.parseInt(Split[j]);
					}
				}
				
				
				
				
				
				
				//Operate data
				Set2 set = new Set2(n);
				set.makeset();
				
				for(int i= 0 ;i < data.length;i++ ) {
					if(data[i][0] == 0) {
						int x = data[i][1];
						int y = data[i][2];
						int z = data[i][3];
						set.link(x, y, z);	
					}
					else if(data[i][0] == 1){
						int x = data[i][1];
						int y = data[i][2];
						
						if(set.findset(x)== set.findset(y))
							System.out.println(set.we[y] - set.we[x]);
						else 
							System.out.println("?");
					}
					
				}
	}
}


class Set2{

	int[] rank,parent;
	int n;
	int weight;
	int[] we;
	int index;
	private static final int INF = Integer.MAX_VALUE;
	
	
	public Set2(int n) {
		rank = new int[n];
		parent = new int[n];
		we = new int[n];
		this.n = n;
		makeset();
	}
	
	void makeset() {
		for(int i= 0 ; i< n; i++)
			parent[i] = i;
	}
	
	int findset(int x) {
		int y = 0;
		if (x == parent[x])
			return x;
		else {
			int temp = parent[x];
			parent[x] = findset(parent[x]);
			we[x] += we[temp]; 
			return parent[x];
		}
	}
	
	void link(int x, int y, int z) {
		int a = findset(x);
		int b = findset(y);
		//int c = findset(z);
		
		if(a!=b) {
			parent[b] = a;
			we[b] = we[x] - we[y] + z;
		}
	}
	
	
	
	
	
	
	
	
	
	
	
	
	

}


Measured memory_bytes: 246300
#include<bits/stdc++.h>
using namespace std;
long long a,b,ans;
int main()
{
	cin>>a>>b;
	if(a==0||b==0)
	{
		if(a>b)
		{
			cout<<abs(a-b)+1<<endl;
			exit(0);
		}
		cout<<abs(a-b)<<endl;
		exit(0);
	}
	if(a>0&&b>0)
	{
		if(a<b)//a>b
		cout<<abs(a-b)<<endl;
		else
		cout<<abs(a-b)+2<<endl;
	}
	if(a>0&&b<0||a<0&&b>0)cout<<abs(abs(a)-abs(b))+1<<endl;
	if(a<0&&b<0)
	{
		if(a==b)cout<<0<<endl;
		if(a>b)cout<<abs(abs(a)-abs(b))+2<<endl;
		if(a<b)cout<<abs(abs(a)-abs(b))<<endl;
	}
}

Measured memory_bytes: 256
// practice with Dukkha
#include <algorithm>
#include <iostream>

using namespace std;

const int N = 100, M = 1000, INF = 0x3f3f3f3f;

int ii[M], jj[M], ww[M], dd[N][N];

int main() {
	int n, m; cin >> n >> m;
	for (int i = 0; i < n; i++) {
		for (int j = 0; j < n; j++)
			dd[i][j] = INF;
		dd[i][i] = 0;
	}
	for (int h = 0; h < m; h++) {
		int i, j, w; cin >> i >> j >> w, i--, j--;
		ii[h] = i, jj[h] = j, ww[h] = w;
		dd[i][j] = dd[j][i] = w;
	}
	for (int k = 0; k < n; k++)
		for (int i = 0; i < n; i++)
			for (int j = 0; j < n; j++)
				dd[i][j] = min(dd[i][j], dd[i][k] + dd[k][j]);
	int ans = 0;
	for (int h = 0; h < m; h++)
		if (ww[h] > dd[ii[h]][jj[h]])
			ans++;
	cout << ans << '\n';
	return 0;
}


Measured memory_bytes: 3640
def main5():
    buf = int(input(""));
    strbuf = input("");
    strbufs = strbuf.split();
    buf2 = []
    saidai = -1;
    for i in range(buf):
        buf2.append(int(strbufs[i]));
    for i in range((buf-1)):
        for j in range(i+1,buf):
            if (abs(buf2[i]-buf2[j]))>saidai:
                saidai =  abs(buf2[i]-buf2[j]);

    print(saidai);


if __name__ == '__main__':
    main5()


Measured memory_bytes: 3060
from operator import itemgetter
import sys
input = sys.stdin.readline


class BIT:
    """区間加算、一点取得クエリをそれぞれO(logN)で答えるデータ構造"""
    def __init__(self, n):
        self.n = n
        self.bit = [0] * (n + 1)

    def _add(self, i, val):
        while i > 0:
            self.bit[i] += val
            i -= i & -i

    def get_val(self, i):
        """i番目の値を求める"""
        i = i + 1
        s = 0
        while i <= self.n:
            s += self.bit[i]
            i += i & -i
        return s

    def add(self, l, r, val):
        """区間[l, r)にvalを加える"""
        self._add(r, val)
        self._add(l, -val)


n, m = map(int, input().split())
info = [list(map(int, input().split())) for i in range(n)]

for i in range(n):
    info[i] = info[i][0], info[i][1], info[i][1] - info[i][0] + 1
info = sorted(info, key=itemgetter(2))

bit = BIT(m + 1)
l_info = 0
ans = n
for d in range(1, m + 1):
    while True:
        if l_info < n and info[l_info][2] < d:
            l, r, _ = info[l_info]
            bit.add(l, r + 1, 1)
            l_info += 1
            ans -= 1
        else:
            break
    cnt = ans
    if d == 1:
        print(n)
        continue
    for i in range(0, m + 1, d):
        cnt += bit.get_val(i)
    print(cnt)

Measured memory_bytes: 128348
# ABC138E - Strings of Impurity
from bisect import bisect_left as bs
from collections import defaultdict


def main():
    S, T = tuple(input() for _ in range(2))
    if not set(T) <= set(S):  # corner case
        print(-1)
        return
    idx, ls = defaultdict(list), len(S)
    for i, s in enumerate(S):
        idx[s] += [i]
    cur = -1
    for t in T:
        tgt = idx[t]
        x = (cur + 1) % ls
        i = bs(tgt, x)
        if i < len(tgt):
            cur += 1 + tgt[i] - x
        else:
            cur += 1 + tgt[0] - x + ls
    print(cur + 1)


if __name__ == "__main__":
    main()

Measured memory_bytes: 7924
import sys

stdin = sys.stdin

ns = lambda: stdin.readline().rstrip()
ni = lambda: int(stdin.readline().rstrip())
nm = lambda: map(int, stdin.readline().split())
nl = lambda: list(map(int, stdin.readline().split()))

mod = 10**9 + 7

n, k = nm()
rl = [-1]*(k+1)
dp = [0]*(k+1)
ans = 0
for i in range(k, 0, -1):
    t = k//i
    if rl[t] < 0:
        rl[t] = pow(t, n, mod)
    r = rl[t]
    for j in range(2*i, k+1, i):
        r = (r - dp[j]) % mod
    dp[i] = r
    ans = (ans + r*i) % mod
print(ans)


Measured memory_bytes: 11996
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
#define rep(i,m,n) for(int i=m;i<n;i++)
ll mod=1e9+7;

int main(){
  int n,a,b;
  cin>>n>>a>>b;
  cout<<min(n*a,b)<<endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <vector>
#include <math.h>
#include <stdio.h>
#include <algorithm>
#include <utility>
#include <functional>
#define rep(i,n) for(int i=0;i<(n);i++)
#define psortsecond(A,N) sort(A,A+N,[](const pii &a, const pii &b){return a.second<b.second;});
#define psortfirst(A,N) sort(A,A+N,[](const pii &a, const pii &b){return a.first<b.first;});
#define All(x) (x).begin(),(x).end()
using namespace std;
using pii  = pair<int,int>;
long long gcd(long long a, long long b){return (b == 0 ? a : gcd(b, a%b));}
long long lcm(long long a, long long b){return a*b/gcd(a,b);}
typedef long long ll;
#define MOD 1000000007
#define EPS 10e-8

int main() {
    ll A[4];
    rep(i,4){
        cin >> A[i];
    }
    //sort(A,A+3);
    cout << min(A[0],A[1])+min(A[2],A[3]) << endl;
}

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

using namespace std;

const int N = (int)3e5 + 7;

int mod = (int)1e9 + 7;

int add(int a, int b) {
	return (a + b) % mod;
}

int mult(int a, int b) {
	return (a * 1LL * b) % mod;
}

int binpow(int a, int n) {
	int res = 1;
	while (n) {
		if (n & 1) {
			res = mult(res, a);
		}
		a = mult(a, a);
		n >>= 1;
	}
	return res;
}

int fact[N], rfact[N];

int cnk(int n, int k) {
	if (k > n) return 0;
	return mult(fact[n], mult(rfact[n - k], rfact[k]));
}

void precalc() {
	fact[0] = 1;
	rfact[0] = 1;
	for (int i = 1; i < N; i++) {
		fact[i] = mult(fact[i - 1], i);
		rfact[i] = binpow(fact[i], mod - 2);
	}
}

int calc(int n, int m) {
	return cnk(n + m - 2, n - 1);
}

int h, w, n;
pair < int, int > ar[(int)3e3 + 7];
int dp[(int)3e3 + 7];

main() {
	precalc();
	scanf("%d %d", &h, &w);
	scanf("%d", &n);
	for (int i = 1; i <= n; i++) {
		int x, y;
		scanf("%d %d", &x, &y);
		ar[i] = {x, y};
	}
	n++;
	ar[n] = {h, w};
	sort(ar + 1, ar + n + 1);
	for (int i = 1; i <= n; i++) {
		dp[i] = calc(ar[i].first, ar[i].second);
		for (int j = i - 1; j >= 1; j--) {
			int to = j;
			dp[i] = add(dp[i], mod - mult(dp[to], calc(ar[i].first - ar[to].first + 1, ar[i].second - ar[to].second + 1)));
		}
	}
	cout << dp[n];
}



Measured memory_bytes: 2560
package main

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

var N int

func main() {
	readVariables()
	if N%2 == 1 {
		fmt.Println(N/2 + 1)
	} else {
		fmt.Println(N / 2)
	}
}

func readVariables() {
	N = nextInt()

}

/* Template */

var scanner *bufio.Scanner

func init() {
	Max := 1001001
	scanner = bufio.NewScanner(os.Stdin)
	scanner.Buffer(make([]byte, 0, Max), Max)
	scanner.Split(bufio.ScanWords)
}

//nextInt converts next token from stdin and returns integer value.
//nextInt panics when conversion into an integer fails.
func nextInt() int {
	if !scanner.Scan() {
		panic("No more token.")
	}
	num, err := strconv.Atoi(scanner.Text())
	if err != nil {
		panic("nextInt(): cannot convert to int: " + scanner.Text())
	}
	return num
}

func nextStr() string {
	if !scanner.Scan() {
		panic("No more token.")
	}
	return scanner.Text()
}

// MinInt returns minimum argument
func MinInt(x, y int) int {
	if x < y {
		return x
	} else {
		return y
	}
}

//MaxInt returns maximum argument
func MaxInt(x, y int) int {
	if x < y {
		return y
	} else {
		return x
	}
}

//AbsInt returns |x| for x
func AbsInt(x int) int {
	if x < 0 {
		return -x
	}
	return x
}

//ModPow calculates integer power with modulo operation
//if modulo <= 1, it powers w/o module operation
//if base < 0, return value might be negative too.
func ModPow(base, exponent, modulo int) (result int) {
	result = 1
	for exponent > 0 {
		if exponent%2 == 1 {
			result *= base
			if modulo > 1 {
				result %= modulo
			}
		}
		base *= base
		if modulo > 1 {
			base %= modulo
		}
		exponent /= 2
	}
	return
}

//Gcd
func Gcd(vals ...int) (result int) {
	if len(vals) == 0 {
		return
	}
	result = vals[0]
	for i := 1; i < len(vals); i++ {
		result = gcd(result, vals[i])
	}
	return
}

func gcd(x, y int) int {
	x, y = AbsInt(x), AbsInt(y)
	for y > 0 {
		x, y = y, x%y
	}
	return x
}

//Lcm
func Lcm(vals ...int) (result int) {
	if len(vals) == 0 {
		return
	}
	result = vals[0]
	for i := 1; i < len(vals); i++ {
		result = lcm(result, vals[i])
	}
	return
}

func lcm(x, y int) int {
	return x * y / gcd(x, y)
}


Measured memory_bytes: 640
import math
from collections import deque
S = input()
ans = [0 for _ in range(len(S))]
cnt = 0
for i in range(len(S) - 1):
    if S[i] == "R":
        if S[i + 1] == "R":
            cnt += 1
        else:
            cnt += 1
            ans[i] += math.ceil(cnt / 2)
            ans[i + 1] += cnt - math.ceil(cnt / 2)
            cnt = 0
ans = ans[:: -1]
S = S[:: -1]
cnt = 0
for i in range(len(S) - 1):
    if S[i] == "L":
        if S[i + 1] == "L":
            cnt += 1
        else:
            cnt += 1
            ans[i] += math.ceil(cnt / 2)
            ans[i + 1] += cnt - math.ceil(cnt / 2)
            cnt = 0
ans = ans[:: -1]
print(" ".join(map(str, ans)))

Measured memory_bytes: 11340
//#define _GLIBCXX_DEBUG

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

#define endl '\n'
#define lfs cout<<fixed<<setprecision(10)
#define ALL(a)  (a).begin(),(a).end()
#define ALLR(a)  (a).rbegin(),(a).rend()
#define spa << " " <<
#define fi first
#define se second
#define MP make_pair
#define MT make_tuple
#define PB push_back
#define EB emplace_back
#define rep(i,n,m) for(ll i = (n); i < (ll)(m); i++)
#define rrep(i,n,m) for(ll i = (ll)(m) - 1; i >= (ll)(n); i--)
using ll = long long;
using ld = long double;
const ll MOD1 = 1e9+7;
const ll MOD9 = 998244353;
const ll INF = 1e18;
using P = pair<ll, ll>;
template<typename T1, typename T2>
bool chmin(T1 &a,T2 b){if(a>b){a=b;return true;}else return false;}
template<typename T1, typename T2>
bool chmax(T1 &a,T2 b){if(a<b){a=b;return true;}else return false;}
ll median(ll a,ll b, ll c){return a+b+c-max({a,b,c})-min({a,b,c});}
void ans1(bool x){if(x) cout<<"Yes"<<endl;else cout<<"No"<<endl;}
void ans2(bool x){if(x) cout<<"YES"<<endl;else cout<<"NO"<<endl;}
void ans3(bool x){if(x) cout<<"Yay!"<<endl;else cout<<":("<<endl;}
template<typename T1,typename T2>
void ans(bool x,T1 y,T2 z){if(x)cout<<y<<endl;else cout<<z<<endl;}  
template<typename T>
void debug(vector<vector<T>>&v,ll h,ll w){for(ll i=0;i<h;i++)
{cout<<v[i][0];for(ll j=1;j<w;j++)cout spa v[i][j];cout<<endl;}};
void debug(vector<string>&v,ll h,ll w){for(ll i=0;i<h;i++)
{for(ll j=0;j<w;j++)cout<<v[i][j];cout<<endl;}};
template<typename T>
void debug(vector<T>&v,ll n){if(n!=0)cout<<v[0];
for(ll i=1;i<n;i++)cout spa v[i];cout<<endl;};
template<typename T>
vector<vector<T>>vec(ll x, ll y, T w){
  vector<vector<T>>v(x,vector<T>(y,w));return v;}
ll gcd(ll x,ll y){ll r;while(y!=0&&(r=x%y)!=0){x=y;y=r;}return y==0?x:y;}
vector<ll>dx={1,-1,0,0,1,1,-1,-1};
vector<ll>dy={0,0,1,-1,1,-1,1,-1};
template<typename T>
vector<T> make_v(size_t a,T b){return vector<T>(a,b);}
template<typename... Ts>
auto make_v(size_t a,Ts... ts){
  return vector<decltype(make_v(ts...))>(a,make_v(ts...));
}
template<typename T1, typename T2>
ostream &operator<<(ostream &os, const pair<T1, T2>&p){
  return os << p.first << " " << p.second;
}
//mt19937 mt(chrono::steady_clock::now().time_since_epoch().count());

int main(){
  cin.tie(nullptr);
  ios_base::sync_with_stdio(false);
  ll res=0,buf=0;
  bool judge = true;
  ll n;cin>>n;
  vector<ll>a(n),b(n);
  rep(i,0,n){
    string s;cin>>s;
    string t;
    rep(j,0,s.size()){
      if(s[j]!='.')t+=s[j];
    }
    ll k=stoll(t);
    while(k%2==0){
      k/=2;
      a[i]++;
    }
    while(k%5==0){
      k/=5;
      b[i]++;
    }
    ll cnt=0;
    ll m=s.size();
    rrep(j,0,m){
      if(s[j]=='.'){
        a[i]-=cnt;
        b[i]-=cnt;
        break;
      }
      else cnt++;
    }
  }
  map<P,ll>mp;
  rep(i,0,n){
    P p(a[i],b[i]);
    for(auto z:mp){
      if(z.fi.fi+p.fi>=0&&z.fi.se+p.se>=0)res+=z.se;
    }
    mp[p]++;
  }
  cout<<res<<endl;
  return 0;
}

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

using namespace std;

int main()
{
    ios::sync_with_stdio(false);
    int n,ans=0;
    cin>>n;
    for(int i=1; i<=n; i++)
    {
        int x;
        cin>>x;
        if(i%2&&x%2)
            ans++;
    }
    cout<<ans;
    return 0;
}


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

int main(int argc, char *argv[]) {
  ios::sync_with_stdio(false);cin.tie(nullptr);cout.tie(nullptr);

  ll n,a,b;cin>>n>>a>>b;

  if(a==0){
    puts("0");return 0;
  }

  ll ab = a+b;

  cout<<(n/ab) * a + min(a, n%ab)<<endl;

  return 0;
}


Measured memory_bytes: 256
package main

import (
	"bufio"
	"fmt"
	"os"
	"sort"
	"strconv"
)

func configure(scanner *bufio.Scanner) {
	scanner.Split(bufio.ScanWords)
	scanner.Buffer(make([]byte, 1000005), 1000005)
}
func getNextString(scanner *bufio.Scanner) string {
	scanned := scanner.Scan()
	if !scanned {
		panic("scan failed")
	}
	return scanner.Text()
}
func getNextInt(scanner *bufio.Scanner) int {
	i, _ := strconv.Atoi(getNextString(scanner))
	return i
}
func getNextInt64(scanner *bufio.Scanner) int64 {
	i, _ := strconv.ParseInt(getNextString(scanner), 10, 64)
	return i
}
func getNextFloat64(scanner *bufio.Scanner) float64 {
	i, _ := strconv.ParseFloat(getNextString(scanner), 64)
	return i
}
func main() {
	fp := os.Stdin
	wfp := os.Stdout
	extra := 0
	if os.Getenv("I") == "IronMan" {
		fp, _ = os.Open(os.Getenv("END_GAME"))
		extra = 100
	}
	scanner := bufio.NewScanner(fp)
	configure(scanner)
	writer := bufio.NewWriter(wfp)
	defer func() {
		r := recover()
		if r != nil {
			fmt.Fprintln(writer, r)
		}
		writer.Flush()
	}()
	solve(scanner, writer)
	for i := 0; i < extra; i++ {
		fmt.Fprintln(writer, "-----------------------------------")
		solve(scanner, writer)
	}
}
func solve(scanner *bufio.Scanner, writer *bufio.Writer) {
	n := getNextInt(scanner)
	k := getNextInt(scanner)
	aa := make([]int, n)
	for i := 0; i < n; i++ {
		aa[i] = getNextInt(scanner)
	}
	sort.Ints(aa)
	mc := newModcom(n + 1)
	var mx, mn mint
	for i := 0; i < n; i++ {
		if n-1-i >= k-1 {
			mn.addAs(mc.choose(n-1-i, k-1).mul(mint(aa[i])))
		}
		if i >= k-1 {
			mx.addAs(mc.choose(i, k-1).mul(mint(aa[i])))
		}
	}
	fmt.Fprintln(writer, mx.sub(mn))
}

type modcom struct {
	facs, invs []mint
}

func newModcom(n int) modcom {
	facs := make([]mint, n+1)
	invs := make([]mint, n+1)
	facs[0] = 1
	for i := 0; i < n; i++ {
		facs[i+1] = facs[i].mul(mint(i + 1))
	}
	invs[n] = facs[n].inv()
	for i := n - 1; i >= 0; i-- {
		invs[i] = invs[i+1].mul(mint(i + 1))
	}
	return modcom{
		facs: facs,
		invs: invs,
	}
}
func (mc *modcom) choose(n, k int) mint {
	return mc.facs[n].mul(mc.invs[k]).mul(mc.invs[n-k])
}

type mint int64

func (mt mint) mod() mint {
	m := mint(1e9 + 7)
	mt %= m
	if mt < 0 {
		return mt + m
	}
	return mt
}
func (mt mint) inv() mint {
	return mt.pow(mint(0).sub(2))
}
func (mt mint) pow(n mint) mint {
	p := mint(1)
	for n > 0 {
		if n&1 == 1 {
			p.mulAs(mt)
		}
		mt.mulAs(mt)
		n >>= 1
	}
	return p
}
func (mt mint) add(x mint) mint {
	return (mt + x).mod()
}
func (mt mint) sub(x mint) mint {
	return (mt - x).mod()
}
func (mt mint) mul(x mint) mint {
	return (mt * x).mod()
}
func (mt mint) div(x mint) mint {
	return mt.mul(x.inv())
}
func (mt *mint) addAs(x mint) *mint {
	*mt = mt.add(x)
	return mt
}
func (mt *mint) subAs(x mint) *mint {
	*mt = mt.sub(x)
	return mt
}
func (mt *mint) mulAs(x mint) *mint {
	*mt = mt.mul(x)
	return mt
}
func (mt *mint) divAs(x mint) *mint {
	*mt = mt.div(x)
	return mt
}


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

int main() {
  
  int N, C;
  cin >> N;

  if (N % 1000 > 0) {
    C = (N / 1000 + 1) * 1000 - N;
  }
  else if (N % 1000 <= 0) {
    C = (N / 1000) * 1000 - N;
  }
  
  cout << C;
  
}

Measured memory_bytes: 3628
#include <bits/stdc++.h>
using namespace std;
const int INF = 1001001001;

int main() {
int N,M;
cin >> N >> M;
vector<int64_t> a(N),b(N);
vector<int64_t> c(M+1),d(M+1);
for (int i = 0;i < N;i++) {
  cin >> a.at(i);
  cin >> b.at(i);
}

for (int j = 1;j < M+1;j++) {
  cin >> c.at(j);
  cin >> d.at(j);
}

vector<int> vec(N);
for (int i = 0;i < N;i++) {
  int cnt = INF;
  for (int j = 1;j < M+1;j++) {
  if (abs(a.at(i)-c.at(j)) + abs (b.at(i) - d.at(j)) < cnt) {
    cnt = abs(a.at(i)-c.at(j)) + abs (b.at(i) - d.at(j));
    vec.at(i) = j;
  }
}

}
for (int i = 0;i < N;i++) cout << vec.at(i) << endl;


return 0;
}

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

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

const long long MOD = 1000000007;

int main(){
  int n;
  cin >> n;
  vector<int> v(n),c(n);
  rep(i,n) cin >> v.at(i);
  rep(i,n) cin >> c.at(i);
  int ans=0;
  rep(i,n){
      if(v.at(i)-c.at(i)>0) ans+=v.at(i)-c.at(i);
  }
  cout << ans << endl;
}


Measured memory_bytes: 256
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
int main(void){
    char a[120],b[120],c[120] ;
    scanf ("%s%s%s",a,b,c) ;
    int aa=strlen(a),bb=strlen(b),cc=strlen(c),next=0 ;
    for (int i=0; i<strlen(a)+strlen(b)+strlen(c); i++){
        if (next==0){
            if (a[strlen(a)-aa]=='a'){
                next=0; 
            } else if (a[strlen(a)-aa]=='b'){
                next=1;
            } else {
                next=2;
            }
            aa--;
        } else if (next==1){
            if (b[strlen(b)-bb]=='a'){
                next=0; 
            } else if (b[strlen(b)-bb]=='b'){
                next=1;
            } else {
                next=2;
            }
            bb--;
        } else {
            if (c[strlen(c)-cc]=='a'){
                next=0; 
            } else if (c[strlen(c)-cc]=='b'){
                next=1;
            } else {
                next=2;
            }
            cc--;
        }
        if (aa<0){
            printf ("A\n");
            exit (0) ;
        } else if (bb<0){
            printf ("B\n") ;
            exit (0) ;
        } else if (cc<0){
            printf ("C\n") ;
            exit (0) ;
        } else {
        }
    }
    return 0 ;
}

Measured memory_bytes: 128
x, y = map(int, input().split())

first_group = [1, 3, 5, 7, 8, 10, 12]
second_group = [4, 6, 9, 11]

if x == 2 or y == 2:
    print('No')
elif x in first_group and y in second_group:
    print('No')
elif x in second_group and y in first_group:
    print('No')
else:
    print('Yes')


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

N, K = map(int, input().split())
h = list(map(int, input().split()))
dp = [None] * N

def solve(n):
    if dp[n] is not None:
        return dp[n]

    if n == 0:
        dp[n] = 0
    elif n == 1:
        dp[n] = abs(h[0] - h[1])
    else:
        ans = 10**10
        for i in range(1, K+1):
            if n - i < 0:
                break
            if dp[n - i] is not None:
                temp = dp[n - i]
            else:
                temp = solve(n - i)
            ans = min(ans, temp + abs(h[n - i] - h[n]))
        dp[n] = ans

    return dp[n]

print(solve(N-1))

Measured memory_bytes: 214552
#include <iostream>
#include <cstring>
#include <string>
#include <algorithm>
#include <cstdlib>
#include <cstdio>
#include <map>
#include <set>
#include <cmath>
#include <vector>
#include <ctime>
#include <queue>
#include <sstream>
#include <utility>
#include <bitset>

using namespace std;

#define MP make_pair 
#define PB push_back 
#define MOD (1000000007) 
#define eps 1e-8
const int INF=1000000007;

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

int n,s,ss;
pii po[100005],rr[100005],rc[100005],rub[100005];
int p[100005],indr[100005],indc[100005];
map<pii,bool> m;
priority_queue<pair<int,pii> > q;
ll ans;

inline bool cmpr(int x,int y)
{
	return po[x].first<po[y].first;
}

inline bool cmpc(int x,int y)
{
	return po[x].second<po[y].second;
}

int FIND(int x)
{
	if(p[x]!=x) return p[x]=FIND(p[x]);
	return x;
}

void UNION(int x,int y)
{
	int rx=FIND(x),ry=FIND(y);
	if(rx!=ry) 
	{
		p[rx]=p[ry];
	}
}

inline int dis(pii x,pii y)
{
	return min(abs(x.first-y.first),abs(x.second-y.second));
}

inline void PUSHR(int i)
{
	int ret=INF,tmp;
	rr[i].first--;
	rr[i].second++;
	if(rr[i].first>0) 
	{
		if(dis(po[indr[rr[i].first]],po[i])<ret) ret=dis(po[indr[rr[i].first]],po[i]),tmp=1;
	}
	if(rr[i].second<=n) 
	{
		if(dis(po[indr[rr[i].second]],po[i])<ret) ret=dis(po[indr[rr[i].second]],po[i]),tmp=2;
	}
	if(tmp==1 && rr[i].first>0) 
	{
		rr[i].second--;
		q.push(MP(-ret,MP(i,indr[rr[i].first])));
	}
	else if(tmp==2 && rr[i].second<=n)
	{
		rr[i].first++;
		q.push(MP(-ret,MP(i,indr[rr[i].second])));
	} 
}

inline void PUSHC(int i)
{
	int ret=INF,tmp;
	rc[i].first--;
	rc[i].second++;
	if(rc[i].first>0) 
	{
		if(dis(po[indc[rc[i].first]],po[i])<ret) ret=dis(po[indc[rc[i].first]],po[i]),tmp=1;
	}
	if(rc[i].second<=n) 
	{
		if(dis(po[indc[rc[i].second]],po[i])<ret) ret=dis(po[indc[rc[i].second]],po[i]),tmp=2;
	}
	if(tmp==1 && rc[i].first>0) 
	{
		rc[i].second--;
		q.push(MP(-ret,MP(i,indc[rc[i].first])));
	}
	else if(tmp==2 && rc[i].second<=n)
	{
		rc[i].first++;
		q.push(MP(-ret,MP(i,indc[rc[i].second])));
	} 
}

int main()
{
	cin>>ss;
	for(int i=1;i<=ss;i++)
	{
		cin>>rub[i].first>>rub[i].second;
		if(m[rub[i]]) continue;
		n++;
		po[n]=rub[i];
		m[po[n]]=1;
	}
	for(int i=1;i<=n;i++){
		p[i]=i;
		indr[i]=i;
		indc[i]=i;
	}
	sort(indr+1,indr+1+n,cmpr);
	sort(indc+1,indc+1+n,cmpc);
	for(int i=1;i<=n;i++)
	{
		rr[indr[i]]=MP(i,i);
		rc[indc[i]]=MP(i,i);
	}
	for(int i=1;i<=n;i++)
	{
		PUSHR(i);
		PUSHC(i);
	}
	for(;s<n-1;)
	{
		int t=-q.top().first;
		pii tp=q.top().second;
		q.pop();
		int fr=tp.first,to=tp.second;
//		cout<<t<<" "<<fr<<" "<<to<<endl;
		PUSHC(fr);
		PUSHC(to);
		PUSHR(fr);
		PUSHR(to);
		if(FIND(fr)==FIND(to)) continue;
		UNION(fr,to);
		ans+=t;

		s++;
	}
	cout<<ans;
	return 0;
}

Measured memory_bytes: 111200
N = list(input())
n = 0

S = 0
for i in range(len(N)):
    S = S + int(N[i])
    n = (int(N[i]) * (10 ** (len(N) - i - 1))) + n
    
if n % S == 0:
    print('Yes')
else:
    print('No')

Measured memory_bytes: 3060
S = input()
first = int(S[0:2])
second = int(S[2:4])
if first > 0 and first <= 12:
	if second > 0 and second <= 12:
		print("AMBIGUOUS")
	else:
		print("MMYY")
elif second > 0 and second <= 12:
	print("YYMM")
else:
	print("NA")


Measured memory_bytes: 3060
import sys
input = sys.stdin.readline

N,K=map(int,input().split())
mod=10**9+7

L=[i for i in range(K+1)]

for i in range(1,K):
    for j in range(i*2,K+1,i):
        L[j]-=L[i]

ANS=0
for i in range(1,K+1):
    ANS=(ANS+pow(K//i,N,mod)*L[i])%mod

print(ANS)


Measured memory_bytes: 73804
#include <stdio.h>

int main () {
  int i;
  int h[999999],w[999999],x,y;

  for (i=0;i<999999;i++) {
    h[i] = 0;
    w[i] = 0;
  }

  i=0;
  while (1) {
    scanf ("%d %d",&h[i],&w[i]);
    if (h[i] == 0 || w[i] == 0) break;
    i++;
  }

  for (i=0;i<999999;i++) {
    if (h[i] == 0 || w[i] == 0) break;
    for (y=0;y<h[i];y++) {
      for (x=0;x<w[i];x++) {
        printf ("#");
      }
      printf ("\n");
    }
    printf ("\n");
  }

  return 0;
}

Measured memory_bytes: 8384
#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
const int maxn=1000;
bool cmp(int a,int b)
{
    return a>b;
}
int main()
{
    ll a[100000],sum=0;
    ll flag=0,n,k,q,m;
    priority_queue<ll> s;
    scanf("%lld%lld",&n,&m);
    for(int i=0;i<n;i++){
        scanf("%lld",&a[i]);
        s.push(a[i]);
    }
    while(m--){
        ll k=s.top();
        s.pop();
        s.push(k/2);
    }
    while(s.size()){
        sum+=s.top();
        s.pop();
    }
    printf("%lld\n",sum);
    return 0;
}


Measured memory_bytes: 1912
#include <iostream>
#include <vector>
#include <math.h>
using namespace std;

int main()
{
    int n;
    cin >> n;
    vector<vector<int> > v(n, vector<int>(3, 0));
    for(int i = 0; i < n; i++){
        cin >> v[i][0] >> v[i][1] >> v[i][2];
    }
    vector<vector<int> > dp(n, vector<int>(3,0));
    int i;
    dp[0][0] = v[0][0];
    dp[0][1] = v[0][1];
    dp[0][2] = v[0][2];
    for(i = 1; i < n; i++){
        dp[i][0] = max(dp[i-1][1], dp[i-1][2]) + v[i][0];
        dp[i][1] = max(dp[i-1][0], dp[i-1][2]) + v[i][1];
        dp[i][2] = max(dp[i-1][0], dp[i-1][1]) + v[i][2];
    }
    cout << max(max(dp[n-1][0], dp[n-1][1]), dp[n-1][2]) << endl;
    return 0;
}


Measured memory_bytes: 11136
x,y=gets.split.map(&:to_i)
s=gets.split.map(&:to_i)
up=x
down=x
for i in 0..100
  if !(s.include?(down))
    do1=1
    break
  elsif !(s.include?(up))
    up1=1
    break
  end
  up+=1
  down-=1
end
if do1==1
  puts down
elsif up1==1
  puts up
else
  puts x
end


Measured memory_bytes: 14408
#include<iostream>
#define mod 1000000007
using namespace std;

long long jie[1000005];

long long qpow(long long a,long long b){
	long long ans=1;
	while(b){
		if(b%2)
			ans=(ans*a)%mod;
		a=(a*a)%mod;
		b/=2;
	}
	return ans%mod;
}

void f(){
	jie[0]=1;
	for(int i=1;i<1000001;i++)
		jie[i]=(jie[i-1]*i)%mod;
}

long long c(long long n,long long m){
	long long a=jie[n];
	long long b=(jie[m]*jie[n-m])%mod;
	return (a*qpow(b,mod-2))%mod;
}

int main(){
	f();
	int h,w,a,b,ans=0;
	cin>>h>>w>>a>>b;
	for(int i=b+1;i<=w;i++){
		long long t=(c(h-a+i-2,h-a-1)%mod*c(w-i+a-1,w-i)%mod)%mod;
		ans=(ans+t)%mod;
	}
	
	cout<<ans<<endl;
	
	return 0;
}

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

int main(){
	ll q,h,s,d;
	cin >> q >> h >> s >> d;
	ll n;
	cin >> n;
	ll one_l;
	one_l = min(q*4,h*2);
	one_l = min(one_l,s);
	if(one_l*2>d){
		if(n%2==1)
			cout << n/2*d+one_l << endl;
		else
			cout << n/2*d << endl;
	}
	else
		cout << n*one_l << endl;
	return 0;
}

Measured memory_bytes: 256
import java.util.*;
public class Main {
	public static void main(String[] args){
      	int Access = 0;
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();		
      	int a;
      	for(int i= 1; i<=n;i++)
        {
         	a = sc.nextInt();          	
          	if (a%2!=1)
            {
              if(a%3==0||a%5==0)
              {     
                Access=Access;
              }
              else
              {
                Access=Access+1;
              }
            }
          	else
            {
              Access=Access;
            }
        }	
      	if(Access==0)
        {
          System.out.println("APPROVED");
        }
      	else
        {
          System.out.println("DENIED");
        }
	}
}

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

using namespace std;

typedef long long ll;

ll n, a, b;
ll ans = LLONG_MAX;

int main(){
    scanf("%lld %lld %lld", &n, &a, &b);
    if((b-a)%2 == 0){
        printf("%lld", (b-a)/2);
        return 0;
    }
    ans = min(b-1, n-a);
    ans = min(ans, a+(b-a-1)/2);
    a=n+1-a, b=n+1-b, swap(a, b);
    ans = min(ans, a+(b-a-1)/2);
    printf("%lld", ans);
}


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


using namespace std;
int n;
vector<int> C;
vector<int> a;

bool rec(int i, int k) {
    if (k == 0) return true;
    if (i >= a.size()) return false;
    return rec(i + 1, k) || rec(i + 1, k - a[i]);
}


int main() {

    cin >> n;
    a.resize(n);
    C.resize(n);

    for (auto it = a.begin(); it != a.end(); it++) {
        cin >> *it;
    }
    
    int q;
    cin >> q;
    for (int i1 = 0; i1 < q; i1++) {
        int num;
        cin >> num;
        cout << (rec(0, num) ? "yes" : "no") << endl;

    }
    return 0;
};


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

using namespace std;

#define rep(i, n) for(int i = 0; i < (int)n; ++i)
#define FOR(i, a, b) for(int i = a; i < (int)b; ++i)

typedef long long ll;

const int Inf = 1e9;
const double EPS = 1e-9;

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

int lcm(int a, int b) {
    return a * b / gcd(a, b);
}

int bitCount(long bits) {
    bits = (bits & 0x55555555) + (bits >> 1 & 0x55555555);
    bits = (bits & 0x33333333) + (bits >> 2 & 0x33333333);
    bits = (bits & 0x0f0f0f0f) + (bits >> 4 & 0x0f0f0f0f);
    bits = (bits & 0x00ff00ff) + (bits >> 8 & 0x00ff00ff);
    return (bits & 0x0000ffff) + (bits >>16 & 0x0000ffff);
}

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n, m;
    cin >> n >> m;
    int ans = m * 1900 + (n - m) * 100;
    rep (i, m) {
        ans *= 2;
    }
    cout << ans << endl;
    
    return 0;
}



Measured memory_bytes: 256
#include <algorithm>
#include <assert.h>
#include <bitset>
#include <cassert>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <memory.h>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <sstream>
#include <utility>
#include <vector>
using namespace std;

typedef pair<int,int> PII;
typedef long long LL;

#define ALL(x) x.begin(),x.end()

#define DEB(args...) fprintf(stderr,args)

#define PB push_back
#define MP make_pair
#define ST first
#define ND second 

const int INF = 0x3f3f3f3f;
const int N = 550;


long long mat[N][N];

int main(){
	int H, W, h, w;
	scanf("%d%d%d%d",&H, &W, &h, &w);
	for(int i = 1; i <= H; i++){
		for(int j = 1; j <= W; j++){
			mat[i][j]=4000;
		}
	}
	for(int i = h; i <= H; i += h){
		for(int j = w; j <= W; j += w){
			mat[i][j]=-(h*w-1)*4000-1;
		}
	}
	long long resp = 0;
	for(int i = 1; i <= H; i++){
		for(int j = 1; j <= W; j++){
			resp += mat[i][j];
		}
	}
	if(resp<=0)puts("No");
	else{
		puts("Yes");
		for(int i = 1; i <= H; i++){
			for(int j = 1; j <= W; j++){
				if(j!=1)printf(" ");
				printf("%lld",mat[i][j]);
			}
			printf("\n");
		}
	}

}

Measured memory_bytes: 3712
fun main(args : Array<String>) {
    val s = readLine()!!.toLong()
    val sqrt = Math.sqrt(s.toDouble()).toLong()

    if (sqrt * sqrt == s) {
        println("0 0 $sqrt 0 0 $sqrt")
        return
    }

    val diff = (sqrt+1) * (sqrt+1) - s
    println("0 0 ${sqrt+1} 1 $diff ${sqrt+1}")
}

Measured memory_bytes: 29956
import java.util.Scanner;
public class Main {

	public static void main(String[] args) {
		Scanner stdIn = new Scanner(System.in);
		
		char[] s = stdIn.next().toCharArray();
		
		int cnt = 0;
		
		for(int i = 0; i < s.length/2; i++) {
			if(s[i]!= s[s.length-i-1]) {
				cnt++;
			}
		}
		System.out.println(cnt);
		
	}

}


Measured memory_bytes: 21588
import Control.Monad
import Data.List

main=do
  [n,m]<-map read.words<$>getLine
  as<-map read.words<$>getLine
  bcs<-replicateM m$(\[a,b]->(a,b)).map read.words<$>getLine
  print $ solve as bcs

solve :: [Integer]->[(Integer,Integer)]->Integer
solve as bcs = go sas sbcs
  where
  go [] _ = 0
  go as [] = sum as
  go (a:as) ((b,c):bcs)
    | b == 0 = go (a:as) bcs
    | c > a = c + go as ((b-1,c):bcs)
    | otherwise = a + go as ((b,c):bcs)
  sas = sort as
  sbcs = sortBy f bcs
  f (_,a) (_,b) = compare b a

Measured memory_bytes: 161916
//   _/                _/                 _/_/_/   _/
//_/_/_/_/   _/_/   _/_/_/_/   _/_/    _/       _/_/
// _/     _/    _/   _/     _/    _/  _/_/_/     _/
//_/     _/    _/   _/     _/    _/  _/    _/   _/
// _/_/   _/_/       _/_/   _/_/      _/_/     _/
#include<iostream>
#include<algorithm>
#include<cmath>
#include<iomanip>
#include<set>
#include<map>
#include<queue>
#include<vector>
using namespace std;
typedef long long ll;
const int MOD=1e9+7;
const double pi=3.14159265358979323846;
int main() {
  cin.tie(0),cout.tie(0);
  ios::sync_with_stdio(false);
  double a,b,x;
  cin >> a >> b >> x;
  if(x<=a*a*b/2) {
    cout << fixed << setprecision(10) << atan((a*b*b)/(2*x))*180/pi << endl;
  }
  else {
    cout << fixed << setprecision(10) << atan((2*a*a*b-2*x)/(a*a*a))*180/pi << endl;
  }
}



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

#define ls st<<1
#define rs st<<1|1
#define LL long long 
#define CLR(a,b) memset(a,(b),sizeof(a))

const int MAXN = 1e3+11;
const int mod = 1e9+7;
const int INF = 0x3f3f3f3f; 

/* ------------------------基本函数-------------------------*/
long long read()
{
    long long res = 0;
    char ch = 0;
    while (ch < '0' || ch > '9')
        ch = getchar();
    while (ch >= '0' && ch <= '9')
    {
        res = res * 10 + ch - '0';
        ch = getchar();
    }
    return res;
}
bool prime(int x) {
	if(x==2 || x==3) 
		return true;
	if(x%2==0 || x%3==0 || x==1)
		return false;
	int k = sqrt(x)+1;
	for(int i = 5; i < k; i++) {
		if(x%i==0 || x%(i+2)==0)
			return false;
	}
	return true;
} 

LL pow_mod(int a, int b, int c) {
	LL ans = 1;
	while(b) {
		if(b&1)
			ans = (ans*1) % c;
		a = (a*a) % c;
		b /= 2;
	}
	return ans;
}
int gcd(int a, int b) {
	if(!b) 
		return a;
	return gcd(b,a%b);
}
/*-------------------------------------------------------*/


int main() {
	int arr[3];
	cin >> arr[0] >> arr[1] >> arr[2];
	sort(arr,arr+3);
	if(arr[2]==arr[1]+arr[0]) cout << "Yes\n";
	else cout << "No\n";
	
return 0;
}

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


//auto mod int
//https://github.com/atcoder-live/library/blob/master/mint.cpp

const int mod = 1000000007;
//const int mod = 998244353;

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

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

istream& operator>>(istream& is, const mint& a) { return is >> a.x;}
ostream& operator<<(ostream& os, const mint& a) { return os << a.x;}

int main() {
    int n_, k_;
    cin >> n_ >> k_;
    const mint e = 2;
    mint n = n_;
    mint k = k_;

    mint ans = (n+1);
    ans *= (n+k+1)/e;
    ans *= n+e-k;
    ans -= (n+1)*(n+e)*(e*n+3)/6;
    ans += (k-1)*k*(e*k-1)/6;
    ans += n+e-k;
    cout << ans << endl;
}

Measured memory_bytes: 3584
n=gets.to_i
s=""
if n==0
  puts 0
  exit
end
f=true
while n!=0
  if n.odd?
    s << "1"
    if f
      n-=1
    else
      n+=1
    end
  else
    s << "0"
  end
  n/=2
  f=!f
end
puts s.reverse

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

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;

#define REP(i, n) for(int i=0; i<(n); ++i)
#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 DEBUG(x) cout<<#x<<": "<<x<<'\n'
#define DEBUG_VEC(v) cout<<#v<<":";REP(i, v.size())cout<<' '<<v[i];cout<<'\n'
#define ALL(a) (a).begin(), (a).end()

#define CHMIN(a, b) a=min((a), (b))
#define CHMAX(a, b) a=max((a), (b))

const ll MOD=1000000007ll;
// const ll MOD=998244353ll;
#define FIX(a) ((a)%MOD+MOD)%MOD

const double EPS=1e-11;
#define EQ0(x) (abs((x))<EPS)
#define EQ(a, b) (abs((a)-(b))<EPS)

int main(){
	ios::sync_with_stdio(false);
	cin.tie(0);
	string s;
	cin>>s;
	REP(i, s.size()-1){
		if(s[i]=='A' && s[i+1]=='C'){
			cout<<"Yes"<<'\n';
			return 0;
		}
	}
	cout<<"No"<<'\n';
	return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<algorithm>
#include<vector>
#include<queue>
#include<string>
using namespace std;
typedef long long ll;
ll tourist[100005]={0};
ll k;
bool judge(ll n){
  for(int i=0;i<k;i++){
    n=n-(n%tourist[i]);
  }
  if(n==2) return true;
  else return false;
}
int main(){
  cin>>k;
  for(int i=0;i<k;i++) cin>>tourist[i];
  ll mi=2;
  //cout<<-1<<endl;
  //return 0;
  for(int i=k-1;i>0;i--){
    ll sr=tourist[i-1];
    ll ks=0;
    if(sr>mi) ks=sr-mi;
    if(sr<mi){
      ks=sr-(mi%sr);
      if(ks==sr) ks=0;
    }
    mi+=ks;
  }
  if(!judge(mi)) {
    cout<<-1<<endl;
    return 0;
  }
  ll lb=0,rb=mi+1;
  while(rb-lb>1){
    ll mid=(lb+rb)/2;
    if(judge(mid)) rb=mid;
    else lb=mid;
  }
  cout<<rb<<" ";
  ll lb2=rb,rb2=1e18;
  while(rb2-lb2>1){
    ll mid=(lb2+rb2)/2;
    if(judge(mid)) lb2=mid;
    else rb2=mid;
  }
  cout<<lb2<<endl;
}


Measured memory_bytes: 1024
n,q = map(int,input().split())
s = input()
l = [0]*q
r = [0]*q

c = [0]
a = 0
for j in range(n) :
  if s[j:j+2] == 'AC' :
    a += 1
  c.append(a)

for i in range(q) :
  l[i], r[i] = map(int,input().split())
  print(c[r[i]-1] - c[l[i]-1])

Measured memory_bytes: 13996
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ld long double
#define REP(i,m,n) for(int i=(int)(m); i<(int)(n); i++)
#define rep(i,n) REP(i,0,n)
#define RREP(i,m,n) for(int i=(int)(m); i>=(int)(n); i--)
#define rrep(i,n) RREP(i,n-1,0)
#define all(v) v.begin(), v.end()
const int inf = 1e9+7;
const ll longinf = 1LL<<60;
const ll mod = 1e9+7;
const ld eps = 1e-10;

void find_divisor(ll N, vector<ll>& divisor) {
  for(int i=1; i<=sqrt(N); i++) {
    if(N % i == 0)
      divisor.push_back(i);
  }
  int n = divisor.size();
  for(int i=n-1; i>=0; i--) {
    if(N != (ll)pow(divisor[i], 2))
      divisor.push_back(N / divisor[i]);
  }
}
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int n; ll m; cin >> n >> m;
  vector<ll> div;
  find_divisor(m, div);
  ll ans = 0;
  for(auto d: div) {
    if(m/d>=n) ans = d;
    else break;
  }
  cout << ans << "\n";
  return 0;
}


Measured memory_bytes: 3700