akhauriyash/Code-Regression huggingface dataset:
// test.cpp
#pragma warning(disable:4996)
#include<iostream>
using namespace std;
int main()
{
    // 整数の入力
    int a,b,c;
	bool bRet =false;
    cin >> a >> b >> c;
	if( a == b+c || b == a + c || c == a + b )
		bRet=true;

	if( bRet )
		cout << "Yes" << endl;
	else
		cout << "No" << endl;
    return 0;
}

Measured memory_bytes: 256
a = int(input())
b = int(input())
c = int(input())
x = int(input())

cnt = 0
for i in range(a+1):
    for j in range(b+1):
        for y in range(c+1):
            if (500 * i) + (100 * j) + (50 * y) == x:
                cnt += 1
print(cnt)


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

int main() {
  int a, b, c;
  	cin >> a >> b >> c;
      	if (a==b+c || (b == a+c|| c == a+b)){
      		cout << "Yes" << endl;
    	}
  		else
  		{
          	cout << "No" << endl;
        }
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int ret,res,n;
vector<int> f;
int main(){
	cin>>n;int x;int i;
	for(int i=0;i<n;++i){
		cin>>x;ret+=x;f.push_back(ret);
	}res=abs(f[0]-(ret-f[0]));
	for(int i=0;i<n;++i){
		if(abs(f[i]-(ret-f[i]))<res){
			res=abs(f[i]-(ret-f[i]));
		}
	}
	cout<<res;
}

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

int main(){
  int N, Ma, Mb;
  std::cin >> N >> Ma >> Mb;

  std::vector<int> a_arr(N), b_arr(N), c_arr(N);
  for(int i = 0; i < N; i++) std::cin >> a_arr[i] >> b_arr[i] >> c_arr[i];

  long long dp[41][401][401];
  for(int j = 0; j <= 400; j++){
    for(int k = 0; k <= 400; k++){
      dp[0][j][k] = 10000;
    }
  }
  dp[0][0][0] = 0;

  for(int i = 0; i < N; i++){
    for(int j = 0; j <= 400; j++){
      for(int k = 0; k <= 400; k++){
        if(j-a_arr[i] < 0 || k-b_arr[i] < 0) dp[i+1][j][k] = dp[i][j][k];
        else dp[i+1][j][k] = std::min(dp[i][j][k], dp[i][j-a_arr[i]][k-b_arr[i]]+c_arr[i]);
      }
    }
  }

  long long ans = 10000;
  for(int i = 1; i < 400; i++){
    if(Ma*i > 400 || Mb*i > 400) break;
    ans = std::min(ans, dp[N][Ma*i][Mb*i]);
  }

  if(ans == 10000) std::cout << -1 << std::endl;
  else std::cout << ans << std::endl;

  return 0;
}



Measured memory_bytes: 51840
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
    ($($r:tt)*) => {
        let mut s = {
            use std::io::Read;
            let mut s = String::new();
            std::io::stdin().read_to_string(&mut s).unwrap();
            s
        };
        let mut iter = s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
}

macro_rules! input_inner {
    ($iter:expr) => {};
    ($iter:expr, ) => {};

    ($iter:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($iter, $t);
        input_inner!{$iter $($r)*}
    };
}

macro_rules! read_value {
    ($iter:expr, ( $($t:tt),* )) => {
        ( $(read_value!($iter, $t)),* )
    };

    ($iter:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($iter, $t)).collect::<Vec<_>>()
    };

    ($iter:expr, chars) => {
        read_value!($iter, String).chars().collect::<Vec<char>>()
    };

    ($iter:expr, usize1) => {
        read_value!($iter, usize) - 1
    };

    ($iter:expr, $t:ty) => {
        $iter.next().unwrap().parse::<$t>().expect("Parse error")
    };
}

fn main() {
    input! {
        n: i64,
        y: i64,
    }
    for i in 0..n + 1 {
        for j in 0..n + 1 - i {
            let k = n - i - j;
            if 10000 * i + 5000 * j + 1000 * k == y {
                println!("{} {} {}", i, j, k);
                return;
            }
        }
    }
    println!("{} {} {}", -1, -1, -1);
}


Measured memory_bytes: 4352
#pragma GCC optimize ("O3")
#include <bits/stdc++.h>
#define abdelrahman010 ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
typedef long long ll;
using namespace std;
const int N = 2e5 + 5;
int n , a[N];
ll memo[N][3];
ll solve(int i , int f) {
    if(i >= n)
        return 0;
    ll &ans = memo[i][f];
    if(~ans)
        return ans;
    ans = -1e18;
    if(f < 2)
        ans = solve(i + 1 , f + 1);
    if(i != n - 1 || f)
        ans = max(ans , solve(i + 2 , f) + a[i]);
    return ans;
}
int main() {
    abdelrahman010
    cin >> n;
    for (int i = 0; i < n; i++)
        cin >> a[i];
    memset(memo, -1, sizeof memo);
    if(n & 1)
        cout << solve(0, 0);
    else
        cout << solve(0 , 1);
    return 0;
}

Measured memory_bytes: 13808
#include <stdio.h>

int selectionSort(int *,int);

int main(){
  int A[100],N,i,cnt;
  scanf("%d",&N);
  for(i=0;i<N;i++){
    scanf("%d",&A[i]);
  }
  cnt=selectionSort(A,N);
  for(i=0;i<N;i++){
    if(i!=0){
      printf(" ");
    }
    printf("%d",A[i]);
  }
  printf("\n");
  printf("%d\n",cnt);
  return 0;
}

int selectionSort(int A[],int N){
  int i,j,t,sw=0,minj;
  for(i=0;i<N-1;i++){
    minj=i;
    for(j=i;j<N;j++){
      if(A[j]<A[minj]){
        minj=j;
      }
    }
    t=A[i];
    A[i]=A[minj];
    A[minj]=t;
    if(i!=minj){
      sw++;
    }
  }
  return sw;
}


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

int main() {
  int N;
  cin >> N;
  vector<int> d(N);
  for (int i = 0; i < N; i++) cin >> d.at(i);
  int ans = 0;
  for (int i = 0; i < N-1; i++) {
    for (int j = i+1; j < N; j++) {
      ans += d.at(i) * d.at(j);
    }
  }
  cout << ans << endl;
}

Measured memory_bytes: 256
#pragma region header
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep1(i, n) for (int i = 1; i <= (int)(n); i++)
#define rev(i, n) for(int i = (int)(n - 1); i >= 0; i--)
#define rev1(i, n) for(int i = (int)(n); i > 0; i--)
#define pb push_back
#define all(v) (v).begin(), (v).end()
#define resort(v) sort((v).rbegin(), (v).rend())
#define vi vector<int>
#define vvi vector<vector<int>>
#define vc vector<char>
#define vvc vector<vector<char>>
#define vb vector<bool>
#define vvb vector<vector<bool>>
using ll = long long;
using P = pair<int, int>;
/* ----------------よく使う数字や配列----------------- */
int dx[] = {1,0,-1,0};
int dy[] = {0,1,0,-1};
constexpr ll mod = 1e9+7;
constexpr ll inf = INT32_MAX/2;
constexpr ll INF = LLONG_MAX/2;
constexpr long double eps = DBL_EPSILON;
constexpr long double pi = 3.141592653589793238462643383279;
/* ----------------------end----------------------- */

/* --------------------テンプレート------------------ */
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;
}
/* ----------------------end----------------------- */

/* --------------------ライブラリ-------------------- */
ll fact(int i) {       //階乗
    if (i == 0) return 1;
    return (fact(i - 1)) * i % mod;
}
ll gcd(ll a, ll b) {        //最大公約数
    if(b == 0) return a;
    return gcd(b, a % b); 
}
ll lcm(ll a, ll b) {      //最小公倍数
    return a * b / gcd(a, b);
}
int keta(ll n) {        //桁数を求める
    if(n == 0) return 1;
    int count = 0;
    while(n != 0) {
        n /= 10;
        count++;
    }
    return count;
}
ll ketasum(ll n) {    //各桁の和
    ll sum = 0;
    while(n != 0) {
        sum += n % 10;
        n /= 10;
    }
    return sum;
}
/* ----------------------end----------------------- */
#pragma endregion
signed main() { 
    int n;cin >> n;
    int GCD;
    rep(i, n) {
        int a;cin >> a;
        if(i==0)GCD=a;
        else GCD=gcd(a,GCD);
    }
    cout << GCD << endl;
    return 0;
}

Measured memory_bytes: 3572
#include<iostream>
#include<string>
#include<algorithm>
#include<cmath>
using namespace std;
int main() {
	int a, b, c, d, e;
	cin >> a >> b;
	int test[50];
	for (int i = 0; i < 50; i++) {
		test[i] = 0;
	}
	for (int j = 1; j <= b; j++) {
		cin >> c >> d;
		test[c - 1]++;
		test[d - 1]++;
	}
	for (int h = 0; h < a; h++) {
		cout << test[h] << "\n";
	}
	cin >> e;
}

Measured memory_bytes: 256
#include <stdio.h>
#include <algorithm>
#include <assert.h>
#include <cmath>
#include <deque>
#include <iostream>
#include <limits.h>
#include <map>
#include <math.h>
#include <queue>
#include <set>
#include <stdlib.h>
#include <string.h>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <vector>
#define LL long long

#define REP(e,v) for(auto e:v)
#define pii pair<int,int>
#define pLL pair<LL,LL>
#define mp make_pair
#define mt make_tuple
#define pq priority_queue<LL>
#define pqg priority_queue<int,vector<int>,greater<int>>
#define pb push_back
#define vec vector<int>
#define vecll vector<LL>
#define vecpii vector<pii>
#define vecpLL vector<pLL>
#define vecbL vector<bool>
#define endl "\n"

using namespace std;

int inp(){
	int x;
	scanf("%d",&x);
	return x;
}


void outp(int i){
	printf("%d",i);
}

LL mod(LL i){
	return i % 1000000007;
}

//int homework(){
//	int N = inp();
//	int M = inp();
//	int A[M];
//	int sum = 0;
//	for(int i = 0;i < M;i++){
//		cin >> A[i];
//		sum += A[i];
//	}
//
//
//	int answer = N - sum;
//
//	if(answer < 0)
//		cout << -1<< endl ;
//	else
//		cout << answer << endl;
//
//
//	return 0;
//}
//
//int management(){
//	int N = inp();
//
//	int A[N];
//	int B[N] = {0};
//
//	for(int i = 1;i < N;i++){
//		cin >> A[i];
//		B[A[i] - 1]++;
//	}
//
//	for(int i = 0;i < N;i++){
//		cout << B[i] << "\n";
//	}
//
//	return 0;
//}

int circle_pond(){
	int R;

	cin >> R;

	cout << (double)(2*R*M_PI);

	return 0;
}
int SoLNs(){

	 LL N = inp();
	 LL K = inp();

	 LL sum = 0;

	for( LL k = K; k <= N+1;k++){

		 LL min = (k-1)*k/2;
		 LL max =  N*(N+1)/2 - (N-k)*(N-k+1)/2;


		sum = mod(sum + max - min + 1);


	}


	outp(sum);

	return 0;

}

signed main() {
	circle_pond();
	//homework();
	//management();
	//SoLNs();

	return 0;
}




Measured memory_bytes: 3756
#include <iostream>
#include <string>

int apply_operator(int op, int x1, int x2)
{
	if (op == 0)
		return x1 + x2;
	else
		return x1 - x2;
}

std::string get_op(int op)
{
	if (op == 0)
		return "+";
	else return "-";
}

int main()
{
	int A, B, C, D;
	std::string n;
	std::cin >> n;
	char buffer[2];
	buffer[1] = 0;
	buffer[0] = n.at(0);
	A = atoi(buffer);
	buffer[0] = n.at(1);
	B = atoi(buffer);
	buffer[0] = n.at(2);
	C = atoi(buffer);
	buffer[0] = n.at(3);
	D = atoi(buffer);
	int found_solution = 0;
	for (int a = 0; a <= 1; a++)
	{
		if (found_solution == 1)
			break;
		for (int b = 0; b <= 1; b++)
		{
			if (found_solution == 1)
				break;
			for (int c = 0; c <= 1; c++)
			{
				if (found_solution == 1)
					break;
				int result = apply_operator(a, A, B);
				result = apply_operator(b, result, C);
				result = apply_operator(c, result, D);
				if (result == 7)
				{
					std::cout << A << get_op(a) << B << get_op(b)
						<< C << get_op(c) << D << "=7";
					found_solution = 1;
				}
			}
		}
	}
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#define mod (998244353)
#define inv2 (499122177) 
#define N 300000
using namespace std;
typedef long long ll;
int n,s,p[N],A[N];
void fwt(int *a,int n,int ops){
	for(int mid=1;mid<n;mid<<=1)
		for(int i=0;i<n;i+=mid<<1)
			for(int j=0;j<mid;j++){
				int x=a[i+j],y=a[i+j+mid];
				a[i+j]=(x+y)%mod;
				a[i+j+mid]=(x-y+mod)%mod;
				if(ops==-1){
					a[i+j]=(1ll*a[i+j]*inv2)%mod;
					a[i+j+mid]=(1ll*a[i+j+mid]*inv2)%mod;
				}
			}
}
inline int ksm(int x,int y){
    int res=1;
	while(y){if(y&1)res=1ll*res*x%mod;x=1ll*x*x%mod;y>>=1;}
	return res;
}
int main(){
//	freopen("test.txt","r",stdin);
	cin>>n;
	for(int i=0;i<(1<<n);i++){
		scanf("%d",&p[i]);
		s=(s+p[i])%mod;
	}
	s=ksm(s,mod-2);
	
	for(int i=0;i<1<<n;i++)p[i]=(1ll*p[i]*s)%mod;
	p[0]=(p[0]+mod-1)%mod;
	
	A[0]=(1<<n)-1;
	for(int i=1;i<1<<n;i++)A[i]=mod-1;
	
	fwt(A,1<<n,1);fwt(p,1<<n,1);
	for(int i=0;i<1<<n;i++)
		A[i]=(1ll*A[i]*ksm(p[i],mod-2))%mod;
	fwt(A,1<<n,-1);
	
	for(int i=0;i<1<<n;i++)
		printf("%d\n",(A[i]-A[0]+mod)%mod);
}

Measured memory_bytes: 5812
n, w = map(int, input().split())
items = [list(map(int, input().split())) for _ in range(n)]

dp = [[0] * (w + 1) for _ in range(n + 1)]

for i in range(n):
    for j in range(w + 1):
        if j - items[i][0] >= 0:
            # 入れない時と入れる時
            dp[i + 1][j] = max(dp[i][j - items[i][0]] + items[i][1], dp[i][j])
        else:
            # 入れる時
            dp[i + 1][j] = dp[i][j]

print(dp[n][w])


Measured memory_bytes: 120044
#これでどうだ
def 解():
    iN,iM = [int(_) for _ in input().split()]
    iD = iM // iN
    if iM % iN == 0:
        print(iD)
    elif 2*iN > iM :
        print(1)
    else:
        aD = []
        iRtM = int(iM**0.5)
        if iRtM > iD:
            for i in range(iD,0,-1):
                if iM % i == 0:
                    print(i)
                    exit()
        else:
            aRet = []
            for i in range(1,iRtM+1):
                if iM % i ==0:
                    if iRtM / 2 > i:
                        aRet.append(i)
                        if iD > iM // i :
                            print (iM // i)
                            exit()
                    else:
                        print (i)
                        exit()
            print(max(aRet))
解()


Measured memory_bytes: 3064
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i = 0; i < (n); i++)
using ll = long long;
using ull = unsigned long long;
using P = pair<int,int>;
using PP = pair<int,pair<int,int>>;
using T = tuple<string,int,int>;
const string EMP = " ";
const ll INF = 1LL<<60;
const ll MOD = 1000000007;

int main(){
  int n,m; cin >> n >> m;
  vector<int> a(m);
  rep(i,m) cin >> a[i];
  if(n >= m){
    cout << 0 << endl;
    return 0;
  }
  sort(a.begin(), a.end());
  vector<int> d;
  for(int i = 1; i < m; i++) d.push_back(a[i] - a[i-1]);
  sort(d.begin(), d.end());
  int ans = 0;
  for(int i = 0; i < m-n; i++) ans += d[i];
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 4172
#include <bits/stdc++.h>
using namespace std;
int main(){
    int n,a,b;
    cin >> n >> a >> b;
    a--;b--;
    map<int,int> k;
    for(int i=0;i<n;i++){
        for(int j=i+1;j<n;j++) k[min(j-i,abs(a-i)+1+abs(j-b))]++;
    }
    for(auto i:k) cout << i.second << endl;
    for(int i=k.size();i<n-1;i++) cout << 0 << endl;
}

Measured memory_bytes: 384
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		try (Scanner scanner = new Scanner(System.in)) {
			int a = scanner.nextInt();
			int b = scanner.nextInt();
			int rankA = getRank(a), rankB = getRank(b);
			System.out.println((rankA == rankB) ? "Draw" : (rankA > rankB) ? "Alice" : "Bob");
		}
	}

	/**
	 * @param n 入力カード
	 * @return 入力カードのランク
	 */
	private static int getRank(int n) {
		return (n + 11) % 13;
	}
}


Measured memory_bytes: 21972
#include<iostream>
#include<climits>
#include<algorithm>
using namespace std;
static const int INF = 1 << 27;
static const int NIL = -1;
int dijkstra(int n, int from, int to, int dist[][100]){
	int d[100];
	bool used[100];
	fill(d, d + n, INF);
	fill(used, used + n, false);
	d[from] = 0;
	for(;;){
		int v = NIL;
		for(int u = 0; u < n; u++){
			if(!used[u] && (v == -1 || d[u] < d[v])) v = u;
		}
		if(v == NIL) break;
		used[v] = true;
		for(int u = 0; u < n; u++){
			d[u] = min(d[u], d[v] + dist[v][u]);
		}
	}
	if(d[to] == INF) return -1;
	else return d[to];
}
int main(){
	for(;;){
		int n, k;
		cin >> n >> k;
		if(n == 0 && k == 0) break;
		int dist[100][100];
		for(int i = 0; i < 100; i++){
			for(int j = 0; j < 100; j++){
				if(i == j) dist[i][j] = 0;
				else dist[i][j] = INF;
			}
		}
		for(int i = 0; i < k; i++){
			int def;
			cin >> def;
			if(def == 0){
				int a, b;
				cin >> a >> b;
				a--; b--;
				cout << dijkstra(n, a, b, dist) << endl;
			}else{
				int c, d, e;
				cin >> c >> d >> e;
				c--; d--;
				if(e < dist[c][d] && e < dist[d][c]){
					dist[c][d] = e;
					dist[d][c] = e;
				}
			}
		}
	}
	return 0;
}

Measured memory_bytes: 3112
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
#define rep2(i, x, n) for (int i = x; i < (n); ++i)
#define all(v) v.begin(), v.end()
#define mp make_pair
#define INF 1e9

void init()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout << fixed << setprecision(20);
}

int main()
{
    init();
    int n;
    long long d;
    cin>>n>>d;

    long long x,y;
    int ans=0;
    rep(i,n){
        cin>>x>>y;
        if(x*x+y*y<=d*d)ans++;
    }
    cout<<ans<<endl;
}


Measured memory_bytes: 3624
while(True):
    s = input().split()
    a,op,b = int(s[0]),s[1],int(s[2])
    if op == '+':
        print(a+b)
    elif op == '-':
        print(a-b)
    elif op == '*':
        print(a*b)
    elif op == '/':
        print(a//b)
    else:
        break


Measured memory_bytes: 5600
//
//  Go to School.cpp
//  National Olympiad in Informatics in Provinces
//
//  Created by 黄子齐 on 2019/9/28.
//  Copyright © 2019 黄子齐. All rights reserved.
//

#include <stdio.h>
const int N = 2e5+10;
int a[N];
int n, x;
int main() {
//    freopen("mytestdata.in", "r", stdin);
    scanf("%d", &n);
    for (int i=1; i<=n; i++) {
        scanf("%d", &x);
        a[x] = i;
    }
    for (int i=1; i<=n; i++) {
        printf("%d ", a[i]);
    }
    printf("\n");
    return 0;
}


Measured memory_bytes: 1152
# from math import factorial,sqrt
# from itertools import permutations as permus
# from fractions import gcd
# from collections import deque,Counter
# from decimal import Decimal, getcontext
# # getcontext().prec = 1000
# # eps = Decimal(10) ** (-100)

# import numpy as np
# import scipy as scp

# 入力の受け取り
n,d = map(int,input().split())

ans = 0
minus = 2*d +1
while n > 0:
    ans += 1
    n -= minus

print(ans)
# print("{:.10f}".format(ans))
# print(*ans)   # unpackして出力。間にスペースが入る
# for row in board:
#     print(*row,sep="")    #unpackして間にスペース入れずに出力する



Measured memory_bytes: 2940
package main
import(
  "fmt"
)
func main(){
  var n, a, i int
  ans:=1001
  fmt.Scan(&n, &a)
  x:=make([]int, n)
  y:=make([]int, n)
  for i=0;i<n;i++{
    fmt.Scan(&x[i], &y[i])
    if x[i]<ans && y[i]<=a{
      ans=x[i]
    }
  }
  if ans==1001{
    fmt.Println("TLE")
  }else{
    fmt.Println(ans)
  }
}


Measured memory_bytes: 512
#include<bits/stdc++.h>
#define pii   pair<long long int,long long int>
#define hell  1000000007
#define boost ios_base::sync_with_stdio(false);cin.tie(0); cout.tie(0)
#define pb  push_back
typedef long long  ll;
using namespace std;
const ll inf = 1LL<<60-1;
const int nax = 1e5+10;
vector<pii> v[nax];
map<ll,ll> d;
ll n,m;
void dk(int s){
   
   for(int i=1;i<=n;i++) d[i] = inf;
   
   d[s] = 0;
   priority_queue<pii, vector<pii> ,greater<pii > > pq;
   pq.push({0,s});
   
   while(!pq.empty()){
   	
   	pair<ll,ll> p = pq.top();
   	pq.pop();
   	
   	ll u = p.second, dist = p.first;
   	
   	if(dist > d[u]) continue;
   	
   	for(auto i : v[u]){
         ll vv = i.first;
		 ll oo = dist + i.second;
		 
		 if(oo < d[vv]){
		 	d[vv] = oo;
		 	pq.push({oo,vv});
		 }   		
	   }
   }
}

int main(){
   
    boost;
    
    cin >> n;
	m = n-1;
	
	for(int i=0;i<n-1;i++){
		ll a,b,c;
		cin >> a >> b >> c;
		
		v[a].pb({b,c});
		v[b].pb({a,c});
	} 
	
	int q,k; cin >> q >> k;
	
	dk(k);
	
	for(int i=0;i<q;i++){
		ll a,b;
		cin >> a >> b;
	    
	    cout << d[a]+d[b] << endl;
	}
	
   	return 0;
}

Measured memory_bytes: 16640
#include<iostream>
#include<iomanip>
#include<sstream>
#include<cstdlib>
#include<cmath>
#include<algorithm>
#include<vector>
#include<queue>
#include<map>
#include<string>
#include<numeric>
#include<set>
using namespace std;

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

  int cnt = 0;
  while(cnt*(a-1) < b-1)
    cnt++;

  cout << cnt << endl;
  
  return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define pb push_back
#define all(x) x.begin(),x.end()
#define lop(i,s,t) for(int i=s;i<(t);++i)
#define rep(i,s,t) for(int i=s;i<=(t);++i)
#define dec(i,s,t) for(int i=s;i>=(t);--i)
using namespace std; 

/*
const int P=998244353; 
int sub(int a,int b){ a-=b; return a<0?a+P:a; }
int add(int a,int b){ a+=b; return a>=P?a-P:a; } 
int mul(int a,int b){ return 1ll*a*b%P; } 
int power(int a,int k){
	int res=1; 
	for(;k;k>>=1,a=mul(a,a))if(k&1)res=mul(res,a); 
	return res;
}
*/

const int N=2e5+50; 

int n,a[N]; 
long long ans;

int main(int argc,char *argv[]){
#ifdef CURIOUSCAT
	//freopen("dat.in","r",stdin); 
#endif
	scanf("%d",&n); 
	rep(i,1,n){
		scanf("%d",a+i); 
		a[i]-=i;
	}
	sort(a+1,a+n+1); 
	int p=(n+1)/2;
	rep(i,1,n){
		ans+=abs(a[i]-a[p]); 
	}
	printf("%lld\n",ans);
}


Measured memory_bytes: 1024
#include<bits/stdc++.h>
#define IOS ios::sync_with_stdio(0), cin.tie(0)
#define RI(x) x = rit()
#define RII(a,b) a = rit(), b = rit()
#define RIII(a,b,c) a = rit(), b = rit(), c = rit()
#define REP(I, N) for(int I=0;I<(N);I++)
#define REPP(I, N) for(int I=1;I<=(N);I++)
#define SZ(x) (int)(x).size()
#define P pair<int, int>
#define F first
#define S second
#define PB(x) push_back(x)
#define endl "\n"
#define ll long long
//#define int long long

//===================================================//

#define N 100000
#define modn 1000000007

using namespace std;
inline int rit(){
    int f=0,key=1;
    char ch;
    do{
        ch = getchar();
        if(ch=='-') key=-1;
    }while(ch<'0'||ch>'9');
    do{
        f = f*10+ch-'0';
        ch = getchar();
    }while(ch>='0'&&ch<='9');
    return f*key;
}
int n, ar[N+5];
int32_t main(void){
    RI(n);
    REPP(i,n){
        RI(ar[i]);
    }
    int ans = 0;
    REPP(i,n){
        if(i==ar[i]){
            ans++;
            if(i==n) swap(ar[i], ar[i-1]);
            else swap(ar[i], ar[i+1]);
        }
    }
    printf("%d\n",ans);
	return 0;
}


Measured memory_bytes: 640
#include <bits/stdc++.h>
using namespace std;
int main()
{
	int n;
	cin>>n;
	int a[n],b[n],c[n];
	for(int i=0;i<n;i++) cin>>a[i];
	b[0]=0;//entering values of i-1
	c[0]=0;//entering values of i-2
	for(int i=1;i<n;i++)
	{
		if(i==1)
		{
			b[i]=abs(a[i-1]-a[i]);
			//cout<<b[i]<<" ";
			c[i]=b[i];
			//cout<<c[i]<<endl;
		}
		else
		{
			//cout<<"i "<<i<<endl;
			b[i]=min(b[i-1],c[i-1])+abs(a[i-1]-a[i]);
			//cout<<b[i]<<" ";
			c[i]=min(b[i-2],c[i-2])+abs(a[i-2]-a[i]);
			//cout<<c[i]<<endl;
		}
	}
	cout<<min(b[n-1],c[n-1])<<endl;
	
	
}

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

int main(){
  int n,c;
  cin >> n >>c ;
  
  long long val[n],wt[n];
  for(int i=0;i<n;i++){
 	cin >> wt[i] >> val[i] ;
  }
  
  long long  dp[n+1][c+1] ;
  
  for(int i=0;i<=n;i++){
    for(int j=0;j<=c;j++){
      if(i==0 || j==0)
        dp[i][j]=0;
      else if(wt[i-1]<=j){
        dp[i][j]=max(val[i-1]+dp[i-1][j-wt[i-1]] , dp[i-1][j]) ;
      }else{
        dp[i][j]=dp[i-1][j];
      }
      
    }
  }
  
  cout<<dp[n][c] ;
  
  return 0;
}


Measured memory_bytes: 82512
#include <iostream>
#include <climits>
#include <cmath>
using namespace std;

int solve(unsigned int E)
{
    int ans = INT_MAX;

    for (int z = 0; z * z * z <= E; ++z)
    {
        for (int y = 0; y * y <= E; ++y)
        {
            int x = (int)(E - y * y - z * z * z);

            if (x >= 0 && x + y * y + z * z * z == E)
            {
                ans = min(ans, x + y + z);
            }
        }
    }
    return ans;
}

int main()
{
    int E;
    while (cin >> E && E > 0)
    {
        cout << solve(E) << endl;
    }
}



Measured memory_bytes: 3088
#include <iostream>
#include <algorithm>
#include <string>
#include <string.h>
#include <stdlib.h>
#include <math.h>
#include <vector>
#include <queue>
#include <stack>
#include <cmath>
#include <map>
#include <iomanip>
#include <set>
using namespace std;

#define rep(i, s) for (int i = 0; i < s; ++i)
#define all(v) (v.begin(), v.end())
#define COUT(x) cout << #x << " = " << (x) << " (L" << __LINE__ << ")" << endl
#define EACH(i, s) for (__typeof__((s).begin()) i = (s).begin(); i != (s).end(); ++i)
#define VEC(a, n) vector<int>a(n)
#define PQ(a) priority_queue<int>a
#define PQmin(a) priority_queue< int, :vector<int>, greater<int> >a
#define PAIR pair<int, int>
/*
sort(sp.begin(), sp.end(), [](PAIR l, PAIR r){
        return l.first<r.first || (l.first==r.first && l.second > r.second);
        });
*/

typedef long long  ll;

#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))

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;
}

int main() {
    string s;
    cin>>s;
    int a=-1;
    int b=-1;
    int c=-1;
    int d=-1;
    int n=s.size();
    for(int i=0;i<n;i++){
        if(s.at(i)=='S'){
            a=1;
        }
        else if(s.at(i)=='N'){
            b=1;
        }
        else if(s.at(i)=='E'){
            c=1;
        }
        else{
            d=1;
        }
    }
    if(a+b==0 or c+d==0){
        cout<<"No"<<endl;
    }
    else{
        cout<<"Yes"<<endl;
    }





    return 0;
}


Measured memory_bytes: 256
# -*- coding: utf-8 -*-
# kakomon toku
import math
import sys
import itertools
import numpy as np

n = int(input())
a = [int(i) for i in input().split()]
#print(a)
ai=0
for i in range(n):
    if ai < a[i]:
        ai = a[i]
a = np.sort(a)
aj = a[0]
center = ai / 2
diff = ai
i=0
for i in range(n):
    if diff > abs(a[i] - center) :
        aj = a[i]
        diff = abs(aj - center)
    else:
        break

print(ai,aj)


Measured memory_bytes: 23112
#include <bits/stdc++.h>
using namespace std;
#define REP(i, n) for (int i = 0; i < (int)(n); i++)
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
typedef long long ll;
typedef pair<int, int> P;
const int INF = 100100100;
const int MOD = (int)1e9 + 7;
const double EPS = 1e-9;
struct Edge {
  ll to;
  ll cost;
};
int main() {
  int K, T;
  cin >> K >> T;
  vector<ll> a(T);
  REP(i, T) cin >> a[i];
  sort(a.begin(), a.end());
  ll num = 0;
  REP(i, T - 1) num += a[i];
  cout << max(a[T - 1] - 1 - num, (ll)0) << endl;
}

Measured memory_bytes: 256
N = int(input())
data = []
for i in range(N):
    data.append(list(map(int, input().split())))
if N == 1:
    prob = data[0][0] - data[0][1] - data[0][2]
    if prob < 0 or prob % 2 != 0:
        print("No")
    else:
        print("Yes")
    quit()
for i in range(N-1):
    t = data[i][0]
    x = data[i][1]
    y = data[i][2]
    deltaT = data[i+1][0] - t
    absX = abs(data[i+1][1] - x)
    absY = abs(data[i+1][2] - y)
    prob = deltaT - absX - absY
    if prob < 0 or prob % 2 != 0:
        print("No")
        quit()
print("Yes")


Measured memory_bytes: 27380
#!/usr/bin/env python3
# Generated by https://github.com/kyuridenamida/atcoder-tools
from typing import *
import itertools
import math
import sys

INF = float('inf')
YES = "Yes"  # type: str
NO = "No"  # type: str


def solve(S: str, T: str):
    return [NO, YES][len(S)+1 == len(T) and S == T[:-1]]


def main():

    sys.setrecursionlimit(10 ** 6)

    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    S = next(tokens)  # type: str
    T = next(tokens)  # type: str
    print(solve(S, T))


if __name__ == '__main__':
    main()


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


void main()
{
  int a, b;
  readf("%s %s\n", &a, &b);
  writeln((a+b)%24);
}


Measured memory_bytes: 256
#include "stdio.h"

int main(){
    int A,B,c=0,i;
    scanf("%d%d",&A,&B);
    for(i=A;i<=B;i++){
        if(i%10==i/10000&&i/10%10==i/1000%10){
            c++;
        }
    }
    printf("%d\n",c);
    return 0;
}

Measured memory_bytes: 1736
import java.util.HashSet;
import java.util.Scanner;

public class Main {

    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int X = sc.nextInt(),N = sc.nextInt();
        int min = 114514893;
        int ans = -1;
        HashSet<Integer> set = new HashSet<Integer>();
        for(int i=0;i<N;i++){
            int temp = sc.nextInt();
            set.add(temp);
        }
        for(int i=-200;i<=200;i++){
            if(set.contains(i)){
                continue;
            }
            if(Math.abs(i-X)<min){
                min = Math.abs(i-X);
                ans = i;
            }else if(Math.abs(i-X)==min&&i<ans){
                //System.out.println(ans+"ss"+i);
                ans = i;
            }
        }
        System.out.println(ans);

    }
}


Measured memory_bytes: 35692
N = int(input())
V = list(map(int,input().split()))


V.sort(reverse=True)

res = 0
for i in range(N-2):
    res += ((1/2)**(i+1))*V[i]
res += ((1/2)**(N-1))*(V[N-2]+V[N-1])
print(res)

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

// グローバル変数
ll n, k;
//vector<int> c;

// 関数プロトタイプ
void input();
void solve();
ll dev(ll);

int main(void)
{
    input();
    solve();  
}

// 標準入力
void input() {
    cin >> n >> k;
}

void solve() {
    n = n % k;
    cout << dev(n) << endl;
}

ll dev(ll cur) {
    ll ncur = abs(cur - k);
    if(cur <= ncur) {
        return cur;
    } else {
        return dev(ncur);
    }
}

Measured memory_bytes: 3556
#include <iostream>

using namespace std;

int main(){
    int n, x; cin >> n >> x;
    int ans=1;
    int d=0;
    for(int i=0; i<n; ++i){
        int l; cin >> l;
        d+=l;
        if(d<=x) ++ans;
    }
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
using namespace std;
using int64 = int64_t;
#define rep(i, n) for (int i = 0; i < (int)(n); ++i)
#define print(x) cout << (x) << '\n'

int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    
    int n, c; cin >> n >> c;
    int64 D[40][40] = {};
    int64 C[510][510] = {};

    rep(i, c){
        rep(j, c) cin >> D[i][j];
    }

    rep(i, n){
        rep(j, n) cin >> C[i][j];
    }

    int sum0[40] = {}, sum1[40] = {}, sum2[40] = {};

    for (int i = 1; i <= c; ++i){
        for (int j = 0; j < n; ++j){
            for (int k = 0; k < n; ++k){
                if ((j + k) % 3 == 0){
                    sum0[i] += D[C[j][k] - 1][i - 1];
                }
                else if ((j + k) % 3 == 1){
                    sum1[i] += D[C[j][k] - 1][i - 1];
                }
                else if ((j + k) % 3 == 2){
                    sum2[i] += D[C[j][k] - 1][i - 1];
                }
            }
        }
    }

    int ans = 1e9;

    for (int i = 1; i <= c; ++i){
        for (int j = 1; j <= c; ++j){
            for (int k = 1; k <= c; ++k){
                if (i != j && j != k && k != i){
                    ans = min(ans, sum0[i] + sum1[j] + sum2[k]);
                }
            }
        }
    }

    print(ans);
    
    return 0;
}


Measured memory_bytes: 2304
/* C++14 (Clang 3.8.0) for AtCoder */

#include <iostream>
#include <vector>
#include <string>
// #include <cmath>
// #include <math.h>
// #include <map>
// #include <algorithm>

namespace AtCoder {
	using Str = std::vector<std::string>;
	using Num = std::vector<int>;

	class Ans {
	public:
		void showResult(void);
		void increment(void);
		void increment(double);
		void decrement(void);
		void decrement(double);
		double getResult(void);
	private:
		double result;
	};
	void Ans::showResult(void) {
		printf("%.0lf\n", this->result);
	}
	void AtCoder::Ans::increment(void) {
		this->result++;
	}
	void AtCoder::Ans::increment(double value) {
		this->result += value;
	}
	void AtCoder::Ans::decrement(void) {
		this->result--;
	}
	void AtCoder::Ans::decrement(double value) {
		this->result -= value;
	}
	double AtCoder::Ans::getResult(void) {
		return this->result;
	}

	void input(Str* str) {
		str->clear();
		std::string buf = "", row = "";
		std::getline(std::cin, buf);
		for (unsigned int i = 0; i < buf.size(); i++) {
			if (' ' == buf[i]) {
				str->push_back(row);
				row = "";
			} else {
				row += buf[i];
			}
		}
		str->push_back(row);
	}
	void input(Num* num) {
		num->clear();
		std::string buf = "", row = "";
		std::getline(std::cin, buf);
		for (unsigned int i = 0; i < buf.size(); i++) {
			if (' ' == buf[i]) {
				num->push_back(std::atoi(row.c_str()));
				row = "";
			} else {
				row += buf[i];
			}
		}
		num->push_back(std::atoi(row.c_str()));
	}
	void exp(std::string* str,  Str* newStr) {
		std::string pre = *str;
		newStr->clear();
		for (unsigned int i = 0; i < pre.length(); i++) {
			newStr->push_back(pre.substr(i, 1));
		}
	}
}

int main(void) {

	AtCoder::Str s;
	AtCoder::input(&s);

	if ("SUN" == s[0]) {
		printf("7\n");
	}
	if ("MON" == s[0]) {
		printf("6\n");
	}
	if ("TUE" == s[0]) {
		printf("5\n");
	}
	if ("WED" == s[0]) {
		printf("4\n");
	}
	if ("THU" == s[0]) {
		printf("3\n");
	}
	if ("FRI" == s[0]) {
		printf("2\n");
	}
	if ("SAT" == s[0]) {
		printf("1\n");
	}

	return 0;
}


Measured memory_bytes: 888
program probB
  implicit none
  integer n,d,x
  integer i,j,k,ans
  integer a(1:100)
  

  read(*,*) n
  read(*,*) d,x
  
  do i=1,n
     read(*,*) a(i)
  end do

  ans = 0
  do i=1,n
     j=0
     do while(j*a(i)+1<=D)
        ans = ans + 1
        j=j+1
     end do
  end do
    
  write(*,*) ans+x
  
   
end program probB



Measured memory_bytes: 768
import java.util.*;

public class Main{
    static long[] last = new long[26];
    static long[] c = new long[26];
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int d = sc.nextInt();
        long[][] s = new long[d+1][26];

        for(int i=0; i<26; i++) {
            c[i] = sc.nextLong();
        }

        for(int i=1; i<=d; i++) {
            for(int j=0; j<26; j++) {
                s[i][j] = sc.nextLong();
            }
        }

        for(int i=1; i<=d; i++) {
            int index = select(s[i], i);
            System.out.print(index);
            if(i!=d) {
                System.out.print("\n");
            }
        }
    }

    public static int select(long[] s, int day) {
        long[] score = new long[26];
        int index = 0;
        long max = -1000000000;
        for(int i=0; i<26; i++) {
            score[i] = s[i];
            for(int j=0; j<26; j++) {
                if(i!=j) {
                    score[i] -= c[j]*(day-last[i]);
                }
            }

            if(score[i]>max) {
                index = i;
                max = score[i];
            }
        }
        return index+1;
    }
}

Measured memory_bytes: 46940
#include <iostream>
#include <algorithm>

using namespace std;

int main(){
    long A, B, Q;
    long s[100002];
    long t[100002];
    cin >> A >> B >> Q;
    s[0] = -10e+17;
    s[A+1] = 10e+17;
    t[0] = -10e+17;
    t[B+1] = 10e+17;
    for(int i = 0; i < A; i++){
        cin >> s[i+1];
    }
    for(int i = 0; i < B; i++){
        cin >> t[i+1];
    }
    sort(s, s+A+2);
    sort(t, t+B+2);
    for(int i = 0; i < Q; i++){
        long x;
        cin >> x;
        long *sl = lower_bound(s, s+A+2, x);
        long *tl = lower_bound(t, t+B+2, x);
        //cout << *sl << ' ' << *tl << endl;
        if(*sl-x < x-*(sl-1)){
            if(*tl-x < x-*(tl-1)){
                cout << max(*tl-x, *sl-x) << endl;
            }else{
                cout << min((x-*(tl-1))+(*sl-x)+min((x-*(tl-1)), (*sl-x)), min(max(x-*(tl-1), x-*(sl-1)), max(*tl-x, *sl-x))) << endl;
            }
        }else{
            if(*tl-x >= x-*(tl-1)){
                cout << max(x-*(tl-1), x-*(sl-1)) << endl;
            }else{
                cout << min((*tl-x)+(x-*(sl-1))+min((*tl-x), (x-*(sl-1))), min(max(x-*(tl-1), x-*(sl-1)), max(*tl-x, *sl-x))) << endl;
            }
        }
    }
}

Measured memory_bytes: 2944
#include <bits/stdc++.h>
typedef long long ll;
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define REP(i,a) FOR(i,0,a)
	
using namespace std;
const int MAX_N=300;
int N;
ll A[MAX_N][MAX_N];
int main(){
	cin>>N;
	REP(i,N){REP(j,N){
		cin>>A[i][j];
	}}
	bool flg=true;
	REP(u,N){
		REP(v,N){
			REP(w,N){
				if (A[u][v]>A[u][w]+A[w][v]){
					flg=false;
				}
			}
		}
	}
	if (flg){
		ll sm=0;
		REP(u,N){
			FOR(v,u+1,N){
				bool f=true;
				REP(w,N){
					if (w==u || w==v)continue;
					if (A[u][v]==A[u][w]+A[w][v]){
						f=false;
					}
				}
				if (f){
					sm+=A[u][v];
				}
			}
		}
		cout<<sm<<endl;
	}else{
		cout<<-1<<endl;
	}
	return 0;
}

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

struct node{
  struct node *right;
  struct node *left;
  struct node *parent;
  int key;
};

typedef struct node * Node;
#define NIL NULL

void inorder(Node);
void preorder(Node);
void insert(int);

Node root;

int main(){
  int n, i, x;
  char com[20];
  
  scanf("%d", &n);

  for(i = 0; i < n; i++){
    scanf("%s", com);
    if ( com[0] == 'i' ){
      scanf("%d", &x);
      insert(x);
    }
    else if(com[0] == 'p' ){
      inorder(root);
      printf("\n");
      preorder(root);
      printf("\n");
    } 
  }

  return 0;
}


void insert(int k){
  Node y = NIL;
  Node x = root;
  Node z;

  z = malloc(sizeof(struct node));
  z->key = k;
  z->left = NIL;
  z->right = NIL;

  while(x != NIL){
    y = x; // 親を設定
    if(z->key < x->key){
      x = x->left;
    }// 左の子へ移動
    else{
      x = x->right;
    }// 右の子へ移動
  }
  z->parent = y;

  if(y == NIL){ // T が空の場合
    root = z;
  }
  else if(z->key < y->key){
    y->left = z;
  }// z を y の左の子にする
  else{
    y->right = z;
  }// z を y の右の子にする
}

void inorder(Node u){
  if(u->left != NIL) inorder(u->left);
 
  printf(" %d",u->key);

  if(u->right != NIL) inorder(u->right);
}

void preorder(Node u){
  printf(" %d",u->key);

  if(u->left != NIL) preorder(u->left);
  if(u->right != NIL) preorder(u->right);
}



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

#define EACH(i, a) for (auto &&i : a)
#define FOR(i, a, b) for (int i = (int)a; i < (int)b; ++i)
#define RFOR(i, a, b) for (int i = (int)b - 1; i >= (int)a; --i)
#define REP(i, n) FOR(i, 0, n)
#define REPS(i, n) FOR(i, 1, int(n) + 1)
#define RREP(i, n) RFOR(i, 0, n)
#define RREPS(i, n) RFOR(i, 1, int(n) + 1)
#define ALL(x) (x).begin(), (x).end()
#define MEMSET(v, h) memset((v), h, sizeof(v))
#define debug(x) cout << #x << ": " << x << endl

#define pb push_back
#define mp make_pair
#define F first
#define S second

#define y0 y3487465
#define y1 y8687969
#define j0 j1347829
#define j1 j234892
#define next asdnext
#define prev asdprev
#define INF (1L << 30)
#define MOD (1000000007)
int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};

template <class T>
void pv(T a, T b) {
  for (T i = a; i != b; ++i) cout << *i << " ";
  cout << endl;
}
template <class T>
void pvp(T a, T b) {
  for (T i = a; i != b; ++i)
    cout << "(" << i->first << ", " << i->second << ") ";
  cout << endl;
}
template <class T>
bool chmax(T &a, const T &b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T>
bool chmin(T &a, const T &b) {
  if (b < a) {
    a = b;
    return 1;
  }
  return 0;
}
int in() {
  int x;
  scanf("%d", &x);
  return x;
}

using ll = long long;
#define int ll

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

  int n, l;
  cin >> n >> l;

  int A[100010];
  MEMSET(A, 0);

  int maxI = -1;

  REP(i, n) {
    int a;
    cin >> a;
    A[i] = a;
  }
  REP(i, n - 1) {
    int sumTwo = A[i] + A[i + 1];
    if (sumTwo >= l) {
      maxI = i + 1;
      break;
    }
  }

  if (maxI == -1) {
    cout << "Impossible" << endl;
  } else {
    cout << "Possible" << endl;
    FOR(i, 1, maxI) { cout << i << endl; }
    RFOR(i, maxI, n) { cout << i << endl; }
  }

  return 0;
};


Measured memory_bytes: 1664
while True:
    no = {}
    n = int(input())
    if (n == 0):
        break
    
    for i in range(n):
        datas = map(int, input().split())
        li = list(datas) 
        e = li[0]
        p = li[1]
        q = li[2]

        s = p * q
        if (e not in no):
            no[e] = s
        else:
            no[e] += s

    na = True    
    for k in no.keys():
        if (1000000 <= no[k]):
            print(k)
            na = False
    
    if (na == True):
        print("NA")
    




Measured memory_bytes: 5776
s = input()
strong = True
for i in range(int(len(s)/2)):
  if s[i] != s[len(s)-1-i]:
    strong = False
p = int((len(s)-1)/2)
for i in range(int(p/2)):
  if s[i] != s[p-1-i]:
    strong = False
if len(s) >= 5:
  q = int((len(s)+3)/2)
  for i in range(len(s)-q):
    if s[q+i-1] != s[len(s)-1-i]:
      strong = False
if strong == True:
  print('Yes')
else:
  print('No')

Measured memory_bytes: 38384
N, K = map(int, input().split())
A = [int(x) for x in input().split()]

B = [0] * (N + 1)
for i in range(N):
    B[A[i]] += 1
B = [x for x in sorted(B, reverse=True) if x > 0]

ans = 0
while len(B) - K > 0:
    ans += B.pop()
print(ans)


Measured memory_bytes: 25748
#include<stdio.h>
int main()
{
    int a,b;
    scanf("%d%d",&a,&b);
    {
        if(a>b)
            printf("a > b\n");
        else if(b>a)
            printf("a < b\n");
        else
            printf("a == b\n");
        return 0;
    }
}



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

using namespace std;
using ll = long long;
using P = pair<int, int>;

const int INF = 1001001001;
const vector<int> di = {-1,  0, 1, 0};
const vector<int> dj = { 0, -1, 0, 1};

void chmin(int &a, int b) { if (a > b) a = b; }

ll GCD(ll a, ll b) {
    if (b == 0) return a;
    else return GCD(b, a % b);
}
ll LCM(ll a, ll b) { return a * b / GCD(a, b); }


int main(){
    int H, W;
    cin >> H >> W;
    vector<string> S(H);

    rep(i, H) cin >> S[i];

    vector<vector<int>> cnt(H, vector<int>(W, 0));

    rep(i, H) {
        vector<int> done(W);
        rep(j, W) {
            if (S[i][j] == '#') continue;
            if (done[j]) continue;
            int l = 0;
            while ((j+l) < W) {
                if (S[i][j+l] == '#') break;
                ++l;
            }
            rep(k, l) {
                cnt[i][j+k] += l;
                done[j+k] = 1;
            }
        }
    }
    rep(j, W) {
        vector<int> done(H);
        rep(i, H) {
            if (S[i][j] == '#') continue;
            if (done[i]) continue;
            int l = 0;
            while ((i+l) < H) {
                if (S[i+l][j] == '#') break;
                ++l;
            }
            rep(k, l) {
                cnt[i+k][j] += l;
                done[i+k] = 1;
            }
        }
    }
    int ans = 0;
    rep(i, H)rep(j, W) {
        ans = max(ans, cnt[i][j] - 1);
    }
    cout << ans << endl;
}

Measured memory_bytes: 20096
#include <iostream>

 

using namespace std;

 

int main()
{
    int i, h, m, s;
    cin >> i;
    h = i / 3600;
    m = (i % 3600) / 60;
    s = i % 60; 
    cout << h << ":" << m << ":" << s << endl; 
    
    return 0;
}


Measured memory_bytes: 3088
#include <algorithm>
#include <bitset>
#include <tuple>
#include <cstdint>
#include <cstdio>
#include <cctype>
#include <assert.h>
#include <stdlib.h>
#include <stdio.h>
#include <cassert>
#include <cfloat>
#include <climits>
#include <cmath>
#include <complex>
#include <ctime>
#include <deque>
#include <fstream>
#include <functional>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <list>
#include <limits>
#include <map>
#include <memory>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>
#include <math.h>

// ===============================================================

using namespace std;
using ll = long long;
using vl = vector<long long>;
using vll = vector<vector<long long>>;
using vs = vector<string>;
using vc = vector<char>;
using vcc = vector<vector<char>>;
using vm = vector<short>;
using vmm = vector<vector<short>>;
using pii = pair<int, int>;
using psi = pair<string, int>;
using ld = long double;
using ull = unsigned long long;

// ===============================================================

ll gcd(ll a, ll b)
{
	if (a % b == 0)
	{
		return(b);
	}
	else
	{
		return(gcd(b, a % b));
	}
}
//最大公約数
ll lcm(ll a, ll b)
{
	return a * b / gcd(a, b);
}
//最小公倍数
ll box(double a) 
{
	ll b = a;
	return b;
}
//切り捨て
ll fff(double a) 
{
	ll b = a + 0.5;
	return b;
}
//四捨五入
ll sum(ll n) { 
	return (1 + n) * n / 2;
}
//1から整数nまでの合計
bool prime(ll a)//素数判定、primeならtrue,違うならfalse
{
	if (a < 2) return false;
	else if (a == 2) return true;
	else if (a % 2 == 0) return false;
	double sqrtNum = sqrt(a);
	for (int i = 3; i <= sqrtNum; i += 2)
	{
		if (a % i == 0)
		{
			return false;
		}
	}

	// 素数である
	return true;
}
//素数判定

// ===============================================================

int main() {
	ll n; cin >> n;
	ll q; cin >> q;
	string a;
	cin >> a;
	vl x(q);
	vl y(q);
	for (int i = 0; i < q; i++) {
		cin >> x[i] >> y[i];
	}
	vector<ll> dataa(n);
	vector<ll> datab(n);
	ll count = 0;
	for (int i = 0; i < n - 1; i++) {
		if (a.substr(i, 2) == "AC") {
			count++;
			dataa[i] = count;
			datab[i + 1] = count;
		}
		else {
			dataa[i] = datab[i + 1] = count;
		}
	}
	for (int i = 0; i < q; i++) {
		cout << datab[y[i] - 1] - datab[x[i] - 1] << endl;
	}
}

Measured memory_bytes: 6612
#include <bits/stdc++.h>
#define REP(i,n) for (int i=0;i<(n);i++)

using namespace std;
const long long INF = 1e+18;
int main(){
  int N;
  cin >> N;
  vector<long long> a(N);
  REP(i,N){
    cin >> a[i];
  }
  REP(i,N - 1){
    a[i + 1] += a[i];
  }
  long long ans = INF;
  REP(i,N - 1){
    ans = min(llabs((a[N - 1] - a[i]) - a[i]), ans);
  }
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 1792
#include<iostream>
#include<string>
#include<vector>
#include<numeric>
#include<algorithm>
#include<cmath>
#include<map>

using namespace std;

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

int main(){

    unsigned long long A, B, C, D;
    cin >> A >> B >> C >> D;

    unsigned long long i;
    unsigned long long ans;

    unsigned long long diff = B - A + 1;
    unsigned long long a, b, ab;

    if(C > D){
        unsigned long long tmp = C;
        C = D;
        D = tmp;
    }

    unsigned long long CD = ((C * D) / gcd(C, D));

    a = ((A - 1) / C + (A - 1) / D - (A - 1) / CD);
    b = B / C + B / D - B / CD;

    ab = b - a;

    ans = B - A + 1 - ab;


    cout << ans << endl;

    return 0;
}



Measured memory_bytes: 256
#include<stdio.h>
 
int main(void){
 
  int i;
  char c;
  scanf("%c", &c);
 
  if((c>= 'a') && (c<='z')){
    printf("a\n");
  }
  else{
    printf("A\n");
  }
 
  return 0;
}


Measured memory_bytes: 1576