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

int main(void){
    int s;
    
    cin >> s;
    
    if(s/100 <= 12 && s/100 != 0 && s%100 <= 12 && s%100 != 0){//amb
        cout << "AMBIGUOUS" << endl;
    } else if(s/100 <= 12 && s/100 != 0){//mmyy
        cout << "MMYY" << endl;
    } else if(s%100 <= 12 && s%100 != 0){//yymm
        cout << "YYMM" << endl;
    } else {//NA
        cout << "NA" << endl;
    }
    
    return 0;
}

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

int main(){
	cin.tie(0),ios::sync_with_stdio(false);
	int d,n; cin>>d>>n;
	int m,ans=0;
	if(d==1)m=100;
	else m=10000;
	if(d==0)for(int i=0;i!=n;++i){
		++ans;
		if(ans%100==0)++ans;
	}else for(int i=0;i!=n;++i){
		ans+=m;
		int t=ans;
		for(int j=0;j<d;++j){t/=100;}
		if(t!=0&&t%100==0)ans+=m;
	}
	cout<<ans<<"\n"s;
}

Measured memory_bytes: 256
/**
 * code generated by JHelper
 * More info: https://github.com/AlexeyDmitriev/JHelper
 * @author alireza_kaviani
 */

#include <bits/stdc++.h>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/assoc_container.hpp>

using namespace std;
using namespace __gnu_pbds;

template<class T> using Tree = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;

typedef long long ll;
typedef long double ld;
typedef pair<ll, ll> pll;
typedef pair<double, double> pdd;

#define all(x)                      (x).begin(),(x).end()
#define Sort(x)                     sort(all((x)))
#define X                           first
#define Y                           second
#define Mp                          make_pair
#define sep                         ' '
#define endl                        '\n'
#define debug(x)                    cerr << #x << " = " << x << endl
#define SZ(x)                       ll(x.size())
#define fast_io                     ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define set_random                  mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());

ll poww(ll a, ll b, ll md) {
    return (!b ? 1 : (b & 1 ? a * poww(a * a % md, b / 2, md) % md : poww(a * a % md, b / 2, md) % md));
}

const ll MAXN = 3e2 + 10;
const ll LOG = 22;
const ll INF = 1e18;
const ll MOD = 1e9 + 7; // 998244353; // 1e9 + 9;

ll n, m, L, dist1[MAXN][MAXN], dist2[MAXN][MAXN], q;

int main() {
    fast_io;
    for (ll i = 0; i < MAXN; i++) {
        for (ll j = 0; j < MAXN; j++) {
            dist1[i][j] = dist2[i][j] = INF;
        }
        dist1[i][i] = dist2[i][i] = 0;
    }

    cin >> n >> m >> L;
    for (ll i = 1; i <= m; i++) {
        ll v, u, w;
        cin >> v >> u >> w;
        dist1[v][u] = dist1[u][v] = w;
    }

    for (ll k = 1; k <= n; k++) {
        for (ll i = 1; i <= n; i++) {
            for (ll j = 1; j <= n; j++) {
                dist1[i][j] = min(dist1[i][j], dist1[i][k] + dist1[k][j]);
            }
        }
    }
    for (ll i = 1; i <= n; i++) {
        for (ll j = 1; j <= n; j++) {
            if (dist1[i][j] <= L) dist2[i][j] = 1;
        }
    }

    for (ll k = 1; k <= n; k++) {
        for (ll i = 1; i <= n; i++) {
            for (ll j = 1; j <= n; j++) {
                dist2[i][j] = min(dist2[i][j], dist2[i][k] + dist2[k][j]);
            }
        }
    }

    cin >> q;
    while (q--) {
        ll v, u;
        cin >> v >> u;
        cout << (dist2[v][u] == INF ? -1 : dist2[v][u] - 1) << endl;
    }

    return 0;
}
/*

*/


Measured memory_bytes: 2048
import java.util.*;
public class Main{

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(System.in);
		
		int N = sc.nextInt();
		
		int start[] = new int[N];
		int len[] = new int[N];
		int often[] = new int[N];
		
		for(int i = 1; i<N; i++) {
			len[i] = sc.nextInt();
			start[i] = sc.nextInt();
			often[i] = sc.nextInt();
		}
		
		for(int i = 1; i<N; i++) {
			int time = 0;
			for(int j = i; j<N; j++) {
//				System.out.println(time + " " + start[j]);
				if(time <= start[j]) {
					time = start[j] + len[j];
				}
				else {
					int next = (int) Math.ceil(time/(1.0*often[j]))*often[j];
					time = next + len[j];
				}
			}
			
			System.out.println(time);
		}
		System.out.println(0);
	}

}


Measured memory_bytes: 27752
#include <iostream>
#include <cmath>
#include <map>
#include <string>
#include<vector>


using namespace std;

int main()
{
    long long K;
    vector<bool> memory;
    cin >> K;
    memory.resize(K, false);
    if(K % 2 == 0){
        cout << -1 << endl;
    }else{

        long long num = 7;
        int count = 1;
        while(true){
            num = num % K;
            if(num == 0){
                cout << count << endl;
                break;
            }
            if(memory[num]){
                cout << -1 << endl;
                break;
            }
            memory[num] = true;
            num = num * 10 + 7;
            count++;
        }
    }
}

Measured memory_bytes: 3728
#include <bits/stdc++.h>
#include <vector>
#include <cstdint>
#define FOR(i,l,r) for(int i=(l);i<(r);++i)
#define RFOR(i,l,r) for(int i=(l);i>=(int)(r);i--)
#define rep(i,n)  FOR(i,0,n)
#define rrep(i,n)  RFOR(i,n-1,0)

#define int long long
using namespace std;
const int MX = 1e6;
const int inf = 1e9+5;
const int mod = 1e9+7;
using ll = long long;

signed main(){
    int h,w,k;
    cin >> h >> w >>k;
    char a[h][w];
    bool c[h];
    rep(i,h) {
        string s;
        cin >> s;
        bool f = false;
        rep(j,w) {
            a[i][j] = s[j];
            if(s[j]=='#') f = true; 
        }

        c[i]=f;
    }
    int b[h][w];
    rep(i,h) {
        rep(j,w) b[i][j]=0;
    }
    int now = 1;
    rep(i,h) {
        if(!c[i]) continue;
        int cnt = 0;
        rep(j,w) {
            if(a[i][j]=='#')cnt++;
            if(j!=0&&a[i][j]=='#'&&cnt!=1)now++;
            b[i][j]=now;
        }
        now++;
    }
    bool f = false;
    rep(i,h) {
        if(c[i]) f = true;
        if(c[i]) continue;
        if(!f) continue;
        rep(j,w) {
            b[i][j]=b[i-1][j];
        }
    }
    rrep(i,h-1) {
        if(b[i][0]!=0) continue;
        rep(j,w) {
            b[i][j]=b[i+1][j];
        }
    }
    rep(i,h) {
        rep(j,w)cout << b[i][j]<<" " << flush;
        if(i<h-1)cout << "" << endl;
    }
    return 0;
}


Measured memory_bytes: 4404
#include <bits/stdc++.h>
#define rep( i, n, m ) for(int i = ( n ); i < ( m ); i++)

int main( void ){
	int n;
	if (!scanf( "%d", &n ))
		return -1;
	int* array = new int[ n ];
	int* sort_array = new int[ n ];
	rep( i, 0, n ){
		int a;
		if (!scanf( "%d", &a ))
			return -1;
		array[i] = a;
		sort_array[i] = a;
	}
	std::sort(sort_array, sort_array+n);
	int md = n/2-1;
	rep( i, 0, n ){
		if (sort_array[md] >= array[i])
			printf("%d\n", sort_array[md+1]);
		else
			printf("%d\n", sort_array[md]);
	}
	return 0;
}


Measured memory_bytes: 3840
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  long long a,b,c;cin >> a >> b >> c;
  vector<long long> k(a,b-c);
  for (int i=0;i<c;i++) {
    long long x;cin >> x;
	k[x-1]++;
  }
  for (int i=0;i<a;i++) if (k[i]>0) cout<<"Yes"<<endl; else cout<<"No"<<endl;
}


Measured memory_bytes: 1408
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
using ll = long long;
ll GetDigit(ll num){ return log10(num)+1; } //numの桁数を求める

int main()
{
    int n,x,y;
    cin >> n >> x >> y;
    int ans = x + y - n;
    if(ans <= 0) ans = 0;
    cout << min(x,y) << " " << ans << endl;
    return 0;
}

Measured memory_bytes: 3672
#include <bits/stdc++.h>
using namespace std;
/*{{{*/  //template
#define rep(i,n) for(int i=0;i<(int)(n);i++)
constexpr int INF = numeric_limits<int>::max()/2;
constexpr long long LINF = numeric_limits<long long>::max()/3;
#define mp make_pair
#define pb push_back
#define eb emplace_back
#define fi first
#define se second
#define all(v) (v).begin(),(v).end()
#define sz(x) (int)(x).size()
#define debug(x) cerr<<#x<<":"<<x<<endl
#define debug2(x,y) cerr<<#x<<","<<#y":"<<x<<","<<y<<endl
//struct fin{ fin(){ cin.tie(0); ios::sync_with_stdio(false); } } fin_;
struct Double{ double d; explicit Double(double x) : d(x){} };
ostream& operator<<(ostream& os,const Double x){ os << fixed << setprecision(20) << x.d; return os; }
template<typename T> ostream& operator<<(ostream& os,const vector<T>& vec){ os << "["; for(const auto& v : vec){ os << v << ","; } os << "]"; return os; }
template<typename T,typename U> ostream& operator<<(ostream& os,const pair<T,U>& p){ os << "(" << p.first << ","<< p.second <<")"; return os; }
template<typename T> ostream& operator<<(ostream& os,const set<T>& st){ os<<"{"; for(T v:st) os<<v<<","; os <<"}"; return os; }
template<typename T,typename U> inline void chmax(T &x,U y){ if(y>x) x = y; }
template<typename T,typename U> inline void chmin(T &x,U y){ if(y<x) x = y; }
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> pii;
typedef vector<int> vi;
typedef vector<vi> vvi;
ll gcd(ll a,ll b){ if(b==0) return a; else return gcd(b,a%b); }
//constexpr double eps = 1e-14; 
constexpr double eps = 1e-10; 
constexpr ll mod = 1e9+7;
const int dx[]={1,0,-1,0} ,dy[] = {0,1,0,-1};
/*}}}*/

int main(){
    int N;
    cin >> N;
    vector<ll> a(N);
    rep(i,N) cin >> a[i];

    vector<ll> b(N);
    map<ll,ll> z;
    for(int i=0;i<N;i++){
        if(z.count(a[i])) continue;
        z[a[i]] = i;
    }

    for(int i=0;i<N;i++) b[i] = z[a[i]];

    set<int> tmp;

    vector<int> ans;

    //debug(b);

    vector<ll> cnt(N+1,0);
    for(int i=0;i<N;i++){
        cnt[b[i]]++;
        cnt[b[N-1-i]]--;
        if(cnt[b[i]] != 0) tmp.insert(b[i]);
        else tmp.erase(b[i]);

        if(cnt[b[N-1-i]] != 0) tmp.insert(b[N-i-1]);
        else tmp.erase(b[N-i-1]);

        if(tmp.size() == 0){
            ans.push_back(i+1);
        }
    }

    for(int i=0;i<ans.size();i++){
        cout << ans[i];
        if(i==ans.size()-1) cout << endl;
        else cout <<  " ";
    }
}



Measured memory_bytes: 9428
#define _USE_MATH_DEFINES
#include <bits/stdc++.h>
using ll = long long;
using namespace std;
#define _overload3(_1, _2, _3, name, ...) name
#define _rep(i, n) repi(i, 0, n)
#define repi(i, a, b) for(int i = int(a); i < int(b); ++i)
#define rep(...) _overload3(__VA_ARGS__, repi, _rep, )(__VA_ARGS__)
#define all(x) (x).begin(), (x).end()
const long long MOD = 1e9 + 7;

template <typename T> bool chmax(T &a, const T &b) {
    if(a < b) {
        a = b;
        return 1;
    }
    return 0;
}
template <typename T> bool chmin(T &a, const T &b) {
    if(a > b) {
        a = b;
        return 1;
    }
    return 0;
}

int main() {
    int N, M, A;
    cin >> N >> M;

    rep(i, M) {
        cin >> A;
        N -= A;
    }
    chmax(N, -1);
    cout << N << endl;
}


Measured memory_bytes: 3624
#include <bits/stdc++.h>
typedef long long LL;
#define FOR(i,a,b) for(LL i=(a);i<(b);++i)
#define REP(i,n) FOR(i,0,n)

using namespace std;
LL p = 1000000007ll;

int main(void)
{
  LL n;
  cin >> n;
  vector<int> a(n);
  for(auto &x:a) cin >> x;
  LL l = 0;
  LL r = n;
  while(r-l>1) {
    LL piv = (l+r+1) / 2;
    vector<pair<int,int>> str;
    bool lpiv = false;
    for(auto x:a) {
      bool more = false;
      while(!str.empty() && str.back().first > x) {
        more = true;
        str.pop_back();
      }
      if(more && piv == 1) {
        lpiv = true;
        break;
      }
      if(str.empty() || str.back().first < x) {
        if(more) str.emplace_back(x,2);
        else str.emplace_back(x,1);
      } else {
        LL updatePos = x;
        while(!str.empty() && str.back().first == updatePos && str.back().second == piv) {
          --updatePos;
          str.pop_back();
        }
        if(updatePos == 0) {
          lpiv = true;
          break;
        }
        if(!str.empty() && str.back().first == updatePos) {
          ++str.back().second;
        } else {
          str.emplace_back(updatePos,2);
        }
        if(updatePos != x) str.emplace_back(x,1);
      }
    }
    if(lpiv) l = piv;
    else r = piv;
  }
  cout << r << endl;
  return 0;
}


Measured memory_bytes: 4692
#include<iostream>
#include<algorithm>
#include<cstdio>
#include<cstring>
#include<cmath>
#include<map>
#include<queue>
#include<set>
#include<stack>
#include<string>
#include<sstream>
#include<vector>
#define inf 2147483647
#define rep(i,a,b) for(int i=a;i<b;i++)
#define  rr read()
#define ll long long
#define repb(i,a,b) for(int i=a;i<=b;i++)
#define CloseIo   ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0)
using namespace std;
int read()
{
    char ch = getchar();
	int x = 0, f = 1;
    while(ch < '0' || ch > '9') {if(ch == '-') f = -1; ch = getchar();}
    while('0' <= ch && ch <= '9') {x = x * 10 + ch - '0'; ch = getchar();}
    return x * f;
}
vector<ll>v[10],v1,v2;

int main()
{
CloseIo;
ll a[10],K;
rep(i,0,3)
scanf("%lld",&a[i]);
scanf("%lld",&K);
rep(i,0,3)
{
	 rep(j,0,a[i])
	 {
	 ll t;
	 scanf("%lld",&t);
	 v[i].push_back(t);
	 	
	 }
	 sort(v[i].begin(),v[i].end(),greater<ll>());
}
rep(i,0,v[0].size())
rep(j,0,v[1].size())
rep(k,0,v[2].size())
if((i+1)*(j+1)*(k+1)<=K)v1.push_back(v[0][i]+v[1][j]+v[2][k]);
else
break;
sort(v1.begin(),v1.end(),greater<ll>());
rep(i,0,K)
printf("%lld\n",v1[i]);

}



Measured memory_bytes: 1412
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main(){
    int n;
    scanf("%d", &n);
    char a[n+1][3];
    char b[n+1][3];
    char c[n+1][3];
    getchar();
    for(int i = 0; i < n; i++){
        scanf("%s", a[i]);
        strcpy(b[i], a[i]);
        strcpy(c[i], a[i]);
    }

    for(int i = 0; i < n; i++){
        for(int j = n-1 ; j >= i+1; j--){
            if(b[j][1] < b[j-1][1]){
                char temp[3];
                strcpy(temp, b[j]);
                strcpy(b[j], b[j-1]);
                strcpy(b[j-1], temp);
            }
        }
    }

    for(int i = 0; i < n; i++){
        int mini = i;
        for(int j = i; j < n; j++){
            if(c[j][1] < c[mini][1]){
                mini = j;
            }
        }
        char temp[3];
        strcpy(temp, c[i]);
        strcpy(c[i], c[mini]);
        strcpy(c[mini], temp);
    }
    for(int i = 0; i < n; i++){
        printf("%s", b[i]);
        if(i!=n-1) printf(" ");
        else printf("\n");
    }
    printf("Stable\n");

    for(int i = 0; i < n; i++){
        printf("%s", c[i]);
        if(i != n-1) printf(" ");
        else printf("\n");
    }

    int flag = 1;
    for(int i = 0; i < n; i++){
        for(int j = 0; j < 2; j++){
            if(b[i][j] != c[i][j]){
                flag = 0;
                break;
            }
        }
    }
    if(flag) printf("Stable\n");
    else printf("Not stable\n");
    return 0;
}


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

using ll = long long;
using ull = unsigned long long;

const double PI = acos(-1);
const int inf = 2e9;
const ll INF = 2e18;
const ll MOD = 1e9 + 7;

#define sz(s) (s).size()
#define pb push_back
#define fi first
#define se second
#define REP(i, n) for (int i = 0; i < n; i++)
#define ALL(a) begin(a), end(a)

int main(void) {
    int n, x;
    while (cin >> n >> x, n) {
        int count = 0;
        REP(i, n) {
            REP(j, i) {
                REP(k, j) {
                    int a = i + 1;
                    int b = j + 1;
                    int c = k + 1;
                    if (a != b && a != c && b != c) {
                        if (a + b + c == x) count++;
                    }
                }
            }
        }
        cout << count << endl;
    }
    return 0;
}


Measured memory_bytes: 3088
using System;

namespace ATCODER123
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] S = Console.ReadLine().Split(' ');
            int N = int.Parse(S[0]);
            int A = int.Parse(S[1]);
            int B = int.Parse(S[2]);

            if (N * A > B)
            {
                Console.WriteLine(B);
            }
            else
            {
                Console.WriteLine(N*A);
            }
        }
    }
}


Measured memory_bytes: 13140
import java.util.Scanner;

class Main{
    
    public static void main(String[] args){
        
        Scanner sc =new Scanner(System.in);
    
        String s=sc.nextLine();
        
        for(int i = 0; i < s.length(); i++) {
			char c = s.charAt(i);
			if('a' <= c && c <= 'z') 
		     System.out.print((char)(c - 32));
			else if('A' <= c && c <= 'Z') 
			 System.out.print((char)(c + 32));
			else System.out.print(c);
		}
		System.out.println();
        
      
  }
}


Measured memory_bytes: 26764
#include<bits/stdc++.h>
using namespace std;
 
#define REP(i,s,n) for(int i=s;i<n;++i)
#define rep(i,n) REP(i,0,n)
#define SORT(c) sort((c).begin(),(c).end())
#define IINF INT_MAX
#define LLINF LLONG_MAX
#define DEBUG false
 
typedef long long ll;
typedef pair<int, int> ii;

int main() {

	int m, nmin, nmax;
	while(cin >> m >> nmin >> nmax, m){
		vector<int> p(m);
		rep(i, m) cin >> p[i];
		
		int ans = 0;
		int maxi = 0;
		REP(i, nmin-1, nmax){
			if(maxi <= p[i] - p[i+1]){
				maxi = p[i] - p[i+1];
				ans = i + 1;
			}
		}
		cout << ans << endl;
		
	}

	return 0;
}

Measured memory_bytes: 3076
zero = "01" * 10**5
one = "10" * 10**5
s = str(input())
ans1 = 0
ans2 = 0
for i, j in zip(s, zero):
    if i != j:
        ans1 += 1
for i, j in zip(s, one):
    if i != j:
        ans2 += 1
print(min(ans1, ans2))


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

int main() {
  int N;
  cin >> N;
  
  int doublet = 0;
  
  for (int i = 0; i < N; i++) {
    int d1, d2;
    cin >> d1 >> d2;
    
    if (doublet == 3) {
      break;
    }
    
    if (d1 == d2) {
      doublet++;
    } else {
      doublet = 0; 
    }
  }
  
  if (doublet == 3) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
}


Measured memory_bytes: 3632
import java.util.*;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		// スペース区切りの整数の入力
		int X=sc.nextInt();
        int Y=sc.nextInt();
        if(2*X<=Y&&4*X>=Y&&Y%2==0){
          System.out.println("Yes");
        }else{
          System.out.println("No");
        }
}
}

Measured memory_bytes: 35608
import java.util.Scanner;

public class Main {
	// 2-100
	public static void main(String args[]) {
		Scanner in = new Scanner(System.in);
		long a = in.nextLong();
		long b = in.nextLong();
		long c = in.nextLong();
		long d = in.nextLong();
		long firstA = a*c;
		long firstB = a*d;
		long SecondA = b*c;
		long SecondB = b*d;
		System.out.println(Math.max(Math.max(firstA, firstB),Math.max(SecondA, SecondB)));
	}

}

Measured memory_bytes: 27064
#include <iostream>
#include <fstream>
#include <vector>
#include <cstring>
#include <algorithm> // sort
#include <unistd.h>
#include <bits/stdc++.h>

#define pii pair<int,int>
#define REP(i, n) for (long long i = 0; i < (n); i++) 
using namespace std;

using Graph = vector<vector<int>>;

vector< vector< pair<int,int> > > v(100010);	
int V[100010] = {0};
int X[100010] = {0};
typedef long long ll;
static const ll INF = 1000000000000000000LL;
static const ll MOD = 1000000007;


 //1 2 3
 //1 5 4
 //1 6 4

 //2 5 1

//↑があったら2 6 は0 
//3 5 2

bool judge = true;

void dfs(int n)
{
    V[n] = 1;

    for(int i = 0; i <  v[n].size(); ++i)
    {
        if(X[v[n][i].first] == MOD)
        {
            X[v[n][i].first] = X[n] + v[n][i].second;
        }
        else if(X[v[n][i].first] != X[n] + v[n][i].second)
        {
            judge = false;
        }

        if(V[v[n][i].first] == 0)dfs(v[n][i].first);
    }

}

int main()
{
    ll N, M;
    cin >> N >> M;
    REP(i, N)
    {
        X[i] = MOD;
    }
    REP(i,M)
    {
        int l,r,d;
        cin >> l >> r >> d;
        --l;--r;
        v[l].push_back({r,d});
        v[r].push_back({l,-d});
    
    }

    REP(i,N)
    {
		if(V[i] == 0)
        {
			X[i] = 0;
			dfs(i);
		}
	}
    if(judge) cout << "Yes" << endl;
	else cout << "No" << endl;






    return 0;
}

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

using namespace std;
typedef long long ll;
typedef unsigned long ul;
typedef pair<ul, ul> P;

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

int main(){
    int N, X;
    int min = INF;

    cin >> N >> X;
    rep(i,N){
        int a; 
        cin >> a;

        X -= a;
        if(min > a) min = a;
    }

    cout << N + (X / min) << endl;
}

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

Measured memory_bytes: 23892
import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.List;
import java.util.NoSuchElementException;

public class Main {
	public static void main(String[] args) {
		FastScanner sc = new FastScanner();
		long N =sc.nextLong();
		long[] ary = new long[5];
		for (int i = 0; i < 5; i++) {
			ary[i] = sc.nextLong();
		}
		long min = 1000000000000001L;
		long ans = 0;
		for(int i = 0; i <5; i++) {
			if (ary[i] >= min) {
				ans++;
			} else {
				ans = (N + ary[i] - 1) / ary[i] + i;
				min = ary[i];
			}
		}
		System.out.println(ans);
	}
}

class FastScanner {
    private final InputStream in = System.in;
    private final byte[] buffer = new byte[1024];
    private int ptr = 0;
    private int buflen = 0;

    private boolean hasNextByte() {
        if (ptr < buflen) {
            return true;
        } else {
            ptr = 0;
            try {
                buflen = in.read(buffer);
            } catch (IOException e) {
                e.printStackTrace();
            }
            if (buflen <= 0) {
                return false;
            }
        }
        return true;
    }

    private int readByte() {
        if (hasNextByte())
            return buffer[ptr++];
        else
            return -1;
    }

    private static boolean isPrintableChar(int c) {
        return 33 <= c && c <= 126;
    }

    public boolean hasNext() {
        while (hasNextByte() && !isPrintableChar(buffer[ptr]))
            ptr++;
        return hasNextByte();
    }

    public String next() {
        if (!hasNext())
            throw new NoSuchElementException();
        StringBuilder sb = new StringBuilder();
        int b = readByte();
        while (isPrintableChar(b)) {
            sb.appendCodePoint(b);
            b = readByte();
        }
        return sb.toString();
    }

    public long nextLong() {
        if (!hasNext())
            throw new NoSuchElementException();
        long n = 0;
        boolean minus = false;
        int b = readByte();
        if (b == '-') {
            minus = true;
            b = readByte();
        }
        if (b < '0' || '9' < b) {
            throw new NumberFormatException();
        }
        while (true) {
            if ('0' <= b && b <= '9') {
                n *= 10;
                n += b - '0';
            } else if (b == -1 || !isPrintableChar(b)) {
                return minus ? -n : n;
            } else {
                throw new NumberFormatException();
            }
            b = readByte();
        }
    }

    public int nextInt() {
        long nl = nextLong();
        if (nl < Integer.MIN_VALUE || nl > Integer.MAX_VALUE)
            throw new NumberFormatException();
        return (int) nl;
    }

    public double nextDouble() {
        return Double.parseDouble(next());
    }
}

Measured memory_bytes: 21204
<?php
$N = intval(fgets(STDIN));
$hArray = array_map("intval", explode(" ", trim(fgets(STDIN))));

$dp[0] = 0;
for($i = 1; $i < $N; $i++){
    $dp[$i] = $dp[$i-1] + abs($hArray[$i] - $hArray[$i-1]);
    if($i >= 2){
        $dp[$i] = min($dp[$i], $dp[$i-2] + abs($hArray[$i] - $hArray[$i-2]));
    }
}
echo $dp[$N-1];

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

// マクロ //
#define rep(v,times) for(int v = 0; v < (int)(times); v++)
#define req(v,first,endplus1) for(int v = first; v < (int)(endplus1); v++)
#define all(x) x.begin(), x.end()
#define sort(x) sort(all(x))
#define uniq(x) x.erase(unique(all(x)), x.end())
#define vsum(x) accumulate(all(x), 0)
#define cou(x) cout << x << endl
#define y() cout << "Yes" << endl
#define n() cout << "No" << endl
#define Y() cout << "YES" << endl
#define N() cout << "NO" << endl
#define x2(x) (x) * (x)

// 型エイリアス //
using lint = long long;
using pii = pair<int, int>;
using vpii = vector<pii>;
using plili = pair<lint, lint>;
using vplili = vector<plili>;
using vi = vector<int>;
using vli = vector<lint>;
using vc = vector<char>;
using vs = vector<string>;
using vb = vector<bool>;
using vvi = vector<vi>;
using vvli = vector<vli>;
using vvb = vector<vb>;
using vvc = vector<vc>;
using vvs = vector<vs>;
using mii = map<int, int>;
using mili = map<int, lint>;
using mci = map<char, int>;
using mcli = map<char, lint>;
using msi = map<string, int>;
using msli = map<string, lint>;


// 関数 //
template<class T, class Q> lint gcd_(T a, Q b) {
    int t;
    while (b != 0) {
        t = a % b;
        a = b;
        b = t;
    }
    return a;
}

template<class T, class Q> lint lcm_(T a, Q b) {
    return a * b / gcd_(a, b);
}

template<class T, class Q> double distance(T a, Q b) {
    double dist;
    dist = sqrt(x2(a.first - b.first) + x2(a.second - b.second));
    return dist;
}

lint perm(int a) {
    lint perm = 1;
    for (int i = a; i >= 1; i--) {
        perm *= i;
    }
    return perm;
}

lint combination(int n, int m) {
    long double c = 1;
    for (int i = n, k = 1; i > m; i--, k++) {
        c *= i;
        c /= k;
    }
    return (lint)c;
}

template<class T, class Q> inline bool chmin(T& a, Q b) {
    if (a > b) {
        a = b;
        return true;
    }
    return false;
}

template<class T, class Q> inline bool chmax(T& a, Q b) {
    if (a < b) {
        a = b;
        return true;
    }
    return false;
}

// 定数 //
const double pi = acos(-1);
const int mod = 1000000007;
const int inf = 1045141919;
const lint linf = ((1LL << 62) - 1);
const int dx4[4] = { 1,0,-1,0 };
const int dy4[4] = { 0,1,0,-1 };
const int dx8[8] = { 1,1,0,-1,-1,-1,0,1 };
const int dy8[8] = { 0,1,1,1,0,-1,-1,-1 };

// End of Template //



int main() {

    cin.tie(0);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(15);

    const unsigned long long ma = 1e18;
    int N;
    cin >> N;
    vector<unsigned long long int> A(N);
    rep(i, N) cin >> A[i];
    sort(A);
    if (A[0] == 0) { cou(0); exit(0); }
    unsigned long long seki = 1;
    unsigned long long prevseki = seki;
    rep(i, A.size()) {
        prevseki = seki;
        seki *= A[i];
        seki /= A[i];
        if (seki != prevseki) { cou(-1); exit(0); }
        seki *= A[i];
        if (seki > ma) { cou(-1); exit(0); }
    }

    cou(seki);
}


Measured memory_bytes: 4436
#include<bits/stdc++.h>
#define int long long
#define MOD 1000000007
using namespace std;
int a,b,ans;
int fun(int a){
	int ans=1;
	for(int i=2;i<=a;i++)ans*=i,ans%=MOD;
	return ans;
}
signed main(){
	scanf("%lld%lld",&a,&b);
	if(abs(a-b)<=1)ans=(1+(a==b))*fun(a)%MOD*fun(b)%MOD;
	printf("%lld",ans);
}

Measured memory_bytes: 256
n = int(input())
abc = [tuple(map(int, input().split())) for _ in range(n)]
dp = [[-10 ** 10 for _ in range(3)] for _ in range(n+1)]
dp[0] = [0, 0, 0]
for i in range(1, n+1):
    for j in range(3):
        for k in range(3):
            if j == k:
                continue
            dp[i][j] = max(dp[i][j], dp[i-1][k] + abc[i-1][j])

print(max(dp[n]))

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


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

  int n;
  cin >> n;
  multiset<int> ms1,ms2;
  set<int> s1,s2;
  int v[n];
  rep(i,n) cin >> v[i];
  rep(i,n){
    if(i%2==0){
      s1.insert(v[i]);
      ms1.insert(v[i]);
    }else{
      s2.insert(v[i]);
      ms2.insert(v[i]);
    }
  }
  int m1=0;
  int mm1,mm2;
  mm1=mm2=0;
  for(auto i:s1){
    if(m1<ms1.count(i)){
      m1=max(m1,((int)ms1.count(i)));
      mm1=i;
    }
  }
  int m2=0;
  for(auto i:s2){
    if(m2<ms2.count(i)){
      m2=max(m2,((int)ms2.count(i)));
      mm2=i;
    }
  }
  int ans=n-(m1+m2);
  int mmm1=0;
  int mmm2=0;
  if(mm1==mm2){
    for(auto i:s1){
      if(mmm1<ms1.count(i) && i!=mm1){
	mmm1=max(mmm1,((int)ms1.count(i)));
      }
    }
    for(auto i:s2){
      if(mmm2<ms2.count(i) && i!=mm2){
	mmm2=max(mmm2,((int)ms2.count(i)));
      }
    }
    ans=min(n-(m1+mmm2), n-(m2+mmm1));    
  }


  
  cout << ans << endl;

  
  return 0;
    

}


Measured memory_bytes: 9984
import java.util.*

fun main(args:Array<String>) {
    val sc = Scanner(System.`in`)
    val s = sc.nextInt()
    var ans = 0L
    for(d in 1..s) {
        if(d % 3 == 0) {
            continue
        }
        if(d % 5 == 0) {
            continue
        }
        ans += d
    }
    println(ans)
}

Measured memory_bytes: 36344
n, m = map(int, input().split())
a = list(map(int, input().split()))
a.sort()
l = []
for i in range(m):
    b, c = map(int, input().split())
    l.append((b, c))
l = sorted(l, key=lambda x: x[1], reverse=True)
cnt = 0
b = 0
ans = 0
for i in a:
    if cnt == m and b == 0:
        ans += i
        continue
    if b == 0:
        b, c = l[cnt]
        cnt += 1
    ans += max(c, i)
    b -= 1
print(ans)

Measured memory_bytes: 23288
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <climits>
#include <cfloat>
#include <cstring>
#include <map>
#include <utility>
#include <set>
#include <iostream>
#include <memory>
#include <string>
#include <vector>
#include <list>
#include <algorithm>
#include <functional>
#include <sstream>
#include <complex>
#include <stack>
#include <queue>
#include <unordered_set>
#include <unordered_map>
#include <array>
#include <cassert>
#include <bitset>
using namespace std;
using LL = long long;

int N;
vector<int>A;

int main(void)
{
	cin >> N;
	for (int i = 0; i < N; ++i) {
		int a;
		cin >> a;
		A.push_back(a);
	}
	sort(A.rbegin(), A.rend());
	int p[2] = {};
	for (int i = 0; i < N; ++i) {
		p[i % 2] += A[i];
	}
	cout << p[0] - p[1] << endl;
	return 0;
}


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

using Graph=vector<vector<int>>;

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

  Graph G(N);
  vector<pair<int,int>> p(N-1);
  for(int i=0;i<N-1;++i){
    int a,b;
    cin>>a>>b;
    --a,--b;
    p[i]=make_pair(a,b);
    G[a].push_back(b);
    G[b].push_back(a);
  }

  int K=0;
  for(int i=0;i<N;++i){
    K=max(K,(int)G[i].size());
  }

  vector<bool> seen(N,false);
  map<pair<int,int>,int> color;
  queue<int> q;
  q.push(0);
  while(!q.empty()){

    int v=q.front();
    q.pop();
    seen[v]=true;

    int cnt=1;
    int parent=0;

    for(auto nv:G[v]){
      if(seen[nv]) parent=color[{v,nv}];
    }
    for(auto nv:G[v]){
      if(!seen[nv]){
      if(cnt==parent) ++cnt;
      color[{v,nv}]=cnt;
      color[{nv,v}]=cnt;
      ++cnt;
      q.push(nv);
      }
    }
  }

  cout<<K<<endl;
  for(int i=0;i<N-1;++i){
    cout<<color[p[i]]<<endl;
  }
}

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

#define rep(i,s,n) for (int i = (int)s; i < (int)n; i++)
#define ll long long
#define pb push_back
#define All(x) x.begin(), x.end()
#define Range(x, i, j) x.begin() + i, x.begin() + j
#define lbidx(x, y) lower_bound(x.begin(), x.end(), y) - x.begin()
#define ubidx(x, y) upper_bound(x.begin(), x.end(), y) - x.begin()
#define BiSearchRangeNum(x, y, z) lower_bound(x.begin(), x.end(), z) - lower_bound(x.begin(), x.end(), y)turn idx;
#define deg_to_rad(deg) ((((double)deg)/((double)360)*2*M_PI))
#define rad_to_deg(rad) ((((double)rad)/(double)2/M_PI)*(double)360)

template<class T>
inline bool chmax(T &a, T b) {
  if(a < b) {
    a = b;
    return true;
  }
  return false;
};

template<class T>
inline bool chmin(T &a, T b) {
  if(a > b) {
    a = b;
    return true;
  }
  return false;
};

static const int MAX = 100001;

vector<int> adj[MAX];
vector<int> used(MAX, 0);
int par[MAX];
map<pair<int, int>, int> c_map;

int bfs() {
  int ret = 0;

  queue<int> q;
  used[1] = 1;
  q.push(1);

  while (!q.empty()) {
    int u = q.front();
    q.pop();
    used[u] = 2;
    int c_num;
    if (u == 1) {
      c_num = 0;
    } else {
      c_num = 1;
    }

    rep(i, 0, adj[u].size()) {
      int v = adj[u][i];
      if (used[v] == 0) {
        used[v] = 1;
        q.push(v);
        c_num += 1;
      }
    }
    ret = max(ret, c_num);
  }

  return ret;
};

void solve(int m_c) {
  rep(i, 0, used.size()) {
    used[i] = 0;
  }

  par[1] = 0;
  queue<int> q;
  used[1] = 1;
  q.push(1);

  while (!q.empty()) {
    int u = q.front();
    q.pop();
    used[u] = 2;
    int p = par[u];
    int p_c;

    if (p == 0) {
      p_c = 0;
    } else {
      p_c = c_map[make_pair(p, u)];
    }

    int c = p_c;

    rep(i, 0, adj[u].size()) {
      int v = adj[u][i];

      if (used[v] == 0) {
        used[v] = 1;
        par[v] = u;
        q.push(v);
        if (c == m_c) {
          c = 1;
          c_map[make_pair(u, v)] = c;
          c_map[make_pair(v, u)] = c;
        } else {
          c+=1;
          c_map[make_pair(u, v)] = c;
          c_map[make_pair(v, u)] = c;
        }
      }
    }
  }
};

int main() {
  int N;
  cin >> N;
  int a, b;
  vector<pair<int, int>> input_edges(N - 1);
  rep(i, 0, N - 1) {
    cin >> a >> b;
    adj[a].pb(b);
    adj[b].pb(a);
    input_edges[i].first = a;
    input_edges[i].second = b;
  }

  int max_color = bfs();

  cout << max_color << endl;
  solve(max_color);
  rep(i, 0, input_edges.size()) {
    cout << c_map[input_edges[i]] << endl;
  }
};


Measured memory_bytes: 20096
#include <bits/stdc++.h>
#include <ext/rope>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/detail/standard_policies.hpp>
using namespace std;
using namespace __gnu_cxx;
using namespace __gnu_pbds;
typedef long long ll;
typedef unsigned long long ull;
typedef unsigned int ui;
typedef long double ld;
typedef pair<int, int> ii;
typedef pair<ii, ii> iii;
int MOD = 10;
const ld E = 1e-9;
#define null NULL
#define ms(x) memset(x, 0, sizeof(x))
#ifndef LOCAL
#define endl "\n"
#endif
#ifndef LONG_LONG_MAX
#define LONG_LONG_MAX LLONG_MAX
#endif
#define sync ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define _read(x) freopen(x, "r", stdin)
#define _write(x) freopen(x, "w", stdout)
#define files(x) _read(x ".in"); _write(x ".out")
#define filesdatsol(x) _read(x ".DAT"); _write(x ".SOL")
#define output _write("output.txt")
#define input _read("input.txt")
#define prev time_prev
#ifndef M_PI
#define M_PI acos(-1)
#endif
#define remove tipa_remove
#define next tipa_next
#define left tipa_left
#define right tipa_right
#define mod % MOD
#define y1 hello_world
unsigned char ccc;
bool _minus = false;
template<typename T>
inline T sqr(T t) {
	return (t * t);
}
inline void read(ll &n) {
	n = 0;
	_minus = false;
	while (true) {
		ccc = getchar();
		if (ccc == ' ' || ccc == '\n')
			break;
		if (ccc == '-') {
			_minus = true;
			continue;
		}
		n = n * 10 + ccc - '0';
	}
	if (_minus)
		n *= -1;
}
inline bool read(int &n) {
	n = 0;
	_minus = false;
	while (true) {
		ccc = getchar();
		if (ccc == ' ' || ccc == '\n') {
			if (ccc == '\n')
				return true;
			break;
		}
		if (ccc == '-') {
			_minus = true;
			continue;
		}
		n = n * 10 + ccc - '0';
	}
	if (_minus)
		n *= -1;
	return false;
}
char wwww[19];
int kkkk;
inline void write(ll y) {
	long long x = y;
	kkkk = 0;
	if (x < 0) {
		putchar('-');
		x *= -1;
	}
	if (!x)
		++kkkk, wwww[kkkk] = '0';
	else
		while (x) {
			++kkkk;
			wwww[kkkk] = char(x % 10 + '0');
			x /= 10;
		}
	for (int i = kkkk; i >= 1; --i)
		putchar(wwww[i]);
}
#ifdef LOCAL
#define DEBUG
#endif
#ifdef DEBUG
#define dbg if(1)
#else
#define dbg if(0)
#endif

bool solve(string s){
	if((int) s.size() == 1){
		return true;
	}
	int a = 0, b = 0, c = 0;
	for(char C : s){
		if(C == 'a'){
			a++;
		}else if(C == 'b'){
			b++;
		}else{
			c++;
		}
	}
	if(max(max(a, b), c) > min(a, min(b, c)) + 1){
		return false;
	}
	return true;
}

int main() {
	sync;
	srand(time(NULL));
	cout.precision(10);
	cout << fixed;
#ifdef LOCAL
	input;
#else

#endif

	string s;
	cin >> s;
	cout << (solve(s) ? "YES" : "NO") << endl;

}


Measured memory_bytes: 512
#include <bits/stdc++.h>
using namespace std;
using ll=long long;
using vin=vector<int>;
using vll=vector<long long>;
using vdo=vector<double>;
using vvin=vector<vector<int>>;
using vvll=vector<vector<long long>>;
using vvdo=vector<vector<double>>;
using vstr=vector<string>;
using vvstr=vector<vector<string>>;
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define rep2(i,s,n) for(int i=(s);i<(int)(n);i++)
#define _GLIBCXX_DEBUG
int main()
{
    int x,y,z;
    cin>>x>>y>>z;
    swap(x,y);
    swap(x,z);
    cout<<x<<' '<<y<<' '<<z<<endl;
}

Measured memory_bytes: 256
"use strict";
var GET=(function(){function f(s){return new g(s);}function g(s){this._s=s.trim().split("\n");this._y=0;}g.prototype.a=function(f){var s=this._s, y=this._y, r;if(typeof s[y]==="string")s[y]=s[y].split(" ").reverse();r=s[y].pop();if(!s[y].length)this._y++;return f?r:+r;};g.prototype.l=function(f){var s=this._s[this._y++].split(" ");return f?s:s.map(a=>+a);};g.prototype.m=function(n,f){var r=this._s.slice(this._y,this._y+=n).map(a=>a.split(" "));return f?r:r.map(a=>a.map(a=>+a));};g.prototype.r=function(n,f){var r=this._s.slice(this._y,this._y+=n);return f?r:r.map(a=>+a);};return f;})();
var o=GET(require("fs").readFileSync("/dev/stdin","utf8"));
function xArray(v){var a=arguments,l=a.length,r="Array(a["+--l+"]).fill(0).map(x=>{return "+v+";})";while(--l)r="Array(a["+l+"]).fill(0).map(x=>"+r+")";return eval(r);}

console.log(main());
function main(){
  var x = o.a();
  while(1){
    if(isPrime(x))return x;
    x++;
  }
}

function isPrime(x){
  for(var i = 2; i*i <= x; i++){
    if(x % i === 0)return false;
  }
  return true;
}

Measured memory_bytes: 21064
#include<stdio.h>

int main(void){
	int S,h,m,s;
	scanf("%d",&S);
	h=S/3600;
	m=(S-h*3600)/60;
	s=S-h*3600-m*60;
	printf("%d:%d:%d\n",h,m,s);
	return 0;
}


Measured memory_bytes: 2080
package main

import (
	"fmt"
	"sort"
)

func main() {
	var n, k int
	fmt.Scan(&n, &k)
	a := make([]int, n+1)
	var x int
	for i := 0; i < n; i++ {
		fmt.Scan(&x)
		a[x]++
	}
	sort.Sort(sort.Reverse(sort.IntSlice(a)))
	ans := n
	for i := 0; i < k; i++ {
		ans -= a[i]
	}
	fmt.Println(ans)
}


Measured memory_bytes: 5376
#include <stdio.h>
int main (){
  while (1){
  int w;
  scanf ("%d",&w); if (w==-1)break;
  if (w<=10){
    printf ("%d\n",4280-1150);
  }
else if (w<=20){
    printf ("%d\n",4280-1150-125*(w-10));
}
else if (w<=30){
    printf ("%d\n",4280-1150-1250-(140*(w-20)));
}
else {
    printf ("%d\n",4280-1150-1250-1400-(160*(w-30)));
}
}
return 0;
}

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

int GCD(int a, int b) {
	return b ? GCD(b, a%b) : a;
}

int main()
{
	int A, B, C, D, w, h;
	cin >> A >> B >> C >> D;
	w = abs(A - C);
	h = abs(B - D);
	cout << w + h - GCD(w, h) << endl;
	return 0;
}


Measured memory_bytes: 256
#include<stdio.h>
int main(){
int w, h, x, y;
scanf("%d",&w); 
scanf("%d",&h); 
scanf("%d",&x); 
scanf("%d",&y); 
double s=(double)w*h/2;
if(w==x*2&&h==y*2)
printf("%lf 1",s);
else
printf("%lf 0",s);
return 0;
}

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

int main(){
  int a,b,c,d;
  cin>>a>>b>>c>>d;
  cout<<((a+b)<(c+d) ? "Right":(a+b)>(c+d) ? "Left":"Balanced")<<endl;
}

Measured memory_bytes: 256
a,b=[int(i) for i in input().split()]
s=list(input())
ans=0

if s[a]=="-":
    del s[a]
    try:
        s=int("".join(s))
    except ValueError:
        print("No")
        ans+=1
else:
    ans+=1
    print("No")
    
if ans==0:
    print("Yes")

Measured memory_bytes: 3060
#![allow(non_snake_case, unused)]
use std::cmp::*;
use std::collections::*;
use std::f64::consts::*;

macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        let mut next = || { iter.next().unwrap() };
        input_inner!{next, $($r)*}
    };
    ($($r:tt)*) => {
        let stdin = std::io::stdin();
        let mut bytes = std::io::Read::bytes(std::io::BufReader::new(stdin.lock()));
        let mut next = move || -> String{
            bytes
                .by_ref()
                .map(|r|r.unwrap() as char)
                .skip_while(|c|c.is_whitespace())
                .take_while(|c|!c.is_whitespace())
                .collect()
        };
        input_inner!{next, $($r)*}
    };
}

macro_rules! input_inner {
    ($next:expr) => {};
    ($next:expr, ) => {};

    ($next:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };

    ($next:expr, mut $var:ident : $t:tt $($r:tt)*) => {
        let mut $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };
}

macro_rules! read_value {
    ($next:expr, ( $($t:tt),* )) => {
        ( $(read_value!($next, $t)),* )
    };

    ($next:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
    };

    ($next:expr, [ $t:tt ]) => {
        {
            let len = read_value!($next, usize);
            (0..len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
        }
    };

    ($next:expr, chars) => {
        read_value!($next, String).chars().collect::<Vec<char>>()
    };

    ($next:expr, bytes) => {
        read_value!($next, String).into_bytes()
    };

    ($next:expr, usize1) => {
        read_value!($next, usize) - 1
    };

    ($next:expr, $t:ty) => {
        $next().parse::<$t>().expect("Parse error")
    };
}

fn main() {
    input!{
        n: usize,
        a: [u64; n],
    }
    let mut f_cnt = 0;
    let mut t_cnt = 0;
    for i in 0..n {
        if a[i] % 4 == 0 {
            f_cnt += 1
        } else if a[i] % 2 == 0 {
            t_cnt += 1
        }
    }
    println!(
        "{}",
        if (f_cnt + t_cnt / 2) >= n / 2 {
            "Yes"
        } else {
            "No"
        }
    )
}


Measured memory_bytes: 4352
#include <iostream>
using namespace std;
int main() {
cin.tie(0);
ios::sync_with_stdio(false);
int a, b, c;
cin >> a >> b >> c;
int x = 0;
for (int i = a; i <= b; i++)
if (c % i == 0) x++;
cout << x << "\n";
}

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

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

#define REP(i,n) for(int i=0;i<(int)(n);i++)
#define FOR(i,a,b) for(int i=(int)(a);i<(int)(b);i++)
#define FORR(i,a,b) for(int i=(int)(b)-1;i>=(int)(a);i--)

#define CHMIN(a,b) (a)=min((a),(b))
#define CHMAX(a,b) (a)=max((a),(b))

#define DEBUG(x) cout<<#x<<": "<<(x)<<endl

int main(){
	int d;
	cin>>d;
	cout<<"Christmas";
	while(d<25){
		d++;
		cout<<" Eve";
	}
	cout<<endl;
	return 0;
}


Measured memory_bytes: 256
x, y = map(int, input().split())

def main():
    ans_1 = x * 4 #12
    ans_2 = ans_1 - y #4

    if ans_2 == 0:
        print("Yes")
        return

    elif ans_2 > 0 and ans_2%2 == 0:
        for i in range(0, x):
            ans_2 = ans_2 - 2

            if ans_2 == 0:
                print("Yes")
                return
        print("No")
        return
    else:
        print("No")
        return
main()

Measured memory_bytes: 9184
import java.util.*;

public class Main {
  private static long split(long n, long k) {
    long sum = 0;
    while (n > 0) {
      sum += n % k;
      n /= k;
    }
    return sum;
  }

  private static long solve(long n, long s) {
    long k;
    for (k = 2; k*k <= n || k < 100; k++) {
      if (split(n, k) == s) {
        return k;
      }
    }
    while (k <= n) {
      long a = n / k;
      long b = n % k;
      if ((a + b - s) % a == 0) {
        long dk = (a + b - s) / a;
        if (dk >= 0 && b - dk*a >= 0) {
          return k + dk;
        }
      }
      k = n / a + 1;
    }
    if (n == s) {
      return n+1;
    }
    return -1;
  }

  public static void main(String[] args) {
    Scanner s = new Scanner(System.in);
    long nl = s.nextLong();
    long sl = s.nextLong();
    System.out.println(solve(nl, sl));
  }
}


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

ll N;
string X;
string s[100];
ll t[100];

int main() {
    cin >> N;
    for (int i = 0; i < N; i++) {
        cin >> s[i] >> t[i];
    }
    cin >> X;

    ll ans = 0;
    bool f = false;
    for (int i = 0; i < N; i++) {
        if (f) ans += t[i];

        if (!f && s[i] == X) f = true;
    }

    cout << ans << endl;

    return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
struct Dice{
  int a[6];
  void D(char c){
    int b;
    if(c=='E')
      b=a[0], a[0]=a[3], a[3]=a[5], a[5]=a[2], a[2]=b;
    else if(c=='W')
      b=a[0], a[0]=a[2], a[2]=a[5], a[5]=a[3], a[3]=b;
    else if(c=='S')
      b=a[0], a[0]=a[4], a[4]=a[5], a[5]=a[1], a[1]=b;
    else
      b=a[0], a[0]=a[1], a[1]=a[5], a[5]=a[4], a[4]=b;
  }
};
int main(){
  Dice d;
  for(int i=0;i<6;++i) cin>>d.a[i];
  string s; cin>>s;
  for(int i=0;i<s.size();++i) d.D(s[i]);
  cout<<d.a[0]<<endl;
  return 0;
}

Measured memory_bytes: 3172
#include <bits/stdc++.h>
#define REP(i, a, n) for (long long i = (a); i < (long long)(n); ++i)
#define REPC(i, a, n) for (long long i = (a); i <= (long long)(n); ++i)
#define ALL(t) t.begin(), t.end()
#define RALL(t) t.rbegin(), t.rend()
#define MATINIT(type, row, col, init) \
  vector<vector<type>>(row, vector<type>(col, init));
#define Yes(cond) cout << (cond ? "Yes" : "No") << endl;
#define YES(cond) cout << (cond ? "YES" : "NO") << endl;
using namespace std;
using LL = long long;
using ULL = unsigned long long;
template <class T>
using VEC = std::vector<T>;
template <class T>
using MAT = std::vector<std::vector<T>>;
void DUMP() { cerr << endl; }
template <class Head, class... Tail>
void DUMP(Head &&head, Tail &&... tail) {
  cerr << head << ", ";
  DUMP(std::move(tail)...);
}
template <typename T>
ostream &operator<<(ostream &os, vector<T> &vec) {
  os << "{";
  for (auto v : vec) os << v << ",";
  os << "}";
  return os;
}
template <typename T>
ostream &operator<<(ostream &os, set<T> &s) {
  os << "{";
  for (auto p : s) os << p << ",";
  os << "}";
  return os;
}
template <typename T1, typename T2>
ostream &operator<<(ostream &os, map<T1, T2> &m) {
  os << "{";
  for (auto p : m) os << p << ",";
  os << "}";
  return os;
}
template <typename T1, typename T2>
ostream &operator<<(ostream &os, pair<T1, T2> p) {
  os << "[" << p.first << " " << p.second << "]";
  return os;
}

int main() {
  LL N, K, Q;
  cin >> N >> K >> Q;
  VEC<int> A(Q);
  VEC<int> sum(N, 0);
  REP(i, 0, Q) {
    cin >> A[i];
    A[i]--;
    sum[A[i]]++;
  }
  REP(i, 0, N) {
    bool yes = (K - (Q - sum[i])) > 0;
    Yes(yes);
  }
  return 0;
}


Measured memory_bytes: 1408
def bigcmb(N, R, MOD):  # nCr(mod p) #n>=10**7,r<=10**6 #前処理不要
    if (R < 0) or (N < R):
        return 0
    R = min(R, N - R)
    fact, inv = 1, 1
    for i in range(1, R + 1):
        fact = (fact * (N - i + 1)) % MOD
        inv = (inv * i) % MOD
    return fact * pow(inv, MOD - 2, MOD) % MOD


x, y = map(int, input().split())
mod = 10**9+7

if (x + y) % 3 != 0 or x > 2 * y or 2 * x < y:
    print(0)
else:
    print(bigcmb((x + y) // 3, x - (x + y) // 3, mod))


Measured memory_bytes: 9208
#include<iostream>
#include<cstdio>
#define int long long
using namespace std;
const int mod=1e9+7,N=2005;
int n,k,f[N][N],fac[N*N],inv[N*N],infac[N*N];
int C(int a,int b)	{return fac[a]*infac[b]%mod*infac[a-b]%mod;}
signed main(){
	scanf("%lld%lld",&n,&k);
	if(k==1){
		printf("1\n");
		return 0;
	}
	fac[0]=infac[0]=inv[1]=1;
	for(int i=2;i<=n*k;i++)	inv[i]=(mod-mod/i)*inv[mod%i]%mod;
	for(int i=1;i<=n*k;i++)	fac[i]=fac[i-1]*i%mod,infac[i]=infac[i-1]*inv[i]%mod;
	for(int i=1;i<=n;i++)	f[i][0]=1;
	for(int i=1;i<=n;i++)
		for(int j=1;j<=i;j++)
			f[i][j]+=(f[i-1][j]+C(k*n-i-(j-1)*(k-1)-1,k-2)*f[i][j-1]%mod*(n-j+1)%mod)%mod;
	printf("%lld\n",f[n][n]);
	return 0;
}

Measured memory_bytes: 120092