akhauriyash/Code-Regression huggingface dataset:
#include<bits/stdc++.h>
 
using namespace std;
using S = set<long long>;
using D = deque<long long>; //pop_back pop_front push_back push_front front back clear empty
using L = vector<long long>;
using M = map<int,long long>;  //erase  (でキーごと削除) 追加削除検索O(log(N))
using A = vector<vector<long long>>;
using U = unordered_map<int,long long>; //map  (との違いはkeyの順番を保持していない)
using PQL = priority_queue<long long>; //erase  (でキーごと削除) push pop top 
using PQG = priority_queue<long long,L,greater<long long>>; //erase  (でキーごと削除) push pop top 

#define sorted(vector) sort(vector.begin(),vector.end()) //O(nlongn)
#define sortedreverce(vector) sort(vector.rbegin(),vector.rend()) //O(nlongn)
#define vdel(vector,a) vector.erase(vector.begin()+a)
#define vmin(vector) *min_element(vector.begin(),vector.end()) //O(N)
#define vmax(vector) *max_element(vector.begin(),vector.end()) //O(N)
#define vsum(vector) accumulate(vector.begin(),vector.end(),0) //O(N)
#define vcount(vector,a) count(vector.begin(), vector.end(),a) //O(N)
#define vfind(vector,a) find(vector.begin(), vector.end(), a) != vector.end() //遅いからあんまり使うな
#define bisect_left(vector,a) (lower_bound(vector.begin(),vector.end(),a)-vector.begin())
#define bisect_right(vector,a) (upper_bound(vector.begin(),vector.end(),a)-vector.begin())
#define max max<unsigned long>
#define min min<unsigned long>
#define inf 1000000000000000000+10
#define setans long long ans=0;

long long MOD=1000000007;

template <typename PQ>
long long pqsum(PQ pq){long long tmp=0;while(!pq.empty()){tmp+=pq.top();pq.pop();};return tmp;};

template <typename T>
void print(T a){for (auto b:a){cout<<b<<" ";};cout<<endl;}
template <>
void print(unsigned long a){cout<<a<<endl;}
template <>
void print(char a){cout<<a<<endl;}
template <>
void print(bool a){cout<<a<<endl;}
template <>
void print(long long a){cout<<a<<endl;}
template <>
void print(A a){for (auto b:a){for (auto c:b){cout<<c<<" ";}cout<<endl;};cout<<endl;}
template <>
void print(string a){cout<<a<<endl;}



//存在確認はmap!!!!!!!!!!!!!か配列に埋め込んでcontinueで回避
//__gcd(a,b)はコンパイラがGCC時のみ
//printf("%.16f", ans); 誤差落ち対応君



int main(){
    ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
    
    long long n;
    setans;
    cin>>n;
    L a(n,0);
    for(long long i=0  ;i<n  ;i++){
        cin>>a[i];
    }
    for(long long i=0  ;i<n  ;i++){
        ans+=a[i]!=i+1;
    }
    if (ans<3){
        cout<<"YES"<<endl;
    }else{
        cout<<"NO"<<endl;
    }
}



Measured memory_bytes: 256
#include<bits/stdc++.h>
#define fast ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
using namespace std;
int parent[500002];
int ranks[500002];
void in()
{
    for(int i=0;i<=500002;i++)
    {
        parent[i]=i;
        ranks[i]=1;
    }
}
int find_p(int x)
{
    if(x!=parent[x])
    {
        return x=find_p(parent[x]);
    }
    return x;
}
void union_p(int x,int y)
{
    int px=find_p(parent[x]);
    int py=find_p(parent[y]);
    if(px==py)
        return;
    if(ranks[px]>=ranks[py])
    {
        parent[py]=px;
        ranks[px]+=ranks[py];
    }
    else{
            parent[px]=py;
        ranks[py]+=ranks[px];

    }
}

int main()
{
    in();
    int a,b,c,d;
    cin >> a >> b;
    while(b--)
    {
        cin >> c >> d;
        union_p(c,d);
    }
    int e=0;
    for(int i=1;i<=a;i++)
    {
      e=max(e,ranks[i]);
    }
    cout << e << endl;






}





Measured memory_bytes: 7552
import 'dart:io';

import 'dart:math';

List<String> getStdStr() => stdin.readLineSync().split(' ');
List<int> getStdInt() {
  var strings = getStdStr();
  List<int> outs = [];
  for (var out in strings) {
    outs.add(int.parse(out));
  }
  return outs;
}

void main() {
  var S = getStdStr();
  var T = getStdStr();
  int ret = T[0].length;
  for (var i = 0; i < S[0].length - T[0].length + 1; ++i) {
    String tmpstr = S[0].substring(i, i + T[0].length);
    ret = min(ret, chkDiff(tmpstr, T[0]));
  }
  print(ret);
}

int chkDiff(String str1, String str2) {
  int ret = 0;
  int size = max(str1.length, str2.length);
  for (var i = 0; i < size; ++i) {
    if (str1[i] != str2[i]) {
      ret++;
    }
  }
  return ret;
}


Measured memory_bytes: 13408
/*
*
*	AUTHOR :- @soham01
*		// "WORK HARD AND NEVER GIVE UP" //
*
*/
#include "bits/stdc++.h"

using namespace std;

#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(), order_of_key()
#define pb push_back
#define mp make_pair
#define vi vector<long long int >
#define vb vector<bool>
#define vs vector<string>
#define vd vector<double>
#define vvi vector<vector<long long int> >
#define vp vector<pair<long long int , long long int > >
#define seti set<long long int >
#define setc set<char>
#define setd set<double>
#define mod 1000000009
#define endl '\n'
typedef long long int lli;

// ITS MY REQUEST TO PLEASE PLEASE DO LOOK AT THE CONSTRAINS GIVEN CAREFULLY
// DO CHECK FOR CORNER CASES

/*-------LET THE GAME BEGIN-----------*/

void solve()
{
	unsigned long long int a,b,c=0,f=0;
	cin >> a >> b;
	if(b>a)
    {
        cout<<min(a,b-a)<<endl;
    }
    else if(a%b==0)
    {
        cout<<"0"<<endl;
    }
    else if(a>b){
        c=a/b;
        f=(c+1)*b;
        cout<<min(a%b,f%a)<<endl;
    }
}
int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);

		solve();
	return 0;
}





Measured memory_bytes: 256
#include <bits/stdc++.h>
 
using namespace std;
typedef long long ll;
typedef vector<int> VI;
ll mm=1000000000;ll MM=mm+7;
#define rep(i, n) for(int i=0;i<n;i++)
#define PI 3.141592653589793
 

int main(){
 int a,b;
  cin >> a >> b;
  int cnt=0;
  for(int i=a;i<=b;i++){
    int k=i;
    int n=k/10000;
    int m=(k%10000)/1000;
    int o=(k%1000)/100;
    int p=(k%100)/10;
    int q=k%10;
    if(n==q && m==p)cnt++;
  }
  cout << cnt << endl;
}

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

using ll  = long long;
using pll = pair<ll,ll>;
using vll = vector<pll>;
using vl  = vector<ll>;
using vvl = vector<vl>;
const ll INFL = (1LL<<60);
vvl edges;
vl dists;

int main() {
    int ans=-1;
    int N,M;
    cin>>N>>M;
    edges.resize(3*N);
    dists.assign(3*N,INFL);
    for (int i=0;i<M;++i) {
        int u,v;cin>>u>>v;u--;v--;
        edges[u].push_back(v+N);
        edges[u+N].push_back(v+2*N);
        edges[u+2*N].push_back(v);
    }
    int S,T;
    cin>>S>>T;S--;T--;
    priority_queue<pll> que;
    que.push(pll(0,S));
    while(!que.empty()){
        ll d=-que.top().first,node=que.top().second;que.pop();
        if (dists[node]!=INFL)continue;
        dists[node]=d;
        if(node==T){ans=dists[T]/3;break;}
        for(auto e:edges[node]){
            que.push(pll(-d-1,e));
        }
    }
    cout<<ans<<endl;
    return 0;
}


Measured memory_bytes: 18944
class Dinic:

	def __init__(self, v, inf=float("inf")):
		self.V = v
		self.inf = inf
		self.G = [[] for _ in range(v)]
		self.level = [0 for _ in range(v)]
		self.iter = [0 for _ in range(v)]

	def addEdge(self, fm, to, cap):
		'''
		to:行き先
		cap:容量
		rev:反対側の辺
		'''
		self.G[fm].append({'to':to, 'cap':cap, 'rev':len(self.G[to])})
		self.G[to].append({'to':fm, 'cap':0, 'rev':len(self.G[fm])-1})


	# sからの最短距離をbfsで計算
	def bfs(self, s):
		import queue
		self.level = [-1 for _ in range(self.V)]
		self.level[s] = 0
		que = queue.Queue()
		que.put(s)

		while not que.empty():
			v = que.get()
			for i in range(len(self.G[v])):
				e = self.G[v][i]
				if e['cap'] > 0 and self.level[e['to']] < 0:
					self.level[e['to']] = self.level[v] + 1
					que.put(e['to'])


	def dfs(self, v, t, f):
		if v == t: return f
		for i in range(self.iter[v], len(self.G[v])):
			self.iter[v] = i
			e = self.G[v][i]
			if e['cap'] > 0 and self.level[v] < self.level[e['to']]:
				d = self.dfs(e['to'], t ,min(f,e['cap']))
				if d > 0:
					e['cap'] -= d
					self.G[e['to']][e['rev']]['cap'] += d
					return d
		return 0


	def max_flow(self,s,t):
		flow = 0
		while True:
			self.bfs(s)
			if self.level[t] < 0: return flow
			self.iter = [0 for _ in range(self.V)]
			f = self.dfs(s,t,self.inf)
			while f > 0:
				flow += f
				f = self.dfs(s,t,self.inf)



from sys import stdin, setrecursionlimit
def IL():return list(map(int, stdin.readline().split()))
 
setrecursionlimit(1000000)

def main():
	N = int(input())
	a = IL()
	d = Dinic(N+2)
	res = 0
	for i in range(N):
	    d.addEdge(N,i, max(0, -a[i]))
	    d.addEdge(i,N+1, max(0,a[i]))
	    res+=max(0,a[i])
	    t = 2*i+2
	    while t<=N:
	        d.addEdge(i,t-1,float('inf'))
	        t+=i+1
	print(res-d.max_flow(N,N+1))
	
	
if __name__ == "__main__": main()

Measured memory_bytes: 4336
#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <queue>
#include <cmath>
#include <set>
typedef long long ll;
typedef unsigned int uint;
using namespace std;

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

    string s;
    cin >> s;
    int bg=0, ed=s.length()-1, ans=0;
    while (ed - bg > 0) {
        if (s[bg] == s[ed]) {
            bg++; ed--;
        } else if (s[bg] == 'x') {
            bg++; ans++;
        } else if (s[ed] == 'x') {
            ed--; ans++;
        } else {
            ans = -1; break;
        }
    }

    cout << ans << "\n";
    return 0;
}

Measured memory_bytes: 512
import sys
input = sys.stdin.readline
import math
tax = 1.08
def print_ans(N):
    """Test Case
    >>> print_ans(432)
    400
    >>> print_ans(1079)
    :(
    >>> print_ans(1001)
    927
    """
    X = int(N // tax)
    if N == math.floor(X * tax):
        print(X)
    elif N == math.floor((X + 1) * tax):
        print(X + 1)
    else:
        print(":(")
    
if __name__ == '__main__':
    N = int(input().rstrip())
    print_ans(N)


Measured memory_bytes: 3060
# coding: utf-8
# Here your code !

import sys

def gcd(a, b):
	while b:
		a, b = b, a % b
	return a
	
def lcm(a, b):
	return a * b // gcd (a, b)

for line in sys.stdin:
    a, b = map(int, line.split())
    print( str(gcd(a,b))+" "+str(lcm(a,b)) )
    

Measured memory_bytes: 7680
//by Top1
#include <bits/stdc++.h>
          
#define f first
#define s second
#define int long long
#define ld long double
#define ull unsigned long long
#define pii pair <int, int>
#define pll pair <long, long>
#define mp make_pair
#define pb push_back
#define pf push_front
#define pp pop_back
#define cerr cout
#define rev reverse
#define all(s) s.begin(), s.end()
#define sz(s) (int)s.size()
#define forn(i, a, b) for (int i = a; i <= b; i++)
#define boost ios_base::sync_with_stdio(false); cin.tie(0),cout.tie(0);
#define nxtp next_permutation
#define pvtp prev_permutation
#define KZ return 
#define x1 x21212121
#define y1 y21212121
#define sqr(x) x * x 
      
const int inf = (1e9) + 1;
const int mod = 479001599;
const int maxn = 1e6 + 111;
        
using namespace std;          

int n, x, y, ans[maxn]; 

void solve(){
	cin >> n >> x >> y;
    
    for (int i = 1; i < n; i++){
    	for (int j = i + 1; j <= n; j++){
    		int k = j - i;
    		if (i <= x && j >= x && j <= y)
    			k = min(k, x - i + min(1 + y - j, j - x));
    		if (i >= x && j <= y)
    			k = min(k, i - x + 1 + y - j);
    		if (i >= x && i <= y && j >= y)
    			k = min(k, i - x + 1 + j - y);
    		if (i <= x && j >= y)
    			k = x - i + j - y + 1;
    		ans[k]++;
    		//cout << i << " " << j << " " << k << endl;	
    	}
    }

    for (int i = 1; i < n; i++)
    	cout << ans[i] << endl;
}                              
      
main(){
    boost;
    
    int q = 1;
 
    //cin >> q;
    
    while (q--){
        solve();
    }
}

Measured memory_bytes: 256
n,a,b = map(int,input().split())

#場合分けで考える
#b-aが偶数の場合、お互いに移動すればよい
#b-aが奇数の場合、末端に近いほうが端まで移動し、その後いターン消費して、距離をお互いに詰める

if (b-a)%2==0:
    ans = (b-a)//2
else:
    #端までの距離が近いほうの移動ステップ
    #端まで移動した際のお互いの距離は変化していない、そこから1ターン消費する
    #距離が偶数になるのでお互いに移動する
    ans = min(a-1,n-b)+1+(b-a-1)//2

print(ans)


Measured memory_bytes: 2940
#include <iostream>
#include <algorithm>
#include <functional>
#include <vector>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <string>
#include <numeric>
#include <cmath>

#define rep(i, n) for (int i = 0; i < n; i++)
using namespace std;
typedef long long ll;
using P = pair<ll, ll>;

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

const ll MOD = 1000000007;
const ll INF = 1LL<<60;
//const ll INF = (ll)1e18 + 1;

struct edge{
  ll to;
  ll cost;
};
using Graph = vector<vector<edge>>;
int main(){
  ll N; cin >> N;
  Graph G(N);
  rep(i, N - 1){
    int a, b, c; cin >> a >> b >> c;
    a--, b--;
    G[a].push_back(edge {b, c});
    G[b].push_back(edge {a, c});
  }
  ll Q, K; cin >> Q >> K;
  K--;

  vector<ll> d(N, INF);
  d[K] = 0;
  priority_queue<P, vector<P>, greater<P>> que;
  que.push(make_pair(0, K));
  while (!que.empty()){
    P p = que.top(); que.pop();
    ll v = p.second;
    if (d[v] < p.first) continue;
    for (auto e: G[v]){
      if (d[e.to] > d[v] + e.cost){
        d[e.to] = d[v] + e.cost;
        que.push(make_pair(d[e.to], e.to));
      }
    }
  }

  rep(i, Q){
    ll x, y; cin >> x >> y;
    x--, y--;
    cout << d[x] + d[y] << endl;
  }
}


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

int main() {
    int N, X;
    int a[110]; 
    cin >> N >> X;
    for (int i = 0; i < N; ++i) cin >> a[i];
    sort(a, a + N);
    int sum = 0; 
    for (int i = 0; i < N; ++i)
      sum += a[i]; 
    cout << N + (X - sum) / a[0] << endl;
}

Measured memory_bytes: 256
n = int(input())
al = list(map(int,input().split()))

al_m = [i - idx for idx, i in enumerate(al)]
al_m2 = [-i - idx for idx, i in enumerate(al)]

al_p = [i + idx for idx, i in enumerate(al)]
al_p2 = [-i + idx for idx, i in enumerate(al)]

from collections import defaultdict
dic = defaultdict(int)

ans = 0
for a in al_m:
    dic[a] += 1
for a in al_m2:
    ans += dic[a]

dic = defaultdict(int)
for a in al_p:
    dic[a] += 1
for a in al_p2:
    ans += dic[a]

print(ans//2)


Measured memory_bytes: 171608
#include <iostream>
#include<algorithm>
#include<string>
#include <cmath>
#include <vector>
#include <map>
#include <cstdio>
#pragma region Macros
#define rep(i,n) for(int i=0;i<n;i++)
#define REP(i,n) for(int i=1;i<=n;i++)
#define int long long
#define all(x) (x).begin(),(x).end()
#define swap(a,b) (a += b,b = a - b,a -= b)
#define ceil(a,b) ((a+b-1)/b)
int gcd(int a, int b) // assuming a,b >= 1
{
    if (a < b)
        swap(a, b);
    if (b == 0)
        return a;
    if (a % b == 0)
        return b;
    return gcd(b, a % b);
}
int lcm(int a, int b) // assuming a,b >= 1
{
    return  a * b / gcd(a, b);
}
using namespace std;
#pragma endregion
signed main() {
    int A=700;
    string S;
    cin >> S;
    rep(i, 3) {
        if (S[i] == 'o')
            A += 100;
    }
    cout << A;
}

Measured memory_bytes: 256
#include<iostream>
using namespace std;
int per[100010];
long long dis[100010];
int flag;
long long maxn;
inline int find(int x)
{
	if(x == per[x])
		return x;
	else
	{
		int x1 = per[x];
		int x2 = find(x1);
		dis[x] = dis[x] + dis[x1];
		return per[x] = x2;
	}
}
inline void merge(int x,int y,int d1)
{
	int fx = find(x);
	int fy = find(y);
	if(fx != fy)
	{
		if(dis[x] + d1 - dis[y] > 0)
		{
			dis[fy] = dis[x] + d1 - dis[y];
			per[fy] = fx;
		}
		else
		{
			dis[fx] = dis[y] - d1 - dis[x];
			per[fx] = fy;
		}
		if(dis[fy] > maxn)
			maxn = dis[fy];
		if(dis[fx] > maxn)
			maxn = dis[fx];
	}
	else
	{
		if(dis[y] - dis[x] != d1)
			flag = 0;
	}
}
int main()
{
	int n,m;
	while(cin >>n >> m)
	{
		int x1,x2,d;
		flag = 1;
		maxn = 0;
		for(int i = 0;i <= n;++i)
		{
			per[i] = i;
			dis[i] = 0;
		}
		for(int i = 1;i <= m;++i)
		{
			cin >> x1 >> x2 >> d;
			merge(x1,x2,d);
		}
		if(maxn > 1e+9)
			flag = 0;
		if(flag)
			cout << "Yes" << endl;
		else
			cout << "No" << endl;
	}
	return 0;
}

Measured memory_bytes: 1536
# coding: utf-8
init = [int(s) for s in input().rstrip().split(' ')]
data = [int(s) for s in input().rstrip().split(' ')]

sorData = sorted(data,reverse=True)

if sorData[init[1]-1] < sum(data)/(4*init[1]):
    print("No")
else:
    print("Yes")

Measured memory_bytes: 3060
h, w, m = map(int, input().split())
hw = [list(map(int, input().split())) for i in range(m)]
hl, wl = [0] * (h + 1), [0] * (w + 1)
for i in hw:
    hl[i[0]] += 1
    wl[i[1]] += 1
hm, wm = max(hl), max(wl)
cnt = hl.count(hm) * wl.count(wm)
for i, j in hw:
    if hl[i] + wl[j] == hm + wm:
        cnt -= 1
print(hm + wm if cnt > 0 else hm + wm - 1)

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

using namespace std;

typedef long long int lli;

const lli MAX = 1000000;
const lli MOD = 1000000007;
lli fac[MAX], finv[MAX], inv[MAX];

// テーブルを作る前処理
void NCRinit() {
    fac[0] = fac[1] = 1;
    finv[0] = finv[1] = 1;
    inv[1] = 1;
    for (int i = 2; i < MAX; i++){
        fac[i] = fac[i - 1] * i % MOD;
        inv[i] = MOD - inv[MOD%i] * (MOD / i) % MOD;
        finv[i] = finv[i - 1] * inv[i] % MOD;
    }
}

// 二項係数計算
lli NCR(int n, int r){
    if (n < r) return 0;
    if (n < 0 || r < 0) return 0;
    return fac[n] * (finv[r] * finv[n - r] % MOD) % MOD;
}

lli NPR(int n, int r) {
    return (NCR(n, r) * fac[r]) % MOD;
}

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

    vector<vector<int>> tree(100001, vector<int>());
    int n, k, a, b;
    cin >> n >> k;
    for (int i=0; i<n-1; i++) { 
        cin >> a >> b;
        tree[a].push_back(b);
        tree[b].push_back(a);
    }

    lli ans = k;
    queue<pair<int, int>> qu; // <prev, crnt>
    qu.push(make_pair(0, 1));
    while (!qu.empty()) {
        int prev = qu.front().first, crnt = qu.front().second;
        qu.pop();

        for (auto t : tree[crnt]) {
            if (t == prev) continue;
            qu.push(make_pair(crnt, t));
        }

        ans *= (crnt == 1) ? NPR(k-1, tree[crnt].size()) : NPR(k-2, tree[crnt].size()-1);
        ans %= MOD;
    }

    cout << ans << endl;

    return 0;
}


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

#define int long long

using namespace std;

int a[200001];

 main () {
	int n;
	cin >> n;
	int all = 0;
	for (int i = 1;i <= n;i ++) {
		cin >> a[i];
		all += a[i];
	}
	int cost = (n * (n + 1)) / 2;
	if (all % cost) {
		cout << "NO";
		exit (0);
	}
	int kol = 0;
	int k = all / cost;
	a[n + 1] = a[1];
	for (int i = 1;i <= n;i ++) {
		int dif = a[i + 1] - a[i];
		dif -= k;
		if (dif > 0) {
			cout << "NO";
			exit (0);
		}
		dif = abs (dif);
		if (dif % n) {
			cout << "NO";
			exit (0);
		}
		kol += dif / n;
	}
	if (kol != k) {
		cout << "NO";
	}
	else cout << "YES";
	return 0;
}

Measured memory_bytes: 1024
#pragma GCC optimize("O3")
#include <bits/stdc++.h>
#define ll long long
#define rep2(i,a,b) for(ll i=a;i<=b;++i)
#define rep(i,n) for(ll i=0;i<n;i++)
#define rep3(i,a,b) for(ll i=a;i>=b;i--)
#define pii pair<int,int>
#define pll pair<ll,ll>
#define pq priority_queue
#define pb push_back
#define eb emplace_back
#define vec vector<int>
#define vecll vector<ll>
#define vecpii vector<pii>
#define vec2(a,b) vector<vec>(a,vec(b))
#define vec2ll(a,b) vector<vecll>(a,vecll(b))
#define vec3(a,b,c) vector<vector<vec>>(a,vec2(b,c))
#define vec3ll(a,b,c) vector<vector<vecll>>(a,vec2ll(b,c))
#define fi first
#define se second
#define endl "\n"
#define all(c) begin(c),end(c)
#define ios ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0);
#define lb(c,x) distance(c.begin(),lower_bound(all(c),x))
#define ub(c,x) distance(c.begin(),upper_bound(all(c),x))
#define MM " "
using namespace std;
int in() {int x;cin>>x;return x;}
ll lin() {ll x;cin>>x;return x;}
template<class T> inline bool chmax(T& a,T b){if(a<b){a=b;return 1;}return 0;}
template<class T> inline bool chmin(T& a,T b){if(a>b){a=b;return 1;}return 0;}
template<class T> inline void print(pair<T,T> p){cout<<"("<<p.first<<","<<p.second<<") ";}
template<class T> inline void print(vector<pair<T,T>> v){for(auto e:v)print(e); cout<<endl;}
template<class T> inline void print(T v){for(auto e:v)cout<<e<<" ";cout<<endl;}


    
void go();

main(){
    ios
    int tc=1;
    // tc=in();
    while(tc--){
        go();
    }
    return 0;
}


void go(){
    int a=in(),b=in();
    if(a>=13)cout<<b<<endl;
    else if(a>=6)cout<<b/2<<endl;
    else cout<<0<<endl;
}





Measured memory_bytes: 256
/*
.......................
.......................
..... MY CODES ARE ....
... UGLIER THAN YOU ...
.......................
.......................
*/
#define pb push_back
#define ff first
#define ss second
#define ll long long
#define IOS ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
#define maxn 200005
#define mod 1000000007
#include <bits/stdc++.h>
using namespace std;

void solve(){
    ll a, b, res, sum = 0;
    cin >> a >> b;
    while(b--){
        ll x;
        cin >> x;
        sum += x;
    }
    if(sum >= a) cout << "Yes";
    else cout << "No";
}


int main() {

    int tc;
    tc = 1;
    while(tc--){
        solve();
    }

    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define INF 1LL<<62
#define inf 1000000007

ll a[50];
int main() {
	ll n;
	cin>>n;
	for(ll i=0;i<50;i++){
		a[i]=i;
		//cout << a[i]<<endl;
	}
	ll sum=n/50;
	for(ll i=0;i<50;i++){
		a[i]+=sum;
	}
	sum=n%50;
	for(ll i=0;i<sum;i++){
		for(ll j=0;j<50;j++){
			if(j==i){
				a[j]+=50;
			}
			else{
				a[j]--;
			}
		//	cout << a[j]<<endl;
		}
	}
	cout << 50<<endl;
	for(ll i=0;i<50;i++){
		cout << a[i]<< " ";
	}
	// your code goes here
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
    using namespace std;
     
    int main() {
      int N;
      cin >> N;
      vector<int> vec(N);
      vector<int> nvec(N);
      
	for (int i = 0; i < N; i++) {
      cin >> vec.at(i);
    }
      
     for (int i = 0; i < N; i++) { 
       for (int j = i; j < N - 1; j++) { 
     if (vec.at(j) >= vec.at(j+1)) {
       nvec.at(i)++;}
    //   cout << nvec.at(i) << i << endl;}
     else {break;}
       }
      if (nvec.at(i) + 1 >= N - nvec.at(i) - 1) {break;}
     }
      
      sort(nvec.begin(), nvec.end());
      
     cout << nvec.at(N-1) << endl;
      
    }

Measured memory_bytes: 1024
#include<cstdio>
#include<iostream>
#include<set>
using namespace std;
typedef long long ll;
set<ll>s;
int main()
{
    int n;
    cin>>n;
    for(int i = 0; i < n; i++){
        ll t;
        cin>>t;
        if(s.count(t))s.erase(s.find(t));
        else s.insert(t);
    }
    cout<<s.size();
    return 0;
}


Measured memory_bytes: 4864
#include "bits/stdc++.h"
//#include "atcoder/all"
#define rep(i,n) for(int i = 0; i < (n); ++i)
using namespace std;
//using namespace atcoder;
typedef long long int ll;
typedef pair<int, int> P;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }

ll memo[90005], num[90005];

int main(){
	cin.tie(0);
	ios::sync_with_stdio(false);
	int h, w, d;
	cin >> h >> w >> d;
	rep(i,h)rep(j,w){
		int a;
		cin >> a;
		num[a] = i * w + j;
	}
	for(int i = 1; i <= h*w; ++i){
		if(i+d <= h*w){
			int y = num[i] / w;
			int x = num[i] % w;
			int ny = num[i+d] / w;
			int nx = num[i+d] % w;
			memo[i+d] = memo[i] + abs(y - ny) + abs(x - nx);
		}
	}
	int q;
	cin >> q;
	rep(qi,q){
		int l, r;
		cin >> l >> r;
		int ans = memo[r] - memo[l];
		cout << ans << endl;
	}
	return 0;
}


Measured memory_bytes: 5056
#include <bits/stdc++.h>
using namespace std;
int dp[50][1000][1000];
int A[100],B[100],C[101];

void Min(int &a,int b){a = min(a,b);}

int main(){
  int n,MA,MB;
  cin>>n>>MA>>MB;
  
  for(int i=0;i<n;i++)cin>>A[i]>>B[i]>>C[i];

  for(int i=0;i<50;i++)
    for(int j=0;j<1000;j++)
      for(int k=0;k<1000;k++) dp[i][j][k] = 1e6;
  
  dp[0][0][0] = 0;

  for(int i=0;i<n;i++)
    for(int j=0;j<500;j++)
      for(int k=0;k<500;k++){
	Min(dp[i+1][j][k],dp[i][j][k]);
	if(j+A[i]>=500||k+B[i]>=500)continue;
	Min(dp[i+1][j+A[i]][k+B[i]],dp[i][j][k]+C[i]);
      }

  int ans=1e9;
  for(int j=1;j<500;j++)
    for(int k=1;k<500;k++){
	int d=__gcd(j,k);
	if(j/d==MA&&k/d==MB) Min(ans,dp[n][j][k]);
    }

  if(ans==1e6) cout<<-1<<endl;
  else cout<<ans<<endl;

  return 0;
}


Measured memory_bytes: 195584
#include<bits/stdc++.h>
#define ll long long
#define ld long double
#define fs first
#define sc second
#define task "test"
using namespace std;
const ll N = 3e3 + 9;
const ll inf = 1e18;
typedef pair<ll,ll> LL;

ll t,n,a,b,c,d;
unordered_map<ll,ll> mp;
ll f(ll n){
    if (n == 0) return 0;
    if (n == 1) return d;
    if (mp.count(n)) return mp[n];
    ll minn = 1e18;
    if (n < minn/d) minn = n*d;
    ll l1,l2,r1,r2,p1,p2;
    l1 = (n/2) * 2;
    l2 = ((n + 1)/2) * 2;
    r1 = (n/3) * 3;
    r2 = ((n + 2)/3) * 3;
    p1 = (n/5) * 5;
    p2 = ((n + 4)/5) * 5;
    minn = min(minn,abs(n - l1)*d + a + f(l1/2));
    minn = min(minn,abs(n - l2)*d + a + f(l2/2));
    minn = min(minn,abs(n - r1)*d + b + f(r1/3));
    minn = min(minn,abs(n - r2)*d + b + f(r2/3));
    minn = min(minn,abs(n - p1)*d + c + f(p1/5));
    minn = min(minn,abs(n - p2)*d + c + f(p2/5));
    return mp[n] = minn;
}
int main(){
    ios_base::sync_with_stdio(0);
    cin.tie(0), cout.tie(0);
    if (fopen(task".inp", "r")){
        freopen(task".inp", "r", stdin);
        //freopen(task".out", "w", stdout);
    }
    cin>>t;
    while(t--){
        mp.clear();
        cin>>n>>a>>b>>c>>d;
        cout<<f(n)<<"\n";
    }
}


Measured memory_bytes: 4168
X, K, D = map(int, input().split())

if X == 0: # Case_1 X = 0
  if K % 2 == 0:
    ans = 0
  else:
    ans = D
else: # Case_2 X != 0 
  if X < 0: # if X < 0, swap the sign of X
    X *= -1
  C = X - K * D
  if C >= 0:
    ans = C
  else: # C ~ ans ~ X
    k = (X - X % D) // D
    if (K - k) % 2 == 0:
      ans = X % D
    else:
      ans = D - X % D
print(ans)

Measured memory_bytes: 9188
#include <iostream>
#include <string>
#include <cstdlib>
#include <cstdio>
#include <queue>
#include <stack>
#include <list>
#include <utility>
#include <vector>
#include <set>
#include <algorithm>
#include <cmath>
#include <climits>
#include <map>
#include <unordered_map>
#include <string.h>
#include<iomanip>
#include <iterator>
#include <locale>

#define all(a) a.begin(),a.end()
#define VV(T) vector<vector< T > >
#define rep(i,N) for(int i = 0; i <N; i++)
#define repsg(i,s,g) for(int i = s; i <g; i++)
#define name(x) #x
using namespace std;


const int INF = 10000000;
const long long INFL = (1LL<<40);
const int MOD = pow(10,9)+7;
int dy[]={0, 0, 1, -1, 0};
int dx[]={1, -1, 0, 0, 0};

typedef long long ll,LL;
typedef vector<int> vint;
typedef vector<vector<int> > vvint;
typedef vector<long long> vll, vLL;
typedef vector<vector<long long> > vvll, vvLL;
typedef pair<int,int> pii;
typedef pair<LL, LL> pLL;


// vector入力
template<typename T>
istream& operator >> (istream& is, vector<T>& vec){
    for(T& x: vec) is >> x;
    return is;
}
// vector出力
template<typename T>
ostream& operator << (ostream& os, vector<T>& vec){
    for(int i=0; i<vec.size(); i++){
        os << vec[i] << ( i+1 == vec.size() ? "" : " " );
    }
    return os;
}

template< typename T >
struct edge{
    int src, to;T cost;
    edge(int to,T cost) :src(-1),to(to),cost(cost){}
    edge(int src, int to, T cost) :src(src),to(to),cost(cost){}edge
    &operator=(const int &x){
        to =x;
        return *this;
    }
    operator int() const{ return to;}
};



int main() {
    int n;cin>>n;vector<int> a(n);cin>>a;
    sort(all(a));
    cout<<a[n-1]-a[0]<<endl;
    return 0;
}





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



int main(){
  int n,j,m,i,max;
  int a[1000];
  while(1){
    max=-1;
    cin >> n >> m;
    if(n==0 && m==0){
      break;
    }
    for(i=0;i<n;i++){
      cin >> a[i];
    }
    for(i=0;i<n;i++){
      for(j=0;j<n;j++){
	if(i==j){
	  continue;
	}
	if(a[i]+a[j]<= m && max < a[i]+a[j]){
	  max=a[i]+a[j];
	}
      }
    }
    if(max==-1){
      cout << "NONE" << endl;
    }else{
      cout << max << endl;
    }
  }
  return 0;
	  
	
	  
    
}



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

int main() {
  int k, i;
  char s[101];
  scanf("%d", &k);
  scanf("%s", s);

  i = 0;
  while(s[i])
    i++;

  if (i <= k)
    printf("%s", s);
  else {
    for (i = 0; i < k; i++) 
      printf("%c", s[i]);
    printf("...");
  }
  return(0);
}

Measured memory_bytes: 1704
#include<bits/stdc++.h>
using namespace std;
static const int64_t mod=1000000007;
int64_t f(int64_t x,int64_t y){
if(y==0)
  return 1;
  else if(y%2==0)
    return (f(x,y/2)*f(x,y/2))%mod;
  else
    return (x*((f(x,y/2)*f(x,y/2))%mod))%mod;
}
int64_t comb(int64_t n,int64_t k){
int64_t a=1;
  for(int64_t i=1;i<=k;i++){
  a=(a*(n+1-i))%mod;
    a=(a*f(i,mod-2))%mod;
  }return a;

}
int main(){
int64_t N,M,K;
  cin>>N>>M>>K;
  int64_t ans=0;
  for(int64_t i=1;i<M;i++)
    ans=(ans+i*(M-i))%mod;
  ans=(((ans*N)%mod)*N)%mod;
  int64_t ans1=0;
  for(int64_t i=1;i<N;i++)
    ans1=(ans1+i*(N-i))%mod;
  ans1=(((ans1*M)%mod)*M)%mod;
  ans=(ans+ans1)%mod;
  ans=(ans*comb(N*M-2,K-2))%mod;
  cout<<ans<<endl;
    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int a[10001];
int main(){
	int n,k;
	cin>>n>>k;
	int i;
	while(n>0){
		for(i=1;i<=k;i++){
			if(n==0) break;
			n--;
			a[i]++;
		}
	}
	int mx=0,mn=1000000;
	for(i=1;i<=k;i++){
		mx=max(a[i],mx);
		mn=min(a[i],mn);
	}
	cout<<abs(mx-mn)<<endl;
}


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

int main()
{
	char tb[9][9];
	for(int i=1; i<=7; i++)
	for(int j=1; j<=6; j++)
		tb[i][j]='a'+(5*(i-1)+j-1);
		
	tb[6][2]='.';
	tb[6][3]='?';
	tb[6][4]='!';
	tb[6][5]=' ';
	
	string b;
	while(cin >> b)
	{
		string res;
		bool g=true;
		if(b.size()%2==1) g=false;
		else
		{
			for(int i=0; i<b.size(); i+=2)
			{
				int f=b[i]-'0', s=b[i+1]-'0';
				if(f<1||f>6||s<1||s>5)
				{
					g=false;
					break;
				}
				res+=tb[f][s];
			}
		}
		
		if(g) cout << res << endl;
		else cout << "NA" << endl;
		
	}
}

Measured memory_bytes: 0
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
//#include <math.h>
//#include <queue>
//#include <stack>
//#include <iomanip>

// sometimes used
//#include <set>
//#include <map>
//#include <numeric>
//#include <list>
//#include <deque>
//#include <unordered_map>

typedef long long LL;
//typedef long double LD;
using namespace std;
 
//#define MOD 1000000007
//#define MOD 998244353
//#define MAX 100100
#define NIL -1
//#define INFTY 1000000000000000000

int main(){
    string s;
    cin >> s;
    vector<vector<LL>> al_list(s.size()+1, vector<LL>(26, 0));
    for(LL i=1; i<=s.size(); i++){
        for(LL j=0; j<26; j++){
            al_list[i][j]=al_list[i-1][j];
        }
        LL tmp=s[i-1]-'a';
        al_list[i][tmp]++;
    }

    bool is_ok;
    LL s_idx=NIL;
    LL e_idx=NIL;

    for(LL i=0; i<s.size(); i++){
        for(LL j=2; j<=3; j++){
            is_ok=false;
            if(i+j>s.size()){
                continue;
            }
            for(LL k=0; k<26; k++){
                if(al_list[i+j][k]-al_list[i][k]>=2){
                    is_ok=true;
                }
            }
            if(is_ok==true){
                s_idx=i+1;
                e_idx=i+j;
                //cout << s_idx << " " << e_idx << endl;
            }
        }
    }

    cout << s_idx << " " << e_idx << endl;

    //for(LL i=0; i<26; i++){
    //    cout << al_list[2][i] << endl;
    //}

    return 0;
}


Measured memory_bytes: 27544
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define ff first
#define ss second
#define endl "\n"
#define all(x) (x).begin(), (x).end()
#define PI 3.1415926535897932384626433832795
int MOD=1e9+7;
int powmod(int a,int l, int md){int res=1;while(l){if(l&1)res=res*a%md;l/=2;a=a*a%md;}return res;}
typedef long long ll; typedef vector<ll> vi; typedef pair<ll, ll> ii; typedef vector<ii> vii;
#define pb push_back
int __set(int b, int i) {return b|(1<<i);} //set ith bit
int __unset(int b, int i) {return b&!(1<<i);}
int __check(int b, int i) {return b&(1<<i);} //returns 0 if ith bit is 0
int mul(int a, int b) {return ((a%MOD)*(b%MOD))%MOD;}
int add(int a, int b) {return (a+b)%MOD;}
int sub(int a, int b) {return (((a-b)%MOD)+MOD)%MOD;}
int __div(int a, int b) {return mul(a, powmod(b, MOD-2, MOD));} //if MOD is prime;
const ll inf = 0xFFFFFFFFFFFFFFFL; //very large number
priority_queue<int, vector<int>, greater<int> > pq; //for min priority_queue
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
clock_t time_p=clock();
void time()
{
    time_p=clock()-time_p;
    cerr<<"Time Taken : "<<(float)(time_p)/CLOCKS_PER_SEC<<"\n";
}

int32_t main(void)
{
	IOS;
	int n; cin>>n;
	vi h(n);
	for(int i = 0; i < n; i++)
		cin>>h[i];
	int dp[n];
	dp[0]=0; dp[1]=abs(h[1]-h[0]);
	for(int i = 2; i < n; i++) {
		dp[i] = min(dp[i-1]+abs(h[i]-h[i-1]), dp[i-2]+abs(h[i]-h[i-2]));
	}
	cout<<dp[n-1]<<endl;
	time();	
	return 0;
}

Measured memory_bytes: 1792
#include <bits/stdc++.h>
using ll = long long;
using namespace std;
#define rep(i,n) for(int i=0, i##_len=(int)(n); i<i##_len; i++)
#define reps(i,n) for(int i=1 , i##_len=(int)(n);i<=i##_len;i++)
#define rrep(i,n) for(int i=((int)(n)-1);i>=0;i--)
#define rreps(i,n) for(int i=((int)(n));i>0;i--)
#define repi(i,x) for(auto i=(x).begin(),i##_fin=(x).end();i!=i##_fin;i++)
#define all(x) (x).begin(), (x).end()
#define F first
#define S second
#define mp make_pair
#define pb push_back
#define solve(a) ((a)?"Yes":"No")
typedef vector<int> Vi;
typedef vector<Vi> VVi;
typedef pair<int , int> Pi;
typedef vector<Pi> VPi;
typedef vector<long long> V;
typedef vector<V> VV;
typedef pair<long long , long long> P;
typedef vector<P> VP;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1;} return 0;}
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1;} return 0;}
const long long INFLL = 1LL<<60;
const int INF = 1<<30;
const double PI=acos(-1);
int main(){
	int h,w;
	cin >>h>>w;
	VVi a(h,Vi(w,0));
	int bef;
	vector<pair<pair<int,int>,pair<int,int>>>ans;
	rep(i,h){
		rep(j,w){
			cin>>bef;
			a[i][j]+=bef;
			if(a[i][j]%2){
				if(j!=w-1){
					ans.push_back(mp(mp(i,j),mp(i,j+1)));
					a[i][j+1]++;
					a[i][j]--;
				}else if(i!=h-1){
					ans.push_back(mp(mp(i, j), mp(i+1, j )));
					a[i+1][j ]++;
					a[i][j]--;
				}
			}
		}
	}
	cout<<ans.size()<<endl;
	rep(i,ans.size()){
		printf("%d %d %d %d\n",1+ans[i].F.F,1+ans[i].F.S,1+ans[i].S.F,1+ans[i].S.S);
	}
}

Measured memory_bytes: 6372
import java.util.*;
public class Main {
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        char a = s.charAt(0);
        char b = s.charAt(1);
        char c = s.charAt(2);
        if(a==b||b==c||c==a){
            System.out.println("No");
        }
        else{
            System.out.println("Yes");
        }
    }
}

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

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

    if (M % 2 != 0){
        if (N % 2 == 0){
            N ++;
        }
        for (int i = N; i <= M; i = i + 2){
            if (M % i == 0){
                cout << M / i << endl;
                return 0;
            }
        }
    }else{
        for (int i = N; i <= M; i++){
            if (M % i == 0){
                cout << M / i << endl;
                return 0;
            }
        }
    }
}


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

using namespace std;

typedef long long ll;

int main(){
	int a,b;
	cin >> a >> b;
	if(a*b %2 == 0)cout << "Even" << endl;
	else cout << "Odd" << endl;

	return 0;
}

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

int main() {
  string S;
  cin >> S;
  vector<char> V(4);
  for (int i = 0; i < 4; i++) {
    V.at(i) = S.at(i);
  }
  sort(V.begin(), V.end());
  if (V.at(0) == V.at(1) && V.at(1) != V.at(2) && V.at(2) == V.at(3)) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
}

Measured memory_bytes: 3628
#include <iostream>
#include <vector>
#include <algorithm>

int main() {
    int N;

    std::cin >> N;
    std::vector<int> V(N), C(N);
    for (int i = 0; i < N; i++) {
        std::cin >> V[i];
    }

    for (int i = 0; i < N; i++) {
        std::cin >> C[i];
    }

    int res = 0;
    for (int i = 0; i < (1 << N); i++) {
        int X = 0, Y = 0;
        for (int j = 0; j < N; j++) {
            if (i >> j & 1) {
                X += V[j];
                Y += C[j];
            }
        }
        res = std::max(res, X - Y);
    }

    std::cout << res << std::endl;
    return 0;
}


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

class Main {
	static Integer n;
	static int cnt;
	public static final int SENTINEL = 1000000001;
    public static void main( String[] args ) {
        try {
	      	BufferedReader kb = new BufferedReader( new InputStreamReader( System.in ) );
			n = Integer.parseInt( kb.readLine() );
			
			ArrayList<Integer> S = new ArrayList<Integer>(n);
			String[] buf = kb.readLine( ).split( " " );
			Integer num;
			for( int i=0; i<n; i++ ) {
				num = Integer.parseInt( buf[i] );
				S.add( num );
			}
			cnt = 0;
			mergeSort( S, 0, n );
			
			StringBuilder output = new  StringBuilder( );
			for( int i=0; i<S.size(); i++ ) {
				output.append( S.get(i) ).append( " " );
			}
			output.deleteCharAt( output.lastIndexOf( " " ) ).append( "\n" );
			output.append( cnt );
			System.out.println( output );            
        } catch( IOException e ) {
            System.err.println( e );
        }
    }
	public static void merge( ArrayList<Integer> S, int left, int mid, int right )
    {
		int n1 = mid - left;
		int n2 = right - mid;
	
		ArrayList<Integer> L = new ArrayList<Integer>(n1);
		ArrayList<Integer> R = new ArrayList<Integer>(n2);
		for( int i=0; i<n1; i++ ) {
		    L.add( S.get( left+i ) );
		}
		for( int i=0; i<n2; i++ ) {
		    R.add( S.get( mid+i ) );
		}
		
		L.add( SENTINEL );
		R.add( SENTINEL );	
		int i, j;
		i = j = 0;
		for( int k=left; k<right; k++ ) {
		    cnt++;
		    if( L.get(i) <= R.get(j) ) {
				S.set( k, L.get( i++ ) );
		    } else {
		        S.set( k, R.get( j++ ) );
		    }
		}	
		return;
    }
	public static void mergeSort( ArrayList<Integer> S, int left, int right )
    {
		if( left+1 < right ) {
			int mid = ( left+right )/2;
			mergeSort( S, left, mid );
			mergeSort( S, mid, right );
			merge( S, left, mid, right );
		}		
		return;
    }
}

Measured memory_bytes: 232584
import java.util.*;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    int count_y = 0;
    for (int i = 0; i < N; i++) {
      String tmp = sc.next();
      if (tmp.charAt(0) == 'Y') {
        count_y++;
      }
    }
    if (count_y > 0) {
      System.out.println("Four");
    } else {
      System.out.println("Three");
    }
  }
}

Measured memory_bytes: 21332
n, m = gets.chomp.split.map(&:to_i)
h = gets.chomp.split.map(&:to_i)

edge = []
m.times do
  a, b = gets.chomp.split.map(&:to_i)
  a -= 1
  b -= 1
  edge.push [a, b]
end

f = Array.new(n, true)

edge.each do |a, b|
  if h[a] > h[b]
    f[b] = false
  elsif h[a] < h[b]
    f[a] = false
  else
    f[a] = f[b] = false
  end
end

puts f.select{ |x| x }.size


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

#define pb push_back
#define mk make_pair
#define lob lower_bound
#define upb upper_bound
#define fst first
#define scd second

typedef unsigned int uint;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> pii;

namespace Fread{
	const int MAXN=1<<20;
	char buf[MAXN],*S,*T;
	inline char getchar(){
		if(S==T){
			T=(S=buf)+fread(buf,1,MAXN,stdin);
			if(S==T)return EOF;
		}
		return *S++;
	}
}
#ifdef ONLINE_JUDGE
	#define getchar Fread::getchar
#endif
inline int read(){
	int f=1,x=0;char ch=getchar();
	while(!isdigit(ch)){if(ch=='-')f=-1;ch=getchar();}
	while(isdigit(ch)){x=x*10+ch-'0';ch=getchar();}
	return x*f;
}
inline ll readll(){
	ll f=1,x=0;char ch=getchar();
	while(!isdigit(ch)){if(ch=='-')f=-1;ch=getchar();}
	while(isdigit(ch)){x=x*10+ch-'0';ch=getchar();}
	return x*f;
}
/*  ------  by:duyi  ------  */ // dysyn1314
const int MAXN=2e5,MOD=924844033,G=5;
inline int mod1(int x){return x<MOD?x:x-MOD;}
inline int mod2(int x){return x<0?x+MOD:x;}
inline int pow_mod(int x,int i){int y=1;while(i){if(i&1)y=(ll)y*x%MOD;x=(ll)x*x%MOD;i>>=1;}return y;}

struct EDGE{int nxt,to;}edge[(MAXN<<1)+5];
int n,head[MAXN+5],tot;
inline void add_edge(int u,int v){edge[++tot].nxt=head[u],edge[tot].to=v,head[u]=tot;}
int sz[MAXN+5],cnt[MAXN+5];
void dfs(int u,int fa){
	sz[u]=1;
	for(int i=head[u];i;i=edge[i].nxt){
		int v=edge[i].to;
		if(v==fa)continue;
		dfs(v,u);
		sz[u]+=sz[v];
		cnt[sz[v]]++;
	}
	if(u!=1)cnt[n-sz[u]]++;
}

int fac[MAXN+5],invf[MAXN+5],f[(MAXN<<2)+5],g[(MAXN<<2)+5],rev[(MAXN<<2)+5];
inline int comb(int n,int k){if(n<k)return 0;else return (ll)fac[n]*invf[k]%MOD*invf[n-k]%MOD;}
void NTT(int *a,int n,int flag){
	for(int i=0;i<n;++i)if(i<rev[i])swap(a[i],a[rev[i]]);
	for(int i=1;i<n;i<<=1){
		int T=pow_mod(G,(MOD-1)/(i<<1));
		if(flag==-1)T=pow_mod(T,MOD-2);
		for(int j=0;j<n;j+=(i<<1)){
			for(int k=0,t=1;k<i;++k,t=(ll)t*T%MOD){
				int Nx=a[j+k],Ny=(ll)a[i+j+k]*t%MOD;
				a[j+k]=mod1(Nx+Ny);
				a[i+j+k]=mod2(Nx-Ny);
			}
		}
	}
	if(flag==-1){
		int inv_n=pow_mod(n,MOD-2);
		for(int i=0;i<n;++i)a[i]=(ll)a[i]*inv_n%MOD;
	}
}
int main() {
	n=read();
	for(int i=1,u,v;i<n;++i)u=read(),v=read(),add_edge(u,v),add_edge(v,u);
	dfs(1,0);
	fac[0]=1;
	for(int i=1;i<=n;++i)fac[i]=(ll)fac[i-1]*i%MOD;
	invf[n]=g[n]=pow_mod(fac[n],MOD-2);
	for(int i=n-1;i>=0;--i)invf[i]=g[i]=(ll)invf[i+1]*(i+1)%MOD;
	for(int i=0;i<=n;++i)f[i]=(ll)fac[n-i]*cnt[n-i]%MOD;
	int lim=1,ct=0;
	while(lim<=n*2)lim<<=1,++ct;
	for(int i=0;i<lim;++i)rev[i]=(rev[i>>1]>>1)|((i&1)<<(ct-1));
	NTT(f,lim,1);NTT(g,lim,1);
	for(int i=0;i<lim;++i)f[i]=(ll)f[i]*g[i]%MOD;
	NTT(f,lim,-1);
	for(int i=1;i<=n;++i){
		printf("%d\n",mod2((ll)comb(n,i)*n%MOD-(ll)invf[i]*f[n-i]%MOD));
	}
	return 0;
}

Measured memory_bytes: 26496
#include<iostream>
#include<cstdio>
#include<cstring>
#include<algorithm>
#include<cmath>
using namespace std;
long long n,a,b;
int main()
{
	scanf("%lld%lld%lld",&n,&a,&b);
	if((a^b)&1)
		printf("%lld\n",min((a+b-1)/2,(n-a+n-b+1)/2));
	else printf("%lld\n",(b-a)/2);
	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <functional>
#include <string>
#include <vector>
#include <utility>
#include <climits>
using namespace std;
#define MAXSIZE 200
#define MAXL 100
typedef long long int lli;

int main(){
    int n, k;
    cin >> n >> k;

    string s;
    cin >> s;

    s[k - 1] += 'a' - 'A';

    cout << s << endl;
    return 0;
}

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

template <typename InputIterator>
typename InputIterator::value_type
summation(InputIterator first, InputIterator last) {
  using T = typename InputIterator::value_type;
  T *p = new T();
  const auto sum = std::accumulate(first, last, *p);
  delete p;
  return sum;
}
template <typename T>
std::istream& operator>> (std::istream &stream, std::vector<T> &v);
template <typename T1, typename T2>
std::istream& operator>> (std::istream &stream, std::pair<T1, T2> &p);
template <typename T>
std::istream& operator>> (std::istream &stream, std::vector<T> &v) {
  for (auto &i : v) {
    stream >> i;
  }
  return stream;
}
template <typename T1, typename T2>
std::istream& operator>> (std::istream &stream, std::pair<T1, T2> &p) {
  stream >> p.first >> p.second;
  return stream;
}

int main() {
  int64_t n;
  std::cin >> n;
  std::vector<std::set<int64_t>> node(n);

  for (int64_t i = 0; i < n - 1; i++) {
    int64_t a, b;
    std::cin >> a >> b;
    a--;
    b--;
    node[a].insert(b);
    node[b].insert(a);
  }

  std::vector<bool> flag(n, false);
  int64_t n1 = 0;
  flag[0] = true;
  std::set<int64_t> q;
  q.insert(0);
  while (!q.empty()) {
    std::set<int64_t> tmp;
    for (const auto i : q) {
      for (const auto j : node[i]) {
        if (!flag[j]) {
          flag[j] = true;
          tmp.insert(j);
          n1 = j;
        }
      }
    }
    std::swap(tmp, q);
  }

  int64_t l = 0;
  q.clear();
  q.insert(n1);
  std::fill(flag.begin(), flag.end(), false);
  flag[n1] = true;
  while (!q.empty()) {
    l++;
    std::set<int64_t> tmp;
    for (const auto i : q) {
      for (const auto j : node[i]) {
        if (!flag[j]) {
          flag[j] = true;
          tmp.insert(j);
          n1 = j;
        }
      }
    }
    std::swap(tmp, q);
  }

  if (l % 3 == 2) {
    std::cout << "Second" << std::endl;
  } else {
    std::cout << "First" << std::endl;
  }
  return 0;
}

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

#define ll long long
#define endl "\n"
#define int ll

signed main ()
{

#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif

	ios_base::sync_with_stdio(false);
	cin.tie(NULL);

	int a, b;
	cin >> a >> b;
	int low = min(100 * a / 8, 100 * b / 10);
	int high = 50000;
	int middle;
	int ans = -1;

	while (low <= high) {
		middle = (low + high) / 2;
		if (middle * 8 / 100 == a and middle * 10 / 100 == b) {
			ans = middle;
			high = middle - 1;
		}
		else if (middle * 8 / 100 > a or middle * 10 / 100 > b) {
			high = middle - 1;
		}
		else low = middle + 1;
	}

	cout << ans << endl;

	return 0;

}


Measured memory_bytes: 3636
#include<iostream>
using namespace std;
int main(){
    int n, a[101];
    cin>>n;
    for(int i=0; i<n; i++) cin>>a[i];
    for(int i=0; i<n; i++) {
        if(i) cout<<" ";
        cout<<a[n-1-i];
    }
    cout<<endl;
}


Measured memory_bytes: 3116
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define REP(i,n) FOR(i,0,n)
#define FOR(i,a,b) for(ll i=a;i<b;i++)
typedef vector<ll> vi;
typedef vector<vector<ll>> vvi;
const ll INF = (1ll << 60);

vector<ll> getPrimes(ll upperBound) {
  bool isPrime[upperBound];
  for (ll i = 0; i < upperBound; i++) isPrime[i] = true;
  for (ll i = 2; i < upperBound; i++) {
    if (isPrime[i]) {
      for (ll j = 2; j * i < upperBound; j++) {
        isPrime[i * j] = false;
      }
    }
  }
  vector<ll> primes;
  for (ll i = 2; i < upperBound; i++) {
    if (isPrime[i]) {
      primes.push_back(i);
    }
  }
  return primes;
}

ll divisibleTimes(ll a, ll b) {
  ll cnt = 0;
  while (a % b == 0) {
    cnt += 1;
    a /= b;
  }
  return cnt;
}

int main(){
  ll n; cin >> n;
  vi a(n); REP(i, n) cin >> a[i];
  vi primes = getPrimes(1000);
  ll ans = 1;
  for (ll prime : primes) {
    ll ma = 0;
    for (ll i : a) ma = max(ma, divisibleTimes(i, prime));
    REP(i, ma) ans *= prime;
  }
  cout << ans << endl;
}

Measured memory_bytes: 3132
#include<stdio.h>

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

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

int main(){
  int N,i,j;
  int A[100];
  scanf("%d",&N);
  for(i=0;i<N;i++) scanf("%d",&A[i]);

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

  return 0;
}
		     



Measured memory_bytes: 2068
import java.util.*;
class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    while(sc.hasNext()) {
     int x = sc.nextInt();
     int y = sc.nextInt();
     if( x == 0 && y == 0 ) {
       break;
     } else {
      System.out.println(Math.min(x, y) + " " + Math.max(x, y));
     }
    }
  }
}


Measured memory_bytes: 35396
#include <iostream>
#include <string>
#include <cmath>
#include <sstream>
#include <iomanip>

using namespace std;

int main(int argc, char* argv[])
{

	double a,b;

	cin >> a >> b;


	cout << (int)ceil((a+b)/2) << endl;


	return 0;

}

Measured memory_bytes: 256