akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
//#include <boost/multiprecision/cpp_int.hpp>
#pragma GCC optimize("O3")
#define REP(i,n) for(int i=0;i<n;i++)
#define REPP(i,n) for(int i=1;i<=n;i++)
#define ALL(obj) (obj).begin(), (obj).end()
#define EPS (1e-9)
#define INF (1e17)
#define PI (acos(-1))
//const double PI = acos(-1);
//const double EPS = 1e-15;
//long long INF=(long long)1E17;
#define i_7 (long long)(1e9+7)
//#define i_7 998'244'353
long mod(long a){
    long long c=a%i_7;
    if(c>=0)return c;
    return c+i_7;
}
long long po(long a, long b){
    if(b==0){
        return 1;
    }
    
    long long z = po(a,b/2);
    z = mod(z*z);
    if(b%2!=0){
        z = mod(a*z);
    }
    return z;
}
using namespace std;
//using namespace boost::multiprecision;

bool prime_(int n){
  if(n==1){
    return false;
  }else if(n==2){
    return true;
  }else{
    for(int i=2;i<=sqrt(n);i++){
      if(n%i==0){
        return false;
      }
    }
    return true;
  }
}

long long gcd_(long long a, long long b){
  if(a<b){
    swap(a,b);
  }
  if(a%b==0){
    return b;
  }else{
    return gcd_(b,a%b);
  }
}
 
long long lcm_(long long x, long long y){
  return (x/gcd_(x,y))*y;
}


int main(){
  
  long long n;
  cin>>n;
  if(n%2 != 0){
    cout<<0<<endl;
    return 0;
  }
  long long m = n/2;
  long long ans = 0;
  long long now = 5;
  while(m >= now){
    ans += m/now;
    now *= 5;
  }
  cout<<ans<<endl;
  return 0; 
}


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

using namespace std;
typedef unsigned long long ull;

const ull MOD = 1000000007;

ull c[4001][4001] = {};

void make_comb_list()
{
    for(int n=0;n<4001;n++){
        c[n][0] = 1;
    }

    for (int n = 1; n < 4001; n++)
    {
        for (int k = 1; k <= n; k++)
        {
            c[n][k] = (c[n - 1][k] + c[n - 1][k - 1]) % MOD;
        }
    }
}

int main()
{
    make_comb_list();
    int N, K;
    cin >> N >> K;

    // N-K+1からi個仕切り選択 K-1からi-1個仕切り選択
    ull num;
    for (int i = 1; i < K + 1; i++)
    {
        num = (c[N - K + 1][i] * c[K - 1][i - 1]) % MOD;
        cout << num << endl;
    }
}


Measured memory_bytes: 123520
import numpy as np
from scipy.sparse.csgraph import floyd_warshall


def solve(N,L,edges,queries):

    graph = np.zeros((N,N),dtype=int)
    for a,b,c in edges:
        graph[a-1,b-1] = c
        graph[b-1,a-1] = c

    dist = floyd_warshall(graph, directed=False)
    dist = (dist<=L)
    dist = floyd_warshall(dist, directed=False)
    res = []
    for a,b in queries:
        d = dist[a-1,b-1]
        res.append(int(d-1) if d != float('inf') else -1)
    return res

import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline

if __name__ == '__main__':

    t = read().split()

    N,M,L = map(int,t[:3])

    m = map(int,t[3:M*3+3])
    edges = zip(m,m,m)

    Q = int(t[M*3+3])
    m = map(int, t[M*3+4:])
    queries = zip(m,m)

    print(*solve(N,L,edges,queries), sep='\n')

Measured memory_bytes: 57832
def solve():
  y,m,d = map(int, input().split("/"))
  if y < 2019: 
    return "Heisei"
  elif y > 2019: 
    return "TBD"
    
  if m < 4: 
    return "Heisei"
  elif m > 4: 
    return "TBD"
    
  if d > 30: 
    return "TBD"
  return "Heisei"
 
print(solve())

Measured memory_bytes: 2940
#include <stdio.h>

typedef struct List {
	struct List *next;
	int v;
} list;

int main()
{
	int i, N, u, w, deg[100001] = {};
	list *adj[100001] = {}, e[200001], *p;
	scanf("%d", &N);
	if (N == 2) {
		printf("1\n");
		fflush(stdout);
		return 0;
	}
	for (i = 0; i < N - 1; i++) {
		scanf("%d %d", &u, &w);
		e[i*2].v = w + 1;
		e[i*2+1].v = u + 1;
		e[i*2].next = adj[u+1];
		e[i*2+1].next = adj[w+1];
		adj[u+1] = &(e[i*2]);
		adj[w+1] = &(e[i*2+1]);
		deg[u+1]++;
		deg[w+1]++;
	}
	
	int par[100001] = {}, q[100001], head, tail;
	for (i = 1; i <= N; i++) if (deg[i] > 1) break;
	par[i] = i;
	q[0] = i;
	for (head = 0, tail = 1; head < tail; head++) {
		u = q[head];
		for (p = adj[u]; p != NULL; p = p->next) {
			w = p->v;
			if (par[w] == 0) {
				par[w] = u;
				q[tail++] = w;
			}
		}
	}
	
	int flag[100001] = {}, ans = 0, count, sum;
	for (head--; head > 0; head--) {
		u = q[head];
		if (deg[u] == 1) continue;
		for (p = adj[u], count = 0; p != NULL; p = p->next) {
			if (p->v == par[u]) continue;
			else if (flag[p->v] == 0) count++;
			else flag[u] = 1;
		}
		if (count == 0) flag[u] = 2;
		else if (count >= 2) {
			ans += count - 1;
			flag[u] = 1;
		}
	}
	for (p = adj[i], count = 0, sum = 0; p != NULL; p = p->next) {
		sum += flag[p->v];
		if (flag[p->v] == 0) count++;
	}
	if (count >= 2) ans += count - 1;
	else if (sum <= 1 && count == 1) ans++;
	printf("%d\n", ans);
	fflush(stdout);
	return 0;
}

Measured memory_bytes: 7160
#include<iostream>
#include<vector>
#include<algorithm>
#include<cmath>
using namespace std;
long long n, s[100000], t[100000], K, ret, inf = (1LL << 40), num[2];
vector<pair<long long, int>>vec[3200000]; bool used[100000]; vector<bool>vec2[3200000];
long long solve(long long I) {
	long long ret = 1;
	for (long long i = 2; i <= 3000; i++) {
		long long U = 0; while (I%i == 0) { I /= i; U++; U %= 3; }
		for (int j = 0; j < (3 - U % 3) % 3; j++) {
			if (ret*i <= inf)ret *= i;
			else ret = inf;
		}
	}
	long long G = (1.0L*sqrtl(1.0L*I) + 0.5L); if (G*G == I) { ret *= G; }
	else { for (int i = 0; i < 2; i++) { if ((inf / I) >= ret)ret *= I; else ret = inf; } }
	return min(ret, inf);
}
void dfs(int pos, int depth) {
	if (used[pos] == true)return;
	num[depth]++; used[pos] = true;
	for (int i = 1; i <= 2000; i++) {
		long long P = 1LL * i*i*i*t[pos]; if (P > 10000000000LL)break;
		int B = (P >> 12); if (vec[B].size() == 0)continue;
		
		int pos1 = lower_bound(vec[B].begin(), vec[B].end(), make_pair(P, 0)) - vec[B].begin();
		if (pos1 >= vec[B].size() || vec[B][pos1].first != P || vec2[B][pos1] == true)continue;
		vec2[B][pos1] = true;
		while (pos1 < vec[B].size() && vec[B][pos1].first == P) {
			dfs(vec[B][pos1].second, depth ^ 1); pos1++;
		}
	}
}
int main() {
	cin >> n;
	for (int i = 0; i < n; i++) {
		cin >> s[i]; t[i] = solve(s[i]);
		if (t[i] != 1)vec[s[i] >> 12].push_back(make_pair(s[i], i)); else K = 1;
	}
	for (int i = 0; i < 3200000; i++) { sort(vec[i].begin(), vec[i].end()); vec2[i].resize(vec[i].size()); }
	for (int i = 0; i < n; i++) {
		if (t[i] == 1 || used[i] == true)continue;
		num[0] = 0; num[1] = 0;
		dfs(i, 0); ret += max(num[0], num[1]);
	}
	cout << ret + K << endl;
	return 0;
}

Measured memory_bytes: 208128
n=int(input())
a=sorted(list(map(int,input().split())))
c=[0]*8
k=-1
for i in range(n):
    if a[i]<400:
        c[0]=1
    elif a[i]<800:
        c[1]=1
    elif a[i]<1200:
        c[2]=1
    elif a[i]<1600:
        c[3]=1
    elif a[i]<2000:
        c[4]=1
    elif a[i]<2400:
        c[5]=1
    elif a[i]<2800:
        c[6]=1
    elif a[i]<3200:
        c[7]=1
    else:
        k=i
        break

d=0
for i in range(8):
    if c[i]==1:
        d+=1
if n==1 or d==0:
    print(1, end=" ")
else:
    print(d, end=" ")

if n==1:
    print(1)
elif k==-1:
    print(d)
else:
    print(d+(n-k))


Measured memory_bytes: 3064
#include<bits/stdc++.h>
typedef long long ll ; 
#define M 1000000007
 
#define PI 3.141592653589793238462643383279502884197169
using namespace std; 



int main()
{

double n,d;
cin>>n>>d;
int ans=0;
for(int i=0;i<n;++i)
{
    double a,b;
    cin>>a>>b;
    if(sqrt(a*a+b*b)<=d)
    ++ans;
    
}
cout<<ans;

    return 0;
}

Measured memory_bytes: 3816
#include<iostream>
#include<cstring>
#include<stack>
#include<cstdio>
#include<cmath>
using namespace std;
#define MAX 10005
int a[MAX];
int main()
{
int n,x,t=0,maxn=0;
cin>>n;
for(int i=1;i<=n;i++)
{
	cin>>x;
	maxn=max(maxn,x);
	a[x]++;
}
for(int i=0;i<=maxn;i++)
{
	
	while(a[i]>0)
	{
		if(t==0)
		{
		cout<<i;
		t=1;
		a[i]--;
	}
	else if(t==1)
	{
		cout<<" ";
		cout<<i;
		a[i]--;
	}
	}
}
cout<<"\n";
return 0;
 } 


Measured memory_bytes: 3112
#include<iostream>
#include<math.h>

using namespace std;

int main()
{
        double c[3];
        int i = 0;
        int temp = 0;
        int data = 0;
        int j = 0;
        int count = 0;
        double hoge,fuga;

        cin >> data;

        while(j<data)
        {
                count = 0;
                cin >> c[0] >> c[1] >> c[2];
                while(count<2){
                for(i=0;i<2;i++)
                {
                        if(c[i]<c[i+1])
                        {
                                temp = c[i];
                                c[i]=c[i+1];
                                c[i+1]=temp;
                        }

                }
                count++;
                }
                hoge = pow(c[0],2.0);
                fuga = pow(c[1],2.0) + pow(c[2],2.0);

                if(hoge == fuga)
                {
                        cout << "YES" << endl;
                }
                else
                {
                        cout << "NO" << endl;
                }

                j++;
        }
}

Measured memory_bytes: 1224
#include <bits/stdc++.h>
#define eb emplace_back
#define all(v) v.begin(),v.end()
using namespace std;
using ll=long long;
using P=pair<ll,ll>;
const ll INF=1LL<<60;
template<class T> void chmin(T &a,T b){a=min(a,b);}
template<class T> void chmax(T &a,T b){a=max(a,b);}
int main(){
	ios::sync_with_stdio(0);
	cin.tie(0);
	int a,b;cin>>a>>b;
	for(int c=0;c<=100000;c++){
		int d=floor(c*(double)(0.08));
		int e=floor(c*(double)(0.10));
		if(a==d&&b==e){
			cout<<c<<endl;
			return 0;
		}
	}
	cout<<-1<<endl;
	return 0;
}


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

#define ios ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0);
#define pb push_back
#define all(v) v.begin(), v.end()
#define ar array

#define F first
#define S second
#define sz(x) int(x.size())
using namespace std;
using ll = long long;
using pii = pair <int, int>;
using pll = pair <ll, ll>;
using ld = long double;

const int mod = 1e9 + 7;
// const int mod = 998244353;
const ll inf = 2e9;
const ll INF = 1e18;
const ld EPS = 1e-7;

const int N = 1e5 + 5;

void solve () {
	int n, k;
	cin >> n >> k;
	ld ans = 0;
	for (int i = 1 ; i <= n ; ++ i) {
		ll now = i;
		ld p = 1.0 / (ld) n;
		while (now < k) {
			now *= 2ll;
			p *= 0.5;
		}
		ans += p;
	}
	cout << fixed << setprecision (10) << ans;
}

int main () {
	ios;
	int tt = 1;
	// cin >> tt;
	while (tt--) {
		solve();
		cout << "\n";
	}
}




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

#define F first
#define S second
#define PB push_back
#define MP make_pair
#define REP(i,a,b) for (int i = a; i <= b; i++)

#define lli long long
#define li long
#define vi vector<int>
#define vli vector<li>
#define vlli viector<lli>
#define pi pair<int,int>
#define vpi vector<pi>

using namespace std;

int main() {
    int r, D, x2;

    scanf("%d %d %d", &r, &D, &x2);

    long long int ant = x2;
    int i;
    REP(i, 0, 9) {
        ant = r * ant - D;
        cout << ant << endl;
    }
}


Measured memory_bytes: 256
N,M=gets.chomp.split.map(&:to_i)
A=gets.chomp.split.map(&:to_i)
bc=M.times.map { gets.split.map(&:to_i) }
bc.sort_by!{|i,j| j }.reverse!
A.sort!

af = []
a  = A

if M > 0
  ix = A.bsearch_index{|x| x >= bc[0][1] }
  if ix != nil
    af = A[ix..-1]
    a = A[0...ix]
  end
end

M.times do |i|
  break if a.empty? || a[0]>bc[i][1]
  b = [a.bsearch_index{|x| x >= bc[i][1]}||a.size, bc[i][0]].min
  if b > 0
    a.shift(b)
    af.push(bc[i][1]*b)
  end
end
puts (a.inject(:+)||0) + (af.inject(:+)||0)

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

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

    int n;
    cin >> n;

    int dp[n + 1] = {};
    dp[0] = 1;
    dp[1] = 1;
    for(int i = 2; i <= n; i++){
        dp[i] = dp[i - 2] + dp[i - 1];
    }

    cout << dp[n] << endl;

    return 0;
}


Measured memory_bytes: 3184
#include <iostream>
#include <iomanip>
#include <algorithm>
#include <bitset>
#include <string>
#include <cmath>
#include <complex>
#include <numeric>
#include <cassert>

#include <vector>
#include <array>
#include <map>
#include <set>
#include <stack>
#include <queue>
#include <deque>
#include <utility>

#define int64 long long
#define uint64 unsigned long long
using namespace std;

int main()
{
	int64 nn, kk, sum = 0;
	cin >> nn >> kk;
	vector<int64> hh(nn);
	for(int64 ii = 0;ii < nn;ii++)
	{
		cin >> hh[ii];
	}
	sort(hh.begin(), hh.end());
	reverse(hh.begin(), hh.end());
	for(int64 ii = kk;ii < nn;ii++)
	{
		sum += hh[ii];
	}
	cout << sum << endl;
	return 0;
}


Measured memory_bytes: 4660
#include <bits/stdc++.h>
using namespace std;
struct segment_tree {
  public:
    const long long uni = 0;
    int n, N;
    vector<long long> tr;
    segment_tree (int size) {
      n = size;
      N = 1;
      while (N < n) {
        N <<= 1;
      }
      tr.resize(2 * N, uni);
    }
    long long opr (long long x, long long y) {
      return max(x, y);
    }
    void update (int i, long long x) {
      i += N;
      tr[i] = x;
      i >>= 1;
      for (; i; i >>= 1) {
        tr[i] = opr(tr[2 * i], tr[2 * i + 1]);
      }
    }
    long long find (int l, int r) {
      return dfs(1, l, r, 0, N);
    }
    long long dfs (int k, int l, int r, int L, int R) {
      if (l <= L && R <= r) {
        return tr[k];
      } else if (r <= L || R <= l) {
        return uni;
      } else {
        int C = (L + R) >> 1;
        return opr(dfs(2 * k, l, r, L, C), dfs(2 * k + 1, l, r, C, R));
      }
    }
};
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n;
  cin >> n;
  vector<int> h(n), a(n);
  for (int i = 0; i < n; i++) {
    int tmp;
    cin >> tmp;
    h[i] = --tmp;
  }
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  segment_tree sgt(n);
  for (int i = 0; i < n; i++) {
    long long maxv = sgt.find(0, h[i]);
    sgt.update(h[i], maxv + a[i]);
  }
  cout << sgt.find(0, n) << '\n';
  return 0;
}

Measured memory_bytes: 5888
N, M = map(int, input().split())
section =[]
for i in range(M):
    section.append(list(map(int, input().split())))
section.sort()

ans = 1
b_edge  = section[0][1]
del section[0]

for a, b in section:
    if b_edge<= a:
        b_edge = b
        ans +=1
    elif b < b_edge:
        b_edge = b
    elif a < b_edge <= b:
        b_edge = b_edge
print(ans)

                   

Measured memory_bytes: 27916
#include <iostream>

#include<iostream>
#include<string>
using namespace std;
int main()
{
	int k{};
	cin >> k;
	string str;
	cin >> str;

	if (str.size()<=k) {
		cout << str;
	}
	else {
		for (size_t i = 0;i < k;++i) {
			cout << str[i];
		}
		cout << "...";
	}
	return 0;

}

Measured memory_bytes: 3568
import java.util.Scanner;

class Main{
    public static void main(String[] args){
        Scanner scan = new Scanner(System.in);
        int W = scan.nextInt();
        int H = scan.nextInt();
        int x = scan.nextInt();
        int y = scan.nextInt();
        int r = scan.nextInt();
        if(x-r>=0 && x+r<=W && y-r>=0 &&y+r<=H){
            System.out.println("Yes");
            
        }else{
            System.out.println("No");
            
        }
    }
}


Measured memory_bytes: 26360
/******************************************
* NICK : nikhilsinghh59 *
******************************************/
#include<bits/stdc++.h>
using namespace std;
#define ll long long int 
#define watch(x) cout << (#x) << " is " << (x) << endl
#define endl "\n"

#define PB push_back
#define F first
#define S second
#define all(c) (c).begin(),(c).end()
const int M = 1e9+7;

int main()
{   


    ll n;
    cin >> n;
    map<ll , ll>mp;

    for(ll i=2;i<=n;i++){
        ll x;
        cin >> x;
        mp[x]++;
    }

    for(ll i=1;i<=n;i++){
        cout << mp[i] << endl;
    }
    
    return 0;
}

Measured memory_bytes: 16132
#include<iostream>
using namespace std;
int main()
{
    // スペース区切りの整数の入力
    int A, B;
    cin >> A >> B;
    // 文字列の入力
    int sum, dif, prd;
	sum = A + B;
    dif = A - B;
    prd = A * B;
    if (sum - dif >= 0 && sum - prd >= 0){
    cout << sum << endl;
    }
    else if ( dif - sum >= 0 && dif - prd >= 0){
    cout << dif << endl;
    }
    else {
    cout << prd << endl;
    }
    return 0;
}




Measured memory_bytes: 256
# coding: utf-8
import sys

sr = lambda: sys.stdin.readline().rstrip()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))

S = sr()

def check(s):
    return s == s[::-1]

mid = (len(S)-1) // 2
bl = check(S) and check(S[:mid]) and check(S[mid+1:])

print('Yes' if bl else 'No')


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

int main(){
    int a;                  // ??°?????¨?????°
    int i,j;                // ???????????????????????¨????????°
    cin >> a;               // ??°?????\????????????

    for( i = 1; i <= a; i++){
        if( i % 3 == 0 )                       //??????????????°??¨???
            cout << ' ' << i;
        else if( i % 10 == 3 )                 //??????????????°????????¨???
            cout << ' ' << i;
        else
            for(j = i; j != 0;){//????¨??????´???????????\??????????????¢??????????????°????????¨???
                j /= 10;
                if( j % 10 == 3 ){
                    cout << ' ' << i;
                    break;
                }
            }
    }
    cout << endl;

    return 0;
}

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

int main()
{
  int x,t;
  int res=0;
  cin >> x>>t;

  res = max(0,x-t);

  cout << res << endl;
}


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

int main(){
  int N, M, X, Y;
  std::cin>>N>>M>>X>>Y;

  std::vector<int> x(N);
  std::vector<int> y(M);
  for(auto i = x.begin();i != x.end();i++){
    std::cin>>*i;
  }
  for(auto i = y.begin();i != y.end();i++){
    std::cin>>*i;
  }
  int max_x = *std::max_element(x.begin(), x.end());
  int min_y = *std::min_element(y.begin(), y.end());

  if((max_x < min_y) && ((X < max_x+1) && (min_y <= Y))){
    std::cout<<"No War"<<std::endl;
  }else{
    std::cout<<"War"<<std::endl;
  }
  return 0;
}

Measured memory_bytes: 256
#define _CRT_SECURE_NO_WARNINGS
#include<iostream>
#include<sstream>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<climits>
#include<cmath>
#include<string>
#include<vector>
#include<set>
#include<map>
#include<queue>
#include<numeric>
#include<functional>
#include<algorithm>
#include<bitset>
#include<tuple>
#include<unordered_set>
#include<unordered_map>
#include<random>
#include<array>
#include<cassert>
#include <atcoder/segtree>
using namespace std;
#define INF ((1<<30)-1)
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define all(v) v.begin(),v.end()


int op(int a, int b) { return max(a, b); }

int e() { return 0; }


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

	int maxv = 300000 + 1;
	atcoder::segtree<int, op, e> seg(maxv);


	int n, k;
	cin >> n >> k;
	vector<int> a(n);
	rep(i, n)cin >> a[i];

	rep(i,n) {
		int v = seg.prod(max(0, a[i] - k), min(maxv, a[i] + k + 1)) + 1;
		seg.set(a[i], v);
	}

	cout << seg.all_prod() << endl;



	return 0;
}


Measured memory_bytes: 8512
// template
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef pair<long long, long long> LP;
#define INF 999999999
#define MOD 1000000007
#define REP(i, n) for(int i = 0, i##_len = (n); i < i##_len; ++i)
#define REP_AB(i, a, b) for (int i = int(a); i <= int(b); ++i)
#define ALL(v) v.begin(), v.end()
#define SORT(v) sort(ALL(v))
#define UNIQUE(v) sort(ALL(v));v.erase(unique(ALL(v)), v.end());
#define SIZE(x) ((ll)(x).size())
int gcd(int a,int b){return b?gcd(b,a%b):a;}
int dx[4]={1,0,-1,0};
int dy[4]={0,1,0,-1};
#define out cout
#define in cin
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; }
// template end

int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    int x, t;
    in >> x >> t;
    out << max(x-t, 0) << endl;
}


Measured memory_bytes: 256
word = input()
answer = 0
if word[0] == 'R':
    if word[1] == 'R':
        if word[2] == 'R':
            answer = 3
        else:
            answer = 2
    else:
        answer = 1
elif word[1] == 'R':
    if word[2] == 'R':
        answer = 2
    else:
        answer = 1
elif word[2] == 'R':
    answer = 1
print(answer)

Measured memory_bytes: 61648
def bubbleSort(A, N):
    flag = 1
    count = 0
    while flag:
        flag = 0
        for j in reversed(xrange(1, N)):
            if A[j] < A[j-1]:
                A[j], A[j-1] = A[j-1], A[j]
                flag = 1
                count+=1
    return count

# MAIN
N = input()
A = map(int, raw_input().split())
c = bubbleSort(A, N)
for i in A: print i,
print 
print c

Measured memory_bytes: 6440
import java.util.*;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int n = Integer.parseInt(sc.next());
    int x = Integer.parseInt(sc.next());
    int t = Integer.parseInt(sc.next());
    
    int ans = n / x;
    if(n%x > 0){
      ans++;
    }
    ans = ans * t;

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


Measured memory_bytes: 35520
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <cmath>
#include <stdio.h>
#include <queue>
#include <climits>
#include <map>
#include <set>
const int mod = 1e9 + 7;
const int inf = 1 << 20;
const long long INF = 1LL << 60;
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
using namespace std;


char f[24][24];
int dis[24][24];

int dx[4] = {-1,0,0,1};
int dy[4] = {0,-1,1,0};
int h,w;
 
int bfs(int sy,int sx,int gy, int gx)
{
    pair<int,int> p;
    queue <pair<int,int>> que;

    for(int i = 0; i < h; i++){
        for(int j = 0; j < w; j++){
            dis[i][j] = 100000000;
        }
    }
    p = make_pair(sx,sy);
    dis[sy][sx] = 0;

    que.push(p);
    while(que.size()){
        pair<int,int> point = que.front();
        que.pop();

        if(point.first == gx && point.second == gy){
            break;
        }

        for(int i = 0; i < 4; i++){
            int nx = point.first + dx[i];
            int ny = point.second + dy[i];
            if(0 <= nx && nx < w && 0 <= ny && ny < h && f[ny][nx] == '.' && dis[ny][nx] == 100000000){
                pair<int,int> n;
                n = make_pair(nx,ny);
                que.push(n);
                dis[ny][nx] = dis[point.second][point.first]+1;
            }
        }
    }
    if(dis[gy][gx] == 100000000){
        return -1;
    }else{
        return dis[gy][gx];
    }
}

int main()
{

    cin >> h >> w;
    for(int i = 0; i < h; i++){
        for(int j = 0; j < w; j++){
            cin >> f[i][j];
        }
    }
    int ans = 0;
    for(int sy = 0; sy < h; sy++){
        for(int sx = 0; sx < w; sx++){
            if(f[sy][sx] == '#') continue;
            for(int gy = 0; gy < h; gy++){
                for(int gx = 0; gx < w; gx++){
                    if(f[gy][gx] == '#'){
                        continue;
                    }else{
                        ans = max(ans,bfs(sy,sx,gy,gx));
                    }
                }
            }
        }
    }
    cout << ans << endl;
}	


Measured memory_bytes: 256
S = input().rstrip()

if S[:7] == 'keyence':
    print('YES')
    exit()
if S[-7:] == 'keyence':
    print('YES')
    exit()

for i in range(1, len(S)):
    for j in range(i, len(S)):
        if S[0:i]+S[j+1:] == 'keyence':
            print('YES')
            exit()
print('NO')


Measured memory_bytes: 3060
using System;
using System.Text;
using System.Linq;
using System.Collections;
using System.Collections.Generic;
using static System.Console;
using static System.Math;

namespace ABC141C
{
    public class Program
    {
        public static void Main(string[] args)
        {
            new Program().Solve(new ConsoleInput(Console.In, ' '));

            return;
        }

        public void Solve(ConsoleInput cin)
        {

            var N = cin.ReadInt;
            var K = cin.ReadInt;
            var Q = cin.ReadInt;
            var A = cin.ReadIntArray(Q);

            var point = new int[N];
            var ok = new int[N];
            foreach (var elem in A)
            {
                ok[elem - 1] += 1;
            }
            for (int i = 0; i < N; i++)
            {
                point[i] = K - Q + ok[i];
            }

            for(int i = 0; i < N; i++)
            {
                if(point[i] > 0)
                {
                    Console.WriteLine("Yes");
                }
                else
                {
                    Console.WriteLine("No");
                }
            }

        }
    }

    public static class Extensions
    {
        public static string Reverse(this string sourse)
        {
            char[] chrAry = sourse.ToCharArray();
            Array.Reverse(chrAry);
            return new string(chrAry);
        }
    }

    public class ConsoleInput
    {
        private readonly System.IO.TextReader _stream;
        private char _separator = ' ';
        private Queue<string> inputStream;
        public ConsoleInput(System.IO.TextReader stream, char separator = ' ')
        {
            this._separator = separator;
            this._stream = stream;
            inputStream = new Queue<string>();
        }
        public string Read
        {
            get
            {
                if (inputStream.Count != 0) return inputStream.Dequeue();
                string[] tmp = _stream.ReadLine().Split(_separator);
                for (int i = 0; i < tmp.Length; ++i)
                    inputStream.Enqueue(tmp[i]);
                return inputStream.Dequeue();
            }
        }
        public string ReadLine { get { return _stream.ReadLine(); } }
        public int ReadInt { get { return int.Parse(Read); } }
        public long ReadLong { get { return long.Parse(Read); } }
        public double ReadDouble { get { return double.Parse(Read); } }
        public string[] ReadStrArray(long N) { var ret = new string[N]; for (long i = 0; i < N; ++i) ret[i] = Read; return ret; }
        public int[] ReadIntArray(long N) { var ret = new int[N]; for (long i = 0; i < N; ++i) ret[i] = ReadInt; return ret; }
        public long[] ReadLongArray(long N) { var ret = new long[N]; for (long i = 0; i < N; ++i) ret[i] = ReadLong; return ret; }
    }
}


Measured memory_bytes: 16592
#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;
    cin >> N >> K;
    vector<int> l(N);
    rep(i, N) cin >> l[i];
    sort(l.begin(), l.end(), greater<int>());
    int sum = 0;
    rep(i, K) sum += l[i];
    cout << sum << endl;
    return 0;
}

Measured memory_bytes: 3528
import java.util.Scanner;
public class Main{
 public static void main(String[] args){
   Scanner sc = new Scanner(System.in);
   String S = sc.next();
   int N = S.length();

   int count =0;
   for(int i =0;i<N;i++)
   {
    if(S.charAt(i)=='0') count++;
   }
   if(N-2*count>0) System.out.println(2*count);
   else System.out.println(2*(N-count));
 }
}

Measured memory_bytes: 25428
#include <algorithm>
#include <bitset>
#include <cassert>
#include <cmath>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <tuple>
#include <vector>

using namespace std;
typedef long long ll;

#define rep(i, n) for (ll i = 0; i < (n); i++)
#define reps(i, f, n) for (ll i = (f); i < (n); i++)
#define repr(i, n) for (ll i = n; i >= 0; i--)
#define repv(v) for (auto it = (v).begin(); it != (v).end(); it++)
#define ALL(x) (x).begin(), (x).end()
#define SZ(x) ((int)(x).size())
#define pb push_back
#define INIT cin.tie(0); ios::sync_with_stdio(false);

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

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

int main() {
    INIT;

    ll N, R;
    cin >> N >> R;

    cout << max(0LL, 10LL - N) * 100 + R << endl;

    return 0;
}

Measured memory_bytes: 3512
#include <bits/stdc++.h>
 
using namespace std;
 
typedef long long swl;
 
int main() {
#ifdef  DEBUG
  ifstream in("input.txt");
  cin.rdbuf(in.rdbuf());
#endif  // for local.
  swl n, a, b;
  cin >> n >> a >> b;
  if ((a + b) & 1) {
    swl top, btm;
    top = a > b ? b + (a-b-1)/2 : a + (b-a-1)/2;
    btm = a > b ? n-a+1 + (a-b-1)/2 : n-b+1 + (b-a-1)/2;
    cout << (top < btm ? top : btm) << endl;
  } else {
    cout << llabs(a-b) / 2 << endl;
  }
  return 0;
}

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

typedef complex<double> P;

double cross(P a, P b) {
  return a.real()*b.imag() - a.imag()*b.real();
}

bool isIn(P p, P a, P b, P c) {
  if(cross(b-a, p-a) < 0) return false;
  if(cross(c-b, p-b) < 0) return false;
  if(cross(a-c, p-c) < 0) return false;
  return true;
}

int main() {
  int Tc;
  cin >> Tc;
  while(Tc--) {
    P a, b, c, d, e;
    cin >> a.real() >> a.imag() >> b.real() >> b.imag()
        >> c.real() >> c.imag() >> d.real() >> d.imag()
        >> e.real() >> e.imag();
    if(cross(b-a, c-a) < 0) swap(b,c);
    bool A = isIn(d,a,b,c);
    bool B = isIn(e,a,b,c);
    if(A ^ B) cout << "OK" << endl;
    else cout << "NG" << endl;
  }
  return 0;
}

Measured memory_bytes: 1220
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace AtCoder_solve
{
    class Program
    {
        public const ulong mod = 1000000007;

        static void Main(string[] args)
        {
            long n = long.Parse(Console.ReadLine());
            var s = Console.ReadLine();
            var ans = "";

            if (n % 2 == 1)
            {
                ans = "No";
            }
            else
            {
                for(int i = 0; i < s.Length / 2; i++)
                {
                    ans = "Yes";
                    if (s[i] != s[i + s.Length / 2])
                    {
                        ans = "No";
                        break;
                    }
                }
            }

            Console.WriteLine(ans);
        }
    }
}


Measured memory_bytes: 13140
n = gets.to_i
array = gets.chomp.split(" ").map(&:to_i)

c = 0
bool = true
while bool do
    (0..n-1).each do |i|
        if array[i] % 2 == 0 
            array[i] = array[i]/2
        else
            puts c
            bool = false
            break
        end
    end
    c = c + 1
end 

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

int main() {
    int a , b , c , d;
    cin >> a >> b;
    cin >> c >> d;
    if(a != c){
        cout << 1 << endl;
    }
    else{
        cout << 0 << endl;
    }
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int main(){
  int n, m, l;
  cin >> n >> m >> l;
  vector< vector<int> > A(n, vector<int>(m));
  for (int i = 0; i < n; i++){
    for (int j = 0; j < m; j++){
      cin >> A[i][j];
    }
  }
  vector< vector<int> > B(m, vector<int>(l));
  for (int i = 0; i < m; i++){
    for (int j = 0; j < l; j++){
      cin >> B[i][j];
    }
  }
  vector< vector<long long> > C(n, vector<long long>(l, 0));
  for (int i = 0; i < n; i++){
    for (int j = 0; j < l; j++){
      for (int k = 0; k < m; k++){
        C[i][j] += A[i][k] * B[k][j];
      }
      cout << C[i][j];
      if (j < l - 1){
        cout << ' ';
      }
    }
    cout << endl;
  }
}


Measured memory_bytes: 3212
//  Mohib Manva.//  
#include<bits/stdc++.h>
using namespace std;
 
 
int main() {
    int t = 1;
    //  scanf("%d",&t);
    while (t--) {
        long long n;
        scanf("%lld",&n);
        if (n == 0){
            puts("0");
            return 0;
        }

        map<long long,int> dp;
        for(int i=0;i<(1<<20);i++) {
            long long f = 1;
            long long val = 0;
            for(int j=0;j<20;j++) {
                if ((i>>j)&1) {
                    val += f;
                }
                f *= -2ll;
            }
            dp[val] = i;
        }

        long long init = 1;
        for(int i=0;i<20;i++) {
            init *= -2ll;
        }

        for(int mask=0;mask<(1<<20);mask++) {
            long long val = 0;
            long long f = init;
            for(int j=0;j<20;j++) {
                if((mask>>j)&1) {
                    val += f;
                }
                f *= -2ll;
            }
            long long rem = (n - val);
            if (dp.find(rem) != dp.end()) {
                int mask1 = dp[rem];
                bool s = 0;
                for(int j=19;j>=0;j--) {
                    if((mask>>j) & 1) {
                        s = 1;
                        printf("1");
                    } else {
                        if (s){
                            printf("0");
                        }
                    }
                }
                mask = mask1;
                for(int j=19;j>=0;j--) {
                    if((mask>>j) & 1) {
                        s = 1;
                        printf("1");
                    } else {
                        if (s){
                            printf("0");
                        }
                    }
                }
                puts("");
                return 0;
            }
        }
        assert(0);

    }
    return 0;
}

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

using namespace std;
typedef long long ll;

int n;
bool pre[1000005][26];
string T[200002];
ll ans;

struct trie {
    trie *son[26];
    int sum[26];
    trie() {
        for (int i = 0; i < 26; i++) son[i] = NULL, sum[i] = 0;
    }
} * root;

bool cmp(const string &a, const string &b) { return a.size() > b.size(); }

void insert(string &s) {
    for (int j = 0; j < 26; j++) pre[0][j] = s[0] - 'a' == j;
    for (int i = 1; i < s.size(); i++)
        for (int j = 0; j < 26; j++)
            pre[i][j] = pre[i - 1][j] | (s[i] - 'a' == j);
    trie *cur = root;
    for (int i = s.size() - 1; i >= 0; i--) {
        if (cur->son[s[i] - 'a'] == NULL) cur->son[s[i] - 'a'] = new trie;
        if (i == 0) ans += cur->sum[s[0] - 'a'];
        for (int j = 0; j < 26; j++) cur->sum[j] += pre[i][j];
        cur = cur->son[s[i] - 'a'];
    }
}

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0), cout.tie(0);
    cin >> n;
    root = new trie;
    for (int i = 1; i <= n; i++) cin >> T[i];
    sort(T + 1, T + n + 1, cmp);
    for (int i = 1; i <= n; i++) insert(T[i]);
    cout << ans;
    return 0;
}


Measured memory_bytes: 343000
#include <iostream>
#include <queue>

using namespace std;
using ll = long long;
using P = pair<int, int>;

#define rep(i, n) for (int i = 0; i < (int)(n); ++i)

const int MAX = 100005;
const int INF = 1 << 30;
vector<int> a[MAX];
int pr[MAX];

void dijkstra(int n) {
  int d[n + 1];
  rep(i, n + 1) {
    d[i] = INF;
    pr[i] = -1;
  }

  priority_queue<P> q;

  d[1] = 0;
  q.push(make_pair(0, 1));
  while (!q.empty()) {
    auto p = q.top();
    q.pop();

    int u = p.second;
    int c = -p.first;
    if (d[u] < c) continue;

    for (auto v : a[u]) {
      if (d[v] == INF) {
        if (d[u] + 1 < d[v]) {
          d[v] = d[u] + 1;
          pr[v] = u;
          q.push(make_pair(-d[v], v));
        }
      }
    }
  }
}

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

  rep(i, m) {
    int u, v;
    cin >> u >> v;
    a[u].push_back(v);
    a[v].push_back(u);
  }

  dijkstra(n);

  cout << "Yes" << '\n';
  for (int i = 2; i < n + 1; ++i) { cout << pr[i] << '\n'; }

  return 0;
}


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

int main(void) {
    long long N, M, K;
    cin >> N >> M >> K;
    vector< long long > A(N), B(M);
    for (int i = 0; i < N; i++) {
        cin >> A[i];
    }
    for (int i = 0; i < M; i++) {
        cin >> B[i];
    }
    long long i = 0, j = 0, t = 0, count = 0;
    for (i = 0; i < N; i++) {
        if (t + A[i] > K) {
            break;
        }
        t += A[i];
        ++count;
    }
    --i;
    for (j = 0; j < M; ++j) {
        if (t + B[j] > K) {
            break;
        }
        t += B[j];
        ++count;
    }
    long long ans = count;
    for (; i >= 0; --i) {
        t -= A[i];
        --count;
        while (j < M) {
            if (t + B[j] > K) {
                break;
            }
            t += B[j];
            ++j;
            ++count;
        }
        ans = max(ans, count);
    }
    printf("%lld\n", ans);
    return 0;
}


Measured memory_bytes: 6420
#include <iostream>
#include <cstdio>
#include <cmath>
#include <cstring>
#include <algorithm>
#include <queue>
#define ll long long
#define space putchar(' ')
#define endl putchar('\n')
#define debug puts("------------------------")
#define F(i,x,n) for(int i=x;i<=n;++i)
#define F_(i,x,n) for(int i=x;i>=n;--i)
using namespace std;
inline void read(int &a) {a=0;int c=getchar(),b=1; while(c>'9'||c<'0') {if(c=='-')b=-1;c=getchar();} while(c>='0'&&c<='9') a=(a<<3)+(a<<1)+c-48,c=getchar();a*=b; }
inline int  Rem() {int a=0,c=getchar(),b=1; while(c>'9'||c<'0') {if(c=='-')b=-1;c=getchar();} while(c>='0'&&c<='9') a=(a<<3)+(a<<1)+c-48,c=getchar();return a*=b; }
inline void write(int x) {if(x>9)write(x/10);putchar('0'+x%10);}
inline void W(int x) {if(x<0){putchar('-'),x=-x;}write(x);}
/**/
int n;
/**/
int main()
{
    // freopen("test.in","r",stdin);
    // freopen("test.out","w",stdout);
    read(n);
    if(n==1) cout<<"1.0000000000";
    else if(n%2==0) cout<<"0.5000000000";
    else printf("%.10f\n",(n/2+1)*1.0/(1.0*n));
}

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

using namespace std;

int main (void) {
    int N, A;
    map<int, int> sum;  /* i + Ai を格納 */
    map<int, int> sub;  /* i - Ai を格納 */

    /* 入力の受取 */
    cin >> N;
    for ( int i=1; i<=N; i++ ) {
        cin >> A;
        sum[i+A]++;
        sub[i-A]++;
    }

    long long ans=0;
    for ( auto itr : sum ) {
        /* sum と同じ値の要素がなければスキップ */
        if ( sub.find(itr.first) == sub.end() )
            continue;
        /* sum と同じ値の要素があったら組み合わせ個数を計算 */
        ans += (long long)itr.second * sub.at(itr.first);
    }

    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 20964
#include <iostream>
#include <iomanip>
#include <vector>
#include <algorithm>
#include <numeric>
#include <functional>
#include <cmath>
#include <queue>
#include <stack>

#define repd(i,a,b) for (int i=(a);i<(b);i++)
#define rep(i,n) repd(i,0,n)
typedef long long ll;

using namespace std;


int inputValue(){
    int a;
    cin >> a;
    return a;
};

long long inputValueLongLong(){
    long long a;
    cin >> a;
    return a;
};

void inputArray(int * p, int a){
    rep(i, a){
        cin >> p[i];
    }
};

void inputVector(vector<int> * p, int a){
    rep(i, a){
        int input;
        cin >> input;
        p -> push_back(input);
    }
}

template <typename T>
void output(T a, int precision) {
    if(precision > 0){
        cout << setprecision(precision)  << a << "\n";
    }
    else{
        cout << a << "\n";
    }
}


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

    long long N;
    N = inputValueLongLong();
    long long D[N];
    long long i=0;
    long long count[N];
    for(i=0;i<N;i++){
        count[i]=0;
    }

    D[0] = inputValueLongLong();
    if(D[0]!=0){
        cout << 0 << endl;
        return 0;
    }

    for(i=1;i<N;i++){
        D[i] = inputValueLongLong();
        if(D[i]==0){
            cout << 0 << endl;
            return 0;
        }
        count[D[i]]++;
    }

    long long sum=1;
    long long j=0;

    for(i=2;i<N;i++){
        for(j=0;j<count[i];j++){
            sum *= count[i-1];
            sum = sum % 998244353;
            if(sum%998244353==0){
                cout << 0 << endl;
                return 0;
            }
        }
    }

    long long res = sum % 998244353;

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

Measured memory_bytes: 1792
#define _GLIBCXX_DEBUG
#include<algorithm>
#include<cmath>
#include<cstring>
#include<cstdio>
#include<iostream>
#include<vector>
#include<queue>
#include<deque>
#include<stack>
#include<set>
#include<map>
#include<string>
#include <bits/stdc++.h>
#define rep(i, n) for(int i = 0; i < (int)n; i++)
#define rep2(i,s,n) for(int i=s;i< (int)n; i++)
#define ll long long 
#define all(v) v.begin(),v.end()
using namespace std;
int main(){
  int n; cin >>n;
  vector<string> s(n);
  rep(i,n) cin>>s[i];
  rep(i,n) sort(all(s[i]));
  ll ans=0;
  sort(all(s));
  map<string,ll> mp;
  rep(i,n) {
    mp[s[i]]++;
  }
  for(auto x: mp){
    ans+=(x.second*(x.second-1))/2;
  }
  cout <<ans<<endl;
}

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

using ll = long long int;

const int MAX = (int)(1e5 + 5);
const ll INF = (ll)(1e10 + 5);

const int MAX_N = (int)(2e1 + 5);

int n;
int p[MAX_N];

int ans;

bool check(int a, int b, int c) {
  vector<int> tmp = {a, b, c};

  sort(tmp.begin(), tmp.end());

  return tmp[1] == b;
}

int main(void) {
  // Here your code !
  scanf("%d", &n);

  for (int i = 0; i < n; ++i) {
    scanf("%d", &(p[i]));
  }

  ans = 0;

  for (int i = 1; i < n - 1; ++i) {
    if (check(p[i - 1], p[i], p[i + 1])) ans += 1;
  }

  printf("%d\n", ans);

  return 0;
}


Measured memory_bytes: 256
// 参考: https://qiita.com/tanakh/items/0ba42c7ca36cd29d0ac8

macro_rules! read_value {
    ($iter:expr, ( $($t:tt),* )) => {
        ( $(read_value!($iter, $t)),* )
    };

    ($iter:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($iter, $t)).collect::<Vec<_>>()
    };

    ($iter:expr, chars) => {
        read_value!($iter, String).chars().collect::<Vec<char>>()
    };

    ($iter:expr, usize1) => {
        read_value!($iter, usize) - 1
    };

    ($iter:expr, $t:ty) => {
        $iter.next().unwrap().parse::<$t>().expect("Parse error")
    };
}

macro_rules! input_inner {
    ($iter:expr) => {};
    ($iter:expr, ) => {};

    ($iter:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($iter, $t);
        input_inner!{$iter $($r)*}
    };
}

macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
    ($($r:tt)*) => {
        let mut s = {
            use std::io::Read;
            let mut s = String::new();
            std::io::stdin().read_to_string(&mut s).unwrap();
            s
        };
        let mut iter = s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
}

fn main() {
    input! {
        a: i64,
        b: i64,
        c: i64,
        d: i64
    };

    let mut t_turn = a / d;
    let mut a_turn = c / b;
    let t_left = a % d;
    let a_left = c % b;

    if t_left != 0 {
        t_turn += 1;
    }

    if a_left != 0 {
        a_turn += 1;
    }

    if t_turn >= a_turn {
        println!("Yes");
    } else {
        println!("No");
    }
}


Measured memory_bytes: 2112
#pragma GCC optimize ("O3")
#pragma GCC target ("sse4")
 
#include <bits/stdc++.h>
 
using namespace std;
 
typedef long long ll;
typedef long double ld;
typedef complex<ld> cd;
 
typedef pair<int, int> pi;
typedef pair<ll,ll> pl;
typedef pair<ld,ld> pd;
 
typedef vector<int> vi;
typedef vector<ld> vd;
typedef vector<ll> vl;
typedef vector<pi> vpi;
typedef vector<pl> vpl;
typedef vector<cd> vcd;
 
#define FOR(i, a, b) for (int i=a; i<(b); i++)
#define F0R(i, a) for (int i=0; i<(a); i++)
#define FORd(i,a,b) for (int i = (b)-1; i >= a; i--)
#define F0Rd(i,a) for (int i = (a)-1; i >= 0; i--)
 
#define sz(x) (int)(x).size()
#define mp make_pair
#define pb push_back
#define f first
#define s second
#define lb lower_bound
#define ub upper_bound
#define all(x) x.begin(), x.end()
#define ins insert
 
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
 
const int MOD = 1000000007;
const char nl = '\n';
const int MX = 100001; //check the limits, dummy
 
int main() {
	ios_base::sync_with_stdio(0); cin.tie(0);    
	
    ld PI = 3.14159;
    ll R; cin >> R;
    cout << setprecision(10) << PI*2*R << nl;
	
	return 0;
}
 
// read the question correctly (ll vs int)
// template by bqi343



Measured memory_bytes: 3804
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
typedef long long ll;
using namespace __gnu_pbds;
typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> pbds;
#pragma GCC target ("avx2")
#pragma GCC optimization ("O3")
#pragma GCC optimization ("unroll-loops")
#define ios ios_base::sync_with_stdio(0) ; cin.tie(0) ; cout.tie(0)
#define so sizeof
#define pb push_back
#define cl clear() ;
#define vl vector<ll>
#define sz size()
#define len length()
#define el endl;cout.flush()
#define be begin()
#define fi first
#define se second
#define br break
#define en end()
#define ro return 0
#define br break
#define eb emplace_back
#define con continue
#define ms(x) memset(x , 0, so x)
#define all(x) (x).be , (x).en
#define acc(x) accumulate((x).be , (x).en , 0ll)
#define forn(i,a,b) for(ll i=a;i<=b;++i)
#define rng_58 mt19937 rng(chrono::steady_clock::now().time_since_epoch().count())
#define vll vector<pair<ll,ll> >
#define pll pair<ll,ll>
#define plll pair<ll,pair<ll,ll>>
#define plvl pair<pair<ll,ll> ,ll>
#define mp make_pair
#define trace3(a,b,c) cerr <<"a is " << a << " b is " << b << " c is " << c << el;
#define trace4(a,b,c,d) cerr <<"a is " << a << " b is " << b << " c is " << c <<" d is " << d << el ;
#define trace5(a,b,c,d,e) cerr <<"a is " << a << " b is " << b << " c is " << c <<" d is " << d << " e is " << e << el;
#define trace6(a,b,c,d,e,f) cerr <<"a is " << a << " b is " << b << " c is " << c <<" d is " << d << " e is " << e << " f is " << f << el ;

int main()
{
    ios;
    ll n , x;
    cin >> n >> x;
    ll res = 0 ;
    vl v ;
    forn(i , 1 , n){
       ll xx;
       cin >> xx;
       v.pb(xx) ;
       if(v[i-1] > x){
        res = res + v[i-1] - x;
        v[i-1] = x;
       }
    }
    forn(i , 1 , n-1){
       ll nsl = v[i] + v[i-1] ;
       if(nsl > x){
        ll diff = nsl - x;
        v[i] = max(0LL , v[i] - diff) ;
        res = res + diff;
       }
    }
    for(ll i = n-2;i>=0;--i){
        ll nsr = v[i] + v[i+1] ;
        if(nsr > x){
            ll diff = nsr -x ;
            v[i] = max(0LL , v[i] - diff) ;
            res = res + diff;
        }
    }
    cout << res<< el ;
    ro ;


}
































Measured memory_bytes: 1400
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#pragma GCC optimize("unroll-loops")
#include <bits/stdc++.h>

#define pb push_back
#define sz(x) ((int)(x).size())
#define all(x) (x).begin(),(x).end()
#define ll long long



using namespace std;

void file(){
	#ifndef ONLINE_JUDGE
    	freopen("in.txt", "r", stdin);
	#endif
}
int tc;
const int N=5e5+5,M=2e6+5,MOD=1e9+7,OO=1e9;

const int MSQ = sqrt(N) + 5;

std::vector<int> wa;
bool  y[1000005];
void sieve(){
	for(int i=2;i<=1000000;i++){
		if(y[i])continue;
		wa.pb(i);
		for(int j=i;j<=1000000;j+=i){
			y[j]=1;
		}
	}
}
int main(){
	ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
	//file();
	
	int n,m;

	cin>>n>>m;
	int ans=0,ans2=0;
	map<int,int>wa;
	for(int i=0;i<m;i++){
		int x;
		string a;
		cin>>x>>a;
		if(wa[x]==-1)continue;
		if(a=="WA")wa[x]++;
		else	ans2+=wa[x],ans++,wa[x]=-1;
	}
	cout<<ans<<" "<<ans2<<endl;
}		



Measured memory_bytes: 4992
n = gets.chomp.to_i
a = gets.chomp.split.map(&:to_i)

aa = [a[0]]
1.upto(n-1) do |i|
    aa << aa[-1] + a[i]
end

i1 = 0
i2 = 1
i3 = 2

ans = 10 ** 9

while(i2 < n-2) do
#    printf("%d %d %d %d\n", aa[i1], aa[i2] - aa[i1], aa[i3] - aa[i2], aa[n-1] - aa[i3])

    while i1 < i2 - 1 do
        if (aa[i1] - (aa[i2] - aa[i1])).abs > (aa[i1+1] - (aa[i2] - aa[i1+1])).abs
            i1 += 1
        else
            break
        end
    end


    while i3 < n - 2 do
        if (aa[n-1] - aa[i3] - (aa[i3] - aa[i2])).abs > (aa[n-1] - aa[i3+1] - (aa[i3+1] - aa[i2])).abs
            i3 += 1
        else
            break
        end
    end
    pqrs = [aa[i1], aa[i2] - aa[i1], aa[i3] - aa[i2], aa[n-1] - aa[i3]]

    ans = (pqrs.max - pqrs.min) if ans > (pqrs.max - pqrs.min)


    i2 += 1
end

puts ans

Measured memory_bytes: 24340