akhauriyash/Code-Regression huggingface dataset:
from collections import deque


def inpl():
    return list(map(int, input().split()))


N, D, A = inpl()
XH = [inpl() for i in range(N)]
XH.sort()
# print(XH)

bomb = [(h + A - 1) // A for x, h in XH]

ans = 0
dq = deque()
s_i = 0
sum_q = 0
for i in range(N):
    while dq and dq[0][1] < XH[i][0]:
        b, _ = dq.popleft()
        sum_q -= b

    bomb[i] -= sum_q
    if bomb[i] <= 0:
        pass
    else:
        ans += bomb[i]
        sum_q += bomb[i]
        dq.append([bomb[i], XH[i][0] + 2 * D])

print(ans)


Measured memory_bytes: 71112
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int MOD = 1e9+7;
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n) for(int i=0;i<(n);++i)
#define ALL(obj) (obj).begin(), (obj).end()

int main(){
	int N;
	cin >> N;
	double x[N];
	string u[N];
	double sum = 0;
	REP(i, N){
		cin >> x[i] >> u[i];
		if(u[i] == "JPY"){
			sum += x[i];
		}else{
			sum += x[i] * 380000.0;
		}
	}
	printf("%f\n", sum);
}

Measured memory_bytes: 256
#include <map>
#include <set>
#include <deque>
#include <queue>
#include <stack>
#include <cmath>
#include <vector>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <algorithm>
#include<functional>
using  namespace std;
typedef long long ll;
#define pd(x) printf("%d\n",x)
const double eps=1e-6;
const double PI=acos(-1.0);
const ll INF=1e15+10;
const int MOD=1e9+7;
const int N=2e5+15;
ll a[N];
//char s[N];
int main()
{
    int n;
    while(~scanf("%d",&n))
    {
        a[0]=0;
        for(int i=1;i<=n;i++)
        {
            scanf("%lld",&a[i]);
            a[i]+=a[i-1];
        }
        ll mi=INF;
        for(int i=2;i<=n;i++)
            mi=min(mi,abs(a[n]-a[i-1]-a[i-1]));
        printf("%lld\n",mi);
    }
    return 0;
}


Measured memory_bytes: 1792
#include <iostream>
#include <iomanip>
#include <vector>
#include <valarray>
#include <map>
#include <set>
#include <list>
#include <queue>
#include <stack>
#include <bitset>
#include <utility>
#include <numeric>
#include <algorithm>
#include <functional>
#include <complex>
#include <string>
#include <sstream>

#include <cstdio>
#include <cstdlib>
#include <cctype>
#include <cstring>
#include <cmath>

using namespace std;

#define all(c) c.begin(),c.end()
#define repeat(i,n) for(int i=0;i<static_cast<int>(n);i++)
#define debug(x) #x << "=" << (x)
#define dump(x) cerr << debug(x) << " (L:" << __LINE__ << ")"<< endl

typedef long long ll;
typedef vector<int> vi;

template<typename T>
ostream& operator<<(ostream& os, const vector<T>& vec){
    os << "[";
    for(int i = 0; i < vec.size(); i++){
        os << vec[i] << ",";
    }
    os << "]";
    return os;
}

template<typename T>
T input(){
    T t;
    cin >> t;
    return t;
}

template<typename T>
vector<T> input(const int N){
    vector<T> v(N);
    repeat(i,N) cin >> v[i];
    return v;
}

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

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

int main(){
    char X, Y;
    cin >> X >> Y;
    if (X > Y) {
        cout << ">" << endl;
    } else if (X < Y) {
        cout << "<" << endl;
    } else {
        cout << "=" << endl;
    }
    return 0;
}


Measured memory_bytes: 636
#!/usr/bin/env python
# -*- coding: utf-8 -*-

while True:
    N,Q = map(int,input().split(" "))
    if N == 0 and Q == 0:
        break
    dateList = [0 for i in range(101)]
    for i in range(N):
        date = list(map(int,input().split()))
        for d in date[1:]:
            dateList[d] += 1
    max_participant = max(dateList)
    if max_participant < Q:
        print(0)
    else:
        for i in range(101):
            if max_participant == dateList[i]:
                print(i)
                break

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

template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }

#define rep(i,cc,n) for(int i=cc;i<n;++i)
#define lrep(i,cc,n) for(long long i=cc;i<n;++i)
#define sqrep(i,cc,n) for(long long i=cc;i*i<=n;++i)
#define rrep(i,cc,n) for(long i=cc;i>n;--i)
#define pii pair<int, int>
#define pll pair<long long, long long>
 
using ll = long long;

const vector<int> dx = {1, 0, -1, 0};
const vector<int> dy = {0, 1, 0, -1};
const ll inf = 1001001001;
const ll e9  = 1000000000;
const ll mod = 1000000007;


int main(){
    int n;
    cin >> n;
    vector<int>a1(n),a2(n);
    rep(i, 0, n)cin >> a1[i];
    rep(i, 0, n)cin >> a2[i];
    int ans = 0;
    rep(i, 0, n){
        int tempans = 0;
        rep(j, 0, i+1){
            tempans += a1[j];
        }
        rep(j, i, n){
            tempans += a2[j];
        }
        ans = max(ans,tempans);
    }
    cout << ans << endl;
}

Measured memory_bytes: 3608
#include <unordered_map>
#include <algorithm>
#include <iostream>
#include <iomanip>
#include <cstring>
#include <string>
#include <vector>
#include <cmath>
#include <map>
using namespace std;

string T;
unordered_map < long long , bool > have;

namespace H2 {

	long long mod = 1000000009LL;

	long long power(long long a, long long b)
	{
		long long ret = 1;
		while(b)
		{
			if(b&1)
				ret = (ret * a) % mod;
			a = (a * a) % mod;
			b /= 2;
		}
		return ret;
	}


	long long inv(long long x)
	{
		return power(x, mod - 2);
	}

	long long base = 10000019;
	long long val[100001];
	long long invPow[100001];

	long long getHash(int start, int len)
	{
		long long v = val[start + len] - val[start];
		v %= mod;
		if(v < 0) v += mod;
		v *= invPow[start];
		v %= mod;
		return v;
	}



	void prepare()
	{
		invPow[0] = 1;
		invPow[1] = inv(base);
		for(int i = 2; i <= 100000; i++)
			invPow[i] = (invPow[i-1] * invPow[1]) % mod;
		val[0] = 0;
		long long weight = 1;
		for(int i = 0; i < T.length(); i++)
		{
			val[i+1] = (val[i] + (long long)T[i] * weight) % mod;
			weight = (weight * base) % mod;
		}
	}

}


namespace H1 {

	long long mod = 1000000007LL;

	long long power(long long a, long long b)
	{
		long long ret = 1;
		while(b)
		{
			if(b&1)
				ret = (ret * a) % mod;
			a = (a * a) % mod;
			b /= 2;
		}
		return ret;
	}


	long long inv(long long x)
	{
		return power(x, mod - 2);
	}

	long long base = 22222223;
	long long val[100001];
	long long invPow[100001];

	long long getHash(int start, int len)
	{
		long long v = val[start + len] - val[start];
		v %= mod;
		if(v < 0) v += mod;
		v *= invPow[start];
		v %= mod;
		return v;
	}



	void prepare()
	{
		invPow[0] = 1;
		invPow[1] = inv(base);
		for(int i = 2; i <= 100000; i++)
			invPow[i] = (invPow[i-1] * invPow[1]) % mod;
		val[0] = 0;
		long long weight = 1;
		for(int i = 0; i < T.length(); i++)
		{
			val[i+1] = (val[i] + (long long)T[i] * weight) % mod;
			weight = (weight * base) % mod;
		}
	}

}

int calc(int len)
{
	int cnt = 0;
	have.clear();
	for(int offset = 0; offset + len <= T.length(); offset ++)
	{
		long long s = H1::getHash(offset, len) + H2::getHash(offset, len) * 1000000010;
		if(have.count(s)) continue;
		have[s] = true;
		cnt ++;
	}
	return cnt;
}

int MAIN()
{
	
	cin >> T;
	
	H1::prepare();
	H2::prepare();

	long long L = 1, R = T.length();
	while(R - L > 3)
	{
		long long M1 = (2*L + R) / 3;
		long long M2 = (2*R + L) / 3;
		if(calc(M1) < calc(M2))
			L = M1;
		else
			R = M2;
	}
	int ans = 0;
	for(int i = L; i <= R; i++)
		ans = max(ans, calc(i));
	cout << ans << endl;
	return 0;
}

int main()
{
	int start = clock();
	#ifdef LOCAL_TEST
		freopen("in.txt", "r", stdin);
		freopen("out.txt", "w", stdout);
	#endif
	ios :: sync_with_stdio(false);
	cout << fixed << setprecision(16);
	int ret = MAIN();
	#ifdef LOCAL_TEST
		cout << "[Finished in " << clock() - start << " ms]" << endl;
	#endif
	return ret;
}


Measured memory_bytes: 7668
N=int(input())
S=list(input())

a=[]
b=[]
max=0

for i in range(1,(N)):
  a=[]
  b=[]
  for j in range(i):
    #print(i,j,S[j])
    a.append(S[j])
  #print(a,len(set(a)))
  for j in range(i,N):
    #print(i,j,S[j])
    b.append(S[j])
  #print(b,len(set(b)))
  if len(set(a)&set(b))>max:
    max=len(set(a)&set(b))
print(max)

Measured memory_bytes: 3064
#include <iostream>

using namespace std;

int dp[2001][20011];

int main() {

    int N, Y;
    cin >> N >> Y;
    Y /= 1000;

    fill(dp[0], dp[2001], 0);
    dp[0][0] = 1;

    for (int i = 0; i < N; i++) {
        for (int j = 0; j < Y; j++) {
            if (dp[i][j]) {
                dp[i + 1][j + 10] = dp[i][j];
                dp[i + 1][j + 5] = dp[i][j];
                dp[i + 1][j + 1] = dp[i][j];
            }
        }
    }

    if (dp[N][Y]) {
        int x, y, z, p;
        x = y = z = 0;
        p = Y;
        for (int i = N; i >= 1; i--) {
            if (dp[i - 1][p - 1]) {
                z++, p--;
                continue;
            }
            if (dp[i - 1][p - 5]) {
                y++, p -= 5;
                continue;
            }
            if (dp[i - 1][p - 10]) {
                x++, p -= 10;
                continue;
            }
        }
        cout << x << " " << y << " " << z << endl;
    } else {
        cout << "-1 -1 -1" << endl;
    }
}

Measured memory_bytes: 156672
#include "bits/stdc++.h"
using namespace std;

#define ASC(vec) vec.begin(), vec.end()		// 昇順ソート 例：sort(ASC(vec));
#define DESC(vec) vec.rbegin(), vec.rend()	// 降順ソート 例:sort(DESC(vec));
#define rep(i, n) for(i = 0; i < n; i++)
#define Rep(i, n) for(i = 1; i < n; i++)

const int inf = (int)1e9 + 7;
const long long INF = 1LL << 60;

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

typedef long long ll;

// 4,8方向に探索する際に用いる配列
//int dx[4] = { 0,  0, 1, -1 };
//int dy[4] = { 1, -1, 0,  0 };
//int dx[8] = { 1, 0, -1,  0, 1, -1, -1,  1 };
//int dy[8] = { 0, 1,  0, -1, 1,  1, -1, -1 };

int main()
{
	int N, K;
	string s;

	cin >> N >> s >> K;

	for (int i = 0; i < s.size(); i++)
	{
		if (s[i] != s[K - 1]) s[i] = '*';
	}
	cout << s << endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int main(){
    long n; cin >> n;
    long cnt = 0;
    string s; cin >> s;
    vector<int> v(3);
    for(int i=0;i<1000;i++){
        v[0] = i/100; v[1] = (i%100)/10; v[2] = i%10;
        long a = 0;
        for(int j=0;j<n;j++){
            if(v[a] == (int)(s[j]-'0'))a++;
            if(a == 3){
                cnt++;
                break;
            }
        }
        a = 0;
    }
    cout << cnt << endl;
}    

Measured memory_bytes: 3644
#include<bits/stdc++.h>
#define ll long long
#define Vi vector<vector<int>>
#define Vl vector<vector<ll>>
#define vi vector<int>
#define vb vector<bool>
#define vl vector<ll>
#define vp vector<pair<int,int>>
#define mod 1000000007
using namespace std;
int util(int index,vi &arr,int A,int B,int C,bool flag1,bool flag2,bool flag3){
	// cout<<index<<" "<<A<<" "<<B<<" "<<C<<" "<<flag1<<" "<<flag2<<" "<<flag3<<endl;
	int n=arr.size();
	if(index==n)
		if(flag1 && flag2 && flag3){
			// cout<<A+B+C<<endl;
			return abs(A)+abs(B)+abs(C);
		}
		else {
			// cout<<100000<<endl;
			return 100000;
		}

	int res=INT_MAX;
	if(A!=0){
		if(!flag1){
			res=min(res,util(index+1,arr,(A-arr[index]),B,C,1,flag2,flag3));
			// res=min(res,abs(A-arr[index])+util(index+1,arr,0,B,C,1,flag2,flag3));
		}
		else{
			// if(10+abs(A-arr[index])<A)
				res=min(res,10+util(index+1,arr,(A-arr[index]),B,C,flag1,flag2,flag3));
			res=min(res,abs(A)+util(index+1,arr,0,B,C,flag1,flag2,flag3));
		}
			
		// res=min(res,A+util(index+1,arr,0,B,C));
	}
	if(B!=0){
		if(!flag2){
			res=min(res,util(index+1,arr,A,(B-arr[index]),C,flag1,1,flag3));
			// res=min(res,abs(B-arr[index])+util(index+1,arr,A,0,C,flag1,1,flag3));
		}
		else{
			// if(10+abs(B-arr[index])<B)
				res=min(res,10+util(index+1,arr,A,(B-arr[index]),C,flag1,flag2,flag3));
			res=min(res,abs(B)+util(index+1,arr,A,0,C,flag1,flag2,flag3));
		}
	}
	if(C!=0){
		if(!flag3){
			res=min(res,util(index+1,arr,A,B,(C-arr[index]),flag1,flag2,1));
			// res=min(res,abs(C-arr[index])+util(index+1,arr,A,B,0,flag1,flag2,1));
		}
		else{
			// if(10+abs(C-arr[index])<C)
			res=min(res,10+util(index+1,arr,A,B,(C-arr[index]),flag1,flag2,flag3));
			res=min(res,abs(C)+util(index+1,arr,A,B,0,flag1,flag2,flag3));
		}
	}
	res=min(res,util(index+1,arr,A,B,C,flag1,flag2,flag3));
	// cout<<index<<" "<<A<<" "<<B<<" "<<C<<" "<<flag1<<" "<<flag2<<" "<<flag3<<" "<<res<<endl;
	return res;
}
int main(){
	int n,A,B,C;
	cin>>n>>A>>B>>C;
	vi arr(n);
	for(int i=0;i<n;i++)
		cin>>arr[i];
	int res=util(0,arr,A,B,C,0,0,0);
	cout<<res<<endl;
	return 0;
}

Measured memory_bytes: 256
using System;
using System.Linq;

namespace ABC102_B
{
    class Program
    {
        static void Main(string[] args)
        {
            var n = int.Parse(Console.ReadLine());
            var a = Console.ReadLine().Split().Select(int.Parse).ToArray();
            Console.WriteLine(a.Max() - a.Min());
        }
    }
}


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

using ll = long long;

int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  
  ll h, w, n;
  cin >> h >> w >> n;
  
  map<pair<int, int>, int> mp;
  int a, b;
  for(int i = 0; i < n; i++){
    cin >> a >> b;
    for(int j = -1; j <= 1; j++){
      for(int k = -1; k <= 1; k++){
        if(a + j >= 2 && a + j <= h - 1 && b + k >= 2 && b + k <= w - 1){
          mp[make_pair(a + j, b + k)]++;
        }
      }
    }
  }
  
  vector<ll> ans(10, 0);
  for(auto it = mp.begin(); it != mp.end(); it++){
    ans.at(it->second)++;
  }
  
  ll keep = (h - 2) * (w - 2);
  for(int i = 1; i < 10; i++) keep -= ans.at(i);
  ans.at(0) = keep;
  
  for(int i = 0; i < 10; i++) cout << ans.at(i) << '\n';
}

Measured memory_bytes: 56576
#include<stdio.h>

int main(void)
{
    int x;
    int ans=0;
    int ans1=0;

    scanf("%d",&x);

    if (x==0)
        printf("0\n");
    else{
        ans=x/500*1000;
        // printf("%d\n",ans);
        ans1=x%500/5*5;
        // printf("%d\n",ans1);
        printf("%d\n",ans+ans1);
    }
    return 0;
}

Measured memory_bytes: 128
# python template for atcoder1
import sys
sys.setrecursionlimit(10**9)
input = sys.stdin.readline


class SegmentTree():
    '''
    非再帰
    segment tree
    '''

    def __init__(self, n, func, init=float('inf')):
        '''
        n->配列の長さ
        func:func(a,b)->val,　func=minだとRMQになる
        木の高さhとすると,
        n:h-1までのノード数。h段目のノードにアクセスするために使う。
        data:ノード。
        parent:k->child k*2+1とk*2+2
        '''
        self.n = 2**(n-1).bit_length()
        self.init = init
        self.data = [init]*(2*self.n)
        self.func = func

    def set(self, k, v):
        '''
        あたいの初期化
        '''
        self.data[k+self.n-1] = v

    def build(self):
        '''
        setの後に一斉更新
        '''
        for k in reversed(range(self.n-1)):
            self.data[k] = self.func(self.data[k*2+1], self.data[k*2+2])

    def update(self, k, a):
        '''
        list[k]=aに更新する。
        更新ぶんをrootまで更新
        '''
        k += self.n-1
        self.data[k] = a

        while k > 0:
            k = (k-1)//2
            self.data[k] = self.func(self.data[k*2+1], self.data[k*2+2])

    def query(self, l, r):
        '''
        [l,r)のfuncを求める
        '''
        L = l+self.n
        R = r+self.n
        ret = self.init
        while L < R:
            if R & 1:
                R -= 1
                ret = self.func(ret, self.data[R-1])
            if L & 1:
                ret = self.func(ret, self.data[L-1])
                L += 1
            L >>= 1
            R >>= 1
        return ret


N = int(input())
L = [list(map(int, input().split())) for _ in range(N)]
L = sorted(L, key=lambda x: x[0])

Seg_L = SegmentTree(N, lambda a, b: max(a, b), init=0)
Seg_R = SegmentTree(N, lambda a, b: min(a, b), init=float('inf'))

for i, q in enumerate(L):
    l, r = q[0], q[1]
    Seg_L.set(i, l)
    Seg_R.set(i, r)
Seg_L.build()
Seg_R.build()
cand = []
for pivot in range(1, N):
    low_1, high_1 = Seg_L.query(0, pivot), Seg_R.query(0, pivot)
    low_2, high_2 = Seg_L.query(pivot, N), Seg_R.query(pivot, N)
    p1 = max(high_1-low_1+1, 0)
    p2 = max(high_2-low_2+1, 0)
    ans = p1+p2
    cand.append(ans)
ans1 = max(cand)

cand2 = []
for rem in range(N):
    rem_low = Seg_L.query(rem, rem+1)
    rem_high = Seg_R.query(rem, rem+1)
    use_low = max(Seg_L.query(0, rem), Seg_L.query(rem+1, N))
    use_high = min(Seg_R.query(0, rem), Seg_R.query(rem+1, N))
    p1 = max(rem_high-rem_low+1, 0)
    p2 = max(use_high-use_low+1, 0)
    ans = p1+p2
    cand2.append(ans)
ans2 = max(cand2)
print(max(ans1, ans2))


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

int main()
{
  int a, b;
  cin>>a>>b;
  if((a==1 && b==2)||(a==2 && b==1))
  {
    cout<<"3";
  }
  if((a==1 && b==3)||(a==3 && b==1))
  {
    cout<<"2";
  }
  if((a==3 && b==2)||(a==2 && b==3))
  {
    cout<<"1";
  }
  return 0;
} 

Measured memory_bytes: 256
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n=sc.nextInt(),buff;
		for(int i=0;i<n;i++) {
			buff=sc.nextInt();
			if(buff%2==0) {
				if(buff%3==0 || buff%5==0) {
				}else {
					System.out.println("DENIED");
					System.exit(0);
				}
			}
		}
		System.out.println("APPROVED");

	}
}



Measured memory_bytes: 23252
#include <bits/stdc++.h>
typedef long long ll;
using namespace std;
using Graph = vector<vector<int>>;

int main() {
  
  string s;
  cin >> s;
  if (s=="a" || s=="b" || s=="c" || s=="d" || s=="e" || s=="f" || s=="g" || s=="h" || s=="i" || s=="j" || s=="k" || s=="l" || s=="m" || s=="n" || s=="o" || s=="p" || s=="q" || s=="r" || s=="s" || s=="t" || s=="u" || s=="v" || s=="w" || s=="x" || s=="y" || s=="z"){
    cout << "a" << endl;
  } else {
    cout << "A" << endl;
  }
  return 0;
}

Measured memory_bytes: 3624
s = input()
t = input()

min = len(t)
for s_index in range(len(s) - len(t) + 1):
    different_chars = 0
    for t_index in range(len(t)):
        if s[s_index + t_index] != t[t_index]:
            different_chars += 1
    if min > different_chars:
        min = different_chars
print(min)

Measured memory_bytes: 8852
using System;
using System.Linq;
using System.Collections.Generic;
using System.IO;
using System.Diagnostics;
using System.Text;

public class Program{
    public static void Main(){
        var watch = new Stopwatch();
        watch.Start();
        var isTest = false;
        var stream = new StreamWriter(Console.OpenStandardOutput()){AutoFlush = false};
        Console.SetOut(stream);
        TextReader reader;
        string filename="";

        if(filename.Length!=0){
            reader = new StreamReader(filename);
        }else{
            reader = Console.In;
        }

        var n = int.Parse(reader.ReadLine());
        var lis = new int[n];
        for(var i=0; i<n; i++){
            lis[i] = int.Parse(reader.ReadLine())-1;
        }

        var passed = new bool[n];
        var now = 0;
        var cnt = 0;
        while(now!=1){
            if(passed[now]){
                cnt = -1;
                break;
            }
            passed[now] = true;
            now = lis[now];
            cnt++;
        }
        Console.WriteLine(cnt);

        watch.Stop();
        if(isTest){
            Console.WriteLine($"実行時間{watch.ElapsedMilliseconds}ミリ秒");
        }
        Console.Out.Flush();
    }
}


Measured memory_bytes: 15328
#include<bits/stdc++.h>
using namespace std;
main() {
    long long N,a,b,c;
    double low;
    scanf("%lld",&N);
    for(a=1;a<=3500;a++) {
        for(b=1;b<=3500;b++) {
            low = (double)(a*b*4 - N*(a+b)) / (N*a*b);
//            printf("low = %lf\n",low);
            if(low==0) continue;
            c = (long long)((double)1/low);
            if(c>0 && 4*a*b*c == N*(a*b + a*c + b*c)) {
                printf("%lld %lld %lld",a,b,c);
                return 0;
            }
        }
    }
}


Measured memory_bytes: 256
package main

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

func getScanner(fp *os.File) *bufio.Scanner {
	scanner := bufio.NewScanner(fp)
	scanner.Split(bufio.ScanWords)
	scanner.Buffer(make([]byte, 500001), 500000)
	return scanner
}

func getNextString(scanner *bufio.Scanner) string {
	scanner.Scan()
	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
	if len(os.Args) > 1 {
		fp, _ = os.Open(os.Args[1])
	}

	scanner := getScanner(fp)
	writer := bufio.NewWriter(os.Stdout)

	var sol Solver
	sol.a = getNextInt(scanner)
	sol.b = getNextInt(scanner)
	sol.c = getNextInt(scanner)

	fmt.Fprintln(writer, sol.solve())
	writer.Flush()
}

// Solver...
type Solver struct {
	a, b, c int
}

func (sol *Solver) solve() string {
	if sol.a > sol.c {
		return "No"
	}
	if sol.b < sol.c {
		return "No"
	}

	return "Yes"
}


Measured memory_bytes: 640
#include <stdio.h>
#include <string.h>
#include <algorithm>
#include <iostream>
#include <math.h>
#include <assert.h>
#include <vector>

using namespace std;
typedef long long ll;
typedef unsigned int uint;
typedef unsigned long long ull;
static const double EPS = 1e-9;
static const double PI = acos(-1.0);

#define REP(i, n) for (int i = 0; i < (int)(n); i++)
#define FOR(i, s, n) for (int i = (s); i < (int)(n); i++)
#define FOREQ(i, s, n) for (int i = (s); i <= (int)(n); i++)
#define FORIT(it, c) for (__typeof((c).begin())it = (c).begin(); it != (c).end(); it++)
#define MEMSET(v, h) memset((v), h, sizeof(v))

int n, m;
ll hp[110];
ll mp[2][100010];
char str1[1000];
char str2[1000];
pair<ll, ll> magic[2][110];

int main() {
  while (scanf("%d", &n), n) {
    REP(i, n) { scanf("%lld", &hp[i]); }
    scanf("%d", &m);
    int single = 0;
    int all = 0;
    REP(i, m) {
      int mpower, damage;
      scanf("%s %d %s %d", str1, &mpower, str2, &damage);
      if (damage == 0) { continue; }
      if (str2[0] == 'S') {
        magic[0][single++] = make_pair(mpower, damage);
      } else {
        magic[1][all++] = make_pair(mpower, damage);
      }
    }
    int cnt[2] = { single, all };
    MEMSET(mp, 0x0f);
    REP(iter, 2) {
      mp[iter][0] = 0;
      REP(i, 100001) {
        REP(j, cnt[iter]) {
          ll ndamage = i + magic[iter][j].second;
          ll nmpower = mp[iter][i] + magic[iter][j].first;
          ndamage = min(ndamage, 100000LL);
          mp[iter][ndamage] = min(mp[iter][ndamage], nmpower);
        }
      }
      for (int i = 100000; i > 0; i--) {
        if (mp[iter][i] > mp[iter][i + 1]) { mp[iter][i] = mp[iter][i + 1]; }
      }
    }
    ll ans = 1LL << 60;
    REP(a, 100001) {
      ll lsum = mp[1][a];
      REP(e, n) {
        if (hp[e] - a <= 0) { continue; }
        if (mp[0][hp[e] - a] > 10000000000LL) { goto next; }
        lsum += mp[0][hp[e] - a];
      }
      ans = min(ans, lsum);
next:;
    }
    printf("%lld\n", ans);
  }
}

Measured memory_bytes: 2468
#include<bits/stdc++.h>
#define ll long long
#define pii pair<int,int>
using namespace std;

const int N = 1e5+10;
int a[N];
int main(){
    int n,r;
    cin >> n;
    for(int i=1;i<=n;++i){
        cin >> a[i];
    }
    int ans = 1e9+1;
    for(int i=1;i<=100;++i){
        int cs = 0;
        for(int j=1;j<=n;++j){
            cs += (i-a[j]) * (i-a[j]);
        }
        ans = min(ans,cs);
    }
    cout << ans << '\n';
    return 0;
}

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

#define rep(i,n) for(i = 0;i < n;++i)
#define all(v) v.begin(), v.end()
using ll = long long;

int main()
{
    ll i,j;
    string s;
    cin >> s;
    ll n = s.size();
    vector<ll> spare(n);
    vector<ll> vs(n);
    vector<ll> mp(2019,0);
    for(i = 0;i < n;++i){
        vs.at(i) = s.at(i) -'0';
    }
    spare.at(n-1) = vs.at(n-1);
    ++mp.at(spare.at(n-1));
    ++mp.at(0);
    vector<ll> spare10(n,1);
    spare10.at(n-1) = 1;
    for(i = 1;i < n;++i){
        spare10.at(n-1-i) = spare10.at(n-i)*10%2019;
        spare.at(n-1-i) = (vs.at(n-1-i)*spare10.at(n-1-i) + spare.at(n-i))%2019;
        ++mp.at(spare.at(n-1-i));
    }
    ll ans = 0;
    for(auto x:mp){
        ans += x*(x-1)/2;
    }
    cout << ans << endl;
    return 0;
}


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

using namespace std;

#define lli long long int

signed main(){

	lli n,m,d;
	cin>>n>>m>>d;

	double ave = (double)(n-d)/(double)(n*n);
	if(d!=0)ave *= 2;
	printf("%5.10f\n",ave*(m-1));

	return 0;
}

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

#define rep(i, n) for (int i = 0; i < n; ++i)
#define all(x) (x).begin(),(x).end()
#define endl "\n"

using ll = long long;
using P = pair<int,int>;
using mp =  map<string,int>;

const int MOD = 1e9 + 7;
const int INF = 1001001001;


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

    ll q, h, s, d, n;
    cin >> q >> h >> s >> d >> n;

    ll ans = 0;
    if(d <= 4*h && d <= 2*s && d <= 8*q){
        ans += (n / 2) * d;
        n %= 2;
    }
    if(8*q <= 4*h && 8*q <= 2*s){
        ans += 4 * n * q;
    }else if(4*h <= 8*q && 4*h <= 2*s){
        ans += 2 * n * h;
    }else if(2*s <= 8*q && 2*s <= 4*h){
        ans += n * s;
    }

    cout << ans << endl;


    return 0;
}

Measured memory_bytes: 256
package main

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

var sc = bufio.NewScanner(os.Stdin)

const inf = 1 << 60

func ri() (n int) {
	sc.Scan()
	for _, v := range sc.Bytes() {
		n = n*10 + int(v-48)
	}
	return
}

func main() {
	sc.Split(bufio.ScanWords)
	n, k := ri(), ri()
	bk := make([]int, 1e5+1)
	var a, b int
	for i := 0; i < n; i++ {
		a, b = ri(), ri()
		bk[a] += b
	}
	acc := 0
	for i, v := range bk {
		acc += v
		if acc >= k {
			fmt.Println(i)
			return
		}
	}
}


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

#define int         long long
#define pb          push_back
#define pii         pair<int,int>
#define vi          vector<int>
#define vii         vector<pii>
#define mi          map<int,int>
#define mii         map<pii,int>
#define all(a)      (a).begin(),(a).end()
#define sz(x)       (int)x.size()
#define endl        "\n"
#define repp(i,a,b) for(int i=a;i<b;i++)
#define rep(i,a,b) 	for(int i=a;i<=b;i++)
#define IOS         ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);

const int N=1e5 + 5;
const int M=1e9 + 7;

int32_t main()
{
	IOS;
	//memset(dp,-1,sizeof(dp));	
	int T;
	T=1;
	while(T--)
	{
		int k,x;
		cin >> k >> x;
		int tot = 500*k;
		if(tot>=x)
		{
			cout << "Yes" << endl;
		}
		else
		{
			cout << "No" << endl;
		}
	}
}


Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <cassert>
#include <climits>
#include <algorithm>
#include <string>
#include <sstream>
#include <complex>
#include <vector>
#include <list>
#include <queue>
#include <deque>
#include <stack>
#include <map>
#include <set>
#include <fstream>

using namespace std;
#define TOSTRING(x) #x
#define SZ(x) (int)(x).size()
#define REP(i,n) for(int i=0;i<(n);i++)
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define REPR(i,n) for(int i=(n)-1;i>=0;i--)
#define ALL(s) (s).begin(), (s).end()
#define so(V) sort(ALL(V))
#define rev(V) reverse(ALL(V))
#define uni(v) v.erase( unique(ALL(v)) , v.end());
#define PAU system("pause")

typedef long long unsigned int llu;
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<bool> vb;
typedef vector<vi> vvi;
typedef vector<vll> vvll;
typedef vector<vb> vvb;
const double EPS = 1e-9;
const int MOD = 1e9 + 7;
const int INF = (1 << 28);
const double PI = acos(-1);

int main() {
	cin.tie(0);
	ios::sync_with_stdio(false);
	int N;
	cin >> N;
	vi A(N);
	ll ans = 0;
	REP(i, N) {
		int a;
		cin >> a;
		if (a == 0) {
			A[i] = 0;
			continue;
		}
		if (a % 2 == 0) {
			ans += (a - 2) / 2;
			A[i] = 2;
		}
		else {
			ans += a / 2;
			A[i] = 1;
		}
	}
	REP(i, N) {
		switch (A[i])
		{
			case 0:
				break;
			case 1:
				if (i + 1 < N && A[i + 1] != 0) {
					A[i + 1]--;
					ans++;
				}
				break;
			case 2:
				ans++;
				break;
		}
	}
	cout << ans << endl;
	PAU;
	return 0;
}


Measured memory_bytes: 888
#include<iostream>
#include<sstream>
#include<fstream>
#include<cstdio>
#include<vector>
#include<list>
#include<stack>
#include<queue>
#include<deque>
#include<string>
#include<map>
#include<set>
#include<algorithm>
#include<cmath>
#include<cstdlib>
using namespace std;

int main(){
	map< string, vector<int> > table;
	string word;
	int n;
	while(cin>>word>>n){
		table[word].push_back(n);
	}
	for(map<string, vector<int> >::iterator it = table.begin();it!=table.end();++it){
		cout<<it->first<<endl;
		vector<int> tmp = it->second;
		sort(tmp.begin(),tmp.end());
		int x = 0;
		for(;x<tmp.size()-1;++x){
			cout<<tmp[x]<<" ";
		}
		cout<<tmp[x]<<endl;
	
	}
	return 0;		
}

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

class Dice{

public:
	Dice(){
		number     = new int[6];
		checkTable = new int[101];
		for(int i=0; i<101; i++){checkTable[i]=-1;}//init
	};

	~Dice(){
		delete[] number;
		delete[] checkTable;
	};
	
	void setLabel(int index, int num){
		number[index]   = num;
		checkTable[num] = index;
	};

	void roll(char ch){
		switch(ch){
		case 'E':
			setNumber(number[3],number[1],number[0],number[5],number[4],number[2]);
			break;
		case 'W':
			setNumber(number[2],number[1],number[5],number[0],number[4],number[3]);
			break;
		case 'N':
			setNumber(number[1],number[5],number[2],number[3],number[0],number[4]);
			break;
		case 'S':
			setNumber(number[4],number[0],number[2],number[3],number[5],number[1]);
			break;
		case 'R':
			setNumber(number[0],number[3],number[1],number[4],number[2],number[5]);
			break;
		}
	};

	bool isSameDice(int given[]){
		for(int i=0; i<6; ++i){
			if(checkTable[given[i]] == -1){return false;}
		}

		// need to include '\n' that occupies 1 unit.
		//char order[25] = "NNNNWNNNWNNNENNNENNNWNNN";
		char order[30] = "RRRRNRRRRNRRRRERRRRNRRRRNRRRR";
		for(int i=0; i<30; ++i){
			roll(order[i]);
			for(int j=0; j<6; ++j){
				if(number[j]!=given[j]){break;}
				if(j==5){return true;}
			}
		}
		return false;
	};

	int* get_number(){
		return number;
	}

private:
	void setNumber(int n0,int n1,int n2,int n3,int n4,int n5){
		number[0] = n0;	
		number[1] = n1;	
		number[2] = n2;	
		number[3] = n3;	
		number[4] = n4;	
		number[5] = n5;	
	};

private:
	int* number;
	int* checkTable;

};

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

	Dice dice[n];
	int label;
	
	for(int j=0; j<n; ++j){
		for(int i=0; i<6; ++i){
			cin >> label;
			dice[j].setLabel(i,label);
		}
	}

	for(int i=1; i<n; ++i){
		for(int j=0; j<i; ++j){
			if(dice[i].isSameDice(dice[j].get_number())){
				cout << "No" << endl;
				return 0;
			}
		}
	}

	cout << "Yes" << endl;
	return 0;

}



Measured memory_bytes: 3132
#include <stdio.h>

int main()
{
	double w,h,x,y;
	scanf("%lf %lf %lf %lf",&w,&h,&x,&y);
	double x1 = w / 2.0;
	double y1 = h / 2.0;
	
	int f = 0;
	if(x == x1 && y == y1) f = 1;
	printf("%lf %d",w * h / 2.0,f);
	return 0;
}

Measured memory_bytes: 128
#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
typedef long long ll;

using namespace std;

int main()
{
	int a,b,n;
	int ans=0;
	
	cin>>n>>a>>b;
	if(a*n>b){
		ans=b;
	}else{
		ans=a*n;
	}
	cout<<ans<<endl;
	return 0;
}

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

ll X, A, B;

int main(){
  cin >> X >> A >> B;
  
  if(A >= B) cout << "delicious" << endl;
  else if(B - A <= X) cout << "safe" << endl;
  else cout << "dangerous" << endl;
}

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

using namespace std;

int main() {
	string s;
	cin >> s;

	vector<int> a(26);

	for (int i = 0; i < s.size(); i++) {
		a[s[i] - 'a'] += 1;
	}

	for (int i = 0; i < 26; i++) {
		if (a[i] == 0) {
			cout << char(i + 'a');
			return 0;
		}
	}
	cout << "None";
	return 0;
}

Measured memory_bytes: 512
#include <iostream>
#include <string>
#include <vector>
#include <deque>
#include <queue>
#include <algorithm>
#include <set>
#include <map>
#include <bitset>
#include <cmath>
#include <functional>

using namespace std;

#define REP(i,n) for(ll (i) = (0);(i) < (n);++i)
#define REV(i,n) for(ll (i) = (n) - 1;(i) >= 0;--i)
#define PB push_back
#define EB emplace_back
#define MP make_pair
#define FI first
#define SE second
#define SHOW1d(v,n) {REP(WW,n)cerr << v[WW] << ' ';cerr << endl << endl;}
#define SHOW2d(v,WW,HH) {REP(W_,WW){REP(H_,HH)cerr << v[W_][H_] << ' ';cerr << endl;}cerr << endl;}
#define ALL(v) v.begin(),v.end()
#define Decimal fixed<<setprecision(20)
#define INF 1000000000
#define LLINF 1000000000000000000LL
#define MOD 998244353

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

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

	string str;cin >> str;
	if(str.size() % 2){cout << "No" << endl;return 0;}
	REP(i, str.size()){
		if(i % 2 && str[i] != 'i'){cout << "No" << endl;return 0;}
		if(i % 2 == 0 && str[i] != 'h'){cout << "No" << endl;return 0;}
	}
	cout << "Yes" << endl;

	return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<cstdio>
#include<string>
#include<cstring>
#include<algorithm>
#define IN1
#define OUT1
using namespace std;
template<typename T>void scan(T &x)
{
    char ch;
    bool f=0;
    x=0;
    ch=getchar();
    while(!isdigit(ch)&&ch!='-')
        ch=getchar();
    if(ch=='-') f=1,ch=getchar();
    while(isdigit(ch)) x=x*10+ch-'0',ch=getchar();
    if(f==1) x=-x;
}
int n;
int a[15];
long long ans;
int main()
{
    #ifdef IN
    	freopen("B.in","r",stdin);
    	#ifdef OUT
    	    freopen("B.out","w",stdout);
    	#endif
    #endif
    scan(n);
    for(register int i=1;i<=n;i++)
        scan(a[i]);
    sort(a+1,a+n+1);
    for(register int i=1;i<n;i++)
        ans+=a[i];
    if(a[n]%2==0) ans+=a[n]/2,printf("%lld\n",ans);
    else ans+=a[n]/2,printf("%lld.5\n",ans);
    return 0;
}

Measured memory_bytes: 256
import java.util.Scanner;

public class Main{

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner kb = new Scanner(System.in);
		String s = kb.next();
		String t = kb.next();
		int count = 0;
		for (int i = 0; i < s.length(); i++) {
			if (s.charAt(i) != t.charAt(i))
				count += 1;
		}

		System.out.println(count);
		kb.close();
	}

}


Measured memory_bytes: 32160
#include <cmath>
#include <string>
#include <vector>
#include <iostream>
#include <algorithm>
#include <functional>
using namespace std;
int main() {
	cin.tie(0);
	ios_base::sync_with_stdio(false);
	vector<vector<int> > A(3, vector<int>(3));
	for (int i = 0; i < 3; ++i) {
		for (int j = 0; j < 3; ++j) {
			cin >> A[i][j];
		}
	}
	vector<vector<bool> > ok(3, vector<bool>(3, false));
	int N;
	cin >> N;
	for (int i = 0; i < N; ++i) {
		int x;
		cin >> x;
		for (int j = 0; j < 3; ++j) {
			for (int k = 0; k < 3; ++k) {
				if (A[j][k] == x) {
					ok[j][k] = true;
				}
			}
		}
	}
	bool ans = false;
	for (int i = 0; i < 3; ++i) {
		bool ok1 = true, ok2 = true;
		for (int j = 0; j < 3; ++j) {
			if (!ok[i][j]) ok1 = false;
			if (!ok[j][i]) ok2 = false;
		}
		if (ok1 || ok2) ans = true;
	}
	if (ok[0][0] && ok[1][1] && ok[2][2]) ans = true;
	if (ok[0][2] && ok[1][1] && ok[2][0]) ans = true;
	cout << (ans ? "Yes" : "No") << endl;
	return 0;
}

Measured memory_bytes: 896
import itertools


a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
k = int(input())

points = list()
points.append(a)
points.append(b)
points.append(c)
points.append(d)
points.append(e)

def is_com_all(points):
    for idx_1, idx_2 in itertools.combinations(range(5), 2):
        if points[idx_2] - points[idx_1] > k:
            return False
    
    return True

if is_com_all(points):
    print('Yay!')
else:
    print(':(')

Measured memory_bytes: 3064
# coding: utf-8
import sys

sr = lambda: sys.stdin.readline().rstrip()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))

se = {'A', 'C', 'G', 'T'}
S = sr()
cand = []
answer = []
for s in S:
    if s in se:
        cand.append(s)
    else:
        if len(cand) > len(answer):
            answer = cand
        cand = []

if len(cand) > len(answer):
    answer = cand
print(len(answer))


Measured memory_bytes: 3064
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const double EPS = 1e-9;
typedef vector<int> vint;
typedef pair<int, int> pint;
#define rep(i, n) REP(i, 0, n)
#define ALL(v) v.begin(), v.end()
#define MSG(a) cout << #a << " " << a << endl;
#define REP(i, x, n) for(int i = x; i < n; i++)
template<class T, class C> void chmax(T& a, C b){ a>b?:a=b; }
template<class T, class C> void chmin(T& a, C b){ a<b?:a=b; }
int main(int argc, char* argv[]) {
    int x,y;
    cin >> x >> y;
    cout << x+y/2 << endl;
    return 0;
}


Measured memory_bytes: 256
#include "iostream"
#include "climits"
#include "list"
#include "queue"
#include "stack"
#include "set"
#include "functional"
#include "algorithm"
#include "math.h"
#include "utility"
#include "string"
#include "map"
#include "unordered_map"
#include "iomanip"
#include "random"

using namespace std;
const long long int MOD = 1000000007;

long long int power(long long int x, long long int n, long long int M) {
	long long int tmp = 1;

	if (n > 0) {
		tmp = power(x, n / 2, M);
		if (n % 2 == 0) tmp = (tmp*tmp) % M;
		else tmp = (((tmp*tmp) % M)*x) % M;
	}
	return tmp;
}

long long int N, M, K, Q, W, H;
long long int ans;


int main() {
	ios::sync_with_stdio(false);
	string a, b, c;
	cin >> a >> b;
	if (a.size() == b.size()) {
		for (int i = 0; i < a.size(); i++) {
			cout << a[i] << b[i];
		}
		cout << endl;
	}
	else {
		for (int i = 0; i < a.size(); i++) {
			if (i == a.size() - 1)cout << a[i] << endl;
			else cout << a[i] << b[i];
		}
	}
	return 0;
}

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

int main() {
  cin.tie(nullptr);
  ios::sync_with_stdio(false);
  int h, n;
  cin >> h >> n;
  int s = 0;
  while (n--) {
    int a;
    cin >> a;
    s += a;
  }
  cout << (s >= h ? "Yes" : "No") << '\n';
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
ll mod = 1e9+7;
int n;
string s;
ll ans;
ll cnt[30] = {};
int main() {
  cin >> n >> s;
  for (int i = 0; i < n; i++) {
    cnt[s[i]-'a']++;
  }
  ans = 1;
  for (int i = 0; i < 26; i++) {
    ans *= (cnt[i]+1);
    ans %= mod;
  }
  cout << (ans+mod-1) % mod << endl;
}

/*　【提出前に確認すること】
・コンパイルできるか
・テストケース試したか
・オーバーフローあるか
*/

Measured memory_bytes: 512
/*
Created on Thu Aug 27 21:32:39 2020

@author: roastedcoder

*/
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long int ull;
const int mod = 1e9+7;
const int INF = INT_MAX;
#define endl "\n"
#define append push_back
#define roastedcoder ios_base::sync_with_stdio(false); cin.tie(NULL);
//__________________________________________________________________



int main() {
	roastedcoder
	int n, x, t, res; cin>>n>>x>>t;
	res = ceil(1.0*n/x);
	cout<<res*t<<endl;
}

//__________________________________________________________________
/*
Sample Input:
20 12 6

Sample Output:
12

*/

Measured memory_bytes: 3624
/*
 * a.cpp
 *
 *  Created on: 2019/06/08
 *      Author: MEIP-users
 */




#include <bits/stdc++.h>
#include <iostream>
#include <cstring>
#include <cstdlib>
#include <cstdio>
#include <cctype>
#include <algorithm>
#include <vector>
#include <string>
#include <math.h>
#include <iomanip>
#include <limits>
#include <list>
#include <locale>
#include <queue>
#include <tuple>
#include <map>
#include <fstream>

using namespace std;


#define MOD (long long int)(1e9+7)
#define ll long long int
#define rep(i,n) for(int i=0; i<(int)(n); i++)
#define reps(i,n) for(int i=1; i<=(int)(n); i++)
#define REP(i,n) for(int i=n-1; i>=0; i--)
#define REPS(i,n) for(int i=n; i>0; i--)
#define INF (int)(1e9+10)
#define LINF (long long int)(112345678901234567)
#define chmax(a, b) a = (((a)<(b)) ? (b) : (a))
#define chmin(a, b) a = (((a)>(b)) ? (b) : (a))




int main() {
	int a,b;
	cin >> a >> b;;

	cout << a*b << endl;
	return 0;
}


Measured memory_bytes: 3624
def main():
    n, p = list(map(int, input().split()))
    def factorization(num):
        result = []
        count = 0
        temp = num
        for i in range(2, int(num ** 0.5) + 1):
            if temp % i == 0:
                count = 0
                while temp % i == 0:
                    count += 1
                    temp /= i
                result.append([i, count])
        if temp != 1:
            result.append([int(temp), 1])
        if result == []:
            result.append([num, 1])
        return result
    ans = 1
    for (fac, cnt) in factorization(p):
        ans *= pow(fac, cnt // n)
    print(ans)

if __name__ == '__main__':
    main()


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

void bubble_sort(int n,string cards[]){
  for(int i=0;i<n;i++)
    for(int j=n-1;j>i;j--)
      if(cards[j][1]<cards[j-1][1]){
	string tmp=cards[j-1];
	cards[j-1]=cards[j];
	cards[j]=tmp;
      }
}

void select_sort(int n,string cards[]){
  for(int i=0;i<n;i++){
    int min=i;
    for(int j=i+1;j<n;j++)
      if(cards[j][1]<cards[min][1]) min=j; 
    string tmp=cards[i];
    cards[i]=cards[min];
    cards[min]=tmp;
  }
}

bool isStable(int n,string a[],string b[]){
  for(int i=0;i<n;i++)
    if(a[i]!=b[i]) return false;
  return true;
}

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

  string cards[n],copy[n];
  for(int i=0;i<n;i++){
    cin>>cards[i];
    copy[i]=cards[i];
  }

  bubble_sort(n,cards);
  for(int i=0;i<n-1;i++) cout<<cards[i]<<" ";
  cout<<cards[n-1]<<endl;
  cout<<"Stable"<<endl;

  select_sort(n,copy);
  for(int i=0;i<n-1;i++) cout<<copy[i]<<" ";
  cout<<copy[n-1]<<endl;
  if(isStable(n,cards,copy)) cout<<"Stable"<<endl;
  else cout<<"Not stable"<<endl;
}


Measured memory_bytes: 3148
let n = Scanf.scanf " %d" (+) 0
let ab_s = Array.init n @@ fun _ -> Scanf.scanf " %d %d" @@ fun a b -> a, b
let f a b = if a mod b = 0 then 0 else if a < b then b - a else (a + b - 1) / b * b - a
let ans = ref 0
let _ = for i = n - 1 downto 0 do ans := !ans + f (fst ab_s.(i) + !ans) (snd ab_s.(i)) done; Printf.printf "%d\n" !ans

Measured memory_bytes: 6784
#include<stdio.h>
#define M 100000

int parent(int i){
  return i/2;
}

int left(int i){
  return 2*i;
}

int right(int i){
  return 2*i+1;
}

int main(){
  
  int n,i,a[M+1];

  scanf("%d",&n);
  for(i=1;i<=n;i++){
    scanf("%d",&a[i]);
  }

  for(i=1;i<=n;i++){
    printf("node %d: key = %d, ",i,a[i]);
    if(parent(i)>=1) printf("parent key = %d, ",a[parent(i)]);
    if(left(i)<=n) printf("left key = %d, ",a[left(i)]);
    if(right(i)<=n) printf("right key = %d, ",a[right(i)]);
    printf("\n");
  }

  return 0;
}
    



Measured memory_bytes: 2056
#include <iostream>
#include <algorithm>
#include <cmath>
#include <cstring>
#include <stack>
#include <map>
#include <queue>
#include <math.h>

using namespace std;

int main()
{
    ios_base::sync_with_stdio(false);
    int n;
    cin>>n;
    long long x, y;
    cin>>x>>y;

    long long a[n];
    for(int i=0;i<n;i++)
    {
        cin>>a[i];
    }
    sort(a, a+n);
    reverse(a, a+n);

    long long s=0;
    long long low=0, high=(a[0]+y-1)/y;
    long long mid;
//    int left[n];
    long long mini = (1<<30);
//    memset(left, 0, sizeof(left));
    long long br=0;

//        cout<<low<<" "<<mid<<" "<<high<<endl;
    while(low<=high)
    {
        mid = (low+high)/2;
//        cout<<low<<" "<<mid<<" "<<high<<endl;
//        bool f=false;
        br =0;

        for(int i=0; i<n; i++)
        {
            int pomm = a[i] - (mid*y);
            
            if(pomm>0)
            br+=(pomm+((x-y)-1))/(x-y);
        }

        if(br<=mid)
        {
            mini = min(mini, mid);
            high = mid-1;
        }
        else
        {
//            mini = min(mini, low);
            low = mid+1;
        }
    }

    cout<<mini<<endl;
    return 0;
}


Measured memory_bytes: 1152
#include <bits/stdc++.h>
using namespace std;
long long f(long long n, long long x) {
  if (n >= 0) {
    return n / x + 1;
  } else {
    return 0;
  }
}

int main() {
  long long a, b, x;
  cin >> a >> b >> x;
  cout << f(b, x) - f(a - 1, x) << endl;
}


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

int main() {
    string s, t;
    cin >> s >> t;
    int res = 0;
    rep(i, s.size()){
        if (s[i] != t[i]) res++;
    }
    cout << res << endl;
}

Measured memory_bytes: 3860
#pragma GCC optimize("Ofast")
#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
//#define int long long
template<typename T> inline bool chmax(T& a,T b) { if (a < b) { a = b; return true; } return false; }
template<typename T> inline bool chmin(T& a,T b) { if (a > b) { a = b; return true; } return false; }

int main() {
    vector<int> a(3);
    for (int i = 0; i < 3; i++) cin >> a[i];
    
    sort(a.rbegin(), a.rend());
    if (a[0] == 7  && a[1] == 5 && a[2] == 5) cout << "YES" << endl;
    else cout << "NO" << endl;
}

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

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

        int N = sc.nextInt();

        int maxCake = N / 4;
        int maxDonut = N / 7;

        boolean can = false;
        for (int i_cake = 0; i_cake <= maxCake; i_cake++) {
            for (int i_donut = 0; i_donut <= maxDonut; i_donut++) {
                if (i_cake * 4 + i_donut * 7 == N) {
                    can = true;
                    break;
                }
            }
        }

        if (can) {
            System.out.println("Yes");
        } else {
            System.out.println("No");
        }
    }
}

Measured memory_bytes: 23892
#include<iostream>
using namespace std;
int main(){
  string b;
  int a=700;
  cin >> b;
  if(b[0]=='o')a=a+100;
  if(b[1]=='o')a=a+100;
  if(b[2]=='o')a=a+100;
  cout << a << endl;
}

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

int main(){
	string s;
	cin >> s;
	int n = s.length();
	int ans = 0;
	for(int i=0; i<n; i++){
		if(i < (n+1)/2 && s[i]=='p') ans--;
		if(i >= (n+1)/2 && s[i]=='g') ans++;
	}
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 512