akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int,int>;
#pragma GCC target ("avx2")
#pragma GCC optimization ("unroll-loops")
#define rep(i, n) for(int i=0;i<(int)(n);++i)
template <typename T> ll gcd(T a, T b) {return b?gcd(b, a%b):a;}
template <typename T> ll lcm(T a, T b) {return a * b / gcd(a, b);};
template <typename T> inline void chmin(T &a, const T& b){if(a>b)a=b;}
template <typename T> inline void chmax(T &a, const T& b){if(a<b)a=b;}

int main() {
  cout << fixed << setprecision(0);
  ios::sync_with_stdio(false);
  cin.tie(0);
  ll n, a, b;
  cin >> n >> a >> b;
  cout << a * (n / (a + b)) + min(n % (a + b), a) << '\n';
//  ll sum = 0;
//  ll ans = 0;
//  for (int i = 0; sum < n;) {
//    sum += a + b;
//    ans += a;
//    if (sum + (++i) * (a + b) > n) {
//      ans += n - sum;
//      break;
//    }
//  }
//  cout << ans << '\n';
}


Measured memory_bytes: 384
#include <bits/stdc++.h>
#define ll long long
#define IOS ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define deb(x) cout<<#x<<"="<<x<<endl;
#define endl '\n'
#define M 1000000007
#define int long long
#define max_n 1000000

using namespace std;

void solve()
{
	ll x,y;
	cin>>x>>y;
	if(y-2*x>=0 && (y-2*x)%2==0 && (y-2*x)/2<=x)cout<<"Yes"<<endl;
	else cout<<"No"<<endl;
	// deb(((y-2*x)/2))
}

int32_t main() 
{
	IOS	
	ll T=1;
	// cin>>T;
	for(ll i=1;i<=T;++i)
	{		
		// cout<<"Case #"<<i<<": ";
    	solve();
	}
	return 0;
}

Measured memory_bytes: 3664
#include <bits/stdc++.h>
#include <algorithm>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
#define DEBUG
#define PI 3.141592653589793238462643383279

#define _GLIBCXX_DEBUG
#ifdef DEBUG
#define s(...) show(__VA_ARGS__);
#define sl(...) show(__VA_ARGS__);cout<<endl;
#else
#define s(...)
#define sl(...)
#endif
void show() {}
template <class Head,class... Args>void show(Head t,Args... args){std::cout<<t<<" ";show(args...);}
#define REP(i, n) for(ll i = 1; i <= n; i++)
#define REPR(i, n) for(ll i = n; i >= 1; i--)
#define FOR(i, m, n) for(ll i = m; i <= n; i++)
const ld INF = 1e9+123;
#define VEC(type,A,N) vector<type> A(N+10)
#define VECi(type,A,N,i) vector<type> A(N+10,i)
#define VEC2(type,A,N,M) vector<vector<type>> A(N+10,vector<type>(M+10))
#define VEC2i(type,A,N,M,i) vector<vector<type>> A(N+10,vector<type>(M+10,i))
#define ALL(v) v.begin(), v.end()
ll frac(ll k){
    int s = 1;
    for (ll i=1; i<=k; ++i)s *= i;
    return s;
}
ll gcd(ll a, ll b){
   if (a%b==0)return(b);
   else return(gcd(b, a%b));
}
ll lcm(ll a,ll b){
    return a*b/gcd(a,b);
}
ll antidiv(ll N,ll C,ll D){
    return N-floor(N/C)-floor(N/D)+floor(N/lcm(C,D));
}
vector<ll> yakusuu(ll N){
    vector<ll> ret;
    for (ll i = 1; i * i <= N; i++) {
        if (N % i == 0) {
            ret.push_back(i);
            if (i * i != N) ret.push_back(N / i);
        }
    }
    sort(ret.begin(), ret.end());
    return ret;
}
int main(){
    int N;
    cin>>N;
    vector<ll> A(N);
    int cnt=0;
    ll sum=0;
    FOR(i,0,N-1){
        cin>>A[i];
        if(A[i]<0){
            cnt++;
            A[i]*=-1;
        }
        sum+=A[i];
    }
    
    sort(ALL(A));
    if(cnt%2==1)sum-=A[0]*2;
    cout<<sum;
    //cout<<fixed<<setprecision(32)<<m;
    //sort(ALL(C),[](auto& a, auto& b) {return a[2] < b[2];});
    //if(equal(D.begin(), D.end()-1, K.begin()))cout<<"Yes";else cout<<"No";
    cout<<endl;
    return 0;
}


Measured memory_bytes: 1024
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<char> vchar;
typedef vector<int> vint;
typedef vector<long long> vll;
typedef vector<vector<long long>> vvll;
typedef vector<vector<int>> vvint;
typedef vector<vector<char>> vvchar;
typedef priority_queue<long long> prque;
#define ain(i,n,a) for(long long i=0;i<(long long)(n);i++){cin>>a[i];}
#define aout(i,n,a) for(long long i=0;i<(long long)(n);i++){cout<<a[i]<<endl;}
#define rep(i, n) for(long long i = 0; i < (long long)(n); i++)
#define vsort(v) sort((v).begin(), (v).end())
#define vrsort(v) sort((v).rbegin(), (v).rend())
#define vreverse(v) reverse((v).begin(), (v).end())
#define pb(a) push_back(a)
#define INF 2000000009
#define MOD 1000000007
int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  ll q,l,r,i;cin>>q;vll aru(100001,1);aru[0]=0;aru[1]=0;
  for(i=2;i<50001;i++){
    ll nako=2;
    while(i*nako<100001){
      aru[i*nako]=0;
      nako++; 
    }
  }
  vll sotoka(100001,0);
  for(i=3;i<100001;i+=2){if(aru[i]*aru[(i+1)/2]){sotoka[i]=1;}}
  rep(i,100000){sotoka[i+1]+=sotoka[i];}
  rep(i,q){
    cin>>l>>r;l--;
    cout<<sotoka[r]-sotoka[l]<<endl;
  }
}

Measured memory_bytes: 2176
#include<iostream>
using namespace std;
int main(){
	int a;
	int b;
	int N;
	int e;
	int r;
	int t;
	cin >> a >> b;
	cin >> N;
	t=0;
	for (int p=0;p<N;p++){
		cin >> e >> r;
		if (b>e){
			if (a<=e){
				t++;
			}else if (a>=e)
				if (a<r)
					t++;
		}
	}
	if (t>0){
		cout << "1" << endl;
	}else if (t==0){
		cout << "0" << endl;
	}
}


Measured memory_bytes: 3092
#include <bits/stdc++.h>
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()
#define rep(i, s, N) for(ll i{s}; i < N; i++)
#define rem(i, N, s) for(ll i{N}; i > s; i--)
using namespace std;using ll = long long int;using ld = long double;using P = pair<ll,ll>;const int MOD = (int)1e9+7;const string rt = "\n";const string sp = " ";/* 最大公約数 */template<typename T> T gcd(T a, T b){return b != 0 ? gcd(b, a % b) : a;}/* UnionFind */template<typename T> struct UnionFind{vector<T> par;UnionFind(T n) : par(n, -1){}void init(T n){par.assign(n, -1);}T root(T x){if (par[x] < 0) return x;else return par[x] = root(par[x]);}bool issame(T x, T y){return root(x) == root(y);}bool merge(T x, T y){x = root(x); y = root(y);if(x == y) return false;if(par[x] > par[y]) swap(x, y);par[x] += par[y];par[y] = x;return true;}int size(int x) {return -par[root(x)];}};/* コンビネーション */template<typename T> ll combpm(T N_, T C_) {const int NUM_=400001;static ll fact[NUM_+1],factr[NUM_+1],inv[NUM_+1];if (fact[0]==0) {inv[1]=fact[0]=factr[0]=1;for (int i=2;i<=NUM_;++i) inv[i] = inv[MOD % i] * (MOD - MOD / i) % MOD;for (int i=1;i<=NUM_;++i) fact[i]=fact[i-1]*i%MOD, factr[i]=factr[i-1]*inv[i]%MOD;}if(C_<0 || C_>N_) return 0;return factr[C_]*fact[N_]%MOD*factr[N_-C_]%MOD;}/* 多次元ベクター */template<class T>vector<T> mvec(size_t a){return vector<T>(a);}template<class T, class... Ts>auto mvec(size_t a, Ts... ts){return vector<decltype(mvec<T>(ts...))>(a, mvec<T>(ts...));}/* 多次元デック */template<class T>deque<T> mdeq(size_t a){return deque<T>(a);}template<class T, class... Ts>auto mdeq(size_t a, Ts... ts){return deque<decltype(mdeq<T>(ts...))>(a, mdeq<T>(ts...));}/* テスト関数 */void test(ll n){cout << "test" << n << endl;}/* 小数点以下 */void fixsp(ll n){cout << fixed << setprecision(n);}void defsp(ll n){cout << defaultfloat << setprecision(n);}/* 重み付きUnionFind */struct WUnionFind {vector<int> par;vector<int> rank;WUnionFind(int n = 1) {init(n);}void init(int n = 1) {par.resize(n); rank.resize(n);for (int i = 0; i < n; ++i) par[i] = i, rank[i] = 0;}int root(int x) {if (par[x] == x) {return x;}else {int r = root(par[x]);return par[x] = r;}}bool issame(int x, int y) {return root(x) == root(y);}bool merge(int x, int y) {x = root(x); y = root(y);if (x == y) return false;if (rank[x] < rank[y]) swap(x, y);if (rank[x] == rank[y]) ++rank[x];par[y] = x;return true;}};/* IO高速化 */void fastio(){ios::sync_with_stdio(false);cin.tie(NULL);}
/* ここからコード開始 */

int main(){
  fastio;
  ll N;
  cin >> N;
  auto did = mvec<ll>(N);
  auto uvw = mvec<P>(N,0);
  rep(i, 0, N-1){
    ll u, v, w;
    cin >> u >> v >> w;
    uvw[u-1].push_back(P(v-1,w%2));
    uvw[v-1].push_back(P(u-1,w%2));
  }
  auto ans = mvec<ll>(N);
  auto func = [&](auto& func, ll u) -> void{
    for(auto&& i : uvw[u]){
      auto& v = i.first;
      auto& w = i.second;
      if(w) ans[v] = !ans[u];
      else ans[v] = ans[u];
      if(did[v]==0){
        did[v] = 1;
        func(func, v);
      }
    }
  };
  func(func, 0);
  for(auto&& i : ans){
    cout << i << rt;
  }
}

Measured memory_bytes: 9728
import java.util.Arrays;
import java.util.Scanner;
import java.util.stream.IntStream;

/**
 * 解説通りに作成したソースコード（二次元累積和使用）
 */
public class Main {

	public static void main(String[] args) {
		try (Scanner scanner = new Scanner(System.in)) {
			int n = scanner.nextInt(), m = scanner.nextInt(), q = scanner.nextInt();
			int[][] p = new int[n + 1][n + 1];
			IntStream.range(0, n + 1).forEach(i -> Arrays.fill(p[i], 0));
			IntStream.range(0, m).forEach(i -> p[scanner.nextInt()][scanner.nextInt()]++);
			IntStream.rangeClosed(1, n).forEach(i -> IntStream.rangeClosed(1, n).forEach(j -> p[i][j] += p[i - 1][j]));
			IntStream.rangeClosed(1, n).forEach(i -> IntStream.rangeClosed(1, n).forEach(j -> p[i][j] += p[i][j - 1]));
			IntStream.range(0, q).forEach(i -> {
				int l = scanner.nextInt(), r = scanner.nextInt();
				System.out.println(p[r][r] + p[l - 1][l - 1] - p[r][l - 1] - p[l - 1][r]);
			});
		}
	}
}


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

int main() {
    int a, b, c, d, k;
    cin >> a >> b >> c >> d >> k;
    int time = 60 * c + d - 60 * a - b;
    cout << max(0, time - k) << endl;
}


Measured memory_bytes: 3588
N = int(input())

def solve():
    nedge = 0
    npoint = N*(N+1)*(N+2)//6
    for _ in range(N-1):
        u, v = map(int, input().split())
        u, v = min(u, v), max(u, v)
        nedge += u * (N-v+1)
    return npoint - nedge


if __name__ == "__main__":
    print(solve())


Measured memory_bytes: 9112
#include <iostream>
#include <iomanip>
#include <utility>
#include <cmath>
#include <random>
#include <vector>
#include <map>
#include <set>
#include <deque>
#include <queue>
#include <stack>
#include <string>
#include <algorithm>
using namespace std;

#define rep(i,n) for(int i = 0; i<n; ++i)
#define REP(i,n) for(int i = 1; i<=n; ++i)
#define all(x) begin(x),end(x)
#define show(obj) {for(auto x:obj)cout<<x<<' ';cout<<endl;}
#define line "----------"
typedef long long ll;
typedef pair<int,int> P;
const int inf = 1001001000;
const ll INF = 1LL<<60;
const ll MOD = 1e9 + 7;

int main(){
	int k; string s; cin>>s>>k;
	set<string> st;
	REP(i,k){
		for(int j = 0; j+i<=s.size(); ++j){
			st.insert(s.substr(j,i));
		}
	}
	for(auto x: st){
		--k;
		if(k == 0){cout<<x<<endl; return 0;}
	}
}

// int k;
// string ans;

// void dfs(string s, string ref){
// 	for(int i = 0; i+s.size()<=ref.size() && s.size() != 0; ++i){
// 		if(s == ref.substr(i, s.size())){
// 			--k;
// 			// cout<<k<<' '<<s<<endl;
// 			if(k == 0)ans = s;
// 			break;
// 		}
// 	}
// 	if(s.size()<5){
// 		rep(i,26){
// 			char c = 'a' + i;
// 			dfs(s+c, ref);
// 		}
// 	}
// }

// int main(){
// 	string s; cin>>s>>k;
// 	set<char> cnt;
// 	rep(i,s.size()){cnt.insert(s[i]);}
// 	if(k == 5 && cnt.size() == 1){
// 		string ans;
// 		rep(i,k)ans += *cnt.begin();
// 		cout<<ans<<endl;
// 		return 0;
// 	}
// 	dfs("", s);
// 	cout<<ans<<endl;
// 	return 0;
// }

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

int main() {
    string s;
    cin >> s;

    if (s == "AAA" or s == "BBB") cout << "No" << endl;
    else cout << "Yes" << endl;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define ll long long
using namespace std;
template<typename tn> void read(tn &a){
	tn x=0,f=1; char c=' ';
	for(;!isdigit(c);c=getchar()) if(c=='-') f=-1;
	for(;isdigit(c);c=getchar()) x=x*10+c-'0';
	a=x*f;
}
const int N = 101000;
int n,x[N],y[N],t[N];
int main(){
	int T=1;
	while(T--){
		read(n);
		for(int i=1;i<=n;i++)
			read(t[i]),read(x[i]),read(y[i]);
		int tx=0,ty=0,lst=0;
		for(int i=1;i<=n;i++){
			int delt=t[i]-lst,dis=abs(x[i]-tx)+abs(y[i]-ty);
			if(delt&1^dis&1||dis>delt){puts("No");goto end;}
			tx=x[i];ty=y[i];lst=t[i];
		}
		puts("Yes");
end:;
	}
	return 0;
}

Measured memory_bytes: 1408
from math import gcd
def readinput():
    k=int(input())
    return k

def main(k):
    memo=[]
    for _j in range(k+1):
        memo.append([0 for _i in range(k+1)])
    sum=0
    for a in range(1,k+1):
        for b in range(1,k+1):
            if memo[a][b]!=0:
                temp=memo[a][b]
            else:
                temp=gcd(a,b)
                memo[a][b]=temp
                memo[b][a]=temp
            for c in range(1,k+1):
                if memo[temp][c]!=0:
                    sum+=memo[temp][c]
                else:
                    temp2=gcd(temp,c)
                    memo[temp][c]=temp2
                    memo[c][temp]=temp2
                    sum+=temp2
    return sum

if __name__=='__main__':
    k=readinput()
    ans=main(k)
    print(ans)


Measured memory_bytes: 9464
#include <algorithm>
#include <bitset>
#include <cmath>
#include <ctime>
#include <iostream>
#include <list>
#include <map>
#include <math.h>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <stdio.h>
#include <string>
#include <tuple>
#include <vector>
using namespace std;
#define rep(i,n) for(int i = 0; i < (n); i++)
#define all(a) begin(a),end(a)
typedef long long ll;
typedef pair<int,int> P;
const int inf=1e+9;
const ll mod=1000000007;
const double PI=3.14159265358979323846;
int dx[] = {1,-1,0,0};
int dy[] = {0,0,1,-1};
ll gcd(ll a, ll b){
  if (b==0) return a;
  else return gcd(b,a%b);
}
int cans(bool f){
  if(f) cout << "Yes" << endl;
  else cout << "No" << endl;
  return 0;
}


int fac(int num) {
  if(num==1) return 1;
  else return num*fac(num-1);
}



vector<string> v(2);

int main() {
  string s,t;
  bool f = false;
  cin >> v[0],sort(all(v[0]));s=v[0];
  cin >> v[1],sort(all(v[1]));
  reverse(all(v[1]));
  t=v[1];
  if(s==t) {
    cout << "No" << endl;
    return 0;
  }
  sort(all(v));
  if(v[0] == s) f=true;
  cans(f);
  return 0;
}


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

using namespace std;

int main(){
    string S;
    cin >> S;
    if(S == "Sunny") cout << "Cloudy" << endl;
    if(S == "Cloudy") cout << "Rainy" << endl;
    if(S == "Rainy") cout << "Sunny" << endl;
    return 0;
}

Measured memory_bytes: 256
def main():
    from sys import setrecursionlimit, stdin, stderr
    from os import environ
    from collections import defaultdict, deque, Counter
    from math import ceil, floor
    from itertools import accumulate, combinations, combinations_with_replacement
    setrecursionlimit(10**6)
    dbg = (lambda *something: stderr.write("\033[92m{}\033[0m".format(str(something)+'\n'))) if 'TERM_PROGRAM' in environ else lambda *x: 0
    input = lambda: stdin.readline().rstrip()
    LMIIS = lambda: list(map(int,input().split()))
    II = lambda: int(input())
    P = 10**9+7
    INF = 10**18+10

    N = II()
    A = LMIIS()
    ans = 0
    count = defaultdict(int)
    for a in A:
        count[a] += 1
    A = list(set(A))
    A.sort()

    if count[1] == 1:
        print(1)
        return
    if count[1] > 1:
        print(0)
        return

    sup = max(A)+1
    Not_Divisible = [True] * sup
    Not_Divisible[0] = False


    for a in A:
        if Not_Divisible[a]:
            for i in range(a*2,sup,a):
                Not_Divisible[i] = False

    ans = 0
    for a in A:
        if Not_Divisible[a] and count[a] == 1:
            ans += 1

    print(ans)
            


    
main()

Measured memory_bytes: 158464
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <climits>
#include <cfloat>
#include <iostream>
#include <sstream>
#include <string>
#include <vector>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <algorithm>

using namespace std;

//repetition
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)
#define CLR(a) memset((a), 0 ,sizeof(a))
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;

//constants
const double EPS = 1e-10;
const double PI  = acos(-1.0);
const int INF = 1<<28;


int main(int argc, char **argv) {
    int K,T;
    cin >> K >> T;
    vector<int> A;
    A.resize(T);
    REP(i, T) cin >> A[i];

    int ans = 0;
    int prev = 0;
    int size = -1;
    REP(i, T)
        if (size < A[i]){
            size = A[i];
            prev = i;
        }
    A[prev]--;

    REP(i, K-1){
        int curr = -1;
        int size = -1;
        REP(j, T)
            if (size < A[j] && j != prev){
                size = A[j];
                curr = j;
            }

        if (A[curr] <= 0 || curr < 0){
            ans++;
            A[prev]--;
        }
        else{
            A[curr]--;
            prev = curr;
        }
    }
    cout << ans << endl;
    return 0;

}


Measured memory_bytes: 256
def binsearch(l, r, fn):
    while r - l > 1:
        m = (l + r) // 2
        if fn(m):
            l = m
        else:
            r = m
    return l

def main():
    N = int(input())
    A = list(map(int, input().split()))
    A = sorted(a - i for i, a in enumerate(A, 1))
    def h(t):
        return sum(abs(a - t) for a in A)
    l = A[0]
    r = A[-1]
    while r - l > 1:
        m = (l + r) // 2
        t = h(m + 1) - h(m)
        if t == 0:
            return h(m)
        if t < 0:
            l = m + 1
        else:
            r = m
    return min(h(l), h(r))

print(main())


Measured memory_bytes: 25744
N=int(input())
a=[int(i)//400 for i in input().split()]
s=set()
r=0
for i in range(N):
    if a[i]>=8:
        r+=1
    else:
        s.add(a[i])
print("{0} {1}".format(max([1,len(s)]),len(s)+r))


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

Measured memory_bytes: 580
#include <stdio.h>
int main(void)
{
	int a,b,c,x,i,j,k,z=0;
	scanf("%d%d%d%d",&a,&b,&c,&x);
	for(i=0; i<=a; i++){
		for(j=0; j<=b; j++){
			for(k=0; k<=c; k++){
				if(i*500+j*100+k*50==x){
					z=z+1;
				}
			}
		}
	}
	printf("%d\n",z);
	return 0;
}

Measured memory_bytes: 128
import java.util.Scanner;

public class Main {

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

		int N = sc.nextInt();
		int x = 0, y = 0, z = 0;

		int cnt = 0;
		for (int i = 0; i < N; i++) {
			String s = sc.next();

			//AB
			for (int j = 0; j < s.length() - 1; j++) {
				if(s.charAt(j) == 'A' && s.charAt(j + 1) == 'B') cnt++;
			}

			if(s.charAt(0) == 'B' && s.charAt(s.length() - 1) == 'A') x++;		//B---A
			else if(s.charAt(s.length() - 1) == 'A') y++;	//----A
			else if(s.charAt(0)== 'B') z++;		//B----

		}

		int ans = 0;
		if (x != 0) {
			if(y == 0 && z == 0)
				ans = x - 1;
			else
				ans = Math.min(y, z) + x;
		} else {
			ans = Math.min(y, z);
		}

		//System.out.println(cnt + " " + x + " " + y + " " + z);

		System.out.println(ans + cnt);
	}

}

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

#define d(x) cerr << #x ":" << x << endl;
#define dd(x, y) cerr << "(" #x "," #y "):(" << x << "," << y << ")" << endl
#define rep(i, n) for (int i = (int)(0); i < (int)(n); i++)
#define repp(i, a, b) for (int i = (int)(a); i < (int)(b); i++)
#define all(v) v.begin(), v.end()
#define dump(v)                  \
    cerr << #v ":[ ";            \
    for (auto macro_vi : v) {    \
        cerr << macro_vi << " "; \
    }                            \
    cerr << "]" << endl;
#define ddump(v)                           \
    cerr << #v ":" << endl;                \
    for (auto macro_row : v) {             \
        cerr << "[";                       \
        for (auto macro__vi : macro_row) { \
            cerr << macro__vi << " ";      \
        }                                  \
        cerr << "]" << endl;               \
    }
using lint       = long long;
const int INF    = 1e9;
const lint LINF  = 1e18;
const lint MOD   = 1e9 + 7;
const double EPS = 1e-10;

int main() {
    lint A, B, N;
    cin >> A >> B >> N;
    if (B == 1) {
        cout << 0 << endl;
        return 0;
    }
    // A = 7, B = 5;
    // N = 20;
    // for (int x = 1; x <= N; x++) {
    //     int left  = (A * x) / B;
    //     int right = (x) / B;
    //     cout << x << ":" << left - A * right << endl;
    // }

    lint left, right;
    if (N < B - 1) {
        left  = (A * N) / B;
        right = N / B;
    } else {
        left  = (A * (B - 1)) / B;
        right = (B - 1) / B;
    }
    cout << left - A * right << endl;

    return 0;
}

Measured memory_bytes: 3640
#include <cstdio>
using namespace std;

int main(void)
{
	int n;
	long long sum = 1;

	scanf("%d",&n);
	for(int f1 = 1; f1 <= n; f1++){
		sum *= f1;
	}

	printf("%lld\n", sum);
	return 0;
}

Measured memory_bytes: 1020
#include <bits/stdc++.h>
#define rep(i,a,b) for(int i=a;i<b;i++)
#define rrep(i,b,a) for(int i=b;i>=a;i--)
#define fori(a) for(auto i : a )
#define all(a) begin(a), end(a)
#define set(a,b) memset(a,b,sizeof(a))
#define sz(a) a.size()
#define pi 3.14159
#define ll long long
#define ull unsigned long long
#define pb push_back
#define PF push_front //deque
#define mp make_pair
#define pq priority_queue
#define mod 1000000007
#define f first
#define s second
#define pii pair< int, int >
#define vi vector<int>
#define vpii vector<pii>
#define debug(v) for(auto i:v) cout<<i<<" ";
#define tc int t; cin >> t; while(t--)

using namespace std;
string repeat(string s, int n) {
    string s1 = "";
    for (int i=0; i<n;i++)
        s1+=s;
    return s1;
}
string getString(char x) {
    string s(1, x);
    return s;
}

void optimizeIO(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
}
int gcd(int a, int b){
    if (a == 0)  return b;
    return gcd(b % a, a);
}
void  solve(){
  int n,m,x,y;
  cin>>n>>m>>x;
  int c1=0,c2=0;
  rep(i,0,m){
    cin>>y;
    if(y<x)c1++;
    else c2++;
  }
  cout<<min(c1,c2)<<endl;
}
int main(){
    optimizeIO();
    // tc
    { solve();
    }
}


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

//loop
#define rep(i,a,n) for(int i=(a);i<(n);++i)
#define repe(i,a,n) for(int i=(a);i<=(n);++i)
#define rrep(i,n,a) for(int i=(n);n>(a);--i)
#define rrepe(i,n,a) for(int i=(n);n>=(a);--i)

//Abbreviate
#define PB push_back
#define MP make_pair
#define F first
#define S second
#define all(v) v.begin(),v.end()
#define ENDL << "\n"

using ll = long long;
using P = pair<int,int>;
using itn = int;

//constant
const int INF = 1<<30;
const ll MOD = 1000000007;
const long double PI =(acos(-1));

/***Snippet*********************************
ifelse, isprime, torad, todeg, lcm, bfs
*********************************************/

//Adjacency list
vector<int> to[100005];

int main(){
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    int a,b;
    cin >> a >> b;
    for(int i=(b-a)+1;i<(b+a);++i){
        if(i==(b+a)-1){
            cout << i ENDL;
            break;
        }
        cout << i << " ";
    }
    
    return 0;
}

Measured memory_bytes: 6000
#include <bits/stdc++.h>
using namespace std;
#define pp pair<int,int>
#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define ll long long
#define ld long double
#define all(a) (a).begin(),(a).end()
#define mk make_pair
ll MOD=1000000007;
ll mod=998244353;
int inf=1000001000;
ll INF=1e18+5;

void Add(int &a, int b) {
  a += b;
  while (a >= MOD) a -= MOD;
  while (a < 0) a += MOD;
}
 
void Mul(int &a, int b) {
  a = 1LL * a * b % MOD;
}
 
int Pow(int b, int e) {
  if (e < 0) e += MOD - 1;
  int ret = 1;
  while (e) {
    if (e & 1) ret = 1LL * ret * b % MOD;
    b = 1LL * b * b % MOD;
    e >>= 1;
  }
  return ret;
}
 
namespace Math {
  const int NMAX = (int)1e7;
  int pow2[1 + NMAX];
  int fact[1 + NMAX], tcaf[1 + NMAX];
  void Precalc() {
    fact[0] = pow2[0] = 1;
    for (int i = 1; i <= NMAX; ++i) {
      pow2[i] = pow2[i - 1];
      Add(pow2[i], pow2[i]);
 
      fact[i] = fact[i - 1];
      Mul(fact[i], i);
    }
    tcaf[NMAX] = Pow(fact[NMAX], -1);
    for (int i = NMAX - 1; i >= 0; --i) {
      tcaf[i] = tcaf[i + 1];
      Mul(tcaf[i], i + 1);
      assert(1LL * fact[i] * tcaf[i] % MOD == 1);
    }
  }
  int Choose(int n, int k) {
    if (k > n || n < 0) return 0;
    return 1LL * fact[n] * tcaf[n - k] % MOD * tcaf[k] % MOD;
  }
};

int main() {
    Math::Precalc();
    ll n;
    cin >> n;
    vector<ll> a(n);
    rep(i,n) cin >> a[i];
    sort(all(a));
    reverse(all(a));
    ll p=Pow(2,2*n-1),q=Pow(2,2*n-2),b=0,ans=0;
    rep(i,n){
        b=(q*i)%MOD;
        b=(b+p)%MOD;
        ans=(ans+(b*a[i])%MOD)%MOD;
    }
    cout << ans << endl;
}


Measured memory_bytes: 119040
#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n;
    cin>>n;
    int a[n];
    for(int i=0;i<n;i++)
        cin>>a[i];
    int dp[n+1];
    dp[0]=0;
    dp[1]=abs(a[1]-a[0]);
    for(int i=2;i<=n;i++)
        dp[i]=min(dp[i-2]+abs(a[i]-a[i-2]),dp[i-1]+abs(a[i]-a[i-1]));
    cout<<dp[n-1]<<"\n";
    return 0;
}

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

using namespace std;


#define PI 3.14159265
#define int long long

int n, k;

string s;

main(){

	cin >> n >> k >> s;


	vector < pair <int, int> > p;

	for(int i = 0; i < n; i++){
		if(s[i] == '0'){
			int j = i;

			while(j < n and s[j] == '0'){
				j++;
			}

			p.emplace_back(i, j - 1);
			i = j;
		}
	}

	if(p.empty() or p.size() <= k){
		cout << n << endl; return 0;
	}

	int record = p[k].first;

	for(int i = k; i < p.size(); i++){
		if(i != p.size() - 1)
			record = max(record, p[i + 1].first - 1 - p[i - k].second);
		else
			record = max(record, n - 1 - p[i - k].second);
	}

	// for(int i = 0; i < p.size(); i++){
	// 	cout << p[i].first << " " << p[i].second << endl;
	// }


	cout << record << endl;

	return 0;
}

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

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

  int ans = 0;
  if (n[0] == '2')
    ++ans;
  if (n[2] == '2')
    ++ans;
  if (n[2] == '2')
    ++ans;
  if (n[3] == '2')
    ++ans;
  cout << ans << endl;
}

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

using namespace std;

#define FOR(i,a,b) for(int i = (a); i <= (b); ++i)
#define FORD(i,a,b) for(int i = (a); i >= (b); --i)
#define RI(i,n) FOR(i,1,(n))
#define REP(i,n) FOR(i,0,(n)-1)
#define mini(a,b) a=min(a,b)
#define maxi(a,b) a=max(a,b)
#define mp make_pair
#define pb push_back
#define st first
#define nd second
#define sz(w) (int) w.size()
typedef vector<int> vi;
typedef long long ll;
typedef long double ld;
typedef pair<int,int> pii;
typedef pair<pii, int> para;
const int inf = 1e9 + 7;
const int maxN = 1e6 + 7;
const ll mod = 1e18 + 7;

int n;
ll arr[maxN];

int main()
{
	ios_base::sync_with_stdio(0);
	cin>>n;
	REP(i, n) cin>>arr[i];
	//sort(arr, arr + n);
	ll sum = 0, ans = 0;
	while (true) {
		REP(i, n) sum += (arr[i] / n);
		ans += sum;
		REP(i, n) {
			ll x = (arr[i] / n);
			arr[i] -= x * n;
			arr[i] += (sum - x);
		}
		//REP(i, n) cout<<arr[i]<<" ";
		//cout<<endl;
		bool pom = false;
		REP(i, n) if (arr[i] >= n) pom = true;
		if (!pom)
			break;
		sum = 0;
	}
	cout<<ans;
	return 0;
}


Measured memory_bytes: 256
//JOI2011本選問３夜店(Night Market) 
#include<stdio.h>
#include<iostream>
#include<algorithm>
using namespace std;

int main(){
	int N, T, S, **dp, A, B, temp, out = 0;

	scanf("%d %d %d",&N, &T, &S);
	dp = new int *[N + 1];
	for(int f1 = 0; f1 <= N; f1++){
		dp[f1] = new int[T + 1];
		if(f1 == 0)
			for(int f2 = 0; f2 <= T; f2++){
				dp[f1][f2] = 0;
			}
	}
	//動的計画法
	for(int f1 = 0; f1 < N; f1++){
		scanf("%d %d", &A, &B);
		if(B <= T){
			if(f1 == 0){
				dp[f1][B] = A;
				for(int f2 = B; f2 <= S; f2++)
					dp[f1][f2] = A;
			}
			else{
				//一段過去の情報をコピーする
				for(int f2 = 0; f2 <= T; f2++)
					dp[f1][f2] = dp[f1 - 1][f2];
				//情報更新
				for(int f2 = 0; f2 <= (T - B); f2++){
					temp = (f2 + B > S && f2 < S) ? S : f2;
					if(temp + B <= T){
						if(temp != S)
							dp[f1][temp + B] = max(dp[f1 - 1][f2] + A, dp[f1 - 1][temp + B]);
						else
							dp[f1][temp + B] = max(dp[f1 - 1][S] + A, dp[f1 - 1][temp + B]);
					}
				}
			}
		}
	}
	for(int f1 = 0; f1 <= T; f1++){
		if(dp[N-1][f1] > out)
			out = dp[N-1][f1];
	}
	printf("%d\n", out);
	return 0;
}

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

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int m = sc.nextInt();
        int[] s = new int[m];
        int[] c = new int[m];
        for (int i = 0; i < m; i++) {
            s[i] = sc.nextInt();
            c[i] = sc.nextInt();
        }

        int[] num = new int[n + 1];
        Arrays.fill(num, -1);
        for (int i = 0; i < m; i++) {
            if (num[s[i]] != -1 && num[s[i]] != c[i]) {
                System.out.println(-1);
                return;
            }
            num[s[i]] = c[i];
        }

        if (n >= 2) {
            if (num[1] == 0) {
                System.out.println(-1);
                return;
            } else if (num[1] == -1) {
                num[1] = 1;
            }
        }
        for (int i = 1; i < num.length; i++) {
            if (num[i] != -1) {
                continue;
            }
            num[i] = 0;
        }
        int ans = 0;
        for (int i = 1; i < num.length; i++) {
            ans += num[i] * Math.pow(10, num.length - i - 1);
        }
        System.out.println(ans);
    }

}


Measured memory_bytes: 21844
let () =
  let a,b,c = Scanf.scanf "%f %f %f\n" (fun a b c -> a, b, c *. (atan 1.) /. 45.) in
  let h = b *. (sin c) in
  let s = a *. h *. 0.5 in
  let l = a +. b +. sqrt ( a ** 2. +. b ** 2. -. 2. *. a *. b *. (cos c)) in
  Printf.printf "%f\n%f\n%f\n" s l h
;;


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

typedef long long ll;
typedef vector<int> vii;
typedef vector<ll> vll;
typedef vector<vll> vvll;
typedef vector<vii> vvii;
typedef pair<ll,ll> pll;

const ll N = 200001;
const ll MOD = 1000000007;
const ll INF = LLONG_MAX;

#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define yes cout<<"YES"<<nl
#define no cout<<"NO"<<nl
#define space ' '
#define nl '\n'

#define COUT(v) for(auto it:v)cout<<it<<space;cout<<nl;
#define CIN(v) for(auto &it:v)cin>>it;

int main()
{
    ios::sync_with_stdio(false),cin.tie(0),cout.tie(0);
    int t=1,cs=0;
    //cin>>t;
    while(t--)
    {
        ll n,i,s;
        cin>>n;
        s=(n/500)*1000;
        n%=500;
        n=n-(n%5);
        cout<<s+n<<nl;
    }
}


Measured memory_bytes: 256
#include <cstdio>
#define M 1000000007

using namespace std;

int main(){
    long long int N,ans = 1;

    scanf("%lld",&N);

    for(int i=1;i<=N;i++){
        ans = (ans * i) % M;
    }

    printf("%lld\n",ans);

    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <cmath>
#include <vector>
#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 euc_dis(x, y) sqrt(x*x + y*y)

typedef long long ll;

using namespace std;

int main(){

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

    int n, k;
    cin >> n >> k;

    vector<int> l(n);
    rep(i, n) cin >> l[i];

    sort(l.begin(), l.end(), greater<int>());

    int sum = 0;
    rep(i, k) sum += l[i];

    cout << sum << '\n';


    return 0;
}


Measured memory_bytes: 256
#!/usr/bin/env python3
from collections import defaultdict,deque
from heapq import heappush, heappop
from bisect import bisect_left, bisect_right
import sys, random, itertools, math
sys.setrecursionlimit(10**5)
input = sys.stdin.readline
sqrt = math.sqrt
def LI(): return list(map(int, input().split()))
def LF(): return list(map(float, input().split()))
def LI_(): return list(map(lambda x: int(x)-1, input().split()))
def II(): return int(input())
def IF(): return float(input())
def S(): return input().rstrip()
def LS(): return S().split()
def IR(n): return [II() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def FR(n): return [IF() for _ in range(n)]
def LFR(n): return [LI() for _ in range(n)]
def LIR_(n): return [LI_() for _ in range(n)]
def SR(n): return [S() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
mod = 1000000007
inf = float("INF")

#solve
def solve():
    s = S()
    print("ABC" if s == "ARC" else "ARC")
    return


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


Measured memory_bytes: 76680
#include <bits/stdc++.h>
using namespace std;
using ll=long long;
using vi=vector<int>;
using vvi=vector<vi>;
using vl=vector<ll>;
using vvl=vector<vl>;
using pii=pair<int,int>;
using pll=pair<ll,ll>;
const ll LINF=0x1fffffffffffffff;
const int INF=0x3fffffff;
const int MOD=1000000007;
#define VAR(type,...) type __VA_ARGS__;in(__VA_ARGS__)
#define VEC(type,name,size) vector<type> name(size);each(x, name)in(x)
#define rep(i,a,b) for(int i=(a);i<(b);++i)
#define rrep(i,a,b) for(int i=(a-1);i>=(b);--i)
#define each(x,v) for(auto &x:(v))
#define all(x) (x).begin(),(x).end()
#define print(...) out(__VA_ARGS__);cout<<endl
void in(){} template<class T,class... U> void in(T &t,U &...u){cin>>t;in(u...);}
void out(){} template<class T,class... U> void out(T t,U ...u){cout<<t<<" ";out(u...);}
void solve();
int main(){cin.tie(0);ios::sync_with_stdio(0);solve();}

void solve() {
  VAR(int, H, W);
  VEC(string, S, H);
  vl dx = {-1, -1, -1, 0, 0, 1, 1, 1};
  vl dy = {-1, 0, 1, -1, 1, -1, 0, 1};
  rep(i, 0, H) {
    rep(j, 0, W) {
      if (S[i][j] == '#') {
        continue;
      }
      int c = 0;
      rep(k, 0, 8) {
        int nx = j + dx[k];
        int ny = i + dy[k];
        if (nx < 0 || nx >= W || ny < 0 || ny >= H) {
          continue;
        }
        if (S[ny][nx] == '#') {
          c++;
        }
      }
      S[i][j] = (char)(c + 48);
    }
  }
  rep(i, 0, H) {
    print(S[i]);
  }
}


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

#define rep(i, n) for(int i = 0; i<(n); i++)
#define chmax(x, y) x = max(x, y)
#define chmin(x, y) x = min(x, y)
using namespace std;
using ll = long long;

int main() {
    int N;
    cin >> N;
    vector<int> P(N), Q(N);
    rep(i, N) cin >> P[i], P[i]--;
    rep(i, N) Q[P[i]] = i;

    int k = 0;
    int now = 0;
    int prev = -1;
    rep(i, N) {
        if (prev > Q[i]) {
            now = 0;
        }

        now++;
        prev = Q[i];
        chmax(k, now);
    }

    int ans = N - k;
    cout << ans << endl;
}


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

const int maxn = 300, maxm = maxn * 2, mod = 1e9 + 7;
int n, m, a[maxm + 3], cnt[maxm + 3], f[maxm + 3][maxn + 3][maxn + 3];
bool tag[maxm + 3];

void upd(int &x, int y) {
	x += y, x < mod ? 0 : x -= mod;
}

int main() {
	scanf("%d", &n);
	m = n * 2;
	for (int i = 1; i <= m; i++) {
		scanf("%d", &a[i]);
		if (a[i] != -1) {
			a[i] = m - a[i] + 1;
		}
		cnt[i] = 1;
	}
	for (int i = 1; i <= m; i += 2) {
		if (a[i] != -1 && a[i + 1] != -1) {
			cnt[a[i]] = 0, cnt[a[i + 1]] = 0;
		}
	}
	for (int i = 2; i <= m; i++) {
		cnt[i] += cnt[i - 1];
	}
	int num = 1, cur = 0;
	for (int i = 1; i <= m; i += 2) {
		if (a[i] == -1 && a[i + 1] == -1) {
			num = 1ll * num * ++cur % mod;
		} else if (a[i] == -1 || a[i + 1] == -1) {
			tag[cnt[a[i] + a[i + 1] + 1]] = true;
		}
	}
	m = cnt[m], n = m / 2;
	f[0][0][0] = 1;
	for (int i = 1; i <= m; i++) {
		for (int j = 0; j <= n; j++) {
			for (int k = 0; k <= n; k++) {
				if (tag[i]) {
					upd(f[i][j][k], f[i - 1][j + 1][k]);
					if (k > 0) {
						upd(f[i][j][k], f[i - 1][j][k - 1]);
					}
				} else {
					upd(f[i][j][k], f[i - 1][j + 1][k]);
					upd(f[i][j][k], 1ll * f[i - 1][j][k + 1] * (k + 1) % mod);
					if (j > 0) {
						upd(f[i][j][k], f[i - 1][j - 1][k]);
					}
				}
			}
		}
	}
	printf("%lld\n", 1ll * f[m][0][0] * num % mod);
	return 0;
}

Measured memory_bytes: 215424
package main

import (
  "bufio"
  "fmt"
  "os"
  "strconv"
  "strings"
)

func main() {
  input := Input{bufio.NewReaderSize(os.Stdin,100)}
  n,q := input.NextInts()
  t := make([][]int,n)
  for i:=0;i<n-1;i++ {
    a,b := input.NextInts()
    t[a-1] = append(t[a-1],b-1)
    t[b-1] = append(t[b-1],a-1)
  }
  cnt := make([]int,n)
  for i:=0;i<q;i++ {
    p,x := input.NextInts()
    cnt[p-1] += x
  }
  ans := make([]int,n)
  var dfs func(int,int,int)
  dfs = func(v,p,s int) {
    s += cnt[v]
    ans[v] = s
    for _,u := range t[v] {
      if u == p { continue }
      dfs(u,v,s)
    }
  }
  dfs(0,-1,0)
  fmt.Print(ans[0])
  for i:=1;i<n;i++ { fmt.Print(" ");fmt.Print(ans[i]) }
  fmt.Println()
}

type Input struct { reader *bufio.Reader }
func(i *Input) NextLine() string {
  var buffer []byte
  for {
    line,isPrefix,err := i.reader.ReadLine()
    if err != nil { panic(err) }
    buffer = append(buffer,line...)
    if !isPrefix { break }
  }
  return string(buffer)
}
func(i *Input) NextInts() (int,int) {
  s := strings.Fields(i.NextLine())
  x,_ := strconv.Atoi(s[0])
  y,_ := strconv.Atoi(s[1])
  return x,y
}

Measured memory_bytes: 79488
#include<iostream>
#include<vector>
#include<algorithm>
#include<map>

using namespace std;

#define rep(i, s, n) for(int i = s;i<n;i++)
#define repe(i, s, n) for(int i = s;i<=n;i++)
#define pb push_back
#define fi first
#define se second
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<int> vi;
typedef vector<int> vll;
typedef vector<pii> vpii;
typedef vector<pll> vpll;
static const ll maxLL = (ll) 1 << 62;
const ll MOD = 1000000007, INF = 1e18;
int dy[] = {-1, 0, 1, 0};
int dx[] = {0, 1, 0, -1};

template<typename T1, typename T2>
bool pairCompare(const pair<T1, T2> &firstElof, const pair<T1, T2> &secondElof) {
    return firstElof.second > secondElof.second;
}

int mapMaxValue(std::map<ll, int> m) {
    int max = 0;
    for (std::map<ll, int>::iterator it = m.begin(); it != m.end(); it++) {
        if (max < it->second) max = it->second;
    }
    return max;
}

int main(void) {
    int n, x;
    cin >> n >> x;

    vi l(n);

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

    int cnt = 1;
    int prev = 0;
    for (int i = 1; i <= n; ++i) {
        int d = prev + l[i - 1];
        if (d <= x) cnt++;
        prev = d;
    }
    cout << cnt << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <stdio.h>
#include <math.h>
using namespace std;
using vi = vector<int>;
using vll = vector<long long int>;
using vb = vector<bool>;
using vvi = vector<vector<int>>;
using vvll = vector<vector<long long int>>;
using ll = long long int;

ll M = 998244353;

ll modpow(ll a, ll n, ll mod) {
    ll res = 1;
    for(int i=0; i<n; i++){
        res *= a;
        res %= mod;
    }
    return res;
}

int main(){
    ll N; cin >> N;
    vll d(N+1);
    for(int i=1; i<N+1; i++){
        cin >> d[i];
    }
    vll num(N, 0);
    for(int i=1; i<N+1; i++){
        num[d[i]]++;
    }
    if(d[1]!=0||num[0]>1){
        cout << 0;
    }else{
        bool t = true;
        for(int i=1; i<N-1; i++){
            if(num[i]==0&&num[i+1]>0){
                t = false;
            }
        }
        if(t == false){
            cout << 0;
        }else{
            ll p = 1;
            for(int i=1; i<N; i++){
                if(num[i]==0){
                    break;
                }else{
                    ll m = modpow(num[i-1], num[i], M);
                    p *= m;
                    p %= M;
                }
            }
            cout << p;
        }
    }
}

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

using namespace std;

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

	if (a <= k) {
		k -= a;
		a = 0;
		b = (b - k) >= 0 ? b - k : 0;
	}
	else {
		a -= k;
	}
	cout << a << " " << b;
	return 0;
}

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

int main(){
	long long n;
	long long temp;
	long long wa=0;
	
	cin >> n;
	temp = n;
	while (temp>0){
		wa += temp%10;
		temp /= 10;
	}
	if(n%wa==0){
		cout << "Yes" << endl;
	}else{
		cout << "No" << endl;
	}
	
	return 0;
}

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

int main(){
  int a,b,c,k;
  cin >> a >>b >>c >>k;
  int ans = 0;

  for(int i=1;i<=k;i++){
    if(a>=i){
      ans++;
    }else if(a+b>=i){
      continue;
    }else{
      ans--;
    }
  }
  cout << ans;
}


Measured memory_bytes: 3576
#include <bits/stdc++.h>
using namespace std;
                     
#define int             long long
#define ld              long double
#define mp              make_pair
#define ff              first
#define ss              second
#define pb              push_back
#define fo(i,n)         for(i=0;i<n;i++)
#define fo1(i,n)        for(i=1;i<=n;i++)
#define FO(i,k,n)       for(i=k;k<=n?i<=n:i>=n;k<=n?i++:i--)
#define all(c)          c.begin(),c.end()
#define rall(c)         c.rbegin(),c.rend()
#define si              set<int>
#define vi              vector<int>
#define mii             map<int,int>
#define pii             pair<int,int>
#define vpii            vector<pii>
#define vvi             vector<vi>
#define usi             unordered_set<int>
#define umii            unordered_map<int,int>
#define pqmx            priority_queue<int>
#define pqmn            priority_queue<int,vi,greater<int> >
#define sp(x)           cout<<setprecision(x)<<fixed;
#define setbits(x)      __builtin_popcountll(x)
#define zerobits(x)     __builtin_ctzll(x)
#define in(a,n)         vi a(n);fo(i,n)cin>>a[i];
#define in1(a,n)        vi a(n+1);fo1(i,n)cin>>a[i];
#define w(t)            int t;cin>>t;while(t--)
#define sz(v)           (int)v.size()
#define gcd             __gcd
#define lcm(x,y)        x*(y/gcd(x,y))
#define endl            '\n'
#define PI              3.14159265358979323846
const int inf =         1e18;
const int mod =         1e9+7;
void __p(int x) {cout<<x;}
void __p(int32_t x){cout<<x;}
void __p(float x){cout<<x;}
void __p(double x){cout<<x;}
void __p(ld x) {cout<<x;}
void __p(char x){cout <<'\''<<x<<'\'';}
void __p(const char *x){cout <<'\"' <<x<<'\"';}
void __p(const string &x) {cout<<'\"'<<x<<'\"';}
void __p(bool x) {cout<<(x?"true":"false");}
void _p() {cout << "]\n";}
template<typename T,typename V>     void __p(const pair<T,V> &x) {cout<<'{';__p(x.first);cout<<',';__p(x.second);cout<<'}';}
template<typename T>                void __p(const T &x) {int f = 0; cout << '{'; for (auto &i: x) cout << (f++ ? "," : ""), __p(i); cout << "}";}
template <typename T,typename... V> void _p(T t, V... v) {__p(t);if(sizeof...(v))cout<<", ";_p(v...);}
int po(int x,int p,int m = inf) {int ans=1;x%=m;while(p>0){if(p&1)ans=(ans*x)%m;p=p>>1;x=(x*x)%m;}return ans;}
int inv(int x,int m=mod){return po(x,m-2,m)%m;}
#ifndef ONLINE_JUDGE
#define dbg(x...) cout<<"["<<#x<<"]=[";_p(x)
#else 
#define dbg(x...)
#endif
//=================================================================================




const int N=1e6+6;
int n,m,k,x,y,z,a,b,c,d,i,j,l,r,f;








void sol()
{   
    cin>>a>>b>>c;
    si s;
    s.insert(a);
    s.insert(b);
    s.insert(c);
    
    
    
    cout<< ((s.size()==2)?"Yes":"No") <<endl;
}





int32_t main()
{
    ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
    //sp(10);
    // w(t)
    sol();
    return 0;
}

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

using namespace std;

int main() {
    int n, h, highest = 0, answer = 0;
    cin >> n;
    for (int i = 0; i < n; ++i) {
        cin >> h;
        if (h >= highest) {
            ++answer;
            highest = h;
        }
    }
    cout << answer << endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define repe(i, n) for (int i = 0; i <= (n); ++i)
#define all(x) (x).begin(),(x).end()
using namespace std;
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; }
typedef long long ll;
const int INF = 1e9;
const ll mod = 1000000007;
int gcd(int a,int b){return b?gcd(b,a%b):a;}
int lcm(int a,int b){return a*b / gcd(a,b);}

int main() {
    string s,ss;
    cin >> s;
    int d = 20190430;
    for (int i=0; i<s.size(); ++i) {
        if (s[i] != '/') {
            ss += s[i];
        }
    }
    int sss = stoi(ss);
    if (sss <= d) {
        cout << "Heisei" << "\n";
    } else {
        cout << "TBD" << "\n";
    }
}


Measured memory_bytes: 256
# dpA - Frog 1
"""
Example:
x y
  x y
    x y ...
        x y (y: answer)
"""
def main():
    n = int(input())
    A = tuple(map(int, input().split()))
    x, y = 0, abs(A[1] - A[0])
    for i in range(2, n):
        dif1 = x + abs(A[i] - A[i - 2])
        dif2 = y + abs(A[i] - A[i - 1])
        x = y
        y = dif1 if dif1 <= dif2 else dif2
    print(y)


if __name__ == "__main__":
    main()

Measured memory_bytes: 14276
#include<iostream>
using namespace std;
#include<string>
#include<utility>
#include<algorithm>
#include<vector>
#include<math.h>
#include<bits/stdc++.h>
#include<stdio.h>
 
int main(){
    long long int x;
    cin >> x;
    long long int num=0;
    num=(x/11)*2;
    if(x%11<=6 && x%11>=1){
        num+=1;
    }
    if(x%11>=7){
        num+=2;
    }
    cout << num;
}

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

int main(){
	int r,g,b;
	cin >> r >> g >> b;
	int sum=100*r+10*g+b;
	if(sum%4==0){
		cout << "YES" << endl;
	}else{
		cout << "NO" << endl;
	}
	return 0;
}


Measured memory_bytes: 256
#pragma GCC optimize "03"
#include "bits/stdc++.h"
using namespace std;
 
#define int long long int
#define ld long double
#define pi pair<int, int>
#define pb push_back
#define fi first
#define se second
#define IOS ios::sync_with_stdio(false); cin.tie(0); cout.tie(0)
#ifndef LOCAL
#define endl '\n'
#endif
 
const int N = 1e3 + 5;
const int mod = 1e9 + 7;
const int inf = 1e9 + 9;
 
string s[1005];
int dp[N][N];

signed main() {
	IOS;
	#ifdef LOCAL
		freopen("input.txt","r", stdin);
		freopen("output.txt","w",stdout);
	#endif
	int n, m;
	cin >> n >> m;
	for(int i = 0; i < n; i++)
		cin >> s[i];
	dp[1][1] = 1;
	for(int i = 0; i < n; i++){
		for(int j = 0; j < m; j++){
			if(s[i][j] == '#')	
				continue;
			if(i != 0 && s[i-1][j] != '#')
				dp[i+1][j+1] = (dp[i+1][j+1] + dp[i][j+1]) % mod;
			if(j != 0 && s[i][j-1] != '#')
				dp[i+1][j+1] = (dp[i+1][j+1] + dp[i+1][j]) % mod;
		}
	}	
	cout << dp[n][m];
	return 0;
}

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

int dp[4002][4002];

int main() {
  string s;
  string t;
  int mx;
  
  while( getline(cin, s) ) {
    fill(dp[0], dp[4000] + 4000, 0);
    getline(cin, t);
    int n = s.size(), m = t.size();
    for(int i=0; i<n; i++) {
      for(int j=0; j<m; j++) {
	if( s[i] == t[j] ) {
	  dp[i+1][j+1] = dp[i][j] + 1;
	} else {
	  dp[i+1][j+1] = 0;
	}
      }
    }
    
    mx = 0;
    for(int i=0; i<=n+1; i++)
      for(int j=0; j<=m+1; j++)
	mx = max(mx, dp[i][j]);
    
    cout << mx << endl;
  }
  
  return 0;
}

Measured memory_bytes: 63744
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <string>
#include <sstream>
#include <complex>
#include <vector>
#include <list>
#include <queue>
#include <deque>
#include <stack>
#include <map>
#include <set>
#include <numeric>
using namespace std;
typedef long long int ll;

#define EPS (1e-7)
#define INF 1e18
#define max(p,q)((p)>(q)?(p):(q))
#define min(p,q)((p)<(q)?(p):(q))
#define PI (acos(-1))

#define REP(i, n) for(int i = 0; i < (int)(n); i++)


int main() {

    int N;
    cin >> N;
    N = N * N * N;
    cout << N << endl;

    return 0;
}

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

class Main {
	public static void main (String[] args) {
		Scanner input=new Scanner(System.in);
		int a,b,c,d;
		a=input.nextInt();
		b=input.nextInt();
		c=input.nextInt();
		d=input.nextInt();
		do{
		    c=c-b;
		  //   System.out.println("c" + c);
		    if(c<=0)
		        break;
		    a=a-d;
		  //  System.out.println("a" + a);
		    if(a<=0)
		        break;
		}while(c>0 && a>0);
		if(c<=0)
		     System.out.println("Yes");
		 else
		    System.out.println("No");
		input.close();
	}
}

Measured memory_bytes: 35812