akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
 
using namespace std;
typedef long long ll;

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

    switch (D) {
        case 0:
            if (N != 100) {
                cout << N;
            } else {
                cout << 101;
            }
            break;
        case 1:
            if (N != 100) {
                cout << N*100;
            } else {
                cout << 101*100;
            }
            break;
        case 2:
            if (N != 100) {
                cout << N*10000;
            } else {
                cout << 101*10000;
            }
            break;
        default:
            break;
    }

    return 0;
}


Measured memory_bytes: 256
#include <iostream>

using namespace std;

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

	int a;
	int n_zero = 0;
	int n_one = 0;
	for (int i = 0; i < n; i++) {
		cin >> a;
		a % 2 == 0 ? n_zero++ : n_one++;
	}

	long long ans;
	if (n_one == 0) {
		ans = p == 1 ? 0 : 1LL << n;
	} else {
		ans = 1LL << (n - 1);
	}

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


Measured memory_bytes: 256
#include<iostream>
#include<cstdio>
#include<queue>
#define MN 1000000
#define mod 1000000007
using namespace std;
inline int read()
{
    int x=0,f=1;char ch=getchar();
    while(ch<'0'||ch>'9'){if(ch=='-')f=-1;ch=getchar();}
    while(ch>='0'&&ch<='9'){x=x*10+ch-'0';ch=getchar();}
    return x*f;
}
int n,f[MN+5],g[MN+5],v,ans;
inline void R(int&x,int y){x+=y;x>=mod?x-=mod:0;}
int main()
{
    n=read();f[1]=1;
    for(int i=1;i<=n;++i)
    {
        R(g[i],v);R(v,f[i-1]);R(ans,1LL*f[i]*(i==n?n-1:1LL*i*n%mod)%mod);
        R(f[i+1],g[i]);R(f[i+1],f[i]);
        R(ans,1LL*g[i]*(n-1)%mod);
    }
    R(ans,f[n+1]);R(ans,g[n+1]);
    printf("%d",ans);
    return 0;
}


Measured memory_bytes: 8064
import java.util.*;
import java.util.regex.Pattern;
public class Main {
	final int INF = 1 << 24;
	private void doit(){
		Scanner sc = new Scanner(System.in);
		while(true){
			int n = sc.nextInt();
			if(n == 0) break;
			String [] data = new String[n];
			int index = 0;
			for(int i=0; i < n; i++){
				data[index] = sc.next();
				//duplicate check
				for(int j = index-1 ; j >= 0; j--){
					boolean p1 = Pattern.matches(".*"+data[index]+".*",data[j]);
					boolean p2 = Pattern.matches(".*"+data[j]+".*",data[index]);
					boolean p3 = data[j].equals(data[index]);
					if(p3){
						
					}
					else if(p1){
						index--;
						break;
					}
					else if(p2){
						for(int k = j + 1; k <= index; k++){
							data[k-1] = data[k];
						}
						index--;
					}
				}
				index++;
			}
			n = index;
			int len = 1 << n;
			int [][] dp = new int[n][len];
			String [][] dpStr = new String[n][len];
			for(int i =0; i < n; i++){
				Arrays.fill(dp[i], INF);
				Arrays.fill(dpStr[i], "");
			}
			for(int i = 0; i < n; i++){
				dp[i][1 << i] = data[i].length();
				dpStr[i][1 << i] = data[i];
			}

			for(int i = 0; i <len; i++ ){
				for(int j = 0; j < n;j++){
					if(dp[j][i] == INF) continue;
					for(int k = 0; k < n; k++){
						if((i & (1 << k)) != 0) continue;
						int ind = i | (1 << k);
						int addlen = getlen(data[j],data[k]);
						int klen = data[k].length();
						int value = addlen + dp[j][i];
						if(dp[k][ind] > value){
							dp[k][ind] = value;

							String addStr = data[k].substring(klen - addlen, klen);
							dpStr[k][ind] = dpStr[j][i] + addStr;
						}
						else if(dp[k][ind] != INF && dp[k][ind] == value){
							String addStr = data[k].substring(klen - addlen, klen);
							String nextStr = dpStr[j][i] + addStr;
							if(dpStr[k][ind].compareTo(nextStr) > 0){
								dpStr[k][ind] = nextStr;
							}

						}
					}
				}
			}
			int ans = INF;
			String str = "";
			for(int i=0; i < n; i++){
				if(ans > dp[i][len-1]){
					ans = dp[i][len-1];
					str = dpStr[i][len-1];
				}
				else if(ans != INF && ans == dp[i][len-1]){
					if(str.compareTo(dpStr[i][len-1]) > 0){
						str = dpStr[i][len-1];
					}
				}
			}
			System.out.println(str);

		}
	}
	private int getlen(String a, String b) {
		int res=b.length(),i = 0;
		StringBuilder sb = new StringBuilder();
		for(i=0; i < b.length() && i < a.length();i++){
			sb.append("" + b.charAt(i));
			if(a.endsWith(sb.toString())){
				res = b.length() - i- 1;
			}
		}
		return res;
	}
	public static void main(String[] args) {
		Main obj = new Main();
		obj.doit();
	}
}

Measured memory_bytes: 16000
import sys
N = int(sys.stdin.readline())
A = list(map(int, sys.stdin.readline().split()))
maxA = max(A)
L=[0 for _ in range(9)]
for a in A:
    if a <=399:
        L[0]+=1
    elif a <=799:
        L[1]+=1
    elif a <=1199:
        L[2]+=1
    elif a <=1599:
        L[3]+=1
    elif a <=1999:
        L[4]+=1
    elif a <=2399:
        L[5]+=1
    elif a <=2799:
        L[6]+=1
    elif a <=3199:
        L[7]+=1
    else:
        L[8]+=1
cnt=0
for i in range(8):
    if L[i] !=0:
        cnt+=1
if cnt==0 and L[8]!=0:
    Min =1
else:
    Min = cnt
print(Min, cnt+L[8])

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

int main() {
  int A, B, H, M;
  double pi = 3.14159265358979;
  cin >> A >> B >> H >> M;
  /*
  cout << M*6-H*30 << endl;
  cout << cos(M*pi/30 - H*pi/6) << endl;
  cout << A*A + B*B
       - 2*A*B*cos(M*pi/30 - H*pi/6) << endl;
  */  
    if (M*pi/30 - H*pi/6 > pi 
        && M*pi/30 - H*pi/6 < -pi) {
      cout << fixed << setprecision(10) 
       << sqrt(A*A + B*B
       + 2*A*B*cos(11*M*pi/360 - H*pi/6)) << endl;
    }
    else {
      cout << fixed << setprecision(10) 
       << sqrt(A*A + B*B
       - 2*A*B*cos(11*M*pi/360 - H*pi/6)) << endl;
    }
    
  
}

Measured memory_bytes: 4192
#include <bits/stdc++.h>
#define rep(i, a, b) for(int i = a; i < b; i++)
#define Rep(i, a, b) for(int i = a; i <= b; i++)
#define _GLIBCXX_DEBUG
#define Vl vector<ll>
#define Vs vector<string>
#define ll long long
#define ALL(v) (v).begin(),(v).end()
using namespace std;

const double pie = acos(-1.0);

// 最大公約数
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);
}

//素数判定
bool is_prime(const unsigned n){
    switch(n){
        case 0: // fall-through
        case 1: return false;
        case 2: // fall-through
        case 3: return true;
    } // n > 3 が保証された
    if(n % 2 == 0 || n % 3 == 0) return false;
    for(unsigned i = 5; i * i <= n; i += 6) {
        if(n % i     == 0) return false; // (6の倍数)-1
        if(n % (i+2) == 0) return false; // (6の倍数)+1
    }
    return true;
}

void solve() {
    ll n; cin >> n;
    Vl a(n);
    rep(i, 0, n) cin >> a[i];
    sort(ALL(a), greater<ll>());
    int f = 0;
    ll ans = 1;
    rep(i, 1, n){
        if(a[i] == a[i-1]){
            ans *= a[i];
            a[i] = -1;
            f++;
        }
        if(f == 2) break;
    }
    if(f == 2) cout << ans << endl;
    else cout << 0 << endl;
}

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

    solve();
    return 0;
}


Measured memory_bytes: 1024
#include<cstdio>
#include<iostream>
#include<ctype.h>
#include<string>
using namespace std;
int main(){
	int N, X, coor = 0, count = 1;
	cin >> N >> X;
	int L[N];
	for(int i = 0; i < N; i++){
		cin >> L[i]; 
		coor += L[i];
		if(coor <= X){
			count++;
		}
		else{
			break;
		}
	}
	cout << count << endl;
	return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<cstdio>
#include<cmath>
#include<algorithm>
#include<cstring>
#include<string>
#include<vector>
#include<map>  
#include<set>
#include<iterator>
#include<list>
#include<utility>
#include<cstdlib>
#include<queue>
#include<stack>
#include<bitset>
//#include<bits/stdc++.h>
#define PI  2*acos(0.0)
#define pb push_back

       
using namespace std;
using ll = long long;
using lli = long long int;
using ld = long double;



int main()
{
ios_base::sync_with_stdio(0);
cin.tie(0), cout.tie(0);

ll s=0;
string n;
cin>>n;

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


if(s%9==0) cout<<"Yes"<<"\n";
else cout<<"No"<<endl;

//cout<<s;
	
	return 0;
	
	
	       /***Israil Hosen
	            Computer Science & Engineering
	         University Of Rajshahi.
	         ***/
	
	
	
}

Measured memory_bytes: 3380
#include<bits/stdc++.h>
#define rep(i, n) for(int i=0;i<(n);++i)
#define per(i, n) for(int i=(n)-1;i>=0;--i)
#define repa(i, n) for(int i=1;i<(n);++i)
#define foreach(i, n) for(auto &i:(n))
#define pii pair<int, int>
#define pll pair<long long, long long>
#define all(x) (x).begin(), (x).end()
#define bit(x) (1ll << (x))
using namespace std;
using ll = long long;
const ll MOD = (ll)1e9+7;
//const ll MOD = 998244353;
//const ll MOD = 924844033;
const int INF = (ll)1e9+7;
const ll INFLL = (ll)1e18;
const double EPS = 1e-5;
using namespace std;
template<class t>
using vvector = vector<vector<t>>;
template<class t>
using vvvector = vector<vector<vector<t>>>;
template<class t>
using priority_queuer = priority_queue<t, vector<t>, greater<t>>;
template<class t, class u> bool chmax(t &a, u b){if(a<b){a=b;return true;}return false;}
template<class t, class u> bool chmin(t &a, u b){if(a>b){a=b;return true;}return false;}

#ifdef DEBUG
#define OUTPUT(x) (output(x), outendl())
#else
#define OUTPUT(x) (void)0
#endif

ll modpow(ll x, ll b){
	ll res = 1;
	while(b){
		if(b&1)res = res * x % MOD;
		x = x * x % MOD;
		b>>=1;
	}
	return res;
}

ll modinv(ll x){
	return modpow(x, MOD-2);
}

bool was_output = false;
template<class t>
void output(t a){
	if(was_output)cout << " ";
	cout << a;
	was_output = true;
}
void outendl(){
	was_output = false;
	cout << endl;
}

ll n;
vector<pll> line;

int main(){
	cin >> n;
	line.resize(n);

	foreach(i,line){
		cin >> i.first >> i.second;
	}

	sort(all(line),[](pll a,pll b){
			return a.first + a.second < b.first + b.second;
			});
	ll mp = -INFLL;
	int ans = 0;
	foreach(i,line){
		if(mp > i.first-i.second){
			++ans;
		}else{
			mp = i.first + i.second;
		}
	}
	cout << n - ans << endl;
	return 0;
}


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

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

   int a[10000];
   for(int i=0;i<n;i++) cin>>a[i];

   int mn = a[0], mx = a[0];
   long long sum = 0;
   for(int i=0;i<n;i++){
     mn = min(mn, a[i]);
     mx = max(mx, a[i]);
     sum += a[i];
    }

   cout<<mn<<" "<<mx<<" "<<sum<<endl;

   return 0;
}


Measured memory_bytes: 3120
#include<bits/stdc++.h>
#define rep(i,n) for(int i = 0; i < int(n); i++)
#define vi vector<int>
#define all(x) (x).begin(),(x).end()
#define INF (1<<30)-1
using ll = long long;
using namespace std;
const int dx[] = {-1, 0, 1, 0};
const int dy[] = {0, 1, 0, -1};
template<class T> inline bool chmax(T &a, const T &b){ if(a<b) { a=b; return 1; } return 0; }
template<class T> inline bool chmin(T &a, const T &b){ if(b<a) { a=b; return 1; } return 0; }

int main(){
  cin.tie(0), ios::sync_with_stdio(false);
  int n,m; cin >> n >> m;
  ll ans = 0;
  for(ll i = 1; i*i <= m; i++){
    if(m % i == 0){
      ll j = m/i;
      if(i * n <= m) chmax(ans,i);
      if(j * n <= m) chmax(ans,j);
    }
  }
  cout << ans;
  cout << "\n";
  return 0;
}


Measured memory_bytes: 3580
#include<iostream>
#include<algorithm>
#include<vector>
#include<queue>
#include<stack>
#include<string>
#include<map>
#include<set>
#include<tuple>
#include<cmath>
#include<iomanip>


#define MOD 1000000007
#define INF 1001001001
#define MIN -1001001001
#define rep(i,k,N) for(int i=k;i<N;i++)
#define MP make_pair
#define MT make_tuple //tie,make_tuple は別物
#define PB push_back
#define PF push_front
#define all(x) (x).begin(),(x).end()


using namespace std;
typedef long long ll;
typedef vector<ll> v;
typedef vector<vector<ll>> vv;

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

int main(){
    ll N;
    cin>>N;
    v A(N);
    map<ll,ll> m;
    map<ll,bool> ok;
    rep(i,0,N)cin>>A[i];
    rep(i,0,N){
        A[i]-=i;
        m[A[i]]++;
    }
    ll ans = 0;
    rep(i,0,N){
        m[A[i]]--;
        ans+=m[-(A[i]+i)-i];
    }
    cout<<ans;
    return 0;
}

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

int main(){
  int n;
  int a[100];
  int min = 999;
  int max = -1;
  
  cin >> n;
  
  for(int i = 0; i < n; i++){
    
    cin >> a[i];
    
    if(a[i] < min) min = a[i];
    if(a[i] > max) max = a[i];
  }
  cout << max - min << endl;
}

Measured memory_bytes: 256
#include<stdio.h>
#include<string>
#include<string.h>
#include<utility>
#include<iostream>
#include<queue>
#include<math.h>
#include<algorithm>
#include<vector>
#include<map>
#include<stack>
#include<bitset>
#include<tuple>

using namespace std;
typedef long long ll;
#define REP(i,n) for(int i=0;i<(int)(n);i++)

int main(){
    int a,b;
    scanf("%d%d",&a,&b);
    int x,num;
    if(a>b){x=b;num=a;}
    else{x=a;num=b;}
    REP(i,num)printf("%d",x);
    printf("\n");
    return 0;
}

Measured memory_bytes: 256
<?php
//error_reporting(0);
//$N = trim(fgets(STDIN));
list($A,$B,$C) = explode(" ",trim(fgets(STDIN)));
//$P = array_map('intval',explode(" ",trim(fgets(STDIN))));
//function chmax(&$a,$b) {if ($a<$b){$a=$b;return true;}return false;}
//function chmix(&$a,$b) {if ($a>$b){$a=$b;return true;}return false;}

if ($A==$B && $B!=$C) {
  printf("Yes\n");
  exit;
}
if ($A==$C && $B!=$C) {
  printf("Yes\n");
  exit;
}
if ($B==$C && $A!=$C) {
  printf("Yes\n");
  exit;
}
printf("No\n");


Measured memory_bytes: 4728
from collections import deque

N, M = map(int, input().split())
G = [[] for i in range(N)]
for i in range(M):
    a, b = map(int, input().split())
    a -= 1
    b -= 1
    G[a].append(b)
    G[b].append(a)
q = deque()
done = [-1]*N
def bfs(fr, now):
    done[now] = fr
    for to in G[now]:
        if done[to] != -1: continue
        q.appendleft((now, to))
q.appendleft((0, 0))
while q:
    fr, now = q.pop()
    if done[now] == -1:
        bfs(fr, now)
print("Yes")
for fr in done[1:]:
    print(fr+1)


Measured memory_bytes: 39936
#include "bits/stdc++.h"

using namespace std;

void solve()
{
	int n;
	long x;
	cin >> n >> x;
	vector<long> as(n);
	long ans = 0;
	for (int i = 0; i < n; i++)
	{
		cin >> as[i];
		ans += as[i];
	}

	for (int i = 1; i < n; i++)
	{
		long tmp = i*x;
		vector<long> bs = as;
		for (int j = 0; j < n; j++)
		{
			bs[j] = min(bs[j], as[(j-1+n)%n]);
			tmp += bs[j];
		}
		ans = min(ans, tmp);
		swap(as, bs);
	}
	cout << ans << endl;
}

int main()
{
	solve();
	//cout << "yui(*-v・)yui" << endl;
	return 0;
}


Measured memory_bytes: 256
import java.util.*;
import java.util.Scanner;
public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		
		int k = scan.nextInt();
		int n = scan.nextInt();
		int a[] = new int[n];
		int dis[] = new int[n];
		int ans = 0;
		for(int i=0;i<n;i++) {
			a[i] = scan.nextInt();
		}
		
		for(int i=0;i<n;i++) {
			if(i!=n-1) {
				dis[i] = a[i+1]-a[i];
			}else {
				dis[i] = a[0]+k-a[i];
			}
		}
		
		Arrays.sort(dis);
		
		for(int i=0;i<n-1;i++) {
			ans += dis[i];
		}
		
		System.out.println(ans);
	}	
	
	
	//最小公約数
	/*
	static int gcd (int a, int b) {
		int temp;
		while((temp = a%b)!=0) {
			a = b;
			b = temp;
		}
		return b;
	}
	*/
	
	//入れ替え
	/*
	static int swap (int a, int b) {
		int swap_arr[] = new int[2];
		
		swap[0] = b;
		swap[1] = a;
		
		return swap_arr;
	}
	*/
	
}


Measured memory_bytes: 65976
//INCLUDE
//------------------------------------------
#include <bits/stdc++.h>
//DEFINE
//------------------------------------------
#define ll long long
#define ld long double
#define ALLv(a)  (a).begin(),(a).end()
#define ALL(a,n)  (a),(a)+n
#define vi vector<long long>
#define vd vector<long double>
#define vs vector<string>
//CONST
//------------------------------------------
#define INF 1010000000000000017LL
#define MOD 1000000007LL
#define EPS 1e-12
#define PI 3.14159265358979323846
//REPEAT
//------------------------------------------
#define   FOR(i,m,n) for(ll (i)=(m);   (i)<(n);  (i)++)
#define   REP(i,n)   for(ll (i)=0;     (i)<(n);  (i)++)
#define  REPS(i,x)   for(ll (i)=1;     (i)<=(x); (i)++)
#define  RREP(i,x)   for(ll (i)=(x)-1; (i)>=0;   (i)--)
#define RREPS(i,x)   for(ll (i)=(x);   (i)> 0;   (i)--)
#define  WREP(i,in,j,jn) REP(i,in)REP(j,jn)
//-----------------------------------------
#define dcml(n) fixed<<setprecision(n)
using namespace std;
int main(void){
    ll S,W;cin>>S>>W;
    if(S<=W)cout<<"unsafe\n";
    else cout<<"safe\n";
}

Measured memory_bytes: 3624
#include <iostream>
using namespace std;
int main() {
    int n;
    int num;
    int count = 0;
    cin>> n;
    for(int i = 1; i <= n; i++){
        cin>> num;
        if(num%2 == 1 and i%2 == 1)
            count++;
    }
    cout<<count<<endl;
    return 0;
}

Measured memory_bytes: 3596
MM = input().split()
N = int(MM[0])
M = int(MM[1])
list1 = []
for i in range(M):
  aa = input().split()
  a = int(aa[0])
  b = int(aa[1])
  list1.append(a)
  list1.append(b)
for i in range(1,N+1):
  ans = list1.count(i)
  print(ans)

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

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

//container util
#define all(x) (x).begin(),(x).end()

//typedef
typedef long long ll;
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<ll> VLL;
typedef vector<VLL> VVLL;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef pair<ll, ll> PLL;

//const value
//const ll MOD = 1e9 + 7;
//const int dx[] = {0,1,0,-1};//{0,0,1,1,1,-1,-1,-1};
//const int dy[] = {1,0,-1,0};//{1,-1,0,1,-1,0,1,-1};

//conversion
inline int toInt(string s) {int v; istringstream sin(s);sin>>v;return v;}
inline ll toLL(string s) {ll v; istringstream sin(s);sin>>v;return v;}
template<class T> inline string toString(T x) {ostringstream sout;sout<<x;return sout.str();}
typedef string::const_iterator State;

bool check(State &begin){
  if(*begin != 'm')  return false;
  begin++;
  if(*begin == 'w') return false;
  if(*begin == 'm'){
    if(check(begin) == false) return false;
  }
  if(*begin != 'e') return false;
  begin++;

  if(*begin == 'm'){
    if(check(begin) == false) return false;
  }

  if(*begin == 'w'){
    begin++;
    return true;
  }
  else{
    return false;
  }
}

int main(){
  ios::sync_with_stdio(false);
  cin.tie(0);
  string s;
  cin >> s;
  State begin = s.begin();
  cout << ((check(begin) && begin == s.cend() )?"Cat":"Rabbit") << endl;

  return 0;
}



Measured memory_bytes: 3224
import java.util.Scanner;

class SumInt{

    private int calculate(int num, int start, int n, int s){
        int tmp = num + start;
        if (tmp > s) return 0;
        if (n == 0){
            if (tmp == s) return 1;
            else return 0;
        }
        int add = 0;
        for (int i = num + 1; i < 10; i++){
            add += calculate(i, tmp, n-1, s);
        }
        return add;
    }

    public int getCombination(int n, int s) {
        int a = 0;
        for (int i = 0; i < 10; i++){
            a += calculate(i, 0, n-1, s);
        }
        return a;
    }
}

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        while (true) {
            int n = sc.nextInt(), s = sc.nextInt();
            if (n ==0 && s ==0)break;
            SumInt si = new SumInt();
            System.out.println(si.getCombination(n, s));
        }
    }
}

Measured memory_bytes: 26148
import java.util.Scanner;
import java.util.stream.IntStream;

public class Main {
	public static void main(String[] arg) {
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		int b = sc.nextInt();
		int c = sc.nextInt();
		int d = sc.nextInt();

		int res = 0;
		if (a < b) {
			res = a;
		} else {
			res = b;
		}

		if (c < d) {
			res += c;
		} else {
			res += d;
		}

		System.out.println(res);
	}
}

Measured memory_bytes: 23636
//abc144_d.cpp
//Sun Oct 27 20:49:51 2019

#include <iostream>
#include <string>
#include <queue>
#include <map>
#include <unordered_map>
#include <vector>
#include <algorithm>
#include <math.h>
#include <set>
#define INTINF 2147483647
#define LLINF 9223372036854775807
#define PI 3.14159265359
using namespace std;
using ll=long long;
typedef pair<int,int> P;

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

	double teimen = a*a;
	double takasa = x/teimen;
	double menseki = takasa*a;
	double border = b*a/2;
	double ans;
	double nexttakasa;
	if (menseki<=border){
		nexttakasa = menseki*2/b;
		ans = atan(b/nexttakasa);
		ans = ans/PI*180;
	}else {
		double temp = (2*menseki)/a-b;
		nexttakasa = b-temp;
		ans = atan(nexttakasa/a);
		ans = ans/PI*180;
	}
	printf("%.10f\n",ans);
}

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

int n;
string s[110];
map<string, int> m;

int main () {

	cin >> n;
	cin >> s[0];
	m[s[0]] ++;
	for (int i = 1; i < n; i ++) {
		cin >> s[i];
		if (m[ s[i] ] == 1) {
			cout << "No";
			return 0;
		}
	
		if (s[i-1][ (int)s[i-1].size()-1 ] != s[i][0]) {
			cout << "No";
			return 0;
		}
	
		m[ s[i] ] ++;
	}
	
	cout << "Yes";

	return 0;
}

Measured memory_bytes: 256
def read_input():
    n, y = map(int, input().split())
    return n, y


def check_1000(y, n):
    return n * 1000 == y


def check_5000(y, n):
    test_n = range(n + 1)

    for tn in test_n:
        rest_y = y - tn*5000
        rest_n = n - tn

        if rest_y < 0:
            break

        if check_1000(rest_y, rest_n):
            return True, tn, rest_n

    return False, -1, -1


def check_10000(y, n):
    test_n = range(n + 1)

    for tn in test_n:
        rest_y = y - tn*10000
        rest_n = n - tn

        if rest_y < 0:
            break

        check_under, n5000, n1000 = check_5000(rest_y, rest_n)
        if check_under:
            return tn, n5000, n1000

    return -1, -1, -1


n, y = read_input()
print('{} {} {}'.format(*check_10000(y, n)))

Measured memory_bytes: 3064
url = "https://atcoder.jp//contests/abc155/tasks/abc155_c"

def main():
    n = int(input())
    words = [input() for i in range(n)]

    words_count = {}
    for w in words:
        words_count.setdefault(w, 0)
        words_count[w] += 1
    ans = ''
    count = 0
    for w in words_count:
        count = words_count[w] if words_count[w] > count else count
    ans = []
    for w in words_count:
        if words_count[w] == count:
            ans.append(w)
    ans = sorted(ans)
    for w in ans:
        print(w)




if __name__ == '__main__':
    main()


Measured memory_bytes: 35208
import java.util.Scanner;

public class Main {
	public static void main(String[]args) {
		Scanner sc = new Scanner(System.in);
		int baka=sc.nextInt();
		int[] kazu = new int[baka];
		//これが繰り返し判断するためのやつ
		int count=0;
		int get=0;
		int x,p;
		for(int i=0;i<baka;i++) {
			get=sc.nextInt();
			if(get==0) {
				x=sc.nextInt();
				kazu[count]=x;
				count++;
			}
			if(get==1) {
				p=sc.nextInt();
				System.out.println(kazu[p]);
			}
			if(get==2) {
				count--;
			}
		}
	}
}



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

typedef long long LL;

const int N=105;
const int M=505;
const int MOD=1000000007;

int n,m,L[N],f[N][N][M];

bool cmp(int x,int y)
{
	return x>y;
}

int main()
{
	scanf("%d%d",&n,&m);
	for (int i=1;i<=n;i++) scanf("%d",&L[i]);
	std::sort(L+1,L+n+1,cmp);
	f[0][0][0]=1;
	for (int i=0;i<n;i++)
		for (int j=0;j<=i;j++)
			for (int k=L[i+1]*j;k<=m;k++)
			{
				if (!f[i][j][k]) continue;
				int w=L[i+1];
				(f[i+1][j+1][k+w]+=f[i][j][k])%=MOD;
				(f[i+1][j][k]+=(LL)(k-w*j+j)*f[i][j][k]%MOD)%=MOD;
				for (int l=1;l<w;l++)
					(f[i+1][j][k+l]+=(LL)j*2*f[i][j][k]%MOD)%=MOD;
				for (int l=0;l<w;l++)
					if (j>1) (f[i+1][j-1][k+l]+=(LL)(w-l-1)*f[i][j][k]%MOD*j%MOD*(j-1)%MOD)%=MOD;
			}
	int ans=0,jc=1;
	for (int j=1;j<=n;j++)
	{
		jc=(LL)jc*j%MOD;
		(ans+=(LL)jc*f[n][j][m]%MOD)%=MOD;
	}
	printf("%d\n",ans);
	return 0;
}

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

int main(){
  int a,b,c;
  cin >> a >> b >> c;
  if( b-a == c-b ){
	cout << "YES" << endl;
  }else{
	cout << "NO" << endl;
  }
  return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<string>
#include<vector>
#include<numeric>
#include<math.h>
#include<algorithm>
#include<iomanip>
#include<list>
using namespace std;

int main() {

	long N;
	cin >> N;

	vector<long> h(N, 0);

	for (long i = 0; i < N; i++) {
		cin >> h[i];
	}

	long cnt = 0;
	long ans = 0;
	auto itr = h.begin();
	while (itr < (h.end() - 1)) {
		itr += 1;
		cnt = 0;
		while (*(itr - 1) >= *itr) {
			cnt += 1;
			itr += 1;
			if (itr == h.end()) {
				break;
			}
		}
		if (ans < cnt) {
			ans = cnt;
		}
	}

	cout << ans << endl;

	return 0;
}



Measured memory_bytes: 1024
#include <iostream>

using namespace std;
#define Max 100000
typedef long long LL;

int n,k;
LL T[Max];

int check(LL P)
{
    int i=0;
    for(int j=0;j<k;j++)
    {
        LL s=0;
        while(s+T[i]<=P)
        {
            s+=T[i];
            i++;
            if(i==n)return i;
        }

    }
    return i;
}
int solve(){
    LL left=0;
    LL right=100000*10000;
    LL mid;
    while(left<right-1)
    {
        mid = (left+right)/2;
        int v=check(mid);
        if(v>=n)right=mid;
        else left=mid;
    }
    return right;
}
int main()
{
    cin>>n>>k;
    for(int i=0;i<n;i++)
        cin>>T[i];
    LL ans=solve();
    cout<<ans<<endl;
    return 0;
}


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

// #define int long long
#define rep(i, n) for (long long i = (long long)(0); i < (long long)(n); ++i)
#define reps(i, n) for (long long i = (long long)(1); i <= (long long)(n); ++i)
#define rrep(i, n) for (long long i = ((long long)(n)-1); i >= 0; i--)
#define rreps(i, n) for (long long i = ((long long)(n)); i > 0; i--)
#define irep(i, m, n) for (long long i = (long long)(m); i < (long long)(n); ++i)
#define ireps(i, m, n) for (long long i = (long long)(m); i <= (long long)(n); ++i)
#define SORT(v, n) sort(v, v + n);
#define REVERSE(v, n) reverse(v, v+n);
#define vsort(v) sort(v.begin(), v.end());
#define all(v) v.begin(), v.end()
#define mp(n, m) make_pair(n, m);
#define cout(d) cout<<d<<endl;
#define coutd(d) cout<<std::setprecision(10)<<d<<endl;
#define cinline(n) getline(cin,n);
#define replace_all(s, b, a) replace(s.begin(),s.end(), b, a);
#define PI (acos(-1))
#define FILL(v, n, x) fill(v, v + n, x);
#define sz(x) long long(x.size())

using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>;
using vll = vector<ll>;
using vvll = vector<vll>;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using vs = vector<string>;
using vpll = vector<pair<ll, ll>>;
using vtp = vector<tuple<ll,ll,ll>>;
using vb = vector<bool>;

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

const ll INF = 1e15;
const ll MOD = 1e9+7;
const ll LINF = 1e18;



signed main()
{
  cin.tie( 0 ); ios::sync_with_stdio( false );
  ll n,m; cin>>n>>m;
  ll sum=0;
  rep(i,m){
    ll a; cin>>a;
    sum+=a;
  }
  ll ans=n-sum;
  if(ans<0) cout<<-1<<endl;
  else cout<<ans<<endl;
}

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

using namespace std;

int main() {
  int N;
  cin >> N;
  int n = N;
  int sum = 0;
  while (n > 0) {
    sum += n % 10;
    n /= 10;
  }
  cout << (N % sum == 0 ? "Yes" : "No") << endl;
}


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

int main(){
	int N,K,x,a;
  cin >> N >> K;
  for(int i = 0; i < N; i++){
  	cin >> x;
    if(x < K-x)
    	a += x*2; 
    	else 
          a += (K-x)*2;
      }
  cout << a;
}

Measured memory_bytes: 384
#include <bits/stdc++.h>
#define rep(var,cnt) for(int (var)=0; (var)<(int)(cnt); ++(var))
#define Rep(var,init,cnt) for(int (var)=(init); (var)<(int)(cnt); ++(var))
#define ran(var,vec) for(auto &(var):(vec))
#define all(v) (v).begin(),(v).end()
#define rall(v) (v).rbegin(),(v).rend()
#define SORT(v) sort(all(v))
#define RSORT(v) sort(rall(v))
#define SUM(v) accumulate(all(v),0)
#define tget(tp,idx) get<idx>(tp)
#define TF(flag) ((flag)?1:0)
#define YN(flag) cout<<(flag?"YES":"NO")<<endl;
#define Yn(flag) cout<<(flag?"Yes":"No")<<endl;
#define yn(flag) cout<<(flag?"yes":"no")<<endl;
#define Cout(v) cout<<(v)
#define COUT(v) cout<<(v)<<endl
using namespace std;

using ll = long long;
using ull = unsigned long long;
using pi = pair<int,int>;
using pl = pair<ll,ll>;
using ti = tuple<int,int,int>;
using tl = tuple<ll,ll,ll>;

template<typename T>
using vec = vector<T>;
template<typename T>
using mat = vector<vec<T>>;
template<typename T>
using cub = vector<mat<T>>;
template<typename T>
using val = valarray<T>;

template<typename T>
using pq = priority_queue<T>;
template<typename T>
using rpq = priority_queue<T,vec<T>,greater<T>>;

template<typename T1,typename T2>
ostream &operator<<(ostream &os, const pair<T1,T2> &p){
  os<<"P("<<p.first<<", "<<p.second<<") ";
  return os;
}

template<typename T1,typename T2>
istream &operator>>(istream &is, pair<T1,T2> &p){
  is>>p.first>>p.second;
  return is;
}

template<typename T>
ostream &operator<<(ostream &os, const vector<T> &v){
  cout<<"V{";
  for(int i=0; i<(int)v.size(); ++i){
    os<<v[i]<<(i+1!=v.size()?" ":"");
  }
  cout<<"}";
  return os;
}

template<typename T>
istream &operator>>(istream &is, vector<T> &v){
  for(T &in:v) is>>in;
  return is;
}

template<typename T>
ostream &operator<<(ostream &os, const valarray<T> &v){
  cout<<"V{";
  for(int i=0; i<(int)v.size(); ++i){
    os<<v[i]<<(i+1!=v.size()?" ":"");
  }
  cout<<"}";
  return os;
}

template<typename T>
istream &operator>>(istream &is, valarray<T> &v){
  for(T &in:v) is>>in;
  return is;
}

// Usual Template End ===================
// Template End =========================

constexpr int MOD=1e9+7;
locale LOCATE=locale::classic();

int main(void){
  string A; cin>>A;
  ll n=A.size();
  ll ans=n*(n-1)/2;
  map<char,int> cnt;
  rep(i,n) ++cnt[A[i]];
  ran(i,cnt){
    ll c=i.second;
    ans-=c*(c-1)/2;
  }
  cout<<ans+1<<endl;
}















Measured memory_bytes: 640
N = int(input())
A = list(map(int, input().split()))
Q = int(input())
BC = [list(map(int, input().split())) for i in range(Q)]

from collections import Counter

counter = Counter(A)
ans = sum([key*value for key, value in counter.items()])

for q in range(Q):
  ans = ans+((BC[q][1]-BC[q][0])*counter[BC[q][0]])
  counter[BC[q][1]] += counter[BC[q][0]]
  counter[BC[q][0]] = 0
  print (ans)

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

#define int long long

signed main() {
  cin.tie(0);
  ios_base::sync_with_stdio(0);
  cout << fixed << setprecision(12);

  int ans = 0;
  int N;
  cin >> N;

  for ( int i = 5; i*2 <= N; i *= 5 ) {
    ans += N/(i*2);    
  }

  if ( N%2 ) cout << 0 << endl;
  else cout << ans << endl;
  
  return 0;
}


Measured memory_bytes: 256
function displayDate(input){
	var pageCNT;
 
    input = input.split("\n")
  
  	const N = parseInt(input[0], 10);
	pageCNT = Math.ceil(N/2);
	console.log(pageCNT);
}
 
 
displayDate(require("fs").readFileSync("/dev/stdin", "utf8"));

Measured memory_bytes: 7372
#include <iostream>
using namespace std;
int main(void){
  int a;
  cin >> a;
  int kazu = 0;
  int tmp2;
  int tmp = 0;
  int wari = 10;
  for(int i=0; to_string(a).size() > i; i++){
    tmp2 = a % wari;
    tmp2 -= tmp;
    tmp2 = tmp2 * 10 / wari;
    kazu += tmp2;
    tmp = tmp2 * wari / 10;
    wari *= 10;
  }
  cout << (a % kazu == 0 ? "Yes" : "No") << endl;
  return 0;
}

Measured memory_bytes: 256
#define _USE_MATH_DEFINES
#include <bits/stdc++.h>
#define USE_LLONG_AS_INT
#ifdef USE_LLONG_AS_INT
#define int long long
#define inf (1ll<<60)
#else
#define inf (1<<30)
#endif
#define rep(i,n) for(int i=0;i<(n);i++)
#define Rep(i,a,b) for(int i=(a);i<(b);i++)
#define REP(i,a,b) for(int i=(a);i<=(b);i++)
#define rev(i,n) for(int i=(n)-1;i>=0;i--)
#define vi vector<int>
#define vvi vector<vi>
#define pb push_back
#define eb emplace_back
#define pi pair<int,int>
#define vp vector<pair<int,int>>
#define mp make_pair
#define all(v) (v).begin(),(v).end()
#define fi first
#define se second
#define MEMSET(a) memset(a,0,sizeof(a))
#define Yes(f) cout<<(f?"Yes":"No")<<endl
#define yes(f) cout<<(f?"yes":"no")<<endl
#define YES(f) cout<<(f?"YES":"NO")<<endl
#define SORT(v) sort(all(v))
#define RSORT(v) sort(all(v), greater<int>())

using namespace std;

const int mod=1e9+7;
const string sp=" ";

void run();

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

signed main(){
    init();
    run();
    return 0;
}

void run(){
    int a,b,n;
    cin>>a>>b>>n;
    cout<<a*min(b-1,n)/b<<endl;
}

Measured memory_bytes: 3644
#include <iostream>
typedef long long ll;
using namespace std;

int main()
{
    ll k,n,s,i;
    cin>>n>>k>>s;
    n-=k;
    for(i=1;i<=k;i++)
    {
        cout<<s<<" ";
    }
    if(s==1e9)
    {
        for(i=1;i<=n;i++)cout<<1<<" ";
    }
    else
    {
        for(i=1;i<=n;i++)cout<<s+1<<" ";
    }
    return 0;
}


Measured memory_bytes: 1280
#include <cstdio>
#include <iostream>
#include <vector>
#include <queue>
#include <string>
#include <utility>
#include <map>
#include <set>
#include <algorithm>
#include<cmath>

#define rep(i, a, b) for (int i=a; i <b; i++)
#define F first
#define S second

using namespace std;

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

int main() {
    int n;
    cin >> n;
    vector<int> ary(n*3);
    for(int i=0; i<n*3; i++) {
        cin >> ary[i];
    }
    /* for(int i=0; i<n*3; i++) {
        printf("%d ", ary[i]);
        if((i+1) % 3 == 0) {
            printf("\n");
        }
    }*/
    int a, b, c; a =0; b=0; c=0;
    for (int i=0; i<n; i++) {
        if (ary[3*i+2] > 0) {
            a = ary[ 3*i ]; b = ary[3*i +1]; c = ary[3*i + 2];
        }
    }
    for (int i=0; i<101; i++) {
        for(int j=0; j<101; j++) {
            
            int h=0;
            h = abs(i - a) + abs(j - b) + c;
            bool ok = true;
            for(int k=0; k<n; k++) {
                int hb = h - abs(ary[3*k] - i) - abs(ary[3*k +1] - j);
                if(hb < 0) {hb = 0;}
                if(hb == ary[3*k +2] && ok) {
                    continue;
                } else {
                    ok = false;
                }
            }
            if(ok) {
                printf("%d %d %d\n", i, j, h);
            }
        }
    }
    return 0;
}

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

int main(){
    int N;
    cin >> N;
    string s;
    cin >> s;
    int l[300000] = {0};
    int r[300000] = {0};
    for(int i=1; i<N; i++){
        int x = 0;
        if(s[i-1] == 'W'){
            x = 1;
        }
        l[i] = l[i-1] + x;
    }
    for(int i=N-2; i>=0; i--){
        int x = 0;
        if(s[i+1] == 'E'){
            x = 1;
        }
        r[i] = r[i+1] + x;
    }
    int n_min = 3000000;
    for(int i=0; i<N; i++){
        int n = l[i] + r[i];
        if(n <= n_min){
            n_min = n;
        }
    }
    cout << n_min;
    return EXIT_SUCCESS;
}

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


int main(void){
  int N;
  string S;
  cin >> N >> S;
  vector<int> W(N), E(N);
  if(S[0] == 'W'){
    W[0] = 1;
    E[0] = 0;
  }
  else{
   W[0] = 0;
    E[0] = 1;
  }
  for(int i = 1; i < N; i++){
    char a = S[i];
    W[i] = W[i - 1];
    E[i] = E[i - 1];
    if(a == 'W') W[i]++;
    else E[i]++;
  }
  int min = E[N - 1] - E[0];
  for(int i = 1; i < N; i++){
    if(E[N - 1] - E[i] + W[i - 1] < min) min = E[N - 1] - E[i] + W[i] ;
    
  }
  
  cout << min;
  
 return 0; 
}

Measured memory_bytes: 2948
#include <bits/stdc++.h>
using namespace std;
typedef pair<string, int> P;

bool pairCompare(const P &firstElof, const P &secondElof)
{
    return firstElof.second > secondElof.second;
}

int main()
{
    int N;
    cin >> N;
    vector<P> rest(N), ind(N);
    for (int i = 0; i < N; i++)
    {
        cin >> rest[i].first >> rest[i].second;
        ind[i].first = rest[i].first;
        ind[i].second = rest[i].second;
    }
    sort(rest.begin(), rest.end());
    // for (int i = 0; i < N; i++)
    // {
    //     cout << rest[i].first << ":" << rest[i].second << endl;
    // }
    for (int i = 1; i < N; i++)
    {
        if (rest[i - 1].first == rest[i].first)
        {
            int j = 0;
            while (j < rest.size() - i)
            {
                if (rest[i - 1 + j].first != rest[i + j].first)
                {
                    break;
                }
                else
                {
                    j++;
                }
            }
            // cout << "num:" << j << endl;
            sort(rest.begin() + i - 1, rest.begin() + i + j, pairCompare);
            i += j;
        }
    }
    //cout << "--------------------" << endl;
    //for (int i = 0; i < N; i++)
    //{
    //    cout << rest[i].first << ":" << rest[i].second << endl;
    //}
    for (int i = 0; i < N; i++)
    {
        int ans;
        for (int j = 0; j < N; j++)
        {
            if (rest[i].first == ind[j].first &
                rest[i].second == ind[j].second)
            {
                ans = j + 1;
                break;
            }
        }
        cout << ans << endl;
    }
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define ff { ios_base::sync_with_stdio(false);cin.tie(NULL);}
using namespace std;

typedef long long ll;
 ll  pp=1e9+7; 
double pi=3.141592653589793238;

 int main() {
        ff;
        
        ll a,b,c,d,e;
        cin>>a>>b>>c>>d>>e;
        if(a==0){
            cout<<"1"<<endl;
        }else if(b==0){
            cout<<"2"<<endl;
        }else if(c==0){
            cout<<"3"<<endl;
        }else if(d==0){
            cout<<"4"<<endl;
        }else if(e==0){
            cout<<"5"<<endl;
        }
        
		
    return 0;
}

            
		
        
           
  

Measured memory_bytes: 3604
import java.util.*;
import java.io.*;

// Template for atcoder
public class Main {

    BufferedReader br;
    PrintWriter out;
    StringTokenizer st;
    boolean eof;
    final long MOD = 1000L * 1000L * 1000L + 7;
    private static final int[] dx = {0, -1, 0, 1};
    private static final int[] dy = {1, 0, -1, 0};

    void solve() throws IOException {
        int sz = 20;
        long[] pow = new long[sz];
        pow[0] = 1;
        for (int i = 1; i < sz; i++) {
            pow[i] = 26 * pow[i - 1];
        }
        for (int i = 1; i < sz; i++) {
            pow[i] += pow[i - 1];
        }
        long N = nextLong();
        int len = 0;
        for (int i = 0; i < sz; i++) {
            if (pow[i] > N) {
                len = i;
                break;
            }
        }

        StringBuilder sb = new StringBuilder();
        N -= len > 0 ? pow[len - 1] : 0;
        for (int i = 0; i < len; i++) {
            long rem = N % 26;
            sb.append((char) (rem + 'a'));
            N = N / 26;
        }

        outln(sb.reverse().toString());
    }

    void shuffle(int[] a) {
        int n = a.length;
        for(int i = 0; i < n; i++) {
            int r = i + (int) (Math.random() * (n - i));
            int tmp = a[i];
            a[i] = a[r];
            a[r] = tmp;
        }
    }
    private void outln(Object o) {
        out.println(o);
    }
    private void out(Object o) {
        out.print(o);
    }
    public Main() throws IOException {
        br = new BufferedReader(new InputStreamReader(System.in));
        out = new PrintWriter(System.out);
        solve();
        out.close();
    }
    public static void main(String[] args) throws IOException {
        new Main();
    }

    public long[] nextLongArr(int n) throws IOException{
        long[] res = new long[n];
        for(int i = 0; i < n; i++)
            res[i] = nextLong();
        return res;
    }
    public int[] nextIntArr(int n) throws IOException {
        int[] res = new int[n];
        for(int i = 0; i < n; i++)
            res[i] = nextInt();
        return res;
    }
    public String nextToken() {
        while (st == null || !st.hasMoreTokens()) {
            try {
                st = new StringTokenizer(br.readLine());
            } catch (Exception e) {
                eof = true;
                return null;
            }
        }
        return st.nextToken();
    }
    public String nextString() {
        try {
            return br.readLine();
        } catch (IOException e) {
            eof = true;
            return null;
        }
    }
    public int nextInt() throws IOException {
        return Integer.parseInt(nextToken());
    }
    public long nextLong() throws IOException {
        return Long.parseLong(nextToken());
    }
    public double nextDouble() throws IOException {
        return Double.parseDouble(nextToken());
    }
}


Measured memory_bytes: 33000
#ifdef ConanYu
#include "local.hpp"
#else
#pragma GCC optimize("-O3")
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
void Main();
#define debug(...) do { } while(0)
int main() {
  ios::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  Main();
}
#endif

void Main() {
  int h, a; cin >> h >> a;
  cout << (h + a - 1) / a << "\n";
}


Measured memory_bytes: 256
N,W=map(int,input().split())
w=[]
v=[]
for i in range(N):
    ww,vv=map(int,input().split())
    w.append(ww)
    v.append(vv)

dp=[[0 for i in range(W+1)] for j in range(N+1)]

for i in range(N):
    for j in range(W+1):
        if(j-w[i]>=0):
            dp[i+1][j]=max(dp[i+1][j],dp[i][j-w[i]]+v[i])
        dp[i+1][j]=max(dp[i+1][j],dp[i][j])
print(dp[N][W])

Measured memory_bytes: 217444
from sys import stdin


def main():
    N = int(stdin.readline().rstrip())
    xys = []
    for _ in range(N):
        A = int(stdin.readline().rstrip())
        xys.append([tuple(int(x) for x in stdin.readline().rstrip().split()) for _ in range(A)])
    max_ = int('1' * N, 2)
    result = 0
    for i in range(max_ + 1):
        sb = bin(i)[2:]
        sb = '0' * (N - len(sb)) + sb
        for idx, c in enumerate(sb):
            if c == '0':
                continue
            is_break = False
            tmp = [None] * N
            for x, y in xys[idx]:
                if (y == 0 and sb[x - 1] == '1') or (y == 1 and sb[x - 1] == '0'):
                    is_break = True
                    break
                if tmp[x - 1] == None:
                    tmp[x - 1] = y
                elif tmp[x - 1] != y:
                    is_break = True
                    break
            if is_break:
                break
        else:
            result = max(result, sb.count('1'))
    print(result)


if __name__ == "__main__":
    main()


Measured memory_bytes: 3064
#include <stdio.h>
#include <string>
#include <iostream>
#include <algorithm>
#include <vector>


using namespace std;

int main(){
	string s;
	cin >> s;
	
	int tmp = s.length();
	int ans;
	int j = 0;
	while (1) {
		j++;
		string s1;
		int len = tmp - j;
		
		for (int i = 0; i < len; i++) {
			s1 += s[i];
		}

		int mid = len / 2;
		bool flag = true;
		//cout << len << endl;
		if (len % 2 == 1) continue;
		for (int i = 0; i < mid; i++) {
			//cout << s1[i] << mid << s1[i + mid] << endl;
			if (s1[i] != s1[i + mid]) flag = false;
		}

		if (flag) {
			ans = len;
			break;
		}
	}

	cout << ans << endl;


	
 
	return 0;
}


Measured memory_bytes: 256
# coding: utf-8
def get_ln_inputs():
    return input().split()


def get_ln_int_inputs():
    return list(map(int, get_ln_inputs()))


def main():
    A_MAX = 10 ** 5

    N = get_ln_int_inputs()[0]
    a = get_ln_int_inputs()
    counts = [0 for _ in range(A_MAX)]

    for num in a:
        counts[num] += 1
    
    max_count = 0
    for target in range(1, A_MAX - 1):
        count = counts[target - 1] + counts[target] + counts[target + 1]
        max_count = max(count, max_count)

    print(max_count)

main()

Measured memory_bytes: 14004
#include <string>
#include <iostream>
#include <algorithm>
#include <vector>
#include <map>
#include <cmath>
#include <set>
#include <queue>
#include<limits.h>
#include<iomanip>
#define rep(i, n) for(int i = 0; i < n; i++)
#define REP(i, m, n) for(int i = m; i < n; i++)
#define rrep(i, n) for(int i = n-1; i >= 0; i--)
#define ALL(v) v.begin(),v.end()
#define RALL(v) v.rbegin(),v.rend()
#define INF 1e8
typedef long long ll;
using namespace std;

vector<int> tree[100005];
int ans[100005];
void dfs(int now, int bnum) {
    if(tree[now].size()==0) return;
    bool flag = false;
    rep(i,tree[now].size()) {
        if(i==bnum) flag = true;
        ans[tree[now][i]] = i;
        if(flag) ans[tree[now][i]]++;
        dfs(tree[now][i],ans[tree[now][i]]);
    }
    return;
}
int main() {
    int n; cin >> n;
    vector<int> ki;
    rep(i,n-1) {
        int a,b; cin >> a >> b;
        a--; b--;
        tree[a].push_back(b);
        ki.push_back(b);
    }
    dfs(0,-1);
    int maxnum = 0;
    REP(i,1,n) maxnum = max(maxnum,ans[i]+1);
    cout << maxnum << endl;
    rep(i,n-1)  cout << ans[ki[i]]+1 << endl;


    return 0;
}

Measured memory_bytes: 7676
#include<bits/stdc++.h>
#define int long long
using namespace std;
signed main(){
    int n;
    string a,b;
    cin>>n>>a>>b;
    int sum=0;
    for(int i=0;i<n;i++){
        sum=0;
        for(int j=0;j<n-i;j++){
            if(b[j]==a[j+i]){
                sum++;
            }
        }
        if(sum==n-i){
            cout<<n+i<<endl;
            return 0;
        }
    }
    cout<<n*2<<endl;
}

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

#define rep(i, n) for (int i = 0; i < (n); i++)
using namespace std;
typedef long long ll;
const int INF = 1e9;

int main() {
  ll n, nn, ans = 0, d;
  cin >> n;

  for (ll a = 2; a * a <= n; ++a) {
    if (n % a != 0) continue;
    ll e = 0, x = 1;
    while (n % a == 0) ++e, n /= a;
    while (x <= e) e -= x++, ans++;
  }
  if (n != 1) ans++;

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


Measured memory_bytes: 3636
C = []
for i in range(3):
  C.append(map(int, raw_input().split()))
r = 'Yes'
for i in range(1,3):
  for j in range(1,3):
    if C[i][j] != C[i][0] + (C[0][j]-C[0][0]):
      r = 'No'
print r

Measured memory_bytes: 2568
def postal(a,b,s):
    if s[a]=='-':
        for i in (s[:a]+s[a+1:]):
            if i not in '0123456789':
                return 'No'
        return 'Yes'
    else:
        return 'No'
a, b = map(int, input().split())
s = input()
print(postal(a,b,s))

Measured memory_bytes: 3060
/*************************************************************************
    > File Name: test.cpp
    > Author: Akira 
    > Mail: qaq.febr2.qaq@gmail.com 
 ************************************************************************/

#include<bits/stdc++.h>
typedef long long LL;
typedef unsigned long long ULL;
typedef long double LD;
#define MST(a,b) memset(a,b,sizeof(a))
#define CLR(a) MST(a,0)
#define Sqr(a) ((a)*(a))
using namespace std;

#define MaxN 100001
#define MaxM MaxN*10
#define INF 0x3f3f3f3f
#define PI 3.1415926535897932384626
const int mod = 1E9+7;
const double eps = 1e-6;
#define bug cout<<88888888<<endl;
#define debug(x) cout << #x" = " << x << endl;

int A,B;

int main()
{
    //std::ios::sync_with_stdio(false);
    scanf("%d%d", &A, &B);
    if(A==1) A=14;
    if(B==1) B=14;
    if(A==B) puts("Draw");
    else if(A>B) puts("Alice");
    else puts("Bob");
    //system("pause");
}


Measured memory_bytes: 256
#include <stdio.h>
#include <iostream>
#include <string>

using namespace std;

int main() {
	string str(""), s;
	int i;
	i = 0;

	getline(cin, str);
	//cout << str << endl;

	for(i = 0; i < str.size(); i++) {
		if('a' <= str[i] && str[i] <= 'z') {
			str[i] = toupper(str[i]);
		} else if('A' <= str[i] && str[i] <= 'Z') {
			str[i] = tolower(str[i]);
		}
	}
	cout << str << endl;
	return 0;
}

Measured memory_bytes: 3156