akhauriyash/Code-Regression huggingface dataset:
import sys

sys.setrecursionlimit(10 ** 6)
input = sys.stdin.readline
from math import floor, sqrt, factorial, hypot, log  # log2ないｙｐ
from heapq import heappop, heappush, heappushpop
from collections import Counter, defaultdict, deque
from itertools import accumulate, permutations, combinations, product, combinations_with_replacement
from bisect import bisect_left, bisect_right
from copy import deepcopy
from fractions import gcd
from random import randint


def ceil(a, b): return (a + b - 1) // b


inf = float('inf')
mod = 10 ** 9 + 7


def pprint(*A):
    for a in A:     print(*a, sep='\n')


def INT_(n): return int(n) - 1


def MI(): return map(int, input().split())


def MF(): return map(float, input().split())


def MI_(): return map(INT_, input().split())


def LI(): return list(MI())


def LI_(): return [int(x) - 1 for x in input().split()]


def LF(): return list(MF())


def LIN(n: int): return [I() for _ in range(n)]


def LLIN(n: int): return [LI() for _ in range(n)]


def LLIN_(n: int): return [LI_() for _ in range(n)]


def LLI(): return [list(map(int, l.split())) for l in input()]


def I(): return int(input())


def F(): return float(input())


def ST(): return input().replace('\n', '')


def main():
    D = I()
    c = LI()
    s = LLIN(D)
    lst = [0] * 26
    for i in range(D):
        l = s[i]
        for j in range(26):
            lst[j] += c[j]
            l[j] += lst[j]
        ind = l.index(max(l))
        print(ind + 1)
        lst[ind] = 0




if __name__ == '__main__':
    main()

Measured memory_bytes: 78692
#include<bits/stdc++.h>
using namespace std;
using Int = long long;
template<typename T1,typename T2> inline void chmin(T1 &a,T2 b){if(a>b) a=b;}
template<typename T1,typename T2> inline void chmax(T1 &a,T2 b){if(a<b) a=b;}
//BEGIN CUT HERE
int lcs(string s,string t){
  int n=s.size(),m=t.size();
  s+='$';t+='%';
  vector<vector<int> > dp(n+2,vector<int>(m+2,-(n+m)));
  dp[0][0]=0;
  for(int i=0;i<=n;i++){
    for(int j=0;j<=m;j++){
      chmax(dp[i+1][j],dp[i][j]);
      chmax(dp[i][j+1],dp[i][j]);
      chmax(dp[i+1][j+1],dp[i][j]+(s[i]==t[j]));
    }
  }
  return dp[n][m];
}
//END CUT HERE

//INSERT ABOVE HERE
signed ALDS1_10_C(){
  cin.tie(0);
  ios::sync_with_stdio(0);
  int q;
  cin>>q;
  while(q--){
    string s,t;
    cin>>s>>t;
    cout<<lcs(s,t)<<"\n";
  }
  cout<<flush;
  return 0;
}
/*
  verified on 2019/04/07
  http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=ALDS1_10_C&lang=jp
*/

signed main(){
  ALDS1_10_C();
  return 0;
}



Measured memory_bytes: 6812
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.StringTokenizer;

public class Main {
    public static void main(String[] args) throws Exception {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        StringTokenizer st;
        PrintWriter pw = new PrintWriter(System.out);
        
        try {
            long a = Integer.parseInt(br.readLine());
            pw.println(a + a*a + a*a*a);
        }
        finally {
            pw.flush();
            pw.close();
        }
    }
}


Measured memory_bytes: 32792
### main

while true
  n = gets.strip.to_i
  break if n == 0

  n.times.each do
    pm, pe, pj = gets.strip.split(' ').map{|s| s.to_i}
    ave_me = (pm + pe) / 2.0
    ave_3 = (pm + pe + pj) / 3.0

    if (pm == 100 || pe == 100 || pj == 100) ||
        ave_me >= 90 || ave_3 >= 80
      puts 'A'
    elsif ave_3 >= 70 || (ave_3 >= 50 && (pm >= 80 || pe >= 80))
      puts 'B'
    else
      puts 'C'
    end
  end
end

Measured memory_bytes: 6144
# -*- coding: utf-8 -*-
def seach (place, ary, dist, top, last)
  half = (last+top)/2
  if place < ary[half]
    seach(place, ary, dist, top, half-1)
  elsif ary[half+1] < place
    seach(place, ary, dist, half+2, last)
  else 
    preDist = place - ary[half]
    folDist = ary[half+1] - place
    if preDist < folDist
      return preDist
    end
    return folDist
  end
end

d = gets.chomp.to_i #??¨???
while d != 0  
  n = gets.chomp.to_i #????????°
  m = gets.chomp.to_i #??¨?????°

  dAry = [] #????????????
  dAry[0] = 0
  for i in 1..n-1
    dAry[i] = gets.chomp.to_i
  end
  dAry[dAry.length] = d
  dAry = dAry.sort

  sum = 0
  kAry = [] #?????????
  for i in 0..m-1
    j = gets.chomp.to_i
    sum += seach(j, dAry, d, 0, dAry.length-1)
  end
  
  puts sum

  d = gets.chomp.to_i #??¨???
end

Measured memory_bytes: 11108
#include<bits/stdc++.h>
#define fo(i,l,r) for(int i=l;i<=r;i++)
#define of(i,l,r) for(int i=l;i>=r;i--)
#define fe(i,u) for(int i=head[u];i;i=e[i].next)
#define el putchar('\n')
#define ta putchar('	')
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
inline void open(const char *s)
{
	#ifndef ONLINE_JUDGE
	char str[20];
	sprintf(str,"%s.in",s);
	freopen(str,"r",stdin);
//	sprintf(str,"%s.out",s);
//	freopen(str,"w",stdout);
	#endif
}
inline ll rd()
{
	static ll x,f;
	x=0;f=1;
	char ch=getchar();
	for(;ch<'0'||ch>'9';ch=getchar())if(ch=='-')f=-1;
	for(;ch>='0'&&ch<='9';ch=getchar())x=x*10+ch-'0';
	return f>0?x:-x;
}
const int N=100010;
int n,Q;ll m;
pii a[N];
int fa[N],siz[N];
#define fi first
#define se second

inline int find(int x){return x==fa[x]?x:fa[x]=find(fa[x]);}
inline void merge(int x,int y)
{
	x=find(x);y=find(y);if(x==y)return;
	fa[x]=y;siz[y]+=siz[x];
}

inline void no(){puts("No");exit(0);}

int main()
{
	n=rd();m=rd();Q=rd();
	int tt=0;
	fo(i,1,n)siz[i]=1,fa[i]=i;
	fo(i,1,Q){
		int x=rd(),y=rd(),z=rd();
		++x;++y;
		if(z)a[++tt]=pii(x,y);
		else merge(x,y);
	}
	fo(i,1,tt)if(find(a[i].fi)==find(a[i].se))no();
	int cnt=0;ll mn,mx;mn=mx=0;
	fo(i,1,n)if(find(i)==i){
		++cnt;
		mn+=siz[i]-1;
		mx+=siz[i]-1;
		siz[i]=1;
	}
	else siz[i]=0;
	fo(i,1,tt)merge(a[i].fi,a[i].se);
	fo(i,1,n)if(find(i)==i&&siz[i]==2&&cnt==2)no();
	mn+=cnt-bool(!tt);
	mx+=1ll*cnt*(cnt-1)/2;
	if(m<mn||m>mx)no();
	puts("Yes");
	return 0;
}


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

using namespace std;

#define rep(i,n) for(int i=0;i<(n);i++)
#define repa(i,a,n) for(int i=(a);i<(n);i++)
#define rrep(i,n) for(int i=n;i>=0;i--)
#define rrepa(i,a,n) for(int i=n;i>=(a);i--)
#define all(a) (a).begin(),(a).end()
#define MOD 1000000007
#define cmax(a,b) a=max(a,b)
#define cmin(a,b) a=min(a,b)
#define vc vector

typedef long long ll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef vector<double> vd;
typedef vector<vd> vvd;
typedef pair<int,int> pi;
typedef pair<ll,ll> pl;

int main(){

    int n;
    map<string,int> num; 
    cin>>n;
    
    rep(i,n){
        string s;
        cin>>s;
        num[s]++;
    }

    cout<<"AC x "<<num["AC"]<<"\n";
    cout<<"WA x "<<num["WA"]<<"\n";
    cout<<"TLE x "<<num["TLE"]<<"\n";
    cout<<"RE x "<<num["RE"]<<"\n";

    return 0;

}

Measured memory_bytes: 3632
#include<bits/stdc++.h>
using namespace std;
#define int long long

int n;
int dp[100005][3];
int points[100005][3];

int solve(int index,int last_done){
    if(index==n) return 0;
    if(dp[index][last_done]!=-1) return dp[index][last_done];
    int &ans=dp[index][last_done];
    if(last_done==0){
        ans=max(points[index][1]+solve(index+1,1),points[index][2]+solve(index+1,2));
    }
    else if(last_done==1){
        ans=max(points[index][0]+solve(index+1,0),points[index][2]+solve(index+1,2));
    }
    else{
        ans=max(points[index][0]+solve(index+1,0),points[index][1]+solve(index+1,1));
    }
    return ans;
}

int32_t main(){
    cin>>n;
    memset(dp,-1,sizeof(dp));
    for(int i=0;i<n;i++){
        for(int j=0;j<3;j++){
            cin>>points[i][j];
        }
    }
    int mx=LLONG_MIN;
    for(int i=0;i<3;i++){
        mx=max(mx,solve(0,i));
    }
    cout<<mx<<"\n";
    return 0;
}

Measured memory_bytes: 9600
#include <iostream>
#include <cmath>
#include <string>
#include <utility>
#include <algorithm>
using namespace std;
typedef long long int ll;

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

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

const ll INF = 1LL << 60;

int main() {
  int N, a[110000], b[110000], c[110000];
  ll dp[110000][3];
  cin >> N;
  for (int i = 0; i < N; i++) cin >> a[i] >> b[i] >> c[i];
  for (int i = 0; i <= N; i++)
    for (int j = 0; j < 2; j++)
      dp[i][j] = -1;
  for (int j = 0; j < 2; j++) dp[0][j] = 0;
  for (int i = 0; i < N; i++) {
    chmax(dp[i+1][0], max(dp[i][1], dp[i][2]) + a[i]);
    chmax(dp[i+1][1], max(dp[i][0], dp[i][2]) + b[i]);
    chmax(dp[i+1][2], max(dp[i][0], dp[i][1]) + c[i]);
  }
  cout << max(max(dp[N][0], dp[N][1]), dp[N][2]) << endl;
  return 0;
}


Measured memory_bytes: 4096
#include <iostream>

using namespace std;

int main()
{
    long long n;
    cin>>n;
    long long arr[n];
    for(long long i = 0;i<n;i++)
    {
        cin>>arr[i];
    }
    long long count = 0;
    for(long long i = 0;i<n-1;i++)
    {
        if(arr[i+1]<arr[i])
        {
            count += arr[i]-arr[i+1];
            arr[i+1] += arr[i]-arr[i+1];
        }
    }
    cout<<count<<endl;
    return 0;
}


Measured memory_bytes: 5156
# -*- coding: utf-8 -*-
import sys
from collections import deque
sys.setrecursionlimit(10**9)
INF=10**18
MOD=10**9+7
input=lambda: sys.stdin.readline().rstrip()
YesNo=lambda b: bool([print('Yes')] if b else print('No'))
YESNO=lambda b: bool([print('YES')] if b else print('NO'))
int1=lambda x:int(x)-1

N=int(input())
M=N**2
P=tuple(map(int1,input().split()))
d=[0]*M
for i in range(N):
    for j in range(N):
        d[i*N+j]=min(min(i,N-1-i),min(j,N-1-j))
used=[1]*M
ans=0
que=[]
for p in P:
    ans+=d[p]
    used[p]=0
    que.append(p)
    while que:
        x=que.pop()
        for ddx in (-1,1,-N,N):
            nx=x+ddx
            if 0<=nx<M:
                if used[x]==0 and d[nx]-d[x]>=1:
                    d[nx]-=1
                    que.append(nx)
                elif used[x]==1 and d[nx]-d[x]>=2:
                    d[nx]-=1
                    que.append(nx)
print(ans)



Measured memory_bytes: 170216
#include <stdio.h>  
#include <algorithm>  
#include <assert.h>
#include <bitset>
#include <cmath>  
#include <complex>  
#include <deque>  
#include <functional>  
#include <iostream>  
#include <limits.h>  
#include <map>  
#include <math.h>  
#include <queue>  
#include <set>  
#include <stdlib.h>  
#include <string.h>  
#include <string>  
#include <time.h>  
#include <unordered_map>  
#include <unordered_set>  
#include <vector>  

#pragma warning(disable:4996)  
#pragma comment(linker, "/STACK:336777216")  
using namespace std;

#define mp make_pair  
#define Fi first  
#define Se second  
#define pb(x) push_back(x)  
#define szz(x) ((int)(x).size())  
#define rep(i, n) for(int i=0;i<n;i++)  
#define all(x) (x).begin(), (x).end()  
#define ldb ldouble  

typedef tuple<int, int, int> t3;
typedef long long ll;
typedef unsigned long long ull;
typedef double db;
typedef long double ldb;
typedef pair <int, int> pii;
typedef pair <ll, ll> pll;
typedef pair <ll, int> pli;
typedef pair <db, db> pdd;

int IT_MAX = 1 << 19;
const ll MOD = 1000000007;
const int INF = 0x3f3f3f3f;
const ll LL_INF = 0x3f3f3f3f3f3f3f3f;
const db PI = acos(-1);
const db ERR = 1e-10;

int main() {
	int N, i;
	ll ans = 0;
	scanf("%d", &N);
	ans = -N;
	for (int i = 1; i <= N; i++) {
		ll t;
		scanf("%lld", &t);
		ans += t;
	}
	return !printf("%lld\n", ans);
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <map>
#include <algorithm>
#include <math.h>
typedef long long int ll;
using namespace std;
ll z[51],p[51];
ll solve(ll n,ll x);
int main() {
  ll n,x;
  cin>>n>>x;
  p[0]=1;
  z[0]=1;
  for(int i=1;i<51;i++){
    p[i]=p[i-1]*2+1;
    z[i]=z[i-1]*2+3;
  }
  
  cout<<solve(n,x)<<endl;
}
ll solve(ll n,ll x){
  if(n==0){
    if(x==0)return 0;
    if(x==1)return 1;
  }
  if(x==1)return 0;
  if(x>1&&x<=z[n-1]+1)return solve(n-1,x-1);
  if(x==z[n-1]+2)return p[n-1]+1;
  if(x>z[n-1]+2&&x<=z[n-1]*2+2)return p[n-1]+solve(n-1,x-2-z[n-1])+1;
  if(x==z[n-1]*2+3)return p[n];
}

Measured memory_bytes: 256
def Sumofnum(K,S):
    A = min(K,S) + 1
    a = max(S - 2*K, 0)
    c = 0
    for x in range (a,A):
        B = min(S - x,K) + 1
        b = max(S - x - K,0)
        for y in range (b,B):
            c = c + 1
    print(c)
    
s = list(map(int,input().split()))
K = s[0]
S = s[1]
Sumofnum(K,S)

Measured memory_bytes: 3060
#include <iostream>
#include <iomanip>

int main()
{
	int a, b;
	std::cin >> a >> b;
	int d, r;
	double f;

	d = a / b;
	r = a % b;
	f = static_cast<double>(a) / b;

	std::cout << d << " " << r << " " << std::setprecision(5) << std::fixed << f << "\n";
    return 0;
}




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

#define st first
#define nd second

using namespace std;

void debug_out() { cerr << endl; }
template<class T> ostream& prnt(ostream& out, T v) { out << v.size() << '\n'; for(auto e : v) out << e << ' '; return out;}
template<class T> ostream& operator<<(ostream& out, vector <T> v) { return prnt(out, v); }
template<class T> ostream& operator<<(ostream& out, set <T> v) { return prnt(out, v); }
template<class T1, class T2> ostream& operator<<(ostream& out, map <T1, T2> v) { return prnt(out, v); }
template<class T1, class T2> ostream& operator<<(ostream& out, pair<T1, T2> p) { return out << '(' << p.st << ' ' << p.nd << ')'; }
template <typename Head, typename... Tail> void debug_out(Head H, Tail... T) { cerr << " " << H; debug_out(T...);}

#define dbg(...) cerr << #__VA_ARGS__ << " ->", debug_out(__VA_ARGS__)
#define dbg_v(x, n) do{cerr<<#x"[]: ";for(long long _=0;_<n;++_)cerr<<x[_]<<" ";cerr<<'\n';}while(0)
#define dbg_ok cerr<<"OK!\n"

const long long N = 100100;

long long a[N], b[N], n;

bool ok(long long nr) {
	long long b[N];
	for(long long i = 1; i <= n; i++) b[i] = a[i] + nr;

	long long req = 0;
	dbg(nr);
	dbg_v(b, n + 1);
	for(long long i = 1; i <= n; i++) {
		req += b[i] / (n + 1);
		req += (b[i] % (n + 1) == n);
	}
	dbg(req);
	return (req <= nr);
}


long long cb(long long l, long long r) {
	while(l != r) {
		long long mid = (l + r) / 2;
		if(ok(mid)) r = mid;
		else l = mid + 1;
	}
	return l;
}

void scad(long long * a, long long n) {
	long long mx = 1;
	for(long long i = 1; i < n; i++)
		if(a[i] > a[mx])
			mx = i;
	a[mx] -= n;
}

long long simulate(priority_queue <long long> pq) {
	long long ret = 0;
	while(pq.top() + ret >= pq.size()) {
		long long x = pq.top() - pq.size() - 1;
		pq.pop();
		pq.push(x);
		ret++;
	}
	return ret;
}


int main() {
	ios_base::sync_with_stdio(false);
	cin >> n;
	long long s = 0;
	for(long long i = 1; i <= n; i++) cin >> a[i], s += a[i];


	long long nrmin = s - 2 * n * n;
	if(nrmin > 0) {
		for(long long i = 1; i <= n; i++) a[i] += nrmin;
			
		long long op = 0;
		for(long long i = 1; i <= n; i++) {
			if(a[i] > 2 * n) {
				a[i] -= 2 * n;
				op += a[i] / (n + 1);
				a[i] = a[i] % (n + 1) + 2 * n;
			}
		}
		while(op < nrmin) scad(a, n + 1), op++;
	}
	priority_queue <long long> pq;
	for(long long i = 1; i <= n; i++) 
		pq.push(a[i]);
	cout << max(nrmin, 0LL) + simulate(pq);
}	


Measured memory_bytes: 256
#include<cstdio>
#include<cstring>

int n;
int fie[13][13];
int now[13][13];
int res[13][13];

void flip(int x,int y){
	fie[x][y]=1-fie[x][y];
	fie[x][y+1]=1-fie[x][y+1];
	fie[x][y-1]=1-fie[x][y-1];
	fie[x+1][y]=1-fie[x+1][y];
	fie[x-1][y]=1-fie[x-1][y];
}

void check(int x,int y){
	if(y==11){
		int flag=0;
		for(int i=1;i<=10;i++){
			for(int j=1;j<=10;j++)if(fie[j][i]==1)flag=1;
		}
		if(flag==0){
			for(int i=1;i<=10;i++){
				for(int j=1;j<=10;j++)res[j][i]=now[j][i];
			}
		}
		return;
	}
	if(y==1){
		now[x][y]=0;
		if(x<=9)check(x+1,y);
		else check(1,y+1);
		
		flip(x,y);
		now[x][y]=1;
		if(x<=9)check(x+1,y);
		else check(1,y+1);
		flip(x,y);
		
	}else{
		if(fie[x][y-1]==1){
			flip(x,y);
			now[x][y]=1;
			if(x<=9)check(x+1,y);
			else check(1,y+1);
			flip(x,y);
		}else{
			now[x][y]=0;
			if(x<=9)check(x+1,y);
			else check(1,y+1);
		}
	}
}

int main(void){
	scanf("%d",&n);
	for(int kkk=0;kkk<n;kkk++){
		memset(fie,0,sizeof(fie));
		for(int i=1;i<=10;i++){
			for(int j=1;j<=10;j++)scanf("%d",&fie[j][i]);
		}
		memset(now,0,sizeof(now));
		memset(res,-1,sizeof(res));
		check(1,1);
		for(int i=1;i<=10;i++){
			for(int j=1;j<=10;j++)printf("%d%c",res[j][i],j==10?'\n':' ');
		}
	}
	return 0;
}

Measured memory_bytes: 1028
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int[] t = new int[n];
		for (int i = 0; i < n; i++) {
			t[i] = scan.nextInt();
		}
		int m = scan.nextInt();
		int[] p = new int[m];
		int[] x = new int[m];
		for (int i = 0; i < m; i++) {
			p[i] = scan.nextInt();
			x[i] = scan.nextInt();
		}
		int[] r = new int[m];
		for (int j = 0; j < m; j++) {
			for (int i = 0; i < n; i++) {
				if (i == p[j]-1) {
					r[j] = r[j] + x[j];
				} else {					
					r[j] = r[j] + t[i];
				}
			}
		}
		for (int i = 0; i < m; i++) {
			System.out.println(r[i]);
		}
	}
}


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

int main(){
    int n;

    scanf("%d",&n);
    n %=10;
    if (n==3)
        printf("bon");
    else if (n==0||n==1||n==6||n==8)
        printf("pon");
    else
        printf("hon");    
    

    return 0;
}

Measured memory_bytes: 1704
#include <iostream>
#include <string>
#include <sstream>
#include <iomanip> 
#include <math.h>
#include <stdio.h>
#include <string.h>
#include <queue>
#include <stack>
#include <vector>
#include <map>
#include <set>
#include <functional>
#include <algorithm>
#include <unordered_map>
#include <unordered_set>
#include <bitset>

using namespace std;


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

	string s;
	cin >> s;
	int n = s.length(), i, j, k, ans;
	vector<pair<int, string>> dp(n + 1, { 0 , " " }), dp2(n + 1, { 0, " " });
	for (i = 1; i <= n; i++) {
		if ((s[i - 1] != dp[i - 1].second[0]) && (dp[i - 1].first + 1 > dp[i].first)) {
			dp[i] = { dp[i - 1].first + 1, s.substr(i - 1, 1) };
		}
		if ((dp2[i - 1].first + 1 > dp[i].first)) {
			dp[i] = { dp2[i - 1].first + 1, s.substr(i - 1, 1) };
		}

		if ((i >= 2) && (dp2[i - 2].first + 1 > dp2[i].first) && (dp2[i - 2].second != s.substr(i-2,2))) {
			dp2[i] = { dp2[i - 2].first + 1, s.substr(i - 2, 2) };
		}
		if ((i >= 2) && (dp[i - 2].first + 1 > dp2[i].first)) {
			dp2[i] = { dp[i - 2].first + 1, s.substr(i - 2, 2) };
		}
	}

	ans = max(dp[n].first, dp2[n].first);
	cout << ans << "\n";

	return 0;
}


Measured memory_bytes: 13684
#include <iostream> 
#include <vector> 
#include <algorithm> 
#include <bits/stdc++.h> 
#include <stdlib.h> 
#include <stdio.h> 
#include <functional> 
#include<math.h> 
#include<cstring>
using namespace std;
int main(void){
    // Your code here!
   vector<int> vec(26);
   for(int i = 0; i < 26; i++) vec.at(i) = 0;
   string S;
   cin >> S;
   int l = S.size();
   for(int i = 0; i < l; i++){
       vec.at( S.at(i) - 'a' )++;
   }
   int m = 0;
   for(int i = 0; i < 26; i++){
       if(vec.at(i) == 0){
           cout << char('a' + i) << endl;
           m++;
           break;
       }
   }
   if(m == 0) cout << "None" << endl;
   
}


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

using namespace std;

typedef unsigned long long ull;
typedef long long ll;
typedef double ld;
//#define ll __int128
//#define int ll
//#define char ll
//#define double ld
typedef vector<char> vc;
typedef vector<vc> vvc;
typedef vector<vvc> vvvc;
typedef pair<int, int> pii;
typedef pair<pii, pii> piii;
typedef pair<ll, ll> pll;
typedef vector<int> vi;
typedef vector<pii> vpi;
typedef vector<vi> vvi;
typedef vector<vvi> vvvi;
typedef vector<short> vs;
typedef vector<vs> vvs;
typedef vector<vvs> vvvs;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef vector<vvl> vvvl;
typedef vector<ld> vld;
typedef vector<vld> vvld;
typedef vector<vvld> vvvld;
typedef vector<string> vst;
typedef vector<vst> vvst;
typedef pair<ld, ld> pld;

#define inmin(a, b) a = min(a, (b))
#define inmax(a, b) a = max(a, (b))
#define ALL(a) a.begin(),a.end()
#define RALL(a) a.rbegin(),a.rend()
#define sqr(x) ((x) * (x))
#define fori(i, n) for(int i = 0; i < int(n); ++i)
#define SZ(a) ((int)((a).size()))
#define triple(T) tuple<T, T, T>
#define quad(T) tuple<T, T, T, T>
#define watch(x) cout << (#x) << " = " << (x) << endl;

#ifdef MAX_HOME
#define cerr cout
#else
#define cerr if (false) cerr
#endif

const double PI = 2 * acos(0.0);
//#define rand shittttty_shit
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
mt19937_64 rng_64(chrono::steady_clock::now().time_since_epoch().count());

const string DIGITS = "0123456789";
const string ALPH = "abcdefghijklmnopqrstuvwxyz";


template<class T0, class T1>
inline ostream &operator<<(ostream &out, pair<T0, T1> &a) {
    return out << "{" << a.first << ", " << a.second << "}";
}

template<class T0, class T1>
inline istream &operator>>(istream &in, pair<T0, T1> &a) {
    return in >> a.first >> a.second;
}

template<class T0, class T1, class T2>
inline ostream &operator<<(ostream &out, tuple<T0, T1, T2> &a) {
    return out << "{" << get<0>(a) << ", " << get<1>(a) << ", " << get<2>(a) << "}";
}

template<class T0, class T1, class T2, class T3>
inline ostream &operator<<(ostream &out, tuple<T0, T1, T2, T3> &a) {
    return out << "{" << get<0>(a) << ", " << get<1>(a) << ", " << get<2>(a) << ", " << get<3>(a) << "}";
}

template<class T>
inline ostream &operator<<(ostream &out, vector<T> &a) {
    out << "[";
    fori (i, a.size())out << a[i] << vector<string>{", ", "]  "}[i + 1 == a.size()];
    return out;
}


void smain();


signed main() {
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
#ifdef MAX_HOME
    freopen("input.txt", "r", stdin);
    clock_t start = clock();
#endif
    cout << setprecision(12) << fixed;
    smain();
#ifdef MAX_HOME
    cout << "\n\nTOTAL EXECUTION TIME: " << float(clock() - start) / CLOCKS_PER_SEC << endl;
#endif
    return 0;
}

void smain() {
    int a, b, c;
    cin >> a >> b >> c;
    inmax(a, b);
    cout << (c + a - 1) / a;
}

Measured memory_bytes: 3600
import std.stdio, std.string, std.conv;
import std.range, std.algorithm, std.array, std.typecons, std.container;
import std.math, std.numeric, core.bitop;

enum inf3 = 1_001_001_001;
enum inf6 = 1_001_001_001_001_001_001L;
enum mod = 1_000_000_007L;


void main() {
    int n, m, q;
    scan(n, m, q);
    auto s = iota(n).map!(i => readln.chomp.to!long).array;
    auto t = iota(m).map!(i => readln.chomp.to!long).array;
    auto xs = iota(q).map!(i => readln.chomp.to!long).array;
    s = [-inf6] ~ s ~ [inf6];
    t = [-inf6] ~ t ~ [inf6];

    auto ss = s.assumeSorted;
    auto ts = t.assumeSorted;

    foreach (i ; 0 .. q) {
        long x = xs[i];

        auto lr = ss.lowerBound(x + 1).back;
        auto lb = ts.lowerBound(x + 1).back;
        auto rr = ss.upperBound(x).front;
        auto rb = ts.upperBound(x).front;
        
        long ans;
        ans = max(x - lr, x - lb);
        ans = min(ans, min(x - lb, rr - x) + rr - lb);
        ans = min(ans, min(x - lr, rb - x) + rb - lr);
        ans = min(ans, max(rr - x, rb - x));
        writeln(ans);
    }
}




int[][] readGraph(int n, int m, bool isUndirected = true, bool is1indexed = true) {
    auto adj = new int[][](n, 0);

    foreach (i ; 0 .. m) {
        int u, v;
        scan(u, v);
        if (is1indexed) {
            u--, v--;
        }
        adj[u] ~= v;
        if (isUndirected) {
            adj[v] ~= u;
        }
    }

    return adj;
}

alias Edge = Tuple!(int, "to", int, "cost");

Edge[][] readWeightedGraph(int n, int m, bool isUndirected = true, bool is1indexed = true) {
    auto adj = new Edge[][](n, 0);

    foreach (i ; 0 .. m) {
        int u, v, c;
        scan(u, v, c);
        if (is1indexed) {
            u--, v--;
        }
        adj[u] ~= Edge(v, c);
        if (isUndirected) {
            adj[v] ~= Edge(u, c);
        }
    }

    return adj;
}

void yes(bool b) {writeln(b ? "Yes" : "No");}
void YES(bool b) {writeln(b ? "YES" : "NO");}
T[] readArr(T)() {return readln.split.to!(T[]);}

void scan(T...)(ref T args) {
    import std.stdio : readln;
    import std.algorithm : splitter;
    import std.conv : to;
    import std.range.primitives;

    auto line = readln().splitter();
    foreach (ref arg; args) {
        arg = line.front.to!(typeof(arg));
        line.popFront();
    }
    assert(line.empty);
}

void fillAll(R, T)(ref R arr, T value) {
    static if (is(typeof(arr[] = value))) {
        arr[] = value;
    }
    else {
        foreach (ref e; arr) {
            fillAll(e, value);
        }
    }
}


Measured memory_bytes: 6268
def answerA():
    a, b = map(int, input().split())
    if a < 10 and b < 10:
        result = a * b
    else:
        result = -1

    print(result)


def answerB():
    def can_be_devided_by_1d(n):
        result = 'No'
        for i in range(1,10):
            floor, mod = divmod(n, i)
            if mod == 0 and floor < 10:
                result = 'Yes'
        return result

    n = int(input())
    print(can_be_devided_by_1d(n))


def answer():
    def make_divisors(n):
        divisors = set()
        for i in range(1, int(n ** 0.5) + 1):
            if n % i == 0:
                divisors.add(i)
                if i != n // i:
                    divisors.add(n // i)
        return divisors

    n = int(input())
    divisors = make_divisors(n)
    candidates = set()

    for i in divisors:
        floor = n // i
        distance = (floor-1) + (i-1)
        candidates.add(distance)

    print(min(candidates))


if __name__ == '__main__':
    answer()


Measured memory_bytes: 3928
#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <math.h>
#include <map>
#define FOR(i,a,b) for(int i = (a); i < (b); i++)
using namespace std;
int main() {
	cin.tie(0);
	ios::sync_with_stdio(false);
	int mini = 0;
	int maxi = 0;
	int count = 0;
	cin >> mini >> maxi;
	string str;
	FOR(i, mini, maxi + 1) {
		str = to_string(i);
		if (str[0] == str[4] && str[1] == str[3]) {
			count++;
		}
	}
	cout << count;
	return 0;
}

Measured memory_bytes: 256
program main
  implicit none
  integer a, b, c, d, e, min10, min10i
  read(*, *) a
  read(*, *) b
  read(*, *) c
  read(*, *) d
  read(*, *) e
  if (mod(a,10) == 0) then
    a = a-10
  end if
  if (mod(b,10) == 0) then
    b = b-10
  end if
  if (mod(c,10) == 0) then
    c = c-10
  end if
  if (mod(d,10) == 0) then
    d = d-10
  end if
  if (mod(e,10) == 0) then
    e = e-10
  end if
!    min10 = 9
min10 = 10
if (min10 > mod(a,10).and. mod(a,10)>0) then
  min10 = mod(a,10)
end if

  if (min10 > mod(b,10).and. mod(b,10)>0) then
    min10 = mod(b,10)
  end if
  if (min10 > mod(c,10).and. mod(c,10)>0) then
    min10 = mod(c,10)
  end if
  if (min10 > mod(d,10).and. mod(d,10)>0) then
    min10 = mod(d,10)
  end if
  if (min10 > mod(e,10).and. mod(e,10)>0) then
    min10 = mod(e,10)
  end if

  a = a/10
  

  a = 10*(a + 1)
  !min10 = mod(a,10)
  !min10i = a
  b = b/10


    b = 10*(b + 1)
  c = c/10


    c = 10*(c + 1)
  d = d/10

    d = 10*(d + 1)
  e = e/10


    e = 10*(e + 1)
  
  write(*, '(i0)') a+b+c+d+e + (min10 - 10)

end program main

Measured memory_bytes: 256
#include<stdio.h>
int main(void)
{
	int s1[6],s2[6],s3[6],s4[6],i,j,x;
	char a[6]={'A','B','C','D','E'};
	while(1){
		scanf("%d %d",&s1[0],&s2[0]);
		if(s1[0]==0&&s2[0]==0) break;
		else s3[0]=s1[0]+s2[0];
		for(i=1;i<5;i++){
			scanf("%d %d",&s1[i],&s2[i]);
			s3[i]=s1[i]+s2[i];
		}
		for(i=0;i<5;i++) s4[i]=s3[i];
		for(i=0;i<4;i++){
			for(j=i+1;j<5;j++){
				if(s3[i]<s3[j]){
					x=s3[i];
					s3[i]=s3[j];
					s3[j]=x;
				}
			}
		}
		for(i=0;i<5;i++){
			if(s3[0]==s4[i]){
				printf("%c %d\n",a[i],s3[0]);
				break;
			}
		}
	}	
	return 0;
}

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

using namespace std;

int MATCH_NUM[9] = {2, 5, 5, 4, 5, 6, 3, 7, 6};

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    
    int N, M;
    cin >> N >> M;
    int A[M]; 
    for (int i = 0; i < M; ++i) {
        cin >> A[i];
    }
    
    string dp[N + 1];
    for (int i = 0; i < N + 1; ++i) {
        dp[i] = "-";
    }
    
    dp[0] = "";
    
    for (int i = 0; i <= N; ++i) {
        if (dp[i] == "-") {
            continue;
        }
        for (int j = 0; j < M; ++j) {
            if (i + MATCH_NUM[A[j] - 1] > N) {
                continue;
            }
            string &bef = dp[i + MATCH_NUM[A[j] - 1]];
            string aft = dp[i] + (char)('0' + A[j]);
            if (bef == "-") {
                bef = aft;
            } else if (bef.size() < aft.size()) {
                bef = aft;
            } else if (bef.size() == aft.size() && bef < aft) {
                bef = aft;
            }
        }
    }
    
    cout << dp[N] << endl;
    
    return 0;
}



Measured memory_bytes: 44800
#pragma GCC optimize ("O3")

#include <bits/stdc++.h>
#define FOR(i, m, n) for (int i = (m); i < (n); ++i)
#define REP(i, n) FOR(i, 0, n)
#define fi first
#define se second
#define pb push_back
#define mp make_pair
#define eb emplace_back
#define bcnt __builtin_popcountll

using namespace std;

typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef pair<ll,ll> Pll;
typedef pair<int,int> Pin;

ll INF = 1e16;
int inf = 1e9;
ll MOD = 1e9+7;

template<typename T>
ostream& operator << (ostream& os, const vector<T>& vec) {
    os << "{ ";
    REP(i, vec.size()) {
        os << vec[i] << " ";
    }
    os << "}";

    return os;
}

ll pow_mod(ll a, ll p) {
    ll res = 1;
    while(p) {
        if (p & 1) res = (res * a) % MOD;
        a = (a * a) % MOD;
        p >>= 1;
    }

    return res;
}


ll mod_inv(ll a, ll m) {
    ll b = m, u = 0, v = 1;
    while(a) {
        ll t = b / a;
        swap(b -= t * a, a);
        swap(u -= t * v, v);
    }

    return (u % m + m) % m;
}

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

void d_err() {
    cerr << endl;
}

template <typename H, typename... T>
void d_err(H h, T... t) {
    cerr << h << " ";
    d_err(t...);
}

#ifdef LOCAL
#define debug(...)  cerr << "[" << #__VA_ARGS__ << "]: ", d_err(__VA_ARGS__);
#else
#define debug(...) 83;
#endif

int main(){
    cin.tie(0);
    ios_base::sync_with_stdio(false);
    
    int N, K;
    cin >> N >> K;

    double ans = 0;

    ans = 1;
    REP(i, N) {
        if (i + 1 < K){
            int n = ceil(log2(float(K) / (i+1)));

            ans -= double(pow(2, n) - 1) / (pow(2, n) * N);

            debug(n, K, i+1);
        }

    }
    
    cout << fixed << setprecision(20);
    cout << ans << endl;

}


Measured memory_bytes: 512
#include <stdio.h>

int top=0;

int push(int);
int pop(void);


int main(){
 
  int x,c,d;
  char s[100];


  while( scanf("%s", s) != EOF ){
    if ( s[0] == '+' ){
      c=pop();
      d=pop();
      push(d+c);


    } else if ( s[0] == '-' ){
      c=pop();
      d=pop();
      push(d-c);
     
      



    } else if ( s[0] == '*' ){
      c=pop();
      d=pop();
      push(d*c);
     

    } else {
      x = atoi(s);
      push(x);
    }
  }
  
  printf("%d\n",pop());
  return 0;
}


int s[100];


int push(int x){

  
  s[top++] = x;
  return x;
}

int pop(void){

    
 
 
  return s[--top]; 
}

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

int main()
{
  int N;
  cin >> N;
  vector<int64_t> L(N+1);
  L.at(0)=2,L.at(1)=1;
  for(int i=2;i<=N;i++){L.at(i)=L.at(i-2)+L.at(i-1);}
  cout << L.at(N) << endl;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define ll long long
#define fast ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
using namespace std;
int main()
{
    int n,d;
    cin>>n>>d;
    int p,q,i,ans=0;
    for(i=0;i<n;i++)
    {
        cin>>p>>q;
        if(sqrt(pow(p,2)+pow(q,2))<=d)
           ans++;
    }
    cout<<ans;
    return 0;
}


Measured memory_bytes: 3648
use proconio::*;

fn main() {
    input! {
        s : String
    }
    let mut a = 0;
    for ch in s.as_str().chars() {
        a = (a + (ch as i32) - ('0' as i32)) % 9;
    }
    let f = if a == 0 { "Yes" } else { "No" };
    println!("{}", f);
}


Measured memory_bytes: 2408
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<iostream>
#include<math.h>
using namespace std;
  
int main(){
	long int n,m,i,j,k;
	while(1){
		m=0;j=0;k=0;
		cin>>n;
		if(n==0){break;}
		
		for(i=1;i<=sqrt((double)n);i++){
			if(n%i==0){
				if(i==1){
					m++;
				}else if(i==sqrt((double)n)){
					m+=i;
				}else{
					m+=i+(n/i);
				}
			}
		}
		if(n==1){
			cout<<"deficient number"<<endl;
		}else if(n==m){
			cout<<"perfect number"<<endl;
		}else if(n<m){
			cout<<"abundant number"<<endl;
		}else{
			cout<<"deficient number"<<endl;
		}
	}
    return 0;
}

Measured memory_bytes: 1156
#include<stdio.h>
int main()
{
    long long int n,k,a;
    scanf("%lld%lld",&n,&k);
    if(n>k){
        a=n%k;
        if(a<=k-a) n=a;
        else n=k-a;
    }else if(n<k){
        if(n>k-n) n=k-n;
    }else{
        n=0;
    }
    printf("%lld",n);
    return 0;
}

Measured memory_bytes: 1728
#include<iostream>
#include<string>
#include<vector>
#include<unordered_map>

int main(void){
    int n;
    std::vector<std::string> vec = {"AC", "WA", "TLE", "RE"};
    std::unordered_map<std::string, int> um;
    std::string str;
    std::cin >> n;
    um[str] = 0;

    for(int i = 0; i < n; i++){
	std::cin >> str;
	um[str]++;
    }

    for(auto i : vec){
	std::cout << i << " x " << um[i] << std::endl;
    }

    return 0;
}


Measured memory_bytes: 3500
#include <bits/stdc++.h>
 
using namespace std;
 
const long long MOD=1e9+7;
const double PI=3.14159265359;



int main() {
    
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    
    int n;
    cin>>n;
    vector<int> v1(n), v2(n), v3(n);
    for(int& i:v1) cin>>i;
    for(int& i:v2) cin>>i;
    for(int& i:v3) cin>>i;
    
    sort(v1.begin(), v1.end());
    sort(v2.begin(),v2.end());
    sort(v3.begin(),v3.end());
    
    long long ans=0;
    int pos1=0, pos3=0;
    
    
    
    for(int i=0; i<n; i++){
        while(pos1<n && v1[pos1]<v2[i]){
            pos1++;
        }
        while(pos3<n && v3[pos3]<=v2[i]){
            pos3++;
        }
        ans+=(long long)(pos1)*(n-pos3);
        
    }
    
    cout<<ans;
    
    return 0;
    
}

Measured memory_bytes: 1408
#include <iostream>
#include <sstream>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <numeric>
#include <algorithm>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cctype>
#include <cmath>
#include <cassert>
#include <cstdarg>
#include <sys/time.h>
#include <fstream>
//#include "cout.h"

using namespace std;

#define SZ(x) ((int)x.size())
#define MSET(x,a) memset(x, a, (int)sizeof(x))
#define PB push_back
#define VI vector < int >
#define PII pair < int, int >
#define LL long long
#define FOR(i,a,b) for (int i = (a); i < (b); i++)
#define REP(i,n) FOR(i,0,n)
#define ALL(v) (v).begin(), (v).end()
#define FIT(it,v) for (__typeof((v).begin()) it = (v).begin(); it != (v).end(); it++)
#define OUT(A) cout << #A << " = "<< (A) << endl
#define OUT2(A, B) cout << "(" << #A << ", " << #B << ") = (" << (A) << ", "<< (B) << ")" << endl
template<class T> void chmin(T &t, T f) { if (t > f) t = f; }
template<class T> void chmax(T &t, T f) { if (t < f) t = f; }

#define present(c, e) ((c).find((e)) != (c).end())
#define cpresent(c, e) (find(ALL(c), (e)) != (c).end())


void solve() {
  int a;
  string s;
  cin >> a >> s;
  if (a >= 3200) cout << s << endl;
  else cout << "red" << endl;
}

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


Measured memory_bytes: 256
/*
 　　　　　／＞　 フ
 　　　　　| 　_　 _|
 　 　　　／`ミ _x 彡
 　　 　 /　　　 　 |
 　　　 /　  ヽ　　 ?
 　／￣|　　 |　|　|
 　| (￣ヽ＿_ヽ_)_)
 　＼二つ
  */

#include <queue>
#include <vector>
#include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
#define MP make_pair
#define ll long long
#define fi first
#define se second
using namespace std;

template <typename T>
void read(T &x) {
    x = 0; bool f = 0;
    char c = getchar();
    for (;!isdigit(c);c=getchar()) if (c=='-') f=1;
    for (;isdigit(c);c=getchar()) x=x*10+(c^48);
    if (f) x=-x;
}

template<typename F>
inline void write(F x, char ed = '\n') {
    static short st[30];short tp=0;
    if(x<0) putchar('-'),x=-x;
    do st[++tp]=x%10,x/=10; while(x);
    while(tp) putchar('0'|st[tp--]);
    putchar(ed);
}

template <typename T>
inline void Mx(T &x, T y) { x < y && (x = y); }

template <typename T>
inline void Mn(T &x, T y) { x > y && (x = y); }

const int N = 4005;
int h[N], ne[N<<1], to[N<<1], tot;
inline void add(int x, int y) {
    ne[++tot] = h[x], to[h[x] = tot] = y;
}

char s[N];
int siz[N], dis[N], f[N], ans = 1e9, n;
void dfs(int x, int fa) {
    siz[x] = s[x] == '1'; int mx = dis[x] = f[x] = 0;
    for (int i = h[x]; i; i = ne[i]) {
        int y = to[i]; if (y == fa) continue;
        dfs(y, x), dis[y] += siz[y];
        dis[x] += dis[y], siz[x] += siz[y]; 
        if (dis[y] > dis[mx]) mx = y;
    }
    if (dis[mx] * 2 <= dis[x]) { f[x] = dis[x] / 2; return; }
    f[x] = dis[x] - dis[mx] + min(f[mx], (2 * dis[mx] - dis[x]) / 2);
}

int main() {
    read(n), scanf ("%s", s + 1);
    for (int i = 1, x, y;i < n; i++)
        read(x), read(y), add(x, y), add(y, x);
    for (int i = 1;i <= n; i++) 
        dfs(i, 0), f[i] * 2 == dis[i] && (Mn(ans, f[i]), 0);
    write(ans < 1e8 ? ans : -1);
    return 0;
}


Measured memory_bytes: 3236
#include <bits/stdc++.h>
using namespace std;
 
typedef long long ll;
#define PI 3.1415926535897932384626433
#define mod 1000000007
 
int gcd(int a, int b) { return b ? gcd(b, a%b) : a; }
 
int lcm(int a, int b) { return a * b / gcd(a, b); }
 
int main(){
    int n;
    cin >> n;
    int a[n];
    for (int i = 0; i < n; i++){
        cin >> a[i];
    }

    double ans;
    for (int i = 0; i < n; i++){
        ans += (1.0 / a[i]);
    }
    ans = 1.0 / ans;
    printf("%.10f", ans);
    return 0;
}

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

namespace HABIT{
    #define f(a,b,c,d) for(register int a=b,c=d;a<=c;a++)
    #define g(a,b,c,d) for(register int a=b,c=d;a>=c;a--)
    #define LOCAL
    typedef int i32;
    typedef unsigned int u32;
    typedef long long int i64;
    typedef unsigned long long int u64;
    const i32 MAXN=1e5+10;
    typedef i64 ar[MAXN];
    
    template<typename T> inline T Max(T a) { return a; }
    template<typename T,typename... Args> inline T Max(T a,Args... args){
        T b=Max(args...);
        return (a>b)?a:b;
    }
    template<typename T> inline T Min(T a) { return a; }
    template<typename T,typename... Args> inline T Min(T a,Args... args){
        T b=Min(args...);
        return (a<b)?a:b;
    }

    #ifdef LOCAL
        inline char gc() { return getchar(); }
    #else
        inline char gc() {
            static char s[1<<20|1]={0},*p1=s,*p2=s;
            return (p1==p2)&&(p2=(p1=s)+fread(s,1,1<<20,stdin),p1==p2)?EOF:*(p1++);
        }
    #endif
    inline i64 read(){
        register i64 ans=0;register char c=gc();register bool neg=0;
        while(c<48||c>57) neg^=!(c^'-'),c=gc();
        while(c>=48&&c<=57) ans=(ans<<3)+(ans<<1)+(c^48),c=gc();
        return neg?-ans:ans;
    }

    char Output_Ans[1<<20|1],*Output_Cur=Output_Ans;
    inline void output() { Output_Cur-=fwrite(Output_Ans,1,Output_Cur-Output_Ans,stdout); }
    inline void print(char c){
        if(Output_Cur-Output_Ans+1>>20) output();
        *(Output_Cur++)=c;
    }
    inline void print(char *s) { while(*s) print( *(s++) ); }
    inline void print(u64 x){
        if(!x) { print('0'); return ; }
        char buf[30]={0},*p=buf+28;
        while(x) *(p--)=x%10+48,x/=10;
        print(p+1);
    }
    inline void print(u32 x) { print( (u64)x ); }
    inline void print(i64 x){
        if(x<0) print('-'),x=-x;
        print( (u64)x );
    }
    inline void print(i32 x){
        if(x<0) print('-'),x=-x;
        print( (u64)x );
    }
}
using namespace HABIT;

const i64 MOD=1e9+7;
ar ar_d_Num;

inline i64 fpow(i64 a,i64 x){
    i64 ans=1;
    for(;x;x>>=1,a=a*a%MOD) if(x&1) ans=ans*a%MOD;
    return ans;
}

int main(){
    i64 d_N=read(),d_K=read();
    g(i,d_K,I,1){
        ar_d_Num[i]=fpow(d_K/i,d_N);
        for(register i32 j=i+i;j<=d_K;j+=i)
            ar_d_Num[i]=(ar_d_Num[i]-ar_d_Num[j])%MOD;
    }
    i64 d_Ans=0;
    f(i,1,I,d_K) d_Ans=(d_Ans+ar_d_Num[i]*i%MOD)%MOD;
    print((d_Ans+MOD)%MOD);
    output();
    return 0;
}

Measured memory_bytes: 4408
import sys
stdin = sys.stdin
 
sys.setrecursionlimit(10**5)

def li(): return map(int, stdin.readline().split())
def li_(): return map(lambda x: int(x)-1, stdin.readline().split())
def lf(): return map(float, stdin.readline().split())
def ls(): return stdin.readline().split()
def ns(): return stdin.readline().rstrip()
def lc(): return list(ns())
def ni(): return int(stdin.readline())
def nf(): return float(stdin.readline())

a,b,k = li()
ans = set()
for i in range(k):
    if a+i > b:
        break
    
    ans.add(a+i)
    
for i in range(k):
    if b-i < a:
        break
    
    ans.add(b-i)
    
ansl = sorted(list(ans))

for ans in ansl:
    print(ans)

Measured memory_bytes: 3064
def yakusuu(n):
    yakusuu_list = list()
    for i in range(n):
        if n % i == 0:
            yakusuu_list.append(i)
    return yakusuu_list


def baisuu(n, max_N):
    baisuu_list = list()
    for i in range(n, max_N + 1, n):
        baisuu_list.append(i)
    return baisuu_list


N = int(input())
A = [-1] + list(map(int, input().split()))
box = [0 for _ in range(N + 1)]
ans = list()

for i in range(N, N // 2, -1):
    box[i] = A[i]

for i in range(N // 2, 0, -1):
    baisuu_list = baisuu(i, N)
    baisuu_xor = 0
    for b in baisuu_list:
        baisuu_xor ^= box[b]
    box[i] = baisuu_xor ^ A[i]

print(sum(box))
for i in range(1, N + 1):
    if box[i] == 1:
        ans.append(i)
print(" ".join(map(str, ans)))


Measured memory_bytes: 27308
#include<iostream>
#include<algorithm>
#include<vector>
using namespace std;
typedef long long ll;

const int MAX_N = 1e+5 + 5;

ll A[MAX_N], B[MAX_N];

int main() {
    int N;
    ll a_sum = 0, b_sum = 0;
    cin >> N;
    for (int i = 0; i < N; i++) {
        cin >> A[i];
        a_sum += A[i];
    }
    for (int i = 0; i < N; i++) {
        cin >> B[i];
        b_sum += B[i];
    }
    if (a_sum < b_sum) {
        cout << -1 << endl;
        return 0;
    }
    vector<ll> sub_prepare;
    ll need_change = 0, changed_num = 0;
    for (int i = 0; i < N; i++) {
        if (A[i] > B[i]) sub_prepare.push_back(A[i] - B[i]);
        else {
            need_change += B[i] - A[i];
            changed_num++;
        }
    }
    if (need_change == 0) {
        cout << 0 << endl;
        return 0;
    }
    sort(sub_prepare.begin(), sub_prepare.end());
    reverse(sub_prepare.begin(), sub_prepare.end());
    int ans = changed_num;
    for (int i = 0; i < sub_prepare.size(); i++) {
        if (need_change > 0) {
            ans++;
            need_change -= sub_prepare[i];
        }
        else break;
    }
    cout << ans << endl;
    return 0;
}

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

int main(){

    string S, T;
    int res=0;
    cin >> S;
    cin >> T;

    int length = S.length();
    for(int i=0; i<length; i++){
        if(S.at(i) != T.at(i))
            res++;
    }

    cout << res << endl;

}

Measured memory_bytes: 3772
#include <bits/stdc++.h>
#define ll long long
#define ull unsigned long long
using namespace std;

/*2進数配列+1*/
vector<int> twoadd(vector<int> v, int N){
    v[N-1]+=1;
    int ind = N-1;
    int j=N-1;
    for(j=N-1;j>=1;j--){
        if(v[j]>1){
            v[j-1]+=1;
            v[j]=0;
        }
    }
    return v;
}

/*フィボナッチ*/
long long fibonatti(long long d){
    long long count = 0;
    long long f1 = 1;
    long long f2 = 1;/*ここを変える*/
    long long temp;
    if(d == 1){
        count = f1;
    }else if(d == 2){
        count = f2;
    }else if(d==0){
        count = 1;
    }else{
        for(int i=0;i<d-2;i++){
            temp = f1+f2;
            f1 = f2;
            f2 = temp;
        }
        count = temp;
    }
    return count;
}

/*最大公約数*/
unsigned long long GCD(long long L,long long R){
    if(L>R){
        long long temp=R;
        R = L;
        L = temp;
    }
    unsigned long long pp=0,ppt=0;
    unsigned long long ans=0;
    if(R%L==0){
        ans = L;
    }else{
        while(true){
            ppt = pp;
            pp=R%L;
            if(pp == 0){
                ans = ppt;
                break;
            }
            R = L;
            L = pp;
        }
    }    
    return ans;    
}

/*最小公倍数*/
unsigned long long LCM(long long L,long long R){
    unsigned long long ans;
    unsigned long long gcd = GCD(L,R);
    ans = (L/gcd)*R;
    return ans;
}

/*ここから*/
int main() {
    int N;
    ll time=0;
    cin >> N;
    vector<pair<long,long>> B(N);
    for(int i=0;i<N;i++){
        cin >> B[i].second >> B[i].first;
    }
    sort(B.begin(),B.end());
    for(int i=0;i<N;i++){
        time += B[i].second;
        if(B[i].first<time){
            cout << "No" << endl;
            exit(0);
        }
    }
    cout << "Yes" << endl;
}

Measured memory_bytes: 6768
#include <bits/stdc++.h>
#define rep(i, n) for(int i = 0; i < (n); i++)
#define all(a) a.begin(), a.end()
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; }
using namespace std;
typedef long long ll;

vector<int> tree[100000];
int dfs(int v, int p){
    int res = 0;
    for(int u : tree[v])if(u != p){
        res ^= (dfs(u, v) + 1);
    }
    return res;
}

int main(){

    int N;
    cin >> N;

    rep(i, N - 1){
        int x, y;
        cin >> x >> y;
        x--; y--;
        tree[x].push_back(y);
        tree[y].push_back(x);
    }

    cout << (dfs(0, -1) ? "Alice\n" : "Bob\n");
    return 0;

}

Measured memory_bytes: 10368
import collections
import itertools
from pprint import pprint as pp

N = int(input())
S = collections.defaultdict(int)
for _ in range(N):
  s = input()
  if s[0] not in ('MARCH'):
    continue
  S[s[0]] += 1
cnt = 0
for (a,b,c) in itertools.combinations('MARCH', 3):
  cnt += S[a] * S[b] * S[c]
print(cnt)

Measured memory_bytes: 3700
import sys
# input = sys.stdin.buffer.readline
def getN():
    return int(input())
def getNM():
    return map(int, input().split())
def getlist():
    return list(map(int, input().split()))
import math
import heapq
from collections import defaultdict, Counter, deque
MOD = 10**9 + 7
INF = 10**15


def main():
    date = ["SUN", "MON", "TUE", "WED", "THU", "FRI", "SAT"]
    print(7 - date.index(input().strip()))


if __name__ == '__main__':
    main()

"""
9999
3

2916
"""

Measured memory_bytes: 38256
#include <bits/stdc++.h>
#include <iostream>
#include <vector>
#include <algorithm>
#include <set>
#include <complex>
#include <tuple>

#define FAST ios_base::sync_with_stdio(false); cin.tie(0)
#define _overload3(_1,_2,_3,name,...) name
#define _rep(i,n) repi(i,0,n)
#define repi(i,a,b) for(int i=int(a);i<int(b);++i)
#define rep(...) _overload3(__VA_ARGS__,repi,_rep,)(__VA_ARGS__)
#define repr(i, a, b) for(int i=int(a); i>=int(b); i--)
#define reps(i,n) for(int i=1;i<=int(n);++i)
#define RREP(i,x) for(int i=((int)(x)-1);i>=0;i--)
#define RREPS(i,x) for(int i=((int)(x));i>0;i--)
#define iceil(x,y) (x+y-1)/y
#define FOR(it,c) for(__typeof((c).begin()) it=(c).begin(); it!=(c).end(); ++it)
#define all(x) (x).begin(),(x).end()
#define UNIQUE(v) v.erase( unique(v.begin(), v.end()), v.end() )
#define LF "\n"

template<typename T1,typename T2> inline void chmin(T1 &a,T2 b){if(a>b) a=b;}
template<typename T1,typename T2> inline void chmax(T1 &a,T2 b){if(a<b) a=b;}

int gcd(int a,int b){return b?gcd(b,a%b):a;}

using namespace std;
typedef long long int ll;
typedef unsigned long long int ull;
typedef pair<int, int> PII;
typedef pair<ll, ll> PLL;
typedef pair<int, PII> PP;

int H,W,h,w;

int main()
{
	FAST;
	cin >> H >> W >> h >> w;

	cout << (H-h)*(W-w) << "\n";

	return 0;
}

Measured memory_bytes: 256