akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
#include <iomanip>
using namespace std;
#define reps(i,s,n) for(int i = s; i < n; i++)
#define rep(i,n) reps(i,0,n)
#define Rreps(i,n,e) for(int i = n - 1; i >= e; --i)
#define Rrep(i,n) Rreps(i,n,0)
#define ALL(a) a.begin(), a.end()
#define fi first
#define se second
#define mp make_pair
typedef long long ll;
typedef vector<ll> vec;
typedef vector<vec> mat;

ll N,M,H,W,K,Q,A,B;
string S;
//const ll MOD = 998244353;
const ll MOD = (1e+9) + 7;
const ll INF = 1LL << 60;
typedef pair<ll,ll> P;

struct edge{
    ll to, cost;
};
vector<vector<edge> > G(100010,vector<edge>(0));
vec score(100010,INF), bip(100010,-1);
ll ng_v = -1, ng_score = INF;
void detS(int v, ll s){
    score[v] = s;
    for(edge e : G[v]){
        if(score[e.to] == INF) {
            detS(e.to, e.cost - s);
        }else if(e.to == ng_v && ng_score == INF && e.cost - s != 0){
            ng_score = e.cost - s;
        }
    }
    return;
}

bool check(){
    rep(i,N){
        for(edge e : G[i]){
            if(score[i] + score[e.to] != e.cost){
                return false;
            }
        }
    }
    return true;
}

bool divide(ll v, ll c){
    bip[v] = c;
    for(edge e : G[v]){
        if(bip[e.to] == -1){
            if(!divide(e.to, c^1)) return false;
        }else if(bip[e.to] == c){
            ng_v = e.to;
            return false;
        }
    }
    return true;
}

int main(){
    cin>>N>>M;
    rep(i,M){
        cin>>A>>B>>K;
        --A, --B;
        edge e;
        e.to = A;
        e.cost = K;
        G[B].push_back(e);
        e.to = B;
        G[A].push_back(e);
    }
    if(divide(0,0)){
        detS(0,0);
        if(check()){
            vec mini(2,INF);
            rep(i,N){
                mini[bip[i]] = min(mini[bip[i]], score[i]);
            }
            cout<<max(0LL, mini[0] + mini[1] - 1)<<endl;
        }else{
            cout<<0<<endl;
        }
    }else{
        detS(ng_v, 0);
        rep(i,N) score[i] = INF;
        detS(ng_v, ng_score/2);
        bool minus = false;
        rep(i,N) if(score[i] <= 0) minus = true;
        cout<<((!minus) && check() ? 1 : 0)<<endl;
    }
}

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

int main(){
  int n,m;
  cin >> n >> m;
  vector<string>word(n);
  for(int i=0;i<n;i++)
    cin >> word.at(i);
  sort(word.begin(),word.end());
  for(int i=0;i<n;i++)
    cout << word.at(i);
  cout << endl;
}

Measured memory_bytes: 3636
import sys

s = input()

a = int(s[0])
b = int(s[1])
c = int(s[2])
d = int(s[3])

ans = a
for i in range(2):
	if i == 0:
		ans += b
		s1 = '+'
	else:
		ans -= b
		s1 = '-'
	for j in range(2):
		if j == 0:
			ans += c
			s2 = '+'
		else:
			ans -= c
			s2 = '-'
		for k in range(2):
			if k == 0:
				ans += d
				s3 = '+'
			else:
				ans -= d
				s3 = '-'
			if ans == 7:
				print(s[0]+s1+s[1]+s2+s[2]+s3+s[3]+"=7")
				sys.exit()
			else:
				if k == 0:
					ans -= d
				else:
					ans += d
		if j == 0:
			ans -= c
		else:
			ans += c
	if i == 0:
		ans -= b
	else:
		ans += b




Measured memory_bytes: 38384
#include<bits/stdc++.h>
using namespace std;
int main(){
    
    int N;
    cin>>N;
    
    vector<string>s(N);
    unordered_map<string,long long>mp(N);
    for(int i=0;i<N;++i){
        cin>>s[i];
        sort(s[i].begin(),s[i].end());
    }
       
    long long sum=0;
    for(int i=0;i<N;++i){
        mp[s[i]]++;
        sum += mp[s[i]]-1;
        }

    cout<<sum<<endl;

}

Measured memory_bytes: 17536
#include<cstdio>
#include<cstring>
#include<algorithm>
#include<cmath>
#include<vector>
#define SF scanf
#define PF printf
#define MAXN 300010
using namespace std;
int tr[MAXN*4],tag[MAXN*4];
int n,h,w,ans;
pair<int,int> a[MAXN],b[MAXN],p[MAXN];
void change(int id,int l,int r,int l1,int r1,int val){
	if(l>=l1&&r<=r1){
		tr[id]+=val;
		tag[id]+=val;
		return ;
	}
	int mid=(l+r)>>1;
	if(l1<=mid)
		change(id*2,l,mid,l1,r1,val);
	if(r1>mid)
		change(id*2+1,mid+1,r,l1,r1,val);
	tr[id]=max(tr[id*2],tr[id*2+1])+tag[id];
}
void work(){
	sort(p+1,p+1+n);
	memset(tr,0,sizeof tr);
	memset(tag,0,sizeof tag);
	int l=0,r=0;
	for(int i=1;i<=n-1;i++){
		if(p[i].second<=h/2){
			int now=i-1;
			while(l>0&&a[l].second<p[i].second){
				change(1,1,n,a[l].first,now,a[l].second-p[i].second);	
				now=a[l].first-1;
				l--;
			}
			if(now!=i-1)
				a[++l]=make_pair(now+1,p[i].second);
		}
		else{
			int now=i-1;
			while(r>0&&b[r].second>p[i].second){
				change(1,1,n,b[r].first,now,p[i].second-b[r].second);
				now=b[r].first-1;
				r--;
			}
			if(now!=i-1)
				b[++r]=make_pair(now+1,p[i].second);
		}
		a[++l]=make_pair(i,0);
		b[++r]=make_pair(i,h);
		change(1,1,n,i,i,h-p[i].first);
		ans=max(tr[1]+p[i+1].first,ans);
	}
}
int main(){
	SF("%d%d%d",&w,&h,&n);
	for(int i=1;i<=n;i++)
		SF("%d%d",&p[i].first,&p[i].second);
	p[++n]=make_pair(0,0);
	p[++n]=make_pair(w,h);
	work();
	for(int i=1;i<=n;i++)
		swap(p[i].first,p[i].second);
	swap(w,h);
	work();
	PF("%d",ans*2);
}

Measured memory_bytes: 16640
#include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<n;i++)
typedef long long ll;
typedef vector<int> vec;
int main(){
  int h1,a1,h2,a2; cin>>h1>>a1>>h2>>a2;
  string s;
  
  rep(i,10000){
  
    h2-=a1;
    if(h2<=0){s="Yes"; break;}
    
    h1-=a2;
    if(h1<=0){s="No"; break;}
  
  }
  
  cout<<s<<endl;
}

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

#define int long long
#define pii pair<int, int>
#define pb push_back
#define vi vector<int>

signed main() {
    ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
    int n;
    cin >> n;
    cout << ((n >= 30) ? "Yes\n" : "No\n");

    return 0;
}



Measured memory_bytes: 3608
def solve():
    N = int(input())
    A = list(map(int,input().split()))

    cnt = [0] * (N+1)
    for i in range(N):
        cnt[A[i]] += 1

    cnt_comb = 0
    for i in range(N+1):
        cnt_comb += calcComb(cnt[i])
    
    for i in range(N):
        print(cnt_comb - (calcComb(cnt[A[i]]) - calcComb(cnt[A[i]]-1)))

def calcComb(n):
    if n == 0:
        return 0
    return (n*(n-1)) // (2*1)
if __name__ == '__main__':
    solve()

Measured memory_bytes: 82640
main(){
  int i=0,n,T,c[1001],t[1001],minc=1001;
  scanf("%d%d",&n,&T);
  for(;i++<n;)scanf("%d%d",&c[i],&t[i]);
  for(i=0;i++<n;)if(t[i]<=T&&c[i]<minc)minc=c[i];
  if(minc==1001)puts("TLE");
  else printf("%d",minc);
}

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

#define fi first
#define se second
#define mp make_pair
#define mt make_tuple
#define pb push_back
#define INF  (1<<30)
#define INFL (1LL<<60)
#define MOD 1000000007
#define EPS ((ld)(1e-9))

#define sz(x) ((int)(x).size())
#define setz(x) memset(x, 0, sizeof(x))
#define rep(i, x)  for (int i = 0, _##i = (x); i < _##i; i++)
#define repp(i, x) for (int i = 1, _##i = (x); i <= _##i; i++)
#define repr(i, s, e) for (int i = (s), _##i = (e); i < _##i; i++)

#define L(x) ((x)*2)
#define R(x) ((x)*2+1)

using namespace std;

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

template<typename T, typename V>
ostream &operator<<(ostream &os, const pair<T, V> pai) { 
    os << pai.first << ' ' << pai.second;
	return os;
}

template<typename T>
ostream &operator<<(ostream &os, const vector<T> v) {
    rep(i, sz(v)) cout << v[i] << ' ';
    return os;
}

template<typename T, typename V>
istream &operator>>(istream &is, pair<T, V> &pai) {
	is >> pai.first >> pai.second;
	return is;
}

int N, A[100000];

vector<ll> pl, mi;
int main(void) {
    iostream::sync_with_stdio(false);
    cin.tie(nullptr), cout.tie(nullptr);
    
    cin >> N;
    rep(i, N) cin >> A[i];
    rep(i, N) {int t; cin >> t; A[i] -= t;}

    rep(i, N) {
        if (A[i] > 0) pl.pb(A[i]);
        if (A[i] < 0) mi.pb(A[i]);
    }

    ll s = 0;
    int t = 0;

    for (ll c : mi) s += c, t++;
    sort(pl.begin(), pl.end(), greater<ll>());

    for (auto p = pl.begin(); p != pl.end() and s < 0; p++) {
        t++;
        s += *p;
    }

    if (s < 0) cout << -1;
    else cout << t;
}

Measured memory_bytes: 1784
class Counter:
  def __init__(self):
    self.v = 0

  def increment(self):
    self.v += 1


H, W = map(int, input().strip().split())

M = [None] * H
MX = [None] * H
MY = [None] * H

for i in range(H):
  M[i] = [c == '.' for c in input().strip()]
  MX[i] = [None] * W
  MY[i] = [None] * W

max_size = 0

for i in range(H):
  for j in range(W):
    if not M[i][j]: continue

    if MX[i][j] is None:
      tmp = Counter()
      for x in range(j, W):
        if not M[i][x]: break
        MX[i][x] = tmp
        tmp.increment()

    if MY[i][j] is None:
      tmp = Counter()
      for y in range(i, H):
        if not M[y][j]: break
        MY[y][j] = tmp
        tmp.increment()

    size = MX[i][j].v + MY[i][j].v - 1
    max_size = max(max_size, size)

print(max_size)

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

#define REP(i, x, n) for (int i = x; i < (int)(n); i++)
#define rep(i, n) REP (i, 0, n)
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define sz(x) (int)(x.size())
#define popcount(x) __builtin_popcount(x)
#define popcountll(x) __builtin_popcountll(x)
#define uniq(x) x.erase(unique(x.begin(), x.end()), x.end())
#define F first
#define S second
#define mp make_pair
#define eb emplace_back

using namespace std;

typedef long long ll;

// const int INF = 1 << 30;
// const ll INF = 1LL << 60;
const int MOD = 1000000007;

int main() {
  int n;
  cin >> n;
  string s1, s2;
  cin >> s1 >> s2;

  ll ans = 1;
  rep (i, n) {
    if (s1[i] == s2[i]) {
      if (i == 0) {
        ans = 3;
      } else if (s1[i - 1] == s2[i - 1]) {
        ans = ans * 2 % MOD;
      }
    } else {
      if (i == 0) {
        ans = 6;
      } else if (s1[i - 1] == s2[i - 1]) {
        ans = ans * 2 % MOD;
      } else {
        ans = ans * 3 % MOD;
      }
      i++;
    }
  }

  cout << ans << endl;
}


Measured memory_bytes: 256
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>

int main(void){
	int n,m,a[10000];
	int i;
	long long int sum=0;

	scanf("%d %d",&n,&m);
	for(i=0;i<m;i++){
		scanf("%d",&a[i]);
		sum+=a[i];
	}
	if(sum<=n){
		printf("%lld",n-sum);
	}else{
		printf("-1");
	}
	return 0;
}


Measured memory_bytes: 1756
n = gets.to_i
abs = n.times.map { gets.split.map(&:to_i) }.sort_by { |a, b| [b, a] }

ans = "Yes"
t = 0

abs.each do |a, b|
  t += a
  if t > b
    ans = "No"
    break
  end
end

puts ans


Measured memory_bytes: 27000
#pragma GCC optimize(2)
#include<bits/stdc++.h>
#define ll long long
#define maxn 300005
#define inf 1e9
#define pb push_back
#define rep(i,a,b) for(int i=a;i<=b;i++)
#define per(i,a,b) for(int i=a;i>=b;i--)
using namespace std;

inline ll read()
{
	ll x=0,w=1; char c=getchar();
	while(c<'0'||c>'9') {if(c=='-') w=-1; c=getchar();}
	while(c<='9'&&c>='0') {x=(x<<1)+(x<<3)+c-'0'; c=getchar();}
	return w==1?x:-x;
}

ll n,a[maxn],b[maxn],dp[520][maxn],L;

inline ll sol(int u,ll nw)
{
	if(u<=512) return dp[u][nw]; ll tmp=0;
	if(nw>=b[u]) tmp=max(tmp,sol(u/2,nw-b[u])+a[u]);
	tmp=max(tmp,sol(u/2,nw)); return tmp;
}

int main()
{
	n=read(); rep(i,1,n) a[i]=read(),b[i]=read(); L=1e5;
	rep(i,1,512)
	{
		rep(j,1,L) dp[i][j]=dp[i/2][j];
		per(j,L,b[i]) dp[i][j]=max(dp[i][j],dp[i][j-b[i]]+a[i]);
	}
	int Q=read();
	while(Q--)
	{
		int v=read(),l=read();
		printf("%lld\n",sol(v,l));
	}
	return 0;
}

Measured memory_bytes: 409932
#include<stdio.h>

int main(void)
{
    int n,a,b;

    scanf("%d %d %d\n", &n, &a, &b);


    if( n*a < b )
    {
        printf("%d\n", (n*a));
    }
    else
    {
        printf("%d\n", b);
    }
    
    return 0;
}


Measured memory_bytes: 128
from collections import deque

N, M = map(int, input().split())
g = {i:set() for i in range(N)}
v = [-1 for i in range(N)]
for _ in range(M):
  a, b = map(int, input().split())
  a, b = a-1, b-1
  g[a].add(b)
  g[b].add(a)

Q = deque()
ans = 0
for a in g:
  if v[a]==-1:
    v[a] = 1
    ans_tmp = 1
    Q.append(a)
    while len(Q)>0:
      na = Q.popleft()
      for nb in g[na]:
        if v[nb] == -1:
          v[nb] = 1
          ans_tmp += 1
          Q.append(nb)
    ans = max(ans, ans_tmp)
print(ans)


Measured memory_bytes: 158840
N, M = map(int, input().split())

left_max, right_min = map(int, input().split())
for m in range(M-1):
    L, R = map(int, input().split())
    left_max = max(L, left_max)
    right_min = min(R, right_min)

if left_max <= right_min:
    print(right_min-left_max+1)
else:
    print(0)


Measured memory_bytes: 44264
#include<iostream>
#include<algorithm>
using namespace std;
int main(){
 int a,b,c,d;
 cin>>a>>b>>c>>d;

 if(a>=d||b<=c)cout<<0<<endl;
 else{
  int t= min({b,d})-max({a,c});
  cout<<t<<endl;
 }
}

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

int main(){
	const int MAX_N = 100;
	int N, A, B, C, D[MAX_N];
	int cal, val, res;
	
	scanf("%d", &N);
	scanf("%d%d", &A, &B);
	scanf("%d", &C);
	for(int i = 0; i < N; i++){
		scanf("%d", &D[i]);
	}
	
	sort(D, D + N, greater<int>());
	cal = C; val = A; res = C / A;
	for(int i = 0; i < N; i++){
		cal += D[i]; val += B;
		res = max(res, cal / val);
	}
	
	printf("%d\n", res);
	
	return 0;
}

Measured memory_bytes: 1040
using System;

class program{
  static void Main(){
    
    var input=Console.ReadLine();
    
    switch(input){
      case "a":
      case "i":
      case "u":
      case "e":
      case "o":
        {Console.WriteLine("vowel");
        break;}
      default:
        {Console.WriteLine("consonant");
        break;}
    }
  }
}
        

Measured memory_bytes: 13140
def main():
    x, y = map(int, input().split())

    money = 0

    if x == 3:
        money += 100000
    elif x == 2:
        money += 200000
    elif x == 1:
        money += 300000

    if y == 3:
        money += 100000
    elif y == 2:
        money += 200000
    elif y == 1:
        money += 300000

    if x == 1 and y == 1:
        money += 400000

    print(money)


if __name__ == "__main__":
    main()


Measured memory_bytes: 61936
import java.util.Scanner;

public class Main {

	static int h,s,m;
	public static void main(String[] args) {
		Scanner cin = new Scanner(System.in);
		while(true){
			int hour =cin.nextInt();
			int season =cin.nextInt();
			int minute =cin.nextInt();
			if(hour+season+minute==-3){
				break;
			}
			h=2;
			s=0;
			m=0;
			minute(minute);
			season(season);
			hour(hour);
			System.out.println(String.format("%1$02d", h)+":"+
					String.format("%1$02d", s)+":"+
					String.format("%1$02d", m));
			h=6;
			s=0;
			m=0;
			minute(minute);
			season(season);
			hour(hour);
			minute(minute);
			season(season);
			hour(hour);
			minute(minute);
			season(season);
			hour(hour);
			System.out.println(String.format("%1$02d", h)+":"+
					String.format("%1$02d", s)+":"+
					String.format("%1$02d", m));
			
		}
	}
	static void minute(int minute){
		m=m-minute;
		if(m<0){
			season(1);
			m = 60+m;
		}
	}
	static void season(int season){
		s = s-season;
		if(s<0){
			hour(1);
			s = 60+s;
		}
	}
	static void hour(int hour){
		h = h-hour;
		
	}
}

Measured memory_bytes: 12000
# -*- coding: utf-8 -*-
# 
import math
import sys
import itertools
import numpy as np

# 
sumo = list(input())
lose = 0
for i in range(len(sumo)):
    if sumo[i] == 'x':
        lose += 1
if lose >= 8:
    print("NO")
else:
    print("YES")





Measured memory_bytes: 12408
n, k = map(int, input().split())
s = [0]*(n+1)

for i in range(k):
    d = int(input())
    a = list(map(int,input().split()))
    for j in range(d):
        s[a[j]] += 1

cnt = 0        
for k in range(1,n+1):
    if s[k] == 0:
        cnt += 1
        
print(cnt)
    

Measured memory_bytes: 67716
#include<iostream>
#include<algorithm>
#include<string>
#include<vector>
#include<cstdlib>
#include<queue>
#include<set>
#include<cstdio>

using namespace std;

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

typedef vector<int> vec;
typedef vector<vec> mat;

const ll mod = 1000000007;

mat mul(mat &A, mat &B){
    mat C(A.size(), vec(B[0].size()));
    for (int i = 0; i < A.size(); i++){
        for (int k = 0; k < B.size(); k++){
            for (int j = 0; j < B[0].size(); j++){
                C[i][j] = (C[i][j] + A[i][k] * B[k][j]) % mod;
            }
        }
    }
    return C;
}

mat pow(mat A, ll n){
    mat B(A.size(), vec(A.size()));
    for (int i = 0; i < A.size(); i++){
        B[i][i] = 1;
    }
    while(n > 0){
        if(n & 1) B = mul(B, A);
        A = mul(A, A);
        n >>= 1;
    }
    return B;
}

int main(){
    ll w, h, x, y;
    cin >> w >> h >> x >> y;
    double ans;
    if((2 * x) == w && (2 * y) == h){
        ans = (double)(w * h);
        ans /= 2;
        printf("%.10lf 1\n", ans);

        // cout << " " << 1 << endl;
    }else{
        ans = (double)(w * h);
        ans /= 2;
        printf("%.10lf 0\n", ans);
        // cout << " " << 0 << endl;
    }
}

Measured memory_bytes: 3736
#include <bits/stdc++.h>
#define Rep(i,n) for(int i=0;i<n;i++)
#define Repr(i,n) for(int i=n;i>=0;i--)
#define For(i,m,n) for(int i=m;i<n;i++)
#define Inf 1LL<<60
#define All(v) v.begin(),v.end()
#define Mod (ll)(1e9+7)
using namespace std;
typedef long long ll;

int main()
{
    ll n,ans,tmp10=1,tmp9=1,tmp8=1;
    cin>>n;
    if(n<=1){
        ans=0;
    }else if(n==2){
        ans=2;
    }else{
        Rep(i,n){
            tmp10*=10;
            tmp9*=9;
            tmp8*=8;
                tmp10%=1000000007;
                tmp9%=1000000007;
                tmp8%=1000000007;
                //cout<<tmp10<<" "<<tmp9<<" "<<tmp8<<endl;
        }
        ans=tmp10-tmp9-tmp9+tmp8;
        while(ans<0) ans+=1000000007;
    }
    cout<<ans<<endl;
    return 0;
}

Measured memory_bytes: 3596
/* ---------- STL Libraries ---------- */
// IO library
#include <cstdio>
#include <fstream>
#include <iomanip>
#include <ios>
#include <iostream>

// algorithm library
#include <algorithm>
#include <cmath>
#include <numeric>
#include <random>

// container library
#include <array>
#include <bitset>
#include <deque>
#include <map>
#include <unordered_map>
#include <queue>
#include <set>
#include <string>
#include <tuple>
#include <vector>

/* ---------- Namespace ---------- */
using namespace std;

/* ---------- Type ---------- */
using ll = long long;
#define int ll
#define P pair<ll, ll>

/* ---------- Constants  */
const ll MOD = 1e9 + 7;
const int INF = 1LL << 55;

/* v-v-v-v-v-v-v-v-v Main Part v-v-v-v-v-v-v-v-v */
signed main() {
    int arr[4];
    for (int i = 0; i < 4; i++) cin >> arr[i];
    sort(arr, arr + 4);

    if (arr[0] == 1 && arr[1] == 4 && arr[2] == 7 && arr[3] == 9) {
        cout << "YES" << endl;
    } else {
        cout << "NO" << endl;
    }
    return 0;
}

Measured memory_bytes: 256
#include<iostream>
using namespace std;
int main(){
	string s;
	cin>>s;
	string tmp = "CODEFESTIVAL2016";
	int cnt = 0;
	for(int i = 0;i < s.size();i++){
		if(s[i] != tmp[i])cnt++;
	}
	cout << cnt << endl;
 
}

Measured memory_bytes: 256
j;i;k;t;main(n){int c[501],f[500],s[500];
for(scanf("%d",&n);k<n-1;k++)scanf("%d%d%d",&c[k],&s[k],&f[k]);
for(;i<n-1;i++){t=0;for(j=i;j<n-1;j++)if(t>s[j])t=s[j]+c[j]+ceil((double)(t-s[j])/f[j])*f[j];else t=s[j]+c[j];
printf("%d\n",t);}puts("0");}

Measured memory_bytes: 1700
#include <iostream>
#include <iomanip>
#include <string>
#include <algorithm>
#include <vector>
#include <cmath>
#include <math.h>
#include <list>
#include <stack>
#include <queue>
#include <utility>

using namespace std;

#define ll long long
#define ld long double
#define MOD 1000000007
#define rep(i, n) for(int i = 0;i < n;i++)
#define PI 3.14159265358979323846

int main()
{
    vector<string> vc;

    vc.push_back("SUN");
    vc.push_back("MON");
    vc.push_back("TUE");
    vc.push_back("WED");
    vc.push_back("THU");
    vc.push_back("FRI");
    vc.push_back("SAT");

    string temp;
    cin >> temp;
    int i = 0;
    while(vc[i] != temp)
    {
        i++;
    }
    cout << 7-i << endl;

}

Measured memory_bytes: 256
#include<iostream>
#include<cmath>
float a,b,x,y,p=6*asin(0.5),d=90;int main(){for(;(std::cin>>a).ignore()>>b,a||b;){x+=a*cos(d*p/180.f);y+=a*sin(d*p/180.f);d-=b;}printf("%d\n%d\n",int(x),int(y));}

Measured memory_bytes: 0
from sys import stdin
from collections import deque
n = int(input())
d = [-1] * (n + 1)
G = [0] + [list(map(int, input().split()[2:])) for _ in range(n)]
d[1] = 0
dq = deque([1])
while len(dq) != 0:
    v = dq.popleft()
    for c in G[v]:
        if d[c] == -1 :
            d[c] = d[v] + 1
            dq.append(c)
for i in range(1, n + 1):
    print(i, d[i])

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

#define scd second
#define fst first
#define pb push_back
#define mkp make_pair
#define all(x) x.begin(), x.end()

using namespace std;

typedef long long int ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef vector<int> vint;
typedef vector<ll> vlong;
typedef vector<pii> vpii;
typedef vector<pll> vpll;
typedef vector<vint> vvint;
typedef vector<vlong> vvlong;
typedef list<int> lint;
typedef list<ll> llong;
typedef list<pii> lpii;
typedef list<pll> lpll;
typedef list<lint> llint;
typedef list<llong> lllong;

int const N=1e6+100;
ll const LINF=numeric_limits<long long int>::max();
int const INF=numeric_limits<int>::max();
int const BN = 31;

ll gcd(ll a, ll b){
	return b ? gcd(b,a%b) : a;
}

ll pow_mod(ll a, ll e, ll m){
	ll res=1;
	while(e){
		if(e&1) res=res*a%m;
		a=a*a%m;
		e>>=1;
	}
	return res;
}

ll inv_mod(ll b, ll m){
	b%=m;
	ll x=0, y=1, r, q, a=m;
	while(b){
		q=a/b;
		r=a%b;
		a=b;
		b=r;
		r=x;
		x=y;
		y=r-q*y;
	}
	x+=m;
	return x%m;
}

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

	int n;
	cin>>n;
	double s=0;
	for(int i=0; i<n; i++){
		double a;
		cin>>a;
		s+=1/a;
	}
	cout<<fixed<<setprecision(6)<<1/s<<endl;
}

Measured memory_bytes: 256
N, M = gets.split.map &:to_i
A = N.times.map{gets.to_i}
B = M.times.map{gets.to_i}

n = (0...N).map{|i| [0, i + 1]}
B.each do |b|
  n[A.index{|i| i <= b}][0] += 1
end

p n.sort{|a, b| a[0] <=> b[0]}.last[1]

Measured memory_bytes: 8776
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define all(a) (a).begin(),(a).end()
using namespace std;
using ll = long long int;
using vec = vector<int>;
using P = pair<int,int>;
const int INF = 1e9+7;

int main() {
  string s; cin >> s;
  int n = s.size();
  if (s[n-1] != 's') {
    cout << s << 's' << endl;
  } else {
    cout << s << "es" << endl;
  }
}


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

int main(int argc, char const *argv[])
{
    int64_t x, k, d, a;
    cin >> x >> k >> d;
    x = x > 0 ? x : x * (-1);

    if ((a = k - x / d) <= 0) {
        cout << x - k*d;
    } else {
        x -= x/d * d;
        if (a % 2 == 0) cout << x;
        else cout << (-1) * (x - d);
    }

    return 0;
}


Measured memory_bytes: 3192
#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
const int INF = 1e9;
const ll LINF = 1e18;
inline ll gcd(ll a, ll b) { return b ? gcd(b, a%b) : a; }
inline ll lcm(ll a, ll b) { return a / gcd(a, b)*b; }
template<class S,class T> ostream& operator << (ostream& out,const pair<S,T>& o){ out << "(" << o.first << "," << o.second << ")"; return out; }
template<class T> ostream& operator << (ostream& out,const vector<T>& V){ for(int i = 0; i < V.size(); i++){ out << V[i]; if(i!=V.size()-1) out << " ";} return out; }
template<class T> ostream& operator << (ostream& out,const vector<vector<T> >& Mat){ for(int i = 0; i < Mat.size(); i++) { if(i != 0) out << endl; out << Mat[i];} return out; }
template<class S,class T> ostream& operator << (ostream& out,const map<S,T>& mp){ out << "{ "; for(auto it = mp.begin(); it != mp.end(); it++){ out << it->first << ":" << it->second; if(mp.size()-1 != distance(mp.begin(),it)) out << ", "; } out << " }"; return out; }
template<typename T>vector<T> make_v(size_t a){return vector<T>(a);}
template<typename T,typename... Ts>auto make_v(size_t a,Ts... ts){return vector<decltype(make_v<T>(ts...))>(a,make_v<T>(ts...));}
template<typename T,typename V> typename enable_if<is_class<T>::value==0>::type fill_v(T &t,const V &v){t=v;}
template<typename T,typename V> typename enable_if<is_class<T>::value!=0>::type fill_v(T &t,const V &v){for(auto &e:t) fill_v(e,v);}
/*
 <url:https://atcoder.jp/contests/abc147/tasks/abc147_b>
 問題文============================================================
 B - Palindrome-philia
 =================================================================
 解説=============================================================
 ================================================================
 */

template<class Type>
Type solve(Type res = Type()){
    string S; cin >> S;
    for(int i = 0; i < S.length()/2; i++){
        res += S[i] != S[S.length()-1-i];
    }
    return res;
}
int main(void) {
    cin.tie(0); ios_base::sync_with_stdio(false);
    // solve(0);
    cout << fixed << setprecision(15) << solve<ll>() << endl;
    return 0;
}


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

using namespace std;

int main()
{
  int n;
  string s;
  cin >> n >> s;
  int cnt = 0;
  for(int i = 0; i < n; i++)
  {
  	if(s[i] == 'A' and s[i + 1] == 'B' and s[i + 2] == 'C')
  	{
  		cnt++;
  	}
  }
  cout << cnt << endl;
  return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<n;i++)
#define all(x) (x).begin(),(x).end()
using namespace std;
const int INF=1145141919,MOD=1e9+7;
const long long LINF=8101145141919364364;

int main(){
	string s; cin>>s;
	int n=s.size();
	if(n==2){
		if(s[0]==s[1]){
			cout<<"1 2"<<endl;
			return 0;
		}
	}else{
		for(int i=0;i<n-2;i++){
			if(s[i]==s[i+1]||s[i]==s[i+2]||s[i+1]==s[i+2]){
				cout<<i+1<<" "<<i+3<<endl;
				return 0;
			}
		}
	}
	cout<<"-1 -1"<<endl;
	return 0;
}


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

using ll = long long;

#define REP(i, n) for (int i = 0; i < n; i++)
#define REPR(i, n) for (int i = n; i >= 0; i--)
#define FOR(i, m, n) for (int i = m; i < n; i++)
#define pb push_back
#define mp make_pair
#define fill(x, y) memset(x, y, sizeof(x))
#define even(x) x % 2 == 0
#define odd(x) x % 2 != 0
#define all(x) x.begin(), x.end()
#define pcnt __builtin_popcount
#define buli(x) __builtin_popcountll(x)
#define F first
#define S second
#define UNIQUE(v) v.erase(unique(v.begin(), v.end()), v.end());

// these functions return the position of result of Binary Search.
#define LB(s, t, x) (int) (lower_bound(s, t, x) - s)
#define UB(s, t, x) (int) (upper_bound(s, t, x) - s)

ll qp(ll a, ll b, int mo) { ll ans = 1; do { if (b & 1) ans = 1ll * ans * a % mo; a = 1ll * a * a % mo; } while (b >>= 1); return ans; }
ll gcd(ll a, ll b) { return b ? gcd(b, a % b) : a; }
int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};
int dx8[] = { 1, -1, 0, 0, 1, 1, -1, -1 };
int dy8[] = { 0, 0, -1, 1, -1, 1, -1, 1 };

template <typename T>
vector<T> make_v(size_t a) { return vector<T>(a); }
template <typename T, typename... Ts>
auto make_v(size_t a, size_t b, Ts... ts) { return vector<decltype(make_v<T>(b, ts...))>(a, make_v<T>(b, ts...)); }
template <typename T, typename V>
typename enable_if<is_class<T>::value == 0>::type
fill_v(T &t, const V &v) { t = v; }
template <typename T, typename V>
typename enable_if<is_class<T>::value != 0>::type
fill_v(T &t, const V &v) { for (auto &e : t) fill_v(e, v); }
// auto dp = make_v<int>(4, h, w);
// fill_v(dp, 0);

const ll INF_LL = (1ll << 60);
const int INF_INT = (int)1e9;
const ll MOD_CONST = (ll)(1e9 + 7);

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

inline tuple<ll, ll> rotate45(tuple<ll, ll> p) { ll x = get<0>(p), y = get<1>(p); return tuple<ll, ll>(x + y, x - y); }
inline bool rangeCheck2D(int nx, int ny, int Width, int Height) { return nx >= 0 and nx < Width and ny >= 0 and ny < Height; }

int main(void)
{
	cin.tie(0); ios::sync_with_stdio(0); cout << fixed << setprecision(20);

	ll N, C, K; cin >> N >> C >> K;
	vector<ll> p(N);
	REP(i, N) cin >> p[i];
	sort(all(p));
	ll ans = 0, start, cnt = 0;
	if (C == 1) {
		cout << N << endl;
		return 0;
	}
	REP(i, N) {
		if (cnt == 0) {
			start = p[i];
			cnt = 1;
		} else if (p[i] - start <= K) {
			cnt++;
			if (cnt == C) {
				ans++;
				cnt = 0;
			}
		} else {
			cnt = 1;
			ans++;
			start = p[i];
		}
	}
	cout << ans+1 << endl;


	return 0;
}


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

ll gcd(ll a,ll b){
  if(b == 0) return a;
  return gcd(b, a % b);
}
const ll p =  1000000007;
ll factorial(ll n){
   ll ans = 1;
   for(int i = n;i>=1;i--){
     ans *= i;
     ans %= p;
   }
   return ans;
}
using Graph = vector<vector<int>>;

ll kzyou(ll a,ll k){//aのk乗を返す
    ll zyou = 1;
    for(ll i = 1;i<=k;i++){
        zyou *= a;
    }
    return zyou;
}

int main(){
  int N;
  cin >> N;
  vector<int> X(N);
  rep(i,N){
    cin >> X[i];
  }
  sort(X.begin(),X.end());
  
  ll ans = p;

  for(int P = X[0];P <= X[N-1];P++){
    ll sum = 0;
    for(int i = 0;i<N;i++){
      sum += (X[i] - P) * (X[i] - P);
    }
    ans = min(ans,sum);
  }
  cout << ans << endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <typeinfo>
#include <cxxabi.h>
#ifdef LOCAL
  #include "dbgtoki.hpp"
  #define DUMP(i) dump((string)TOSTRING(i), demangle(typeid(i).name()), __LINE__ , i) 
DbgTimer D_t;
  #define TSTART() D_t.start()
  #define TSTOP() D_t.stop()
#else
  #define DUMP(i) 
  #define TSTART()
  #define TSTOP()  
#endif
 
#define TOSTRING(x) #x
#define SZ(x) (int)(x).size()
#define REP(i,n) for(int i=0;i<(n);i++)
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define ALL(s) (s).begin(), (s).end()
#define UNIQUE(v) v.erase( unique(v.begin(), v.end()) , v.end());

using namespace std;
typedef long long unsigned int llu;
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vll;

const int EPS = 1e-9;



int main (){
  cin.tie(0);
  ios::sync_with_stdio(false);
  string s;
  while(cin >> s){
    TSTART();
    REP(i,SZ(s)){
      if(i % 2 == 0)cout << s[i];
    }
    
    cout << endl;
    TSTOP();
  }
  return 0;
}



Measured memory_bytes: 592
import sys

if __name__ == "__main__":
    A = int(input())
    B = int(input())
    C = int(input())
    X = int(input())
    pattern = 0

    for i in range(A+1):
        for j in range(B+1):
            for k in range(C+1):
                tmp = i * 500 + j * 100 + k * 50
                if tmp == X: pattern += 1
    print(pattern)

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

int main()
{
 int n,k;
 cin >> n >> k;
 int price[n];
 for(int i=0;i<n;i++)
 {
     cin >> price[i];
 }
 sort(price,price+n);
 int cost=0;
 for(int j=0;j<k;j++)
 {
     cost = cost+price[j];
 }
 cout << cost;
     return 0;
}

Measured memory_bytes: 3572
#include<iostream>
#include<vector>
#include<string>
#include<climits>
#include<algorithm>
#include<cmath>
#include<iomanip>
#include<set>
#include<queue>

int main(){
	long long w, h, x, y;
	std::cin>>w>>h>>x>>y;

	double s= (double)w * (double)h / 2.0 ;

	bool isCenterW= (2*x==w);
	bool isCenterH= (2*y==h);

	int ans;

	if(isCenterW && isCenterH)
		ans= 1;
	else
		ans= 0;

	std::cout<<s<<" "<<ans<<std::endl;

	return 0;
	
}

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

int main() {
    int N;
    cin >> N;
    long int pwr = 1;
    int s = 1000 * 1000 * 1000 + 7;
    for (int i = 1; i <= N; ++i){
        pwr *= i;
        while (pwr >= s){
            pwr = pwr % s;
        }
    }
    cout << pwr << endl;
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); i++)
#define chmin(x, y) x = min(x, y)
#define chmax(x, y) x = max(x, y)
using namespace std;
typedef pair<int, int> P;
typedef long long ll;
int main() {
  int N; cin >> N;
  vector<pair<int, int>> p;
  rep(i, N) {
       int b, c; cin >> b >> c;
       p.push_back(make_pair(c, b));
  }
sort(p.begin(), p.end());

  int pos = 0;
bool f = true;
rep(i, N) {pos += p[i].second;
     if(p[i].first>=pos) continue;
     else {f=false; cout << "No" << endl; break;
          } 
}
if(f) cout << "Yes" << endl;
}

Measured memory_bytes: 2420
#include <iostream>                                                             
#include <cmath>                                                                
using namespace std;                                                            
                                                                                
int main (void) {                                                               
  double x1, y1, x2, y2;                                                        
  double xdiff;                                                                 
  double ydiff;                                                                 
  double R=0;                                                                   
  cin >> x1 >> y1 >> x2 >> y2;                                                  
  xdiff = x2-x1;                                                                
  ydiff = y2-y1;                                                                
                                                                                
  R = sqrt(pow(xdiff,2)+pow(ydiff,2));                                          
  cout << fixed;                                                                
  cout.precision(8);                                                            
  cout << R << endl;                                                            
}                                                                               
                             

Measured memory_bytes: 3260
#include<bits/stdc++.h>
using namespace std;
void serch(int n,int now)
{
    n*=n;
    int random=(n%1000000/100);
    cout<<random<<endl;
    if(now<10)serch(random,now+1);
}
int main()
{
    int n;
    cin>>n;
    for(int i=1;i<=n;i++){
        int num;
        cin>>num;
        cout<<"Case "<<i<<':'<<endl;
        serch(num,1);
    }
}

Measured memory_bytes: 1160
#include<bits/stdc++.h>
using namespace std;
using i64 = int_fast64_t;
#define rep(i, N) for(i64 i = 0; i < N; i++)
#define Rep(i, k, N) for(i64 i = k; i < N; i++)
#define all(v) v.begin(), v.end()
#define eb emplace_back
#define Cout(s) cout << s << endl
string Yes(bool b) {if(b){return "Yes";} else {return "No";}}
string YES(bool b) {if(b){return "YES";} else {return "NO";}}

int main(){
    i64 N;
    cin >> N;
    vector<i64> A(N+1, 0), sum(N+1, 0);
    rep(i, N) cin >> A[i];

    sort(all(A));
    Rep(i, 1, N+1) sum[i] = sum[i-1] + A[i];

    auto check = [&](int mid) -> bool {
        while(mid <= N && A[mid+1] <= 2*sum[mid]) mid++;
        return mid == N+1;
    };

    int ok = N+1, ng = 0;
    while(ok - ng > 1){
        int mid = (ok + ng) / 2;

        if(check(mid) == 1) ok = mid;
        else ng = mid; 
    } 

    cout << N - ng << endl;
}


Measured memory_bytes: 1792
N,M = map(int,input().split())
X = list(map(int,input().split()))
X.sort(reverse=True)
a = [0 for i in range(M)]
for i in range(1,M):
    a[i-1] = X[i-1]-X[i]
a.sort(reverse=True)
print(sum(a[N-1:]))

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

int main()
{
    string s;
    cin >> s;
    int n = 4;
    vector<int> sint(n);
    string op[n - 1];

    for (int i = 0; i < n; i++)
    {
        sint.at(i) = s.at(i) - '0';
    }

    for (int bit = 0; bit < (1 << (n - 1)); bit++)
    {
        int t = sint[0];
        int total = t;
        for (int i = 0; i < n - 1; i++)
        {
            if (bit & (1 << i))
            {
                t = sint[i + 1];
                total += t;
                op[i] = '+';
            }
            else
            {
                t = sint[i + 1];
                total -= t;
                op[i] = '-';
            }
        }
        if (total == 7)
        {
            cout << sint[0] << op[0] << sint[1] << op[1] << sint[2] << op[2] << sint[3] << "=7" << endl;
            return 0;
        }
    }
}


Measured memory_bytes: 256
n,l,t=map(int,input().split())
a,cs=[0]*n,0
for i in range(n):
	x,y=map(int,input().split())
	x+=(t if y==1 else -t)
	cs=(cs+x//l)%n
	x%=l
	a[i]=x
a.sort()
print('\n'.join([str(a[(i+cs+n)%n]) for i in range(n)]))


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

int main () {
	vector <int> primes;
	primes.push_back(2);
	for (int i = 3; i <= 100000; ++i) {
		bool isPrime = true;
		for (int j = 0; j < primes.size() && primes[j] <= i / 2; ++j) {
			if (i % primes[j] == 0) {
				isPrime = false;
				break;
			}
		}
		if (isPrime) {
			primes.push_back(i);
		}
	}

	vector <int> isLike2017;
	for (int i = 1; i < primes.size(); ++i) {
		if (binary_search(primes.begin(), primes.end(), (primes[i] + 1)/2)) {
			isLike2017.push_back(primes[i]);
		}
	}

	int q;
	cin >> q;
	while (q--) {
		int l, r;
		cin >> l >> r;
		int left = lower_bound(isLike2017.begin(), isLike2017.end(), l) - isLike2017.begin();
		int right = upper_bound(isLike2017.begin(), isLike2017.end(), r) - isLike2017.begin();
		cout << right - left << endl;
	}
}

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

#define pb push_back
#define mp make_pair

typedef long long ll;

const int inf = 1e9;
const ll linf = 1e18;
const ll mod = 1e9 + 7;

ll dp[3001][3001];

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

  int n = s.size();
  int m = t.size();

  for(int i = 0; i < n; i++){
    for(int j = 0; j < m; j++){
      if(s[i] == t[j]){
        dp[i+1][j+1] = dp[i][j] + 1;
      }else{
        if(dp[i][j+1] > dp[i+1][j]){
          dp[i+1][j+1] = dp[i][j+1];
        }else{
          dp[i+1][j+1] = dp[i+1][j];
        }
      }
    }
  }

  string ans;
  for(int i = n-1, j = m-1; i >= 0 and j >= 0; ){
    if(s[i] == t[j]){
      ans += s[i];
      i--;
      j--;
    }else{
      if(dp[i][j+1] > dp[i+1][j]){
        i--;
      }else{
        j--;
      }
    }
  }

  reverse(ans.begin(), ans.end());

  cout << ans << endl;

  return 0;
}


Measured memory_bytes: 70656
a=65280; b=61680; c=52428; d=43690; e=65535
QS = [[] for i in range(17)]
QS[1] = [a, b, c, d]
L = {a: 1, b: 1, c: 1, d: 1, e: 1, e: 1, 0: 1}
H = []
get = L.get
push = H.append
for l in range(1, 16):
    Q = QS[l]
    li = 13-l; l3 = l+3; l1 = l+1
    pop = Q.pop
    pushQN = QS[l1].append
    while Q:
        p = pop()
        if L[p] < l: continue
        if l1 < get(p ^ e, 17):
            L[p ^ e] = l1
            l < 12 and pushQN(p ^ e)
        if l < 13:
            for q, r in H:
                if r < li:
                    if l3+r < get(p & q, 17): L[p & q] = l3+r; QS[l3+r].append(p & q)
                    if l3+r < get(p ^ q, 17): L[p ^ q] = l3+r; QS[l3+r].append(p ^ q)
                elif r == li:
                    if p & q not in L: L[p & q] = 16
                    if p ^ q not in L: L[p ^ q] = 16
                else: break
            if l < 7: push((p, l))
print(*map(L.__getitem__, eval("e&"+",e&".join(open(0).read().replace(*"-~").replace(*"*&").replace(*"1e").split()[:-1]))),sep='\n')

Measured memory_bytes: 8256
#include<iostream>
#include<vector>
#include<string>
#include<algorithm>
#include<numeric>
#include<stack>
#include<map>
#include<queue>
#include<unordered_map>
#include<cmath>
#include<utility>

using ULL = unsigned long long;
using LL = long long;
using String = std::string;
using Ints = std::vector<int>;
using Doubles = std::vector<double>;
using Bools = std::vector<bool>;
using Strings = std::vector<std::string>;
using ULLs = std::vector<ULL>;
using LLs = std::vector<LL>;

using namespace std;

// pythonのdictionary相当
template <typename T1, typename T2>
using Dict = std::unordered_map<T1,T2>;



int main(void) {
    int S;
    LL res=0;
    cin >> S;
    if(S<3){
        cout << 0 << endl;
        return 0;
    }
    vector<Ints> dp(1000, vector<int>(S, 0));

    for(int i=0;i<S;i++) dp[0][i] = 1;
    for(int i=1;i<S/3;i++){
        for(int j=i*3;j<S;j++){
            dp[i][j] = (dp[i][j-1] + dp[i-1][j-3]) % 1000000007;
        }
    }



    for(int i=0;i<S/3;i++){
        res+=dp[i][S-3];
        res%=1000000007;
    }

    cout << res << endl;
}

Measured memory_bytes: 10992
#include <stdio.h>

int main(){

 int a, b;
 scanf("%d %d\n", &a, &b);
 
 if(a > b){
    printf("a > b\n");
 }
 else if(a < b){
     printf("a < b\n");
 }
 else{
     printf("a == b\n");
 }

 return 0;
}

Measured memory_bytes: 584
using System;
using System.IO;
using System.Linq;
using System.Collections;
using System.Collections.Generic;
using System.Text;
using System.Numerics;
using System.Threading.Tasks;
using System.Text.RegularExpressions;
using static System.Math;
using Debug = System.Diagnostics.Debug;
using MethodImplOptions = System.Runtime.CompilerServices.MethodImplOptions;
using MethodImplAttribute = System.Runtime.CompilerServices.MethodImplAttribute;

static class P
{
    static void Main()
    {
        var n = int.Parse(Console.ReadLine());
        if (n == 1)
        {
            Console.WriteLine(1);
            return;
        }
        var xy = Enumerable.Repeat(0, n).Select(_ => Console.ReadLine().Split().Select(int.Parse).ToArray()).Select(x => new Tuple<long, long>(x[0], x[1])).OrderBy(x => x.Item1).ThenBy(x => x.Item2).ToArray();
        HashSet<Tuple<long, long>> set = new HashSet<Tuple<long, long>>(xy);
        var candidate = xy.SelectMany(x => xy.Select(y => new Tuple<long, long>(x.Item1 - y.Item1, x.Item2 - y.Item2))).Distinct().ToArray();

        int min = int.MaxValue;
        foreach (var cand in candidate)
        {
            if (cand.Item1 == 0 && cand.Item2 == 0) continue;
            var res = 0;
            foreach (var point in xy)
            {
                if (set.Contains(new Tuple<long, long>(point.Item1 - cand.Item1, point.Item2 - cand.Item2))) continue;
                res++;
            }
            min = Min(min, res);
        }
        Console.WriteLine(min);
    }
}

class UnionFind
{
    public int Size { get; private set; }
    public int GroupCount { get; private set; }
    List<int> Sizes;
    List<int> Parent;
    public UnionFind(int count)
    {
        Size = 0;
        GroupCount = 0;
        Parent = new List<int>(count);
        Sizes = new List<int>(count);
        ExtendSize(count);
    }
    public bool TryUnite(int x, int y)
    {
        int xp = Find(x);
        int yp = Find(y);
        if (yp == xp) return false;
        if (Sizes[xp] < Sizes[yp])
        {
            var tmp = xp;
            xp = yp;
            yp = tmp;
        }
        GroupCount--;
        Parent[yp] = xp;
        Sizes[xp] += Sizes[yp];
        return true;
    }
    public IEnumerable<int> AllRepresents => Parent.Where(x => x == Parent[x]);
    public int GetSize(int x) => Sizes[Find(x)];
    [MethodImpl(MethodImplOptions.AggressiveInlining)]
    public int Find(int x)
    {
        while (x != Parent[x])
        {
            Parent[x] = Parent[Parent[x]];
            x = Parent[x];
        }
        return x;
    }
    [MethodImpl(MethodImplOptions.AggressiveInlining)]
    public void ExtendSize(int treeSize)
    {
        if (treeSize <= Size) return;
        Parent.Capacity = treeSize;
        Sizes.Capacity = treeSize;
        while (Size < treeSize)
        {
            Parent.Add(Size);
            Sizes.Add(1);
            Size++;
            GroupCount++;
        }
    }
}


Measured memory_bytes: 16224
#include<stdio.h>
#include<math.h>

#define PI 3.1415926535897932384626433832795028841971699

int main(void) {
	double a, b;
	double C;
	double S, L, h;
	
	scanf("%lf %lf %lf", &a, &b, &C);
	
	C = 2*PI*C/360;

	
	h = b*sin(C);
	S = a*h*0.5;
	L = a+b+sqrt(a*a+b*b-2*a*b*cos(C));;
	
	printf("%lf\n%lf\n%lf\n", S, L, h);
	
	return 0;
}
	

Measured memory_bytes: 648
#include<bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < n; ++i)
#define rep2(i,s,n) for (int i = s; i < n; ++i)
#define all(a) a.begin(),a.end()
#define tmax(a,b,c) max(a,max(b,c))
#define tmin(a,b,c) min(a,min(b,c))
#define pb push_back
using namespace std;
using ll = long long;
using P = pair<int,int>;
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 int inf = 1001001001;

int main() {
    int n,a,b,c;
    cin >> n >> a >> b >> c;
    vector<int> l(n);
    rep(i,n) cin >> l[i];
    int ans = inf;
    auto sum = [&](const vector<int>& v) {
        int ret = 0;
        for(int i : v) ret += l[i];
        return ret;
    };
    rep(i,1<<2*n) {
        vector<int> fa,fb,fc,fn;
        rep(j,n) {
            int now = i>>j*2;
            bool fs = now>>1&1;
            bool ss = now&1;
            if(fs && ss) fn.pb(j);
            else if(fs) fa.pb(j);
            else if(ss) fb.pb(j);
            else fc.pb(j);
        }
        int as = fa.size();
        int bs = fb.size();
        int cs = fc.size();
        if(as == 0 || bs == 0 || cs == 0) continue;
        int nans = 0;
        nans += (as+bs+cs-3)*10;
        nans += abs(sum(fa)-a)+abs(sum(fb)-b)+abs(sum(fc)-c);
        chmin(ans,nans);
    }
    cout << ans << endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <string>
#include <string.h>
#include <stdlib.h>
#include <math.h>
#include <vector>
#include <queue>
#include <stack>
using namespace std;

#define rep(i, s) for (int i = 0; i < s; ++i)
#define all(v) (v.begin(), v.end())
#define COUT(x) cout << #x << " = " << (x) << " (L" << __LINE__ << ")" << endl
#define EACH(i, s) for (__typeof__((s).begin()) i = (s).begin(); i != (s).end(); ++i)
#define VEC(a, n) vector<int>a(n)
#define PQ(a) priority_queue<int>a
#define PQmin(a) priority_queue< int, :vector<int>, greater<int> >a
#define PAIR pair<int, int>
/*
sort(sp.begin(), sp.end(), [](PAIR l, PAIR r){
        return l.first<r.first || (l.first==r.first && l.second > r.second);
        });
*/

typedef long long  ll;

#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))

int main() {
    int n;
    cin>>n;
    vector<ll>a(5,0);
    for(int i=0;i<n;i++){
        string s;
        cin>>s;
        if(s.at(0)=='M')a.at(0)++;
        if(s.at(0)=='A')a.at(1)++;
        if(s.at(0)=='R')a.at(2)++;
        if(s.at(0)=='C')a.at(3)++;
        if(s.at(0)=='H')a.at(4)++;
    }

    ll ans=0;
    for(int i=0;i<3;i++){
        for(int j=i+1;j<4;j++){
            for(int k=j+1;k<5;k++){
                ans+=a.at(i)*a.at(j)*a.at(k);
            }
        }
    }
    cout<<ans<<endl;

    return 0;
}


Measured memory_bytes: 256
#!/usr/bin/env ruby

def read_input()
  edge_num = gets(chomp: true).to_i
  edges = []
  graph = Hash.new { [] }
  (1...edge_num).each do
    edge = gets(chomp: true).split()
    edges << edge
    a,b = edge
    if (!graph.has_key?(a))
      graph[a] = []
    end
    graph[a] << b
  end
  [edges, graph]
end

def solve(graph, node, base_color, color_edge, max)
  children = graph[node]
  edge_num = children.length
  edge_num += 1 unless (base_color.nil?)
  max = edge_num if (edge_num > max)
  color = 0
  children.each { |child|
    color += 1
    color += 1 if (color == base_color)
    color_edge[node] = {} if (color_edge[node].nil?)
    color_edge[node][child] = color
    max, color_fedge = solve(graph, child, color, color_edge, max)
  }
  [max, color_edge]
end

edges, graph = read_input
max, color_edge = solve(graph, "1", nil, {}, -1)

puts max
edges.each do |a,b|
  puts color_edge[a][b]
end


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

using namespace std;

#define REP(i,m) for(long long i=0; i<m; i++)
#define FOR(i,n,m) for(long long i=n; i<m; i++)
#define INF 1000000001
#define INFL (1LL << 60)
#define MOD 1000000007
#define ALL(v) v.begin(),v.end()
#define pb push_back
#define ll long long int
#define P pair<ll, ll>

ll fac[1000001];
ll pat[1000001] = { };

ll POW(ll a, ll b){
  if(b == 0) return 1;
  if(b == 1) return a;
  if(b%2 == 1) return (a*POW(a, b-1))%MOD;
  ll x = POW(a, b/2);
  return (x*x)%MOD;
}

int main() {
  int n;
  cin >> n;
  n--;
  fac[0] = 1;
  REP(i, 1000000) fac[i+1] = (fac[i] * (i+1))%MOD;
  FOR(i, n/2+1, n+1){
    pat[i] = fac[i-1];
    (pat[i] *= fac[i]) %= MOD;
    (pat[i] *= POW(fac[2*i-n-1], MOD-2)) %= MOD;
  }
  ll ans = 0;
  FOR(i, 1, n+1){
    (ans += (i*(pat[i]-pat[i-1] + MOD))) %= MOD;
  }
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 13824