akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <stdlib.h>
#include <vector>
#include <string>
#include <stdio.h>

using namespace std;

int main(int argc, char const* argv[])
{
	int m,n;
	const string Fizz("Fizz"),Buzz("Buzz"),FizzBuzz("FizzBuzz");
	string str;
	vector<int> player;
	vector<int>::iterator it;

	while( cin >> m >> n && m ){
		player.clear();
		for( int i = 1;i <= m;i++ ) player.push_back( i );

		it = player.begin();
		for( int i = 1;i <= n;i++ ){
			if( it == player.end() ) it = player.begin();
			cin >> str;
			if( player.size() == 1 ) continue;
			
			if( !(i % 15) ){ if( FizzBuzz != str ){ it = player.erase( it ); continue;}}
			else if( !(i % 3) ){ if( Fizz != str ){ it = player.erase( it ); continue;}}
			else if( !(i % 5) ){ if( Buzz != str ){ it = player.erase( it ); continue;}}
			else{
				int j;
				for( j = 0;j < str.size();j++ ){
					if( str[j] > '9' || str[j] < '0' ){
						break;
					}
				}
				if( j == str.size() ){ if( atoi( str.c_str() ) != i ){ it = player.erase( it ); continue;}}
				else {it = player.erase( it ); continue;}
			}
			it++;
		}

		for( int i = 0;i < player.size();i++ ){
			cout << (( i == 0 ) ? "" : " ") << player[i];
		}
		cout << endl;
	}
	return 0;
}

Measured memory_bytes: 0
#include <bits/stdc++.h>
using namespace std;
#define storpa ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
int main(){
    storpa;
    int n, m, k, a, b[31]={0}, cnt=0;
    vector<int>vec;
    cin >> n >> m;
    for(int i=0; i<n; i++){
      cin >> k;
      for(int j=0; j<k; j++){
        cin >> a;
        b[a]++;
        vec.push_back(a);
      }
    }
    for(int i=0; i<=m; i++){
      if(b[i]==n){
        cnt++;
      }
    }
    cout << cnt;
}


Measured memory_bytes: 3636
#include <iostream>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <algorithm>
#include <string>
#include <cmath>
#include <cstdio>
#include <iomanip>
#include <fstream>
#include <cassert>
#include <cstring>
#include <unordered_set>
#include <unordered_map>
#include <numeric>
#include <ctime>
#include <bitset>
#include <complex>

using namespace std;

#define int long long

int solve(vector<pair<int, int>> a) {
	vector<pair<int, int>> ev;
	for (auto t : a) {
		int l, r;
		tie(l, r) = t;
		ev.push_back({l, 0});
		ev.push_back({r, 1});
	}
	sort(ev.begin(), ev.end());
	int bl = 0;
	int pr = 0;
	int ans = 0;
	for (auto t : ev) {
		int x, tp;
		tie(x, tp) = t;
		if (tp == 0) {
			if (bl == 0) pr = x;
			bl++;
		} else {
			bl--;
			if (bl == 0) {
				ans += x - pr + 1;
			}
		}
	}
	return ans;
}

map<int, vector<pair<int, int>>> lol;

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

	int n, x, d;
	cin >> n >> x >> d;
	if (d == 0) {
		if (x == 0) cout << 1 << endl;
		else cout << n + 1 << endl;
		return 0;
	}
	x -= d;
	//x + d, ... x + n * d
	for (int tk = 0; tk <= n; tk++) {
		int mn = (1 + (tk)) * tk / 2;
		int mx = ((n - tk + 1) + n) * tk / 2;
		int kek = tk * x;
		mn += kek / d;
		mx += kek / d;
		kek %= d;
		lol[kek].push_back({mn, mx});
	}
	int ans = 0;
	for (auto t : lol) {
		ans += solve(t.second);
	}
	cout << ans << endl;
}


Measured memory_bytes: 22144
// This file is a "Hello, world!" in C++ language by GCC for wandbox.
#include <stdio.h>

int main()
{
int n;
    scanf("%d",&n);
    
    for(int i=0;i<n;i++){
int a;
int b;
int c;
    scanf("%d",&a);
    scanf("%d",&b);
    scanf("%d",&c);
    
if(a*a+b*b==c*c){
    printf("YES\n");
}
else if(b*b+c*c==a*a){
    printf("YES\n");
}
else if(c*c+a*a==b*b){
    printf("YES\n");
}
else {
    printf("NO\n");
}
        
}
}
// GCC reference:
//   https://gcc.gnu.org/

// C++ language references:
//   https://msdn.microsoft.com/library/3bstk3k5.aspx
//   http://www.cplusplus.com/
//   https://isocpp.org/
//   http://www.open-std.org/jtc1/sc22/wg21/

// Boost libraries references:
//   http://www.boost.org/doc/

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


//defines...
#define ll long long
#define boost ios_base::sync_with_stdio(false);cin.tie(NULL);
#define pb push_back
#define mp make_pair
#define in insert
#define pi 2*acos(0.0)1
#define srt(s) sort(s.begin(),s.end())
#define rsrt(s) sort(s.rbegin(),s.rend())
#define all(x) x.begin(),x.end()
#define mem(a, b) memset(a, b, sizeof(a))

const ll mod=1e9+7;
const ll MX=2e5+5;

//code goes from here...



int main()
{
#ifndef ONLINE_JUDGE
    //freopen("input.txt", "r", stdin);

    freopen("output.txt", "w", stdout);
#endif

    boost
    //---------------------------------
    ll n,m,x;

    cin >> n >> m >> x;
    vector <ll> tx(n);
    for(ll i=0;i<m;i++)
    {
        ll t;
        cin >> t;
        tx[t]++;
    }

    ll c1=0,c2=0;
    for(ll i=x;i<n;i++) c1+=tx[i];
    for(ll i=x;i>=0;i--) c2+=tx[i];

    cout << min(c1,c2) << endl;
    
    //---------------------------------
    
    return 0;
}


Measured memory_bytes: 3616
#include<iostream>
#include<stdio.h>
#include<algorithm>
#include<cmath>
#include<vector>
#include<map>
#include<set>
#include<string>
using namespace std;
#define mod int(1e9+7)
#define rep(i,n) for(int i=0;i<n;i++)
#define reps(i,a,b) for(int i=a;i<=b;i++)
#define repn(i,a,b) for(int i=b-1;i>=a;i--)
#define F first
#define S second
typedef long long int ll;

int main()
{ ios_base::sync_with_stdio(false); cin.tie(0);
  //freopen("a.txt","r",stdin);
  ll t; cin>>t;
  ll a,b; cin>>a>>b;
  ll ans=0;
  while(t--)
  { ll c; cin>>c;
    if(c<a || c>=b) ans++;
  }
  cout<<ans<<endl;
  return 0;
}


Measured memory_bytes: 256
X, Y, A, B, C = list(map(int,input().split()))
p = list(map(int,input().split()))
q = list(map(int,input().split()))
r = list(map(int,input().split()))
 
p.sort(reverse=True)
q.sort(reverse=True)
r.sort(reverse=True)
 
p.append(float("inf"))
q.append(float("inf")) 

Z = 0
while Z < C:
  if min(p[X - 1], q[Y - 1]) < r[Z]:
    if p[X - 1] < q[Y - 1]:
      X -= 1
      Z += 1
    else:
      Y -= 1
      Z += 1
    continue
  break
 
print(sum(p[:X]) + sum(q[:Y]) + sum(r[:Z]))

Measured memory_bytes: 23328
#include <bits/stdc++.h>
#include <vector>
#include <cstdlib> //abs(int)
using namespace std;
int main(void){
  int A, B, C, D;
  cin >> A >> B >> C >> D;
  if(A + B > C + D){
    cout << "Left";
  } else if(A + B == C + D){
    cout << "Balanced";
  } else {
    cout << "Right";
  }
}

Measured memory_bytes: 256
// Aizu Vol0 0038: Poker Hand
// 2017.7.30

#include <stdio.h>
#include <stdlib.h>

#define MAX 14

int main()
{
	int card[MAX+3];
	int max;
	int i, j, d[5];
	
	while (scanf("%d,%d,%d,%d,%d", &d[0], &d[1], &d[2], &d[3], &d[4]) == 5) {
		for (i = 1; i <= MAX; i++) card[i] = 0;
		max = 0;
		for (i = 0; i < 5; i++) {
			if (++card[d[i]] > max) max = card[d[i]];
			if (d[i] == 1) card[14] = 1;
		}
		if (max == 4) {
			puts("four card");
			goto DONE;
		}
		if (max == 3) {
			for (i = 1; i < MAX; i++) {
				if (card[i] == 2) {
					puts("full house");
					goto DONE;
				}
			}
		}
		if (max == 1) {
			for (i = 1; i <= 10; i++) {
				for (j = 0; ; j++) {
					if (j >= 5) {
						puts("straight");
						goto DONE;
					}
					if (card[i + j] != 1) break;
				}
			}
		}
		if (max == 3) {
			puts("three card");
			goto DONE;
		}
		if (max == 2) {
			for (i = 1; card[i] < 2; i++);
			for (j = i + 1; j < MAX; j++) {
				if (card[j] == 2) {
					puts("two pair");
					goto DONE;
				}
			}
			puts("one pair");
			goto DONE;
		}
		puts("null");
	DONE:;
	}
	return 0;
}

Measured memory_bytes: 580
n = gets.to_i
ary = []
n.times { ary << gets.chomp }
cnt = ary.each_with_object(Hash.new(0)) {|e, h| h[e] += 1 }
puts "AC x #{cnt['AC'].to_i}\nWA x #{cnt['WA'].to_i}\nTLE x #{cnt['TLE'].to_i}\nRE x #{cnt['RE'].to_i}"

Measured memory_bytes: 20648
#include <iostream>
#include <cassert>
#include <climits>
#include <bitset>
#include <stack>
#include <queue>
#include <iomanip>
#include <limits>
#include <string>
#include <cmath>
#include <set>
#include <map>
#include <math.h>
#include <algorithm>
#include <vector>
#include <string.h>

using namespace std;

typedef long long ll;
typedef pair<ll,ll> P;

long long int INF = 3e18;
long long int mod = 1000000007;
double Pi = 3.1415926535897932384626;

vector<ll> G[500005];
vector<P> tree[500010];
priority_queue <ll> pql;
priority_queue <P> pqp;
//big priority queue
priority_queue <ll,vector<ll>,greater<ll> > pqls;
priority_queue <P,vector<P>,greater<P> > pqps;
//small priority queue
//top pop

int dx[8]={1,0,-1,0,1,1,-1,-1};
int dy[8]={0,1,0,-1,1,-1,-1,1};
char dir[] = "DRUL";
ll bit[500005];
//↓,→,↑,←

#define p(x) cout<<x<<endl;
#define el cout<<endl;
#define pe(x) cout<<x<<" ";
#define ps(x) cout<<fixed<<setprecision(15)<<x<<endl;
#define pu(x) cout<<x;
#define re(i,n) for(i=0;i<n;i++);
#define pb push_back
#define lb lower_bound
#define ub upper_bound
#define deba(x) cout<< #x << " = " << x <<endl

ll rui(ll abc,ll bed){
    //abcのbed乗を計算する
    if(bed==0){return 1;}
    else{
        ll ced = rui(abc,bed/2);
        ced *= ced;
        ced %= mod;
        if(bed%2==1){ced*=abc; ced%=mod;}
        return ced;
    }
}
ll gcd(ll number1,ll number2){
    if(number1 > number2){
        swap(number1,number2);
    }
    if(number1 == 0 || number1 == number2){
        return number2;
    }else{
        return gcd(number2 % number1,number1);
    }
}

ll i,j,k,ii,jj,r,l;
ll n,m,num,sum;
ll ans;
ll a,b,c,d,e,g,h,w,ok,ng;
ll x[500005],y[500005],z[500005];
ll cost[500005];
bool flag,dame;
char s[5005];

int main(){
    cin >> n >> m;
    for(i=0;i<n;i++){
        cin >> x[i] >> y[i];
    }
    sort(x,x+n);
    sort(y,y+n);
    for(i=n-1;i>=0;i--){
        if(y[i] > x[n-1]){
            ans++;
            m -= y[i];
        }
        if( m <= 0){
            p(ans);
            return 0;
        }
    }
    ans += (m+x[n-1] - 1)/x[n-1];
    p(ans);
    return 0;
}


Measured memory_bytes: 35072
#pragma region
#include <bits/stdc++.h>
using namespace std;
inline void ci(void){
  return;
}
template <typename First, typename... Rest>
void ci(First& first, Rest&... rest){
  cin >> first;
  ci(rest...);
  return;
}
inline void co(void){
  cout << "\n";
  return;
}
template <typename First, typename... Rest>
void co(First first, Rest... rest){
  cout << first << " ";
  co(rest...);
  return;
}
#define ll long long
#define ld long double
#define st string
#define dl double
#define wh while
#define mp make_pair
#define mt make_tuple
#define pb push_back
#define tp tuple
#define ft first
#define sc second
#define ve vector
#define tos to_string
#define len length
#define rt return 0
#define br break
#define con continue
#define lcm(n, m) (n * m / gcd(n, m))
#define np next_permutation
#define repi(i, m, n) for(int i=(int)(m);i<(int)(n);i++)
#define rep(i, n) repi(i, 0, n)
#define repill(i, m, n) for(ll i=(ll)(m);i<(ll)(n);i++)
#define repll(i, n) repill(i, 0, n)
#define revi(i, m, n) for(int i=(int)(m);i>(int)(n);i--)
#define rev(i, n) revi(i, 0, n)
#define revill(i, m, n) for(ll i=(ll)(m);i>(ll)(n);i--)
#define revll(i, n) revill(i, 0, n)
#define sz(v) ((int)(v).size()) 
#define each(i, n) for(auto&& i: n)
#define all(n) (n.begin(), n.end())
#define allr(n) (n.rbegin(), n.rend())
#define sp(n) cout << fixed << setprecision(n)
#pragma endregion
// sqrt ルート, int 2*10^9, gcd　最大公約数
// __builtin_popcount bitの個数

int main() {
  st S;
  ci(S);
  int a;
  rep(i, sz(S) / 2 - 1){
    bool f = 1;
    rep(j, i){
      if(S.at(j) != S.at(j + i + 1)){
        f = 0;
      }
    }
    if(f){
      a = (i + 1) * 2;
    }
  }
  co(a);
}

Measured memory_bytes: 256
#include<iostream>
#include<string>
#include <stdio.h>
#include <math.h>
#include <cctype>
using namespace std;
int main(){
	double n;
	while(cin>>n){
		double t=n/9.8;
		double y=t*t*4.9;
		int ans=ceil((y+5)/5);
		cout<<ans<<endl;
	}
	return 0;

}

Measured memory_bytes: 1228
#include <iostream>
#include <algorithm>
#include <cmath>
#include <string>
using namespace std;
#define inf 1000000007

long long int function(long long int x){
    long long int sum=1;
    for(long long int i = 1; i <= x; i++)
        sum=(sum*i)%inf;
    return sum;
}
 
int main(void){
   long long int n, m;
   cin >> n >> m;
   long long int ans;
   if(abs(n-m)>1)
    ans = 0;
    else if(abs(n-m)==1)
        ans = (function(n)*function(m))%inf;
    else if(n==m){
        ans = (function(n)*function(m))%inf;
        ans*=2;
        ans %= inf;
    }
    cout << ans << endl;
    return 0;
}

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

using namespace std;

template <class T> class SegTree {
    int n;                          // 葉の数
    vector<T> data;                 // データを格納するvector
    T def;                          // 初期値かつ単位元
    function<T(T, T)> operation;    // 区間クエリで使う処理
    function<T(T, T)> update;       // 点更新で使う処理

    // 区間[a,b)の総和。ノードk=[l,r)に着目している。
    T _query(int a, int b, int k, int l, int r){
        // 交差しない場合
        if(r <= a || b <= l) return def; 
        //// a,l,r,bの順で完全に含まれる
        if (a <= l && r <= b){
            return data[k]; 
        }else{
            T c1 = _query(a, b, 2 * k + 1, l, (l + r) / 2);
            T c2 = _query(a, b, 2 * k + 2, (l + r) / 2, r);
            return operation(c1, c2);
        }
    }
    public:
    // _n:必要サイズ, _def:初期値かつ単位元, _operation:クエリ関数,
    // _update:更新関数
    //コンストラクタ
    SegTree(size_t _n, T _def, 
                    function<T(T, T)> _operation, 
                    function<T(T, T)> _update)
                    :def(_def), operation(_operation), update(_update){
        n=1;
        while(n < _n){
            n *= 2;
        }
        data = vector<T>(2*n -1, def);
    }

    //区間クエリ[a, b)
    T query(int a, int b){
        return _query(a, b, 0, 0, n);
    }

    //更新クエリ:場所i(0-indexed)の値をxで更新
    void change(int i, T x){
        i += n -1;
        data[i] = update(data[i], x);
        while(i > 0){
            i = (i-1)/2;
            data[i] = operation(data[i*2+1], data[i*2+2]);
        }
    }

    // 添字でアクセス
    T operator[](int i){
        return data[i + n -1];
    }
};

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

    vector<long long> alphabet_unit(26); 

    auto operate = [&](vector<long long> a, vector<long long> b){
        vector<long long> ans(26);
        for(int i=0; i<26; ++i){
            ans[i] = a[i] + b[i];
        }
        return ans;
    };

    auto update = [&](vector<long long> a, vector<long long> b){
        return b;
    };

    bool alphabet[26];

    // 要素数N・long long型・区間min・点更新
    SegTree< vector<long long> > st(N, alphabet_unit, operate, update);

    string s; cin >> s; 
    for(int i=0; i<s.size(); ++i){
        int idx = s[i] - 'a';
        vector<long long> alphabet(26);
        alphabet[idx] = 1;
        st.change(i, alphabet);
    }

    int Q; cin >> Q;
    for(int i=0; i<Q; ++i){
        int query_type; cin >> query_type;
        if(query_type == 1){
            int leave_id; cin >> leave_id;
            leave_id--;
            char c; cin >> c;
            vector<long long> alphabet(26);
            int idx = c - 'a';
            alphabet[idx] = 1;
            st.change( leave_id, alphabet);
        }else{
            int l, r; cin >> l >> r;
            l--;
            if(l ==r) r++;
            vector<long long> res = st.query(l, r);

            long long ans = 0;
            for(int i=0; i<26; ++i){
                if(res[i] > 0) ans++;
            }
            cout << ans << endl;
        }
    }
    return 0;
}

Measured memory_bytes: 258276
#include <iostream>
#include <stdio.h>
#include <string>
#include <cstdlib>
#include <cmath>
#include <math.h>
#include <vector>
#include <algorithm>
using namespace std;

int main(){
	int x, t;
	cin >> x >> t;

	cout << max(x-t, 0) << endl;

	return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int m,x,y,ans;
int main(){
	scanf("%d",&m);
	for(int i=1;i<=m;i++){
		scanf("%d%d",&x,&y);
		ans+=(y-x+1);
	}
	printf("%d",ans);
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long  ll;
const ll mod =1000000007;
int main(){
    double w,h,x,y;
    cin>>w>>h>>x>>y;
    cout<<w*h/(2.0)<<" "<< ( (x==w/2&&y==h/2)? 1 :0)<<endl;
}

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

int main() {
	int a[20][20];
	int mata[20][20][20][20];
	int x,y,z,w,s,x1,y1,matatabi;
	cin >> s ;
	for(int i=0;i<s;i++){
		cin >> x1 >> y1;
		for(int b=0;b<20;b++){
			for(int c=0;c<20;c++){
				a[b][c]=0;
			}
		}
		a[0][0]=1;
		for(int d=0;d<20;d++){
			for(int e=0;e<20;e++){
				for(int f=0;f<20;f++){
					for(int g=0;g<20;g++){
					    mata[d][e][f][g]=0;
					    }
				}
			}
		}
		
		cin >>matatabi;
		for(int j=0;j<matatabi;j++){
			cin>>x>>y>>z>>w;
			mata[x][y][z][w]=1;
		}
		for(int k=0;k<x1;k++){
			if(mata[k][0][k+1][0]!=1 && mata[k+1][0][k][0]!=1){
			a[k+1][0]=a[k][0];
			}
		}
		for(int l=0;l<y1;l++){
			if(mata[0][l][0][l+1]!=1 && mata[0][l+1][0][l]!=1){
			a[0][l+1]=a[0][l];
			}
		}
		for(int m=1;m<y1+1;m++){
			for(int n=1;n<x1+1;n++){
				if(mata[n-1][m][n][m]!=1 && mata[n][m][n-1][m]!=1){
				a[n][m]+=a[n-1][m]; 
				}
				if(mata[n][m-1][n][m]!=1 && mata[n][m][n][m-1]!=1){
				a[n][m]+=a[n][m-1];
				}
			}
		}
			
		if(a[x1][y1]==0){
			cout << "Miserable Hokusai!"<<endl;
		}else{
	    cout << a[x1][y1]<<endl;
		}
	    }
	return 0; 
}

Measured memory_bytes: 1788
using System;
using System.Collections.Generic;
using System.Linq;

namespace ABC095_B_Bitter_Alchemy
{
	internal class Program
	{
		public static void Main(string[] args)
		{
			string[] input = Console.ReadLine().Split(' ');
			int n = int.Parse(input[0]);
			int x = int.Parse(input[1]);
			
			List<int> mArrs = new List<int>();
			
			for (int i = 0; i < n; i++) {
				mArrs.Add(int.Parse(Console.ReadLine()));
				x -= mArrs[i];
			}

			int count = n;

			while (x >= mArrs.Min())
			{
				x -= mArrs.Min();
				count++;
			}
			
			Console.WriteLine(count);
		}
	}
}

Measured memory_bytes: 15312
/*                    ___          |\    /|           ____   ____   ____  ____
   |     |    /\    /    \ |     | | \  / |    /\    |    \ |    \ |     |    \
   |_____|   /__\   \____  |_____| |  \/  |   /__\   |____/ |____/ |__   |____/
   |     |  /    \       \ |     | |      |  /    \  |      |      |     |   \
   |     | /      \ \____/ |     | |      | /      \ |      |      |____ |    \
*/
#include<bits/stdc++.h>
using namespace std;
#define isko_lga_dala_to_life_jhinga_la_la ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define lb lower_bound
#define ub upper_bound
#define pf push_front
#define pb push_back
#define ll long long
#define pi pair<int,int>
#define pl pair<long long,long long>
#define pld pair<long double,long double>
#define endl '\n'
#define loop(i,n) for(ll i=0;i<n;i++)
#define mod ((ll)(1e9+7))
#define in(x) scanf("%lld",&x)
#define in2(x,y) scanf("%lld %lld",&x,&y)
#define in3(x,y,z) scanf("%lld %lld %lld",&x,&y,&z)
#define inv(v) for(auto&i:v) in(i)
#define vl vector<ll>
#define ml unordered_map<ll,ll> 
#define vpl vector<pair<ll,ll>>
#define INF 0x3f3f3f3f

template<typename T, typename TT>
ostream& operator<<(ostream &os, const pair<T, TT> &t) { return os<<t.first<<" "<<t.second; }
template<typename T>
ostream& operator<<(ostream& os, const vector<T> &t) { for(auto& i: t) os<<i<<" "; return os; }

int main() {
    ll a,b;
    in2(a,b);
    cout<<((ll)(a*b))/(__gcd(a,b))<<endl;
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define MOD 1000000007
typedef long long int ll;
using namespace std;

int main()
{
    int n; cin >> n;
    string ans = "No";
    for(int i=1;i<10;i++){
        if(n%i == 0 && n/i<10) ans = "Yes";
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 256
#include <iostream>

const int MOD =  1000000007;
const int N_MAX = 20000002;

using namespace std;

typedef long long ll;
typedef pair<ll, ll> P;

ll inv[N_MAX],fac[N_MAX],finv[N_MAX];
ll pow2[N_MAX];

void init(){
    fac[0]=fac[1]=1;
    finv[0]=finv[1]=1;
    inv[1]=1;
    pow2[0] = 1;
    pow2[1] = 2;
    for(int i=2;i<N_MAX;i++){
        inv[i]=MOD-inv[MOD%i]*(MOD/i)%MOD;
        fac[i]=fac[i-1]*(ll) i%MOD;
        finv[i]=finv[i-1]*inv[i]%MOD;
        pow2[i] = (pow2[i-1]*2)%MOD;
    }
}


ll comb(ll n, ll m){
    if(m < 0) return 0;
    if(n < 0) return 0;
    if(n < m) return 0;
    ll ans = (fac[n]*finv[m])%MOD;
    ans = (ans*finv[n-m])%MOD;
    ans += MOD;
    ans %= MOD;
    return ans;
}

int main(){
    init();
    ll H, W, K;
    cin >> H >> W >> K;
    ll ans = 0;
    for(ll k = 1; k <= K; k++){
        int tmp = (((fac[k]*fac[K-k])%MOD)*comb(H+W-k, K-k))%MOD;
        tmp = (tmp*(((k+1)*comb(H+W, k))%MOD + (((H*W)%MOD)*comb(H+W-2, k-2)%MOD)))%MOD;
        ans += tmp;
        ans %= MOD;
    }
    cout << ans << endl;
}

Measured memory_bytes: 625280
#include <iostream>
#include <algorithm>
#include <string>
#include <string.h>
#include <stdlib.h>
#include <math.h>
#include <vector>
#include <queue>
#include <stack>
#include <cmath>
#include <map>
#include <iomanip>
#include <set>
#include <ctime>
#include <tuple>
#include <bitset>
#include <assert.h>
#include <deque>
using namespace std;

/*
using PAIR = pair<string, int>;
sort(sp.begin(), sp.end(), [](PAIR l, PAIR r){
        return l.first<r.first || (l.first==r.first && l.second > r.second);
        });
*/

typedef long long ll;

#define fi first
#define se second
#define rep(i, n) for (ll i = 0; i < n; i++)
#define debugA() cerr << "AAAAA" << endl
#define debug_() cerr << "-------------" << endl
#define debug(x) cerr << #x << ": " << x << endl
#define debug_vec(v)                   \
    for (int i = 0; i < v.size(); i++) \
    {                                  \
        cout << v[i] << " ";           \
    }                                  \
    cout << endl;
#define debug_vec2(v)                         \
    for (int i = 0; i < v.size(); i++)        \
    {                                         \
        for (int j = 0; j < v[i].size(); j++) \
        {                                     \
            cout << v[i][j] << " ";           \
        }                                     \
        cout << endl;                         \
    }

using Graph = vector<vector<int>>;
using P = pair<int, int>;

int main()
{
    int q;
    cin >> q;
    while (q--)
    {
        string s, t;
        cin >> s >> t;
        int n = s.size();
        int m = t.size();
        vector<vector<ll>> dp(n + 10, vector<ll>(m + 10, 0));
        for (int i = 1; i <= n; i++)
        {
            for (int j = 1; j <= m; j++)
            {
                if (s[i - 1] == t[j - 1])
                {
                    dp[i][j] = max(dp[i][j], dp[i - 1][j - 1] + 1);
                }
                else
                {
                    dp[i][j] = max({dp[i][j], dp[i - 1][j], dp[i][j - 1]});
                }
            }
        }
        // debug_vec2(dp);
        cout << dp[n][m] << endl;
    }

    return 0;
}



Measured memory_bytes: 10808
#include <stdio.h>
#include <algorithm>

using namespace std;

struct TRAMP{
	char mark;
	int number;
};

int main(){
	int n,min;
	char buf[3];
	scanf("%d",&n);

	TRAMP selectArray[n],bubbleArray[n];

	for(int i = 0; i < n; i++){
		scanf("%s",buf);
		selectArray[i].mark = buf[0];
		selectArray[i].number = buf[1] - '0';
		bubbleArray[i] = selectArray[i];
	}

	for(int i = n-1; i >= 0; i--){
		for(int j = 0; j < i; j++){
			if(bubbleArray[j].number > bubbleArray[j+1].number) swap(bubbleArray[j], bubbleArray[j+1]);
		}
	}

	for(int i = 0; i < n-1; i++){
		min = i;
		for(int j = i+1; j < n; j++){
			if(selectArray[j].number < selectArray[min].number){
				min = j;
			}
		}
		if(i != min){
			swap(selectArray[i],selectArray[min]);
		}
	}

	for(int i = 0; i < n-1; i++) printf("%c%d ",bubbleArray[i].mark,bubbleArray[i].number);
	printf("%c%d\n",bubbleArray[n-1].mark,bubbleArray[n-1].number);
	printf("Stable\n");
	for(int i = 0; i < n-1; i++) printf("%c%d ",selectArray[i].mark,selectArray[i].number);
	printf("%c%d\n",selectArray[n-1].mark,selectArray[n-1].number);

	int p;
	for(p=0; p < n; p++){
		if(selectArray[p].number != bubbleArray[p].number || selectArray[p].mark != bubbleArray[p].mark)
			break;
	}
	if(p == n){
		printf("Stable\n");
	}else{
		printf("Not stable\n");
	}

	return 0;
}


Measured memory_bytes: 2748
#include <stdio.h>

int main() {
	char s[4];
	scanf("%s", &s);
	int answer = 700;
	if (s[0] == 'o') answer += 100;
	if (s[1] == 'o') answer += 100;
	if (s[2] == 'o') answer += 100;
	printf("%d", answer);
}

Measured memory_bytes: 128
#include <bits/stdc++.h>
using namespace std;
#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 all(x) (x).begin(), (x).end()
#define sz(x) int(x.size())
#define get_unique(x) x.erase(unique(all(x)), x.end());
typedef long long ll;
typedef complex<double> Complex;
const int INF = 1e9;
const ll MOD = 1e9 + 7;
const ll LINF = 1e18;
template <class T>
bool chmax(T& a, const T& b) {
    if (a < b) {
        a = b;
        return 1;
    }
    return 0;
}
template <class T>
bool chmin(T& a, const T& b) {
    if (b < a) {
        a = b;
        return 1;
    }
    return 0;
}
template <class T>
vector<T> make_vec(size_t a) {
    return vector<T>(a);
}
template <class T, class... Ts>
auto make_vec(size_t a, Ts... ts) {
    return vector<decltype(make_vec<T>(ts...))>(a, make_vec<T>(ts...));
}
template <typename T>
ostream& operator<<(ostream& os, vector<T> v) {
    for (int i = 0; i < sz(v); i++) {
        os << v[i];
        if (i < sz(v) - 1) os << " ";
    }
    return os;
}
int main() {
    ll n, d;
    cin >> n >> d;
    int ans = 0;
    rep(i, n) {
        ll x, y;
        cin >> x >> y;
        ans += x * x + y * y <= d * d;
    }
    cout << ans << endl;
}

Measured memory_bytes: 3620
#include<cstdio>
#include<iostream>
#include<fstream>
#include<cmath>
#include<cstring>
#include<algorithm>
using namespace std;
#define Set(a) memset(a,0,sizeof(a))
#define F(i,a,b) for(register int i=a,i##end=b;i<=i##end;++i)
#define UF(i,a,b) for(register int i=a,i##end=b;i>=i##end;--i)
#define openf(a) freopen(#a".in","r",stdin);freopen(#a".out","w",stdout)
#define re register
#define ri re int
#define il inline
typedef long long ll;
typedef unsigned long long ull;
template<typename T> inline T rd(T& x)
{
	T f=1;x=0;char c=getchar();
	for(;!isdigit(c);c=getchar()) if(c=='-') f=-1;
	for(; isdigit(c);c=getchar()) x=(x<<3)+(x<<1)+(T)(c-'0');
	x*=f;
	return x;
}
ll rd(){ll x;rd(x);return x;}
inline int max(int a,int b){return a>b?a:b;}
//inline int min(int a,int b){return a<b?a:b;}
const int inf=1<<30;

int main()
{
	ll n,k;
	cin>>n>>k;
	cout<<min(n%k,k-n%k)<<endl;
	return 0;
}

Measured memory_bytes: 256
A = int(input())
B = int(input())
C = int(input())
X = int(input())
ans = 0
for i in range(A+1):
    for j in range(B+1):
        for k in range(C+1):
            if X == 500*i + 100*j + 50*k:
                ans += 1
print(ans)

Measured memory_bytes: 3060
#include <cstdio>
#include <cstring>
#define min(a,b) ((a)<(b)?(a):(b))
char s[1003],t[1003];
int lens,lent,ans=1<<30,sum;
int main(){
    scanf("%s%s",s,t);
    lens=strlen(s),lent=strlen(t);
    for(int i=0;i<lens-lent+1;i++){
        sum=0;
        for(int j=0;j<lent;j++) if(s[i+j]!=t[j]) ++sum;
        ans=min(ans,sum);
    }
    printf("%d\n",ans);
    return 0;
}

Measured memory_bytes: 1728
h,w = map(int,input().split())
a_list=[]
for i in range(h):
  a_list.append(list(map(int,input().split())))
ans_list = [] 
one_load = []
for a in range(h):
  if a % 2 == 0:
    for b in range(w):
      one_load.append([a,b])
  else:
    for b in range(w-1,-1,-1):
      one_load.append([a,b])
keiro = []     
for i in range(len(one_load) - 1):
  if a_list[one_load[i][0]][one_load[i][1]] % 2 == 1:
    a_list[one_load[i+1][0]][one_load[i+1][1]] += 1
    keiro.append([one_load[i][0]+1,one_load[i][1]+1,one_load[i+1][0]+1,one_load[i+1][1]+1])
print(len(keiro))
for k in keiro:
  print(*k)
    
      

Measured memory_bytes: 61080
#include <bits/stdc++.h>
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define REP(i,n) for(int i=0;i<(n);i++)
#define RREP(i,n) for(int i=(n)-1;i>=0;i--)
using namespace std;
#define MOD 1000000007

int main()
{
    int N;
    scanf("%d", &N);
    vector<int> T(N), A(N);
    int max = 0, max_index = 0;
    REP (i, N) {
        scanf("%d", &T[i]);
        if (max < T[i]) {
            max = T[i];
            max_index = i;
        }
    }
    REP (i, N) {
        scanf("%d", &A[i]);
    }
    if (A[max_index] != max) {
        printf("0\n");
        return 0;
    }
    if (A[0] != T[N - 1]) {
        printf("0\n");
        return 0;
    }
    if (T.size() == 1) {
        if (T[0] == A[0]) {
            printf("1\n");
            return 0;
        } else {
            printf("0\n");
            return 0;
        }
    }
    long long ans = 1;
    for (int i = 1; i < max_index; i++) {
        if (T[i] == T[i - 1]) {
            ans *= T[i] % MOD;
            ans %= MOD;
        }
    }
    for (int i = N - 2; i > max_index; i--) {
        if (A[i] == A[i + 1]) {
            ans *= A[i] % MOD;
            ans %= MOD;
        }
    }
    printf("%lld\n", ans);
}

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

#define mod 998244353

long long dp[300001];

int a[300001];

int N;

long long f(int i) {
    stack<int> st;
    
    for(int i = 0; i < N; i++) {
        if(st.size() > 0) {
            if(st.top() % 2 == a[i] % 2) {
                st.pop();
            }else st.push(a[i]);
        }else st.push(a[i]);
    }
    long long cnt = 0;
    while(!st.empty()) {
        if(st.top() % 2) cnt++;
        st.pop();
    }
    return cnt;

}

vector<int> adj[100010];

void dfs(int v, int * dist, int d, int * vis) {
    vis[v] = 1;
    for(int i = 0;i < adj[v].size(); i++) {
        
        int u = adj[v][i];
        if(vis[u]) continue;
        dist[u] = d+1;
        dfs(u, dist, d+1, vis);
    }

}
int main() {
    // oh hi mark
    int n, u, v; cin >> n >> u >> v;
    for(int i = 0; i < n-1; i++) {
        int a,b; cin >> a >> b;
        adj[a].push_back(b);
        adj[b].push_back(a);
    }
    int dist1[n+1], dist2[n+1];
    int vis1[n+1], vis2[n+1];
    memset(vis1, 0, sizeof vis1);
    memset(vis2, 0, sizeof vis2);
    dist1[u] = 0;
    dfs(u, dist1, 0, vis1);
    dist2[v] = 0;
    dfs(v, dist2, 0, vis2);
    int ans=0;
    for(int i = 1;i <= n; i++) {
        //cout << dist1[i] << "," << dist2[i] << endl;
        if(dist2[i] > dist1[i]) {
            ans = max(ans, dist2[i]);
        }
    }
    cout << ans -1;
    return 0;
}


Measured memory_bytes: 14208
n,l = map(int,input().split())
mn = 1000
for i in range(1,n+1):
    ans = l+i-1
    if abs(ans)<abs(mn):
        ans1 = ans
        mn = min(abs(mn),abs(ans))
ans2 = 0      
for j in range(1,n+1):
    ans2 += (l+j-1)
print(ans2-ans1)

Measured memory_bytes: 38256
#include <bits/stdc++.h> 
#define int long long
#define quickie ios_base::sync_with_stdio(false); cin.tie(NULL);
#define rep(i, a, b) for(int i=a; i<b; i++)
#define rep1(i, a, b) for(int i=a; i<=b; i++)
#define repp(i, a, b) for(int i=b-1; i>=a; i--)
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define SZ(x) ((int)(x).size())
#define db double
#define mi map<int, int>
#define mc map<char, int>
#define ms map<string, int>
#define vi vector<int>
#define qi queue<int>
#define MI(x) power(x, mod-2)
#define test int t; cin >> t;
//#define mod 1000000007LL
#define mod 998244353 
using namespace std;
int power(int x, int y) ;
int gcd(int a, int b) ;

signed main() {
    quickie
    db a, b, c ,d ;
    cin >> a >> b >> c >> d ;
    db ans = (a*b)/2 ;
    if((a)/2 == c && (b)/2 == d) {
        cout << fixed << setprecision(9) << ans << " " << 1 << "\n" ;
    }
    else cout << fixed << setprecision(9) << ans << " " << 0 << "\n" ;
}

int power(int x, int y) {
    int res = 1; x %= mod;
    while (y > 0) {
        if (y & 1)
            res = (res*x) % mod;
        y = y>>1;
        x = (x*x) % mod;
    }
    return res%mod;
}
 
int gcd(int a,int b){
    if(a==0) return b;
    return gcd(b%a,a);
}

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

void vdToLower(char* chText);

// 文章Tの中に単語Wがいくつ含まれるかを出力
// 単語レベルで比較なので、1単語ずつ読み取り
int main()
{
	char achInputW[10], achInputT[1000];
	char achEnd[] = "END_OF_TEXT";
	int iLengthW, iLengthT;
	int iCnt1, iCnt2;
	int iAns = 0;

	scanf("%s\n", achInputW);
	scanf("%s", achInputT);

	// 先頭から順に比較、Wの長さを考慮してTの探索位置を決定
	while (strcmp(achEnd, achInputT) != 0)
	{
		iLengthW = strlen(achInputW);
		iLengthT = strlen(achInputT);

		// 文字サイズが異なるなら次の単語
		if (iLengthW != iLengthT)
		{
			scanf("%s", achInputT);
			continue;
		}

		// 小文字化
		vdToLower(achInputT);

		// 文字列比較
		if (strcmp(achInputW, achInputT) == 0)
		{
			iAns++;
		}

		scanf("%s", achInputT);
	}
	printf("%d\n", iAns);

	return 0;
}

// 入力テキストを小文字化
void vdToLower(char* chText)
{
	int iLenghtT = strlen(chText);
	int iCnt;
	int iDiff = 'a' - 'A';

	for (iCnt = 0; iCnt < iLenghtT; iCnt++)
	{
		if ('A' <= chText[iCnt] && chText[iCnt] <= 'Z')
		{
			chText[iCnt] += iDiff;
		}

	}
}


Measured memory_bytes: 2100
import java.io.*;
import java.util.*;
import static java.lang.Math.min;
import static java.lang.Math.max;
public class Main {

    private static void solver(InputReader sc, PrintWriter out) throws Exception {
          long n = sc.nextLong();
          String ans = "";
          String arr[] = {"a","b","c","d","e","f","g","h", "i", "j", "k", "l", "m",
          "n", "o", "p", "q", "r", "s","t","u","v","w","x","y","z"};
          //out.println(arr.length);
          while(n > 0){
              long mod = n%26;mod--;
              if(mod < 0) {
                  mod = 25; n= n/26;
                  n--;
              }else n = n/26;
              ans += (arr[(int) mod]);
          }
          for(int i=ans.length()-1; i>=0; i--) out.print(ans.charAt(i));
    }

    public static void main(String[] args) throws Exception {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        solver(in,out);
        out.close();
    }
    static class InputReader {
        public BufferedReader reader;
        public StringTokenizer tokenizer;
        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        }
        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }
        public int nextInt() {
            return Integer.parseInt(next());
        }
        public long nextLong() {
            return Long.parseLong(next());
        }
        public double nextDouble(){
            return Double.parseDouble(next());
        }
    }
}
class Pair implements Comparable<Pair>{
    int x,y;
    Pair(int x, int y){
        this.x = x;
        this.y = y;
    }
    public int compareTo(Pair p){
        return (int)(this.x - p.x);
    }
}
class Tuple{
    String s;
    int x, y;

    public Tuple(String s, int x, int y) {
        this.s = s;
        this.x = x;
        this.y = y;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Tuple tuple = (Tuple) o;
        return x == tuple.x &&
                y == tuple.y &&
                s.equals(tuple.s);
    }

    @Override
    public int hashCode() {
        return Objects.hash(s, x, y);
    }
}


Measured memory_bytes: 37328
#include<iostream>
#include<cmath>
using namespace std;
double A, B, C, D;
int main(){
    std::cin >> A >> B >> C >> D;
    double n_ao = ceil(A/D);
    double n_ta = ceil(C/B);
    if(n_ao == n_ta){
        if((int)A%(int)D == 0){
            if((int)C%(int)B == 0){
                std::cout << "Yes";
            }else{
                std::cout << "No";
            }
        }else{
            std::cout << "Yes";
        }
    }else{
        if(n_ao > n_ta){
            std::cout << "Yes";
        }else{
            std::cout << "No";
        }
    }
}

Measured memory_bytes: 3700
#include<bits/stdc++.h>
using namespace std;
int main()
{
    long n,m,a[200005],sum=0;
    cin>>n>>m;
    for(int i=0;i<m;i++)
    {
          cin>>a[i];
          sum=sum+a[i];
    }
    if(n-sum<0)
      cout<<"-1"<<endl;
    else
      cout<<n-sum<<endl;
}


Measured memory_bytes: 3756
import java.util.Scanner;

public class Main {

	static Scanner scanner;
	public static void main(String[] args) {
	    scanner = new Scanner(System.in);

	    long n=gl();
	    
	   

        System.out.println(f(n));
//        if (a<=8&&b<=8) {
//        	System.out.print("Yay!");
//        }else {
//        	System.out.print(":(");
//        }


	}
	
	public static long f(long n) {
		if (n==1) {
			return 1;
		} else {
			return (n* f(n-1) % 1000000007);
		}
	}

	// 文字列として入力を取得
	public static String gs() {
		return scanner.next();
	}

	// intとして入力を取得
	public static int gi() {
		return Integer.parseInt(scanner.next());
	}

	// longとして入力を取得
	public static long gl() {
		return Long.parseLong(scanner.next());
	}
	
	// doubleとして入力を取得
	public static double gd() {
		return Double.parseDouble(scanner.next());
	}
}

Measured memory_bytes: 43160
#include<stdio.h>

void trace(int A[], int N) {
	int i;
	for (i = 0; i < N; i++) {
		if (i > 0)printf(" ");
		printf("%d", A[i]);
	}
	printf("\n");
}

void insertionSort(int A[], int N) {
	int i, j, v;
	for (i = 1; i < N; i++) {
		v = A[i];
		j = i - 1;
		while (j >= 0 && A[j]>v) {
			A[j + 1] = A[j];
			j--;
		}
		A[j + 1] = v;
		trace(A, N);
	}
}

int main() {
	int N, i, j;
	int A[100];

	scanf("%d", &N);
	for (i = 0; i < N; i++)scanf("%d", &A[i]);

	trace(A, N);
	insertionSort(A, N);

	return 0;
}

Measured memory_bytes: 2660
import java.util.Arrays;
import java.util.Scanner;

public class Main {
	static Scanner sc = new Scanner(System.in);
	static final int INF = Integer.MAX_VALUE;
	static int N = Integer.parseInt(sc.next());
	static int W = Integer.parseInt(sc.next());
	static int V = 1000*N;
	static int[] w = new int[N];
	static int[] v = new int[N];
	static long[][] dp = new long[N+1][V+1];
	static {
		Arrays.stream(dp).parallel().forEach(i -> Arrays.fill(i, INF));
		dp[0][0] = 0;
	}
	public static void main(String[] args) {
		for (int i = 0; i < N; i++) {
			w[i] = Integer.parseInt(sc.next());
			v[i] = Integer.parseInt(sc.next());
		}
		for (int i = 0; i < N; i++) {
			for (int j = 0; j < V+1; j++) {
				if (j>=v[i]) {
					dp[i+1][j] = Math.min(dp[i][j], dp[i][j-v[i]] + w[i]);
				} else {
					dp[i+1][j] = dp[i][j];
				}
			}
		}
		int ans = -1;
		for (int i = 0; i < V+1; i++) {
			if (dp[N][i]<=W) {
				ans = i;
			}
		}
		System.out.println(ans);
	}
}


Measured memory_bytes: 133200
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <ctime>
#include <iostream>
#include <algorithm>
#include <sstream>
#include <string>
#include <vector>
#include <queue>
#include <stack>
#include <map>
#include <set>
#include <utility>
#include <cctype>
using namespace std;

#define rep(i,n) for(int (i)=0; (i)<(int)(n); ++(i))
#define foreach(c,i) for(__typeof((c).begin()) i=(c).begin();i!=(c).end();i++)

const int MAX_N = 100002;
const int MAX_M = 15;

double dp[MAX_N][MAX_M];
double pow_[MAX_M];
vector<double> ans(MAX_N);

void main2() {
  rep(i,MAX_M) pow_[i] = pow(0.5, i);
  dp[0][0] = 1.0;
  double sums = 0, *prev = dp[0], *next = dp[1];
  
  for (int i = 0; i < MAX_N; ++i) {
    fill(next, next + MAX_M, 0);
    for (int j = 0; j < MAX_M-1; ++j) {
      if (prev[j]) {
        sums += prev[j] * pow_[j];
        if (j == 0) {
          next[1] += prev[j];
        } else {
          next[j+1] += prev[j] * pow_[j];
          next[0] += prev[j] * (1 - pow_[j]);
        }
      }
    }
    ans[i+1] = sums;
    swap(prev, next);
  }
}

int main() {
  main2();
  int n;
  while (scanf("%d",&n),n) printf("%lf\n",ans[n]);
  return 0;
}
    

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

int main() {
    int n, a, b, c, d; cin >> n >> a >> b >> c >> d;

    cout << min((((n +(a-1))/ a) * b), ((n + (c-1)) /c) * d) << endl;
}


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

int main(void)
{
    int D = 0;
    int T = 0;
    int S = 0;
    int n = 0;

    n = scanf("%d",&D);
    if (n == EOF)
    {
        return -1;
    }

    n = scanf("%d", &T);
    if (n == EOF)
    {
        return -1;
    }

    n = scanf("%d", &S);
    if (n == EOF)
    {
        return -1;
    }
    
    if (S == 0 || T == 0 || D == 0)
    {
        return -1;
    }

    if (T * S >= D)
    {
        printf("Yes");
    }
    else
    {
        printf("No");
    }
    return 0;
}


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

int k,n;
long long w[100000];

int num(long long p){
  int j=0;
  for(int i=0;i<k;i++){
    int sum=0;
    while(sum+w[j]<=p){
      sum+=w[j];
      j++;
      if(j==n)return n;
    }
  }
  return j;
}

int search(){
  long long left=0,right=100000*10000,mid;
  while(right-left>1){
    mid=(right+left)/2;
    int v=num(mid);
    // cout<<v<<" ";
    if(v>=n)right=mid;
    else left=mid;
  }
  return right;
}
int main(){
    int p;
    cin>>n>>k;
    for(int i=0;i<n;i++){
      cin>>w[i];
    }
    long long ans=search();
    cout<<ans<<endl;
    return 0;
}

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

int main(){
    int n,k,d,a,count[101],sum=0;
    cin >> n >> k;
    for(int i=0;i<n;i++){
        count[i]=0;
    }
    for(int i=0;i<k;i++){
        cin >> d;
        for(int j=0;j<d;j++){
            cin >> a;
            count[a-1]++;
        }
    }
    for(int i=0;i<n;i++){
        if(count[i]==0) sum++;
    }
    cout << sum;
}

Measured memory_bytes: 3596
#include <iostream>
#include <map>
#include <string>

using namespace std;

int main(void){
  map<string, int> table = { {"SUN", 7}, {"MON", 6}, {"TUE", 5}, {"WED", 4}, {"THU", 3},{"FRI", 2},{"SAT", 1} };
  string str;
  
  cin >> str;
  cout << table[str] << endl;
		      
  return 0;
}


Measured memory_bytes: 256
import java.util.*;
public class Main{
	public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        int b = sc.nextInt();
        if(a>b){
            System.out.println(a-1);
        }else{
            System.out.println(a);
        }
    }
}


Measured memory_bytes: 22996
import sys
n, m = map(int, input().split())
ans = ['*'] * n

for i in range(m):
    s, c = map(int, input().split())
    s -= 1
    c = str(c)
    if s == 0 and c == '0' and n > 1:
        print('-1')
        sys.exit()
    elif ans[s] == '*':
        ans[s] = c
    elif ans[s] != c:
        print('-1')
        sys.exit()

ans = ''.join(ans).replace('*', '0')

if ans[0] == '0' and len(ans) > 1:
    ans = '1' + ans[1:]

print(ans)


Measured memory_bytes: 38384
n,m,k=map(int,input().split())

class UF():
  def __init__(self, N):
    self._parent=[n for n in range(0, N)]
    self._size=[1] * N

  def find_root(self, x):
    if self._parent[x]==x:return x
    self._parent[x]=self.find_root(self._parent[x])
    return self._parent[x]

  def unite(self, x, y):
    gx=self.find_root(x)
    gy=self.find_root(y)
    if gx==gy:return

    if self._size[gx]<self._size[gy]:
      self._parent[gx]=gy
      self._size[gy]+=self._size[gx]
    else:
      self._parent[gy]=gx
      self._size[gx]+=self._size[gy]

  def size(self, x):
    return self._size[self.find_root(x)]

  def samegroup(self, x, y):
    return self.find_root(x)==self.find_root(y)

  def groupnum(self):
    N=len(self._parent)
    ans=0
    for i in range(N):
      if self.find_root(i)==i:
        ans+=1
    return ans

cf=[[] for i in range(n)]
cb=[[] for i in range(n)]

UFa=UF(n)
UFb=UF(n)
for i in range(m):
  x,y=map(int,input().split())
  UFa.unite(x-1,y-1)
  UFb.unite(x-1,y-1)
  cf[x-1].append(y-1)
  cf[y-1].append(x-1)
UFa.groupnum()

for i in range(k):
  x,y=map(int,input().split())
  cb[x-1].append(y-1)
  cb[y-1].append(x-1)

ans=[]
for i in range(n):
  x=(UFa.size(i)-1)-len(cf[i])
  for j in range(len(cb[i])):
    if UFa.samegroup(i,cb[i][j]):
      x-=1
  ans.append(str(x))
print(' '.join(ans))

Measured memory_bytes: 124092
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
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; }
const ll mod=1e9+7;
const ll inf=1ll<<60;

/* */

int main(){

    // 入力スタンダード（複数指定）
    int n;
    cin >> n;
    
    // **************************************
    int a[n], b[n], c[n];
    ll ah[n], bh[n], ch[n];
    for(int i=0; i<n; i++){
        cin >> a[i] >> b[i] >> c[i];
        //ah[i] = 0;
        //bh[i] = 0;
        //ch[i] = 0;
    } 
    // **************************************
    
    ah[0]=a[0];
    bh[0]=b[0];
    ch[0]=c[0];
    for(int i=1; i<n; i++){
        ah[i]=max(a[i]+bh[i-1], a[i]+ch[i-1]);
        bh[i]=max(b[i]+ch[i-1], b[i]+ah[i-1]);
        ch[i]=max(c[i]+ah[i-1], c[i]+bh[i-1]);        
    }

    cout << max(ah[n-1],max(bh[n-1], ch[n-1])) << endl;
    
    return 0;
}

Measured memory_bytes: 3712
#include <bits/stdc++.h>
#define pb push_back
#define eb emplace_back
#define fi first
#define se second
#define rep(i,N) for(long long i = 0; i < (long long)(N); i++)
#define repr(i,N) for(long long i = (long long)(N) - 1; i >= 0; i--)
#define rep1(i,N) for(long long i = 1; i <= (long long)(N) ; i++)
#define repr1(i,N) for(long long i = (N) ; (long long)(i) > 0 ; i--)
#define each(x,v) for(auto& x : v)
#define all(v) (v).begin(),(v).end()
#define sz(v) ((int)(v).size())
#define ini(...) int __VA_ARGS__; in(__VA_ARGS__)
#define inl(...) long long __VA_ARGS__; in(__VA_ARGS__)
#define ins(...) string __VA_ARGS__; in(__VA_ARGS__)
using namespace std; void solve();
using ll = long long; template<class T = ll> using V = vector<T>;
using vi = V<int>; using vl = V<>; using vvi = V< V<int> >;
constexpr int inf = 1001001001; constexpr ll infLL = (1LL << 61) - 1;
struct IoSetupNya {IoSetupNya() { cin.tie(nullptr); ios::sync_with_stdio(false); cout << fixed << setprecision(15); cerr << fixed << setprecision(7);} } iosetupnya;
template<typename T, typename U> inline bool amin(T &x, U y) { return (y < x) ? (x = y, true) : false; }
template<typename T, typename U> inline bool amax(T &x, U y) { return (x < y) ? (x = y, true) : false; }
template<typename T, typename U> ostream& operator <<(ostream& os, const pair<T, U> &p) { os << p.first << " " << p.second; return os; }
template<typename T, typename U> istream& operator >>(istream& is, pair<T, U> &p) { is >> p.first >> p.second; return is; }
template<typename T> ostream& operator <<(ostream& os, const vector<T> &v) { int s = (int)v.size(); rep(i,s) os << (i ? " " : "") << v[i]; return os; }
template<typename T> istream& operator >>(istream& is, vector<T> &v) { for(auto &x : v) is >> x; return is; }
void in(){} template <typename T,class... U> void in(T &t,U &...u){ cin >> t; in(u...);}
void out(){cout << "\n";} template <typename T,class... U> void out(const T &t,const U &...u){ cout << t; if(sizeof...(u)) cout << " "; out(u...);}
template<typename T>void die(T x){out(x); exit(0);}
#ifdef NyaanDebug
  #include "NyaanDebug.h"
  #define trc(...) do { cerr << #__VA_ARGS__ << " = "; dbg_out(__VA_ARGS__);} while(0)
  #define trca(v,N) do { cerr << #v << " = "; array_out(v , N);cout << endl;} while(0)
#else
  #define trc(...)
  #define trca(...)
  int main(){solve();}
#endif

using P = pair<int,int>; using vp = V<P>;
constexpr int MOD = /**/ 1000000007; //*/ 998244353;
//////////

void solve(){
  inl(N , A , B);
  if((A + B) & 1) {
    ll ans = min( max(A , B) - 1 , N - min(A , B) );
    amin(ans , (A - 1 + B - 1 + 1) / 2);
    amin(ans , (2 * N - A - B + 1) / 2);
    out(ans);
  }
  else out(abs(A - B) / 2);
}

Measured memory_bytes: 256