akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef vector<ll> vl;
typedef vector<pair<ll,ll>> vp;
#define rep(i,n) for(ll i = 0; i < ll(n); i++)
#define MMOD(i) ((i%MOD)+MOD)%MOD;
#define all(v) v.begin() , v.end()
#define vec(i,j) vector<vector<ll>>(i,vector<ll>(j,0))
const ll INF=99999999999999;
const ll MOD=998244353;
const ll MAX_N=100010;
ll a,b,c,d,e,y,z,k,m,n,l,q,h,w,ans=0;
vl v,v1,v2(200001,0),edge[200001],tree[200001],kaijo(200001),beki(200001),used(200001,0),niko(200001,0),dp(200001);
vp p,p1;
string s;
int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
   cin>>a>>b>>c;
   cout<<a+b+c-fmaxl(a,fmaxl(b,c))<<endl;
}

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

#define mod      1e9+7;
#define INF      1e9+9;
#define ps(x,y)  fixed<<setprecision(y)<<x
# define PI 3.14159265358979323846264338327950 L
typedef long long ll;
typedef unsigned long long ull;
int main()
{
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
#ifndef ONLINE_JUDGE
	freopen("input.txt","r",stdin);
	freopen("output.txt","w",stdout);
#endif
	char ch;
	cin>>ch;
	if(isupper(ch)){
		cout<<"A\n";
	}
	else{
		cout<<"a\n";
	}

	return 0;
}

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

int main()
{
    long long int n,max=0,s;
    cin>>n;
    long long int x=sqrt(n);
    for(int i=x;i>=1;i--)
    {
        if(n%i==0)
        {
            max=i;
            s=n/i;
            break;
        }
        
    }
    cout<<max+s-2;
    return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int,int>;
#define rep(i,n) for(ll i = 0; i < (ll)(n); i++)
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; }
const ll INF = 1LL << 60;
int main(){
    int n; 
    cin >> n;
    vector<int> L(n);
    rep(i,n) cin >> L[i];
    sort(L.begin(), L.end());

    ll ans = 0;
    rep(i,n){
        for(int j=i+1; j<n; j++){
            int mx = L[i]+L[j];
            int l=0; int r = n;
            while(l+1<r){
                int x = (l+r)/2;
                if (L[x]<mx) l=x; else r=x;
            }
            ans += max(0,l-j);
        }
    }
    cout << ans << endl;
    
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll MOD = 1e9 + 7/*998244353*/;
const ll INF = 1LL << 60;
ll mod_pow(ll, ll, ll); ll mod_fact(ll, ll); ll mod_inv(ll, ll); ll gcd(ll, ll); ll lcm(ll, ll);
//
int main(){
    int n, k;
    string s;
    cin >> n >> k >> s;
    int sum = n - 1;
    for(int i = 1; i < n; i++) if(s[i] != s[i - 1]) sum--;
    cout << min(n - 1, sum + 2 * k);
}

Measured memory_bytes: 512
#include <iostream>
#include <string>
#include <cmath>
using namespace std;
int main(void){
    // Your code here!
    long long int N,H,W,i,j,k,ans,count,cost,tmp;
    long long int S[200010];
    long long int Ssum[200010];
    string T;
    bool flag;
    count=0;
    ans=std::pow(10,18);
    flag=false;
    cin >>N>>H;
    for (i=H-(N-1);i<=H+(N-1);i++){
        if (i==H+(N-1)){
            
            cout <<i <<endl;
        }
        else{
            cout <<i << " ";
        }
    
    }

    
    

    return 0;
    
}


Measured memory_bytes: 3632
#include<bits/stdc++.h>
using namespace std;
int main(){
  int a,b; cin >> a >> b;
  if(a > b){
    for(int i = 0; i < a; i++)
      cout << b;
  }
  else
    for(int i = 0; i < b; i++)
      cout << a;
}

Measured memory_bytes: 3560
#include <stdio.h>

int main(){
  int p[5];
  int k;
  int flag = 0;
  scanf("%d\n",&p[0]);
  scanf("%d\n",&p[1]);
  scanf("%d\n",&p[2]);
  scanf("%d\n",&p[3]);
  scanf("%d\n",&p[4]);
  scanf("%d\n",&k);

  for(int i = 0; i < 5; i ++){
    for(int j = 0; j < 5; j ++){
      if(p[i] - p[j] <= 0){
        break;
      }else{
        if(p[i] - p[j] > k){
          flag = 1;
        }
      }
    }
  }

  if(flag){
    printf(":(");
  }else{
    printf("Yay!");
  }
  return 0;
}


Measured memory_bytes: 256
import sys
from itertools import accumulate

read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
sys.setrecursionlimit(10 ** 9)
INF = 1 << 60


def prime_numbers(n):
    if n < 2:
        return []

    m = (n + 1) // 2
    p = [1] * m
    for i in range(1, int((n ** 0.5 - 1) / 2) + 1):
        if p[i]:
            p[2 * i * (i + 1) :: 2 * i + 1] = [0] * (((m - 1) - 2 * i * (i + 1)) // (2 * i + 1) + 1)

    return {2} | {2 * i + 1 for i in range(1, m) if p[i]}


def main():
    primes = prime_numbers(10 ** 5)
    A = [1 if n in primes and (n + 1) // 2 in primes else 0 for n in range(10 ** 5 + 1)]
    A = tuple(accumulate(A))

    Q, *LR = map(int, open(0).read().split())
    ans = []
    for l, r in zip(*[iter(LR)] * 2):
        ans.append(A[r] - A[l - 1])

    print('\n'.join(map(str, ans)))
    return


if __name__ == '__main__':
    main()


Measured memory_bytes: 93876
#include<cstdio>
#include<iostream>
#include<string>
#include<cstring>
#include<algorithm>
#include<map>
using namespace std;
const int inf=0x3f3f3f3f;
const int Maxn=1000000+10;
int a[Maxn];
int n,m,ans;
map <int,bool> vis;
int gcd(int a,int b)
{
	if(!b)return a;
	return gcd(b,a%b);
}
int main()
{
//	freopen("in.txt","r",stdin);
	scanf("%d",&n);
	bool flag=0;
	for(int i=1;i<=n;++i)
	scanf("%d",&a[i]);
	for(int i=1;i<=n;++i)
	{
		int tmp=a[i];
		for(int j=2;j*j<=a[i];++j)
		{
			if(tmp%j)continue;
			if(vis[j] || vis[a[i]/j]){flag=1;goto GG;}
			vis[j]=vis[a[i]/j]=1;
			while(tmp && tmp%j==0)tmp/=j;
			while(tmp && tmp%(a[i]/j)==0)tmp/=(a[i]/j);
		}
		if(tmp==1)continue;
		if(vis[tmp]){flag=1;goto GG;}
		vis[tmp]=1;
	}
	GG:
	if(!flag)
	{
		puts("pairwise coprime");
		return 0;
	}
	ans=a[1];
	for(int i=2;i<=n;++i)
	ans=gcd(ans,a[i]);
	if(ans==1)puts("setwise coprime");
	else puts("not coprime");
	return 0;
}

Measured memory_bytes: 7652
n, k = map(int, input().split())
ans = 0
for i in range(k, n+2):
    ma = (n+n-i+1)*i//2
    mi = (i-1)*i//2
    # print(ma, mi)
    add = ma-mi+1
    ans += add

print(int(ans % (10**9+7)))


Measured memory_bytes: 9084
#include <bits/stdc++.h>
using namespace std;
 
using ll=long long;
 
#define rng(i,a,b) for(int i=int(a);i<int(b);i++)
#define rep(i,b) rng(i,0,b)
#define gnr(i,a,b) for(int i=int(b)-1;i>=int(a);i--)
#define per(i,b) gnr(i,0,b)
#define pb push_back
#define eb emplace_back
#define bg begin()
#define ed end()
#define all(x) x.bg,x.ed
const ll MOD = 1e9 + 7;



int main() {
    int n, k; cin >> n >> k;
    vector<int> as(n);
    rep(i, n)  cin >> as[i];
    sort(all(as));
    int ans = 0;
    rep(i, k) ans += as[i];
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 3600
import numpy as np
#from numba import njit

#(N, K) = map(int, input().split())
#A = np.array(list(map(int, input().split())))
N = int(input())
A = np.array(list(map(int, input().split())))

#@njit
def solve(N,A):
    l = []
    S = np.bitwise_xor.reduce(A)
    S = S ^ A[0]
    l += (str(S),)
    i = 1
    while i < len(A):
        S = S ^ A[i-1] ^ A[i]
        l += (str(S),)
        i+= 1
    print(" ".join(l))
        
solve(N,A)


Measured memory_bytes: 49612
#include<bits/stdc++.h>
using namespace std ;
#define ll long long
#define ld long double
#define ff first
#define ss second
const ll mod =   998244353  ;
ll multiply(ll a, ll b ){ return ((a % mod) * (b % mod)) % mod; }
ll add(ll a, ll b) {     return ((a % mod) + (b % mod)) % mod; }
ll sub(ll a, ll b) { return ((a%mod) - (b % mod)+ mod) % mod ; }
////////////////////////////////////////////////////////////////

///////////////////////////////////////////////////////////////
void solve(){
    int n ;
    cin >> n ;
    vector < int > a(n) ;
    int x = 0 ;
    for( int i = 0 ; i < n ; i++) cin >> a[i] , x^=a[i];
    for( int i = 0 ; i < n ; i++) cout << (x^a[i]) << " " ;
}
int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    int t = 1 ;
    //cin >> t ;
    while(t--){
        solve( );
    }
}


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

using namespace std;

#define INF 1000000007
#define LINF (1LL << 60)
#define PI 3.14159265358979

typedef long long i64;
typedef pair<i64,i64> P;

inline i64 mod(i64 a, i64 m) { return (a % m + m) % m; }

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; }



i64 n;
void solve(){
	cin >> n;
	
	cout << n*(n-1)/2 << endl;
}

int main(){
	std::cin.tie(0);
	std::ios::sync_with_stdio(false);
	int t = 1;
	//cin >> t;
	while(t--){
		solve();
	}
	
	return 0;
}


Measured memory_bytes: 256
//              +-- -- --++-- +-In the name of ALLAH-+ --++-- -- --+              \\

#include <bits/stdc++.h>

#define F first
#define S second
#define _sz(x) (int)x.size()

using namespace std ;
using ll = long long ;
using ld = long double ;
using pii = pair <int , int> ;

int const N = 1e5 + 20 ;
int n , dn[N] , ans = N ;
vector <int> g[N] ;

void dfs1 (int v , int par = -1) {
	int tmp = 0 ;
	for (int u : g[v]) {
		if (u == par) continue ;
		dfs1(u , v) ;
		dn[v] += dn[u] ;
		if (!dn[u]) tmp ++ ;
	}

	dn[v] = dn[v] + max(0 , tmp - 1) ;
}

void dfs2 (int v , int par = -1 , int up = 0 , int ut = 0) {
	int res = up , tmp = ut ;
	for (int u : g[v]) {
		if (u == par) continue ;
		if (!dn[u]) tmp ++ ;
		res += dn[u] ;
	}
	ans = min(ans , res + max(0 , tmp - 1) + 1) ;


	for (int u : g[v]) {
		if (u == par) continue ;
		int nres , ntmp ;

		ntmp = tmp - (!dn[u]) ;
		nres = res - dn[u] ;

		dfs2(u , v , nres + max(0 , ntmp - 1) , !(nres + max(0 , ntmp - 1))) ;
	}
}

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

	cin >> n ;

	for (int i = 0 , u , v ; i < n - 1 ; i ++) {
		cin >> u >> v ;
		g[u].push_back(v) ;
		g[v].push_back(u) ;
	}

	dfs1(0) ;
	dfs2(0) ;

	cout << ans << '\n' ;
}

Measured memory_bytes: 13824
import java.util.Scanner;

public class Main {

     static Scanner scanner;

     public static void main(String[] args) {
         scanner = new Scanner(System.in);

         int N=gi();
         long[] a=new long[N];
         long ans=0;
         long tmp=1;
         for (int i=0; i<N;i++) {
        	 a[i]=gl();
        	 if(tmp==a[i]) {
        		 tmp++;
        	 } else {
        		 ans++;
        	 }
         }

         if(tmp==1) {
        	 System.out.println(-1);
         } else {
        	 System.out.println(ans);
         }
     }

     // 文字列として入力を取得
     public static String gs() {
          return scanner.next();
     }

     // intとして入力を取得
     public static int gi() {
          return Integer.parseInt(scanner.next());
     }

     // longとして入力を取得
     public static long gl() {
          return Long.parseLong(scanner.next());
     }

     // doubleとして入力を取得
     public static double gd() {
          return Double.parseDouble(scanner.next());
     }
}

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

using namespace std;
const int MAXN = 1e7 + 10;
char s[MAXN];

int main() {
    cin >> s;
    int len = strlen(s);
    if (s[len - 1] == 's') {
        cout << s << "es" << endl;
    } else {
        cout << s << "s" << endl;
    }
    return 0;
}

Measured memory_bytes: 3628
#include<iostream>
#include<iomanip>
#include<cmath>
#include<string>
#include<cstring>
#include<vector>
#include<list>
#include<algorithm>
#include<map>
#include<set>
#include<queue>
#include<stack>
using namespace std;
typedef long long ll;
#define fi first
#define se second
#define mp make_pair
#define mt make_tuple
#define pqueue priority_queue
const int inf=1e9+7;
const ll mod=1e9+7;
const ll mod1=998244353;
const ll big=1e18;
const double PI=2*asin(1);

int main() {
  ll A, B;
  cin>>A>>B;
  if(abs(A-B)<=1) cout<<"Brown"<<endl;
  else cout<<"Alice"<<endl;
}



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

#include <iostream>
//#include <algorithm>
// #include <iomanip>
#define ll long long
#define map unordered_map
#define set unordered_set
#define pll pair<ll, ll>
#define vll vector<ll>
#define mll map<ll, ll>

using namespace std;

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

int main() {
  // std::cout << std::fixed << std::setprecision(10);
  ll N;
  scanf("%lld", &N);

  ll sum1 = 0;
  ll sum2 = 0;

  for (ll i = 1; i <= N; i++) {
    sum1 += (i * (N - i + 1));
  }

  for (ll i = 1; i <= N - 1; i++) {
    ll a, b;
    scanf("%lld %lld", &a, &b);
    if (a > b) swap(a, b);
    sum2 += ((a) * (N - b + 1));
  }

  cout << sum1 - sum2 << endl;
}


Measured memory_bytes: 3812
#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 INF 1e9

int main(){
  double L;
  cin >> L;
  printf("%.9f\n", L*L*L/27);
  return 0;
}


Measured memory_bytes: 256
//コメント付き。
using System;
using System.Collections.Generic;
using System.Linq;
class Program
{
    static void Main(string[] args)
    {
        var NY = Console.ReadLine().Split().Select(x => int.Parse(x)).ToList();
        int N = NY[0];
        int Y = NY[1] / 1000;
        //最初に-1,-1,-1を入れておけば、値が見つかれば更新され、なければ-1のまま。
        //returnで抜ける場合は、こうしなくても、最後まできたら-1,-1,-1を出力すればよい。
        int[] ans = new int[] { -1, -1, -1 };
        //indexがNまで必要ということに注意
        for (int i = 0; i <= N; i++)
        {
            for (int j = 0; j <= N - i; j++)
            {
                // ここまでくるとkは定まるので、3重にネストする必要はない。実行時間がかなり長くなる。25->1300ms
                //for(int k=0;k<=N-i-j;k++){
                //  if(i+j+k==N){
                int k = N - i - j;
                if (i * 10 + j * 5 + k * 1 == Y)
                {
                    ans = new int[] { i, j, k };
                    Console.WriteLine("{0} {1} {2}", ans[0], ans[1], ans[2]);
                    //一個だけ見つければいいので、ここでreturnで抜ければよい。
                    return;
                }
            }
        }

        Console.WriteLine("{0} {1} {2}", ans[0], ans[1], ans[2]);
    }
}




Measured memory_bytes: 13268
#include <bits/stdc++.h>
using namespace std;
using Graph = vector<vector<int>>;
#define rep(i,a,b) for (int i = (a); i < (b); i++ )
typedef pair<int,int> P;
typedef long long ll;
const int INF = 100000000;
const double PI=3.14159265358979323846;

int main (){
    string S;
    cin >> S;

    int a[S.size()];
    a[0] = 0;
    
    rep(i,1,S.size()) {
        if (S[i]==S[i-1]) {
            a[i]=a[i-1];
        }
        else {
            a[i] = a[i-1]+1;
        }
    }
    cout << a[S.size()-1] << endl;
}





Measured memory_bytes: 896
import java.util.HashSet;
import java.util.Scanner;

public class Main {
	

	
	public static void main(String[] args) {

		
		Scanner s = new Scanner(System.in);
		HashSet<String> h = new HashSet<>();
		int n = s.nextInt();
		
		while(n--!=0) {
			h.add(s.next());
		}
		System.out.println(h.size());
		
		
	}
}

Measured memory_bytes: 76804
#include <iostream>
#include <string>
#include <cstring>
#include <cstdlib>
#include <algorithm>
using namespace std;

typedef struct {
    string item;
    int number;
} dict;

// --------------- 比較用の関数 cmp -------------------
// https://edu.clipper.co.jp/pg-2-55.html
// https://edu.clipper.co.jp/pg-2-53.html
int cmp( const void *p, const void *q ) {
    return ((dict*)p)->number - ((dict*)q)->number;
}


int main() {
    int n;
    cin >> n;
    string s[n];
    for (int i = 0; i < n; i++) {
        cin >> s[i];
    }
    sort(s, s + n);

    /* 
    cout << "=============" << endl;
    for(int i = 0; i < n; i++) {
        cout << s[i] << endl;
    }
    */

    dict list[n];
    list[0].item = s[0];
    list[0].number = 1;
    int j = 0;

    for(int i = 1; i < n; i++) {
        if(s[i] == s[i - 1]) {
            list[j].number++;
            continue;
        }
        j++;
        list[j].item = s[i];
        list[j].number = 1;
    }


    /* 
    cout << "===============" << endl;
    for (int i = 0; i <= j; i++) {
        cout << list[i].item << ": " << list[i].number << endl;
    }
    */

    int max = 0;
    for(int i = 0; i <= j; i++) {
        if(max < list[i].number) max = list[i].number;
    }

    // cout << "~~~~~~~~~~~~" << endl;
    for (int i = 0; i <= j; i++) {
        if(list[i].number == max) 
            cout << list[i].item << endl;
    }

    // sort 要らなかった
    // qsort(list, j, sizeof(dict), cmp);

    
    /* 
    cout << "===============" << endl;
    for (int i = 0; i <= j; i++) {
        cout << list[i].item << ": " << list[i].number << endl;
    }
    */
    return 0;
}

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

typedef long long ll;
typedef pair<int,int>P;
#define INF (int)(1e9)
#define EPS (1e-7)
#define MOD ((ll)1e9+7)
#define rep(i,n) for(int i = 0; i < (int)(n); i++)
#define REP(i,n) for(int i=1;i<=(int)(n);i++)
#define FOR(i,k,n) for(int i = (k); i < (int)(n); i++)
#define ALL(a)  a.begin(),a.end()
#define RALL(a) a.begin(),a.end(),greater<int>()
#define pb push_back
#define vec vector<int>


/*--------------------------------------------*/
/*ll factorial(ll);
void list_Prime(ll);
ll divisor(ll);
ll lcm(ll, ll);//AとBの最小公倍数
ll gcd(ll,ll);*/
/*--------------------------------------------*/
/*--------------------------------------------*/
/*
ll factorial(ll n){
    if(n==1)return 1;
    return n*factorial(n-1);
}
ll lcm(ll A, ll B) {//最小公倍数
    ll a = A;
    ll b = B;
    if (a == 0 || b == 0) { return 0; }
    if (a < 0) { a = -a; }
    if (b < 0) { b = -b; }
    while (b > 0) {
        ll c = a % b;
        a = b;
        b = c;
    }
    return A/a*B;
}

ll gcd(ll a,ll b){
    while (b != 0) {
        int t = b;
        b = a % b;
        a = t;
    }
    return a;
}


void list_Prime(ll n){//n以下の素数を全て見つける
    ll Limit=(int)sqrt((double)n);
    for(ll i=2;i<=n;i++)prime[i]=1;//最初はみんな素数かも
    //素数の整数倍を消していく(ルートnまで)
    for(ll i=2;i<=Limit;i++){
        if(prime[i]){
            for(ll j=2*i;j<=n;j++){
                if(j%i==0){
                    prime[j]=0;                
                }
            }
        }
    }
}

ll divisor(ll n){
    for(ll i=2;i<=n;i++){
        ll d=1;
        ll tmp=i;
        while(tmp>0){
            d++;
            while(tmp%d==0){
                prime[i]++;
                tmp/=i;
            }
        }
    }
    ll sum=1;
    for(ll i=2;;i<=n;i++){
        sum*=(prime[i]+1)/MOD;
    }    
    cout<<"sum="<<sum<<endl;

    return sum%MOD;
}
*/
/*--------------------------------------------*/

const int MAX_N = 100000+10;

vec dp(MAX_N,INF); // dp[i] が i についての答え

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

    // 初期化
    //for (int i = 0; i < MAX_N; ++i) dp[i] = N; // INF の気持ち
    dp[0] = 0;

    // 貰う DP --- dp[n] に遷移を集める
    REP(i,n) {
        for (int pow6 = 1; pow6 <= i; pow6 *= 6) {
            //printf("n=%d,pow6=%d,,dp[%d]=%d\n",i,pow6,i,dp[i]);
            dp[i] = min(dp[i], dp[i - pow6] + 1);
            //printf("n=%d,pow6=%d,,dp[%d]=%d\n",i,pow6,i,dp[i]);
        }
        for (int pow9 = 1; pow9 <= i; pow9 *= 9) {
            //printf("n=%d,pow9=%d,,dp[%d]=%d\n",n,pow9,n,dp[n]);
            dp[i] = min(dp[i], dp[i - pow9] + 1);
            //printf("n=%d,pow9=%d,,dp[%d]=%d\n",n,pow9,n,dp[n]);
        }
    }

    cout << dp[n] << endl;
}

Measured memory_bytes: 760
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define rep2(i,n) for (int i = 1; i < (n); ++i)
using namespace std;
typedef long long ll;
 
int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    char C;
    cin >> C;
    cout << char(C+1) << endl;
    return 0;
}


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

char base1, base2, base3;
int score;

void hit(void);
void homerun(void);

int main(void)
{
	int out;
	int n;
	int i;
	char event[8];
	
	scanf("%d", &n);
	for (i = 0; i < n; i++){
		base1 = base2 = base3 = 0;
		out = score = 0;
		
		while (out != 3){
			scanf("%s", event);
		
			if ((strcmp(event, "HIT")) == 0){
				hit();
			} else  if((strcmp(event, "OUT") == 0)){
				out++;
			} else if((strcmp(event, "HOMERUN")) == 0){
				homerun();
			}
		}
		printf("%d\n", score);
	}
	
	return (0);
}

void hit(void)
{
	if (base3 == 1){
		score++;
		base3 = 1;
	}
	
	if (base2 == 1){
		base3 = 1;
		base2 = 0;
	}
	
	if (base1 == 1){
		base2 = 1;
		base1 = 0;
	}
	
	base1 = 1;
}

void homerun(void)
{
	score += base1 + base2 + base3;
	score++;
	
	base1 = base2 = base3 = 0;
}

Measured memory_bytes: 596
#include <iostream>
#include <vector>
#include <cstdlib>
using namespace std;
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; }


int main() {
    int N; cin >> N;
    int h[N];
    for (int i = 0; i < N; ++i) cin >> h[i];

    // 無限大の値
    const long long INF = 1LL << 60;
    
    // DP テーブル
    long long dp[N];
    
    // DP テーブル全体を初期化 (最小化問題なので INF に初期化)
    for (int i = 0; i < N; ++i) dp[i] = INF;

    // 初期条件
    dp[0] = 0;
    
    // ループ
    for (int i = 1; i < N; ++i) {

    chmin(dp[i], dp[i-1] + abs(h[i]-h[i-1]));
    if(i>1){
    chmin(dp[i], dp[i-2] + abs(h[i]-h[i-2]));        
    }
    }

// 解を得て出力
cout << dp[N-1] << endl;

	return 0;
}

Measured memory_bytes: 1408
#!usr/bin/env python3
from collections import defaultdict, deque
from heapq import heappush, heappop
from itertools import permutations, accumulate
import sys
import math
import bisect
def LI(): return [int(x) for x in sys.stdin.buffer.readline().split()]
def I(): return int(sys.stdin.buffer.readline())
def LS():return [list(x) for x in sys.stdin.readline().split()]
def S():
    res = list(sys.stdin.readline())
    if res[-1] == "\n":
        return res[:-1]
    return res
def IR(n):
    return [I() for i in range(n)]
def LIR(n):
    return [LI() for i in range(n)]
def SR(n):
    return [S() for i in range(n)]
def LSR(n):
    return [LS() for i in range(n)]

sys.setrecursionlimit(1000000)
mod = 1000000007

def solve():
    a,b,c,x,y = LI()
    ans = a*x+b*y
    for z in range(x+y+1):
        rx = max(0,x-z)
        ry = max(0,y-z)
        m = rx*a+ry*b+2*z*c
        if m < ans:
            ans = m
    print(ans)
    return

#Solve
if __name__ == "__main__":
    solve()


Measured memory_bytes: 39408
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp> // Common file
#include <ext/pb_ds/tree_policy.hpp> // Including tree_order_statistics_node_update
using namespace std;
using namespace __gnu_pbds;
typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;
 
int N, Q;
int S[1000005];
int T[1000005];
int X[1000005];
 
int D[1000005];
 
vector <int> post[1000005];
 
int main() {
    ios_base::sync_with_stdio(false);
    cin >> N >> Q;
 
    for(int i = 1; i <= N; i++)
        cin >> S[i] >> T[i] >> X[i];
 
    for(int i = 1; i <= Q; i++)
        cin >> D[i];
 
    for(int i = 1; i <= N; i++) {
        int l = distance(D, lower_bound(D + 1, D + Q + 1, S[i] - X[i]));
        int r = distance(D, upper_bound(D + 1, D + Q + 1, T[i] - X[i] - 1));
        post[l].push_back(X[i]);
        post[r].push_back(-X[i]);
    }
 
    multiset<int> s;
    for(int i = 1; i <= Q; i++) {
        for(auto v: post[i]) {
            if(v < 0) s.erase(s.find(-v));
            else s.insert(v);
        }
        cout << (s.empty() ? -1 : *s.begin()) << "\n";
    }
}


Measured memory_bytes: 48372
/*
    1) Notice the range of data;
    2) while(scanf) format need to init;
    3) Enough maxn;
    4) delete the freopen;
    5) remember to read this before submit;
    6) For dream
*/
#include <bits/stdc++.h>
using namespace std;
typedef long long LL;
typedef unsigned long long ULL;
int gcd(int a,int b){if (b == 0) return a; return gcd(b , a%b);}
int lcm(int a, int b){ return a/gcd(a,b)*b;}
inline int read(){
    int f = 1, x = 0;char ch = getchar();
    while (ch > '9' || ch < '0'){if (ch == '-')f = -f;ch = getchar();}
    while (ch >= '0' && ch <= '9'){x = x * 10 + ch - '0';ch = getchar();}
    return x * f;
}
const int maxn = 1e5 + 10;

int main(){
    int A = read(),B = read();
    int ans = 0;
    if (A > B){
        ans += A;
        A--;
    }else{
        ans += B;
        B--;
    }
    if (A > B){
        ans += A;
        A--;
    }else{
        ans += B;
        B--;
    }
    cout << ans << endl;
    return 0;
}

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

inline int cha(int a){
	return (a > 0)?a:-a;
}

inline long int max(long int a, long int b){
	return (a > b)?a:b;
}

int main(){
	/*input*/
	int n;	cin >> n;
	int* x = new int [n];
	int* y = new int [n];
	long int* h = new long int [n];
	for(int i = 0; i < n; i++){
		cin >> x[i] >> y[i] >> h[i]; 
	}
	/*calculation*/
	int C_x, C_y; 
	int H = 0;
	bool flag = true;
	for(C_y = 0; C_y <= 100; C_y++){
		for(C_x = 0; C_x <= 100; C_x++){
			for(int i = 0; i < n; i++){
				if(h[i] > 0){
					H = cha(C_x - x[i])+cha(C_y - y[i])+h[i]; 
					break;
				}
			}
			for(int i = 0; i < n; i++){
				long int tmp = max(H - cha(C_x - x[i]) - cha(C_y - y[i]), 0);
				if(tmp != h[i]){
					flag = false;
					break;
				}else{
					flag = true;
				}
			}
			if(flag)break;
		}
		if(flag)break;
	}
	/*output*/
	cout << C_x << " " << C_y << " " << H << endl;
	delete[] x;
	delete[] y;
	delete[] h;
}


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

// #define ll long long
// using namespace std;
// int main(){
// 	ll n,a,i,j,k,b,l,sum,cnt=0,cnt1=0,value;
// 	cin>>n>>a>>b;
// 	sum=a+b;
// 	value=n-sum;
// 	string s,s1;
// 	for( i=0;i<a;i++){
// 	 	s[i]='b';
//      }
// 	for( k=0;k<b;k++){
// 		s1[k]='r';
// 	}
// 	for( j=a;j<b;j++){
// 		s[i]=s1[j];
// 		i++;
// 	}
// 	for(l=0;l<sum;l++){

// 		if(s[l]=='b' ||s[l]=='B' ){
// 			cnt++;
// 		}else if(s[l]=='r'||s[l]=='R'){
// 			cnt1++;
// 		}
// 	}
// 	cout<<cnt+value<<endl;
// 	cnt=0;
// 	return 0;
// }


#include<bits/stdc++.h>
#define ll long long
using namespace std;
int main(){
  ll n, a, b;
  cin >> n >> a >> b;
  ll ab = a + b;
  cout << n / ab * a + min(a, n % ab) << endl;
  return 0;
}

Measured memory_bytes: 256
#include <stdio.h>
#define INF 100000001
int DP[101][101];
int p[101];

int rec(int r,int c){
  int Min =INF;
  int num=c-r,i;

  for(i=0;i<num;i++){
    Min = min(Min,DP[r][r+i]+DP[r+i+1][c]+p[r-1]*p[r+i]*p[c]);
  }
  return Min;
}
int min(int min,int dp){

  if(min<=dp)return min;
  else return dp;
}
  

int main(){
  int N,i;
  scanf("%d",&N);
  for(i=1;i<=N;i++)DP[i][i]=0;
  scanf("%d",&p[0]);
  scanf("%d",&p[1]);
  int bb;
  for(i=2;i<=N;i++){
    scanf("%d%d",&bb,&p[i]);
  }

  for(i=1;i<N;i++)DP[i][i+1]=p[i-1]*p[i]*p[i+1];
  int j;
  for(j=0;j<=N-3;j++){
    for(i=3+j;i<=N;i++){
      DP[i-2-j][i]=rec(i-2-j,i);
    }
  }

  printf("%d\n",DP[1][N]);

  return 0;
}
    

  



Measured memory_bytes: 2056
#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
const int INF = (1<<30);
const ll INFLL = (1ll<<60);
const ll MOD = (ll)(1e9+7);

#define l_ength size

void mul_mod(ll& a, ll b){
	a *= b;
	a %= MOD;
}

void add_mod(ll& a, ll b){
	a = (a<MOD)?a:(a-MOD);
	b = (b<MOD)?b:(b-MOD);
	a += b;
	a = (a<MOD)?a:(a-MOD);
}

ll h[100100],dp[100100];

int main(void){
	int n,i;
	ll ans=0ll;
	cin >> n;
	for(i=0; i<n; ++i){
		cin >> h[i];
	}
	reverse(h,h+n);
	for(i=1; i<n; ++i){
		if(h[i]>=h[i-1]){
			dp[i] = dp[i-1]+1;
		}
		ans = max(ans,dp[i]);
	}
	cout << ans << endl;
	return 0;
}


Measured memory_bytes: 1792
#include<cstdio>
#include<algorithm>
#include<cstring>
#include<vector>
#define MN 200005
using namespace std;
int n,q,cnt,T[MN<<2],f[MN],c[MN];
vector<int> v[MN];
void update(int l,int r,int a,int k,int ad){
	if(l==r)return (void)(T[k]=min(T[k],ad));int mid=(l+r)>>1;
	if(a<=mid)update(l,mid,a,k<<1,ad);else update(mid+1,r,a,k<<1|1,ad);T[k]=min(T[k<<1],T[k<<1|1]);
}
int que(int l,int r,int a,int b,int k){
	if(l==a&&r==b)return T[k];int mid=(l+r)>>1;
	if(b<=mid)return que(l,mid,a,b,k<<1);if(a>mid)return que(mid+1,r,a,b,k<<1|1);
	return min(que(l,mid,a,mid,k<<1),que(mid+1,r,mid+1,b,k<<1|1));
}
int main(){
	memset(T,0x3f,sizeof(T));memset(f,0x3f,sizeof(f));
	scanf("%d",&n);int x,y;
	for(int i=1;i<=n;i++)scanf("%d",&x),c[i]=x?1:-1,cnt+=!x;
	scanf("%d",&q);
	for(int i=1;i<=q;i++)scanf("%d%d",&x,&y),v[x].push_back(y);f[0]=0;
	for(int i=1;i<=n;i++){
		for(int j=0;j<v[i].size();j++){
			int tmp=min(f[i-1],que(1,n,max(i-1,1),v[i][j],1));
			if(tmp<f[v[i][j]])f[v[i][j]]=tmp,update(1,n,v[i][j],1,tmp);
		}f[i]=min(f[i],f[i-1]+c[i]);
	}printf("%d\n",f[n]+cnt);
}

Measured memory_bytes: 13568
#include <iostream>
#include <cmath>

using std::cin;
using std::cout;
using std::endl;

int gcd(int n, int m) {
	if ( n%m == 0 ) {
		return m;
	}
	else {
		return gcd(m,n%m);
	}
}

int main(void) {
	int p,q;
	cin >> p >> q;
	int n = q;
	int m = p;
	int l = gcd(n,m);
	while ( l != 1 ) {
		n = n/l;
		m = m/l;
		l = gcd(n,m);
	}
	while ( (int)sqrt(n) == sqrt(n) ) {
		n = sqrt(n);
	}
	for (int i = 2; i*i < n+1; i++) {
		if ( n%(i*i) == 0 ) {
			n = n/i;
			i--;
		}
	}
	cout << n << endl;
	return 0;
}

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


int main(){
	double v;
	while(cin >> v){
		double t = v / 9.8;
		double y = 4.9 * t*t;
		int N = (int)ceil((y + 5) / 5);

		cout << N << endl;
	}

	return 0;
}

Measured memory_bytes: 3136
#include <bits/stdc++.h>
#define endl "\n"
using namespace std;
typedef long long ll;
typedef pair<ll, ll> l_l;
typedef pair<int, int> i_i;

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

  ll n, d, count=0;
  cin >> n >> d;
  pair<ll, ll> x[n];
  
  for(int i=0; i < n; i++){
    cin >> x[i].first >> x[i].second;
  }

  for(int i=0; i < n; i++){
    if(x[i].first * x[i].first + x[i].second * x[i].second <= d *d){
      count++;
    }
  }
  cout << count;
  return 0;
}

Measured memory_bytes: 6676
h, w = map(int, input().split())
a = [list(input()) for _ in range(h)]
d = (-1, 0), (1, 0), (0, -1), (0, 1)

step = [(i, j) for i in range(h) for j in range(w) if a[i][j] == '#']

def next_step():
    r = []
    for i, j in step:
        for di, dj in d:
            di += i
            dj += j
            if 0 <= di < h and 0 <= dj < w and a[di][dj] == '.':
                a[di][dj] = '#'
                r.append((di, dj))
    return r

n = h * w - len(step)
r = 0
while n:
    r += 1
    step = next_step()
    n -= len(step)
print(r)


Measured memory_bytes: 132432
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int main()
{
	ios_base::sync_with_stdio(0); 
    cin.tie(0);   
	// ll n,a[200009];
	string s,a;
	cin>>s>>a;
	if(s.size()+1==a.size())
	{
		for(int i=0;i<s.size();i++)
		{
			if(a[i]!=s[i])
			{
				cout<<"No";
				exit(0);
			}
		}
	}
	else
	{
		cout<<"No";
		exit(0);
	}
	cout<<"Yes";
	
	return 0;
}

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

#define lli long long int
#define REP(i,s,n) for(int i=s;i<n;i++)
#define NUM 2520
#define INF (1LL<<62)
#define DEBUG 1
#define mp(a,b) make_pair(a,b)
#define SORT(V) sort(V.begin(),V.end())
#define PI (3.141592653589794)
#define TO_STRING(VariableName) # VariableName
#define LOG(x) if(DEBUG)cout<<TO_STRING(x)<<"="<<x<<" "<<endl;
#define LOG2(x,y) if(DEBUG)cout<<TO_STRING(x)<<"="<<x<<" "<<TO_STRING(y)<<"="<<y<<endl;
#define LOG3(x,y,z) if(DEBUG)cout<<TO_STRING(x)<<"="<<x<<" "<<TO_STRING(y)<<"="<<y<<" "<<TO_STRING(z)<<"="<<z<<endl;
#define LOG4(w,x,y,z) if(DEBUG)cout<<TO_STRING(w)<<"="<<w<<" "<<TO_STRING(x)<<"="<<x<<" "<<TO_STRING(y)<<"="<<y<<" "<<TO_STRING(z)<<"="<<z<<endl;

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; }

void func(long long N, long long K, std::vector<long long> x, std::vector<long long> y){

    vector<lli> xb(N),yb(N);
    REP(i,0,N){
        xb[i]=x[i];
        yb[i]=y[i];
    }

    SORT(xb);
    SORT(yb);

    lli ans =INF;

    REP(i,0,N)REP(j,i+1,N){
        lli x1 = xb[i];
        lli x2 = xb[j];
        REP(k,0,N)REP(l,k+1,N){
            lli y1 = yb[k];
            lli y2 = yb[l];

            lli cnt = 0;
            REP(m,0,N){
                if(x1<=x[m] && x[m]<=x2 && y1<=y[m] && y[m] <= y2)cnt++;
            }
            if(cnt>=K)chmin(ans,(x2-x1)*(y2-y1));
        }
    }

    cout<<ans<<endl;

}

int main(){
    // cout << fixed << setprecision(5);

    long long N;
    scanf("%lld",&N);
    long long K;
    scanf("%lld",&K);
    std::vector<long long> x(N);
    std::vector<long long> y(N);
    for(int i = 0 ; i < N ; i++){
        scanf("%lld",&x[i]);
        scanf("%lld",&y[i]);
    }
    func(N, K, std::move(x), std::move(y));
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#ifdef __LOCAL
    #define DBG(X) cout << #X << " = " << (X) << endl;
    #define SAY(X) cout << (X) << endl;
#else
    #define DBG(X)
    #define SAY(X)
#endif

#ifdef __LOCAL
    #include <filesystem>
    namespace fs = std::filesystem;
#endif

using namespace std;

using ll = long long int;
using ull = unsigned long long int;
using ld = long double;
using pii = pair<int, int>;
using pll = pair<ll, ll>;

int dx[]={1, 0, -1, 0, 1,-1, 1,-1};
int dy[]={0, 1, 0, -1, 1, 1,-1,-1};
const int INT_INF = (int)(2e9);
const ll  LL_INF = (ll)(2e18);
static mt19937 _g(time(nullptr));
 
inline ll randint(ll a, ll b) { ll w = (_g() << 31LL) ^ _g(); return a + w % (b - a + 1); }
inline void fast_io() { ios_base::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr); };
template<typename T, typename S> inline ostream& operator<<(ostream& os, const pair<T, S> p) { cout << "[" << p.first << ";" << p.second << "]"; return os; }
template<typename T, typename S> inline ostream& operator<<(ostream& os, const map<T, S> p) { for (auto el : p) cout << "[" << el.first << ";" << el.second << "]"; return os; }
template<typename T> inline ostream& operator<<(ostream& os, const vector<T>& v) { for (auto el : v) cout << el << " "; return os; }
template<typename T> inline vector<T> fetch_vec(int sz) { vector<T> ret(sz); for (auto& elem : ret) cin >> elem; return ret; }

int N;
ll z,w;
vector<ll> a;
void input(){
    fast_io();
    #ifdef __LOCAL
        fs::path p = __FILE__;
        fs::path input,output;
        input = output = p.parent_path();
        input += string("/input/") + string(p.stem()) + string(".txt");
        output += string("/output/") + string(p.stem()) + string(".txt");
        freopen(input.c_str(), "r", stdin);
        freopen(output.c_str(), "w", stdout);
    #endif
    cin >> N >> z >> w;
    a = fetch_vec<ll>(N);
}

// bool max_cmp(pll a, pll b){
//     if(a.first!=b.first) return a.first < b.first;
//     else return a.second < b.second;
// }

// bool min_cmp(pll a, pll b){
//     if(a.first!=b.first) return a.first < b.first;
//     else return a.second > b.second;
// }

int solve(){
    vector<pll> A;
    A.emplace_back(abs(w-a[N-1]),0);
    for (int i = 0; i < N-1; i++) A.emplace_back(abs(a[i]-a[N-1]),i+1);
    auto itr = A.begin();
    auto itrm = min_element(itr,A.end());
    if(itrm==A.end()) {cout << (*itr).first << endl; return 0;}

    while(itr!=A.end()){
        auto itrM = max_element(itr,A.end());
        if(itr==itrM) break;
        itr = itrM;
        auto itrm = min_element(itr,A.end());
        if(itr==itrm) break;
        itr = itrm;
    }
    if((*itr).first < (*A.begin()).first) itr = A.begin();
    cout << (*itr).first << endl;
    
    return 0;
}   

int main()
{
    input();
    solve();
    return 0;
}


Measured memory_bytes: 384
import java.util.*;

public class Main {
    public static void main(String[] args){
        Scanner sc = new Scanner (System.in);

        int n,m,ans;
        n=sc.nextInt();
        m=sc.nextInt();
        
            ans=m*(m-1)/2;
            ans+=n*(n-1)/2;

        System.out.println(ans);
        sc.close();
    }
}

Measured memory_bytes: 23508
#include <iostream>
using namespace std;
int main() {
  int n;
  cin >> n;
  bool flag = false;
  for (int i = 0; i <= n/7; i++) {
    if ((n - 7*i) % 4 == 0) flag = true;
  }
  if (flag) cout << "Yes" << endl;
  else cout << "No" << endl;
  return 0;
}

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

int main(){
	int n, k;
	string s;
	cin >> n >> s >> k;
	rep(i, n){
		if(s.at(i) == s.at(k-1)) cout << s.at(k-1);
		else cout << '*';
	}
	cout << endl;
	return 0;
}

Measured memory_bytes: 256
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int[] a = new int[n];
		
		for(int i = 0; i < a.length; i++) {
			a[i] = sc.nextInt();
		}
		
		for(int i = n-1; i >= 0; --i) {
			if(i < n-1) System.out.printf(" ");
			System.out.printf("%d",a[i]);
			
		}
		System.out.println();
		

	}
}


Measured memory_bytes: 26512
#include<iostream>
#include<vector>
using namespace std;
int main()
{
    // 入力
    int a,b;
    cin >> a;
    vector<int> v;
    for (int i = 0; i < a; ++i) {
        cin >> b;
        v.push_back(b);
    }
    // 処理
    int c=0;
    int d=0;
    while(true){
        for (int j = 0;j<a;++j){
            c = c + v[j]%2;
        }
        if(c>0){
            break;
        }else{
            for(int j=0;j<a;++j){
                v[j] = v[j]/2;
            }
            ++d;
            c=0;
        }
    }
    // 出力
    cout << d << endl;
    return 0;
}

Measured memory_bytes: 256
import java.util.*;
import java.io.*; //printwiter
 
/**
 * Base_version with PrintWriter
 */ 
 
class Main { 
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
      	int x = sc.nextInt();
      	int t = sc.nextInt();
      	PrintWriter out = new PrintWriter(System.out);
        out.println(Math.max(x - t, 0));
      	out.flush();
    }
}

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

static const int N = 100000;

struct node
{
    int parent;
    std::vector<int> child;
};

int main(void)
{
    std::vector<int> col(N);
    std::vector<node> graph(N);

    int n;
    std::cin >> n;

    for (int i = 1; i <= n-1; i++)
    {
        int a, b;
        std::cin >> a >> b;
        auto& p = graph[a-1];
        p.child.push_back(i);
        graph[b-1].parent = i;
    }

    size_t m = 0;
    for (int i = 1; i <= n; i++)
    {
        const auto& p = graph[i-1];
        m = std::max(m, p.child.size() + (size_t)((p.parent == 0)?0:1));
        int c = 1;
        for (const auto& pp: p.child)
        {
            if (col[pp-1] != 0)
            {
                continue;
            }
            if (col[p.parent-1] == c)
            {
                c++;
            }
            col[pp-1] = c;
            c++;
        }
    }

    std::cout << m << std::endl;
    for (int i = 0; i < n-1; i++)
    {
        std::cout<< col[i] <<std::endl;
    }

    return 0;
}


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

int main() {
  string s;
  int a,b;
  cin >>a>>s>>b;
  if (s.at(0)=='+') {
    cout<<a+b<<endl;
  }
  else{
    cout<<a-b<<endl;
  }
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define REP(i,n) for(int i=0;i<n;i++)
#define LOOP(i,x,n) for(int i=x;i<n;i++)
#define ALL(v) (v).begin(),(v).end()
#define PB push_back
#define MP make_pair
#define F first
#define S second
#define int long long
using namespace std;
const int MOD=1000000007;
const int INF=1000000009;

signed main(){
  int a,b,c;
  cin>>a>>b>>c;
  cout<<(a+b>=c?"Yes":"No")<<endl;

  return 0;
}


Measured memory_bytes: 256
#include<stdio.h>

#define MAX 100
#define INF 100000000
#define white 0
#define gray 1
#define black 2

typedef struct{
  int data[MAX];
  int head;
  int tail;
}queue;

queue Q;

int n,d[MAX] = {INF};
int g[MAX][MAX] = {0};
int color[MAX] = {white};

void bfs(int);
void enqueue(int);
int dequeue(void);

int main(){
  int i,j,u,k,v;

  scanf("%d",&n);

  for(i=0;i<n;i++){
    scanf("%d %d",&u,&k);
    for(j=0;j<k;j++){
      scanf("%d",&v);
      g[u-1][v-1] = 1;
    }
  }
  for(i=0;i<n;i++)
    d[i] = INF;

  bfs(0);

  for(i=0;i<n;i++){
    if(d[i] == INF)printf("%d %d\n",i+1,-1);
    else printf("%d %d\n",i+1,d[i]);
  }
  
  return 0;
  
}

void bfs(x){
  int v,u;

  d[x] = 0;
  color[x] = gray;
  Q.head = Q.tail = 0;
  enqueue(x);

  while(Q.tail < n){
    u = dequeue();
    if(u == INF)break;
    for(v=0;v<n;v++){
      if(g[u][v] == 0)continue;
      if(color[v] == white){
	d[v] = d[u] + 1;
	color[v] = gray;
	enqueue(v);
      }
    }
    color[u] = black;
  }
}

void enqueue(int x){

  if(Q.tail >= n)return;
  
  Q.data[Q.tail] = x;
  Q.tail++;
  
}

int dequeue(){
  int x;

  if(Q.head == Q.tail)return INF;

  x = Q.data[Q.head];
  Q.head++;

  return x;
  
}



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

using namespace std;
using ll = long long;
using ld = long double;
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define reps(i,s,n) for(int i=(int)(s);i<(int)(n);i++)
#define allsort(v) sort(v.begin(),v.end())
#define allsortg(v)sort(v.begin(),v.end(),greater<int>());
const ll mod = 1e9 + 7;
const int INF = 1e9;

int main() {
	cin.sync_with_stdio(false);
	int A, B;
	cin >> A >> B;
	if (A % 3 == 0 || B % 3 == 0 || (A + B) % 3 == 0)cout << "Possible" << "\n";
	else cout << "Impossible" << "\n";
	return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define int long long
using namespace std;
constexpr int mod=1e9+7;
signed main(){
    int n,a[200000],sum=0;
    cin>>n;
    for(int i=0;i<n;i++){
        cin>>a[i];
        sum+=a[i];
    }
    int tmp=0,ans=mod*mod;
    for(int i=1;i<n;i++){
        tmp+=a[i-1];
        ans=min(ans,abs(sum-tmp-tmp));
    }
    cout<<ans<<endl;
}


Measured memory_bytes: 1792
N,K = map(int,input().split())
P = [0 for i in range(N)]
for i in range(K):
    a = int(input())
    b = list(map(int,input().split()))
    for j in range(a):
      P[b[j]-1] = 1 
m = 0   
for i in range(N):
    if P[i] == 0:
        m += 1
print(m)

Measured memory_bytes: 9184
//From Naruto to Hokage
//#include <RJ>
#include<bits/stdc++.h>
using namespace std;

#define ll          long long
#define pb          push_back
#define eb          emplace_back
#define endl        '\n'
#define mii         map<ll,ll>
#define pii         pair<ll,ll>
#define vi          vector<ll>
#define all(a)      (a).begin(),(a).end()
#define F           first
#define S           second
#define sz(x)       (ll)x.size()
#define hell        1000000007
#define INF         (1ll<<60)
#define rep(i,a,b)  for(ll i=a;i<=b;i++)
#define rrep(i,a,b)  for(ll i=a;i>=b;i--)
#define present(c,x) ((c).find(x) != (c).end())
#define cpresent(c,x) (find(all(c),x) != (c).end())
#define ios ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define time        cerr << "\nTime elapsed: " << 1000 * clock() / CLOCKS_PER_SEC << "ms\n";
ll gcd(ll a, ll b) { return b == 0 ? a : gcd(b, a % b); }
ll lcm(ll a, ll b) { return a * (b / gcd(a, b)); }
const int N=100005;
void solve(){
    ll n;
    cin>>n;
    cout<<(n*(n-1))/2;
}
signed main()
{
    ios
    int TESTS=1;
    //cin>>TESTS;
    while(TESTS--){
        solve();
    }
    time
    return 0;
}

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

using namespace std;

struct Point{
	double x,y;
	Point(double x=0.0,double y=0.0):x(x),y(y){}
};

typedef Point Vector;

double cross(Vector a,Vector b){
	return a.x*b.y-a.y*b.x;
}

int main(){
	double x1,y1,x2,y2,x3,y3,xp,yp;
	while(~scanf("%lf %lf %lf %lf %lf %lf %lf %lf",&x1,&y1,&x2,&y2,&x3,&y3,&xp,&yp)){
		Vector v1(x2-x1,y2-y1),v2(x3-x2,y3-y2),v3(x1-x3,y1-y3);
		Vector u1(xp-x1,yp-y1),u2(xp-x2,yp-y2),u3(xp-x3,yp-y3);
		if (cross(v1,u1)*cross(v2,u2)>0 && cross(v2,u2)*cross(v3,u3)>0){
			printf("YES\n");
		}else{
			printf("NO\n");
		}
	}
	return 0;
}

Measured memory_bytes: 1196
#include <bits/stdc++.h>
using namespace std;
using ll=long long;
#define rep(i,n) for (ll i=0; i<n; ++i)
#define all(c) begin(c),end(c)
#define PI acos(-1)
#define oo LLONG_MAX
template<typename T1, typename T2>
bool chmax(T1 &a,T2 b){if(a<b){a=b;return true;}else return false;}
template<typename T1, typename T2>
bool chmin(T1 &a,T2 b){if(a>b){a=b;return true;}else return false;}
/*
26^5+
26^4 * 25^1 * 3H1+
26^3 * 25^2 * 3H2+
26^(K-i) * sHi

ｎＨｒ＝n+r-1Cｒ

26^5 * 25^0 * 3H0 +
26^4 * 25^1 * 3H1 +
26^3 * 25^2 * 3H2 +
...
26^(K-i) * 25^i * sHi


*/

const int MAX =2000010;
const int MOD = 1000000007;

long long fac[MAX], finv[MAX], inv[MAX];

void COMinit(){
  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;
  }
}

ll COM(int n, int k){
  if(n<k)
    return 0;
  if(n<0 || k<0)
    return 0;
  return fac[n]*(finv[k]*finv[n-k]%MOD)%MOD;
}

int main(){
  cin.tie(0);
  ios::sync_with_stdio(0);
  COMinit();
  
  ll K; cin >> K;
  string S; cin >> S;
  ll ssz = S.size();
  ll ans = 0;
  vector<ll> pre(1000001, 1), prem(10000001, 1);
  for(ll i=1; i<=1000000; i++){
    pre[i] = pre[i-1] * 26;
    pre[i] %= MOD;
    prem[i] = prem[i-1] * 25;
    prem[i] %= MOD;
  }
  rep(i, K+1){
    ll tmp;
    tmp = pre[K-i];
    tmp *= prem[i];
    tmp %= MOD;
    tmp *= COM(ssz + i - 1, i);
    tmp %= MOD;
    ans += tmp;
    ans %= MOD;
  }
  cout << ans << endl;
//26^(K-i) * sHi
//ｎＨｒ＝n+r-1 Cｒ
}


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

int main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    //freopen("input.txt","r", stdin);
    //freopen("output.txt","w",stdout); 
    
    int n; cin>>n;
    double d ; cin>>d;
    int ans = 0;
    for(int i=1;i<=n;i++)
    {
       double x,y; cin>>x>>y;
       if(x*x+y*y<=d*d)
       {
         //cout<<x<<" "<<y<<endl;
         ans++;
       }
    }

    cout<<ans;
    
}   
   

Measured memory_bytes: 3736
#include<iostream>
#include<algorithm>
#include<vector>
#include<string>
#include<cctype>
using namespace std;
#define rep(i,n) for(int i = 0 ; i < (n) ; ++i )
vector<int>card;
int ans;
void bfs(int now,int sum){
  if(sum > 21) return;
  if(now == card.size()){
    ans = max(ans,sum);
    return;
  }
  bfs(now+1,sum+min(card[now],10));
  if(card[now] == 1) bfs(now+1,sum+11);
}
int main(){
  string s;
  while(getline(cin,s) , s != "0"){
    card.clear();
    ans = 0;
    int a = 0;
    rep(i,s.size()){
      if(isdigit(s[i])) a = a * 10 + s[i] - '0';
      else if(s[i] == ' '){
        card.push_back(a);
        a = 0;
      }
    }
    card.push_back(a);

    bfs(0,0);
    cout << ans << endl;
  }
}

Measured memory_bytes: 1204
# -*- coding: utf-8 -*-

# input
M, D = map(int, input().split())

# solve
ans = 0
for i in range(1, M + 1):
    for j in range(1, D + 1):
        d = str(j)
        if len(d) == 2:
            d1 = int(d[1])
            d10 = int(d[0])
            if d1 >= 2 and d10 >= 2 and d1 * d10 == i:
                ans += 1

# output
print(ans)


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

int main()
{
    int64_t ans1,ans2,a,b,x;

    cin >> a >> b>>x;

    ans2=b/x;
    ans1=a/x;
    if(a%x==0)cout << ans2-ans1+1 <<endl;
    else cout << ans2-ans1 <<endl;

}

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

int main()
{
        int a, b;
        cin >> a >> b;
        if (a == b) {
                cout << "a == b" << endl;
        }
        else if (a > b) {
                cout << "a > b" << endl;
        }
        else {
                cout << "a < b" << endl;
        }
}



Measured memory_bytes: 3096
N = int(input())
A = list(map(int, input().split()))
Amin = 10**9
ans = 0
counter = 0
for i in range(N):
  if(A[i] < 0):
    counter = counter + 1
  a = abs(A[i])
  ans += a
  Amin = min(a, Amin)
    
if(counter%2 == 1):
    ans -= 2*Amin
  
print(ans)


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

int main(){
    int n,k;
    cin >> n >> k;
    string s;
    cin >> s;
    locale l =locale::classic();
    REP(i,n)
    {
        if(i==(k-1)){
            cout << tolower(s[i], l);
        }else{
            cout << s[i];
        }
    }
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  vector<int> math(N);
  for (int i = 0; i < N; i++) {
    cin >> math.at(i);
  }
  double s = 0;
  for (int i = 0; i < N; i++) {
    s = s + (1.0 / math.at(i));
  }
  double w = 1 / s;
  cout << w << endl;
}

Measured memory_bytes: 256