akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
// iostream is too mainstream
#include <cstdio>
// bitch please
#include <iostream>
#include <algorithm>
#include <cstdlib>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <list>
#include <cmath>
#include <iomanip>
#include <time.h>
#define dibs reserve
#define OVER9000 1234567890
#define ALL_THE(CAKE,LIE) for(auto LIE =CAKE.begin(); LIE != CAKE.end(); LIE++)
#define tisic 47
#define soclose 1e-8
#define chocolate win
// so much chocolate
#define patkan 9
#define ff first
#define ss second
#define abs(x) (((x) < 0)?-(x):(x))
#define uint unsigned int
#define dbl long double
#define pi 3.14159265358979323846
using namespace std;
// mylittledoge

using cat = long long;

#ifdef DONLINE_JUDGE
	// palindromic tree is better than splay tree!
	#define lld I64d
#endif

int main() {
	cin.sync_with_stdio(0);
	cin.tie(0);
	cout << fixed << setprecision(10);
	int N, M;
	cin >> N >> M;
	vector<int> deg(N, 0);
	vector< vector<int> > G(N);
	for(int i = 0; i < M; i++) {
		int u, v;
		cin >> u >> v;
		deg[--u]++;
		deg[--v]++;
		G[u].push_back(v);
		G[v].push_back(u);
	}
	int cnt2 = 0, cnt3p = 0;
	for(int i = 0; i < N; i++) {
		if(deg[i]&1) {
			cout << "No\n";
			return 0;
		}
		if(deg[i] >= 6) cnt3p++;
		if(deg[i] == 4) cnt2++;
	}
	if(cnt3p >= 1 || cnt2 >= 3) {
		cout << "Yes\n";
		return 0;
	}
	if(cnt2 <= 1) {
		cout << "No\n";
		return 0;
	}
	for(int i = 0; i < N; i++) if(deg[i] == 4) {
		for(int j = 0; j < 4; j++) {
			int cur = G[i][j], prev = i;
			if(deg[cur] == 4) continue;
			while(true) {
				int nxt = G[cur][0]+G[cur][1]-prev;
				prev = cur;
				cur = nxt;
				if(deg[cur] == 4) break;
			}
			if(cur != i) continue;
			cout << "Yes\n";
			return 0;
		}
		cout << "No\n";
		return 0;
	}
	return 0;
}

// look at my code
// my code is amazing


Measured memory_bytes: 6144
use std::io::stdin;

fn main() {
    let mut s = String::new();
    stdin().read_line(&mut s).ok();
    let n: i64 = s.trim().parse::<i64>().unwrap() % 10;

    println!(
        "{}",
        if n == 3 {
            "bon"
        } else if [2, 4, 5, 7, 9].contains(&n) {
            "hon"
        } else {
            "pon"
        }
    );
}


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

#define rep(i,n) for(int i=0;i<(int)n;i++)
#define all(c) (c).begin(),(c).end()
#define mp make_pair
#define pb push_back
#define each(i,c) for(__typeof((c).begin()) i=(c).begin();i!=(c).end();i++)
#define dbg(x) cerr<<__LINE__<<": "<<#x<<" = "<<(x)<<endl

using namespace std;

typedef long long ll;
typedef vector<int> vi;
typedef pair<int,int> pi;
const int inf = (int)1e9;
const double INF = 1e12, EPS = 1e-9;

char in[1000100];

int main(){
	fgets(in, sizeof(in), stdin);
	vector<pi> v;
	int cnt = 0, ans = 0;
	
	for(int i = 0; ; i++){
		if(i && in[i] != in[i - 1]){
			v.pb(mp(in[i - 1], cnt));
			cnt = 1;
		}
		else cnt++;
		if(!in[i]) break;
	}
	
	rep(i, v.size() - 2) if(v[i].first == 'J'
		&& v[i + 1].first == 'O'
		&& v[i + 2].first == 'I'){
		
		if(v[i + 1].second <= v[i].second && v[i + 1].second <= v[i + 2].second)
		ans = max(ans, v[i + 1].second);
	}
	
	cout << ans << endl;
	
	return 0;
}

Measured memory_bytes: 11904
N = int(input())
A,B = map(int,input().split(" "))
P = list(map(int,input().split(" ")))

one,two,three = 0,0,0
for i in range(N):
    if P[i] <= A:
        one += 1
    elif P[i] > A and P[i] <= B:
        two += 1
    else:
        three += 1


print(min([one,two,three]))

Measured memory_bytes: 38256
#include <iostream>
#include <string>
#include <vector>
#include <sstream>
#include <cstdlib>
#include <algorithm>

using namespace std;

string ItoS(int num){
  stringstream ss;
  ss << num;
  return ss.str();
}

int main(){
  unsigned int a0;
  unsigned int L;
  
  while(cin >> a0 >> L, a0 || L){
    vector<string> a;
    a.push_back(ItoS(a0));
    bool eq = false;
    for(int i=0; 1; i++){
      int keta = 0;
      if(a[i].length() != L){
	keta = L-a[i].length();
      }
      string smin = a[i];
      string smax = a[i];
      sort(smin.begin(), smin.end());
      sort(smax.begin(), smax.end(), greater<char>());
      for(int j=0; j<keta; j++){
	smax.push_back('0');
      }
      int min = atoi(smin.c_str());
      int max = atoi(smax.c_str());
      int sa = max - min;
      for(int j=0; j<i+1; j++){
	if(ItoS(sa) == a[j]){
	  cout << j << " " << a[j] << " " << i+1-j << endl;
	  eq = true;
	  break;
	}
      }
      if(eq){
	break;
      }
      a.push_back(ItoS(sa));
    }
  }
  return 0;
}

Measured memory_bytes: 1248
#include <stdio.h>  
#include <algorithm>  
#include <assert.h>
#include <bitset>
#include <cmath>  
#include <complex>  
#include <deque>  
#include <functional>  
#include <iostream>  
#include <limits.h>  
#include <map>  
#include <math.h>  
#include <queue>  
#include <set>  
#include <stdlib.h>  
#include <string.h>  
#include <string>  
#include <time.h>  
#include <unordered_map>  
#include <unordered_set>  
#include <vector>  
#include <chrono>
#include <random>
#include <time.h>
#define ll long long
#define rep2(i,a,b) for(ll i=a;i<=b;++i)
#define rep(i,n) for(ll i=0;i<n;i++)
#define rep3(i,a,b) for(ll i=a;i>=b;i--)
#define pii pair<int,int>
#define pll pair<ll,ll>
#define pq priority_queue<int>
#define pqg priority_queue<int,vector<int>,greater<int>>
#define pb push_back
#define vec vector<int>
#define vecll vector<ll>
#define vecpii vector<pii>
#define endl "\n"
#define all(c) begin(c),end(c)
using namespace std;
int in() {int x;scanf("%d",&x);return x;}
ll lin() {ll x;scanf("%lld",&x);return x;}

#define INF 1e9+7
#define LLINF 1e18+7
#define N 500000
ll MOD=1e9+7;
vec mem(20,-1);
main(){
    int n=in();
    int a=in(),b=in(),c=in(),d=in();
    string s;
    cin>>s;
    vec v;
    v.pb(0);
    rep(i,n)if(s[i]=='.')v.pb(1);else v.pb(0);
    rep2(i,b,d-1){
        if(!v[i]&&!v[i+1]){
            cout<<"No";return 0;
        }
    }
    rep2(i,a,c-1){
        if(!v[i]&&!v[i+1]){
            cout<<"No";return 0;
        }
    }
    if(c>d){
        bool flag=false;
        rep2(i,b,d){
            if(v[i-1]&&v[i+1]&&v[i])flag=true;
        }
        if(!flag){cout<<"No";return 0;}
    }
    cout<<"Yes";
}



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

int main(){

  long long i,ans=0;
  string c;
  cin>>c;
  for(i=0;i<c.size();i++){

    ans=ans+((int)c[i]-48);
    //cout<<ans<<endl;
  }

  if(ans%9==0){
    cout<<"Yes"<<endl;
  }
  else{
      cout<<"No"<<endl;
  }
  return 0;
}


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

typedef unsigned long long ull;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<double, double> pdd;
const ull mod = 1e9 + 7;
#define REP(i,n) for(int i=0;i<(int)n;++i)

//debug
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;

template<class S, class T> ostream& operator << (ostream& os, const pair<S, T> v){
  os << "(" << v.first << ", " << v.second << ")"; return os;
}
template<class T> ostream& operator << (ostream& os, const vector<T> v){
  for(int i = 0; i < v.size(); i++){if(i > 0){os << " ";} os << v[i];} return os;
}
template<class T> ostream& operator << (ostream& os, const vector<vector<T>> v){
  for(int i = 0; i < v.size(); i++){if(i > 0){os << endl;} os << v[i];} return os;
}

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

    string s, t;
    cin >> s >> t;
    vector<ll> dict[26];
    ll N = s.size(), M = t.size();

    REP(i, N){
        dict[s[i]-'a'].push_back(i+1);
    }

    ll res = 0;
    ll now = 0;
    REP(i, M){
        ll cha = t[i] - 'a';
        auto itr = upper_bound(dict[cha].begin(), dict[cha].end(), now);
        if(itr == dict[cha].end()){
            itr = upper_bound(dict[cha].begin(), dict[cha].end(), 0);
            if(itr == dict[cha].end()){
                cout << -1 << endl;
                return 0;
            }
            res += N;
            now = *itr;
        }else{
            now = *itr;
        }
    }
    res += now;

    cout << res << endl;

    return 0;
}

Measured memory_bytes: 1736
#include<stdio.h>
int main()
{
	int A,B,C;
	char op;
	scanf("%d %c %d",&A,&op,&B);
	switch(op)
	{
	case'+':
		C=A+B;
		printf("%d\n",C);
		break;
		case'-':
			C=A-B;
			printf("%d\n",C);
			break;
		}
	return 0;
}

Measured memory_bytes: 128
n = int(input())
a = [list(map(int,input().split())) for i in range(2)]
s1 = sum(a[0])
s2 = sum(a[1])
now = s2+a[0][0]
ans = now
for j in range(1,n):
	now =now-a[1][j-1]+a[0][j]
	ans =max(ans,now)
print(ans)




Measured memory_bytes: 3060
#include <bits/stdc++.h>
using namespace std;
 
long long dp[1<<17][3];
 
int main () {
  ios_base::sync_with_stdio(false); cin.tie(0);

  int n; cin >> n;

  for (int i = 1; i <= n; ++i) {
    int fun[3]; 
    for (int j = 0; j < 3; ++j) {
      cin >> fun[j];
      for (int k = 0; k < 3; ++k) if (j != k) {
        dp[i][j] = max(dp[i - 1][k] + fun[j], dp[i][j]);
      }
    }
  }
  cout << *max_element(dp[n], dp[n] + 3) << '\n';
}


Measured memory_bytes: 2688
#include <cstdio>
#include <cstring>
#include <iostream>
#include <string>
#include <cmath>
#include <bitset>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <algorithm>
#include <complex>
#include <unordered_map>
#include <random>
using namespace std;
typedef long long int ll;
typedef pair<int, int> P;
int main()
{
	int x, y;
	cin>>x>>y;
	cout<<x+y/2<<endl;
	return 0;
}

Measured memory_bytes: 256
import sys

sys.setrecursionlimit(10**9)

h, k = map(int, input().split())
hi = list(map(int, input().split()))
hi.sort(reverse=True)
del hi[:k]

num = 0
if hi == []:
    print(0)
else:
    for i in hi:
        num += i
    print(num)


Measured memory_bytes: 26024
import java.util.*;
import static java.lang.System.*;
import static java.lang.Math.*;
public class Main {
public static void main(String[] args){
Scanner sc = new Scanner(in);
    int w = Integer.parseInt(sc.next());
    int a = Integer.parseInt(sc.next());
    int b = Integer.parseInt(sc.next());
    if(a>b+w||b>a+w){
    out.println(min(abs(a+w-b),abs(b+w-a)));
}else{
        out.println(0);
    }
}
}

Measured memory_bytes: 21716
#include <iostream>
#include <algorithm>

using namespace std;

int main() {
	int n, k;
	scanf("%d %d", &n, &k);
	int *a = new int[n];
	for (int i = 0; i < n; i++) {
		scanf("%d", &a[i]);
	}
	int res = 1e9;
	sort(a, a + n);
	for (int i = 0; i <= n - k; i++) {
		res = min(res, a[i + k - 1] - a[i]);
	} 
	printf("%d\n", res);
	return 0;
}

Measured memory_bytes: 640
#include<bits/stdc++.h>
#define FAST_IO ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define INF (1e10+5)
#define F first
#define S second
#define pb push_back
#define MP make_pair
#define FRL(i,a,n) for(i=a;i<n;i++)
#define FR(i,n) FRL(i,0,n)
#define RFRL(i,n) for(i=n;i>=0;i--)
#define MOD 1000000007
#define fill(a) memset(dp,a,sizeof(dp));

using namespace std;

typedef long long int  ll;

typedef vector<ll> vi;
typedef pair<ll,ll> pi;
typedef vector< pair<ll,ll> > vpi;
typedef set<ll> st;
typedef map<ll,ll> mp;
typedef unordered_map<ll,ll> ump;

template< class T>
T minn(T a,T b)
{
	return (a>b)?b:a;
}
template< class T>
T maxx(T a,T b)
{
	return (a>b)?a:b;
}


void FILE_OP()
{
	#ifndef ONLINE_JUDGE
        freopen("inputf.txt", "r", stdin);
        freopen("output2.txt", "w", stdout);
    #endif
}
ll binpow(ll a, ll b) {
    ll res = 1;
    while (b > 0) {
        if (b & 1)
            res = res * a;
        a = a * a;
        b >>= 1;
    }
    return res;
}

void SOLVE()
{

	
	ll tt,m,i,j,k,a,b,c,d,l,r;
	//cin>>tt;
	tt=1;
	//fill(-1)
	ll n,W;
    
    //ll dp[100010];
	while(tt--)
	{
		cin>>n>>a>>b;
		ll ans=(n/(a+b))*a;

		if((n%(a+b)) > 0)
		{
			n=(n%(a+b));
			//cout<<n<<"\n";
			if(a<n)
				ans+=a;
			else
				ans+=n;
		}
		cout<<ans<<"\n";
		
	}


		
}

int main()
{
	FAST_IO
	//FILE_OP();
	SOLVE();
	
	return 0;
}


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

string change(string s){
    if(s == "A") return "a";
    else if(s == "B") return "b";
    else return "c";
}

int main(){
    int N,K;
    cin >> N >> K;
    string S;
    cin >> S;
    for (int n=0; n<N; n++){
        if(n == K-1){
            string s=S.substr(n,1);
            cout << change(s);
        }
        else cout << S.substr(n,1);
    }
    cout << endl;
}


Measured memory_bytes: 256
/*
ID: learnin7
TASK: test
LANG: C++                 
*/
/* LANG can be C++11 or C++14 for those more recent releases */
#include<bits/stdc++.h>

using namespace std;
typedef long long ll;

int main(){
        
    ios_base::sync_with_stdio(0);
    //ofstream fout ("test.out");
    //ifstream fin ("test.in");
    //fin >> a >> b;
    //fout << a+b << endl;
    int n;
    cin>>n;
    ll a[n];
    ll sum=0;
    for(int i=0;i<n;i++){
        cin>>a[i];
        sum += a[i]; 
    }
    ll mini = LONG_MAX;
    ll s=0;
    for(int i=0;i<n;i++){
        s += a[i];
        ll d = sum -s;
        mini = min(mini, abs(s-d));
    }
    cout<<mini<<endl;
    return 0;
}



Measured memory_bytes: 1792
###==================================================
### import
#import bisect
#from collections import Counter, deque, defaultdict
#from copy import deepcopy
#from functools import reduce, lru_cache
#from heapq import heappush, heappop
#import itertools
#import math
#import string
import sys
### stdin
def input(): return sys.stdin.readline().rstrip()
def iIn(): return int(input())
def iInM(): return map(int, input().split())
def iInM1(): return map(int1, input().split())
def iInLH(): return list(map(int, input().split()))
def iInLH1(): return list(map(int1, input().split()))
def iInLV(n): return [iIn() for _ in range(n)]
def iInLV1(n): return [iIn()-1 for _ in range(n)]
def iInLD(n): return [iInLH() for _ in range(n)]
def iInLD1(n): return [iInLH1() for _ in range(n)]
def sInLH(): return list(input().split())
def sInLV(n): return [input().rstrip('\n') for _ in range(n)]
def sInLD(n): return [sInLH() for _ in range(n)]
### stdout
def OutH(lst, deli=' '): print(deli.join(map(str, lst)))
def OutV(lst): print('\n'.join(map(str, lst)))
### setting
sys.setrecursionlimit(10 ** 6)
### utils
int1 = lambda x: int(x) - 1
### constants
INF = int(1e9)
MOD = 1000000007
dx = (-1, 0, 1, 0)
dy = (0, -1, 0, 1)
###---------------------------------------------------

a = iIn()
s = input()

if a >= 3200:
    print(s)
else:
    print('red')

Measured memory_bytes: 62076
from itertools import product

N = int(input())
x, y, h = [None] * N, [None] * N, [None] * N
for i in range(N):
    x[i], y[i], h[i] = map(int, input().split())

max_i = h.index(max(h))
for cx, cy in product(range(101), repeat=2):
    H = h[max_i] + abs(x[max_i] - cx) + abs(y[max_i] - cy)
    ok = True
    for i in range(N):
        if h[i] != max(H - abs(x[i] - cx) - abs(y[i] - cy), 0):
            ok = False
            break
    if ok:
        print(cx, cy, H)
        break


Measured memory_bytes: 3188
#include <bits/stdc++.h>
#define rep(i,n) for(int i = 0; i < n; i++)
#define mrep(i,j,n) for(int i = j; i < n; i++)
#define reps(i,n) for(int i = 1; i <= n; i++)
#define rrep(i,n) for(int i = n-1; i >= 0; i--)
#define rreps(i,n) for(int i = n; i >= 1; i--)
#define co(x) cout << x <<endl
#define cs(x) cout << x <<" "
#define cer(x) cerr << x <<endl
#define all(x) (x).begin(),(x).end()
#define sz(x) ((int)(x).size())
#define ERASE(x,val) x.erase(remove(ALL(x), val), x.end())

typedef long long ll;
typedef unsigned long long ull;
using namespace std;
ll mod = 1e9 + 7;
template<class T>inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; }return false; }
template<class T>inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; }return false; }

int main()
{
	int n; cin >> n;
	string s; cin >> s;
	vector<int>lb(n + 1, 0);
	vector<int>rw(n + 1, 0);
	reps(i, n)
	{
		lb[i] = s[i-1] == '#' ? lb[i-1] + 1 : lb[i-1];
	}
	rrep(i, n)
	{
		if (i == n-1)rw[i] = s[i] == '.' ? 1 : 0;
		else rw[i] = s[i] == '.' ? rw[i + 1] + 1 : rw[i + 1];
	}
	int ans = n;
	rep(i, n + 1)chmin(ans, lb[i] + rw[i]);
	co(ans);
	return 0;
}


Measured memory_bytes: 2180
N=int(input())
prev=[0,0,0]
for i in range(N):
  t,x,y=map(int,input().split())
  dis = abs(x-prev[0]) + abs(y -prev[1])
  time= t-prev[2]
  if dis <= time and (time-dis)%2==0:
    prev=[x,y,t]
  else:
    print("No")
    exit(0)
print("Yes")
  

Measured memory_bytes: 3060
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>

#define x first
#define y second
#define ndl '\n'
#define mp make_pair
#define mt make_tuple
#define pb push_back
#define up_b upper_bound
#define low_b lower_bound
#define sz(x) (int)x.size()
#define bit __builtin_popcount
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()

using namespace std;
using namespace __gnu_pbds;

template<typename T> using indexed_set = tree <T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());

typedef long long ll;
typedef long double ld;
typedef unsigned int uint;
typedef unsigned long long ull;
typedef pair<ll, ll> pll;
typedef pair<int, int> pii;
typedef pair<int, ll> pil;
typedef pair<ll, int> pli;
typedef pair<int, ull> piu;
typedef vector<vector<int>> matrix;

const ll INF = 1e18 + 123;
const ld EPS = 1e-9;
const int inf = 1e9 + 123;
const int MOD = 1e9 + 7;
const int N = 5e5 + 123;
const int M = 1e6 + 123;
const double pi = acos(-1.0);
const int dx[] = {0, 0, 1, -1};
const int dy[] = {1, -1, 0, 0};

string s;
int a[N];

void solve(){
    int n;
    cin >> n;
    cin >> s;
    int r = 0, g = 0, b = 0;
    map<char, int> id;
    id['R'] = 1;
    id['G'] = 10;
    id['B'] = 100;
    for (int i = 0; i < n; i++){
        r += s[i] == 'R';
        g += s[i] == 'G';
        b += s[i] == 'B';
        a[i] = id[s[i]];
       // cout << a[i] << " ";
    }
    ll ans = 1ll*r*g*b;
    for (int i = 0; i < n; i++){
        for (int j = 1; j <= i && i + j < n; j++){
            if (a[i] + a[i-j] + a[i+j] == 111) ans--;
        }
    }
    cout << ans;
}

int main(){
    #ifdef KAZAKH
        freopen("input.txt", "r", stdin);
    #endif
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    int t = 1;
    //cin >> t;
    for (int i = 1; i <= t; i++){
        //cout << "case #" << i << ": ";
        solve();
    }
    return 0;
}


Measured memory_bytes: 3684
#include<iostream>
#include<cstdio>
#include<cstring>
using namespace std;
const int maxn = 2005, inf = 1e9 + 5;
int dp[maxn][2], a[maxn];
inline int ABS(int x){return x>=0?x:-x;}
int main(){
//    freopen("e:\\in.txt","r",stdin);
    memset(dp, 0, sizeof(dp));
    int n, z, w;
    cin>>n>>z>>w;
    for(int i = 1; i <= n; i++)cin>>a[i];
    dp[n-1][0] = dp[n-1][1] = ABS(a[n-1] - a[n]);
    for(int i = n - 2; i >= 1; i--){
        dp[i][0] = ABS(a[i] - a[n]);
        for(int k = i + 1; k <= n-1; k++){
            dp[i][0] = max(dp[i][0], dp[k][1]);
        }
        dp[i][1] = ABS(a[i] - a[n]);
        for(int k = i + 1; k <= n-1; k++){
            dp[i][1] = min(dp[i][1], dp[k][0]);
        }
    }
    int ans = ABS(a[n] - w);
    for(int i = 1; i <= n - 1; i++)
        ans = max(ans, dp[i][1]);
    cout<<ans<<endl;
    return 0;
}



Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll N=5e5+5;
int main(){
    ios_base:: sync_with_stdio(false);
    cin.tie(NULL); cout.tie(NULL);
    string s;cin>>s;
    for(auto &ch:s){
        if(ch=='?')ch='D';
        cout<<ch;
    }
}


Measured memory_bytes: 3784
#include <bits/stdc++.h>
#define rep(i,n) for(int i = 0; i < (int)(n); i++)
#define rrep(ri,n) for(int ri = (int)(n-1); ri >= 0; ri--)
#define rep2(i,x,n) for(int i = (int)(x); i < (int)(n); i++)
#define repit(itr,x) for(auto itr = x.begin(); itr != x.end(); itr++)
#define rrepit(ritr,x) for(auto ritr = x.rbegin(); ritr != x.rend(); ritr++)
#define ALL(n) begin(n), end(n)
using ll = long long;
using namespace std;

int main(){
	char c;
	cin >> c;
	c++;
	cout << c << endl;
	return 0;
}

Measured memory_bytes: 256
n = gets.chomp.to_i
ss = (0...n).map { gets.chomp }

ab = ss.map { |s| s.scan('AB').length }.inject(&:+)
xa = ss.select { |s| s[0] != 'B' && s[-1] == 'A' }.length
ba = ss.select { |s| s[0] == 'B' && s[-1] == 'A' }.length
bx = ss.select { |s| s[0] == 'B' && s[-1] != 'A' }.length

if xa == 0 && bx == 0
  if ba == 0
    puts(ab)
  else
    puts(ab + ba - 1)
  end
else
  puts(ab + ba + [xa, bx].min)
end


Measured memory_bytes: 4604
import java.util.Arrays;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		
		Scanner sc = new Scanner(System.in);
		while(true){
			
			int n = sc.nextInt();
			if(n==0) {
				sc.close();
				break;
				
			}
			
			int[] a = new int[n];
			int[] b = new int[n];
			Arrays.fill(a, 0);
			Arrays.fill(b, 0);
			
			int a_score=0;
			int b_score=0;
			
		
			for(int i=0; i<n; i++){
				a[i] = sc.nextInt();
				b[i] = sc.nextInt();
			}
		
			
		
			for(int i=0; i<n; i++){
				if(a[i] > b[i]){
					a_score += a[i]+b[i];
				}else if(a[i] == b[i]){
					a_score += a[i];
					b_score += b[i];
				}else{
					b_score += a[i]+b[i];
				}
			}
			
			System.out.println(a_score + " " + b_score);

		}
		
	}

}

Measured memory_bytes: 51636
#include <bits/stdc++.h>
//#include <ext/pb_ds/assoc_container.hpp>
//#include <ext/pb_ds/tree_policy.hpp>
#define mp				make_pair
#define pb				push_back
#define all(a)			(a).begin(), (a).end()
#define sz(a)			a.size()
#define md(a, b)		((a) % b + b) % b
#define mod(a)			md(a, MOD)
#define srt(a)			sort(all(a))
#define mem(a, h)		memset(a, (h), sizeof(a))
#define f 				first
#define s 				second
#define forn(i, n)			for(int i = 0; i < n; i++)
#define fore(i, b, e)	for(int i = b; i < e; i++)
#define forg(i, b, e, m)	for(int i = b; i < e; i+=m)
//int in(){int r=0,c;for(c=getchar();c<=32;c=getchar());if(c=='-') return -in();for(;c>32;r=(r<<1)+(r<<3)+c-'0',c=getchar());return r;}

using namespace std;
//using namespace __gnu_pbds;

typedef long long 		ll;
typedef long double ld;	
typedef unsigned long long 		ull;
typedef pair<int, int>  ii;
typedef vector<int>     vi;
typedef vector<ii>      vii;
typedef vector<ll>      vll;
//typedef tree<int,null_type,less<int>,rb_tree_tag,tree_order_statistics_node_update> ordered_set;
//find_by_order kth largest  order_of_key <
const int tam = 100010;
const int MOD = 1000000007;
const int MOD1 = 998244353;
const double EPS = 1e-9;
const double PI = acos(-1); 
int main()
{
	ios::sync_with_stdio(0); cin.tie(0);
	//freopen("asd.txt", "r", stdin);
	//freopen("qwe.txt", "w", stdout);
	int n;
	cin>>n;
	int a;
	int res = 0;
	fore(i, 1, n + 1)
	{
		cin>>a;
		res += !!(a & 1) && (!!(i & 1));
	}
	cout<<res<<'\n';
	return 0;
}

// read the question correctly (is y a vowel? what are the exact constraints?)
// look out for SPECIAL CASES (n=1?) and overflow (ll vs int?) ARRAY OUT OF BOUNDSS2	

Measured memory_bytes: 3624
while True:
  try:
    ss = input().split()
    stack = []

    for s in ss:
      if s == "+":
        a, b = stack.pop(), stack.pop()
        stack.append(b + a)
      elif s == "-":
        a, b = stack.pop(), stack.pop()
        stack.append(b - a)
      elif s == "*":
        a, b = stack.pop(), stack.pop()
        stack.append(b * a)
      elif s == "/":
        a, b = stack.pop(), stack.pop()
        stack.append(b / a)
      else:
        stack.append(int(s))

    print(stack[0])

  except EOFError:
    break


Measured memory_bytes: 5616
a = int(input())
if a >= 400 and a <= 599: print('8')
elif a >= 600 and a <= 799: print('7')
elif a >= 800 and a <= 999: print('6')
elif a >= 1000 and a <= 1199: print('5')
elif a >= 1200 and a <= 1399: print('4')
elif a >= 1400 and a <= 1599: print('3')
elif a >= 1600 and a <= 1799: print('2')
else: print('1')

Measured memory_bytes: 9184
# include <bits/stdc++.h>
using namespace std; 
int main(){
  long long int r, g, b,k, x, y, temp; 
  cin>>r>>g>>b; 
  cin>>k; 
    temp=0;
    while(g<=r){
      g=2*g;
      temp++;
    }
    while(b<=g){
      b=2*b;
      temp++;
    }
    if(temp<=k){
      cout<<"Yes";
    }
    else{
      cout<<"No";
    }
  return 0;
}

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

int main(){
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n;
  cin >> n;
  long long ans = 0L;
  for(int i=1; i<=n;i++){
    if(i%3==0) continue;
    if(i%5==0) continue;
    ans += i;
  }
  cout << ans << endl;

  return 0;
}


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

int main(){
    ll n,k;
    cin >> n >> k;
    ll ans = 0;
    for(ll i = k;i <= n+1;i++){
        ll sumMin = (0+i-1)*i/2;
        ll sumMax = (n+n-i+1)*i/2;
        ans += sumMax - sumMin+1;
    }
    ans %= 1000000007;
    cout << ans << endl;
    return 0;
}

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

typedef long long ll;
typedef long double ld;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef pair<ld,ld> pdd;
typedef vector<ll> vll;
typedef vector<ld> vld;
typedef vector<pll> vpl;
typedef vector<vll> vvll;

#define ALL(a) a.begin(),a.end()
#define SZ(a) ((int)a.size())
#define FI first
#define SE second
#define REP(i,n) for(int i=0;i<((int)n);i++)
#define REP1(i,n) for(int i=1;i<((int)n);i++)
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define PB push_back
#define EB emplace_back
#define MP(a,b) make_pair(a,b)
#define SORT_UNIQUE(c) (sort(c.begin(),c.end()), c.resize(distance(c.begin(),unique(c.begin(),c.end()))))
#define GET_POS(c,x) (lower_bound(c.begin(),c.end(),x)-c.begin())
#define yes cout<<"Yes"<<endl
#define YES cout<<"YES"<<endl
#define no cout<<"No"<<endl
#define NO cout<<"NO"<<endl
#define Decimal fixed<<setprecision(20)
#define INF 1000000000
#define LLINF 1000000000000000000LL

const int inf = 1e9;
const ll linf = 1LL << 50;
const double eps = 1e-10;
const int MOD = 1e9 + 7;
const int dx[4] = {-1, 0, 1, 0};
const int dy[4] = {0, -1, 0, 1};

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

  ll n;
  cin>>n;
  vll a(n);
  REP(i,n)cin>>a[i];

  ll money=1000;
  ll nmin=a[0];
  REP(i,n){
    ll pre=a[i-1];
    if(i==0)
      continue;

    if(pre>a[i]){
      money+=money/nmin*(pre-nmin);
      nmin=a[i];
    }
  }
  money+=money/nmin*(a[n-1]-nmin);

  cout<<money<<endl;
}



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

int main() {
  long long n, k, q;
  cin >> n >> k >> q;
  vector<long long> a(q), pts(n, k - q);
  for (long long i = 0; i < q; i++) {
    cin >> a.at(i);
    pts.at(a.at(i) - 1)++;
  }
  for (long long i = 0; i < n; i++) {
    if (pts.at(i) <= 0) cout << "No" << endl;
    else cout << "Yes" << endl;
  }
}

Measured memory_bytes: 2176
var
	x,y:array[0..110] of boolean;
	a:array[0..110] of string[110];
	n,m,i,j:longint;
	ch:string[110];
begin
	readln(n,m);
	fillchar(x,sizeof(x),true);
	fillchar(y,sizeof(y),true);
	for i:=1 to n do 
	begin 
		readln(a[i]);
		if pos('#',a[i])=0 then x[i]:=false;
	end;
	for i:=1 to m do
	begin
		ch:='';
		for j:=1 to n do ch:=ch+a[j,i];
		if pos('#',ch)=0 then y[i]:=false;
	end;
	for i:=1 to n do
	begin
		for j:=1 to m do
			if (x[i] and y[j]) then write(a[i,j]);
		if x[i] then writeln;
	end;
end.

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

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

    int h, w;
    cin >> h >> w;

    char s[h][w];
 
    for (int i = 0; i < h; ++i) {
        for (int j = 0; j < w; ++j) {
            cin >> s[i][j];
        }
    }

    for (int i = 0; i < h; ++i) {
        for (int j = 0; j < w; ++j) {
            if (i == 0 || j == 0 || i == h-1 || j == w-1) continue;
            if (s[i][j] == '#' && !(s[i][j+1] == '#' ||
                                    s[i+1][j] == '#' ||
                                    s[i][j-1] == '#' ||
                                    s[i-1][j] == '#')) {
                cout << "No" << endl;
                return 0;
            }
        }
    }

    cout << "Yes" << endl;

    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main()
    {
    	cin.tie(0);
        ios::sync_with_stdio(0);
        string s,S;cin>>s;
    	for (int i = 0; i <s.size() ; ++i)
    	{
    		if(i%2==0){
              cout<<s[i];
            }
    	}
    	return 0;
    }
 

Measured memory_bytes: 592
from math import atan, pi
a, b, x = map(int, input().split())
if 2*x <= a**2*b:
    print(180 * atan(a * b ** 2 / (2 * x)) / pi)
else:
    print(180 * atan(2*(a**2*b-x)/a**3)/pi)


Measured memory_bytes: 2940
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;


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

        int flgsub = 0;
        int flag = 0;

        for (int i = 0; i < T.length(); i++) {
            T = T.substring(1,T.length()) + T.substring(0,1);
            if(T.equals(R)){
                flag =1;
            }
        }
        if(flag == 0){
            System.out.println("No");
        }else{
            System.out.println("Yes");
        }

    }
}


Measured memory_bytes: 21588
#include <cstdio>
#include <iostream>
#include <cstring>
#include <vector>
#include <algorithm>
#include <string>
#include <utility>
#include <queue>
#include <unordered_set>
#include <set>
#include <unordered_map>
#include <map>
#include <cmath>
#include <iomanip>
#include <cassert>
using namespace std;
#define sL(i) i << 1
#define sR(i) i << 1 | 1
#define mp make_pair
#define pb push_back
typedef long long ll;
typedef pair<int,int> pi;
typedef pair<int, pair<int,int>> ppi;
const int MOD = 1e9 + 7;
const int INF = 2e9 + 5;
const int MAXN = 200010;

int n, a[MAXN], sub[MAXN] = {0};
int main() {
    cin.sync_with_stdio(0);
    cin.tie(0);
    cin >> n;
    for (int i = 2; i <= n; i++) {
        cin >> a[i];
        ++sub[a[i]];
    }
    for (int i = 1; i <= n; i++) {
        cout << sub[i] << "\n";
    }
}

Measured memory_bytes: 4692
#include <sstream>
#include <string>
#include <vector>
#include <map>
#include <algorithm>
#include <iostream>
#include <utility>
#include <set>
#include <cctype>
#include <queue>
#include <stack>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <functional>

using namespace std;

#define INF 1000000000
#define EPS 1e-9
#define PI (atan(1.0) * 4.0)

typedef pair<int, int> P;
typedef long long ll;

#define MAX_M 16
#define MAX_N 20000

int N, M;
int C[MAX_M];
int x[MAX_N];

ll dp[MAX_N+1][256];

vector<int> ans_list;

int main(){

	while (true){

		cin >> N >> M;

		if (N == 0 && M == 0)
			break;

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

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

		for (int i = 0; i < N + 1; i++){
			for (int j = 0; j <= 255; j++){
				dp[i][j] = INF;
			}
		}

		dp[0][128] = 0;

		for (int i = 0; i < N; i++){
			for (int j = 0; j <= 255; j++){
				if (dp[i][j] == INF)
					continue;
				for (int m = 0; m < M; m++){
					if (j + C[m] < 0){
						dp[i + 1][0] = min(dp[i + 1][0], dp[i][j] + (0 - x[i])*(0 - x[i]));
					}
					else if (j + C[m] > 255){
						dp[i + 1][255] = min(dp[i + 1][255], dp[i][j] + (255 - x[i])*(255 - x[i]));
					}
					else
						dp[i + 1][j + C[m]] = min(dp[i + 1][j + C[m]], dp[i][j] + (j + C[m] - x[i])*(j + C[m] - x[i]));
				}
			}
		}

		ll ans = INF;
		for (int i = 0; i <= 255; i++){
			ans = min(ans, dp[N][i]);
		}

		ans_list.push_back(ans);

	}

	for (int i = 0; i < ans_list.size(); i++){
		cout << ans_list[i] << endl;
	}

	return 0;

}

Measured memory_bytes: 41296
#include <bits/stdc++.h>
#include <random>
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define rep1(i,n) for (int i = 1; i <= (n); ++i)

using namespace std;
using ll = long long;
using P = pair<ll,ll>;
using ull= unsigned long long;
const ll K_MAX=1e5+5;
const ll Lmax=ll(1e18);
const int Nmax=2e5+1;
const int Nd=61;
const int INF=1e5;

// GCD, LCM
// https://youtu.be/8lm8o8L9Bmw?t=2285
// https://youtu.be/XI8exXVxZ-Q?t=3595
// https://youtu.be/F2p_e6iKxnk?t=843
ll gcd(ll a, ll b) { return b?gcd(b,a%b):a;} //最大公約数
ll lcm(ll a, ll b) { return a/gcd(a,b)*b;} //最小公倍数

int main(){
  ll n; cin>>n;
  vector<ll> a(n);
  bool pc=true;
  ll sgcd=1;
  ll temp;
  ll minP=2;
  bool furui=false;
  vector<bool> exist(1010101,false);

  rep(i,n){
    cin>>a[i];
    if(i==1){
      sgcd=gcd(a[0],a[1]);
    }
    if(i>1){
      sgcd=gcd(sgcd,a[i]);
    }

    temp=a[i];
    furui=false;
    if(pc){
      for (ll k=2; k*k<=temp;k++){
        if(temp%k!=0) continue;

        while(temp %k ==0){
          temp /=k;
        }

        if(exist[k]){
          pc=false;
          break;
        }
        exist[k]=true;
      }
      if(temp!=1 && exist[temp]){
        pc=false;
        break;
      }
      exist[temp]=true;
    }
  }

  if(pc){
    cout<<"pairwise coprime"<<endl;
    return 0;
  }

  if(sgcd==1){
    cout<<"setwise coprime"<<endl;
    return 0;

  }
  cout<<"not coprime"<<endl;
  return 0;



}


Measured memory_bytes: 11180
import scala.collection.mutable.ArrayBuffer

object Main {
  def main(args: Array[String]): Unit = {
    val lines = io.Source.stdin.getLines().toSeq
    println(solve(lines))
  }

  def solve(lines: Seq[String]): String = {
    val n = lines.head.toInt
    val a = lines.tail.head.split(" ").map(_.toLong).toIndexedSeq
    val divisors = IndexedSeq.concat(divisor(a(0)), divisor(a(n - 1))).distinct.sorted
    debug(n, a, divisors)
    divisors.filter(d => a.count(_ % d == 0) >= a.length - 1).max.toString
  }

  private def divisor(n: Long): IndexedSeq[Long] = {
    val buf = ArrayBuffer.empty[Long]
    for (i <- 1 to Math.sqrt(n).toInt) {
      if (n % i == 0) {
        buf.append(i)
        if (i * i != n) buf.append(n / i)
      }
    }
    buf.toIndexedSeq
  }

  private def debug(x: Any): Unit = {
    if (System.getenv("LOCAL_DEBUG") != null)
      println(x)
  }
}


Measured memory_bytes: 46584
# your code goes here
while true

	aryMondai = gets.split.map(&:to_i);
	
	num1 = aryMondai[0];
	num2 = aryMondai[1];
	
	if num1 == 0 && num2 == 0 then
		break;
	end
	
	for i in 0..num1-1 do
		
		for j in 0..num2-1 do
		
			if ( i+j ) % 2== 0 then
				
				print "#";
				
			else
				
				print ".";	
				
			end
		
		end
		
		print "\r\n";
	end
	
	print "\r\n";
end

Measured memory_bytes: 8712
#include <bits/stdc++.h>
#define ll long long int
#define endl "\n"
#define mod 1000000007
#define mem(a,val) memset(a,val,sizeof(a))
#define ps(x,noOfDecimal) fixed<<setprecision(noOfDecimal)<<x

using namespace std;
int main()
{
#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif
	std::ios::sync_with_stdio(false);
	int t = 1;
	// cin>>t;
	while (t--) {
		int n;
		cin >> n;
		vector<int> arr(n);
		for (int i = 0; i < n; i++) {
			cin >> arr[i];
		}
		priority_queue<int> pq;

		for (int i = 0; i < arr.size(); ++i)
		{
			pq.push(arr[i]);
		}
		ll ans = 0;

		ans += pq.top();
		pq.pop();

		n -= 2;
		// n /= 2;
		while (n > 0) {
			// cout << pq.top() << " " << n << endl;
			if (n == 1)ans += 1 * pq.top();
			else ans += 2 * pq.top();
			pq.pop();
			n -= 2;
		}
		cout << ans;

	}
	return 0;
}

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

int main() {

  int n,m;
  cin >>n>>m;
  
  if(n==0){
    cout << m*(m-1)/2<<endl;
    return 0;
  }
  else if(m==0){
    cout << n*(n-1)/2<<endl;
    return 0;
  }
  else{
    cout <<n*(n-1)/2+ m*(m-1)/2<<endl;
  }
  
  return 0;
}

Measured memory_bytes: 256
#include <algorithm>
#include <bitset>
#include <cassert>
#include <cstring>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <vector>

using namespace std;

typedef long long ll;
typedef pair<int, int> pii;
typedef pair<double, ll> state;
typedef vector<vector<ll>> matrix;

int n, m;
int s[2005];
int t[2005];
ll dp[2005];
ll ndp[2005];
const int MOD = 1000000007;

void solve() {
  cin >> n >> m;
  for(int i = 0; i < n; i++) cin >> s[i];
  for(int i = 0; i < m; i++) cin >> t[i];
  dp[0] = 1;
  for(int i = 0; i < n; i++) {
    vector<ll> prefS;
    prefS.push_back(dp[0]);
    for(int j = 1; j < m; j++) {
      prefS.push_back(prefS.back() + dp[j]);
    }
    for(int j = 0; j < m; j++) {
      if(s[i] == t[j]) {
        ll inc = prefS[j];
        inc %= MOD;
        ndp[j+1] += inc;
      }
    }
    for(int j = 0; j <= m; j++) {
      dp[j] += ndp[j];
      dp[j] %= MOD;
    }
    memset(ndp, 0, sizeof(ndp));
  }
  ll ret = 0;
  for(int i = 0; i <= m; i++) ret += dp[i];
  ret %= MOD;
  cout << ret << "\n";
}

void casesolve() {
  /*
  int t;
  cin >> t;
  for(int i = 1; i <= t; i++) {
    cout << "Case #" << i << ": ";
    solve();
  }
  */
}

int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL); cout.tie(NULL);
  solve();
  // casesolve();
}


Measured memory_bytes: 384
#include <bits/stdc++.h>
#define int long long
using namespace std;
const int MOD = pow(10, 9) + 7;
//const int MOD = 998244353;
//const int MOD = ;
int mod(int A, int M) {return (A % M + M) % M;}
const int INF = 1LL << 60;
template <class T> bool chmin(T& a, T b) {if (a > b) {a = b; return true;} return false;}
template <class T> bool chmax(T& a, T b) {if (a < b) {a = b; return true;} return false;}
int divCeil(int A, int B) {return (A + (B - 1)) / B;}
int myctoi(char C) {return C - 48;}
char myitoc(int N) {return '0' + N;}

signed main()
{
  int N, D;
  cin >> N >> D;

  int ans = divCeil(N, 2 * D + 1);

  cout << ans << endl;
}

Measured memory_bytes: 256
N = int(input())
T,A = map(int, input().split())
H = [int(i) for i in input().split()]

X=[]
for i in range(N):
	X.append(abs(A-(T-H[i]*0.006)))
m=min(X)
for i in range(N):
	if X[i]==m:
		print(i+1)

Measured memory_bytes: 3064
import java.util.*;

class Main {

    static void printSeconds(int second) {
        int h = second / 3600;
        int m = (second / 60) % 60;
        int s = second % 60;

        System.out.printf("%02d:%02d:%02d\n", h, m, s);
    }

    static void solve (int h, int m, int s) {
        int second = h * 3600 + m * 60 + s;
        int rest = 7200 - second;

        printSeconds(rest);
        printSeconds(rest * 3);
    }

    public static void main (String [] args) {

        Scanner sc = new Scanner(System.in);

        while(true) {
            int h = sc.nextInt();
            int m = sc.nextInt();
            int s = sc.nextInt();

            if (h == -1 && m == -1 && s == -1)  break;

            solve(h, m, s);
        }


    }
}

Measured memory_bytes: 12000
import java.io.*;
import java.util.Scanner;
import java.util.Arrays;

class Main {
    static Scanner sc = new Scanner(System.in);
    public static void main(String[] args) throws IOException {
        for(int i = 0; ; ++i) {
            int v[] = new int[2];
            v[0] = ReadInt();
            v[1] = ReadInt();
            if( v[0] == 0 && v[1] == 0 ) break;
            Arrays.sort(v);
            System.out.println(v[0] + " " + v[1]);            
        }
    }
    static int ReadInt() throws IOException {
        return Integer.parseInt(sc.next());
    }
}

Measured memory_bytes: 36972
#include <stdio.h>

int main(void)
{
	int i,y,hi,hy,ki,ky,si,sy,hp=0,kp=0,n;
	scanf("%d %d",&hi,&hy);
	scanf("%d %d",&ki,&ky);
	scanf("%d %d",&i,&y);
	scanf("%d %d",&si,&sy);
	hp=hi*i+hy*y;
	hp+=hi/10*si;
	hp+=hy/20*sy;
	kp=ki*i+ky*y;
	kp+=ki/10*si;
	kp+=ky/20*sy;
	if(hp==kp)
	{
		printf("even\n");
	}
	else if(hp>kp)
	{
		printf("hiroshi\n");
	}
	else
	{
		printf("kenjiro\n");
	}
	return 0;
}

Measured memory_bytes: 2604
import sys
import math

for line in sys.stdin:
  try:
    mv = float(line)
    n = 2
    while True:
      if math.sqrt((5 * n - 5) / 4.9) * 9.8 >= mv:
        print(n)
        break
      else:
        n += 1
  except:
    break



Measured memory_bytes: 5632
from collections import defaultdict, deque, Counter
from heapq import heappush, heappop, heapify
from itertools import permutations, accumulate, combinations, combinations_with_replacement
from math import sqrt, ceil, floor, factorial
from bisect import bisect_left, bisect_right, insort_left, insort_right
from copy import deepcopy
from operator import itemgetter
from functools import reduce
from fractions import gcd
import sys
def input(): return sys.stdin.readline().rstrip()
def I(): return int(input())
def Is(): return map(int, input().split())
def LI(): return list(map(int, input().split()))
def TI(): return tuple(map(int, input().split()))
def IR(n): return [I() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def TIR(n): return [TI() for _ in range(n)]
def S(): return input()
def Ss(): return input().split()
def LS(): return list(input())
def SR(n): return [S() for _ in range(n)]
def SsR(n): return [Ss() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
sys.setrecursionlimit(10**6)
MOD = 10**9+7
INF = 10**18
# ----------------------------------------------------------- #

a, b = Is()
if b % a == 0:
    print(a+b)
else:
    print(b-a)

Measured memory_bytes: 65388
N = int(input())
A = list(map(int,input().split()))
ans = 1
cur = 'N'
i = 1
while i < N:
    if cur == 'U':
        if A[i] < A[i-1]:
            ans += 1
            cur = 'N'
        i += 1
    elif cur == 'D':
        if A[i] > A[i-1]:
            ans += 1
            cur = 'N'
        i += 1
    elif cur == 'N':
        if A[i] > A[i-1]:
            cur = 'U'
        elif A[i] < A[i-1]:
            cur = 'D'
        i += 1
print(ans)

Measured memory_bytes: 84964
import bisect
from math import sqrt
x = int(input())
a = [1]
s = 1
for i in range(2, 2*int(sqrt(x))):
    s += i
    a.append(s)

if x in a:
    print(a.index(x) + 1)
    exit()

print(bisect.bisect_right(a, x)+1)



Measured memory_bytes: 5780
package main

import "fmt"

const inf int = 1e18

func main() {
	var n int
	fmt.Scan(&n)
	as := make([]int, n)
	for i := 0; i < n; i++ {
		fmt.Scan(&as[i])
	}

	dp := make([]int, n)
	for i := 0; i < n; i++ {
		dp[i] = inf
	}

	for i := 0; i < n; i++ {
		a := as[n-i-1]
		k := upperBound(dp, a)
		dp[k] = a
	}

	ans := 0
	for i := 0; i < n; i++ {
		if dp[i] < inf {
			ans++
		}
	}

	fmt.Println(ans)
}

func upperBound(a []int, x int) int {
	lb, ub := -1, len(a)
	for ub-lb > 1 {
		m := (lb + ub) / 2
		if a[m] <= x {
			lb = m
		} else {
			ub = m
		}
	}
	return ub
}


Measured memory_bytes: 5504
#include<bits/stdc++.h>
using namespace std;
int main()
{
    string s,s1;
    cin >> s >> s1;
    int i,co=0;
    for(i=0;i<s.size();i++)
    {
        if(s[i]!=s1[i])co++;
    }
    cout << co << endl;
}



Measured memory_bytes: 3828
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;

int main() {
    int h, w;
    cin >> h >> w;
    char s[50][50];
    for(int i = 0; i < h; i++){
        for(int j = 0; j < w; j++){
            cin >> s[i][j];
        }
    }
    bool OK = true;
    for(int i = 0; i < h; i++){
        for(int j = 0; j < w; j++){
            if(s[i][j]=='#'){
                OK = false;
                if(i-1>=0){
                    if(s[i-1][j]=='#'){
                        OK = true;
                    }
                }
                if(i+1<w){
                    if(s[i+1][j]=='#'){
                        OK = true;
                    }
                }
                if(j-1>=0){
                    if(s[i][j-1]=='#'){
                        OK = true;
                    }
                }
                if(j+1<h){
                    if(s[i][j+1]=='#'){
                        OK = true;
                    }
                }
            }
            if(!OK){
                cout << "No" << endl;
                return 0;
            }
        }
    }

    cout << "Yes" << endl;

    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define fastIO (cin.tie(0), cout.tie(0), ios::sync_with_stdio(false))
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define precise(i) fixed << setprecision(i)
using lint = long;
using llint = long long;
using namespace std;

int main() {
    fastIO;
    int a;
    cin >> a;
    cout << (a * (1 + a * (1 + a)));
}

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

// const SP: u8 = b' ';
const LF: u8 = b'\n';

struct CharacterInput<'a> {
    locked_stdin: StdinLock<'a>,
    bytes_buffer: Vec<u8>,
}

impl<'a> CharacterInput<'a> {
    fn read(&mut self, delimiter: u8) -> &[u8] {
        self.bytes_buffer.clear();

        let mut len = self
            .locked_stdin
            .read_until(delimiter, &mut self.bytes_buffer)
            .unwrap();

        if len > 0 {
            len -= 1;
        }

        &self.bytes_buffer[0..len]
    }

    fn scan_u(&mut self, delimiter: u8) -> u32 {
        self.read(delimiter)
            .into_iter()
            .fold(0, |accumulator, byte| {
                (byte - b'0') as u32 + accumulator * 10
            })
    }

    fn scan_u_vec(&mut self, n: usize, separator: u8, delimiter: u8) -> Vec<u32> {
        let mut vector = Vec::with_capacity(n as usize);
        for _i in 0..n - 1 {
            vector.push(self.scan_u(separator));
        }
        vector.push(self.scan_u(delimiter));
        vector
    }
}

fn create_cin<'a>(input: StdinLock<'a>, buffer_capacity: usize) -> CharacterInput {
    CharacterInput {
        locked_stdin: input,
        bytes_buffer: Vec::with_capacity(buffer_capacity),
    }
}

struct CharacterOutput {
    string_buffer: String,
}

impl CharacterOutput {
    fn push_s(&mut self, s: &str) {
        self.string_buffer += s;
    }

    fn add_s(&mut self, s: &str, separator: char) {
        self.push_s(s);
        self.string_buffer.push(separator);
    }

    fn push<T: ToString>(&mut self, n: T) {
        self.push_s(&n.to_string());
    }

    fn add<T: ToString>(&mut self, n: T, separator: char) {
        self.push(n);
        self.string_buffer.push(separator);
    }

    fn add_from_iterator<T: ToString, I>(
        &mut self,
        iterator: &mut I,
        length: usize,
        separator: char,
        delimiter: char,
    ) where
        I: Iterator<Item = T>,
    {
        for element in iterator.by_ref().take(length - 1) {
            self.add(element, separator);
        }
        self.add(iterator.next().unwrap(), delimiter);
    }

    fn flush(&mut self) {
        let out = stdout();
        let mut out = out.lock();
        out.write_all(self.string_buffer.as_bytes()).unwrap();
        self.string_buffer.clear();
    }
}

fn create_cout(capacity: usize) -> CharacterOutput {
    CharacterOutput {
        string_buffer: String::with_capacity(capacity),
    }
}

// ------------------------------------------------------------------------

fn main() {
    let cin = stdin();
    let cin = &mut create_cin(cin.lock(), 16);

    let mut max_a = 0;
    let mut second_max_a = 0;

    let n = cin.scan_u(LF) as usize;
    let a: Vec<u32> = (0..n)
        .map(|_| {
            let a_i = cin.scan_u(LF);

            if a_i > max_a {
                max_a = a_i;
            } else if a_i > second_max_a {
                second_max_a = a_i;
            }

            a_i
        })
        .collect();

    let cout = &mut create_cout(7 * n);

    for a_i in a {
        if a_i < max_a { cout.add(max_a, '\n'); }
        else { cout.add(second_max_a, '\n') }
    }

    cout.flush();
}


Measured memory_bytes: 7676
#include <iostream>
#include <cmath>
#include <algorithm>
#include <vector>
using namespace std;
int main() {
    double N, cnt = 0; cin >> N;
    for (int i = 1; i <= N; ++i) if (i % 2 != 0) cnt++;
    printf("%f\n", cnt / N);
}

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

int n, ans;
vector<int> v;
vector<pair<int, int> > q;

int main(){
	ios::sync_with_stdio(false);
	cin.tie(0);cout.tie(0);
	
	cin >> n;
	for (int i = 0; i < n; i++){
		int a;
		cin >> a;
		v.push_back(a);
	}	
	sort(v.begin(), v.end());
	int t = v[0], c = 1;
	for (int i = 1; i < n; i++){
		if(v[i] != v[i - 1]){
			q.push_back({t, c});
			t = v[i];
			c = 1;
		}
		else
			c++;
	}
	if(c > 0)
		q.push_back({v[n - 1], c});
	
	for (auto p : q){
		if(p.second < p.first)
			ans += p.second;
		if(p.second > p.first)
			ans += p.second - p.first;
	}
	cout << ans;
}


Measured memory_bytes: 1784