akhauriyash/Code-Regression huggingface dataset:
//Mahir Ratanpara (DA-IICT)
#include<bits/stdc++.h>
using namespace std;
#define Ff(i,a,n) for(i=a;i<n;i++)
#define Fr(i,a,n) for(i=a;i>n;i--)
#define ll long long
#define FAST ios_base::sync_with_stdio(false),cin.tie(0),cout.tie(0);
#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define all(x) x.begin(), x.end()
#define clr(x) memset(x, 0, sizeof(x))
#define sortall(x) sort(all(x))
#define tr(it, a) for(auto it = a.begin(); it != a.end(); it++)
typedef pair<ll, ll>	pa;
typedef vector<ll>		vc;
typedef vector<pa>		vp;
typedef vector<vc>		vvc;
int mpow(int base, int exp); 
void ipgraph(ll n,ll m);
void dfs(int u, int par);
const int mod = 1000000007;
const int N = 3e5, M = N;
//=======================

vc g[N];

int main() {
    FAST;
    ll t, i, j, k, p, q, r, x, y, u, v, n, m;
    cin>>n;
    ll ans=n-1;
    for(i=2;i*i<=n;i++)
    {
      if(n%i==0)
      {
        ans=min(i-1+n/i-1,ans);
      }
    }
    cout<<ans;
    return 0;
}

int mpow(int base, int exp) {
  base %= mod;
  int result = 1;
  while (exp > 0) {
    if (exp & 1) result = ((ll)result * base) % mod;
    base = ((ll)base * base) % mod;
    exp >>= 1;
  }
  return result;
}

void ipgraph(ll n, ll m){
	int i, u, v;
	while(m--){
		cin>>u>>v;
		g[u-1].pb(v-1);
		g[v-1].pb(u-1);
	}
}

void dfs(int u, int par){
	for(int v:g[u]){
		if (v == par) continue;
		dfs(v, u);
	}
}

Measured memory_bytes: 7296
#include <stdio.h>
#include <stdlib.h>
#include <math.h>

#define MAX 1000000

int main(){
	bool p[MAX+1];
	int num,answer;

	while( scanf("%d" , &num) != EOF ){	
		p[0] = false;
		p[1] = false;
		for(int i=2 ; i<=MAX ; i++){
			p[i] = true;
		}
		answer = 0;

		for(int i=2 ; i<=sqrt(MAX)+1 ; i++){
			if(p[i]==1){
				for(int j=i*2; j<=MAX; j=j+i){
					p[j] = false;
				}
			}
		}

		for(int i=0; i<=num; i++){
			if(p[i]){
				answer++;
			}
		}
		printf("%d\n", answer);
	}
}

Measured memory_bytes: 1736
#include <stdio.h>
int main(void){
  int count = 0, n;
  scanf("%d", &n);
  for(int i = 1; i <= n; i++){
    if(i < 10 || (99 < i && i < 1000) || (9999 < i && i < 100000)){
      count++;
    }
  }
  printf("%d\n", count);
  return 0;
}

Measured memory_bytes: 128
#include <bits/stdc++.h>
#define REV(v) reverse(v.begin(), v.end());
#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, start, stop) for (int i = start; i < stop; i++)
#define FORR(i, start, stop) for (int i = start; i > stop; i--)
#define SORT(v, n) sort(v, v + n);
#define SORTR(v, n) sort(v, v + n,greater<int>());
#define VSORT(v) sort(v.begin(), v.end());
#define VSORTR(v) sort(v.begin(), v.end(),greater<int>());
#define REMOVE(v,n) remove(vector<int> v,v+v.size(),int n)
#define ll long long
#define ull unsigned long long
#define pb(a) push_back(a)
#define INF 999999999
#define V(v,i,j) vector(v.begin() + i, v.begin() + j)
#define INSERT(va,vb) va.insert(va.end(), vb.begin(), vb.end())
using namespace std;
typedef vector<int> vint;
typedef pair<int, int> P;
typedef pair<ll, ll> LP;
typedef pair<int, P> PP;
typedef pair<ll, LP> LPP;

int dy[] = {0, 0, 1, -1};
int dx[] = {1, -1, 0, 0};
const int MOD = 1000000007;

//vector< vector<int> > v (size1, vector<int>(size2) );

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    ll N,W;
    cin>>N>>W;
    vector<ll> w(N),v(N);
    FOR(i,0,N) cin>>w[i]>>v[i];
    ll dp[N+1][W+1];
    //↓注意
    FOR(j,0,W+1){
        dp[0][j]=-10e10;
    }
    dp[0][0]=0;
    FOR(i,0,N){
        FOR(j,0,W+1){
            if(j-w[i]>=0)dp[i+1][j]=max(dp[i][j],dp[i][j-w[i]]+v[i]);
            else dp[i+1][j]=dp[i][j];
            //cout<<"i "<<i<<" j "<<j<<' '<<dp[i][j]<<endl;
        }
    }
    ll ans=0;
    FOR(i,0,N+1){
        FOR(j,0,W+1){
            ans=max(ans,dp[i][j]);
        }
    }
    cout<<ans<<endl;
}

Measured memory_bytes: 79232
#include <algorithm>
#include <cmath>
#include <iostream>
#include <string>
#include <vector>

int main()
{
    long long a, b;
    int k;
    std::cin >> a >> b >> k;
    for (int i = 0; i < k; i++)
    {
        if (i % 2 == 0)
        {
            if (a % 2 != 0) { a--; }
            a -= (a / 2);
            b += a;
        }
        else
        {
            if (b % 2 != 0) { b--; }
            b -= (b / 2);
            a += b;
        }
    }

    std::cout << a << ' ' << b << std::endl;
    return 0;
}

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

typedef long long ll;
typedef long double Double;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)

// chmax, chmin
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;
}


template<typename T>
class CumulativeSum {
    const int n;
    std::vector<T> sum_data;
public:
    CumulativeSum(vector<T> data) : n(data.size()) {
        sum_data.resize(n + 1);
        for (int i = 0; i < n; i++) {
            sum_data[i + 1] = sum_data[i] + data[i];
        }
    }

    // 区間 [l, r) 番目の範囲の和を求める．(l = r のときは 0 を返す．)
    T sum(int l, int r) const {
        assert(0 <= l && l <= r && r <= n);
        return sum_data[r] - sum_data[l];
    }
};
typedef CumulativeSum<ll> CumSum;

void solve(long long N, std::vector<std::vector<long long>> A) {
  vector<CumSum> s;
  for(int i = 0 ; i < 2 ; i++){
    s.push_back(CumSum(A[i]));
  }
  ll ans = 0;
  for(int i = 0 ; i < N ; i++){
    ans = max(ans, s[0].sum(0, i+1) + s[1].sum(i, N));
  }
  cout << ans << endl;
}

int main() {
  long long N;
  scanf("%lld", &N);
  std::vector<std::vector<long long>> A(2, std::vector<long long>(N));
  for (int i = 0; i < 2; i++) {
    for (int j = 0; j < N; j++) {
      scanf("%lld", &A[i][j]);
    }
  }
  solve(N, std::move(A));
  return 0;
}


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

int main(void) {
	using namespace std;
	int N, Q, K;
	const int MAX_V = 100001;
	vector<pair<int, long long>> graph[MAX_V];
	cin >> N;
	for(int i = 0; i < N - 1; ++i) {
		int a, b;
		long long c;
		cin >> a >> b >> c;
		--a;
		--b;
		graph[a].push_back(make_pair(b, c));
		graph[b].push_back(make_pair(a, c));
	}
	cin >> Q >> K;
	--K;
	//Dijkstra
	const long long INF = 1000000001L * MAX_V;
	long long d[MAX_V];
	fill(d, d + N, INF);
	d[K] = 0;
	priority_queue<pair<int, long long>, vector<pair<int, long long>>, greater<pair<int, long long>>> q;
	q.push(make_pair(K, 0));//(vertex, distance);
	while(!q.empty()) {
		pair<int, long long> a = q.top();
		q.pop();
		if(d[a.first] < a.second) continue;
		for(int i = 0; i < graph[a.first].size(); ++i) {
			pair<int, long long> e = graph[a.first][i];
			if(d[e.first] > d[a.first] + e.second) {
				d[e.first] = d[a.first] + e.second;
				q.push(make_pair(e.first, d[e.first]));
			}
		}
	}
	for(int i = 0; i < Q; ++i) {
		int x, y;
		cin >> x >> y;
		--x;
		--y;
		cout << (d[x] + d[y]) << '\n';
	}
	return 0;
}


Measured memory_bytes: 11120
#include <bits/stdc++.h>
using namespace std;
 
#define REP(i, s) for (int i = 0; i < s; ++i)
#define ALL(v) (v).begin(), (v).end()
#define COUT(x) cout << #x << " = " << (x) << " (L" << __LINE__ << ")" << endl
#define EACH(i, s) for (__typeof__((s).begin()) i = (s).begin(); i != (s).end(); ++i)
#define DEBUG
#define int long long
#define INF 1e18
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; }
template<class T1, class T2> ostream& operator << (ostream &s, pair<T1,T2> P)
{ return s << '<' << P.first << ", " << P.second << '>'; }
template<class T> ostream& operator << (ostream &s, vector<T> P)
{ for (int i = 0; i < P.size(); ++i) { if (i > 0) { s << " "; } s << P[i]; } return s; }
template<class T> ostream& operator << (ostream &s, vector<vector<T> > P)
{ for (int i = 0; i < P.size(); ++i) { s << endl << P[i]; } return s << endl; }
template<class T> ostream& operator << (ostream &s, set<T> P)
{ EACH(it, P) { s << "<" << *it << "> "; } return s << endl; }
template<class T1, class T2> ostream& operator << (ostream &s, map<T1,T2> P)
{ EACH(it, P) { s << "<" << it->first << "->" << it->second << "> "; } return s << endl; }
template<class T>void show(vector<T>v){for (int i = 0; i < v.size(); i++){cerr<<v[i]<<" ";}cerr<<"\n";}
typedef long long ll;


signed main()
{
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    int n;
    cin >> n;
    vector<int> a(n);
   // vector<int> prime(1e6 + 1,0);
    vector<int> mp(1e6+1,0);
    multiset<int> st;
    for (int i = 0; i < n; i++)
    {
        cin >> a[i];
        mp[a[i]]++;
    }

    int cnt = 0;
    for (int i = 0; i < n; i++)
    {
        int x = a[i];
         mp[a[i]]--;
         bool ok = true;
        vector<int> p;
       
        for (int j = 1; j * j <= x; j++)
        {
            if(x%j==0){
                if(mp[j] > 0){
                    ok = false;
                    break;
                }
                if(j*j!=x){
                    if(mp[x/j] >0){
                        ok = false;
                        break;
                    }
                }
            }
        }
        if(ok){
            cnt++;
        }
        mp[a[i]]++;
        
    }
    cout << cnt << endl;
    return 0;
}

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

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

  int min = 10000000;
  vector<int> a(n);


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

    int cnt = 0;
    while(a[i] % 2 != 1){
      cnt++;
      a[i] /= 2;

}

    if(min > cnt) min = cnt;
    if(min == 0) break;
  }

  cout << min << endl;

  return 0;

}

Measured memory_bytes: 256
#include<cstdio>
using namespace std;
long long a,b,k;
int main()
{
    scanf("%lld%lld%lld",&k,&a,&b);
    if(k<=a)return puts("1"),0; 
    else if(a<=b)return puts("-1"),0;   
    else printf("%lld\n",((k-a)/(a-b)+bool((k-a)%(a-b)))<<1|1);
}

Measured memory_bytes: 128
// https://atcoder.jp/contests/abc149/tasks/abc149_d
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define REP(i, n) FOR(i, 0, n)
#define REPR(i, n) for (int i = n - 1; i >= 0; i--)
#define FOR(i, s, n) for (int i = (s), i##_len = (n); i < i##_len; ++i)
#define ALL(obj) (obj).begin(), (obj).end()
#define ALLR(obj) (obj).rbegin(), (obj).rend()
#define DIV(a, b) ((a - 1) / b + 1)
// int gcd(int a, int b) { return b ? gcd(b, a % b) : a; }
// int lcm(int c, int d) { return c / gcd(c, d) * d; }

enum RSP { RSP_R, RSP_S, RSP_P };

signed main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    int N, K, R, S, P;
    cin >> N >> K >> R >> S >> P;
    string str;
    cin >> str;

    // K回目までは必ず勝てる
    vector<vector<int>> score(3, vector<int>(N));

    // R: グー (Rock)
    // S: チョキ (Scissors)
    // P: パー (Paper)
    REP(i, K) {
        if (str[i] == 'r') {
            // 相手グーなのでパーで勝つ
            score[RSP_P][i] = P;
        } else if (str[i] == 's') {
            // 相手チョキなのでグーで勝つ
            score[RSP_R][i] = R;
        } else if (str[i] == 'p') {
            // 相手パーなのでチョキで勝つ
            score[RSP_S][i] = S;
        }
    }

    FOR(i, K, str.length()) {
        int t = 0;
        REP(j, 3) { t = max(t, score[j][i - K]); }
        if (str[i] == 'r') {
            // 相手グーなのでパーで勝つ
            score[RSP_P][i] = max(score[RSP_R][i - K], score[RSP_S][i - K]) + P;
            score[RSP_R][i] = t;
            score[RSP_S][i] = t;
        } else if (str[i] == 's') {
            // 相手チョキなのでグーで勝つ
            score[RSP_R][i] = max(score[RSP_S][i - K], score[RSP_P][i - K]) + R;
            score[RSP_S][i] = t;
            score[RSP_P][i] = t;
        } else if (str[i] == 'p') {
            // 相手パーなのでチョキで勝つ
            score[RSP_S][i] = max(score[RSP_R][i - K], score[RSP_P][i - K]) + S;
            score[RSP_R][i] = t;
            score[RSP_P][i] = t;
        }
    }
    int ans = 0;
    for (int i = str.length() - K; i < (int)str.length(); i++) {
        int t = 0;
        REP(j, 3) { t = max(t, score[j][i]); }
        ans += t;
    }
    cout << ans << endl;

    return 0;
}


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

using LL = long long;
const int maxn = 3030;
int n;
LL a[maxn];

signed main() {
  // freopen("in", "r", stdin);
  while(~scanf("%d",&n)) {
    LL lcm;
    LL ret = 0;
    for(int i = 1; i <= n; i++) {
      scanf("%lld", &a[i]);
      ret += a[i];
    }
    printf("%lld\n", ret-n);
  }
  return 0;
}

Measured memory_bytes: 256
from math import sqrt
from typing import List, Tuple


def project(point: complex, begin: complex, end: complex) -> complex:
    tmp = (point - begin) / (end - begin)
    return tmp.real * (end - begin) + begin


if __name__ == "__main__":
    x, y, r = map(int, input().split())
    c = complex(x, y)
    ans: List[Tuple[float, float, float, float]] = []
    q = int(input())

    for _ in range(q):
        res = []
        x, y, z, w = map(int, input().split())
        p1, p2 = complex(x, y), complex(z, w)
        proj = project(c, p1, p2)
        for i in (-1, 1):
            res.append(proj + i * sqrt(
                       r**2 - abs(c - proj)**2) * (p2 - p1) / abs(p2 - p1))
        res.sort(key=lambda x: (x.real, x.imag))
        ans.append((res[0].real, res[0].imag, res[1].real, res[1].imag))

    for a in ans:
        print("{:.6f} {:.6f} {:.6f} {:.6f}".format(*a))



Measured memory_bytes: 7284
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
 
 
public class Main{
 
    public static void main(String[] args) throws IOException {
        BufferedReader buf = new BufferedReader(new InputStreamReader(System.in));
         
        int n = Integer.parseInt(buf.readLine());
        String[] str = buf.readLine().split(" ");
     
        long sum = 0;
        int max = Integer.MIN_VALUE, min = Integer.MAX_VALUE, tmp = 0; 
        for (int i = 0; i < n; i++) {
            tmp = Integer.parseInt(str[i]);
            if(tmp < min)min = tmp;
            if(tmp > max)max = tmp;
            sum = sum + tmp;
        }
        System.out.println(min+" "+max+" "+sum);
    }
 
}

Measured memory_bytes: 25584
#include<iostream>
#include<string>
using namespace std;
int main()
{
  string s,t;
  cin>>s>>t;
  int count;
  int len=s.length();
  for(int i=0;i<s.length();i++)
  {
    if(s[i]==t[i])
      count++;
  }
  if(count==s.length())
    cout<<"Yes"<<endl;
  else
    cout<<"No"<<endl;
  return 0;
}

Measured memory_bytes: 3596
import sys
from io import StringIO
import unittest

class TestClass(unittest.TestCase):
    def assertIO(self, input, output):
        stdout, stdin = sys.stdout, sys.stdin
        sys.stdout, sys.stdin = StringIO(), StringIO(input)
        resolve()
        sys.stdout.seek(0)
        out = sys.stdout.read()[:-1]
        sys.stdout, sys.stdin = stdout, stdin
        self.assertEqual(out, output)
    def test_入力例_1(self):
        input = """3
10 2 5
6 3 4"""
        output = """5"""
        self.assertIO(input, output)
    def test_入力例_2(self):
        input = """4
13 21 6 19
11 30 6 15"""
        output = """6"""
        self.assertIO(input, output)
    def test_入力例_3(self):
        input = """1
1
50"""
        output = """0"""
        self.assertIO(input, output)
def resolve():
    N=int(input())
    A=[int(i) for i in input().split()]
    B=[int(i) for i in input().split()]
    print(sum([max(A[i]-B[i],0) for i in range(N)]))

if __name__ == "__main__":
    resolve()

Measured memory_bytes: 51312
import bisect
n = int(input())
A = list(map(int, input().split(' ')))
B = list(map(int, input().split(' ')))
C = list(map(int, input().split(' ')))

A.sort()
B.sort()
C.sort()
ans = 0
for j in range(n):
    i = bisect.bisect_left(A, B[j])
    k = n - bisect.bisect_right(C, B[j])
    ans += int(i*k)
print(ans)

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

#define forn(i, n) for(int i = 0; i < (int)(n); i++)
#define ford(i, n) for (int i = (int)(n) - 1; i >= 0; --i)
#define forab(i, a, b) for(int i=(a);i<(b);++i)
#define foreach(i, n) for (__typeof(n.begin()) i = n.begin(); i != n.end(); ++i)
#define sqr(x) ((x)*(x))
#define clr(a, b) memset(a, b, sizeof(a))
#define SZ(a) ((int)a.size())
#define inf 0x3f3f3f3f
typedef vector<int> vi;
typedef pair<int, int> pii;
typedef long long ll;
const double eps = 1e-8;
int dcmp(double x) { if (x < -eps) return -1; else return x > eps;}
#define se(x) cout<<#x<<" = "<<x<<endl

const int N = 1010;
int a[N];

int solve(int n, int x) {
	sort(a, a + n);
	int ret  = 0;
	forn (i, n-1) {
		if (x >= a[i]) {
			x -= a[i];
			ret++;
		} else {
			break;
		}
	}
	if (x == a[n-1]) ret++;
	return ret;
}

int main(int argc, char *argv[]) {
	int n, x;
	while (scanf("%d%d", &n, &x) != EOF) {
		forn (i, n) {
			scanf("%d", a+i);
		}
		int ret = solve(n, x);
		printf("%d\n", ret);
	}
	return 0;
}



Measured memory_bytes: 256
N=int(input())
S=[''.join(sorted((input()))) for i in range(N)]
P={}
for i in range(N):
    if S[i] in P:
        P[S[i]]+=1
    else:
        P[S[i]]=0
for i in P.keys():
    if P[i]>=2:
        P[i]=P[i]*(P[i]+1)/2
print(int(sum(P.values())))

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

const int MOD = 1e9 + 7;

int main() {
  int h, w;
  cin >> h >> w;
  vector<string> a(h);
  for (int i = 0; i < h; i++) {
    cin >> a[i];
  }
  vector<vector<int>> dp(h, vector<int>(w, 0));
  vector<vector<bool>> used(h, vector<bool>(w, false));
  queue<P> q;
  dp[0][0] = 1;
  q.push({0, 0});
  while (!q.empty()) {
    int i, j;
    tie(i, j) = q.front();
    q.pop();
    if (i >= h || j >= w) continue;
    if (used[i][j]) continue;
    if (i + 1 < h && a[i + 1][j] == '.') {
      dp[i + 1][j] += dp[i][j];
      dp[i + 1][j] %= MOD;
      q.push({i + 1, j});
    }
    if (j + 1 < w && a[i][j + 1] == '.') {
      dp[i][j + 1] += dp[i][j];
      dp[i][j + 1] %= MOD;
      q.push({i, j + 1});
    }
    used[i][j] = true;
  }
  cout << dp[h - 1][w - 1] << endl;
}


Measured memory_bytes: 5504
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <ctime>
#include <string>
#include <vector>
#include <map>
#include <list>
#include <stack>
#include <queue>
#include <utility>
#include <algorithm>
#include <functional>
#include <cassert>

#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define REP(i,n) for(int i=0;i<n;i++)
#define DEBUG(x) cout<<#x<<": "<<x<<endl;
#define ALL(a) (a).begin(),(a).end()

#define pb push_back

using namespace std;
typedef unsigned long ul;
typedef long long ll;
typedef vector<int> vi;
typedef vector<vi> vii;

int max(vi a, int j) {
    int max = -1;
    int idx = -1;
    REP(i,a.size()) {
        if (i == j) continue;
        if (max < a[i]) {
            idx = i;
            max = a[i];
        }
    }

    if (max == 0) return -1;
    return idx;
}

int min(vi a, int j) {
    int min = 10001;
    int idx = -1;
    REP(i,a.size()) {
        if (i == j) continue;
        if (a[i] == 0) continue;
        if (min > a[i]) {
            idx = i;
            min = a[i];
        }
    }

    return idx;
}

int main() {
    int k, t;
    cin >> k >> t;
    vi a;

    REP(i,t){
        int tmp;
        cin >> tmp;
        a.pb(tmp);
    }

    int c = 0;
    int j = -1;
    while (true) {
        int max_idx = max(a, j);
        if (max_idx == -1) max_idx = max(a, -1);

        if (max_idx != -1) {
            if (max_idx == j) c++;
            a[max_idx]--;
            j = max_idx;
        } else {
            cout << c << endl;
            return 0;
        }

        int min_idx = min(a, j);
        if (min_idx == -1) min_idx = min(a, -1);
        if (min_idx != -1) {
            if (min_idx == j) c++;
            a[min_idx]--;
            j = min_idx;
        }

    }

}




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

int main () {
  int N;
  cin >> N;
  int A[210];
  for (int i = 0; i < N; i++) {
    cin >> A[i];
  }

  int count = 0;
  int flag = 0;

  while(true) {
    for (int i = 0; i < N; i++) {
      if(A[i] % 2 != 0) {
        flag = 1;
        break;
      }
    }
    if (flag == 1) break;
    for (int i = 0; i < N; i++) {
      A[i] /= 2;
    }
    count++;
  }

  cout << count << endl;

}


Measured memory_bytes: 256
using System;

namespace AOJ.ALDS
{
    public class Allocation
    {
        public static void Main()
        {
            var input = Console.ReadLine().Split(' ');
            int pack_num = int.Parse(input[0]);
            int track_num = int.Parse(input[1]);

            ulong[] list = new ulong[pack_num];
            for (int i = 0; i < pack_num; i++) { list[i] = ulong.Parse(Console.ReadLine()); }

            // バイナリサーチ
            ulong max = 100000 * 10000; // 必要な積載量の最大値
            ulong min = 1;
            while (max > min)
            {
                ulong mid = (min + max) / 2;

                // トラックに荷物を積む
                int cnt = 1;
                ulong current = 0;
                for (int i = 0; i < pack_num; i++)
                {
                    // 荷物の大きさが積載量を超えたら失敗
                    if (list[i] > mid)
                    {
                        cnt = track_num + 1;
                        break;
                    }

                    if (current + list[i] > mid)
                    {
                        // 次のトラックへ
                        cnt++;
                        current = list[i];
                    }
                    else { current += list[i]; }
                }
                // 荷物が積めたか判定
                if (cnt <= track_num) { max = mid; }
                else { min = mid + 1; }
            }
            Console.WriteLine(max);
        }
    }
}

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

#define dcm(x) cerr << #x << ": " << x << endl;

using namespace std;

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

int main() {
    //clock_t start = clock();
    ios::sync_with_stdio(false); cin.tie(0);
    //freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);
    long long int a, b; cin >> a >> b;
    long long int cnt = 0;
    if (a<=0 && b>=0) {
        cout << "Zero" << endl;
        return 0;
    }
    for (long long int i=a; i<=b; ++i) {
        if (i < 0) {
            cnt++;
        }
    }
    if (cnt % 2 != 0) {
        cout << "Negative" << endl;
    } else {
        cout << "Positive" << endl;
    }
    //clock_t stop = clock();
    //cout << (double)(stop-start)/CLOCKS_PER_SEC << " (s)" << endl;
    return 0;
}


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

int main(){
  int n;
  cin >> n;
  vector<int> a(n);
  rep(i,n) cin >> a[i];
  int nxt=1,ans=0;//nxt=次に来るべき数、ans=消した個数
  rep(i,n){
    if (nxt==a[i]){
      ++nxt;
    }else {
      ++ans;
    }
  }
  if (ans==n) ans=-1;
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 1024
using System;

namespace b
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] input = Console.ReadLine().Split(' ');
            int h = int.Parse(input[0]);
            int w = int.Parse(input[1]);
            Console.WriteLine(h * w + " " + (2 * h + 2 * w));

        }
    }
}



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

int main(){
  int n;
  cin >> n;
  if(n % 10 == 0) cout << 10 << endl;
  else{
    int ans = 0;
    while(n != 0){
      ans += n % 10;
      n /= 10;
    }
    cout << ans << endl;
  }
}

Measured memory_bytes: 3508
import sys
input = sys.stdin.readline
class UnionFind(object):
    def __init__(self, size):
        self.parent = [i for i in range(size)]
        self.rank = [0 for _ in range(size)]


    def find(self, x):
        if self.parent[x] == x:
            return x
        else:
            return self.find(self.parent[x])


    def unite(self, x, y):
        x = self.find(x)
        y = self.find(y)
        if x == y:
            return

        if self.rank[x] < self.rank[y]:
            self.parent[x] = y
        else:
            self.parent[y] = x
            if self.rank[x] == self.rank[y]:
                self.rank[x] += 1

    def same(self, x, y):
        return self.find(x) == self.find(y)
def compute_mst_kruskal(N, edges):#N = 頂点数、edges 0-indexed
    edges = sorted(edges, key = lambda x:x[2])
    UF = UnionFind(N)
    cost = 0
    for edge in edges:
        x, y, w = edge
        if not UF.same(x, y):
            UF.unite(x, y)
            cost+=w
    return cost
N = int(input())
ixy = []
for i in range(N):
    x, y = map(int, input().split())
    ixy.append((i, x, y))
xy_x = sorted(ixy, key = lambda x:x[1])
xy_y = sorted(ixy, key = lambda x:x[2])
edges = []
for i in range(N-1):
    i1, x1, y1 = xy_x[i]
    i2, x2, y2 = xy_x[i+1]
    edges.append((i1, i2, x2-x1))
    i1, x1, y1 = xy_y[i]
    i2, x2, y2 = xy_y[i+1]
    edges.append((i1, i2, y2-y1))
ans = compute_mst_kruskal(N, edges)
print(ans)


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

using namespace std;

int main(void) {
    unsigned long long t1, t2, a1, a2, b1, b2;
    cin >> t1 >> t2 >> a1 >> a2 >> b1 >> b2;
    unsigned long long sa = t1 * a1 + t2 * a2, sb = t1 * b1 + t2 * b2;
    if (sa == sb) {
        cout << "infinity" << endl;
    } else {
        if (sa > sb) {
            swap(sa, sb);
            swap(a1, b1);
            swap(a2, b2);
        }
        if (a1 < b1) {
            cout << 0 << endl;
        } else {
            auto delta = t1 * (a1 - b1);
            auto sum_delta = sb - sa;
            auto times = delta / sum_delta;
            if (times * sum_delta == delta) {
                cout << times * 2 << endl;
            } else {
                cout << times * 2 + 1 << endl;
            }
        }
    }
    return 0;
}

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

//repetition
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define rep(i, n) for(int i = 0; i < (int)(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;


//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();}


int main(){
    ll x,y,z,k;
    cin >> x >> y >> z >> k;
    VLL a(x);
    VLL b(y);
    VLL c(z);

    rep(i,x) cin >> a[i];
    rep(i,y) cin >> b[i];
    rep(i,z) cin >> c[i];
    sort(all(a),greater<ll>());
    sort(all(b),greater<ll>());
    sort(all(c),greater<ll>());

    VLL s;
    int index = 0;
    rep(i,min(k,x)){
        rep(j,min(k/(i+1),y)){
            rep(l,min(k/((i+1)*(j+1)),z)){
                s.push_back( a[i] + b[j] + c[l]);
            }
        }
    }
    sort(all(s),greater<ll>());
    rep(i,k){
        cout << s[i] << endl;
    }
    return 0;
}


Measured memory_bytes: 1404
main(){
  int i,j,x,y,s,a[14][14],b=0,c=0;
  for(i=0;i<14;i++)
    for(j=0;j<14;j++)
      a[i][j]=0;
  while(scanf("%d,%d,%d",&x,&y,&s)!=-1)
    switch(s){
    case 3:
      a[x+2][y  ]++;
      a[x+3][y+1]++;
      a[x+4][y+2]++;
      a[x+3][y+3]++;
      a[x+2][y+4]++;
      a[x+1][y+3]++;
      a[x  ][y+2]++;
      a[x+1][y+1]++;
    case 1:
      a[x+2][y+2]++;
      a[x+1][y+2]++;
      a[x+2][y+1]++;
      a[x+3][y+2]++;
      a[x+2][y+3]++;
      break;
    case 2:
      for(i=0;i<3;i++)
	for(j=0;j<3;j++)
	  a[x+i+1][y+j+1]++;
      break;
    }
  for(i=2;i<12;i++)
    for(j=2;j<12;j++){
      if(a[i][j]==0)
	b++;
      if(a[i][j]>c)
	c=a[i][j];
    }
  printf("%d\n%d\n",b,c);
  return 0;
}

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

#include <ext/pb_ds/assoc_container.hpp> // Common file
#include <ext/pb_ds/tree_policy.hpp> // Including tree_order_statistics_node_update
using namespace __gnu_pbds;
using namespace std;
#define int long long
//for set
typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;   
// for multiset
// typedef tree<
// int,
// null_type,
// less<int>,
// rb_tree_tag,
// tree_order_statistics_node_update> ordered_multiset;

#define ff first
#define ss second
#define endl "\n"
#define all(x) (x).begin(), (x).end()
#define sz(x) (int)(x.size())
#define PI 3.1415926535897932384626433832795
int MOD=1e9+7;
// int MOD=998244353;
int powmod(int a,int l, int md){int res=1;while(l){if(l&1)res=res*a%md;l/=2;a=a*a%md;}return res;}
int binpow(int a,int l){int res=1;while(l){if(l&1)res=res*a;l/=2;a=a*a;}return res;}
typedef long long ll; typedef vector<int> vi; typedef pair<int,int> ii; typedef vector<ii> vii;
#define pb push_back
int __set(int b, int i) {return b|(1<<i);} //set ith bit
int __unset(int b, int i) {return b&(~(1UL<<i));}
int __check(int b, int i) {return b&(1<<i);} //returns 0 if ith bit is 0
int mulmod(int a, int b, int md) {return ((a%md)*(b%md))%md;}
int addmod(int a, int b, int md) {return (a+b)%md;}
int submod(int a, int b, int md) {return (((a-b)%md)+md)%md;}
int divmod(int a, int b, int md) {return mulmod(a, powmod(b, md-2, md), md);} //if md is prime;
const ll inf = 0xFFFFFFFFFFFFFFFL; //very large number
priority_queue<int, vector<int>, greater<int> > pq; //for min priority_queue
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
clock_t time_p=clock();
void time()
{
    time_p=clock()-time_p;
    cerr<<"Time Taken : "<<(float)(time_p)/CLOCKS_PER_SEC<<"\n";
}

int cmp(const ii& p1, const ii& p2) {
	return (p1.ss>p2.ss);
}

signed main(void)
{
	IOS;
	int n; cin>>n;
	int k; cin>>k;
	vi p(n);
	for(int i = 0; i < n; i++) {
		cin>>p[i];
	}
	int s=0;
	for(int i = 0; i < k; i++)
		s += p[i]+1;
	int mx=s;
	for(int i = 1; i+k-1 < n; i++) {
		s=s-(p[i-1]+1)+(p[i+k-1]+1);
		mx=max(mx,s);
	}
	cout<<setprecision(16)<<(double)mx/2.0<<endl;
	time();
	return 0;
}

Measured memory_bytes: 1792
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
#define rep(i,N) for(int i = 0; i < (N); i++)
#define erep(i,N) for(int i = N; i >= 0; i--)
const ll INF = 1000000000000000000;
#define PI 3.1415926535
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true;} return false;}
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true;} return false;}
char upper(char c){
    if('a' <= c && c <= 'z'){
        c = c - ('a' - 'A');
    }
    return c;
}
char lower(char c){
    if('A' <= c && c <= 'Z'){
        c = c + ('a' - 'A');
    }
    return c;
}
int GetDigit(int num){
    int digit=0;
    while(num!=0){
        num /= 10;
        digit++;
    }
    return digit;
}
bool IsPrime(int num)
{
    if (num < 2) return false;
    else if (num == 2) return true;
    else if (num % 2 == 0) return false; // 偶数はあらかじめ除く
    double sqrtNum = sqrt(num);
    for (int i = 3; i <= sqrtNum; i += 2)
    {
        if (num % i == 0)
        {
            // 素数ではない
            return false;
        }
    }
    // 素数である
    return true;
}
ll enum_divisors(ll N) {
    ll res = 0;
    for (ll i = 1; i * i <= N; ++i) {
        if (N % i == 0) {
            res++;
            // 重複しないならば i の相方である N/i も push
            if (N/i != i) res++;
        }
    }
    // 小さい順に並び替える
    return res;
}
//input
ll N;
//processing
ll cnt = 1;
bool An = true;
ll H,W;
//dpTable
//int dp[100050];
int main(){
    cin >> N;
    vector<ll> A(N);
    rep (i,N) cin >> A.at(i);
    sort (A.begin(),A.end());
    reverse(A.begin(),A.end());
    rep (i,N - 1){
        if (A.at(i) == A.at(i + 1)) cnt++;
        else {
            if (cnt >= 4) {
                if (An) {
                    H = A.at(i);
                    W = A.at(i);
                    cnt = 0;
                    break;
                }
                else {
                    W = A.at(i);
                    cnt = 0;
                    break;
                }
            }
            else if (cnt >= 2) {
                if (An) {
                    An = false;
                    H = A.at(i);
                }
                else {
                    W = A.at(i);
                    cnt = 0;
                    break;
                }
            }
            cnt = 1;
        }
    }
    if (H == 0){
        if (cnt >= 4){
            H = A.at(N - 1);
            W = A.at(N - 1);
        }
    }
    else if (W == 0){
        if (cnt >= 2){
            W = A.at(N - 1);
        }
    }
    cout << H * W << endl;
    return 0;
}


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

#define rep(i, n) for (int i = 0; i < int(n); i++)
#define rrep(i, n) for (int i = int(n) - 1; i >= 0; i--)
#define reps(i, n) for (int i = 1; i <= int(n); i++)
#define rreps(i, n) for (int i = int(n); i >= 1; i--)
#define repc(i, n) for (int i = 0; i <= int(n); i++)
#define rrepc(i, n) for (int i = int(n); i >= 0; i--)
#define repi(i, a, b) for (int i = int(a); i < int(b); i++)
#define repic(i, a, b) for (int i = int(a); i <= int(b); i++)
#define each(x, y) for (auto &x : y)
#define all(a) (a).begin(), (a).end()
#define bit32(x) (1 << (x))
#define bit64(x) (1ll << (x))
#define sz(v) ((int) v.size())

using namespace std;

using i64 = long long;
using f80 = long double;
using vi32 = vector<int>;
using vi64 = vector<i64>;
using vf80 = vector<f80>;
using vstr = vector<string>;

inline void yes() { cout << "Yes" << endl; exit(0); }
inline void no() { cout << "No" << endl; exit(0); }
inline i64 gcd(i64 a, i64 b) { if (min(a, b) == 0) return max(a, b); if (a % b == 0) return b; return gcd(b, a % b); }
inline i64 lcm(i64 a, i64 b) { if (min(a, b) == 0) return max(a, b); return a / gcd(a, b) * b; }
template <typename T> class pqasc : public priority_queue<T, vector<T>, greater<T>> {};
template <typename T> class pqdesc : public priority_queue<T, vector<T>, less<T>> {};
template <typename T> inline void amax(T &x, T y) { x = max(x, y); }
template <typename T> inline void amin(T &x, T y) { x = min(x, y); }
template <typename T> inline T exp(T x, i64 n, T e = 1) { T r = e; while (n > 0) { if (n & 1) r *= x; x *= x; n >>= 1; } return r; }
template <typename T> istream& operator>>(istream &is, vector<T> &v) { each(x, v) is >> x; return is; }
template <typename T> ostream& operator<<(ostream &os, vector<T> &v) { rep(i, v.size()) { if (i) os << ' '; os << v[i]; } return os; }
void solve(); int main() { ios::sync_with_stdio(0); cin.tie(0); cout << fixed << setprecision(16); solve(); return 0; }

void solve() {
  int n, h;
  cin >> n >> h;
  int xmax = 0;
  vi32 b(n);
  rep(i, n) {
    int x, y;
    cin >> x >> y;
    amax(xmax, x);
    b[i] = y;
  }
  sort(all(b));
  reverse(all(b));
  i64 ans = 0;
  rep(i, n) {
    if (b[i] < xmax) break;
    h -= b[i];
    ans += 1;
    if (h <= 0) {
      cout << ans << endl;
      return;
    }
  }
  // xc >= h
  // c >= h / x
  // c = (h + x - 1) / x
  ans += (h + xmax - 1) / xmax;
  cout << ans << endl;
}


Measured memory_bytes: 640
from collections import deque
import sys

k = int(input())
d = deque()
c = 1

while True:
    if c < 10:
        d.append(c)
        c += 1
        if c > k:
            print(d.pop())
            sys.exit()
    else:
        n = d.popleft()
        m = n % 10
        for i in range(-1, 2):
            if 0 <= m + i <= 9:
                d.append(n * 10 + m + i)
                c += 1
                if c > k:
                    print(d.pop())
                    sys.exit()

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

void fastStream(){cin.tie(0);std::ios_base::sync_with_stdio(0);}

int N, M;
int A[100010];
int B[100010];
int deg[100010];

int main(){

    cin >> N >> M;
    for(int i = 0; i < M; i++){
        cin >> A[i] >> B[i];
        A[i]--; B[i]--;
        deg[A[i]]++;
        deg[B[i]]++;
    }
    bool is_odd = false;
    for(int i = 0; i < N; i++){
        if(deg[i] % 2){
            is_odd = true;
        }
    }
    if(is_odd) cout << "NO" <<endl;
    else cout << "YES" << endl;


    return 0;
}


Measured memory_bytes: 1408
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define all(v) v.begin(),v.end()
#define rall(v) v.rbegin(),v.rend()
typedef long long ll;
#define _GLIBCXX_DEBUG
typedef vector<int> vec;
typedef vector<ll> lvec;
typedef vector<char>cvec;
typedef pair<ll, ll> LP;
typedef tuple<ll, ll, ll> LT;
typedef pair<int, int> P;
typedef tuple<int, int, int> T;
int main()	{
  int n,x; cin>>n>>x;
  vector<int>l(n),d(n+1);
  rep(i,n){
    cin>>l[i];
    d[i+1]=d[i]+l[i];
  }
  int cnt=0;
  rep(i,n+1){
    if(d[i]<=x)
      cnt++;
  }
  cout<<cnt<<endl;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define del(a,i) memset(a,i,sizeof(a))
#define ll long long
#define inl inline
#define il inl void
#define it inl int
#define ill inl ll
#define re register
#define ri re int
#define rl re ll
#define mid ((l+r)>>1)
#define lowbit(x) (x&(-x))
#define INF 0x3f3f3f3f
using namespace std;
template<class T>il read(T &x){
	int f=1;char k=getchar();x=0;
	for(;k>'9'||k<'0';k=getchar()) if(k=='-') f=-1;
	for(;k>='0'&&k<='9';k=getchar()) x=(x<<3)+(x<<1)+k-'0';
	x*=f;
}
template<class T>il _print(T x){
	if(x/10) _print(x/10);
	putchar(x%10+'0');
}
template<class T>il print(T x){
	if(x<0) putchar('-'),x=-x;
	_print(x);
}
ll mul(ll a,ll b,ll mod){long double c=1.;return (a*b-(ll)(c*a*b/mod)*mod)%mod;}
it qpow(int x,int m,int mod){
	int res=1,bas=x;
	while(m){
		if(m&1) res=(1ll*res*bas)%mod;
		bas=(1ll*bas*bas)%mod,m>>=1;
	}
	return res;
}
const int N = 1e6+5,mod = 998244353,inv2 = 499122177;
it add(int x,int y){ return x+y>=mod?x+y-mod:x+y; }
it mul(int x,int y){ return 1ll*x*y%mod; }
il inc(int &x,int y){ x=add(x,y); }
int n,mx,ans,ccnt,S[N],mu[N],sum[N],pri[N],val[N],cnt[N];
char is_not[N];
il Init(){
	mu[1]=1;
	for(ri i=2;i<=mx;++i){
		if(!is_not[i]) mu[i]=-1,pri[++ccnt]=i;
		for(ri j=1;j<=ccnt&&i*pri[j]<=mx;++j){
			is_not[i*pri[j]]=1;
			if(i%pri[j]==0) break;
			mu[i*pri[j]]=-mu[i];
		}
	}
	for(ri i=1;i<=mx;++i) if(mu[i]<0) mu[i]+=mod;
	for(ri i=1;i<=mx;++i) for(ri j=i;j<=mx;j+=i) inc(sum[j],mul(mul(i,mu[j/i]),mul(j/i,j/i)));
	for(ri i=1;i<=mx;++i) for(ri j=1;j<=mx/i;++j) inc(S[i],mul(j,cnt[j*i]));
	for(ri i=1;i<=mx;++i) S[i]=mul(S[i],S[i]);
}
int main(){
//	freopen(".in","r",stdin);
//	freopen(".out","w",stdout);
	read(n);
	for(ri i=1;i<=n;++i) read(val[i]),++cnt[val[i]],mx=max(mx,val[i]);
	Init();
	for(ri i=1;i<=mx;++i) inc(ans,mul(S[i],sum[i]));
	for(ri i=1;i<=n;++i) inc(ans,mod-val[i]);
	print(mul(ans,inv2));
	return 0;
}

Measured memory_bytes: 20608
import math


def main():
    A, B, H, M = list(map(int, input().split(' ')))
    rad_a = 2 * math.pi * (60 * H + M) / 720
    rad_b = 2 * math.pi * M / 60
    theta = abs(rad_a - rad_b)
    print(math.sqrt(A**2 + B**2 - 2 * A * B * math.cos(theta)))


if __name__ == '__main__':
    main()

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

typedef long long ll;

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

int main(){
	ll A,B;
	cin>>A>>B;
	ll g=gcd(A,B);
	ll cnt=0;
	for(ll i=2;i*i<=g;i++){
		if(g%i==0){
			cnt++;
			while(g%i==0){
				g/=i;
			}
		}
	}
	if(g>1)cnt++;
	cout<<cnt+1<<endl;
	return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define pi acos(-1)
#define ll long long
#define pii pair<ll,ll>
#define debug(a) cout<<a<<'\n'
#define maxn 100009 /// leave to tomorrow anything that can be done today
#define MOD 1000000007
#define F first
#define S second
#define rep(i, a, b) for(ll i = a; i < (b); ++i)
#define per(i, b, a) for(ll i = b-1; i>=a ; i--)
#define trav(a, x) for(auto& a : x)
#define allin(a , x) for(auto a : x)
#define all(x) begin(x), end(x)
#define sz(x) (ll)(x).size()
using namespace std;
const ll INF = 1e17 + 9;
int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    ll a,b;
    cin>>a>>b;
    cout<<a*b<<endl;
    return 0;   
}   

Measured memory_bytes: 3652
// inputに入力データ全体が入る
function Main(input) {
	// 1行目がinput[0], 2行目がinput[1], …に入る
	input = input.split("\n");
	S = input[0];
	T = input[1];

	var inS = [];
	var inT = [];

	var counter = function(str,seq){
		return str.split(seq).length - 1;
	}

	var first = "a", last = "z";
	for(var i = first.charCodeAt(0); i <= last.charCodeAt(0); i++) {
		inS[i] = counter(S, eval("String.fromCharCode(" + i + ")"));
		inT[i] = counter(T, eval("String.fromCharCode(" + i + ")"));
	}

	inS.sort(function(a,b){
        if( a > b ) return -1;
        if( a < b ) return 1;
		return 0;
	});

	inT.sort(function(a,b){
        if( a > b ) return -1;
        if( a < b ) return 1;
		return 0;
	});


	if (inS.toString() == inT.toString()) {
		console.log('Yes');
	} else {
		console.log('No');
	}
}
//*この行以降は編集しないでください（標準入出力から一度に読み込み、Mainを呼び出します）
Main(require("fs").readFileSync("/dev/stdin", "utf8"));


Measured memory_bytes: 20172
while True:
    n=map(int, raw_input().split())
    if n[0]==n[1]==n[2] == -1:
        break
    elif (n[0]==-1 or n[1]==-1) or int(n[0])+int(n[1]) < 30:
        print 'F'
    elif int(n[0])+int(n[1])>=80:
        print 'A'
    elif int(n[0])+int(n[1])>=65:
        print 'B'
    elif int(n[0])+int(n[1])>=50:
        print 'C'
    elif int(n[0])+int(n[1])>=30:
        if n[2]<50:
            print 'D'
        else:
            print 'C'
    else:
        print 'F'

Measured memory_bytes: 4244
def solve():
    from sys import stdin
    f_i = stdin
    
    n = int(f_i.readline())
    for i in range(n):
        x1, y1, x2, y2, x3, y3 = map(float, f_i.readline().split())
        A = x1 + y1 * 1j
        B = x2 + y2 * 1j
        C = x3 + y3 * 1j
        a = abs(C - B)
        b = abs(A - C)
        c = abs(B - A)
        c1 = a**2 * (b**2 + c**2 - a**2)
        c2 = b**2 * (c**2 + a**2 - b**2)
        c3 = c**2 * (a**2 + b**2 - c**2)
        
        U = (c1 * A + c2 * B + c3 * C) / (c1 + c2 + c3)
        R = abs(U - A)
        
        print('{:.3f} {:.3f} {:.3f}'.format(U.real, U.imag, R))

solve()


Measured memory_bytes: 5644
if __name__ == '__main__':

    n = int(input())
    
    flg = False

    for i in range(0,101,4):
        for j in range(0,101,7):
            if i + j > 100:
                break
            if n - (i+j) == 0:
                flg = True
                break
        if flg:
            break

    if flg:
        print("Yes")
    else:
        print("No")


Measured memory_bytes: 9120
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define PI 3.141592653589793
#define rep(i, n) for (int i = 0; i < (n); i++)
#define REP(i, a, n) for (int i = a; i < (n); i++)
#define rrep(i, n, k) for (int i = (n); i >= (k); i--);
#define all(x) (x).begin(), (x).end()
#define vi vector<int>
template<class T> istream &operator>>(istream&is,vector<T>&v){for(auto &elemnt:v)is>>elemnt;return is;}
template<class T,class U> istream &operator>>(istream&is,pair<T,U>&p){is>>p.first>>p.second;return is;}
template<class T>vector<T> make_vector(size_t a){return vector<T>(a);}
template<class T, class... Ts>auto make_vector(size_t a, Ts... ts){return vector<decltype(make_vector<T>(ts...))>(a, make_vector<T>(ts...));}
const int MOD = 998244353;
const int INF = 2e18;

signed main() {
    int a, b, c;
    cin >> a >> b >> c;
    int temp = c - a - b;
    if (temp <= 0) {
        cout << "No" << endl;
        return 0;
    }
    if (4 * a * b < temp * temp) {
        cout << "Yes" << endl;
    } else {
        cout << "No" << endl;
    }
}


Measured memory_bytes: 256
// https://atcoder.jp/contests/abc156/tasks/abc156_e
#include <iostream>
#include <cstdlib>
#include <algorithm>
#include <string>
#include <vector>
#include <cmath>
using namespace std;
static const int MAX = 1000000;
long long fact[MAX], fact_inv[MAX], inv[MAX];

void InitmodnCk(long long mod)
{
    fact[0] = fact[1] = 1;
    fact_inv[0] = fact_inv[1] = 1;
    inv[0] = inv[1] = 1;
    for (int i = 2; i < MAX; ++i)
    {
        fact[i] = fact[i - 1] * i % mod;
        inv[i] = mod - inv[mod % i] * (mod / i) % mod;
        fact_inv[i] = fact_inv[i - 1] * inv[i] % mod;
    }
}

long long modnCk(long long n, long long k, long long mod)
{
    if (n < k) return 0;
    if (n < 0 || k < 0) return 0;
    long long ret = fact[n] * (fact_inv[k] * fact_inv[n - k] % mod) % mod;
    if (ret < 0) ret = (ret + mod) % mod;
    return ret;
}

int main()
{
    long long n, k;
    cin >> n >> k;
    static constexpr long long mod = 1e+9 + 7;
    InitmodnCk(mod);
    // 空いている部屋の数に関してループを回す
    long long ans = 0;
    if (k >= n - 1)
    {
        ans += modnCk(2 * n - 1, n, mod);
        ans = ans % mod;
        if (ans < 0) ans = (ans + mod) % mod;
        cout << ans << endl;
        return 0;
    }
    ans += 1;
    for (long long i = 1; i <= k; ++i)
    {
        ans += modnCk(n, i, mod) * modnCk(n - 1, i, mod);
        ans = ans % mod;
        if (ans < 0)
            ans = (ans + mod) % mod;
    }

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


Measured memory_bytes: 23680
#include <bits/stdc++.h>
#ifdef __LOCAL
    #define DBG(X) cout << #X << " = " << (X) << endl;
    #define SAY(X) cout << (X) << endl;
    #include <filesystem>
    namespace fs = std::filesystem;
#else
    #define DBG(X)
    #define SAY(X)
#endif

using namespace std;

using ll = long long int;
using ull = unsigned long long int;
using ld = long double;
using pii = pair<int, int>;
using pll = pair<ll, ll>;

int dx[]={1, 0, -1, 0, 1,-1, 1,-1};
int dy[]={0, 1, 0, -1, 1, 1,-1,-1};
const int INT_INF = (int)(2e9);
const ll  LL_INF = (ll)(2e18);
static mt19937 _g(time(nullptr));
 
inline ll randint(ll a, ll b) { ll w = (_g() << 31LL) ^ _g(); return a + w % (b - a + 1); }
inline void fast_io() { ios_base::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr); };
template<typename T, typename S> inline ostream& operator<<(ostream& os, const pair<T, S> p) { cout << "[" << p.first << ";" << p.second << "]"; return os; }
template<typename T, typename S> inline ostream& operator<<(ostream& os, const map<T, S> p) { for (auto el : p) cout << "[" << el.first << ";" << el.second << "]"; return os; }
template<typename T> inline ostream& operator<<(ostream& os, const vector<T>& v) { for (auto el : v) cout << el << " "; return os; }
template<typename T> inline vector<T> fetch_vec(int sz) { vector<T> ret(sz); for (auto& elem : ret) cin >> elem; return ret; }

int N,M;
vector<ll> H;
vector<vector<int>> G;
void input(){
    fast_io();
    #ifdef __LOCAL
        fs::path __p = __FILE__;
        fs::path __input, __output;
        __input = __output = __p.parent_path();
        __input += string("/input/") + string(__p.stem()) + string(".txt");
        __output += string("/output/") + string(__p.stem()) + string(".txt");
        freopen(__input.c_str(), "r", stdin);
        freopen(__output.c_str(), "w", stdout);
    #endif
    cin >> N >> M;
    G.resize(N);
    H = fetch_vec<ll>(N);
    for (int i = 0; i < M; i++)
    {
        int a,b; cin >> a >> b;
        a--,b--;
        G[a].push_back(b);
        G[b].push_back(a);
    }
}

bool dfs(int u){
    ll h=H[u];
    for(auto v:G[u]){
        if(h<=H[v]) return false;
    }
    return true;
}

int solve(){
    ll ans=0;
    for (int i = 0; i < N; i++)
    {
        if(dfs(i)) ans++;
    }
    cout << ans << endl;
    
    return 0;
}   

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


Measured memory_bytes: 9268
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
const ll maxn = 2e5 + 5;
const ll maxm = 1e3 + 5;
const ll cnt = 1e18;
inline void qread(){}
template<class T1, class ...T2>
inline void qread(T1 &IEE, T2&... ls){
    register T1 __ = 0, ___ = 1;
    register char ch;
    while(!isdigit(ch = getchar())) ___ = (ch == '-') ? -___ : ___;
    do{
        __ = (__ << 1) + (__ << 3) + (ch ^ 48);
    }while(isdigit(ch = getchar()));
    __ *= ___;
    IEE = __;
    qread(ls...);
    return ;
}
long long a, b, c;
int main(){
    qread(a, b, c);
    b = b * 100 + c;
    a *= b;
    a /= 100;
    cout << a;
    return 0;
}

Measured memory_bytes: 3624