akhauriyash/Code-Regression huggingface dataset:
#include <cstdio>
#include <cstring>
#include <cctype>
 
int main()
{
    char W[10],T[1000];
    int counter = 0;
    int T_length;//?????????t???byte??°?????????
 
    scanf("%s", W);
    for(int i = 0; W[i] != '\0'; i++){
        if(isupper(W[i])) W[i] = tolower(W[i]);
    }
 
    while(scanf("%s", T) != EOF){
        T_length  = strlen(T);
        for(int i = 0; T[i] != '\0'; i++){
            if(isupper(T[i])) T[i] = tolower(T[i]);
        }
        if(strcmp(T, W) == 0){
            counter++;
        }
    }
    printf("%d\n", counter);
 
    return 0;
}
		
		

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

static const int MAX = 100000;
static const int NIL = -1;

int n;
vector<int> G[MAX];
int color[MAX];

void dfs(int r, int c) {
	stack<int>S;
	S.push(r);
	color[r] = c;
	while (!S.empty()) {
		int u = S.top(); S.pop();
		for (int i = 0; i < G[u].size(); i++) {
			int v = G[u][i];
			if (color[v] == NIL) {
				color[v] = c;
				S.push(v);
			}
		}
	}
}

void assignColor() {
	int id = 0;
	for (int i = 0; i < n; i++)color[i] = NIL;
	for (int u = 0; u < n; u++) {
		if (color[u] == NIL)dfs(u, id++);
	}
}

int main() {
	int s, t, m, q;

	cin >> n >> m;

	for (int i = 0; i < m; i++) {
		cin >> s >> t;
		G[s].push_back(t);
		G[t].push_back(s);
	}
	assignColor();

	cin >> q;

	for (int i = 0; i < q; i++) {
		cin >> s >> t;
		if (color[s] == color[t]) {
			cout << "yes" << endl;
		}
		else {
			cout << "no" << endl;
		}
	}
	return 0;
}


Measured memory_bytes: 8964
import collections


def main():
    N = int(input())
    S = input()
    cnt = collections.Counter(S)
    E_cnt = cnt['E']
    W_cnt = cnt['W']
    tmp = 0
    if S[0] == 'E':
        E_cnt -= 1
    ans = E_cnt
    for i in range(1, N):
        if S[i] == 'E':
            E_cnt -= 1
        else:
            W_cnt -= 1
        if S[i - 1] == 'W':
            tmp += 1
        ans = min(ans, tmp + E_cnt)

    print(ans)


if __name__ == "__main__":
    main()


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

#define ll long long
#define endl "\n"
#define pb push_back
#define mp make_pair
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);


void solve() {

	int n;
	cin >> n;
	int a,t,w,r;
	a = t = w = r = 0;
	for(int i = 0;i < n;i++){
		string s;
		cin >> s;
		if(s == "AC")a++;
		if(s == "TLE")t++;
		if(s == "WA")w++;
		if(s == "RE")r++;

	}

	cout << "AC x " << a << endl;
	cout << "WA x " << w << endl;
	cout << "TLE x " << t << endl;
	cout << "RE x " << r << endl;



   


}


int32_t main()
{

    IOS

    int T;
    T = 1;
    //cin >> T;
    while (T--) {
        solve();
    }




}


Measured memory_bytes: 3660
n=int(input())
l = list(map(int,input().split()))
max=0
a=0
for i in range(n-1):
    if l[i+1]<=l[i]:
        a+=1
        if a>=max:
            max=a
    elif l[i+1]>l[i]:
        if a>=max:
            max=a
        a=0
print(max)

Measured memory_bytes: 20476
#include <bits/stdc++.h>
typedef long long ll;
const int INF = 1e9;
const int MOD = 1e9+7;
const ll LINF = 1e18;
using namespace std;

#define dump(x)  cout << #x << " = " << (x) << endl;
#define YES(n) cout << ((n) ? "YES" : "NO"  ) << endl
#define Yes(n) cout << ((n) ? "Yes" : "No"  ) << endl
#define POSSIBLE(n) cout << ((n) ? "POSSIBLE" : "IMPOSSIBLE"  ) << endl
#define Possible(n) cout << ((n) ? "Possible" : "Impossible"  ) << endl
#define possible(n) cout << ((n) ? "possible" : "impossible"  ) << endl

#define SANKOU(n,a,b) cout << ((n) ? (#a) : (#b) ) << endl

#define FOR(i,a,b) for(ll i=(a);i<(b);++i)
#define REP(i,n) for(ll i=0;i<(n);++i)
#define REPR(i,n) for(ll i=n;i>=0;i--)

#define FOREACH(x,a) for(auto&& (x) : (a) )

#define WFA(d,v) REP(k,v)REP(i,v)REP(j,v)d[i][j]=min(d[i][j],d[i][k]+d[k][j])

#define SCOUT(x) cout<<(x)<<" "
#define ENDL cout<<endl

#define VECCIN(x) for(auto&youso_: (x) )cin>>youso_
#define VECIN2(x,y) REP(i,x.size())cin>>x[i]>>y[i]
#define VECCOUT(x) if(1){for(auto tt=x.begin();tt!=x.end();tt++){if(tt!=x.begin())cout<<" ";cout<<(*tt);}cout<<endl;}

#define ALL(obj) (obj).begin(),(obj).end()

#define EXIST(n,x) (find(ALL(n),x)!=n.end())
#define UNIQUE(obj) sort(ALL( obj )); obj.erase(unique(ALL(obj)),obj.end())
#define EN(x) if(1){cout<<#x<<endl;return 0;}
#define COUT(x) cout<<(x)<<endl
void CINT(){}
template <class Head,class... Tail>
void CINT(Head&& head,Tail&&... tail){
    cin>>head;
    CINT(move(tail)...);
}
#define CIN(...) int __VA_ARGS__;CINT(__VA_ARGS__)
#define LCIN(...) ll __VA_ARGS__;CINT(__VA_ARGS__)
#define SCIN(...) string __VA_ARGS__;CINT(__VA_ARGS__)

template <class T = ll>
T IN(){T x;cin>>x;return (x);}

template <class Head>
void VT(Head head){}
template <class Head,class Seco,class... Tail>
void VT(Head&& head,Seco&& seco,Tail&&... tail){
    seco.resize(head);
    VT(head,move(tail)...);
}
void VT2(){}
template <class Head,class... Tail>
void VT2(Head&& head,Tail&&... tail){
  VECCIN(head);
  VT2(move(tail)...);
}

template <class Head>
void VT3(Head&& head){}
template <class Head,class Seco,class... Tail>
void VT3(Head&& head,Seco&& seco,Tail&&... tail){
  seco[head]=IN();
  VT3(head,move(tail)...);
}

#define VC1(n,...) V __VA_ARGS__;VT(n,__VA_ARGS__);VT2(__VA_ARGS__); //aaabbbccc
#define VC2(n,...) V __VA_ARGS__;VT(n,__VA_ARGS__);REP(i,n)VT3(i,__VA_ARGS__); //abcabcabc

// #include <boost/multiprecision/cpp_int.hpp>
// using namespace boost::multiprecision; // cpp_int

#define P pair<ll,ll>
#define V vector<ll>
#define M map<ll,ll>
#define S set<ll>

#define pb(a) push_back(a)
#define mp make_pair

int main(){
    CIN(n);VC2(n,x,y,h);
    int t;
    REP(i,n)if(h[i])t=i;
    REP(i,101){
        REP(j,101){
            int high = abs(i-x[t]) + abs(j-y[t]) + h[t];
            bool flag = (high>=1);
            REP(k,n){
                int hig = max(high - abs(i-x[k]) - abs(j-y[k]), 0LL);
                if(h[k] != hig){
                    flag=false;
                    break;
                }
            }
            if(flag){
                SCOUT(i);SCOUT(j);COUT(high);
     
            }
        }
    }
return 0;
}


Measured memory_bytes: 256
n = $stdin.readline.to_i
d = Array.new(n) { $stdin.readline.chomp.split.map(&:to_i) }

res = []
(n - 2).times do |i|
  if d[i][0] == d[i][1] && d[i + 1][0] == d[i + 1][1] && d[i + 2][0] == d[i + 2][1]
    puts "Yes"
    exit
  end
end
puts "No"

Measured memory_bytes: 14388
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using V = vector<ll>;
#define _GLIBCXX_DEBUG
#define rep(i, a) for(int i = 0; i < a; i++)
#define ALL(v) v.begin(), v.end()

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

    int f=0;
    if(a<2019) f=1;
    if(a==2019&&b<=4) f=1;
    if(f)cout<<"Heisei"<<endl;
    else cout<<"TBD"<<endl;

}

Measured memory_bytes: 256
#include<iostream>

using namespace std;
typedef long long ll;

ll A, B;

int main() {
	cin >> A >> B;
	ll ans = 1;
	ll a = A;
	while (a <= B) {
		ans++;
		a *= 2;
	}
	cout << ans - 1 << endl;
	return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<cstdio>
#include<cstring>
#include<string>
#include<algorithm>
#include<bitset>
#include<vector>
#include<deque>
#include<queue>
#include<map>
#include<set>
#include<stack>
#include<cmath>
#include<iomanip>
#include <functional>
using namespace std;
typedef long long ll;
//const int mod = 1000000007;
const int INF = 1 << 28;
const double EPS = 1e-10;
//cout << fixed << std::setprecision(9) << flush;
//memset(a, 0, sizeof(a));
//--------------------------

int n;
vector<int> a;

int main()
{
	cin >> n;
	for (int i = 0;i < n;i++) {
		int t;
		cin >> t;
		a.push_back(t);
	}

	sort(a.begin(), a.end());
	int ans;
	int minn = 2 * a[n-1];
	int big = 1 + a[n - 1];

	for (int i = 0;i < n;i++) {
		if (abs(big / 2 - a[i]) < minn) {
			ans = a[i];
			minn = abs(big / 2 - a[i]);
		}
	}

	cout << a[n - 1] << " " << ans << endl;

	return 0;
}


Measured memory_bytes: 892
#include <iostream>
#include <cstring>
#include <map>
#include <algorithm>
#include <cmath>
using namespace std;
typedef long long ll;
ll n, a[200008];

int main(){
	cin >> n;
	for(ll i = 1; i <= n; i++){cin >> a[i];}
	
	ll itr_f = 1;
	ll itr_b = 1;
	ll ans = 0;
	ll bit_bucket = 0;
	while(itr_f <= n){
		//cout << a[itr_f] << " " << bit_bucket << endl;
		//cout << (a[itr_f] ^ bit_bucket) << endl; 
		//cout << " " << a[itr_f]+bit_bucket << endl;
		if((a[itr_f]^bit_bucket) == a[itr_f]+bit_bucket){
			bit_bucket += a[itr_f];
			if(itr_f <= n){ans += itr_f-itr_b+1;}
			itr_f++;
		}
		else{
			bit_bucket -= a[itr_b];
			itr_b++;
		}
		//cout << ans << " " << itr_f << itr_b << " " << bit_bucket << endl;
	}
	
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 1792
N = int(input())
C = [int(input()) for _ in range(N)]
mod = int(1e9+7)

from itertools import groupby
x = [0] + [k for k, g in groupby(C)]

dp = [0]*(len(x)) # i個目までで何通りあるか
dp[0] = 1
memo = {}

for i in range(1, len(x)):
    c = x[i]
    memo[c] = (memo.get(c,0) + dp[i-1])%mod
    dp[i] = memo[c]

print(dp[-1])

Measured memory_bytes: 35580
N,M,C=map(int,input().split())
B = list(map(int, input().split()))
ans=0
for _ in range(N):
    A = list(map(int, input().split()))
    hantei=0
    for j in range(M):
        hantei+=A[j]*B[j]
    if hantei+C>0:
        ans+=1
print(ans)


Measured memory_bytes: 9000
#include<stdio.h>
int main() {
    int a, b,c,k, ans,i,keep;
    scanf("%d%d%d%d", &a, &b,&c,&k);
    for (i = 0; i < 2; i++) {
        if (a < b) {
            keep = a;
            a = b;
            b = keep;
        }
        if (b < c) {
            keep = b;
            b = c;
            c = keep;
        }
    }
    for (i = 0; i < k; i++)
        a = a * 2;
    ans = a + b + c;
    printf("%d\n", ans);
    return 0;
}

Measured memory_bytes: 128
#include<iostream>
#include<vector>
#include<queue>
#include<string>
#include<set>

using namespace std;
using ll = long long;

const int INF = 1001001001;
const int MOD = 1000000007;

int main(){
    ll x;cin >> x;

    ll a = 100;
    ll cnt = 0;
    while(1){
        a *= 1.01;
        cnt++;
        if (a >= x){
            cout << cnt << endl;
            return 0;
        }
    }

    return 0;
}

Measured memory_bytes: 3676
#include<cstdio>
using namespace std;
int a,b;
int main(){
    scanf("%d%d",&a,&b);
    if(a>0)puts("Positive");               
    else if(b>=0)puts("Zero");            
    else if((a&1)^(b&1))puts("Positive"); 
    else puts("Negative");
    return 0;
}

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

int main() {
    int N, M, P, X;
    cin >> N;
    vector<int> T(N), U(N);

    for (int i = 0; i < N; i++) {
        cin >> T.at(i);
        U.at(i) = T.at(i);
    }

    cin >> M;

    for (int i = 0; i < M; i++) {
        cin >> P >> X;
        T.at(P - 1) = X;
        int sum = 0;
        for (int j = 0; j < N; j++) {
            sum += T.at(j);
        }
        cout << sum << endl;
        T.at(P - 1) = U.at(P - 1);
    }
}

Measured memory_bytes: 3560
# -*- coding: utf-8 -*-
"""
スクリーンキーボード
https://onlinejudge.u-aizu.ac.jp/challenges/sources/ICPC/Prelim/1633

"""
import sys


def solve(h, w):
    keyboard = dict()
    for y in range(h):
        for x, ch in enumerate(input()):
            keyboard[ch] = (x, y)

    cx, cy = 0, 0
    ans = 0
    for ch in input():
        nx, ny = keyboard[ch]
        ans += (abs(nx - cx) + abs(ny - cy) + 1)
        cx, cy = nx, ny
    return ans


def main(args):
    while True:
        h, w = map(int, input().split())
        if h == 0 and w == 0:
            break
        ans = solve(h, w)
        print(ans)


if __name__ == '__main__':
    main(sys.argv[1:])



Measured memory_bytes: 5632
#include <bits/stdc++.h>
using namespace std;
template<class T> ostream& operator<<(ostream &os, vector<T> V) { os << "[ "; 
  for(auto v:V)os << v << " "; return os << "]";
}
template<class T> ostream& operator<<(ostream &os, set<T> S){ os << "{ "; 
  for(auto s:S) os<<s<<" ";  return os<<"}"; 
}
template<class L, class R> ostream& operator<<(ostream &os, pair<L,R> P) {
  return os<<"("<<P.first<<","<< P.second << ")";
}
template<class L, class R> ostream& operator<<(ostream &os, map<L,R> M) {
  os<<"{ ";for(auto m:M)os<<"("<<m.first<<":"<<m.second<<")";
  return os<<"}";
}
#define cerr cout
#define TRACE
#ifdef TRACE
#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1>
void __f(const char* name, Arg1&& arg1){
  cerr << name << " : " << arg1 << std::endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args){
  const char* comma = strchr(names + 1, ',');cerr.write(names, comma - names) << " : " << arg1<<" | ";__f(comma+1, args...);
}
#else
#define trace(...) 1
#endif
// #include <ext/pb_ds/assoc_container.hpp> 
// #include <ext/pb_ds/tree_policy.hpp> 
// using namespace __gnu_pbds;
// #define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update>
// find_by_order(k)  returns iterator to kth element starting from 0;
// order_of_key(k) returns count of elements strictly smaller than k;
//For multiset use less_equal operator but it does support erase operations for multiset
#define ll long long
#define ld long double
#define vll vector<ll>
#define pll pair<ll,ll>
#define vpll vector<pll>
#define I insert 
#define pb push_back
#define F first
#define S second
//#define endl "\n"
#define all(v) (v).begin(),(v).end()
#define For(i,n) for(int i=0;i<(int)n;++i)
#define Rev(i,n) for(int i=(int)n-1;i>=0;--i)
#define Rep(i,n) for(int i=1;i<=(int)n;++i)
typedef vector<int> vi;
typedef pair<int,int> pii;
typedef pair<pii,int> ppi;
typedef vector<pii> vpi;
#define fio ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
#define mp make_pair
// inline void modadd(int &a,int &b){a+=b;if(a>=mod)a-=mod;} 
const int N = 1e6;
ll dp[N];
int lst[N];
int main(){
  fio; cout<<fixed<<setprecision(25);	
  ll n , x , m ; cin >> n >> x >> m;
  ll tmp = x;
  ll ans = 0; 
  ll i = 0;
  bool ok = 0;
  while(1){
    ++i;
    if(lst[x] != 0) break;
    lst[x] = i;
    dp[i] = x;
    x = x*x%m;
    if(x == 0){
      ok = 1;
      break;
    }
  }
  if(n < N){
    ll ans = 0;
    for(int i = 1;i <= n ; ++i){
      ans += tmp;
      tmp =tmp*tmp%m;
    }
    cout << ans << endl;
    return 0;
  }
  if(ok){
    for(int j = 1;j <= min(n,i*1ll) ; ++j)
      ans += dp[j];
    cout << ans << endl;
  }
  else{
    ll q = 0;
    while(1){
      ++q;
      if(tmp != x) ans += dp[q];
      else break;
      tmp = tmp*tmp%m;
    }
    ll tot = 0;
    for(int j = q;j <= i ; ++j) tot += dp[j];
    n -= (q-1);
    ans += (n/(i-q))*tot; 
    ll lft = (n%(i-q));
    for(int j = q;lft > 0 ; --lft , ++j)
      ans += dp[j];
    cout << ans << endl;
  }
}


Measured memory_bytes: 4376
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.LinkedHashSet;
import java.util.Random;

public class Main {


    public static void main(String[] args) throws IOException {
        BufferedReader read = new BufferedReader(new InputStreamReader(System.in));
//
        String s=read.readLine();
        String ss[]=s.split(" ");
        int n=Integer.parseInt(ss[0]);
        int d=Integer.parseInt(ss[1]);
        int c=0;
        for(int i=0;i<n;i++){
            String co=read.readLine();
            String ss2[]=co.split(" ");
            int x=Integer.parseInt(ss2[0]);
            int y=Integer.parseInt(ss2[1]);
            double dist=Math.sqrt(Math.pow(x,2)+Math.pow(y,2));
            if(dist<=d){
                c++;
            }
        }
        System.out.println(c);

    }

}


Measured memory_bytes: 47560
C=[list(map(int,input().split()))for _ in range(3)]
ans='Yes'

if C[1][0]-C[0][0]!=C[1][1]-C[0][1]:
    ans='No'
elif C[1][2]-C[0][2]!=C[1][1]-C[0][1]:
    ans='No'
elif C[2][0]-C[1][0]!=C[2][1]-C[1][1]:
    ans='No'
elif C[2][2]-C[1][2]!=C[2][1]-C[1][1]:
    ans='No'

print(ans)

Measured memory_bytes: 3064
#include<stdio.h>
#include<string.h>
#include<math.h>
#include<ctype.h>



int main()

{
    int n;
    scanf("%d",&n);
    char s[10];
    int ac=0,wa=0,tle=0,re=0;
    while(n--)
    {
        scanf("%s",s);
        if(strcmp(s,"AC")==0)
            ac++;
        if(strcmp(s,"WA")==0)
            wa++;
            if(strcmp(s,"TLE")==0)
            tle++;
            if(strcmp(s,"RE")==0)
            re++;
    }
    printf("AC x %d\nWA x %d\nTLE x %d\nRE x %d\n",ac,wa,tle,re);
    return 0;
}

/*
I wish I could be the monster you think I am !!!
*/


Measured memory_bytes: 1724
/*
数据不清空，爆零两行泪。
多测不读完，爆零两行泪。
边界不特判，爆零两行泪。
贪心不证明，爆零两行泪。
动规顺序错，爆零两行泪。
大于少等号，爆零两行泪。
变量不统一，爆零两行泪。
越界不判断，爆零两行泪。
调试不注释，爆零两行泪。
溢出不 l l，爆零两行泪。
*/
#include<bits/stdc++.h>
using namespace std;
int main(){
	int n;
	cin>>n;
	cout<<1ll*(n-1)*n/2;
	return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
vector<int> s;
int main() {
	int m, f;
	for (;;) {
		cin >> m >> f; int i = 0;
		if (m == 0 && f == 0) {
			break;
		}
		for (int j = 1; j <= m; j++) {
			for (int k = j + 1; k <= m; k++) {
				for (int l = k + 1; l <= m; l++) {
					if (j + k + l == f)
						++i;
				}
			}
		}
		s.push_back(i);
	}
	for (int i = 0; i < s.size(); i++) {
		cout << s[i] << endl;
	}
}


Measured memory_bytes: 3160
#include<iostream>
#include<iomanip>
#include<vector>
#include<map>
#include<stack>
#include<queue>
#include<string>
#include<utility>
#include<algorithm>
#include<cmath>
#include<climits>
using namespace std;

using ll = long long;

void read();
template<typename First, typename... Rest> void read(First& first, Rest&... rest);
void write();
template<typename First, typename... Rest> void write(First first, Rest... rest);
template<typename T> void write_vec(vector<T>& v, char divider);

int main(){
    int N, M;
    read(N, M);
    vector<int> k(M);
    vector<vector<int>> s(M);
    for(int i = 0; i < M; i++){
        read(k[i]);
        s[i].resize(k[i]);
        for(int j = 0; j < k[i]; j++){
            read(s[i][j]);
        }
    }
    vector<int> p(M);
    for(int i = 0; i < M; i++){
        read(p[i]);
    }
    int ans = 0;
    for(int b = 0; b < (1 << N); b++){
        bool f = true;
        for(int i = 0; i < M; i++){
            int sum = 0;
            for(int j = 0; j < k[i]; j++){
                int sij = (b >> (s[i][j] - 1)) & 1;
                if(sij) sum++;
            }
            if(sum % 2 != p[i]) f = false;
        }
        if(f) ans++;
    }
    write(ans);
    return 0;
}

//配列以外の入力を受け取る
void read(){

}
template<typename First, typename... Rest>
void read(First& first, Rest&... rest){
    cin >> first;
    read(rest...);
}
//
//配列以外を出力する
void write(){

}
template<typename First, typename... Rest>
void write(First first, Rest... rest){
    cout << first << " ";
    write(rest...);
}
//
//配列を区切って出力する
template<typename T>
void write_vec(vector<T>& v, char divider){
    for(size_t i = 0; i < v.size(); i++){
        cout << v[i] << divider;
    }
}
//

Measured memory_bytes: 256
/*
ID: anonymo14
TASK: wormhole
LANG: C++                 
*/
#include<bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<pair<int,int>> vpii;

#define F first
#define S second
#define PU push
#define PUF push_front
#define PUB push_back
#define PO pop
#define POF pop_front
#define POB pop_back

#define REP(i,a,b) for(int i=a; i<=b; i++)

#define MOD 1000000007

void solve(int test_case) {
	long double a,b,c;
	cin>>a>>b>>c;
	if((4*a*b<(c-a-b)*(c-a-b))&&(c>a+b))cout<<"Yes";
	else cout<<"No";
}

int main() {
	
	////// FILE BASED IO////
	//freopen("wormhole.in", "r", stdin);
	//freopen("wormhole.out", "w", stdout);
	///////////////
	
	ios::sync_with_stdio(0);
	cin.tie(0);
	int t=1;
	//cin>>t;
	REP(i,1,t) {
		solve(i);
	}
	return 0;
}	


Measured memory_bytes: 3748
n = int(input())
a = [list(map(int, input().split())) for _ in range(n)]
if a[0][0] >= a[0][1] + a[0][2] and (a[0][0] - a[0][1] - a[0][2]) % 2 == 0:
    pass
else:
    print('No')
    exit()
for i in range(n - 1):
    x = a[i + 1][0] - a[i][0]
    y = abs(a[i + 1][1] - a[i][1])
    z = abs(a[i + 1][2] - a[i][2])
    if x >= y + z and (x - y - z) % 2 == 0:
        pass
    else:
        print('No')
        break
else:
    print('Yes')


Measured memory_bytes: 27324
#include <bits/stdc++.h>
#define pb push_back
#define rep(i,n) for(int i=0;i<(n);i++)
#define reps(i,n,s) for(int i=(s);i<(n);i++)
#define rrep(i,n) for(int i=(n-1);i>=0;i--)
#define rreps(i,n,s) for(int i=s;i>=n;i--)
#define MOD 1000000007
using ll = long long;
using namespace std;
template<class T> bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T> bool chmin(T &a, const T &b) { if (a>b) { a=b; return 1; } return 0; }

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

cout<<(k/2)*((k+1)/2)<<endl;
//system("pause");
return 0;
}

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

int main() {
  string x;
  cin >> x;
  char stack[200000] = { x[0] };
  int n = 1;
  for (int i = 1; i < x.length(); i++) {
    stack[n++] = x[i];
    if (stack[n - 2] == 'S' && stack[n - 1] == 'T') {
      n -= 2;
    }
  }
  cout << n << endl;
}


Measured memory_bytes: 772
#include <stdio.h>
#include <unistd.h>

int main()
{
	int		ans;
	int		n;
	long	d;
	long	x,y;

	ans = 0;
	scanf("%d %ld", &n, &d);
	while (n)
	{
		scanf("%ld %ld", &x, &y);
		if (((x*x) + (y*y)) <= (d*d))
			ans++;
		n--;
	}
	printf("%d", ans);
}

Measured memory_bytes: 1732
/*
	Solved!
	Time: 05:23:26 PM
	Date: 05-04-2020
*/
#include <bits/stdc++.h>
using namespace std;
 
typedef unsigned long long  ll;
typedef vector<int>         vi;
typedef vector<ll>          vll;

#define ff                  first
#define sf                  scanf
#define pf                  printf
#define ss                  second
#define ppb                 pop_back
#define pb                  push_back
#define MP                  make_pair
#define MAXN                5000005
#define MOD                 100000007
#define inf                 0x3f3f3f3f
#define PI                  (2.0*acos(0.0))
#define INF                 0x3f3f3f3f3f3f3f3f
#define rev(v)              reverse(all(v))
#define all(v)              v.begin(), v.end()
#define __lcm(x, y)         (x * y) / __gcd(x, y)
#define FOR(i, x, y)        for(int i = x; i < y; i++)
#define RFOR(i, x, y)       for(int i = x; i >= y; i--)
#define MEM(arr, val)       memset(arr, val, sizeof(arr));
#define unq(v)              (v).resize(unique(all(v)) - v.begin())
#define READ()              freopen("input.txt", "r", stdin)
#define WRITE()             freopen("output.txt", "w", stdout)
#define si(n)               scanf("%d", &n)
#define sl(n)               scanf("%lld", &n)
#define sii(a, b)           scanf("%d %d", &a, &b)
#define sll(a, b)           scanf("%lld %lld", &a, &b)
#define siii(a, b, c)       scanf("%d %d %d", &a, &b, &c)
#define slll(a, b, c)       scanf("%lld %lld %lld", &a, &b, &c)
#define siiii(a, b, c, d)   scanf("%d %d %d %d", &a, &b, &c, &d)
#define sllll(a, b, c, d)   scanf("%lld %lld %lld %lld", &a, &b, &c, &d)
#define vout(v)             for(int i = 0; i < v.size(); i++) {cout << v[i]; if(i < v.size() - 1) cout << ' '; else cout << endl;}

int main(){
    /*#ifndef ONLINE_JUDGE
        double start = clock(); READ(); WRITE();
    #endif*/
        string s; cin >> s;
        sort(all(s));
        int ans = 0;
        if(s[0] == s[1] && s[2] == s[3] && s[1] != s[2]) ans = 1;
        puts(ans ? "Yes" : "No");

    /*#ifndef ONLINE_JUDGE
        printf("\n>>Runtime: %.10fs\n", (double)(clock() - start) / CLOCKS_PER_SEC);
    #endif*/

    return 0;
}

Measured memory_bytes: 256
def dfs(links, fixed, s):
    q = [(s, 0)]
    cnt = [0, 0]
    while q:
        v, c = q.pop()
        if fixed[v] > -1:
            if fixed[v] != c:
                return False
            continue
        fixed[v] = c
        cnt[c] += 1
        for u in links[v]:
            q.append((u, c ^ 1))
    return (max(cnt), min(cnt))


def is_bipartite(n, links):
    fixed = [-1] * n
    l, r = 0, 0
    can = []
    for i in range(n):
        if fixed[i] > -1:
            continue
        cnt = dfs(links, fixed, i)
        if cnt == False:
            return -1
        can.append(cnt)

    can.sort(reverse=True)
    for cnt in can:
        j = 0 if cnt[0] > cnt[1] else 1
        if l > r:
            j ^= 1
        l += cnt[j]
        r += cnt[j ^ 1]
    return (l * (l - 1) + r * (r - 1)) // 2


n, m = map(int, input().split())
links = [set(range(n)) - {i} for i in range(n)]
for _ in range(m):
    a, b = map(int, input().split())
    a -= 1
    b -= 1
    links[a].remove(b)
    links[b].remove(a)
print(is_bipartite(n, links))


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

#define IL inline 
IL int read() {
	char ch = getchar(); int u = 0, f = 1;
	while (!isdigit(ch)) { if (ch == '-') f = -1; ch = getchar(); }
	while (isdigit(ch)) { u = (u << 1) + (u << 3) + ch - 48; ch = getchar(); }
	return u * f; 
}

const int mod = 1e9 + 7;
IL int pls(int x, int y) { x += y; return x >= mod ? x - mod : x; }
IL int mul(int x, int y) { return 1ll * x * y % mod; }
IL int fpw(int x, int y) {
	int r = 1;
	for (; y; y >>= 1, x = mul(x, x))
		if (y & 1) r = mul(r, x);
	return r;
}
const int maxn = 505;
int n, a[maxn], b[maxn], C;
int f[maxn][maxn];
int main() {
	n = read(), C = read();
	for (int i = 1; i <= n; ++i) a[i] = read();
	for (int i = 1; i <= n; ++i) b[i] = read();
	f[0][0] = 1;
	for (int i = 1; i <= n; ++i) {
		for (int k = 0; k <= C; ++k) {
			int V = 0;
			for (int j = a[i]; j <= b[i]; ++j) { V = pls(V, fpw(j, k)); }
			for (int j = k; j <= C; ++j) {
				f[i][j] = pls(f[i][j], mul(f[i - 1][j - k], V));
			}				
		}
	}
	cout << f[n][C];
	return 0;
}

Measured memory_bytes: 1024
#pragma gcc optimize("Ofast")
#include <bits/stdc++.h>

using namespace std;
using ll = long long;

#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define REP(i, n) for (int i = 0; i < (n); ++i)
#define SORT(V) sort((V).begin(),(V).end())
#define pb push_back
#define endl '\n'
#define int long long

const int MOD = 1000000007;
const int INF = 1061109567;
const double EPS = 1e-10;
const double PI  = acos(-1.0);

// 変数定義
int n;
string s;
int ans = 0;
char pv = '-';
//

signed main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  cin >> n >> s;
  REP(i, n) {
    if (!(pv == s[i])) {
      pv = s[i];
      ans++;
    }
  }
  cout << ans << endl;
}

Measured memory_bytes: 512
from collections import defaultdict

N=int(input())
C=[int(input()) for _ in range(N)]

d = defaultdict(int)

ans=1
for i,c in enumerate(C):
    if i>=1 and C[i-1]==C[i]:
        continue
    else:
        ans+=d[c]
        d[c]=ans
        
        ans%=10**9+7
        d[c]%=10**9+7
print(ans)

Measured memory_bytes: 29796
#include <iostream> // cout, endl, cin
#include <cmath>
#include <math.h>
using namespace std;

int main(){
    int X,A,B;
    cin>>X;
    A=X/100;
    B=fmod(X,100);
    for(int i=0;i<A;i++){
        B=B-5;
    }
    if(B>0) cout<<0<<endl;
    else cout<<1<<endl;
}

Measured memory_bytes: 256
#include<stdio.h>

int main(void) {

	int m, f, b, kari;
	scanf("%d %d %d", &m, &f, &b);
	if (m >= b) {
		printf("0\n");
	}
	else if(m + f < b){
		printf("NA\n");
	}
	else {
		kari = b - m;
		printf("%d\n", kari);
	}

	return 0;
}


Measured memory_bytes: 2084
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <queue>
#include <cmath>
#include <climits>
#include <iomanip>
using namespace std;
typedef long long ll;
int main(){
  int n,m;
  cin >> n >> m;
  vector<int> ball(n);
  vector<int> count(n);
  for(int i = 0;i <= n - 1;i++)ball[i] = 1;
  for(int i = 0;i <= n - 1;i++)count[i] = 0;
  count[0] = 1;
  for(int i = 0;i <= m - 1;i++){
    int a,b;
    cin >> a >> b;
    a--;
    b--;
    if(count[a] == 1){
      if(ball[a] == 1)count[a] = 0,count[b] = 1;
      else count[a] = 1,count[b] = 1;
    }
    ball[a]--;
    ball[b]++;
  }
  int res = 0;
  for(int i = 0;i <= n - 1;i++)if(count[i] == 1)res++;
  cout << res << endl;
  return 0;
}

Measured memory_bytes: 1024
import java.util.*;
class Main
{
    public static void main(String args[]){
        Scanner sc=new Scanner(System.in);
        String s=sc.nextLine();
        if(s.length()<6)
            System.out.println("No");
        if(s.charAt(2)==s.charAt(3)&&s.charAt(4)==s.charAt(5))
            System.out.println("Yes");
        else
            System.out.println("No");
    }
}

Measured memory_bytes: 21844
#include <iostream>
#include <vector>

using namespace std;

pair<vector<int>, int> bubbleSort(vector<int> a) {
    bool isSorted = false;
    int c = 0;

    while (!isSorted) {
        isSorted = true;
        for (int i = a.size() - 1; i >= 1; i--) {
            if (a[i] < a[i - 1] ) {
                swap(a[i], a[i - 1]);
                isSorted = false;
                c++;
            }
        }
    }

    return pair<vector<int>, int>(a, c);
}

int main() {
   int n;
   cin >> n;
   vector<int> a = vector<int>(n);
   for (int i = 0; i < n; i++) {
       cin >> a[i];
   }
   pair<vector<int>, int> sorted_count = bubbleSort(a);
   for(int i = 0; i < a.size(); i++) {
       if (i != 0) {
           cout << " ";
       }
       cout << sorted_count.first[i];
   }
   cout << endl << sorted_count.second << endl;

   return 0;
}


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

int main(){
    string s;
    cin >> s;
    int k;
    cin >> k;
    for (int i = 0; i < s.size(); i++){
        int tmp = (26 - (s[i] - 'a')) % 26;
        if (tmp <= k) s[i] = 'a', k -= tmp;
    }
    if (k > 0) s.back() = (char)((s.back() - 'a' + k) % 26 + 'a');
    cout << s << endl;
}

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

#define fi first
#define se second
#define FO(x, n) for (int x = 0; x < n; ++x)
#define FOR(x, a, b) for (int x = a; x < b; ++x)
#define RFO(x, n) for (int x = n - 1; x >= 0; --x)
#define RFOR(x, a, b) for (int x = b - 1; x >= a; --x)
#define FOR_ITER(x, a) for(auto x = a.begin(); x != a.end(); ++x)
using namespace std;
typedef unsigned char byte;
typedef long long llong;
typedef unsigned long long ullong;
typedef pair<int, int> pii;
typedef pair<double, double> pdd;
typedef pair<string, string> pss;
typedef pair<llong, llong> pll;
inline bool feq(const double& a, const double& b) { return fabs(a - b) < 1e-10; }

using namespace std;

int n, k, x, y;

int main(){
//    int n, l;
//    cin >> n >> k;
//    vector<bool> dislike(10, false);
//
//    FOR(i, 0, k) {
//        int t;
//        cin >> t;
//        dislike[t] = true;
//    }


    cin >> n >> k >> x >> y;

    int sum = 0;
    FOR(i, 1, n + 1) {
        if(i > k) {
            sum += y;
        } else {
            sum += x;
        }
    }

    cout << sum << endl;
    return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<cstdio>
#include<algorithm>
#include<vector>
#include<cmath>
#include<string>
#include<numeric>
#include<limits.h>
#include<utility>
#include<cstdlib>
#include<bitset>
#define LP(i,n) for(int i=0;i<n;i++)
#define LPIN(n,a) for(int i=0;i<n;i++)cin >> a[i]
using namespace std;

int main(){
int a,b;
cin >> a >> b;
for(int i=b-a+1;i<=b+a-1;i++){
    if(i==b+a-1){
        cout <<i <<endl;
        continue;
    }
    cout << i <<" ";
}
return 0;
}



Measured memory_bytes: 256
#include <bits/stdc++.h>
#define pb push_back
#define ll long long
#define f first
#define s second
using namespace std;
ll dp[100001][4];
const ll mod = 1000000007;
string s, foo = "ABC";
int main(){
    ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
    cin >> s;
    for(int i = s.length(); i >= 0; i--){
        for(int j = 3; j >= 0; j--){
            if(i == s.length()){
                if(j == 3)dp[i][j] = 1;
            }
            else{
                if(s[i] == '?')dp[i][j] += dp[i+1][j]*3;
                else dp[i][j] = dp[i+1][j];
                if(j < 3){
                    if(s[i] == '?' || s[i] == foo[j]){
                        dp[i][j] += dp[i+1][j+1];
                    }
                }
                dp[i][j] %= mod;
            }
        }
    }
    cout << dp[0][0] << endl;
    return 0;
}


Measured memory_bytes: 6860
#include <bits/stdc++.h>
using namespace std;
int main()
{
  int n;cin>>n;
  string s;cin>>s;
  if(n%2){
    cout<<"No"<<endl;
    return 0;
  }
  if(s.substr(0,s.length()/2)==s.substr(s.length()/2,s.length()))cout<<"Yes"<<endl;
  else cout<<"No"<<endl;
}

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


int main()
{
	int A, B, K;
	cin >> A >> B >> K;

	int n = 0;
	while (n<K)
	{
		if (n % 2 == 0)
		{
			if (A % 2 == 1)
			{
				A = A - 1;
			}
			B = (B + (A / 2));
			A = A / 2;
		}
		if (n % 2 == 1)
		{
			if (B % 2 == 1)
			{
				B = B - 1;
			}
			A = (A + (B / 2));
			B = B / 2;
		}
		n = n + 1;
	}
	cout << A << " " << B << endl;
	return 0;
}


Measured memory_bytes: 256
use std::io::*;

fn main() {
    let mut s: String = String::new();
    std::io::stdin().read_to_string(&mut s).ok();
    let mut itr = s.trim().split_whitespace();
    let h: usize = itr.next().unwrap().parse().unwrap();
    let w: usize = itr.next().unwrap().parse().unwrap();
    let n: usize = itr.next().unwrap().parse().unwrap();

    let dx: Vec<isize> = [0, 0, -1, 0, 1, -1, 1, -1, 1].to_vec();
    let dy: Vec<isize> = [0, 1, 0, -1, 0, -1, 1, 1, -1].to_vec();
    let mut pos = std::collections::HashMap::new();

    for _ in 0..n {
        let b: usize = itr.next().unwrap().parse::<usize>().unwrap() - 1;
        let a: usize = itr.next().unwrap().parse::<usize>().unwrap() - 1;
        for i in 0..9 {
            let nx = a as isize + dx[i];
            let ny = b as isize + dy[i];
            if 0 < nx && nx < w as isize - 1 && 0 < ny && ny < h as isize - 1 {
                let p = pos.entry((ny, nx)).or_insert(0);
                *p += 1;
            }
        }
    }

    let mut ans = vec![0; 10];
    let mut sum = (h - 2) * (w - 2);
    for (_, v) in pos {
        ans[v] += 1;
        sum -= 1;
    }
    ans[0] = sum;
    let mut out = Vec::new();
    for i in 0..10 {
        writeln!(out, "{}", ans[i]).ok();
    }
    stdout().write_all(&out).unwrap();
}


Measured memory_bytes: 55080
N,M=map(int,input().split())
Z=[int(_) for _ in input().split()]
V=sum(Z)
rat=float(1/(4*M))
cnt=0
for i in range(N):
  if float(Z[i]/V)>=rat:
    cnt+=1
if cnt>=M:
  print('Yes')
else:
  print('No')



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

// int main() {
//   cin.tie(0);
//   ios::sync_with_stdio(false);
//   int h, w;
//   scanf("%d %d", &h, &w);
//   vector<string> a(h);
//   for(int i = 0; i < h; i++) cin >> a[i];
//   for(int i = 0; i < w + 2; i++) cout << '#';
//   cout << endl;
//   for(int i = 0; i < h; i++) cout << '#' << a[i] << '#' << endl;
//   for(int i = 0; i < w + 2; i++) cout << '#';
//   cout << endl;
// }

#include <bits/stdc++.h>
using namespace std;

int main() {
  int n, m;
  cin >> n >> m;
  string s(m + 2, '#');
  cout << s << endl;
  string t;
  while(n--) {
    cin >> t;
    t.insert(t.begin(), '#');
    t.push_back('#');
    cout << t << endl;
  }
  cout << s << endl;
  return 0;
}


Measured memory_bytes: 256
using System;
using System.Collections.Generic;
using System.Text;
using System.Numerics;
using System.IO;

namespace SolutionCS
{
    class Program
    {
        static void Main(string[] args)
        {
            int N = int.Parse(Console.ReadLine());

            string[] s = Console.ReadLine().Split(' ');

            int sum = 0;
            int longest = 0;
            for (int i = 0; i < N; i++)
            {
                int tmp = int.Parse(s[i]);

                longest = Math.Max(longest, tmp);
                sum += tmp;
            }

            if(sum - longest > longest)
            {
                Console.WriteLine("Yes");
            }
            else
            {
                Console.WriteLine("No");
            }
        }
    }
}



Measured memory_bytes: 13140
#include "bits/stdc++.h"
#define hhh cerr<<"hhh"<<endl
#define see(x) cerr<<(#x)<<'='<<(x)<<endl
using namespace std;
typedef long long ll;
typedef pair<int,int> pr;
inline int read() {int x=0,f=1;char c=getchar();while(c!='-'&&(c<'0'||c>'9'))c=getchar();if(c=='-')f=-1,c=getchar();while(c>='0'&&c<='9')x=x*10+c-'0',c=getchar();return f*x;}

const int maxn = 3e5+7;
const int inf = 0x3f3f3f3f;
const int mod = 1e9+7;



int main() {
    int a=read(), b=read();
    cout<<a*b<<endl;
}

Measured memory_bytes: 3596
#include <iostream>

using namespace std;

int n;
bool prime[300005];

int main(void){
  prime[1] = true;
  for(int i = 2; i <= 300000; i++){
    if(i%7 != 1 && i%7 != 6){
      prime[i] = true;
    }
  }

  for(int i = 2; i <= 300000; i++){
    if(prime[i]) continue;
    for(int j = 2; i*j <= 300000; j++){
      if(j%7 == 1 || j%7 == 6){
        prime[i*j] = true;
      }
    }
  }

  while(1){
    cin >> n;
    if(n == 1) break;
    cout << n << ":";

    for(int i = 1; i <= 300000; i++){
      if(!prime[i] && n % i == 0){
        int f = n / i;
        if(f%7 == 1 || f%7 ==6) cout << " " << i;
      }
    }
    cout << endl;
  }
  return 0;
}



Measured memory_bytes: 3280
a=input()
r=[]
for i in range(a):
    k=input()
    r.append(k)
minv=r[0]
maxv=-10**9
for j in range(1,len(r)):
    maxv=max(maxv,r[j]-minv)
    minv=min(minv,r[j])
print maxv

Measured memory_bytes: 19052
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int[] t = new int[n];
        for (int i = 0; i < t.length; i++) {
            t[i] = sc.nextInt();
        }
        int m = sc.nextInt();
        int[] p = new int[m];
        int[] x = new int[m];
        for (int i = 0; i < x.length; i++) {
            p[i] = sc.nextInt();
            x[i] = sc.nextInt();
        }
        for (int i = 0; i < m; i++) {
            int ans = x[i];
            int c = p[i] - 1;
            for (int j = 0; j < n; j++) {
                if(c != j) {
                    ans += t[j];
                }
            }
            System.out.println(ans);
        }
    }
}

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

struct unionfind {
	vector<int> p, r, ss;
	unionfind(int n) {
		p.assign(n, 0);
		r.assign(n, 0);
		ss.assign(n, 1);
		for (int i = 0; i < n; ++i) p[i] = i;
	}
	int findset(int i) { return p[i]==i ? i : (p[i]=findset(p[i])); }
	void unite(int i, int j) {
		int x = findset(i), y = findset(j);
		if (x != y) {
			if (r[x] > r[y]) p[y] = x, ss[x] += ss[y];
			else {
				p[x] = y, ss[y] += ss[x];
				if (r[x] == r[y]) ++r[y];
			}
		}
	}
	int setsize(int i) { return ss[findset(i)]; }
};

int main()
{
	int n, m, a, b;
	scanf("%d%d", &n, &m);
	unionfind uf(n);
	while (m--) {
		scanf("%d%d", &a, &b);
		uf.unite(a-1, b-1);
	}
	for (int i = m = 0; i < n; ++i) m = max(m, uf.setsize(i));
	printf("%d\n", m);
}

Measured memory_bytes: 5560
#include <string>
#include <vector>
#include<iostream>
#include<cstdio>
#include<cstdlib>
#include<stack>
#include<queue>
#include<cmath>
#include<algorithm>
#include<functional>
//--
#include<list>
#include<deque>
#include<bitset>
#include<set>
#include<map>
#include<cstdio>
#include<cstring>
#include<sstream>
#include<complex>
#define X first
#define Y second
#define pb push_back
#define rep(X,Y) for (int (X) = 0;(X) < (Y);++(X))
#define rrep(X,Y) for (int (X) = Y-1;(X) >=0;--(X))
#define all(X) (X).begin(),(X).end()
#define rall(X) (X).rbegin(),(X).rend()

using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
typedef complex<double> pt;

pt proj(pt a,pt to){
  return (conj(a)*to).real()/norm(to)*to;
}

int main(){
  int i,j,k,n;
  pt o,p,q;
  cin>>o.real()>>o.imag()>>p.real()>>p.imag();
  cin>>n;
  rep(i,n){
    cin>>q.real()>>q.imag();
    q=proj(q-o,p-o)+o;
    printf("%.9f %.9f\n",q.real(),q.imag());
  }
  return 0;
}

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

#define pb(n) push_back(n)
#define fi first
#define se second
#define all(r) (r).begin(),(r).end()
#define gsort(st,en) sort((st),(en),greater<int>())
#define vmax(ary) *max_element(all(ary))
#define vmin(ary) *min_element(all(ary))
#define debug(x) cout<<#x<<": "<<x<<endl
#define fcout(n) cout<<fixed<<setprecision((n))
#define scout(n) cout<<setw(n)
#define vary(type,name,size,init) vector< type> name(size,init)

#define rep(i,n) for(int i = 0; i < (int)(n);++i)
#define REP(i,a,b) for(int i = (a);i < (int)(b);++i)
#define repi(it,array) for(auto it = array.begin(),end = array.end(); it != end;++it)
#define repa(n,array) for(auto &n :(array))

using ll = long long;
using vi = vector<int>;
using vl = vector<ll>;
using dict = map<string,int>;
using pii = pair<int,int> ;

constexpr int imax = ((1<<30)-1)*2+1 ;
constexpr int inf = 100000000;
constexpr double PI = acos(-1.0) ;
double eps = 1e-10 ;
const int dy[] = {-1,0,1,0};
const int dx[] = {0,-1,0,1};

inline bool value(int x,int y,int w,int h){
  return (x >= 0 && x < w && y >= 0 && y < h);
}

template<typename T>
void Unique(vector<T> &v){
  sort(all(v));
  v.erase(unique(all(v)),v.end());
}

template<typename T>
T ston(string& str, T n){
  istringstream sin(str) ;
  T num ;
  sin >> num ;
  return num ;
}

void Ans(bool f){
  if(f) cout << "YES"<<endl;
  else cout << "NO"<<endl;
}

string Solve(vector<int> v){
  set<int> s;
  int st = 0;
  REP(i,1,14){
    if(v[i] > 0){
      s.insert(i);
    }
    if(v[i] == v[i-1] && v[i] != 0){
      ++st;
    }
  }
  int m = *max_element(all(v));
  if(m == 4){
    return "four card";
  }
  else if(m == 3 && s.size() == 2){
    return "full house";
  }
  else if(m == 1){
    if((v[1] != 0 && v[1] == v[10] && v[11] == v[12] && v[13] == v[1] && v[1] == v[11])||(st == 4)){
      return "straight";
    }
    else
      return "null";
  }
  else if(m == 3 && s.size() == 3){
    return "three card";
  }
  else if(m == 2 && s.size() == 3){
    return "two pair";
  }
  else if(m == 2){
    return "one pair";
  }
  return "null";
}

int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  char c;
  int a,b,d,e,f;
  while(cin >> a >> c >> b >> c >> d >> c >> e >> c >> f){
    vary(int,v,14,0);
    v[a]++;
    v[b]++;
    v[d]++;
    v[e]++;
    v[f]++;
    cout << Solve(v) << endl;
  }
  return 0;
}

Measured memory_bytes: 3188
#include "bits/stdc++.h"
using namespace std;
#define pb          push_back
#define mp          make_pair
#define pii         pair<int,int>
#define vi          vector<int>
#define vii         vector<pii>
#define mi          map<int,int>
#define mii         map<pii,int>
#define all(a)      (a).begin(),(a).end()
#define x           first
#define y           second
#define sz(x)       (int)x.size()
#define endl        '\n'
#define hell        1000000007
#define N	    100001
#define rep(i,a,b)  for(int i=a;i<b;i++)
typedef long long ll;
void solve() {
	vi a(3);
	for(int &i :a)
		cin>>i;
	sort(all(a));
	int ans = a[2] - a[1];
	a[0] += a[2] - a[1];
	int dff = a[2] - a[0];
	if(dff % 2)
		ans += 2;
	ans += (a[2] - a[0]) / 2;
	cout<<ans<<endl;

}
int main() {
	int t;
//	cin>>t;
	t = 1;
	while(t--){
		solve();
	}
}


Measured memory_bytes: 256
#include<stdio.h>
int main()
{
	 long int i,j,k,l,m;
	scanf("%ld",&k);
	scanf("%ld",&l);
	if((k+l)%2==0)
	{
		printf("%ld",(k+l)/2);
	}
	else
	{
		printf("IMPOSSIBLE");
	}
}

Measured memory_bytes: 128
n, m = map(int, input().split())
P, S = [], [] 
PS = set()
for _ in range(m):
    p, s = map(str, input().split())
    P.append(int(p))
    S.append(s)
    PS.add((int(p),s))

gotou = 0

sudeni_seitou = set()
for i in range(m):
    if S[i] == 'AC':
        sudeni_seitou.add(P[i])

mou_sudeni_seitou = set()
for i in range(m):
    if S[i] == 'AC':
        mou_sudeni_seitou.add(P[i])
    elif (S[i] == 'WA') and (P[i] in sudeni_seitou) and (P[i] not in mou_sudeni_seitou):
        gotou += 1

seitou = len(sudeni_seitou)

print(str(seitou) + ' ' + str(gotou))

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

int main()
{
	int N,H,W;
	cin >> N >> H >> W;
	int A[N],B[N];
	for(int i=0;i<N;i++) cin >> A[i] >> B[i];

	int num = 0;
	for(int i=0;i<N;i++) if(A[i]>=H && B[i]>=W) num++;
	
	cout << num << endl;

	return 0;
}

Measured memory_bytes: 256
#include<stdio.h>
int main(){
double a[8];
while(scanf("%lf %lf %lf %lf %lf %lf %lf %lf",&a[0],&a[1],&a[2],&a[3],&a[4],&a[5],&a[6],&a[7])!=EOF){
if((a[1]-a[3])*(a[5]-a[7])+(a[0]-a[2])*(a[4]-a[6])==0)
printf("YES\n");
else printf("NO\n");
}
return 0;
}

Measured memory_bytes: 0
#include<bits/stdc++.h>
using namespace std;
int n,m,cnt[100005],a,b;
int main(void){
	scanf("%d%d",&n,&m);
	for(int i=0;i<m;++i){
		scanf("%d%d",&a,&b);
		++cnt[a], ++cnt[b];
	}
	for(int i=1;i<=n;++i) if(cnt[i]&1){
		puts("NO");
		return 0;
	}
	puts("YES");
}

Measured memory_bytes: 640
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using Edge = vector<int>;
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define IFOR(i,a,b) for(int i=(b-1);i>=(a);--i)
#define RPT(i,a,b) for(int i=(a);i<((a)+(b));++i)
#define IRPT(i,a,b) for(int i=((a)+(b)-1);i>=(a);--i)
constexpr int INF = (1 << 28);
constexpr ll INF_ = (1LL << 58);
constexpr ld EPS = (1e-10);
constexpr ld PI_ = 3.141592653589793238;//46264338327950288
constexpr ld E_ = 2.71828182845904523;//5360287471352
vector<int> V; vector<Edge> E; vector<int> pred, checked, dist;
void BFS(int s);
int main(void){
  int H, W, Table[25][25]; cin >> H >> W;
  E = vector<Edge>(H*W+2);
  RPT(i,0,H){
    RPT(j,0,W){
      char S; cin >> S;
      if(S=='.') Table[i][j] = 1;
      else Table[i][j] = 0;
    }
  }
  RPT(i,0,H){
    RPT(j,0,W){
      int id = W*i+j;
      if(Table[i][j]==1){
        V.push_back(id);
        for(int k=-1; k < 2; k++){
          for(int l=-1; l < 2; l++){
            if((k!=0 || l!=0) && (k==0 || l == 0) && (i+k)>=0 && (i+k) < H && (j+l)>=0 && (j+l)<W){
              if(Table[i+k][j+l]==1) E[id].push_back( W*(i+k)+(j+l)  );
            }
          }
        }
      }
    }
  }
  pred = vector<int>(H*W+2);
  checked = vector<int>(H*W+2);
  dist = vector<int>(H*W+2);
  int ans = 0;
  for(auto v : V){
    BFS(v);
    for(auto v : V){
      if(dist[v] < INF && dist[v] > ans){
        ans = dist[v];
      }
    }
  }
  cout << ans << endl;
  return 0;
}
void BFS(int s){
  for(auto v : V){
    pred[v] = -1;
    dist[v] = INF;
    checked[v] = 0;
  }
  checked[s] = 1;
  dist[s] = 0;
  queue<int> Q;
  Q.push(s);
  while(!Q.empty()){
    int u = Q.front();
    for(auto v : E[u]){
      if(checked[v]==0){
        dist[v] = dist[u] + 1;
        pred[v] = u;
        checked[v] = 1;
        Q.push(v);
      }
    }
    Q.pop();
    checked[u] = 2;
  }
}

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


int main(int argc, char *argv[]) {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  cout << setprecision(20);

  int N; cin >> N;
  vector<int> L(2*N);
  for (int i = 0; i < 2*N; i++) cin >> L.at(i);
  sort(L.begin(), L.end());
  int s = 0;
  for (int i = 0; i < N; i++) {
    int j = 2 * i;
    s += L.at(j);
  }
  cout << s << endl;

  return 0;
}



Measured memory_bytes: 256