akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<n;i++)
#define pb push_back
const int N = 110000;
int pos;
char s[N];
map<char,int> mp;
int number(){
    return mp[s[pos++]];
}
int factor(){
    if(s[pos] == '['){
        pos++;
        int res = factor();
        pos++;
        return res;
    }
    else if(s[pos]=='+'){
        pos++;
        return factor()|factor();
    }
    else if(s[pos]=='*'){
        pos++;
        return factor()&factor();
    }
    else if(s[pos]=='^'){
        pos++;
        return factor()^factor();
    }
    else return number();
}
        
main(){
    while(1){
        scanf("%s",s);
        if(s[0]=='.')exit(0);
        map<int,int> cnt;
        int k,ans;cin>>k;
        rep(i,10000){
            int now = i;
            rep(j,4){
                mp['d'-j]=now%10;
                now/=10;
            }
            pos = 0;
            int t = factor();
            if(k==i){
                ans = t;
            }
            cnt[t]++;
        }
        cout << ans << " " << cnt[ans] << endl;
    }
}


Measured memory_bytes: 3128
#include <iostream>
#include <sstream>
#include <algorithm>
#include <string>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <stack>
#include <memory>
#include <complex>
#include <numeric>
#include <cstdio>
#include <iomanip>

#define REP(i,m,n) for(int i=int(m);i<int(n);i++)
#define EACH(i,c) for (auto &(i): c)
#define all(c) begin(c),end(c)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort(begin(c),end(c))
#define pb emplace_back
#define MP make_pair
#define SZ(a) int((a).size())

#ifdef LOCAL
#define DEBUG(s) cout << (s) << endl
#define dump(x)  cerr << #x << " = " << (x) << endl
#define BR cout << endl;
#else
#define DEBUG(s) do{}while(0)
#define dump(x) do{}while(0)
#define BR 
#endif
using namespace std;

using UI = unsigned int;
using UL = unsigned long;
using LL = long long int;
using ULL = unsigned long long;
using VI = vector<int>;
using VVI = vector<VI>;
using VLL = vector<LL>;
using VS = vector<string>;
using PII = pair<int,int>;
using VP = vector<PII>;

//struct edge {int from, to, cost;};

constexpr double EPS = 1e-10;
constexpr double PI  = acos(-1.0);
//constexpr int INF = INT_MAX;

template<class T> inline T sqr(T x) {return x*x;}

int main() {
    LL k;
    cin >> k;
    if (k == 0) {
        cout << 4 << endl;
        cout << "3 3 3 3" << endl;
        return 0;
    }
    if (k == 1) {
        cout << 3 << endl;
        cout << "1 0 3" << endl;
        return 0;
    }
    if (k <= 50) {
        cout << k << endl;
        REP(i,0,k) {
            if (i) cout << " ";
            cout << i + 1;
        }
        cout << endl;
        return 0;
    }
    int mod = k % 50;
    LL base = k / 50;
    cout << 50 << endl;
    REP(i,0,50) {
        if (i) cout << " ";
        if (i < 50 - mod) {
            cout << base + i;
        } else {
            cout << base + i + 1;
        }
    }
    cout << endl;
    
    return 0;
}
    /*
    VI a(50);
    REP(i,0,50) a[i] = 100 + i;
    a[0] -= 1;
    a[1] -= 1;
    int cnt = 0;
    while (*max_element(all(a)) >= 50) {
        auto it = max_element(all(a));
        for (auto i = begin(a); i != end(a); ++i) {
            if (i != it) *i += 1;
            else *i -= 50;
            //cout << *i << " ";
        }
        //cout << endl;
        //cout << *max_element(all(a)) << endl;
        cnt++;
    }
    cout << cnt << endl;
    */

Measured memory_bytes: 256
/**********************************************
 *Author*        :XzzF
 *Created Time*  : 2018/6/4 9:47:07
 *Ended  Time*  : 2018/6/4 9:50:21
*********************************************/

#include <cstdio>
#include <cstring>
#include <cmath>
#include <cstdlib>
#include <algorithm>
#include <string>
#include <iostream>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <stack>
#include <ctime>
using namespace std;
typedef long long LL;
const int inf = 1 << 30;
const LL INF = 1LL << 60;

int N;

int Get(int A, int B) {
	int res = 0;
	while(A > 0) {
		res += (A % 10);
		A = A / 10;
	}
	while(B > 0) {
		res += (B % 10);
		B = B / 10;
	}
	return res;
}

int main()
{
	while(scanf("%d", &N) != EOF)
	{
		int ans = inf;
		for(int i = 1; i <= (N + 1) / 2; i++) {
			int A = i, B = N - i;
			ans = min(ans, Get(A, B));
		}
		printf("%d\n", ans);
	}
    return 0;
}

Measured memory_bytes: 256
while True:
    n,x = map(int,input().split())
    s = 0
    if n==0 and x==0:
      break
    if x <= 3*n-3 and x >= 6:
      for i in range(1,min(n-1,x//3)):
        s += len(range(max(i+1,x-i-n),min(n,(x-i+1)//2)))
    print(s)

Measured memory_bytes: 7664
#include<bits/stdc++.h>
using namespace std;
#define int long long
//#undef int
#define mk make_pair
#define pb push_back
#define pf push_front
typedef pair<int, int> pii;
const int mod = 1000000007;
const int INF = 1000000009;
const long long INFL = 1000000000000000018ll;

int N, a[100100], K;

signed main()
{
    cin >> N >> K;
    for(int i = 0; i < N; i++){
        cin >> a[i];
    }
    for(int i = 1; i < N; i++){
        if(a[i] + a[i - 1] >= K){
            printf("Possible\n");
            for(int l = 1; l < i; l++){
                printf("%lld\n", l);
            }
            for(int r = N - 1; r >= i; r--){
                printf("%lld\n", r);
            }
            return 0;
        }
    }
    printf("Impossible\n");

    return 0;
}
/*


*/




Measured memory_bytes: 1536
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define rrep(i,n) for(int i = 1; i <= (n); ++i)
#define drep(i,n) for(int i = (n)-1; i >= 0; --i)
#define all(x) (x).begin(),(x).end()
#define SZ(x) ((int)(x).size())
#define bit(n) (1<<(n))
using namespace std;
typedef long long ll;
typedef long double ld;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<vi> vvi;
typedef vector<bool> vb;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1;} return 0;}
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1;} return 0;}
ll 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 const INF = 1001001001;


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

int a,b,c,k;
cin >> a >> b >> c >> k;
int cnt = 0;
while(a >= b) {
    b *= 2;
    cnt++;
}
while(b >= c) {
    c *= 2;
    cnt++;
}

if(cnt <= k) cout << "Yes" << endl;
else cout << "No" << endl;

return 0;
}

Measured memory_bytes: 3648
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(n);++i)
#define ALL(A) A.begin(), A.end()

using namespace std;

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

const int MAX_N = (int)1e5 + 5;
vector<int> G[MAX_N];
int d[2][MAX_N];

void dfs(int curr, int prev, int depth, int flag){
	d[flag][curr] = depth;
	for (int i = 0; i < (int)G[curr].size(); ++i){
		int next = G[curr][i];
		if (next == prev) continue;
		dfs(next, curr, depth + 1, flag);
	} // end for
}

int main()
{
	rep (i, MAX_N) G[i].clear();
	memset(d, 0, sizeof(d));
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	int N; cin >> N;
	rep (i, N - 1){
		int a, b; cin >> a >> b;
		--a, --b;
		G[a].push_back(b);
		G[b].push_back(a);
	} // end if
	
	dfs(0,-1, 0, 0);
	dfs(N-1, -1, 0, 1);

	int black = 0, white = 0;
	rep (i, N){
		if (d[0][i] <= d[1][i]){
			++black;
		}else{
			++white;
		} // end if
	} // end rep

	cout << (black > white ? "Fennec" : "Snuke") << endl;	

	return 0;
}

Measured memory_bytes: 14336
using System;
using static System.Console;
using static System.Math;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
 
 
namespace atcoder
{
    class Program
    {
        //メイン関数
        static void Main(string[] args)
        {
            string[] reader = ReadLine().Split(' ');
            int a = int.Parse(reader[0]);
            int b = int.Parse(reader[1]);
 
            if (a <= 9 && b <= 9) WriteLine(a * b);
            else WriteLine("-1");
        }
    }
}

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

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


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

int main(int argc, char const* argv[])
{
    int n, a, b;
    std::cin >> n >> a >> b;


    int diff = std::abs(a - b);
    if(diff % 2 == 0)
    {
        std::cout << "Alice" << std::endl;
    }
    else
    {
        std::cout << "Borys" << std::endl;
    }
}

Measured memory_bytes: 256
#include<iostream>
#include<algorithm>
#include<iomanip>
#include<ios>
#include<string>
#include<map>
#include<set>
#include <unordered_set>
#include<vector>
#include<cmath>

using namespace std;


int main(void) {
	long long int n, m; cin >> n >> m;
	long long int sum = 0;

	if (m == 1 && n == 1) { cout << "1" << endl; }
	else if (n <= 2 && m <= 2) { cout << "0" << endl; }
	else if (n == 1 && m != 1) { cout << n * m - 2 << endl; }
	else if (m == 1 && n != 1) { cout << n * m - 2 << endl; }
	else { cout << n * m - (n - 2) * 2 - (m - 2) * 2 - 4 << endl; }


	return 0;
}

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

int n;
void cs(int*,int*,int);

int main(){

  int i,k=0;
  int A[2000000];
  int B[2000000];

  scanf("%d",&n);
  for(i=0;i<n;i++){
    scanf("%d",&A[i]);
    if(A[i]>k) k=A[i];
  }

  cs(&A[0],&B[0],k);

  for(i=0;i<n-1;i++)printf("%d ",B[i]);
  printf("%d\n",B[i]);

  return 0;
}

void cs(int* A,int* B,int k){
  int i,j;
  int *C;

  C=(int*)malloc(sizeof(int)*(k+1));
  for(i=0;i<=k;i++) C[i]=0;
  for(j=0;j<n;j++) C[A[j]]++;
  i=0;
  for(j=0;j<=k;j++){
    while(1){
      if(C[j]==0)break;
      B[i]=j;
      i++;
      C[j]--;
    }
  }
}



Measured memory_bytes: 17360
#include<bits/stdc++.h>
using namespace std;
string s;
int k;
int main(){
	cin >> k;
	cin >> s;
	int len = s.length();
	if(k >= len) cout << s << endl;
	else{
		for(int i = 0;i < k;i++)
			printf("%c",s[i]);
		puts("...");
	}
	return 0;
}

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

using namespace std;
int main(int argc, char *argv[]) {
	int n, k, q;
	cin >> n >> k >> q;
	int a[q];
	for (int i = 0; i < q; i++) {
		cin >> a[i];
	}
	
	vector<int> b(n, k - q);
	for (int i = 0; i < q; i++) {
		b[a[i]-1] += 1;
	}
	
	for (int i = 0; i < n; i++) {
		if (b[i] > 0) {
			cout << "Yes" << endl;
		} else {
			cout << "No" << endl;
		}
	}
}

Measured memory_bytes: 1408
w,h,x,y = map(int,input().split())
print((w-0)*(h-0)/2)
if (w - 0)/2 == x and (h - 0)/2 == y:
  print(1)
else:
  print(0)
# vart = 0
# hori = 0
# vart = min((x - 0)*(h-0),(w - x)*(h - 0))
# hori = min((w - 0)*(y - 0),(w - 0)*(h - y))
# print(max(vart,hori))
# if vart == hori:
#   print(1)
# else:
#   print(0)

Measured memory_bytes: 2940
N,M = map(int,input().split())
shop = []
for _ in range(N):
  A = list(int(i) for i in input().split())
  shop.append(A)
shoplist = sorted(shop)
t = 0
k = 0
while k < M:
  k += shoplist[t][1]
  t += 1
x = 0
for i in range(t):
  x += shoplist[i][0]*shoplist[i][1]
print(x-(k-M)*shoplist[t-1][0])

Measured memory_bytes: 28644
n, y = gets.split.map(&:to_i)
0.upto(n) do |bill_1|
  0.upto(n) do |bill_2|
    next if (bill_1 + bill_2) > n
    bill_3 = n - (bill_1 + bill_2)
    if 10000 * bill_1 + 5000 * bill_2 + 1000 * bill_3 == y
      puts "#{bill_1} #{bill_2} #{bill_3}"
      exit
    end
  end
end
puts "-1 -1 -1"


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

int main(){
  string S, T;
  cin >> S >> T;
    int ans = T.size();
    for (int i = 0; i < S.size() - T.size() + 1; i++){
        int diff = 0;
        for (int j = 0; j < T.size(); j++){
            if(S.at(i + j) != T.at(j)){
                diff++;
                
            }
           
        }
      ans = min(ans, diff);
    }
    cout << ans << endl;
}



Measured memory_bytes: 3612
#include<iostream>
#include<stdio.h>
#include<cmath>
using namespace std;


int main()
{
    int k, s;
    cin >> k >> s;
    int res = 0;
    for (int x = 0; x <= k; x++)
        for (int y = 0; y <= k; y++)
        {
            if (x + y + k >= s && x + y <= s) res++;
        }
    cout << res << endl;
}

Measured memory_bytes: 256
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Scanner;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author mikit
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        C3Or2 solver = new C3Or2();
        solver.solve(1, in, out);
        out.close();
    }

    static class C3Or2 {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            int n = in.nextInt();
            int r = 0;
            for (int i = 0; i < n; i++) {
                int a = in.nextInt();
                int s = a & -a;
                r += log2(s);
            }
            out.println(r);
        }

        static int log2(int n) {
            if (n == 0) {
                return 0;
            }

            int pos = 0;
            if (n >= (1 << 16)) {
                n >>= 16;
                pos += 16;
            }
            if (n >= (1 << 8)) {
                n >>= 8;
                pos += 8;
            }
            if (n >= (1 << 4)) {
                n >>= 4;
                pos += 4;
            }
            if (n >= (1 << 2)) {
                n >>= 2;
                pos += 2;
            }
            if (n >= (1 << 1)) {
                pos += 1;
            }
            return pos;
        }

    }
}



Measured memory_bytes: 34652
# vim: fileencoding=utf-8


def main():
    n = int(input())
    ans = n
    max = 0
    for i in range(1, n + 1):
        c = len(bin(i)) - bin(i).rfind("1") - 1
        if max < c:
            max = c
            ans = i
    print(ans)


if __name__ == "__main__":
    main()


Measured memory_bytes: 62184
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int,int>;

int main() {
    int n;
    cin >> n;
    vector<char> c(n);
    for (int i = 0; i < n; i++)
        cin >> c[i];
    
    int l = 0, r = n-1;
    int ans = 0;
    while (l < r) {
        while (c[l] != 'W' && l < n) l++;
        while (c[r] != 'R' && 0 < r) r--;
        if (l >= r)
            break;
        ans++;
        l++;
        r--;
    }
    
    cout << ans << endl;
    
    return 0;
}


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

int main(){
	int n;
	scanf("%d", &n);
	int d[n + 1];
	memset(d, 0, sizeof d);
	d[0] = 1;
	for(int i = 100; i <= n; ++i){
		d[i] = d[i - 100] || d[i - 101] || d[i - 102] || d[i - 103] || d[i - 104] || d[i - 105];
	}
	printf("%d\n", d[n]);

}


Measured memory_bytes: 640
#include<bits/stdc++.h>
using namespace std;
#define rep(i,j,n) for(int i=(int)(j);i<(int)(n);i++)
#define REP(i,j,n) for(int i=(int)(j);i<=(int)(n);i++)
#define MOD 1000000007
#define int long long
#define ALL(a) (a).begin(),(a).end()
#define vi vector<int>
#define vii vector<vi>
#define pii pair<int,int>
#define priq priority_queue<int>
#define disup(A,key) distance(A.begin(),upper_bound(ALL(A),(int)(key)))
#define dislow(A,key) distance(A.begin(),lower_bound(ALL(A),(int)(key)))
signed main(){
  int ans=0;
  string S;
  cin>>S;
  rep(i,0,4){
    if(S[i]=='+')
      ans++;
    else
      ans--;
    }
  cout<<ans;
  }


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

#define REP(i,n) for(int i=0;i<(n);i++)
#define ALL(v) (v).begin(),(v).end()
#define int long long
typedef pair<int,int> P;

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

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

    int n;
    while(cin>>n,n)
    {
        vector<pair<double,string> > vec;
        REP(i,n){
            string str;
            int p,a,b,c,d,e,f,s,m;
            cin>>str>>p>>a>>b>>c>>d>>e>>f>>s>>m;
            double x=(double)(f*s*m-p)/(a+b+c+m*(d+e));
            vec.push_back(make_pair(-x,str));
        }
        sort(ALL(vec));

        REP(i,n) cout<<vec[i].second<<endl;
        cout<<"#"<<endl;
    }
}



Measured memory_bytes: 3204
n = int(input())
rx = 0
ry = 0
rt = 0
ok = True
for _ in range(n):
    t, x, y = map(int, input().split())
    dist = abs(x-rx) + abs(y-ry)
    #print(dist)
    if dist <= abs(t-rt) and (abs(t-rt)-dist)%2 == 0:
        rx = x
        ry = y
        rt = t
    else:
        print("No")
        exit()
print("Yes")

Measured memory_bytes: 9152
#include<iostream>
using namespace std;
#include<algorithm>
#include<map>
#define mod  998244353
#define int long long int
int32_t main()
{
     string str;
     cin>>str;
     int p=-1,q=-1;
     int i;
     for(i=0;str[i]!='\0';i++)
     {
		 if(str[i]=='C')
		 {
			 p=i;
			 break;
		 }
	 }
	 int j=str.size()-1;
	 while(j>=0)
	 {
		 if(str[j]=='F')
		 {
			 q=j;
			 break;
		 }
		 j--;
	 }
	 if(p!=-1&&q!=-1)
	 {
		 if(q>p)
		    cout<<"Yes"<<endl;
		 else
		    cout<<"No"<<endl;
	 }
	 else 
	     cout<<"No"<<endl;
}


Measured memory_bytes: 256
#include<cstdio>
#include<cstring>
#include<iostream>
#include<stdlib.h>
#include<ctime>
#include<string>
#include<cmath>
#include<algorithm>
#include<vector>
#include<set>
#include<map>
#include<queue>
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define LL long long
#define FOR(i,a,b) for (int i=a;i<=b;i++)
#define FORD(i,a,b) for (int i=a;i>=b;i--)
using namespace std;
typedef pair<int,int> pa;
void getint(int &v){
    char ch,fu=0;
    for(ch='*'; (ch<'0'||ch>'9')&&ch!='-'; ch=getchar());
    if(ch=='-') fu=1, ch=getchar();
    for(v=0; ch>='0'&&ch<='9'; ch=getchar()) v=v*10+ch-'0';
    if(fu) v=-v;
}
const int MO=1e9+7;
LL ans,fac[8010],inv[8010];
int n,v[4010][4010],tag[4010][4010],a[200010],b[200010];
LL pw(LL x,LL y){
	LL t=1;
	for (;y;y>>=1){
		if (y&1) t=t*x%MO;
		x=x*x%MO;
	}
	return t;
}
LL C(int x,int y){
	return fac[x]*inv[y]%MO*inv[x-y]%MO;
}
int main(){
	scanf("%d",&n);
	FOR(i,1,n){
		scanf("%d%d",&a[i],&b[i]);
		v[2000-a[i]][2000-b[i]]++;
		tag[2000+a[i]][2000+b[i]]++;
	}
	FOR(i,0,4000)
		FOR(j,0,4000){
			(v[i+1][j]+=v[i][j])%=MO;
			(v[i][j+1]+=v[i][j])%=MO;
		}
	FOR(i,0,4000)
		FOR(j,0,4000)
			(ans+=1ll*v[i][j]*tag[i][j])%=MO;
	fac[0]=1;
	FOR(i,1,8000) fac[i]=fac[i-1]*i%MO;
	inv[8000]=pw(fac[8000],MO-2);
	FORD(i,7999,0) inv[i]=inv[i+1]*(i+1)%MO;
	FOR(i,1,n)
		(ans-=C(a[i]+a[i]+b[i]+b[i],a[i]+a[i]))%=MO;
	ans=ans*pw(2,MO-2)%MO;
	ans=(ans%MO+MO)%MO;
	cout<<ans<<endl;
	return 0;
}


Measured memory_bytes: 96256
#include <bits/stdc++.h>
#include <string.h>
using namespace std;
typedef long long int ll;
typedef long double ld;
#define pb push_back
#define f(ii,n) for(ii=0;ii<n;ii++)
#define F(ii,a,n) for(ii=a;ii<n;ii++)
#define read(array,n) for(ll i=0;i<n;i++) cin>>array[i];
#define inf 1000000007;
// function to transform string to lowercase --> transform(s.begin(),s.end(),s.begin(),::tolower)
void swap(ll *xp,ll *yp){
	ll temp = *xp;
	*xp = *yp;
	*yp = temp;
}

ll power(ll i,ll j){
	ll prod=1;
	while(j>0){
		if(j&1){
			prod=prod*i;
		}
		j=j>>1;
		i=i*i;
	}
	return prod;
}

void solve(){
	ll n,i,j;
	cin>>n;
	ll f500=n/500;
	n=n%500;
	ll f5=n/5;
	n=n%5;
	ll tt=(f500*1000)+(f5*5);
	cout<<tt<<endl;
}
int main(){
	// freopen("filename.txt","r",stdin);
	solve();
	
	// ll t;
	// cin>>t;
	// while(t--){
	// 	solve();
	// }
}

Measured memory_bytes: 256
n = int(input())
lis = [tuple(map(int, input().split())) for i in range(n - 1)]
for i in range(n):
    time = 0
    for t in lis[i:]:
        c, s, f = t
        reg = (time + (f - 1)) // f * f
        time = max(reg, s) + c
    print(time)


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


int main()
{
	int a, b;

	cin >> a >> b;

	if (a == b){
		cout << "a == b" << endl;
	}
	else if (a < b){
		cout << "a < b" << endl;
	}
	else if (a > b){
		cout << "a > b" << endl;
	}
	
	return 0;
}


Measured memory_bytes: 3088
#include <bits/stdc++.h>
using namespace std;
#define ll                      long long
#define pb                      push_back
#define rep(i,a,b,c)            for(ll i=(a);i<=(b);i+=(c))
#define repb(i,a,b,c)           for(ll i=(a);i>=(b);i-=(c))
#define MOD                     1000000007
#define inf                     3e18
#define ld                      long double
#define mp                      make_pair
#define vpll                    vector<pair<ll,ll> >
#define vll                     vector<ll>
#define vld                     vector<ld>
#define vvll                    vector<vector<ll>>
#define vvld                    vector<vector<ld>>
#define pll                     pair<ll,ll>
#define vvpll                   vector<vector<pair<ll,ll>>>
#define pqll                    priority_queue<ll>
#define mll                     map<ll,ll>
#define mlc                     map<ll,char>
#define um                      unordered_map
#define umll                    um<ll,ll>
#define umlc                    um<ll,char>
#define all(x)                  x.begin(),x.end()
#define fi                      first
#define se                      second
#define ln                      cout<<"\n";
#define endl                    "\n"
#define test                    ll T;cin>>T;while(T--)
#define isvowel(a)              (a == 'a' || a == 'e' || a == 'i' || a == 'o' || a == 'u')
#define fastIO                  ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define show(w,size)            for(ll i=0;i<size;i++) cout<<w[i]<<" ";
#define prll(a)                 cout<<a<<"\n";
#define mset(dp,no)             memset(dp,no,sizeof(dp))
#define input(a,n)              rep(i,0,n-1,1) cin>>a[i];
#define countbit                __builtin_popcount                                           //Number of setbits in decimal notation
#define lb(v,cur)               lower_bound(all(v),cur)-v.begin()
#define ub(v,cur)               upper_bound(all(v),cur)-v.begin()
#define db(...)                 __f(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1>
void __f(const char* name, Arg1&& arg1) { cerr << name << " : " << arg1 <<'\n'; }
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args) {
    const char* comma = strchr(names + 1, ',');
    cout.write(names, comma - names) << " : " << arg1 << " | "; __f(comma + 1, args...);
}
long long pows(long long a, long long b) {
  long long res = 1;
    while (b > 0) {
        if (b & 1)
            res = res * a;
        a = a * a;
        b >>= 1;
    }
    return res;
}
ll powm(ll x,ll y,ll m=MOD){x=x%m;ll res=1;while(y){if(y&1)res=res*x;res%=m;y=y>>1;x=x*x;x%=m;}return res;}
ll modInverse(ll a, ll m=MOD){if(m == 1)return 0;ll m0=m,y=0,x=1;while(a>1){ll q=a/m,t=m;m=a%m,a=t;t=y;y=x-q*y;x=t;}if(x<0) x+=m0;return x;}
int main()
{
ll n,m,i,j,k,x,y,v,z,t,e,f,p,q,g,l,r,w,h,count1=0,prod=1,a,b,c,d,index,diff,ans=0,sum=0,sum1=0,sum2=0,flag=0,flag1=0,flag2=0;
string s,s1,s2;
cin>>n;
x=0;
ll ar[n];
for(i=0;i<n;i++)
{
  cin>>ar[i];
  x=(x^ar[i]);
}
for(i=0;i<n;i++)
{
  cout<<(x^ar[i])<<" ";
}
}


Measured memory_bytes: 5156
# -*- coding: utf-8 -*-
# abc126/abc126_a
import sys

s2nn = lambda s: [int(c) for c in s.split(' ')]
ss2nn = lambda ss: [int(s) for s in list(ss)]
ss2nnn = lambda ss: [s2nn(s) for s in list(ss)]
i2s = lambda: sys.stdin.readline().rstrip()
i2n = lambda: int(i2s())
i2nn = lambda: s2nn(i2s())
ii2ss = lambda n: [i2s() for _ in range(n)]
ii2nn = lambda n: ss2nn(ii2ss(n))
ii2nnn = lambda n: ss2nnn(ii2ss(n))

def main():
    N, K = i2nn()
    S = list(i2s())
    S[K-1] = S[K-1].lower()
    print(''.join(S))

main()

Measured memory_bytes: 3064
#include <bits/stdc++.h>
using namespace std;
#define ll long long int 
#define ull unsigned long long int
#define IOS ios_base::sync_with_stdio(false);cin.tie(NULL);
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define mx *max_element
#define mn *min_element
#define fo(i,n) for(ll i=0;i<n;i++)
#define of(i,n) for(ll i=n-1;i>=0;i--)
#define all(x) x.begin(),x.end()
#define sortall(x) sort(all(x))
#define mem(x,p) memset(x,p,sizeof(x))
#define w(t) ll t;cin>>t;while(t--)
#define kk "\n"
const ll mod=1e9+7;
int main()
{
  IOS
  ll n;
  cin>>n;
  ll p=31;
  ll c=0;
  unordered_map <ll,ll> mp{0};
  fo(i,n)
  {
    string s;
    cin>>s;
    ll ans=0;
    for(ll j=0;j<s.length();j++)
    {
      ll c=(ll)(s[j]);
      ans=ans+(ll)((c*(ll)pow(p,(ll)(j+1))));
    }
    if(mp[ans]==0)
    {
      c++;
      mp[ans]=1;
    }
  }
  cout<<c<<kk;
  return 0;
}


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

int main()
{
    int n,a,b,c,d,i,j;
    cin>>n>>a>>b>>c>>d;
    string s,s2;
    cin>>s;
    s = "#"+s;
    
    if(b<c)
    {
        for(i=b;i<min(c+2,d);i++)
        {
            if(s[i+1]=='#' || s[i-1]=='#' || s[i]=='#')
            {
                
            }
            else
            {
                b = i;
                break;
            }
        }
    }
    
    s[a] = '#';
    s[b] = '#';
    s2 = s;
    bool f = true, f2 = true;
    for(i=b+1;i<d;i++)
    {
        if(i+1<=d && s[i]=='#' && s[i+1]=='#')
        {
            f = false;
            break;
        }
    }
    s[d] = '#';
    s[b] = '.';
    // cout<<f<<" ";
    
    for(i=a+1;i<c;i++)
    {
        if(i+1<=c && s[i]=='#' && s[i+1]=='#')
        {
            // cout<<i<<" ";
            f = false;
            break;
        }
    }
    s[c] = '#';
    s[a] = '.';
    // cout<<f<<" ";
    
    for(i=a+1;i<c;i++)
    {
        if(i+1<=c && s2[i]=='#' && s2[i+1]=='#')
        {
            // cout<<i<<" ";
            f2 = false;
            break;
        }
    }
    s2[c] = '#';
    s2[a] = '.';
    for(i=b+1;i<d;i++)
    {
        if(i+1<=d && s2[i]=='#' && s2[i+1]=='#')
        {
            f2 = false;
            break;
        }
    }
    s2[d] = '#';
    s2[b] = '.';
    
    // cout<<f<<" "<<f2<<" ";
    
    if(f || f2)
        cout<<"Yes";
    else
        cout<<"No";
    
    return 0;
}


Measured memory_bytes: 772
import sys
import numpy as np

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

N = ir()
H = np.array(lr())
can_go = H[:-1] >= H[1:]
A = np.arange(N)
A[:-1][can_go] += 1

# 最終地点まで進める
for _ in range(20):
    A = A[A] 

answer = (A - np.arange(N)).max()
print(answer)
# 55

Measured memory_bytes: 23380
#include<bits/stdc++.h>
using namespace std;
int main(){
	int n;
	int sum=0;
	cin >> n;
	int t=n/2;
	if(t*2==n){
		cout << n/2-1;
	}
	else{
		cout << n/2;
	}
	return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>
#define int long long
using namespace __gnu_pbds;
using namespace std;
template <typename T>
using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;

int mod=1e9+7;
int dp1[100005];
int dp2[100005];
int pre1[100005],pre2[100005];
signed main()
{
     ios_base::sync_with_stdio(false);
     cin.tie(NULL);  
//  #ifndef ONLINE_JUDGE
//     freopen ("INPUT.txt" , "r" , stdin);
//     freopen ("OUTPUT.txt" , "w" , stdout);
//  #endif

// -------------------------------------Code starts here---------------------------------------------------------------------     

   int n,k;
   cin>>n>>k;
   int sq=sqrt(n);
   int sq2=sq;
   if(n/sq2==sq)
      sq2--;

   for(int i=1;i<=sq;i++)
   {
      dp1[i]=1;
      pre1[i]=pre1[i-1]+dp1[i];
      pre1[i]%=mod;
   }
   for(int i=sq2;i>=1;i--)
   {
      dp2[i]=(n/i-n/(i+1));
      pre2[i]=pre2[i+1]+dp2[i];
      pre2[i]%=mod;
   }
   for(int i=2;i<=k;i++)
   {
      for(int j=1;j<=sq;j++)
      {
         dp1[j]=pre1[sq]+pre2[j];
         dp1[j]%=mod;
      }
      for(int j=1;j<=sq2;j++)
      {
         dp2[j]=pre1[j]*(n/j-n/(j+1));
         dp2[j]%=mod;
      }

      for(int i=1;i<=sq;i++)
      {
         pre1[i]=pre1[i-1]+dp1[i];
         pre1[i]%=mod;
      }
      for(int i=sq2;i>=1;i--)
      {
         pre2[i]=pre2[i+1]+dp2[i];
         pre2[i]%=mod;
      }
   }
   cout<<(pre1[sq]+pre2[1])%mod;


// -------------------------------------Code ends here------------------------------------------------------------------
     clock_t clk;
 	clk = clock();
 
    clk = clock() - clk;
 	cerr << fixed << setprecision(6) << "Time: " << ((double)clk)/CLOCKS_PER_SEC << "\n";
 	return 0;
 }

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

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    string s;
    cin >> s;
    if(s.size() < 3){
        cout << 0 << endl;
        return 0;
    }
    ll ans = 0, cnt = 0;
    char c = '!';
    for(int i = s.size()-1; i >= 0; --i){
        if(i > 0 && s[i] == 'C' && s[i-1] == 'B'){
            ++cnt;
            --i;
        }
        else if(s[i] == 'A') ans += cnt;
        else cnt = 0;
    }
    cout << ans << endl;
	return 0;
}


Measured memory_bytes: 720
#include <bits/stdc++.h>
#define INF 1e18
#define int long long
#define Rep(i, a, n) for (int i = (a); i < (n); i++)
#define rep(i, n) Rep(i, 0, n)
#define all(a) (a).begin(), (a).end()
using namespace std;
typedef pair<int, int> P;
typedef pair<int, P> PP;
const int mod = 1000000007;

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

    int b;
    while (cin >> b, b)
    {
        int ans1, ans2;
        for (int i = 1; i * (i + 1) / 2 <= b; i++)
        {
            //s * i + i * (i - 1) / 2 = b
            if ((2 * b - i * (i - 1)) % (2 * i) == 0)
            {
                ans1 = ((2 * b - i * (i - 1)) / (2 * i));
                ans2 = i;
            }
        }
        cout << ans1 << " " << ans2 << endl;
    }
}


Measured memory_bytes: 3068
#include<bits/stdc++.h>
#include<vector>
#include<algorithm>
#define F first
#define S second
#define PB push_back
#define MP make_pair


using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef pair<int,int> pi;
typedef vector<pi> vii;
typedef set<int> si;
typedef map<string, int> msi;

#define INF 2000000000

const int maxn=10000009;
const ll mod=1e9+7;

int main()
{
    ios::sync_with_stdio(0);
    cin.tie(0);
    int n;
    cin>>n;
    int k;
    cin>>k;
    int ans=0,l;
    for(int i=0;i<n;i++){
        cin>>l;
        if(l>=k) ans++;
    }
    cout<<ans;

}


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

int main(){
  long long int N,M;
  long long int i;
  long long int ans = 0;
  cin >> N >> M;
  vector<pair<long long int,long long int>> pairs(N);
  for(i=0;i<=N-1;i++)
    cin >> pairs[i].first >> pairs[i].second;
  sort(pairs.begin(),pairs.end());
  i = 0;
  while(pairs[i].second < M){
    M -= pairs[i].second;
    ans += pairs[i].first * pairs[i].second;
    i++;
  }
  cout << ans + M * pairs[i].first;
}



Measured memory_bytes: 1792
#include<cstdio>
#define N 500001
using namespace std;
int a[N],right[N],l1[N],r1[N],limit1[N],limit2_l[N],limit2_r[N];
int n,m;
void swap(int &x,int &y)
{
	int t=x;x=y;y=t;
}
int max(int x,int y)
{
	if (x<y) return y;
	return x;
}
int min(int x,int y)
{
	if (x<y) return x;
	return y;
}
void qsort(int l,int r)
{
	int i=l,j=r;
	int mid=a[(i+j)/2];
	while (i<=j)
	{
		while (a[i]<mid) i++;
		while (a[j]>mid) j--;
		if (i<=j)
		{
			swap(a[i],a[j]);
			i++;j--;
		}
	}
	if (i<r) qsort(i,r);
	if (l<j) qsort(l,j);
}
bool pd(int s)
{
	for (int i=1;i<=n;i++)
		if (a[1]+a[i]<=s)
			right[1]=i;
	for (int i=2;i<=n;i++)
	{
		right[i]=right[i-1];
		while (right[i]>=0&&a[i]+a[right[i]]>s) right[i]--;
	}
	l1[1]=r1[1]=n+1;
	for (int i=1;i<=n;i++)
		if (a[1]+a[i]>=m)
		{
			l1[1]=i;break;
		}
	for (int i=1;i<=n;i++)
		if (a[1]+a[i]>=m&&a[1]+a[i]<=m+s)
			r1[1]=i;
	a[n+1]=1e9;
	for (int i=2;i<=n;i++)
	{
		l1[i]=l1[i-1];r1[i]=r1[i-1];
		while (l1[i]>=0&&a[i]+a[l1[i]-1]>=m) l1[i]--;
		while (r1[i]>=0&&a[i]+a[r1[i]]>m+s) r1[i]--;
	}
//	for (int i=1;i<=n;i++)
//		if (l1[i]<=i) l1[i]=i+1;
//	for (int i=1;i<=n;i++)
//		if (r1[i]<=i) r1[i]=i+1;
	limit1[0]=1e9;
	for (int i=1;i<=n;i++) 
		limit1[i]=min(limit1[i-1],right[i]+i-1);
	limit2_l[n+1]=0;limit2_r[n+1]=1e9;
	for (int i=n;i>=1;i--)
	{
		limit2_l[i]=max(limit2_l[i+1],l1[i]-(n-i));
		limit2_r[i]=min(limit2_r[i+1],r1[i]-(n-i));
	}
	for (int i=0;i<=n;i++)
		if (i%2==0&&i<=limit1[i]&&(limit2_l[i+1]<=i+1&&i+1<=limit2_r[i+1]))
			return true;
	return false;
}
int main()
{
	scanf("%d%d",&n,&m);
	for (int i=1;i<=n*2;i++) scanf("%d",&a[i]);
	qsort(1,n*2);
	n*=2;
	int l=0,r=m,ans=-1;
	while (l<=r)
	{
		int mid=(l+r)/2;
		if (pd(mid))
		{
			ans=mid;
			r=mid-1;
		}
		else
			l=mid+1;
	}
	printf("%d\n",ans);
} 

Measured memory_bytes: 7192
#include <bits/stdc++.h>
using namespace std;
#define REP(i,a,n) for(int i=(a); i<(int)(n); i++)
#define rep(i,n) REP(i,0,n)
#define FOR(it,c) for(__typeof((c).begin()) it=(c).begin(); it!=(c).end(); ++it)
#define ALLOF(c) (c).begin(), (c).end()
typedef long long ll;
typedef unsigned long long ull;

struct FenwickTree{
  static const int SIZE = 1<<17;
  int n, tree[SIZE+1];
public:
  FenwickTree(int n_){
    n = n_;
    for(int i=0; i<n+1; i++) tree[i] = 0;
  }
  void add(int i, int value){
    for(; i<n; i|=i+1) tree[i] += value;
  }
  int sum(int i){
    int s = 0;
    for(; i>=0; i=(i&i+1)-1) s += tree[i];
    return s;
  }
};


ll bubble(vector<int> v){
  ll ret = 0;
  FenwickTree ft(1<<17);
  
  rep(j,v.size()){
    ret += j - ft.sum(v[j]);
    ft.add(v[j], 1);
  }
  return ret;
}



int main(){
  string S;
  cin >> S;
  map<char,int> memo;
  rep(i,S.size()){
    memo[S[i]]++;
  }
  int odd = 0;
  FOR(it,memo){
    if((it->second)%2==1) odd++;
  }

  if(odd >= 2){
    cout << -1 << endl;
    return 0;
  }

  ll ret = 0;
  
  map<char,int> memo2;
  string S1, S2;
  rep(i,S.size()){
    if(memo2[S[i]]<memo[S[i]]/2){
      ret += i-(S1.size());
      S1 += S[i];
      memo2[S[i]]++;
    }else{
      S2 += S[i];
    }
  }
  reverse(ALLOF(S1));

  map<char,vector<int>> memo3;
  map<char,int> memo4;
  rep(i,S1.size()){
    memo3[S1[i]].push_back(i);
  }
  vector<int> v;
  rep(i,S2.size()){
    if(memo[S2[i]]%2==1){
      v.push_back(-1);
      memo[S2[i]]--;
    }else{
      v.push_back(memo3[S2[i]][memo4[S2[i]]]);
      memo4[S2[i]]++;
    }
  }
  if(odd > 0){
    rep(i,v.size()) v[i]++;
  }
  ret += bubble(v);
  
  cout << ret << endl;
  
  return 0;
}



Measured memory_bytes: 2688
#include <bits/stdc++.h>
using namespace std;
#define MOD 1000000007
//#define MOD 998244353
#define INF 1145141919810893364
typedef pair<int,int> PP;
typedef long long ll;
#define int ll
#define setdouble setprecision
#define REP(i,n) for(int i=0;i<(n);++i)
#define OREP(i,n) for(int i=1;i<=(n);++i)
#define RREP(i,n) for(int i=(n)-1;i>=0;--i)
#define GOODBYE cout << -1 << endl;return 0
#define MM <<" "<<
#define Endl endl

vector<int> compress(vector<int> D){
    map<int,int> G;
    vector<int> E,r;
    int s=D.size();
    for(int i=0;i<s;i++){
        E.push_back(D[i]);
    }
    sort(E.begin(),E.end());
    int t=0;
    for(int i=0;i<s;i++){
        if(i!=0 && E[i]!=E[i-1]){
            t++;
        }
        G[E[i]]=t;
    }
    for(int i=0;i<s;i++){
        r.push_back(G[D[i]]);
    }
    return r;
}

signed main(void){
    int N;
    vector<int> A,B,C,D;
    int b;
    cin >> N;
    REP(i,N){
        cin >> b;
        B.push_back(b);
    }
    B=compress(B);
    REP(i,N){
        if(!(i&1)){
            C.push_back(B[i]);
        }else{
            D.push_back(B[i]);
        }
    }
    sort(C.begin(),C.end());
    sort(D.begin(),D.end());
    
    REP(i,N){
        if(!(i&1)){
            A.push_back(C[i/2]);
        }else{
            A.push_back(D[i/2]);
        }
    }
    int Ans=0;
    
    //REP(i,N){cout << B[i] << " ";}cout << endl;
    //REP(i,N){cout << A[i] << " ";}cout << endl;
    
    REP(i,N){
        if((A[i]&1)!=(i&1)){
            Ans++;
        }
    }
    cout << Ans/2 << endl;
    return 0;
}



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

using namespace std;

typedef vector<int> vi;

int main() {
    ios::sync_with_stdio(false);

    int n, m;
    cin >> n >> m;
    string s;
    cin >> s;

    vi go;
    for (int i = 0; i <= n; i++) {
        if (s[i] == '0') {
            go.push_back(i);
        }
    }

    vi ans;
    for (int i = n; i > 0; ) {
        int x = *lower_bound(go.begin(), go.end(), i - m);
        if (x == i) {
            cout << -1 << endl;
            return 0;
        }

        ans.push_back(i - x);
        i = x;
    }

    for (int i = ans.size() - 1; i >= 0; i--) {
        cout << ans[i] << " \n"[i==0];
    }

    return 0;
}


Measured memory_bytes: 1480
N, T = map(int, input().split())
t = [int(i) for i in input().split()]
ans = 0
last_shower = 0
for i in range(N):
    if t[i] < last_shower < t[i] + T:
        ans += t[i] + T - last_shower
    else:
        ans += T
    last_shower = t[i] + T
print(ans)

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

int main(){
  int N, t;
  cin >> N;
  t = 0;
  
  for(int i = 0; i < N; i++){
    int a, b;
    cin >> a >> b;
    t += b - a + 1;
  }
  cout << t << endl;
}



Measured memory_bytes: 256
a,b,x=map(int,input().split())
a_x=a%x
if a_x==0:
    print(1+(b-a)//x)
else:
    a_new=a-a_x+x
    if a_new>b:
        print(0)
    else:
        print(1+(b-a_new)//x)

Measured memory_bytes: 2940
#include <iostream>
using namespace std;
 
int main(){
    int W, H, x, y, r;
    int minx, miny, maxx, maxy;
    cin >> W >> H >> x >> y >> r;

    minx = x - r;
    miny = y - r;
    maxx = x + r;
    maxy = y + r;

    if (minx < 0 || miny < 0 || maxx > W || maxy > H) {
        cout << "No" << endl;
        return 0;
    }

    cout << "Yes" << endl;
    return 0;
}

Measured memory_bytes: 1156
#include <stdio.h>
#define N 100000
#define NIL -1

struct Node{
  int p;
  int l;
  int r;
};

struct Node T[N];
int D[N];

void print(int);
int rec(int, int);


int main(){
  int n,i,j,k,id,c,l,r;
  scanf("%d",&n);

  for(i=0;i<n;i++) T[i].p = T[i].l = T[i].r = NIL;

  for(i=0;i<n;i++){
    scanf("%d%d",&id,&k);
    for(j=0;j<k;j++){
      scanf("%d",&c);
      if(j==0) T[id].l=c;
      else T[l].r=c;
      l=c;
      T[c].p=id;
    }
  }
  
  for(i=0;i<n;i++){
    if(T[i].p==NIL) r=i;
  }

  rec(r,0);

  for(i=0;i<n;i++) print(i);
 
  return 0;
}


void print(int u){
  int i,c;
  printf("node %d: parent = %d, depth = %d, ",u,T[u].p,D[u]);
  if(T[u].p==NIL) printf("root, ");
  else if(T[u].l==NIL) printf("leaf, ");
  else printf("internal node, ");
  
  printf("[");
  for(i=0,c=T[u].l; c!=NIL; i++,c=T[c].r){
    if(i) printf(", ");
    printf("%d",c);
  }
  printf("]\n");
}

int rec(int u, int p){
  D[u]=p;
  if(T[u].r!=NIL) rec(T[u].r, p);
  if(T[u].l!=NIL) rec(T[u].l, p+1);
}



Measured memory_bytes: 6408
#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(){
    double r;
    cin >> r;
    r = r*2.0;
    r = r*3.141592653;
    printf("%.5f",r);
}

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

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


Measured memory_bytes: 3080
N, K = gets.split.map(&:to_i)
v_list = gets.split.map(&:to_i)

ans = -1
(0..([N, K].min)).each do |lc|
  (0..([N - lc, K - lc].min)).each do |rc|
    sorted = (v_list.take(lc) + v_list.drop(v_list.size - rc)).sort
    sum = 0
    restc = K - lc - rc
    sorted.each do |v|
      if v < 0 && restc > 0
        restc -= 1
        next
      end
      sum += v
    end
    ans = sum if sum > ans
  end
end
puts ans


Measured memory_bytes: 3964
macro_rules! input {
    ($t:ty) => {
        {
            let mut line = String::new();
            std::io::stdin().read_line(&mut line).unwrap();
            line.trim().parse::<$t>().unwrap()
        }
    };
    ($($t:ty),*) => {
        {
            let mut line = String::new();
            std::io::stdin().read_line(&mut line).unwrap();
            let mut iter = line.split_whitespace();
            (
                $(iter.next().unwrap().parse::<$t>().unwrap(),)*
            )
        }
    };
    ($t:ty ;) => {
        {
            let mut line = String::new();
            std::io::stdin().read_line(&mut line).unwrap();
            line.split_whitespace()
                .map(|t| t.parse::<$t>().unwrap())
                .collect::<Vec<_>>()
        }
    };
    ($t:ty ; $n:expr) => {
        (0..$n).map(|_|
            input!($t)
        ).collect::<Vec<_>>()
    };
}

fn main(){
    let (a,b,c) = input!(usize,usize,usize);
    let mut ans = 1;
    let mut x = vec![a];
    for i in vec![b,c]{
        if x.contains(&i) {
            continue;
        }else{
            ans += 1;
            x.push(i);
        }
    }
    println!("{}", ans);
}

Measured memory_bytes: 4352
#include <bits/stdc++.h>
using namespace std;
#define REP(i,b,e) for(int i=(b);i<(e);++i)
#define RREP(i,b,e) for(int i=(b)-1;i>=e;--i)
#define rep(i,e) for(int i=0;i<(e);++i)

constexpr int MOD = 1000000007;
constexpr long long INF = 1LL << 62;
constexpr double EPS = 1e-9;

struct custom_tf : std::numpunct<char> {
  std::string do_truename() const { return "Yes"; }
  std::string do_falsename() const { return "No"; }
};

struct Initializer {
  Initializer() {
    std::cin.tie(0);
    std::ios::sync_with_stdio(0);
    std::cout << std::fixed << std::setprecision(15) << std::boolalpha;
    std::cout.imbue(std::locale(std::cout.getloc(), new custom_tf));
  }
} initializer;

template<typename T>
std::istream &operator>>(std::istream &is, std::vector<T> &vec) {
  for (T &x : vec) is >> x;
  return is;
}

template<typename T>
std::ostream &operator<<(std::ostream &os, const std::vector<T> &vec) {
  os << "[";
  for (auto it = vec.begin(); it != vec.end(); ++it) {
    if (it != vec.begin()) os << ", ";
    os << *it;
  }
  return os << "]";
}

template<typename T, typename U>
std::ostream &operator<<(std::ostream &os, const std::pair<T, U> &pa) {
  return os << "(" << pa.first << ", " << pa.second << ")";
}

template<typename T>
std::ostream &operator<<(std::ostream &os, const std::set<T> &se) {
  os << "{";
  for (auto it = se.begin(); it != se.end(); ++it) {
    if (it != se.begin()) os << ", ";
    os << *it;
  }
  return os << "}";
}

template<typename T, typename U>
std::ostream &operator<<(std::ostream &os, const std::map<T, U> &ma) {
  os << "{";
  for (auto it = ma.begin(); it != ma.end(); ++it) {
    if (it != ma.begin()) os << ", ";
    os << it->first << ": " << it->second;
  }
  return os << "}";
}

inline void print(void) { std::cout<<'\n'; }
template<class T> inline void print(const T &x) { std::cout<<x<<'\n'; }
template<class T, class... U> inline void print(const T &x, const U&... y) { std::cout<<x<<", "; print(y...); }
#define dump(...) std::cout<<#__VA_ARGS__<<": [L_"<<__LINE__<<"]"<<'\n'; print(__VA_ARGS__);std::cout<<'\n';

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


int main() {
  int a; cin>>a;
  string s; cin>>s;
  if(a>=3200) print(s);
  else print("red");

  return 0;
}


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

#define rep(i, n) for (int i = 0; i < int(n); i++)
#define rrep(i, n) for (int i = int(n) - 1; i >= 0; i--)
#define reps(i, n) for (int i = 1; i <= int(n); i++)
#define rreps(i, n) for (int i = int(n); i >= 1; i--)
#define repi(i, a, b) for (int i = int(a); i < int(b); i++)
#define each(x, y) for (auto &x : y)
#define all(a) (a).begin(), (a).end()
#define bit(b) (1ll << (b))
#define uniq(v) (v).erase(unique(all(v)), (v).end())
#define rsort(v) sort(all(v)); reverse(all(v))

using namespace std;

using i32 = int;
using i64 = long long;
using f80 = long double;
using vi32 = vector<i32>;
using vi64 = vector<i64>;
using vf80 = vector<f80>;
using vstr = vector<string>;

inline void yes() { cout << "Yes" << '\n'; exit(0); }
inline void no() { cout << "No" << '\n'; exit(0); }
inline i64 gcd(i64 a, i64 b) { if (min(a, b) == 0) return max(a, b); if (a % b == 0) return b; return gcd(b, a % b); }
inline i64 lcm(i64 a, i64 b) { return a / gcd(a, b) * b; }
void solve(); int main() { ios::sync_with_stdio(0); cin.tie(0); cout << fixed << setprecision(16); solve(); return 0; }
template<typename T> class pqasc : public priority_queue<T, vector<T>, greater<T>> {};
template<typename T> class pqdesc : public priority_queue<T, vector<T>, less<T>> {};
template<typename T> inline void amax(T &x, T y) { if (x < y) x = y; }
template<typename T> inline void amin(T &x, T y) { if (x > y) x = y; }
template<typename T> inline T power(T x, i64 n) { T r = 1; while (n > 0) { if (n & 1) r *= x; x *= x; n >>= 1; } return r; }
template<typename T> istream& operator>>(istream &is, vector<T> &v) { for (auto &x : v) is >> x; return is; }
template<typename T> ostream& operator<<(ostream &os, const vector<T> &v) { rep(i, v.size()) { if (i) os << ' '; os << v[i]; } return os; }

void solve() {
  int sx, sy, tx, ty;
  cin >> sx >> sy >> tx >> ty;
  rep(i, tx - sx) cout << 'R';
  rep(i, ty - sy) cout << 'U';
  rep(i, tx - sx) cout << 'L';
  rep(i, ty - sy) cout << 'D';
  cout << 'D';
  rep(i, tx - sx + 1) cout << 'R';
  rep(i, ty - sy + 1) cout << 'U';
  cout << 'L';
  cout << 'U';
  rep(i, tx - sx + 1) cout << 'L';
  rep(i, ty - sy + 1) cout << 'D';
  cout << 'R';
  cout << '\n';
}


Measured memory_bytes: 256
fun main(args: Array<String>) {
    val h = readLine()!!.toInt()
    val w = readLine()!!.toInt()
    val n = readLine()!!.toInt()

    val ans = Math.max(h, w).let {
        n / it + if (n % it != 0) {
            1
        } else {
            0
        }
    }
    println(ans)
}

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

int main() {
	
	ios_base::sync_with_stdio(0);
	
	int n;
	cin >> n;
	vector<vector<int>> v(n,vector<int>(3,0));
	
	for(int i=0; i<n; ++i) {
		for(int j=0; j<3; ++j)
		cin >> v[i][j];
	}
	
	for(int i=1; i<n; ++i) {
		for(int j=0; j<3; ++j) {
			
			if(j==0)
			v[i][j] = v[i][j] + max(v[i-1][1],v[i-1][2]);
			
			else if(j==1)
			v[i][j] = v[i][j] + max(v[i-1][0],v[i-1][2]);
			
			else
			v[i][j] = v[i][j] + max(v[i-1][0],v[i-1][1]);
			
		}
		
	}
	
	cout << max(v[n-1][0],max(v[n-1][1],v[n-1][2]));
	return 0;
	
}

Measured memory_bytes: 8800
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
ll GCD(ll x,ll y){
    if(y == 0) return x;
    else return GCD(y,x%y);
}

int main() {
    int a,b,c;
    cin >> a >> b >> c;
    int ans = -1;
    if(a % 2 != 0 || b % 2 != 0 || c % 2 != 0){
        cout << 0 << endl;
        return 0;
    }
    for(int i = 1;i <= 1000;i++){
        if(a % 2 != 0 || b % 2 != 0 || c % 2 != 0){
            ans = i-1;
            break;
        }
        int x,y,z;
        x = a;
        y = b;
        z = c;
        a = (y+z)/2;
        b = (x+z)/2;
        c = (x+y)/2;
    }
    cout << ans << endl;
}



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

using namespace std;

int main(){
    int N, M;
    cin >> N >> M;
    vector<long long> c(N+1, -1);
    c[N] = 1;
    vector<int> b(N+1, 0);
    for(int i=0; i<M; ++i){
        int t;
        cin >> t;
        b[t] = 1;
    }

    function<long long(int n)> f = [&](int n){
        if(c[n]>=0) return c[n];
        long long count = 0;
        if(n+1<=N && b[n+1]==0) count += f(n+1);
        if(n+2<=N && b[n+2]==0) count += f(n+2);
        c[n] = count % 1000000007;
        return c[n];
    };
    cout << f(0) << endl;;
}


Measured memory_bytes: 7680