akhauriyash/Code-Regression huggingface dataset:
#include<iostream>
#include<cmath>
using namespace std;

typedef long long ll;

int main() {
	ll n, s, ans; cin >> n >> s;
	for (ll i = 2; i * i <= n; i++) {
		ans = i;
		ll x = log2(n) / log2(i), tmp = 0, tmpN = n;
		while (x >= 0) {
			ll ml = tmpN / pow(i, x);
			tmp += ml;
			tmpN = tmpN - ml * pow(i, x--);
		}
		if (tmp == s) {
			cout << i << endl;
			return 0;
		}
	}

	ll start = n / ans + 1;
	for (ll i = start; i > 0; i--) {
		if (s - i < 0)continue;
		ll b = (n - (s - i)) / i;
		if (b > s - i && b * i + (s - i) == n && b >= 2 && b > i) { cout << b << endl; return 0; }
	}
	if (n == s) { cout << n + 1 << endl; return 0; }
	cout << -1 << endl;

	return 0;
}

Measured memory_bytes: 512
#include <iostream>
#include <vector>
#include <map>
#include <math.h>
using namespace std;
int main(void){
    unsigned long long X;
    unsigned long long out;
    unsigned long long year=0;
    cin >> X;
    out = 100;
    do {
        out = out * 1.01;
        year++;
    }
    while(out < X);
    cout << year;
    return 0;
}

Measured memory_bytes: 3636
import sys
import heapq
import math
import fractions
import bisect
import itertools
from collections import Counter
from collections import deque
from operator import itemgetter
def input(): return sys.stdin.readline().strip()
def mp(): return map(int,input().split())
def lmp(): return list(map(int,input().split()))

s=input()
a="abcdefghijklmnopqrstuvwxyz"
print(a[a.index(s)+1])

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

#define ll long long 
#define sz(x) ((int)x.size())
#define inf (1000*1000*1000+9)
#define infl (1ll*inf*inf)
#define all(a) a.begin(),a.end()
#define fast_io ios_base::sync_with_stdio(NULL); cin.tie(NULL)

const int nax=1005; 
vector<int> adj[nax]; 
int vis[nax]; 
vector<int> path; 
vector<int> v; 
bool found; 

void dfs(int u){
	if(found) return; 
	vis[u]=1; 
	path.push_back(u); 
	for(int vv:adj[u]){
		if(vis[vv]==1){
			found=1; 
			v.push_back(vv); 
			int i=sz(path)-1; 
			while(path[i]!=vv){
				v.push_back(path[i]); 
				i--; 
			}
			return;
		}
		else if(vis[vv]==0){
			dfs(vv); 	
			if(found) return;
		}
	}
	vis[u]=2; 
	path.pop_back(); 
}
int mm[nax][nax]; 

void solve(){
	int n,m; cin>>n>>m; 	
	for(int i=1;i<=m;i++){
		int u,vv; cin>>u>>vv; 
		mm[u][vv]=1; 
		adj[u].push_back(vv); 
	}
	for(int i=1;i<=n;i++){
		if(vis[i]==0)
			dfs(i); 
	}
	reverse(all(v)); 
	vector<int> av(sz(v),1); 
	if(sz(v)==0) {
		cout<<-1<<endl; 
		return; 
	}
	while(1){
		bool pres=1;
		for(int i=0;i<sz(v);i++){
			if(!av[i]) continue;
			for(int j=sz(v)-1;j>i+1;j--){
				if(!av[j]) continue;
				if(mm[v[i]][v[j]]){
					for(int k=i+1;k<j;k++){
						av[k]=0;
					}
					break;
				}
			}
		}
		for(int i=1;i<sz(v);i++){
			if(!av[i]) continue; 
			for(int j=i-1;j>=0;j--){
				if(!av[j]) continue; 
				if(mm[v[i]][v[j]]){
					for(int k=i+1;k<sz(v);k++) av[k]=0; 
					for(int k=j-1;k>=0;k--) av[k]=0; 	
					break; 
				}
			}
		}
		if(pres){
			break; 
		}
	}
	vector<int> ans; 
	for(int i=0;i<sz(v);i++){
		if(av[i]){
			ans.push_back(v[i]); 
		}
	}
	cout<<sz(ans)<<endl; 
	for(int i=0;i<sz(ans);i++){
		cout<<ans[i]<<endl; 
	}
}

int main(){
	clock_t beg=clock(); 
	fast_io; 
	solve(); 	
	clock_t end=clock(); 
	fprintf(stderr, "%lf\n", (double)(end-beg)/(CLOCKS_PER_SEC));
}

Measured memory_bytes: 3840
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        double odd =  n % 2 == 1 ? n / 2 + 1 : n / 2;
        System.out.println(odd / n);
    }
}


Measured memory_bytes: 21844
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <ctime>
#include <cassert>
#include <iostream>
#include <sstream>
#include <string>
#include <list>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <utility>
#include <numeric>
#include <algorithm>
#include <bitset>
#include <complex>
#include <fstream>
using namespace std;
typedef long long ll;
typedef vector<int> vint;
typedef pair<int, int> pint;
#define TO_STRING(a) #a
#define REP(i, x, n) for(int i = x; i < n; i++)
#define rep(i, n) REP(i, 0, n)
template<class T, class C> void chmax(T& a, C b){ if(a < b) a = b; }
template<class T, class C> void chmin(T& a, C b){ if(b < a) a = b; }
template<class T, class C> pair<T, C> mp(T a, C b){ return make_pair(a, b); }
template<class T> void MSG(T a){ cout << TO_STRING(a) << " = " << a << endl; }
 
 
const int INF = 1 << 30;
 
int main()
{
        // Source
        int piza = INF, juice = INF;
        rep(i, 5)
        {
                int in;
                cin >> in;
                chmin((i < 3 ? piza : juice), in);
        }
        cout << piza + juice - 50 << endl;
}

Measured memory_bytes: 0
#include<bits/stdc++.h>
#define LL long long
#define REP(i,n) for(int i=0;i<(n);++i)
#define REPA(i,n) for(int i=1;i<(n);++i)
#define foreach(i, n) for(auto &i:(n))
#define PII pair<int,int>
#define PLI pair<long long, int>
#define PLL pair<long long, long long>
#define PDD pair<double, double>
#define MOD ((int)1e9 + 7)
#define INF ((int)1e9)
#define INFLL ((LL)1e18)
#define ALL(x) (x).begin(),(x).end()
#define ctoi(x) (x - 'a') 
#define CTOI(x) (x - 'A')
#define BIT(x) (1 << (x))
using namespace std;

LL modinv(LL a){
    LL b = MOD, u = 1, v = 0;
    while(b){
        LL t = a / b;
        a -= t * b;swap(a, b);
        u -= t * v;swap(u, v);
    }
    u%=MOD;
    if(u < 0) u += MOD;
    return u;

}

LL exp(LL a, LL b){
    LL sum = a;
    LL res = 1;
    while(b){
        if(b&1){
            res = (res * sum)%MOD;
        }
        sum = (sum * sum) % MOD;
        b>>=1;
    }
    return res;
}

int main(){
    int N, A, B;
    cin >> N >> A >> B;
    cout << min(N*A, B) << endl;
    return 0;
}


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

int main () {
    int a, b, c, d;
    cin >> a >> b >> c >> d;
    while (true) {
        c -= b;
        if (c <= 0) break;
        a -= d;
        if (a <= 0) break;
    }
    string ans = "No";
    if (c <= 0) ans = "Yes";
    cout << ans << endl;
}


Measured memory_bytes: 3592
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.io.IOException;
import java.util.InputMismatchException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskD solver = new TaskD();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskD {
        public void solve(int testNumber, InputReader in, PrintWriter out) {
            int n = in.nextInt();
            int m = in.nextInt();

            int[][] cnt = new int[m][100001];
            for (int i = 0; i < n; i++) {
                int s = in.nextInt();
                int t = in.nextInt();
                int c = in.nextInt() - 1;
                cnt[c][s]++;
                cnt[c][t]--;
            }

            int[] sum = new int[100001];
            for (int i = 0; i < m; i++) {
                for (int j = 1; j < 100000; j++) {
                    if (cnt[i][j] == 1) {
                        sum[j - 1]++;
                    } else if (cnt[i][j] == -1) {
                        sum[j]--;
                    }
                }
            }
            for (int i = 0; i < 100000; i++) {
                sum[i + 1] += sum[i];
            }

            int ans = 0;
            for (int i = 0; i < 100000; i++) {
                ans = Math.max(ans, sum[i]);
            }

            out.println(ans);
        }

    }

    static class InputReader {
        BufferedReader in;
        StringTokenizer tok;

        public String nextString() {
            while (!tok.hasMoreTokens()) {
                try {
                    tok = new StringTokenizer(in.readLine(), " ");
                } catch (IOException e) {
                    throw new InputMismatchException();
                }
            }
            return tok.nextToken();
        }

        public int nextInt() {
            return Integer.parseInt(nextString());
        }

        public InputReader(InputStream inputStream) {
            in = new BufferedReader(new InputStreamReader(inputStream));
            tok = new StringTokenizer("");
        }

    }
}



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

#define ll long long
#define ld long double
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define PI 3.14159265358979323846
#define sz(x) ((int)(x).size())

const int INF = 1e9;
const int MOD = 1e9 + 7;
const ll LINF = 1e18;
int main()
{
    int n,k;
    cin >> n >> k;
    vector<int> h(n);
    rep(i,n)
    {
        cin >> h[i];
    }
    sort(h.begin(),h.end());

    int mn = INF;
    int index = 0;

    while (index+k-1<n)
    {
        mn = min(h[index+k-1]-h[index],mn);
        index++;
    }
    cout << mn << endl;
    
}

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

const ll mod = 1000000007;
const ll INF = 1001001001;

int main(){
    string s; cin >> s;
    int ans = 0;
    for(int i = 0; i < s.size(); i++){
        if(s[i] == '+') ans++;
        else ans--;
    }
    cout << ans << endl;
}


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

int main() {
	string s;
	string n;
	cin >> s >> n;
	int count = 0;
	for(int i = 0; i < s.size(); i++){
		if(s[i] != n[i]){
			count++;
		}
	}
	cout << count << endl;
	return 0;
}


Measured memory_bytes: 3896
public class Main {
	 public static void main(String[] a){
		 int x =1;
		 int y =1;
		 System.out.println(x + "x" + y + "=" + x * y);
		 
		 while(x < 10){
			 if(y<9){
				 y = y +1;
				 System.out.println(x + "x" + y + "=" + x * y);
			 }
			 
			 else if(y == 9 && x < 9){
				 y = 1;
				 x = x +1;
				 System.out.println(x + "x" + y + "=" + x * y);
			 }
			 
			 else{
				 break;
			 }
		
		 }
	 }
}

Measured memory_bytes: 16844
use std::io::*;
use std::str::FromStr;

pub fn read<T: FromStr>() -> T {
    let stdin = stdin();
    let stdin = stdin.lock();
    let token: String = stdin
        .bytes()
        .map(|c| c.expect("failed to read char") as char)
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect();
    token.parse().ok().expect("failed to parse token")
}

pub fn read_n<T: FromStr>(n: usize) -> Vec<T> {
    read_n_logic::<T>(n, vec![])
}

pub fn read_n_logic<T: FromStr>(n: usize, mut a: Vec<T>) -> Vec<T> {
    match n {
        0 => a,
        _ => {
            a.push(read::<T>());
            read_n_logic(n - 1, a)
        }
    }

}

use std::cmp::{max, min};

fn main() {
    let n: usize = read();
    let k: i64 = read();
    let h: Vec<i64> = read_n(n);
    let mut cnt = 0;

    for i in h {
        if i >= k {
            cnt += 1;
        }
    }

    println!("{}", cnt);

}


Measured memory_bytes: 13692
#include<iostream>
#include<cstdio>
#include<algorithm>
#include<vector>
using namespace std;

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


Measured memory_bytes: 256
#include<bits/stdc++.h>
#define watch(x) cout<<(#x)<<" is "<<(x)<<endl
#define all(x) (x).begin(),(x).end()
#define fi first
#define se second
#define pb push_back
#define pq priority_queue
#define rep(i,n) for(ll (i)=0;(i)<(n);(i)++)
#define elif else if

using namespace std;
using ll=long long;
using ull=unsigned long long;
using ld=long double;
using pll=pair<ll,ll>;
using pss=pair<string,string>;
using pdd=pair<ld,ld>;
using graph=vector<vector<int>>;
using wgraph=vector<vector<pll>>;

const ll MOD=1000000007;
const int dx[4]={1,0,-1,0};
const int dy[4]={0,1,0,-1};
const int ex[8]={1,1,0,-1,-1,-1,0,1};
const int ey[8]={0,1,1,1,0,-1,-1,-1};
const ld E=1e-9;

template<class T> void chmin(T &a, T b){a=min(a, b);}
template<class T> void chmax(T &a, T b){a=max(a, b);}

ll abs1(ll a){if(a>=0)return a;else return -a;}
ll pow1(ll a,ll b,ll p=LLONG_MAX){ll ret=1;while(b!=0){if((b&1)==1)ret*=a;a*=a;if(a>=p)a%=p;if(ret>=p)ret%=p;b=b>>1;}return ret;}
int digit(ll a,ll b=10){int i=0;while(a!=0){a/=b;i++;}return i;}
ll gcd1(ll a,ll b){if(a==0 || b==0)return 0;ll n;while(a%b!=0){n=a%b;a=b;b=n;}return b;}
ll solveLinear(ll n,ll m,ll c){
  if(n==0 && m==0)return 0;ll a[100],b[100];a[0]=n;b[0]=m;int i=1;
  while(b[i-1]!=0){a[i]=b[i-1];b[i]=a[i-1]%b[i-1];i++;}n=i;if(c%a[n-1]!=0)return 0;ll x=c/a[n-1],y=0;
  for(i=1;i<n;i++){ll cnt=x;x=y;y=cnt-(a[n-i-1]/b[n-i-1])*y;}return x;
}
ll modInv(ll a,ll p=MOD){a%=p;ll n=solveLinear(a,p,1);n%=p;if(n<0)return n+p;return n;}
ll fact(ll n,ll p=MOD){if(n<0)return 0;ll ret=1;for(int i=1;i<=n;i++){ret=ret*i;if(ret>=p)ret%=p;}return ret;}
ll perm(ll n,ll k,ll p=MOD){if(n<0 || k<0 || n<k)return 0;ll ret=1;rep(i,k){ret=ret*(n-i);if(ret>=p)ret%=p;}return ret;}
ll binom(ll n,ll k,ll p=MOD){return (perm(n,k,p)*modInv(fact(k)))%p;}

int main(){
  ll i,j,k,cnt=0;
  ll n;
  cin>>n;
  vector<pll> x(n);
  for(i=0;i<n;i++){
      ll a,b;
      cin>>a>>b;
      x[i].fi=a+b;
      x[i].se=a-b+1;
  }
  sort(all(x));
  ll cur=x[0].fi;
  for(i=1;i<n;i++){
      if(cur>=x[i].se){
          cnt++;
      }else{
          cur=x[i].fi;
      }
  }
  cout<<n-cnt<<endl;
}


Measured memory_bytes: 1792
import java.util.Scanner;

public class Main {

	static long mod = 1000000007;

	public static void main(String[] args) {
		// AtCoder_A
		Scanner sc = new Scanner(System.in);
		// 整数の入力
		String S = sc.nextLine();

		if(S.substring(S.length() -1).equals("s")) {
			System.out.println(S + "es");
		} else {
			System.out.println(S + "s");
		}
	    // Scannerクラスのインスタンスをクローズ
		sc.close();
	}
}


Measured memory_bytes: 38528
#include<bits/stdc++.h>
using namespace std;
const int N=305;
typedef long long ll;
const ll inf=1e18;
int n;
ll res,a[N],s[44];
bool vis[44];
ll solve()
{
    ll sum=a[1]+a[2];
    for(int i=40;i>=0;i--)
        if(res>>i&1) sum-=1ll<<i,vis[i]=true;
    if(sum<0||(sum&1)){printf("-1\n");exit(0);}
    sum>>=1;
    for(int i=40;i>=0;i--)
        if(sum>>i&1)
    {
        if(vis[i]){printf("-1\n");exit(0);}
        vis[i]=true;
    }
    for(int i=0;i<=40;i++)
    {
        if(i) s[i]=s[i-1];
        if(vis[i]) s[i]+=1ll<<i;
    }
    ll A=0,B=0;
    for(int i=40;i>=0;i--)
        if(vis[i])
        {
            ll p=1ll<<i;
            if(res>>i&1)
            {
                if(A+p<=a[1]&&(B>=a[2]||i&&B+s[i-1]>=a[2])) A+=p;
                else B+=p;
            }
            else
                A+=p,B+=p;
        }
    if(A<=a[1]&&B>=a[2]&&A>=1) return a[1]-A;
    return inf;
}
int main()
{
    scanf("%d",&n);
    for(int i=1;i<=n;i++) scanf("%lld",&a[i]);
    for(int i=3;i<=n;i++) res^=a[i];
    ll ans=solve();
    if(ans==inf) ans=-1;
    printf("%lld\n",ans);
}


Measured memory_bytes: 3824
#include <iostream>
#include <string>
#include <cmath>
#include<algorithm>
#include<stack>
#include<queue>
#include<map>
#include<set>
#include<iomanip>
#define _USE_MATH_DEFINES
#include <math.h>
#include <functional>
using namespace std;

#define rep(i,x) for(int i=0;i<x;i++)
#define repn(i,x) for(int i=1;i<=x;i++)

typedef long long ll;
const ll INF = 1e17;
const ll MOD = 1000000007;
const ll MAX = 1000001;

ll max(ll a, ll b) {
	if (a > b) { return a; }
	return b;
}

ll min(ll a, ll b) {
	if (a > b) { return b; }
	return a;
}

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

ll lcm(ll a, ll b) {
	return a * b / gcd(a, b);
}

struct edge {
	ll ind;
	ll fr;
	ll to;
	ll d;
};


///////////////////////////


int main() {

	ll N, Y;
	cin >> N >> Y;

	ll x = -1;
	ll y = -1;
	ll z = -1;

	rep(i, N+1) {
		rep(j, N+1) {
			if (i + j > N) { continue; }
			ll k = N - i - j;

			if (10000 * i + 5000 * j + 1000 * k == Y) { x = i; y = j; z = k; }
		}
	}

	cout << x << " " << y << " " << z;

	system("PAUSE");

	

}


Measured memory_bytes: 504
#include <cstdio>
#include <utility>
#include <vector>
#include <algorithm>
using namespace std;

#define gcu getchar_unlocked
#define pcu putchar_unlocked
#define _il inline
#define _in _il int in
#define _sc _il bool scan
_in(int c){int n=0;bool m=false;if(c=='-')m=true,c=gcu();
	do{n=10*n+(c-'0'),c=gcu();}while(c>='0');return m?-n:n;} //&&c<='9'
_in() {return in(gcu());}
_sc(int &n){int c=gcu();return c==EOF?false:(n=in(c),true);}
_sc(char &c){c=gcu();gcu();return c!=EOF;}
//_sc(string &s){int c;s="";
//	for(;;){c=gcu();if(c=='\n'||c==' ')return true;else if(c==EOF)return false;s+=c;}}
template <typename H,typename... T> _sc(H &h, T&&... t){return scan(h)&&scan(t...);}
#define _vo _il void out
#define _vl _il void outl
template <typename T>
_vo(T n){static char buf[20];char *p=buf;
	if(n<0)pcu('-'),n*=-1;if(!n)*p++='0';else while(n)*p++=n%10+'0',n/=10;
	while (p!=buf)pcu(*--p);}
_vo(const char *s){while(*s)pcu(*s++);}
_vo(char c){pcu(c);}
//_vo(string &s){for (char c: s) pcu(c);}
template <typename H,typename... T> _vo(H&& h, T&&... t){out(h);out(move(t)...);}
//template <typename T> _vo(vector<T> &v){for(T &x:v)out(&x == &v[0]?"":" "),out(x);out('\n');}
_vl(){out('\n');}
template <typename... T> _vl(T&&... t){out(move(t)...);outl();}

int main() {
	for (int n, a, b, c, x; n = in(), a = in(), b = in(), c = in(), x = in(), n;) {
		int f = 0;
		for (;;) {
			int y = in();
			for (;x != y && f <= 10000; f++)
				x = (a * x + b) % c;
			if (--n) {
				x = (a * x + b) % c;
				f++;
			} else
				break;
		}
		outl(f >= 10001 ? -1 : f);
	}
}


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

int n,c,k;
vector<int> v;

main()
{
	scanf("%d %d %d",&n,&c,&k);
	for(int i=0;i<n;i++)
	{
		int a;
		scanf("%d",&a);
		v.push_back(a);
	}
	sort(v.begin(),v.end());
	int late=v[0]+k,pass=1,ans=1;
	for(int i=1;i<n;i++)
	{
		if(v[i]>late)
		{
			pass=1;
			ans++;
			late=v[i]+k;
		}
		else
		{
			if(pass==c)
			{
				pass=0;
			}
			if(pass==0)
			{
				ans++;
				late=v[i]+k;
			}
			pass++;
			pass%=c;
		}
	}
	printf("%d\n",ans);
}

/*
4 1 10
2
3
4
5
*/

Measured memory_bytes: 892
#include<stdio.h>
#include<stdlib.h>
#include<math.h>
#include<string.h>
typedef long long int ll;
void swap(ll *x,ll *y){ll temp;temp=*x;*x=*y;*y=temp;}
ll asc(const void *a,const void *b){return *(ll*)a-*(ll*)b;}
ll desc(const void *a,const void *b){return *(ll*)b-*(ll*)a;}
ll max(ll x,ll y){return x>y?x:y;}
ll min(ll x,ll y){return x>y?y:x;}
 
int main(){
    char str[10];
    int list[26];
 
    for(int i=0;i<26;i++)list[i]=0;
    scanf("%s",str);
    for(int i=0;str[i]!='\0';i++){
        list[str[i]-0x41]++;
    }
    int cnt=0;
    for(int i=0;i<26;i++){
        if(list[i]==2)cnt++;
    }
    if(cnt==2)printf("Yes\n");
    else printf("No\n");
    return 0;
    
 
 
    
}

Measured memory_bytes: 128
tm = {}
"abcdefghijklmnopqrstuvwxyz".chars.each { |c|
  tm[c] = 0
}
tm["None"] = 0
s = gets.chomp
s.chars.each { |c|
  tm[c] += 1
}
tm.each {|k,v|
  if v == 0
    puts k
    exit
  end
}


Measured memory_bytes: 8956
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Comparator;

public class Main {
	public static void main(String[] args) throws IOException {
		BufferedReader r = new BufferedReader(new InputStreamReader(System.in), 1);
		String s;
		String sl[];

		s = r.readLine();
		sl = s.split(" ");

		long a = Long.parseLong(sl[0]);
		long v = Long.parseLong(sl[1]);

		s = r.readLine();
		sl = s.split(" ");

		long b = Long.parseLong(sl[0]);
		long w = Long.parseLong(sl[1]);
		
		s = r.readLine();
		sl = s.split(" ");

		long t = Long.parseLong(sl[0]);

		if(v < w) {
			System.out.println("NO");
			System.exit(0);
		}
		System.out.println(Math.abs(a - b) <= t * Math.abs(v - w) ? "YES" : "NO");
	}
}

Measured memory_bytes: 32608
//   _/                _/                 _/_/_/   _/
//_/_/_/_/   _/_/   _/_/_/_/   _/_/    _/       _/_/
// _/     _/    _/   _/     _/    _/  _/_/_/     _/
//_/     _/    _/   _/     _/    _/  _/    _/   _/
// _/_/   _/_/       _/_/   _/_/      _/_/     _/
#include<iostream>
#include<algorithm>
#include<cmath>
#include<iomanip>
#include<set>
#include<map>
#include<queue>
#include<vector>
using namespace std;
typedef long long ll;
const int MOD=1e9+7;
const double pi=acos(-1);
int main() {
  cin.tie(0),cout.tie(0);
  ios::sync_with_stdio(false);
  int n,f=0;
  cin >> n;
  for(int i=1; i<=50000; i++) {
    if(floor(i*1.08)==n) {
      cout << i << endl;
      return 0;
    }
  }
  cout << ":(" << endl;

}



Measured memory_bytes: 256
#include <stdio.h>

#define MAX 101

struct Node_struct{int r, c;}; 
typedef struct Node_struct Node;

Node A[MAX];
int min(int, int);
void computing(int);
int p[MAX-1], m[MAX-1][MAX-1];
int main()
{
  int n, i;

  scanf("%d", &n);

  for(i=1;i<=n;i++){
    scanf("%d %d", &A[i].r, &A[i].c);    
  }
  
  p[0]=A[1].r;
  for(i=1;i<=n;i++){
    p[i]=A[i].c;
  }

  computing(n);

  return 0;
}
void computing(int n){
  int i, j;

  for(i=1;i<=n;i++){
    m[i][i]=0;
  }
  
  for(j=1;j<n;j++){
    for(i=1;i<n;i++){
      if(i+j==n+1) break;
      m[i][i+j]=min(i, j);
    }
  }

  printf("%d\n", m[1][n]);
 
}
  
int min(int i, int j){
  int a=100000, b, k;
  b = i + j;

  for(k=i;k<b;k++){
    if(a > m[i][k] + m[k+1][b] + p[i-1] * p[k] * p[b]) a = m[i][k] + m[k+1][b] + p[i-1] * p[k] * p[b];
  }

  return a;
}

  

  
  
	  



Measured memory_bytes: 2108
#include <iostream>
#include <algorithm>
#include <complex>
#include <utility>
#include <vector>
#include <string>
#include <queue>
#include <tuple>
#include <cmath>
#include <bitset>
#include <cctype>
#include <set>
#include <numeric>
#define _overload3(_1,_2,_3,name,...) name
#define _rep(i,n) repi(i,0,n)
#define repi(i,a,b) for(ll i=ll(a);i<ll(b);++i)
#define rep(...) _overload3(__VA_ARGS__,repi,_rep,)(__VA_ARGS__)
#define all(x) (x).begin(),(x).end()
#define PRINT(V) cout << V << "\n"
#define SORT(V) sort((V).begin(),(V).end())
#define RSORT(V) sort((V).rbegin(), (V).rend())
using namespace std;
using ll = long long;
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; }
inline bool Yes(bool condition){ if(condition) PRINT("Yes"); else PRINT("No"); }
template<class itr> void cins(itr first,itr last){
    for (auto i = first;i != last;i++){
        cin >> (*i);
    }
}
template<class itr> void array_output(itr start,itr goal){
    string ans = "",k = " ";
    for (auto i = start;i != goal;i++) ans += to_string(*i)+k;
    if (!ans.empty()) ans.pop_back();
    PRINT(ans);
}
ll gcd(ll a, ll b) {
    return a ? gcd(b%a,a) : b;
}
const ll INF = 1e17;
const ll MOD = 1000000007;
typedef pair<ll,ll> P;
const ll MAX = 200005;
int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    ll n,k,c;
    cin >> n >> k;
    vector<ll> a(n),b(n);
    rep(i,n){
        cin >> c;
        a[i] = c;
        b[i] = c;
    }
    SORT(a);
    SORT(b);
    a.push_back(-1);
    b.erase(unique(all(b)),b.end());
    vector<ll> cnt;
    c = 1;
    rep(i,n){
        if (a[i] == a[i+1]) c++;
        else{
            cnt.push_back(c);
            c = 1;
        }
    }
    SORT(cnt);
    c = 0;
    rep(i,b.size()-k) c += cnt[i];
    PRINT(c);
}


Measured memory_bytes: 7012
N = int(input())
A = sorted(map(int, input().split()))
B = sorted(map(int, input().split()))
C = sorted(map(int, input().split()))
sumSunuke = 0


def bs_left(list, target):
    low, high = 0, len(list)
    while low < high:
        mid = (low + high) // 2
        if list[mid] < target:
            low = mid + 1
        else:
            high = mid
    return low


def bs_right(list, target):
    low, high = 0, len(list)
    while low < high:
        mid = (low + high) // 2
        if list[mid] > target:
            high = mid
        else:
            low = mid + 1
    return low


for x in range(N):
    ab = bs_left(A, B[x])
    bc = N - bs_right(C, B[x])
    sumSunuke += ab * bc
print(sumSunuke)


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

using namespace std;

#define range(i, m, n) for(int i = m; i < n; i++)
#define husk(i, m, n) for(int i = m; i > n; i--)

int n;
const int MAX = 32;

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> n;
  map<long long, int> cnt;
  int res = 0;
  range(i, 0, n) {
    long long a;
    cin >> a;
    cnt[a]++;
  }
  while(cnt.size()) {
    long long u = prev(cnt.end())->first;
    int c = cnt[u];
    long long v = -1;
    range(i, 0, MAX) {
      if(cnt.count((1LL << i) - u)) {
        int s = (1LL << i) - u;
        if(s != u || (s == u && c > 1)) {
          v = s;
        }
      }
    }
    if(~v) res++;
    cnt[u]--;
    if(cnt[u] == 0) cnt.erase(u);
    if(~v) {
      cnt[v]--;
      if(cnt[v] == 0) cnt.erase(v);
    }
  }
  cout << res;
  return 0;
}


Measured memory_bytes: 12800
#include<bits/stdc++.h>
using namespace std;
int main(){
int64_t A,B,C;
  cin>>A>>B>>C;
  int64_t ans=0;
  if(A==B && B==C){
  if(A%2==0)
    cout<<-1<<endl;
    else
      cout<<0<<endl;
  
  }else{
  int64_t ans=0;
    for(int i=1; ;i++){
    if(A%2==0 && B%2==0 && C%2==0){
    int64_t a=(B+C)/2;
      int64_t b=(A+C)/2;
      int64_t c=(A+B)/2;
      A=a; B=b; C=c;
         ans=i;
    }else break;
    
    }cout<<ans<<endl;
  
 }
    return 0;
}


Measured memory_bytes: 256
A,B,C,D,E,F = map(int,input().split())

concentration = 0
ans = [A*100,0]

water = []
for a in range(F//(A*100) + 1):
  for b in range(((F-a*A*100)//(B*100))+1):
    water.append((a*A+b*B)*100)
    
water = sorted(list(set(water)))

sugar = []
for c in range(F//C + 1):
  for d in range(((F - c*C)//D)+1):
    sugar.append(c*C+d*D)
sugar = sorted(list(set(sugar)))


for wa in water:
  for su in sugar:
    if wa + su <= F:
      if su <= (wa/100)*E:
        if wa != 0:
          if concentration < su/(su+wa):
            concentration = su/(su+wa)
            ans = [su+wa,su]

print(" ".join(map(str,ans)))

Measured memory_bytes: 18180
#include <iostream>
#include <string>
#include <utility>
#include <vector>
#include <algorithm>
using namespace std;

int main(void){
  
  int N;
  cin >> N;
  
  typedef pair<string,int> P;
  typedef pair<P,int> data;
  vector<data> v;
  
  string S;
  int p;
  
  for(int i = 0; i < N; ++i){
    cin >> S >> p;
    v.push_back(data(P(S,-p),i+1));
  }
  
  sort(v.begin(),v.end());
  
  for(int i = 0; i < N; ++i){
    cout << v[i].second <<endl;
  }
  
  return 0;
}


Measured memory_bytes: 256
import sys
from collections import deque

H, W = map(int, input().split())
Ch, Cw = (int(i) - 1 for i in input().split())
Dh, Dw = (int(i) - 1 for i in input().split())
G = [list(sys.stdin.readline().strip()) for _ in range(H)]

def bfs(start):
    zeroQ = deque()
    oneQ = deque()
    zeroQ.append(start)
    dist[start[1]][start[0]] = 0

    while zeroQ or oneQ:
        if zeroQ:
            x, y = zeroQ.popleft()
        else:
            x, y = oneQ.popleft()
        
        for dx in range(-2, 3):
            for dy in range(-2, 3):
                nx = x + dx
                ny = y + dy
                
                if not(0 <= nx < W and 0 <= ny < H):
                    continue
                if G[ny][nx] == '#':
                    continue
                if abs(dx) + abs(dy) == 0:
                    continue
                
                cost = 0 if abs(dx) + abs(dy) == 1 else 1
                
                if dist[ny][nx] <= dist[y][x] + cost:
                    continue
                dist[ny][nx] = dist[y][x] + cost
                
                if cost == 0:
                    zeroQ.append((nx, ny))
                else:
                    oneQ.append((nx, ny))

dist = [[10 ** 9 for _ in range(W)] for _ in range(H)]

bfs((Cw, Ch))
# for g in dist:
#     print(g)
if dist[Dh][Dw] == 10 ** 9:
    print(-1)
else:
    print(dist[Dh][Dw])


Measured memory_bytes: 134820
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <stack>
using namespace std;

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

int H, W, K;
vector<string> g;
const int MAX = 1e9 + 7;

int cal(vector<vector<int>> &vs){
    int R = vs.size();
    int res = 0;

    int b = 0, e = b;
    while(e < W){
        vector<int> s(R, 0);
        bool f = true;

        while(e < W){
            for(int i=0; i<R; i++){
                s[i] += vs[i][e];
                if(s[i] > K){
                    f = false;
                    break;
                }
            }
            if(!f) break;
            e++;
        }
        if(!f && b == e){
            return MAX;
        }

        if(!f){
            res++;
        }

        b = e;
    }
    return res;
}

int solve(){
    int res = MAX;
    for(int a=0; a<(1<<(H-1)); a++){
        int b = 0, e = b;
        vector<vector<int>> vs;
        while(e < H){
            vector<int> v(W, 0);
            while(e < H-1 && (a>>e)%2!=1){
                e++;
            }
            
            for(int j=0; j<W; j++){
                for(int i=b; i<=e; i++){
                    v[j] += g[i][j]-'0';    
                }
            } 
            vs.push_back(v);
            //cout<<b<<" "<<e<<endl;
            b = e + 1; e = b;  
        }

        res = min(res, cal(vs) + int(vs.size()) - 1);
    }

    return res;
}

int main(){
    //freopen("e.in", "r", stdin);
    cin>>H>>W>>K;
    g = vector<string>(H);
    for(int i=0; i<H; i++){
        cin>>g[i];
    }
    cout<<solve()<<endl;
    return 0;
}





Measured memory_bytes: 256
X, Y, A, B, C = map( int, input().split(" "))
scoreA = list( map(int, input().split(" ")))
scoreB = list( map(int, input().split(" ")))
scoreC = list( map(int, input().split(" ")))

scoreA.sort(reverse=True)
scoreB.sort(reverse=True)
scoreC.sort(reverse=True)

scoreAll = scoreA[:X] + scoreB[:Y] + scoreC

scoreAll.sort(reverse=True)

print(sum(scoreAll[:X+Y]))

Measured memory_bytes: 23328
#include "iostream"
#define endl '\n'

using namespace std;

int main() {
  int a, b, c, d = 0;
  int flag = 0;

  cin >> a;
  cin >> b;
  cin >> c;
  cin >> d;

  while (true) {
    c -= b;
    if (c <= 0) {
      flag = 1;
      break;
    }

    a -= d;
    if (a <= 0) {
      flag = -1;
      break;
    }
  }

  cout << (flag == 1 ? "Yes" : "No");

  return 0;
}

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

int main()
{
    int n,k;
    cin>>n>>k;
    int arr[n],dp[k+1]={};
    for(int i=0;i<n;i++) cin>>arr[i];
    for(int i=0;i<=k;i++)
    {
        if(dp[i]==0)
        {
            for(int j=0;j<n;j++)
            if(i+arr[j]<=k) dp[i+arr[j]]=1;
        }
    }
    if(dp[k]==1) cout<<"First";
    else cout<<"Second";
    return 0;
}


Measured memory_bytes: 640
#pragma GCC optimize ("Ofast")

#pragma GCC target ("avx2,tune=native")

#include <x86intrin.h>

#include <bits/stdc++.h>

using namespace std;

int main() {

    ios_base::sync_with_stdio(false);

    cin.tie(0);

    int N, M;

    cin >> N >> M;

    pair<int, int> S[N];

    for (int i = 0; i < N; i++)

        cin >> S[i].first >> S[i].second;

    sort(S, S + N);

    long long res = 0;

    for (int i = 0; i < N; i++) {

        if (S[i].second >= M) {

            res += (long long) S[i].first * M;

            break;

        }

        res += (long long) S[i].first * S[i].second;

        M -= S[i].second;

    }

    cout << res;

    return 0;

}

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

template <typename T> T load() { T r; cin >> r; return r; }
template <typename T> vector<T> loadMany(int n) { vector<T> rs(n); generate(rs.begin(), rs.end(), &load<T>); return rs; }

int main() {
	ios::sync_with_stdio(false);
	cin.tie(nullptr);
	auto n = load<int>();
	auto lucky = n / 100 == 7 or (n % 100) / 10 == 7 or n % 10 == 7;
	cout << (lucky ? "Yes\n" : "No\n");
}


Measured memory_bytes: 3624
#include <bits/stdc++.h>
#define PB push_back
#define FST first
#define SCD second
#define retunr return
#define modp 1000000007
#define MODP 1000000
#define EPS 1e-6
#define INF 0x3f3f3f3f
#define MAX2 113
#define MAX3 5013
#define MAX4 10013
#define MAX5 200013
#define MAX6 2000013
#define MAXN 100013
#define MANX MAXN
using namespace std;
typedef long long LL;
typedef unsigned int UI;
const UI tb[32] = {13, 0, 27, 1, 28, 18, 23, 2, 29, 21, 19, 12, 24, 9, 14, 3, 30, 26, 17, 22, 20, 11, 8, 13, 25, 16, 10, 7, 15, 6, 5, 4};
#define LOG(x) tb[(UI(x) * (UI)263572066) >> 27]
typedef pair<int,int> PA;
typedef pair<double,double> PAf;
int n,m,tot;

struct E
{
    int a, nxt;
    // E(){}
    // E(int x, int y, int z) : a(x), nxt(y), c(z) {}
};

int q[MAX6];

std::vector<int> v;

int main()
{
#ifndef ONLINE_JUDGE
    // freopen("in.txt", "r", stdin);
    // freopen("out.txt", "w", stdout);
#endif
    int TT = 1;
    // scanf("%d",&TT);
    for (int ci=1;ci<=TT;++ci) {
    // while (scanf("%d", &n)!=EOF) {
        scanf("%d%d", &n, &m);
        memset(q,0,sizeof(q));
        for (int i=0;i<n;++i) {
            int x;
            scanf("%d", &x);
            q[x]++;
        }
        v.clear();
        for (int i=1;i<=n;++i) {
            if (q[i]!=0) {
                v.push_back(q[i]);
            }
        }
        sort(v.begin(), v.end());
        if (v.size()<=m) {
            cout<<0<<endl;
        } else {
            int ans = 0;
            for (int i=0;i<v.size()-m;++i) ans+=v[i];
            cout<<ans<<endl;
        }
    }
    return 0;
}


Measured memory_bytes: 9208
#include<bits/stdc++.h>
using namespace std;
int main(){
    int l,r;
    cin>>l>>r;
    r=min(r,l+2019);
    int ans=2019;
    for(long long i=l;i<r;i++){
        for(long long j=i+1;j<=r;j++){
            ans=min(ans,(int)((i*j)%2019));
        }
    }
    cout<<ans<<endl;
    return 0;
}


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

int main(){
  int n;
  cin>>n;
  ll cnt=0,ans=0;
  rep(i,n){
    ll a;
    cin>>a;
    if(a==0){
      ans+=cnt/2;
      cnt=0;
    }
    else{
      cnt+=a;
    }
  }
  ans+=cnt/2;
  cout<<ans<<endl;
  return 0;
}

Measured memory_bytes: 256
a, b, k = map(int, input().split())
if k > (b - a)//2 :
	for i in range(a, b+1) :
		print(i)   
	exit()
for i in range(a, a + k) :          
	if a <= i < a + k :
		print(i)
for i in range(b - k, b + 1) :
	if b - k < i and a + k <= i:
		print(i)

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

using namespace std;

int n, a[(int)2e5], d[(int)2e5];

int main(){
    cin >> n;
    for(int i = 1; i <= n; i++){
        cin >> a[i];
    }
    d[2] = abs(a[2] - a[1]);
    for(int i = 3; i <= n; i++)
        d[i] = min(d[i - 1] + abs(a[i] - a[i - 1]), d[i - 2] + abs(a[i] - a[i - 2]));
    cout << d[n];
}


Measured memory_bytes: 1024
import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        long[] H = new long[N];
        int counter = 0;
        int countMax = 0;
        
        for(int i = 0; i < N; i++){
            H[i] = sc.nextLong();
            if(i > 0){
                if(H[i-1] >= H[i]){
                    counter++;
                }
                if(H[i-1] < H[i]){
                    if(counter > countMax){
                        countMax = counter;
                    }
                    counter = 0;
                }
            }
        }
        
        if(counter > countMax){
            countMax = counter;
        }
        
        System.out.println(countMax);
    }
}

Measured memory_bytes: 50584
#include <iostream>
#include <string>
#include <cmath> //これはlogを使うときに必要
using namespace std;

int divisor(int n) {
  int a = 0;
  for(int i = 1; i <=n; i++) {
    if(n % i == 0)
    a++;
  }
  return a;
}

int main() {
  int b = 0;
  int n;
  cin >> n;
  for(int i = 1; i < n + 1; i += 2) {
    if(divisor(i) == 8)
    b++;
  }
  cout << b << endl;
}


Measured memory_bytes: 256
#include<iostream>

using namespace std;
int main()
{
	int n,a[100010],ans = 0;
	cin >> n;
	for(int i=1; i<=n; i++){
		cin >> a[i];
	}
	int i = 1;
	bool flag[100010];
	for(int i=1; i<=n; i++){
		flag[i] = true;
	}
	while(1){
		if(i == 2)
			break;
		else if(flag[i] == false){
			ans = -1;
			break;
		}
		else{
			flag[i] = false;
			i = a[i];
		}
		ans++;
	}
	cout << ans << endl;
	
	return 0;
}


Measured memory_bytes: 768
#include <iostream>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <string>
#include <map>
#include <set>
#include <queue>
#include <algorithm>
#define inf 0x3f3f3f3f
#define LL long long

using namespace std;

int main()
{
    string s;
    while(cin>>s){
        int flag1=0,flag2=0,flag3=1;
        if(s[0]=='A'){
            flag1=1;
        }
        int sum=0;
        for(int i=2;i<s.size()-1;i++){
            if(s[i]=='C') sum++;
        }
        if(sum==1) flag2=1;
        for(int i=0;i<s.size();i++){
            if(s[i]=='A'||s[i]=='C') continue;
            if(s[i]<'a'||s[i]>'z'){
                flag3=0;
            }
        }
        if(flag1&&flag2&&flag3){
            printf("AC\n");
        }
        else{
            printf("WA\n");
        }
    }
    return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<vector>
#include <cmath>
#include <map>
#include <set>
#include <algorithm>
#include <string>
#define rep(i,n) for (int i= 0;i<(n);++i)
using namespace std;
typedef long long ll;
int main() {
    ll N , X , T ;
    cin >> N >> X >> T ;
    if(N % X == 0){
        cout << T * (N / X) << endl;
    }else{
        cout << T * (N / X + 1) << endl;
    }
    return 0;
}

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

int main(void)
{
    int s,w;
    cin >> s >> w;
    if(s < w)
        cout << "unsafe" << endl;
    else if (s == w)
        cout << "unsafe" << endl;
    else 
        cout << "safe" << endl;
}

Measured memory_bytes: 3596
#include<bits/stdtr1c++.h>
#include<list>
#include<algorithm>
using namespace std;

int main(){
    int A,B,C,D;
    cin >> A >> B >> C >> D;
    if (A*B >= C*D){
        cout << A*B << endl;
    }
    else{
        cout << C*D << endl;
    }
    return 0;
}

Measured memory_bytes: 256
import java.util.*;
class Main
{
  public static void main(String[] args)
  {
    Scanner sc = new Scanner(System.in);
    
    int r = sc.nextInt();
    int g = sc.nextInt();
    int b = sc.nextInt();
    
    int total = 100*r + 10*g + b;
    
    if(total%4==0){
      System.out.println("YES");
    }else{
      System.out.println("NO");
    }
  }
}

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


int main(){
ll N,A,B;
cin >> N >>A >> B;
ll ans = 0;
ans += N/(A+B) * A;
if (N%(A+B) <= A) {
  ans += N%(A+B);
} else {
  ans += A;
}
cout << ans << endl;

return 0;

}

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

int check(vector<int> v) {
	sort(v.begin(), v.end());
	//for (int i = 0; i < v.size(); i++)cout << v[i] << "  ";
	if ((v[0] == v[1] && v[1] == v[2] && v[2]== v[3]) || (v[1] == v[2] && v[2]== v[3] && v[3] == v[4])) {//four cards
		return 1;
	}
	else if (((v[0] == v[1] && v[1] == v[2]) && (v[3] == v[4])) || ((v[0] == v[1]) && (v[2] == v[3] && v[3] == v[4]))) {//full house
		return 2;
	}
	else if (v[0] == v[1] - 1 && v[0] == v[2] - 2 && v[0] == v[3] - 3 && v[0] == v[4] - 4) {//straight
		return 3;
	}
	else if (v[0]==1 && v[1]==10 && v[2]==11 && v[3] == 12 && v[4] == 13) {//straight
		return 3;
	}
	else if (((v[0] == v[1] && v[1] == v[2]) || (v[1] == v[2] && v[2] == v[3])) || ((v[2] == v[3] && v[3] == v[4]))) {//three cards
		return 4;
	}
	else if ((v[0] == v[1] && v[2] == v[3]) || (v[0] == v[1] && v[3] == v[4]) || (v[1] == v[2] && v[3] == v[4])) {//two pair
		return 5;
	}
	else if ((v[0] == v[1]) || (v[1] == v[2]) || (v[2] == v[3]) || (v[3] == v[4])) {//one pair
		return 6;
	}
	else {
		return 7;
	}
}


int main()
{
	vector<int> v;
	int a, b, c, d, e;
	while (scanf("%d,%d,%d,%d,%d", &a, &b, &c, &d, &e) != EOF) {
		v.clear();
		v.push_back(a);
		v.push_back(b);
		v.push_back(c);
		v.push_back(d);
		v.push_back(e);
		switch (check(v)) {
			case 1:cout << "four card" << endl; break;
			case 2:cout << "full house" << endl; break;
			case 3:cout << "straight" << endl; break;
			case 4:cout << "three card" << endl; break;
			case 5:cout << "two pair" << endl; break;
			case 6:cout << "one pair" << endl; break;
			case 7:cout << "null" << endl; break;
			default:cout << "Error" << endl; break;
		}
	}
    return 0;
}

Measured memory_bytes: 3104
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <set>

using namespace std;

int main(){
    int N,M,a,b;
    cin>>N>>M;
    vector<int> B(N,0);
    for(int i=0;i<M;i++){
        cin>>a>>b;
        B[a-1]++;
        B[b-1]++;
    }
    for(int i=0;i<N;i++){
        cout<<B[i]<<endl;
    }
    return 0;
}

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

#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep1(i, n) for (int i = (int)(n)-1; i >=0; i--)

using ll = long long;

int main(){
  int n;
  cin>>n;
  vector<ll> a(n),b(n),c(n);
  rep(i,n)cin>>a.at(i);
  rep(i,n)cin>>b.at(i);
  rep(i,n)cin>>c.at(i);
  sort(a.begin(),a.end());
  sort(b.begin(),b.end());
  sort(c.begin(),c.end());
  ll ans = 0;
  rep(j,n){
    auto na = lower_bound(a.begin(),a.end(),b.at(j)) ;
    auto nc = upper_bound(c.begin(),c.end(),b.at(j));

    auto aa = distance(na,a.begin());
    auto cc = distance(c.end(),nc);
    ans+=aa*cc;

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


Measured memory_bytes: 2688
#include "bits/stdc++.h"

using namespace std;

#define DEBUG(x) cerr<<#x<<": "<<x<<endl;
#define DEBUG_VEC(v) cerr<<#v<<":";for(int i=0;i<v.size();i++) cerr<<" "<<v[i]; cerr<<endl

typedef long long ll;
#define vi vector<int>
#define vl vector<ll>
#define vii vector< vector<int> >
#define vll vector< vector<ll> >
#define vs vector<string>
#define pii pair<int,int>
#define pis pair<int,string>
#define psi pair<string,int>
#define pll pair<ll,ll>
template<class S, class T> pair<S, T> operator+(const pair<S, T> &s, const pair<S, T> &t) { return pair<S, T>(s.first + t.first, s.second + t.second); }
template<class S, class T> pair<S, T> operator-(const pair<S, T> &s, const pair<S, T> &t) { return pair<S, T>(s.first - t.first, s.second - t.second); }
template<class S, class T> ostream& operator<<(ostream& os, pair<S, T> p) { os << "(" << p.first << ", " << p.second << ")"; return os; }
#define X first
#define Y second
#define rep(i,n) for(ll i=0;i<(ll)(n);i++)
#define rep1(i,n) for(ll i=1;i<=(ll)(n);i++)
#define rrep(i,n) for(ll i=(ll)(n)-1;i>=0;i--)
#define rrep1(i,n) for(ll i=(ll)(n);i>0;i--)
#define REP(i,a,b) for(ll i=(ll)a;i<(ll)b;i++)
#define in(x, a, b) (a <= x && x < b)
#define all(c) c.begin(),c.end()
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 (a>b) { a = b; return 1; } return 0; }
#define UNIQUE(v) v.erase(std::unique(v.begin(), v.end()), v.end());
const ll inf = 1000000001;
const ll INF = 1e18;
const ll MOD = 1000000007;
const double pi = 3.14159265358979323846;
#define Sp(p) cout<<setprecision(15)<< fixed<<p<<endl;
int dx[4] = { 1,0, -1,0 }, dy[4] = { 0,1,0,-1 };
int dx2[8] = { 1,1,0,-1,-1,-1,0,1 }, dy2[8] = { 0,1,1,1,0,-1,-1,-1 };
#define fio() cin.tie(0); ios::sync_with_stdio(false);
#define mp make_pair


int main () {
  int a, b;
  cin >> a >> b;
  a--;b--;
  cout << a * b << endl;
}


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

template<class T> void vin(vector<T>& v, int n) {
    v.resize(n);
    for (int i = 0; i < n; ++i) {
        cin >> v[i];
    }
}

struct WeightUnionFind {
    static const int Max = 101010;
    int par[Max];
    int ws[Max];

    void init(int n) {
        for (int i = 0; i < n; ++i) {
            par[i] = -1;
        }
    }

    int find(int x) {
        if (par[x] < 0) {
            return x;
        }
        else {
            int parent = find(par[x]);
            ws[x] += ws[par[x]];
            return par[x] = parent;
        }
    }

    int weight(int x) {
        find(x);
        return ws[x];
    }

    void unite(int x, int y, int w) {
        w += weight(x);
        w -= weight(y);
        x = find(x);
        y = find(y);
        if (x == y) return;
        if (par[y] < par[x]) {
            int tmp = x;
            x = y;
            y = tmp;
            w = -w;
        }
        par[x] += par[y];
        par[y] = x;
        ws[y] = w;
    }

    bool same(int x, int y) {
        return find(x) == find(y);
    }

    int diff(int x, int y) {
        if (!same(x, y)) return -1;
        return weight(y) - weight(x);
    }
    int size(int x) {
        return -par[find(x)];
    }
};

int N, M;
WeightUnionFind uf;

int main() {
    cin >> N >> M;
    uf.init(N+1);
    bool ok = true;
    rep(i, M) {
        int l, r, d;
        cin >> l >> r >> d;
        l--;
        r--;
        if (uf.same(l, r)) {
            if (uf.diff(l, r) != d) {
                ok = false;
            }
        }
        else {
            uf.unite(l, r, d);
        }
    }
    cout << (ok ? "Yes" : "No") << endl;
}


Measured memory_bytes: 1024
import java.util.*;
public class Main{
	public static void main(String[] args){
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int m = scan.nextInt();
		Vector<Integer>[] to = new Vector[2000000];
		for(int i = 0;i < 2000000; ++i){
			to[i] = new Vector<>();
		}
		for(int i = 0;i < m; ++i){
			int a = scan.nextInt();
			int b = scan.nextInt();
			--a;--b;
			to[a].add(b);
			to[b].add(a);

		}
		Queue<Integer>q = new ArrayDeque<>();//ärÎŰĚ¸_
		q.add(0);
		int[] distance = new int[n];//¸_ĚŁ
		Arrays.fill(distance,Integer.MAX_VALUE);
		int[] pre = new int[n];//OĚ¸_
		distance[0] = 0; //n_
		q.add(0);
		while(q.peek() != null){
			int v = q.poll();
			for(int i :to[v]){
				if(distance[i] != Integer.MAX_VALUE)continue;
				distance[i] = distance[v]+1;//¸_ĚŁđL^
				pre[i] = v;//OĚ¸_ĚÔđL^
				q.add(i);
			}
		}
		System.out.println("Yes");
		for(int i = 1;i < n; ++i){
			int ans = pre[i];
			System.out.println(ans+1);
		}
	}
}



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

int main(){
    int n;
    cin >> n;
    int a;
    int dp[n];
    int ans=0;
    for(int i=0;i<n;i++)dp[i]=1e9;
    for(int i=0;i<n;i++){
        cin >> a;
        a *= (-1);
        *upper_bound(dp,dp+n,a)=a;
    }
    cout << lower_bound(dp,dp+n,1e9)-dp;
}

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

int main(){
	string s;
	int n;
	cin >> s >> n;
	int sl = s.length();
	int ans = 0;
	for(int i=0; i<n; i++){
		string t;
		cin >> t;
		t += t;
		int tl = t.length();
		for(int j=0; j+sl<tl; j++){
			if(t.substr(j, sl) == s){
				ans++;
				break;
			}
		}
	}
	cout << ans << endl;
	return 0;
}



Measured memory_bytes: 3192