akhauriyash/Code-Regression huggingface dataset:
import bisect


def main():
  D, G = list(map(int, input().split()))
  P = []
  for i in range(1, D+1):
    P.append(tuple(map(int, input().split())))

  # print(D, G, P)
  minp = float('inf')
  for bit in range(1 << D):
    total = 0
    num_p = 0
    bset = set()
    for i in range(D):
      mask = 1 << i
      if bit & mask:
        total += P[i][1] + 100*(i+1)*P[i][0]
        num_p += P[i][0]
        bset.add(i)

    # print(f'bset:{bset}, num_p:{num_p}')

    res = G - total
    if res <= 0:
      if num_p < minp:
        minp = num_p
      continue

    for i in reversed(sorted(set([i for i in range(D)]) - bset)):
      maxv = 100*(i+1) * (P[i][0]-1)

      if res <= maxv:
        num_take = max(min(bisect.bisect(list(range(0, maxv+100*(i+1), 100*(i+1))), res)-1, P[i][0]-1), 1)
        # print(i, list(range(0, maxv, 100*(i+1))))
        # print(f'res:{res} so solve {100*(i+1)} * {num_take}')
        num_p += num_take
        res -= 100*(i+1)*num_take
        if num_p < minp:
          minp = num_p
        break

      res -= maxv
      # print(f'solve {i+1} * {P[i][0]-1}')
      num_p += (P[i][0]-1)

  print(minp)


if(__name__ == '__main__'):
  main()

Measured memory_bytes: 9300
#include<iostream>
#include<stack>
#include<string>
#include<vector>
#include<algorithm>
using namespace std;

int main(){
    stack<int> S1;
    stack<pair<int, int> > S2;
    char ch;
    int sum = 0;
    for(int i=0; cin >> ch; i++){
        if(ch == '\\') S1.push(i);
        else if(ch == '/' && S1.size() > 0){
            int j = S1.top(); S1.pop();
            sum += i-j; //水たまりの総面積
            int a = i-j;
            while(S2.size() > 0 && S2.top().first > j){ //水たまりの統合処理
                a += S2.top().second; S2.pop(); //各水たまりの面積を求めている
            }
            S2.push(make_pair(j, a));
        }
    }

    vector<int> ans;
    while(S2.size() > 0) {ans.push_back(S2.top().second); S2.pop();}
    reverse(ans.begin(), ans.end());
    cout << sum << endl;
    cout << ans.size();
    for(int i=0; i<ans.size(); i++){
        cout << " ";
        cout << ans[i];
    }
    cout << endl;

    return 0;
}


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

int main() {
  int N=0;
  int S=0;
  int flag=0;

  cin >> N;
  if(0<N && N<100){
    for(int i=1; i<10; i++){
      for(int j=1; j<10; j++){
        S=i*j;
        if(N==S){
          flag = 1;
          cout << "Yes" <<endl;
          return 0;
        }
      }
    }
  }
  if(flag != 1)
  {
    cout << "No" << endl;
  }
}


Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <cstdio>
#include <string.h>
using namespace std;

int H, W, cnt[1001][1001], res;
string s[1001], emb[2];
bool check[1001][1001];

int search(int x, int y){
	int c = 0;
	for(int i = 0; i < 2; ++i){
		for(int j = 0; j < 2; ++j){
			if(s[y + i][x + j] == emb[i][j])
				c++;
		}
	}
	if(c == 4){
		res++;
		check[y][x] = true;
	}
	return c;
}

int search2(int x, int y){
	bool flag = true;
	if(check[y][x])
		flag = false;
	int c = search(x, y);
	if(flag)
		check[y][x] = false;
	if(c == 4)
		res--;
	return c;
}

int main() {
	cin >> H >> W;
	for(int i = 0; i < H; ++i)
		cin >> s[i];
	for(int i = 0; i < 2; ++i)
		cin >> emb[i];
		
	for(int y = 0; y < H - 1; ++y){
		for(int x = 0; x < W - 1; ++x){
			cnt[y][x] = search(x, y);
		}
	}
	int ans = res;
	for(int y = 0; y < H - 1; ++y){
		for(int x = 0; x < W - 1; ++x){
			if(cnt[y][x] == 3){
				int nx, ny;
				char tmp;
				for(int i = 0; i < 2; ++i){
					for(int j = 0; j < 2; ++j){
						if(s[y + i][x + j] != emb[i][j]){
							nx = x + j;
							ny = y + i;
						}
					}
				}
				tmp = s[ny][nx];
				s[ny][nx] = emb[ny - y][nx - x];
				if((nx == 0 && ny == 0) || (nx == 0 && ny == H - 1)
				  || (nx == W - 1 && ny == 0) || nx == W - 1 && ny == H - 1){
					ans = max(ans, res + 1);
				}
				else if(ny == 0){
					int t = (search2(nx, ny) == 4);
					t += (search2(nx - 1, ny) == 4) - check[ny][nx - 1];
					ans = max(ans, res + t);
				}
				else if(ny == H - 1){
					int t = (search2(nx, ny - 1) == 4);
					t += (search2(nx - 1, ny - 1) == 4) - check[ny - 1][nx - 1];
					ans = max(ans, res + t);
				}
				else if(nx == 0){
					int t = (search2(nx, ny) == 4);
					t += (search2(nx, ny - 1) == 4) - check[ny - 1][nx];
					ans = max(ans, res + t);
				}
				else if(nx == W - 1){
					int t = (search2(nx - 1, ny) == 4);
					t += (search2(nx - 1, ny - 1) == 4) - check[ny - 1][nx - 1];
					ans = max(ans, res + t);
				}
				else{
					int t = (search2(nx, ny) == 4);
					t += (search2(nx - 1, ny - 1) == 4) - check[ny - 1][nx - 1];
					t += (search2(nx - 1, ny) == 4) - check[ny][nx - 1];
					t += (search2(nx, ny - 1) == 4) - check[ny - 1][nx];
					ans = max(ans, res + t);
				}
				s[ny][nx] = tmp;
			}
		}
	}
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 7148
#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[i];
  
  sort(d.begin(),d.end());
  
  int ans = d[n/2] - d[n/2 - 1];
  
  cout << ans << endl;
}


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

using namespace std;

int main(void)
{
	vector<int> A;
	int n = 0, tmp;

	cin >> n;

	for(int i = 0 ; i < n ; i++) {
		cin >> tmp;
		A.push_back(tmp);
	}

	sort(A.begin(), A.end());

	cout << A[n / 2] - A[n / 2 - 1];

	return 0;
}


Measured memory_bytes: 892
# 入力
N = input()

A1 = [ n=='E' for n in input()]


minimum = sum(A1[1:])
count = minimum

for i in range(1,int(N)):
    if(not A1[i-1]):
        count += 1
    if(A1[i]):
        count -= 1
    if(count<minimum):
        minimum = count
print(minimum)

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

int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  string s;
  cin>>s;
  int freq[mem] = {0};
  for(int i=0;s[i];i++) {
    freq[s[i]-'a']++;
  }
  bool nope = false;
  for(int i=0;i<mem;i++) {
    if(freq[i]&1) {
      nope=true;break;
    }
  }
  if(nope)
    cout<<"No";
  else
    cout<<"Yes";
  cout<<"\n";
  return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<vector>
#include<algorithm>
#include<utility>
#include<string>
#include<cmath>
#include<cstring>
#include<queue>
#include<map>
#include<climits>
#include<set>

#define REP(i, n) for(int i = 0;i < n;i++)
#define REPR(i, n) for(int i = n;i >= 0;i--)
#define FOR(i, m, n) for(int i = m;i < n;i++)
#define FORR(i, m, n) for(int i = m;i >= n;i--)
#define SORT(v, n) sort(v, v+n);
#define VSORT(v) sort(v.begin(), v.end());
#define llong long long
#define pb(a) push_back(a)
using namespace std;
typedef pair<int, int> pii;
typedef long long int ll;
typedef pair<ll, ll> pll;
//int dx[4] = { 1,0,0,-1 };
//int dy[4] = { 0,1,-1,0 };
#define MOD 1000000007
#define ARRAY_MAX 100005

const int INF = 1e9 + 7;


int main() {


	ios::sync_with_stdio(false);
	cin.tie(0);

	int n, m;
	cin >> n >> m;
	vector<pii> a(m);
	for (int i = 0; i < m; i++)
	{
		cin >> a[i].first >> a[i].second;
	}
	sort(a.begin(), a.end(), greater<pii>());
	
	int cnt = 0;
	int ans = 0;
	for (int i = 0; i < m; i++) {
		if (a[i].first >= n)
		{
			cnt++;
		}
		else
		{
			ans += (n - a[i].first);
			cnt++;
		}
		if (cnt == m - 1) {
			break;
		}
	}

	cout << ans << endl;


	
	return 0;
}



Measured memory_bytes: 3204
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.StringTokenizer;

public class Main {

	static class Node {		
		int id;
		int parentId;
		int depth;
		int[] children;
		public Node(int id, int parentId) {
			this.id = id;
			this.parentId = parentId;
			this.children = null;
			this.depth = 0;
		}
		private String getType() {
			if (depth == 0) {
				return "root";
			}
			if (children == null || children.length == 0) {
				return "leaf";
			}
			return "internal node";
		}		
		public String toString() {
			StringBuilder sb = new StringBuilder();
			sb.append("node " + id + ": ");
			sb.append("parent = " + parentId + ", ");
			sb.append("depth = " + depth + ", ");
			sb.append(getType() + ", ");
			sb.append(Arrays.toString(children));
			return sb.toString();
		}
	}

	public static void main(String[] args) throws IOException {
		BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
		int n = Integer.parseInt(reader.readLine());
		Node[] nodes = new Node[n];

		for (int i = 0; i < n; i++) {
			
			StringTokenizer st = new StringTokenizer(reader.readLine());			
			int id = Integer.parseInt(st.nextToken());
			if (nodes[id] == null) {
				nodes[id] = new Node(id, -1);
			}
			if (nodes[id].parentId != -1) {
				nodes[id].depth = nodes[nodes[id].parentId].depth + 1;
			}

			int m = Integer.parseInt(st.nextToken());
			int[] children = new int[m];
			for (int j = 0; j < m; j++) {
				int childId = Integer.parseInt(st.nextToken());
				children[j] = childId;
				if (nodes[childId] == null) {
					nodes[childId] = new Node(childId, id);
				} else {
					nodes[childId].parentId = id;
				}
				nodes[childId].depth = nodes[id].depth + 1;
			}
			nodes[id].children = children;
		}

		for (Node node : nodes) {
			System.out.println(node);
		}
	}
}



Measured memory_bytes: 120424
s = gets.chomp.split('').map(&:to_i)
i = 0
switch = false
while i < s.size-1
  # puts "s[i]:#{s[i]}  s[i+1]:#{s[i+1]}"
  if s[i] == s[i+1]
    switch = true
  end
  i += 1
end

if switch
  puts "Bad"
else
  puts "Good"
end

Measured memory_bytes: 14292
#include <bits/stdc++.h>
using namespace std;
#define SELECTER(_1, _2, _3, SELECT, ...) SELECT
#define REP1(i, n) for(int (i)=0; (i)<(n); (i)++)
#define REP2(i, a, b) for(int (i)=(a); (i)<(b); (i)++)
#define REP(...) SELECTER(__VA_ARGS__, REP2, REP1,) (__VA_ARGS__)
#define MOD 1'000'000'007

template <class T> ostream& operator<<(ostream& os, const vector<T>& v){ os << "{"; for(size_t i=0; i<v.size(); i++) os << v[i] << (i+1==v.size() ? "" : ", "); os << "}"; return os; }
template <class T, class U> ostream& operator<<(ostream& os, const pair<T, U>& p){ return os << "{" << p.first << ", " << p.second << "}"; }

int main(){
    int N;
    cin >> N;
    vector<vector<int>> D(N, vector<int>(N));
    REP(i, N){
        int A;
        cin >> A;
        REP(j, A){
            int x, y;
            cin >> x >> y;
            x--;
            D[i][x] = y+1;
        }
    }

    int ans = 0;
    REP(i, 1<<N){
        bool ok = true;
        REP(j, N){
            if(i&(1<<j)){
                REP(k, N){
                    if(D[j][k] == 1){
                        if(i&(1<<k)) ok = false;
                    }
                    if(D[j][k] == 2){
                        if(!(i&(1<<k))) ok = false;
                    }
                }
            }
        }
        if(ok){
            int cnt = __builtin_popcount(i);
            ans = max(ans, cnt);
        }
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 256
N = int(input())
A = list(map(int, input().split()))

state_plus = False
state_minus = False
state_flat = True
count = 0

for i in range(N-1):
    # print(str(A[i]) + ',' + str(A[i + 1]))
    if state_flat:
        if A[i + 1] > A[i]:
            state_flat = False
            state_plus = True
        elif A[i + 1] < A[i]:
            state_flat = False
            state_minus = True
    elif state_plus:
        if A[i] > A[i + 1]:
            state_plus = False
            state_flat = True
            count += 1
    elif state_minus:
        if A[i] < A[i + 1]:
            state_minus = False
            state_flat = True
            count += 1
    # print(count)

print(count + 1)


Measured memory_bytes: 14252
//include
//------------------------------------------
#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>
#include <bits/stdc++.h>
#include<queue>
#include <numeric>
using namespace std;
 
//conversion
//------------------------------------------
inline int toInt(string s) {int v; istringstream sin(s);sin>>v;return v;}
template<class T> inline string toString(T x) {ostringstream sout;sout<<x;return sout.str();}
 
//math
//-------------------------------------------
template<class T> inline T sqr(T x) {return x*x;}
 template<class T>bool chmin(T &a, const T &b) { if (b<a) { a = b; return 1; } return 0; }
//typedef
//------------------------------------------
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef long long LL;
 
//container util
//------------------------------------------
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())
 
//repetition
//------------------------------------------
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)
#define fore(i,a) for(auto &i:a)

//constant
//--------------------------------------------
const double EPS = 1e-10;
const double PI  = acos(-1.0);
 
//clear memory
#define CLR(a) memset((a), 0 ,sizeof(a))
 
//debug
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;
 

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

LL lcm(LL a, LL b){
    LL g = gcd(a,b);
    return a/g *b;
}


int main(){
    long long N;
    cin >> N;
    long long a[N];
    for(int i=0;i<N;++i){
        cin >> a[i];
    }
    sort(a,a+N);
    long long num_max=a[N-1];
    long long num[110000]={0};
    for(int i=0;i<N;++i){
        ++num[a[i]];
    }
    long long ans=num[a[0]];
    for(int i=a[0]+1;i<=num_max+1;++i){
     ans=max(num[i-1]+num[i]+num[i+1],ans);
    }
    cout << ans;
}

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

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

Measured memory_bytes: 1156
import sys,queue,math,copy,itertools,bisect,collections,heapq

def main():
    sys.setrecursionlimit(10**7)
    INF = 10**18
    MOD = 10**9 + 7
    LI = lambda : [int(x) for x in sys.stdin.readline().split()]
    _LI = lambda : [-int(x) for x in sys.stdin.readline().split()]
    NI = lambda : int(sys.stdin.readline())
    SI = lambda : sys.stdin.readline().rstrip()
    DD = ((1,0),(0,1),(-1,0),(0,-1))

    N,M,K = LI()
    A = LI()
    B = LI()

    xa = 0
    xb = 0

    i = 0
    while xa+A[i] <= K:
        xa += A[i]
        i += 1
        if i >= N:
            break
    ans = i
    k = 0
    for j in range(i-1,-1,-1):
        if k >= M: break
        while xa + B[k] <= K:
            xa += B[k]
            k += 1
            if k >= M:
                break
        ans = max(ans,i+k)
        i -= 1
        xa -= A[i]
    if k < M:
        while xa + B[k] <= K:
            xa += B[k]
            k += 1
            if k >= M: break
    ans = max(ans,i+k)

    print(ans)


if __name__ == '__main__':
    main()

Measured memory_bytes: 113292
#include<bits/stdc++.h>
#define rep(i,a,b) for(int i=a;i<b;i++)
#define rrep(i,a,b) for(int i=a;i>=b;i--)
#define fore(i,a) for(auto &i:a)
#pragma GCC optimize ("-O3")
using namespace std; void _main(); int main() { cin.tie(0); ios::sync_with_stdio(false); _main(); }
//---------------------------------------------------------------------------------------------------
/*---------------------------------------------------------------------------------------------------
　　　　　　　　　　　 ∧＿∧  
　　　　　 ∧＿∧ 　（´<_｀ ）　 Welcome to My Coding Space!
　　　　 （ ´_ゝ`）　/　 ⌒i     
　　　　／　　　＼　 　  |　|     
　　　 /　　 /￣￣￣￣/　　|  
　 ＿_(__ﾆつ/　    ＿/ .| .|＿＿＿＿  
　 　　　＼/＿＿＿＿/　（u　⊃  
---------------------------------------------------------------------------------------------------*/



int N;
vector<int> E[201010];
int P[201010];
int A[201010];
//---------------------------------------------------------------------------------------------------
void pre() { // 葉を刈る
    queue<int> que;
    rep(i, 1, N + 1) if (E[i].size() == 0) que.push(i);
    while (!que.empty()) {
        int cu = que.front(); que.pop();
        if (0 <= A[cu]) continue;

        set<int> s;
        int ng = 0;
        fore(to, E[cu]) {
            if (A[to] < 0) ng = 1;
            s.insert(A[to]);
        }

        if (ng) continue;

        int g = 0;
        while (s.count(g)) g++;

        A[cu] = g;
        que.push(P[cu]);
    }
}
//---------------------------------------------------------------------------------------------------
bool check(int i, int x) {
    int pre = x;
    int cu = P[i];
    while (cu != i) {
        set<int> s;
        s.insert(pre);
        fore(to, E[cu]) s.insert(A[to]);
        int g = 0;
        while (s.count(g)) g++;
        pre = g;
        cu = P[cu];
    }

    set<int> s;
    s.insert(pre);
    fore(to, E[i]) s.insert(A[to]);
    int g = 0;
    while (s.count(g)) g++;
    
    return g == x;
}
//---------------------------------------------------------------------------------------------------
void _main() {
    cin >> N;
    rep(i, 1, N + 1) {
        int p; cin >> p;
        E[p].push_back(i);
        P[i] = p;
    }
    rep(i, 1, N + 1) A[i] = -1;

    pre();

    int fixid = 0;
    rep(i, 1, N + 1) if (A[i] < 0) fixid = i;

    set<int> s;
    fore(to, E[fixid]) s.insert(A[to]);
    int fir = 0;
    while (s.count(fir)) fir++;
    int sec = fir + 1;
    while (s.count(sec)) sec++;

    string ans = "IMPOSSIBLE";
    if (check(fixid, fir)) ans = "POSSIBLE";
    else if (check(fixid, sec)) ans = "POSSIBLE";

    cout << ans << endl;
}

Measured memory_bytes: 11904
module.exports=function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=0)}([function(e,t,n){n(1)(n(2).readFileSync("/dev/stdin","UTF-8"))},function(e,t){e.exports=function(e){for(var t=e.split("\n"),n=[t[0].split(""),t[1].split(""),t[2].split("")],r=["A","B","C"],o={a:0,b:1,c:2},u=0;;){if(0==n[u].length)return void console.log(r[u]);u=o[n[u].shift()]}}},function(e,t){e.exports=require("fs")}]);

Measured memory_bytes: 7372
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <cmath>
#include <numeric>
#include <iostream>
#include <sstream>
#include <string>
#include <algorithm>
#include <vector>
#include <map>
#include <queue>
#include <stack>
#include <deque>
#include <list>
#include <unordered_map>
#include <tuple>
#include <complex>


#define FOR(i, a, b)		for(int i = (int)(a); i < (int)(b); ++i)
#define FORE(i, a, b)		for(int i = (int)(a); i <= (int)(b); ++i)
#define REP(i, n)			FOR(i, 0, n)
#define REPE(i, n)			FORE(i, 0, n)
#define ALL(x)				(x).begin(),(x).end()
#define DEBUG_DC(x)			cout << #x << ": " << x << endl
#define VEC_TYPE			int
#define INF					1e5+1

using namespace std;
typedef long long ll;
typedef vector<VEC_TYPE> vdef;
typedef vector<vdef> vvdef;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmaxE(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; }
template<class T> inline bool chminE(T& a, T b) { if (a >= b) { a = b; return 1; } return 0; }
template<typename T> inline T mygcd(T a, T b) { return b ? mygcd(b, a%b) : a; }
template<typename T> inline T mylcm(T a, T b) { return a * b / mygcd(a, b); }


int main()
{
	double w, h, x, y;
	cin >> w >> h >> x >> y;
	cout << 0.5*w*h << " ";
	bool f = 0;
	if (0.5*w == x && 0.5*h == y) f = 1;
	cout << f << endl;
	//int ans = 0;

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

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


vector<pair<long long, long long> > prime_factorize(long long n) {
    vector<pair<long long, long long> > res;
    for (long long p = 2; p * p <= n; ++p) {
        if (n % p != 0) continue;
        int num = 0;
        while (n % p == 0) { ++num; n /= p; }
        res.push_back(make_pair(p, num));
    }
    if (n != 1) res.push_back(make_pair(n, 1));
    return res;
}

int main(){
	// sengen
	long long n;
	// nyuryoku
	cin >> n;
	// keisan
	auto fact = prime_factorize(n);
	long long ans = 0;
	for(auto p:fact){
		long long wari = p.first;
		while(1){
			if(n%wari == 0){
				ans++;
				n = n/wari;
				wari *= p.first;
			}else{
				break;
			}
		}
	}
	// syutsuryoku
	cout << ans;
}

Measured memory_bytes: 3620
#include<bits/stdc++.h>
using namespace std;
#define fo(i,a,b) for(register int (i)=(a);(i)<=(b);++(i))
#define of(i,a,b) for(register int (i)=(a);(i)>=(b);--(i))
#define rd read()
#define maxn 500001
#define int long long
#define fre(a) freopen("a.in","r",stdin);freopen("a.out","w",stdout);
int read() {int x=0,f=1;char ch=getchar();while(!isdigit(ch)){if(ch=='-')f=-1;ch=getchar();}while(isdigit(ch))x=x*10+ch-'0',ch=getchar();return x*f;}
void print(int x) { if(x<0){putchar('-');x=-x;}if(x>9)print(x/10);putchar(x%10+'0');}
int qp(int a, int  b) {int ans = 1;for(; b; b >>= 1, a *= a) if(b & 1) ans *= a;return ans;}
int ans;
signed main() {
    int n=rd,k=rd;
    if(k==100)k++;
    ans=qp(100,n)*k;
    print(ans),puts(" ");
    return 0;
}

Measured memory_bytes: 256
//khodaya khodet komak kon
#include <bits/stdc++.h>

#define F first
#define S second
#define pb push_back
#define all(x) x.begin(), x.end()
#pragma GCC optimise ("ofast")
#pragma GCC optimise("unroll-loops")
#define int long long

using namespace std;

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

const int N = 200000 + 10;
const ll MOD = 1000000000 + 7;
const ll INF = 1000000000000000000;
const ll LOG = 25;

ll n, A, B;

int32_t main(){
	ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
	cin >> n >> A >> B;
	if (A > B) swap(A, B);
	ll dis = abs(B - A);
	if (dis % 2 == 0){
		return cout << dis / 2ll, 0;
	}
	ll ans = n;
	ans = min(ans, A + abs((1) - (B - A)) / 2);
	B = n + 1 - B;
	A = n + 1 - A;
	ans = min(ans, B + abs((1) - (A - B)) / 2);
	cout << ans;










	return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>;
using vs = vector<string>;
using msi = map<string, int>;
using mii = map<int, int>;
using psi = pair<string, int>;
using pii = pair<int, int>;
using vlai = valarray<int>;
#define rep(i,n) for(int i=0;i<n;i++)
#define range(i,s,n) for(int i=s;i<n;i++)
#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define fs first
#define sc second
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define INF 1E9
#define EPS 1E-9
#define MOD 1000000007
#define PI 3.1415926535897932384

std::ostream &operator<<(std::ostream &out, const vector<int> &tgt)
{
	string s;
	for (int i = 0; i<tgt.size(); i++) {
		s += (to_string(tgt[i]) + ((i != tgt.size() - 1) ? " " : ""));
	}
	out << s;
	return out;
}

int main() {
	ll n, a, b, c, d;
	cin >> n >> a >> b >> c >> d;
	ll fin = b - a;
	bool ans = false;
	rep(i, n) {
		ll tab = -n + 1 + 2 * i;
		ll t, b;
		t = c*tab + i*(d - c);
		b = c*tab - (n - 1 - i)*(d - c);
		if (t >= fin&&b <= fin)ans = true;

	}
	
	cout << (ans?"YES":"NO") << endl;
}

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

typedef long long ll;

const int Maxn = 100005;

int n;
int a[Maxn];

int main()
{
	scanf("%d", &n);
	for (int i = 1; i <= n; i++)
		scanf("%d", &a[i]);
	if (a[n] != 2) { printf("-1\n"); return 0; }
	ll lef = 2, rig = 3;
	for (int i = n - 1; i > 0; i--) {
		ll has1 = ((lef - 1) / a[i] + 1) * ll(a[i]);
		ll has2 = rig / a[i] * ll(a[i]);
		if (has1 > has2) { printf("-1\n"); return 0; }
		lef = has1; rig = has2 + ll(a[i] - 1);
	}
	cout << lef << " " << rig << endl;
	return 0;
}

Measured memory_bytes: 640
A,B,C = map(int,input().split())
lst = []
lst.append(A)
lst.append(B)
lst.append(C)

a = max(lst)
lst.remove(a)
b = max(lst)
lst.remove(b)
ans = str(a) + str(b)
ans = int(ans) + int(lst[0])
print(ans)


Measured memory_bytes: 3060
from sys import exit
from collections import deque

K = int(input())
l = 0


def f(l):
    global D, K
    if l == 0:
        K -= 1
        if K == 0:
            print(''.join(map(str, D)))
            exit()
        D.pop()
        return
    d = D[-1]
    for i in (d - 1, d, d + 1):
        if i < 0 or i > 9:
            continue
        D.append(i)
        f(l - 1)
    D.pop()


while True:
    for i in range(1, 10):
        D = deque([i])
        f(l)
    l += 1


Measured memory_bytes: 3564
while True:
    n = int(input())
    if not n+1:
        break
    p = 1 + 0j
    for _ in range(n-1):
        d = p * 1j
        d /= abs(d)
        p += d
    print("{:.2f}\n{:.2f}".format(p.real, p.imag))

Measured memory_bytes: 7492
#include <stdio.h>

int main()
{
    int n, k, q; //6人数 3初期特典 4試行回数
    scanf("%d %d %d", &n, &k, &q);
    int a[q];
    for (int i = 0; i < q; i++)
    {
        scanf("%d", &a[i]);
    }

    int ans[n];

    for (int i = 0; i < n; i++)
    {
        ans[i] = 0;
    }

    for (int i = 0; i < q; i++) //333333：得点,(3132)-1ばんめ
    {
        ans[a[i] - 1]++; // 1
    }

    int sum = 0;
    for (int i = 0; i < n; i++)
    {
        sum += ans[i];
    }

    for (int i = 0; i < n; i++)
    {
        if (k + ans[i] - sum <= 0)
        {
            printf("%s\n", "No");
        }
        else
        {
            printf("%s\n", "Yes");
        }
    }

    return 0;
}

Measured memory_bytes: 1280
#include<iostream>
using namespace std;
int n,q;
int par[10001];
int deep[10001];

void init(){
  for(int i=0;i<=n;i++){
    par[i]=i;
    deep[i]=0;
  }
  //  for(int i=0;i<=n;i++) cout<<par[i]<<endl;
}

int find(int x){
  if(par[x]==x) return x;
  else return par[x]=find(par[x]);
}

void unite(int x,int y){
  x=find(x);
  y=find(y);
  if(x==y) return;
  
  if(deep[x]<deep[y])par[x]=y;
  else{
    par[y]=x;
    if(deep[x]==deep[y]) deep[x]++;
  }
}

bool same(int x,int y){
  // cout<<find(x)<<endl;
  // cout<<find(y)<<endl;
  return find(x)==find(y);
}


int main(){
  int com,x,y;

  cin>>n>>q;
  init();
  for(int i=0;i<q;i++){
    cin>>com>>x>>y;
    if(com==0){
      unite(x,y);
    }else {
      if(same(x,y)==true) cout<<"1"<<endl;
      else cout<<"0"<<endl;
    }
  }
  return 0;
}

Measured memory_bytes: 1228
# I - Coins
N = int(input())
P = list(map(float,input().split()))

# dp[i][j]: 最初の i 枚のコインを投げたとき、表が j 回出る確率
dp = [[0]*(N+1) for _ in range(N+1)]

# 初期条件
# コインを 0 枚投げたとき、表が 0 回出る確率は 1
dp[0][0] = 1

# コインを i 枚投げたとき
for i in range(1,N+1):
    # 表が j 回出たとき
    for j in range(1,i+1):
        # コインが表のときの確率
        dp[i][j] += dp[i-1][j-1]*P[i-1]
        # コインが裏のときの確率
        dp[i][j-1] += dp[i-1][j-1]*(1-P[i-1])
    
# 半分以上表ときの確率
ans = 0
for j in range(N//2 + 1,N+1):
    ans += dp[N][j]
print(ans)

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

using namespace std;

const char ok = '1';
const char no = '0';

struct P{
	int x;
	int y;
	int z;
};

int main()
{
	int a, b, c, n, v;
	char ch[301];
	P p;
	
	while(cin>>a>>b>>c && (a+b+c)){
		cin >> n;
		fill(ch, ch+301, '2');
		vector<P> vec;
		
		while(n--){
			cin >> p.x >> p.y >> p.z >> v;
			if(v == 1){
				ch[p.x] = ch[p.y] = ch[p.z] = ok;
			} else {
				vec.push_back(p);
			}
		}
		
		for(int i = 0; i < vec.size(); i++){
			if(ch[vec[i].x] == ok && ch[vec[i].y] == ok){
				ch[vec[i].z] = no;
			} else if(ch[vec[i].x] == ok && ch[vec[i].z] == ok){
				ch[vec[i].y] = no;
			} else if(ch[vec[i].y] == ok && ch[vec[i].z] == ok){
				ch[vec[i].x] = no;
			}
		}
		for(int i = 1; i <= a+b+c; i++){
			cout << ch[i] << endl;
		}
	}
	
	return 0;
}

Measured memory_bytes: 0
n=int(input())
XL=[list(map(int,input().split())) for i in range(n)]
Range=[[x-l,x+l] for x,l in XL]
ans,end=0,-1*(10**9+1)
Range.sort(key=lambda X: X[1])

for R in Range:
  if end > R[0]:
    continue
  ans += 1
  end=R[1]
print(ans)

Measured memory_bytes: 42792
#include <iostream>
#include <string>
#include <algorithm>
using namespace std;

int main(){

  int N;
  int t[110000], x[110000], y[110000];
  cin >> N;
  t[0] = x[0] = y[0] = 0;
  for (int i = 0; i < N; ++i) cin >> t[i+1] >> x[i+1] >> y[i+1];

  bool can = true;
  for (int i = 0; i < N; ++i){
    int dt = t[i+1] - t[i];
    int dist = abs(x[i+1] - x[i]) + abs(y[i+1] - y[i]);
    if (dt < dist) can = false;
    if ((dt - dist) % 2 != 0) can = false; 
  }

  if (can) cout << "Yes" << endl;
  else cout << "No" << endl;
}

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

#define each(i, c) for (auto& i : c)
#define unless(cond) if (!(cond))

using namespace std;

typedef long long int lli;
typedef unsigned long long ull;
typedef complex<double> point;

template<typename P, typename Q> ostream& operator << (ostream& os, pair<P, Q> p) { os << "(" << p.first << "," << p.second << ")"; return os; }
template<typename P, typename Q> istream& operator >> (istream& is, pair<P, Q>& p) { is >> p.first >> p.second; return is; }
template<typename T> ostream& operator << (ostream& os, vector<T> v) { os << "("; each (i, v) os << i << ","; os << ")"; return os; }
template<typename T> istream& operator >> (istream& is, vector<T>& v) { each (i, v) is >> i; return is; }

template<typename T> inline T setmax(T& a, T b) { return a = std::max(a, b); }
template<typename T> inline T setmin(T& a, T b) { return a = std::min(a, b); }

int main(int argc, char *argv[])
{
  ios_base::sync_with_stdio(0);
  cin.tie(0);

  char g[3][3];
  for (int i = 0; i < 3; ++i) {
    for (int j = 0; j < 3; ++j) {
      cin >> g[i][j];
    }
  }
  for (int i = 0; i < 3; ++i) {
    cout << g[i][i];
  }
  cout << endl;
  
  return 0;
}


Measured memory_bytes: 256
/**
*    Username : adhoc_king
*    Name : adhoc_king
*    Institute : IIT Bombay
*/

// #include <bits/stdc++.h>
#include <algorithm>
#include <iostream>
#include <cstring>
#include <vector>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <string>
// #include <deque>
// #include <queue>
// #include <array>
// #include <ctime>
// #include <list>
#include <map>
// #include <set>
// #include <cassert>
// #include <complex>
// #include <sstream>
// #include <forward_list>
// #include <unordered_set>
// #include <unordered_map>
using namespace std;

#define pb push_back
#define mp make_pair
#define scani(n) scanf("%d",&n);
#define EPS 1e-9
#define FOR(i,n) for(int i=0; i<n; i++)
#define X first
#define Y second
#define arrinput for(int i=0; i<n; i++) cin>>arr[i];
#define arrsum for(int i=0; i<n; i++) sum+=arr[i];
#define for0(i,n) for(int i=0; i<n; i++)
#define for1(i,n) for(int i=1; i<=n; i++)
#define forr(i,n) for(int i=n-1; i>=0; i--)
#define all(v) v.begin(), v.end()

typedef long long ll;
typedef pair<int,int> pii;
typedef vector<int> vi;
typedef vector<pii> vii;

const int MOD = 1e9+7;
const int n_ = 1e5+1000;
const long double PI = acos(-1.0);

ll gcd (ll a, ll b) {return ( a ? gcd(b%a, a) : b );}
ll power(ll a, ll n) {ll p = 1;while (n > 0) {if(n%2) {p = p * a;} n >>= 1; a *= a;} return p;}
ll power(ll a, ll n, ll mod) {ll p = 1;while (n > 0) {if(n%2) {p = p * a; p %= mod;} n >>= 1; a *= a; a %= mod;} return p % mod;}

bool vowel(char ch) {
    if(ch=='a' || ch=='e' || ch=='i' || ch=='o' || ch=='u') return true;
    else return false;
}

int main()
{
    #define int long long
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);

    // freopen("input.txt", "r", stdin);
    // freopen("output.txt", "w", stdout);

    char ch;
    cin>>ch;
    if(ch == 'A') cout<<'T';
    if(ch == 'T') cout<<'A';
    if(ch == 'G') cout<<'C';
    if(ch == 'C') cout<<'G';

    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define _GLIBCXX_DEBUG
#define rng(i,a,b) for(int i=int(a);i<int(b);i++)
#define rep(i,b) rng(i,0,b)
#define gnr(i,a,b) for(int i=int(b)-1;i>=int(a);i--)
#define per(i,b) gnr(i,0,b)
#define bg begin()
#define ed end()
#define rbg rbegin()
#define red rend()
#define all(x) x.bg,x.ed
#define rall(x) x.rbg,x.red
#define pb push_back
#define pf push_front
#define eb emplace_back
using namespace std;
typedef long long ll;
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;}
template<class t,class u> t MAX(t a,u b){if(a>=b) return a; return b;}
template<class t,class u> t MIN(t a,u b){if(a<=b) return a; return b;}
template<class t> int SIZE(t s){return (int)s.size();}
template<class t> using vc=vector<t>;
template<class t> using vvc=vc<vc<t>>;
using vvi=vc<vc<int>>;
using pi=pair<int,int>;
using vi=vc<int>;
void yes(){ cout << "Yes" << endl; }
void no(){ cout << "No" << endl; }
const long long INF = 1LL << 60;

int main(){
    cout << fixed << setprecision(20);
    ll n; cin >> n; n++;
    vc<ll> a(n), su(n+1);
    rep(i,n){
        cin >> a[i];
    }
    rep(i,n){
        su[n-1-i] = su[n-i] + a[n-1-i];
    }
    ll cur = 1,ans = 1;
    rep(i,n-1){
        cur -= a[i];
        if(cur < 0){
            cout << -1 << endl;
            return 0;
        } else {
            ll num = min(cur * 2, su[i+1]);
            ans += num;
            cur = num;
        }
        //cout << cur << " " << i << " " << su[i] << endl;
    }
    if(cur != a[n-1]) cout << -1 << endl;
    else cout << ans << endl;
    return 0;
}


Measured memory_bytes: 4848
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int D , N , ans;
  cin >> D >> N;
  if(N != 100){
    ans = pow(100 , D) * N;
  }
  else{
    ans = pow(100 , D) * (N+1);
  }
  cout << ans << endl;
 
}

Measured memory_bytes: 512
N,M,C=list(map(int,input().split()))
B=list(map(int,input().split()))

a=[]
for i in range(N):
    a.append(list(map(int,input().split())))
cnt=0
for k in range(N):
    sum=0
    for j in range(M):
        sum+=a[k][j]*B[j]

    if sum+C > 0:
        cnt+=1

print(cnt)

Measured memory_bytes: 3064
#include<bits/stdc++.h>                   
    #define FOR(i,a,b) for(int i=a;i<b;++i)
    #define ROF(i,a,b) for(int i=a;i>=b;--i)
    #define vi vector<int>
    #define vlli vector<long long int>
    #define pb push_back
    #define mp make_pair
    #define ll long long
    #define all(c)  ((c).begin()), ((c).end())
    #define dbg(x) cout<<#x<<" = "<<x<<"\n"
    #define FOREACH(i,t) for (auto &i:t)
     
    const ll MOD = 1e9+7;
     
    using namespace std;
     
    int main(void) {
       int n;
       cin>>n;
       ll a[n][3];
       FOR(i,0,n) FOR(j,0,3) cin>>a[i][j];
        ll dp[n][3];
        dp[n-1][0] = a[n-1][0];
        dp[n-1][1] = a[n-1][1];
        dp[n-1][2] = a[n-1][2];
        ROF(i,n-2,0) {
            FOR(j,0,3) {
                dp[i][j] = a[i][j] + max(dp[i+1][(j+1)%3],dp[i+1][(j+2)%3]);
            }
            
        }
        ll ans = 0;
        FOR(i,0,3) ans = max(ans,dp[0][i]);
        cout<<ans;
    }                              

Measured memory_bytes: 4992
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Aoj_Learning2
{
    class Program
    {
        static void Main(string[] args)
        {
            Aoj_Learning14();
        }

        private static void Aoj_Learning14()
        {
            string[] str = new string[100000];
            int n, q = 0;
            int[] S = new int[100000];
            int[] T = new int[50000];
            int count = 0;

            // 数列Sの個数取得
            n = int.Parse(Console.ReadLine());
            // 数列Sを取得(数列Sの条件：昇順)
            str = Console.ReadLine().Split(' ');
            for (int i = 0; i < n; i++)
            {
                S[i] = int.Parse(str[i]);
            }
            // 数列Tの個数取得
            q = int.Parse(Console.ReadLine());
            // 数列Tを取得
            str = Console.ReadLine().Split(' ');
            for (int i = 0; i < q; i++)
            {
                T[i] = int.Parse(str[i]);
            }

            // 数列Sが昇順に並んでることを利用して二分探索する
            for(int i = 0;i < q; i++)
            {
                if(T[i] < S[n/2])
                {
                    for(int j = 0; j < n/2; j++)
                    {
                        if(T[i] == S[j])
                        {
                            count++;
                            break;
                        }
                    }
                }
                else
                {
                    for(int j = n/2; j < n; j++)
                    {
                        if (T[i] == S[j])
                        {
                            count++;
                            break;
                        }
                    }
                }
            }

            Console.WriteLine(count);
        }
    }
}


Measured memory_bytes: 30092
N, Y = map(int, input().split())
Y //= 1000
k = min((Y - N) // 4, Y // 5)
if 9 * k >= 2 * (Y - N):
    x = (Y - N) - 4 * k
    y = -2 * (Y - N) + 9 * k
    z = Y - 5 * k
    print(x, y, z)
else:
    print(-1, -1, -1)



Measured memory_bytes: 2940
#include<iostream>
#include<string>
#include<vector>
#include<utility>
#include<algorithm>
#include<map>
#include<cstdlib>
#include<cmath>
#include<numeric>
#include<iomanip>
#include<functional>
#include<cstdlib>
#include<queue>
#include<deque>
const double PI = acos(-1);
#define rep(i,n)for(int i=0;i<(n);i++)
using namespace std;
using ll =long long;
const int mod = 1000000007;
int ctoi(char c) {
	if (c >= '0' && c <= '9') {
		return c - '0';
	}
	return 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);
};
//fixed << setprecision(2)
bool  Array_check(ll y, ll x,ll d,ll w) {
	if (x < 0 || x >= w || y<0 || y>=d) {
		return false;
	}
	else {
		return true;
	}
	
}
//小文字=大文字+32
int main() {
	ll x, y;
	cin >> x >> y;
	int ans = 0;
	while (x <= y) {
		x *= 2;

		ans++;
	}
	cout << ans;
}


Measured memory_bytes: 3612
// Enjoy your stay.

#include <bits/stdc++.h>

#define EPS 1e-9
#define INF 1070000000LL
#define MOD 1000000007LL
#define fir first
#define foreach(it,X) for(auto it=(X).begin();it!=(X).end();it++)
#define ite iterator
#define mp make_pair
#define mt make_tuple
#define rep(i,n) rep2(i,0,n)
#define rep2(i,m,n) for(int i=m;i<(n);i++)
#define pb push_back
#define sec second
#define sz(x) ((int)(x).size())

using namespace std;

typedef istringstream iss;
typedef long long ll;
typedef pair<ll,ll> pi;
typedef stringstream sst;
typedef vector<ll> vi;

int N,X[100010],Y[100010];

int main(){
	cin.tie(0);
	ios_base::sync_with_stdio(0);
	
	cin>>N;
	int x,y;
	rep(i,N){
		cin>>x>>y;
		X[i]=x-y;
		Y[i]=x+y;
	}
	int loX=*min_element(X,X+N);
	int hiX=*max_element(X,X+N);
	int loY=*min_element(Y,Y+N);
	int hiY=*max_element(Y,Y+N);
	int ans1=0,ans2=0;
	rep(i,N){
		ans1=max(ans1,min(max(X[i]-loX,Y[i]-loY),max(hiX-X[i],hiY-Y[i])));
		ans2=max(ans2,min(max(X[i]-loX,hiY-Y[i]),max(hiX-X[i],Y[i]-loY)));
	}
	cout<<min(ans1,ans2)<<endl;
}

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

template <typename InputIterator>
typename InputIterator::value_type summation(InputIterator first,
                                             InputIterator last) {
  return std::accumulate(first, last, typename InputIterator::value_type());
}
template <typename T>
std::istream &operator>>(std::istream &stream, std::vector<T> &v);
template <typename T1, typename T2>
std::istream &operator>>(std::istream &stream, std::pair<T1, T2> &p);
template <typename T>
std::istream &operator>>(std::istream &stream, std::vector<T> &v) {
  for (auto &i : v) {
    stream >> i;
  }
  return stream;
}
template <typename T1, typename T2>
std::istream &operator>>(std::istream &stream, std::pair<T1, T2> &p) {
  stream >> p.first >> p.second;
  return stream;
}

int main() {
  int64_t h, a;
  std::cin >> h >> a;
  std::cout << (h - 1) / a + 1 << std::endl;
  return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define PI 3.14159265358979323846264338327
#define NUM 1000000007
#define ss second
#define ff first
using namespace std;
int main(){
	ios::sync_with_stdio(0);	
	int a, b, c;
	cin >> a >> b >> c;
	for (int i = 1; i <= 10; i++){
		c = a * c - b;
		cout << c <<"\n";
	}
	return 0;
}

Measured memory_bytes: 256
/* cerberus97 - Hanit Banga */

#include <iostream>
#include <iomanip>
#include <cassert>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <vector>
#include <algorithm>

using namespace std;

#define pb push_back
#define fast_cin() ios_base::sync_with_stdio(false); cin.tie(NULL)

typedef long long ll;
typedef long double ld;
typedef pair <int, int> pii;
typedef pair <ll, ll> pll;

const int N = 210, X = 1e5 + 10, mod = 1e9 + 7;

int s[N], pos[X];
ll choose[N][N], dp[N][X];
ll fact[N];

int main() {
	fast_cin();
	int n, x;
	cin >> n >> x;
	for (int i = 1; i <= n; ++i) {
		cin >> s[i];
	}
	sort(s + 1, s + 1 + n);
	pos[0] = 0;
	for (int i = 1; i <= x; ++i) {
		pos[i] = pos[i - 1];
		if (pos[i] + 1 <= n and s[pos[i] + 1] <= i) {
			++pos[i];
		}
	}
	for (int i = 0; i < N; ++i) {
		choose[i][i] = choose[i][0] = 1;
		for (int j = 1; j < i; ++j) {
			choose[i][j] = (choose[i - 1][j] + choose[i - 1][j - 1]) % mod;
		}
	}
	fact[0] = 1;
	for (int i = 1; i < N; ++i) {
		fact[i] = (i * fact[i - 1]) % mod;
	}
	for (int j = 1; j <= x; ++j) {
		dp[0][j] = j;
	}
	for (int i = 1; i <= n; ++i) {
		for (int j = 1; j <= x; ++j) {
			dp[i][j] += dp[i - 1][j] * (i - 1);
			dp[i][j] %= mod;
			int v = j % s[i];
			int k = pos[v];
			ll temp = dp[k][v] * choose[i - 1][k];
			temp %= mod;
			temp *= fact[i - 1 - k];
			temp %= mod;
			dp[i][j] += temp;
			dp[i][j] %= mod;
		}
	}
	cout << dp[n][x] << endl;
}

Measured memory_bytes: 158720
#include<bits/stdc++.h>
#define eps 1e-9;
#define MOD 1000000007;
#define INV_10 299473306;
using namespace std;
int main()
{
  ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
  int n, x, y;
  cin >> n >> x >> y;
  int d[n+1];
  for(int i = 0; i <= n; i++)
  	d[i]=0;
  for(int i = 1; i <= n; i++)
  {
  	vector<bool>vu(n+1, false);
  	int dis=0;
  	vector<int>bfs;
  	bfs.push_back(i);
  	vu[i]=true;
  	while(!bfs.empty())
  	{
  		int l=bfs.size();
  		d[dis]+=l;
  		for(int j = 0; j < l; j++)
  		{
  			if(bfs[j]+1 <= n && !vu[bfs[j]+1])
  			{
  				vu[bfs[j]+1]=true;
  				bfs.push_back(bfs[j]+1);
  			}
  			if(bfs[j]-1 >= 1 && !vu[bfs[j]-1])
  			{
  				vu[bfs[j]-1]=true;
  				bfs.push_back(bfs[j]-1);
  			}
  			if((bfs[j]==x && !vu[y]))
  			{
  				vu[y]=true;
  				bfs.push_back(y);
  			}
  			if((bfs[j]==y && !vu[x]))
  			{
  			    vu[x]=true;
  				bfs.push_back(x);
  			}
  		}
  		dis++;
  		bfs.erase(bfs.begin(), bfs.begin()+l);
  	}
  }
  for(int i = 1; i < n; i++)
  	cout << d[i]/2 << '\n';
}

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

#define INF 1e18
#define MAX (1e9+5)

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

using ll = long long;

// auto mod int
// https://youtu.be/L8grWxBlIZ4?t=9858
// https://youtu.be/ERZuLAxZffQ?t=4807 : optimize
// https://youtu.be/8uowVvQ_-Mo?t=1329 : division
const int mod = 1000000007;
struct mint {
  ll x; // typedef long long ll;
  mint(ll x=0):x((x%mod+mod)%mod){}
  mint operator-() const { return mint(-x);}
  mint& operator+=(const mint a) {
    if ((x += a.x) >= mod) x -= mod;
    return *this;
  }
  mint& operator-=(const mint a) {
    if ((x += mod-a.x) >= mod) x -= mod;
    return *this;
  }
  mint& operator*=(const mint a) { (x *= a.x) %= mod; return *this;}
  mint operator+(const mint a) const { return mint(*this) += a;}
  mint operator-(const mint a) const { return mint(*this) -= a;}
  mint operator*(const mint a) const { return mint(*this) *= a;}
  mint pow(ll t) const {
    if (!t) return 1;
    mint a = pow(t>>1);
    a *= a;
    if (t&1) a *= *this;
    return a;
  }

  // for prime mod
  mint inv() const { return pow(mod-2);}
  mint& operator/=(const mint a) { return *this *= a.inv();}
  mint operator/(const mint a) const { return mint(*this) /= a;}
};
istream& operator>>(istream& is, mint& a) { return is >> a.x;}
ostream& operator<<(ostream& os, const mint& a) { return os << a.x;}

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

  if (n<=2) {
    cout << 0 << endl;
    return 0;
  }

  vector< vector<mint> > dp(n+1,vector<mint>(n+1));
  dp[3][1] = 1;
  rep(i,n) rep(j,n) {
    if (!dp[i][j].x) continue;
    dp[i+1][j]+=dp[i][j];
    if (i+3<=n) dp[i+3][j+1]+=dp[i][j];
  }
  mint ans = 0;
  rep(i,n+1) ans += dp[n][i];
  cout << ans << endl;

  return 0;
}


Measured memory_bytes: 34536
#include <stdio.h>
int main(){
	int n[10000];
	int i=0;
	while(1){
		scanf("%d", &n[i]);
		if(!n[i]){
			break;
		}
		i++;
	}
	int limit=i;
	i=0;
	for(i=0;i<limit;i++){
		printf("Case %d: %d\n", i+1, n[i]);
	}
	
	return 0;
}



Measured memory_bytes: 1776
import java.util.*;

public class Main {

	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		int a = in.nextInt();
		int b = in.nextInt();
		int c = in.nextInt();
		int temp = 0;
		
		temp = a;
		a = b;
		b = temp;
		
		temp= c;
		c = a;
		a = temp;
		
		System.out.print(a + " " + b + " " + c);
		
	}
	
}

Measured memory_bytes: 21716
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
	   Scanner scan = new Scanner(System.in);
	   int a = scan.nextInt();
	   int b = scan.nextInt();
	   int c = scan.nextInt();
	   
	   int numDivisors = 0;
	   
	   while(a <= b) {
	      if(c%a == 0) numDivisors++;
		  a++;
	   }
			 
	   System.out.println(numDivisors);
	}

}






Measured memory_bytes: 26444
#include <iostream>
#include <string>
#include <vector>
#include <queue>
#include <algorithm>

using namespace std;
typedef long long ll;

int main()
{
	string s; cin >> s;
	if (s[0] < 'a') cout << 'A' << endl;
	else cout << 'a' << endl;
}



Measured memory_bytes: 3124
using System;
class Program
{
    static void Main(string[] args)
    {
        // 解
        int ans = 0;

        // 入力
        string[] inp = Console.ReadLine().Split(' ');
        int a = int.Parse(inp[0]);
        int b = int.Parse(inp[1]);
        int c = int.Parse(inp[2]);

        ans = c > (b / a) ? b / a : c; 
        
        //出力
        Console.WriteLine(ans);
    }
}


Measured memory_bytes: 11092
#include <iostream>

using namespace std;

int main()
{
 int x,y,z,w;
 cin>>x>>y>>z;
 long long  arr[10];
 arr[0]=(x*z)-y;
 cout<<arr[0]<<endl;
 for(int i=1;i<10;i++){
 arr[i]=(x*arr[i-1])-y;
 cout<<arr[i]<<endl;}
    return 0;
}


Measured memory_bytes: 256