akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
using namespace std;
int main(){
	int n,m,i,j;
	char **a,*b;
	while(cin>>n){
		if(n==0){break;}
		a=new char*[n];
		for(i=0;i<n;i++){
			a[i]=new char[2];
		}
		for(i=0;i<n;i++){
			cin>>a[i][0]>>a[i][1];
		}
		cin>>m;
		b=new char[m+1];
		for(i=0;i<m;i++){
			cin>>b[i];
			for(j=0;j<n;j++){
				if(b[i]==a[j][0]){
					b[i]=a[j][1];
					break;
				}
			}
		}
		b[m]='\0';
		cout<<b<<endl;
	}
	return 0;
}

Measured memory_bytes: 1304
#include<bits/stdc++.h>
#define ll  long long
using namespace std;
int main()
{
	
	int N;
	ll Y;
	cin>>N>>Y;
	int a=0,b=0,c=0;
	int flag = Y/1000;
	b = Y/5000;
	c = (Y%5000)/1000;
	int count = 0;
		while(a+b+c!=N)
		{
			count++;
			if(count>N*flag) break;
			if(a+b+c>N)
			{
				if(b>0)
				{
					b-=2;
					a++;
				}
				else
				{
					c-=10;
					a++;
				}
			}
			if(a+b+c<N)
			{
				if(a>0)
				{
					a--;
					c+=10;
				}
				else
				{
					if(b>0)
					{
						b--;
						c+=5;
					}
					
				}
			}
		}
		if(count<N*flag&&a>=0&&b>=0&&c>=0)
		cout<<a<<" "<<b<<" "<<c<<endl;
		else
		cout<<"-1 -1 -1"<<endl;
	
	return 0;
}

Measured memory_bytes: 256
from collections import deque
def LI():return [int(i) for i in input().split()]

ans=0
inf=1<<65
n,m=LI()
X=[0,inf,-inf]
Y=[0,inf,-inf]
V=[]
H=[]
for i in range(n):
    a,b,c=LI()
    V.append(((a,b),c))
    Y.append(c)
    X.append(a)
    X.append(b)
 
n+=2
V.append(((-inf,inf),inf))
V.append(((-inf,inf),-inf))
 
for i in range(m):
    a,b,c=LI()
    H.append((a,(b,c)))
    X.append(a)
    Y.append(b)
    Y.append(c)
 
m+=2
H.append((inf,(-inf,inf)))
H.append((-inf,(-inf,inf)))

X.sort()
xdc={}
c=1
for j in sorted(set(X)):
    xdc[c]=j
    c+=1
nx=c-1
 
Y.sort()
ydc={}
c=1
for j in sorted(set(Y)):
    ydc[c]=j
    c+=1
ny=c-1
 
xdcr=dict(zip(xdc.values(),xdc.keys()))
ydcr=dict(zip(ydc.values(),ydc.keys()))
 
mpy=[[0]*(nx+1+1) for i in range(ny+1+1)]
mpx=[i[:]for i in mpy]

for (a,b),c in V:
    mpx[ydcr[c]][xdcr[a]]+=1
    mpx[ydcr[c]][xdcr[b]]+=-1
for i in range(ny+1):
    for j in range(nx):
        mpx[i][j+1]+=mpx[i][j]
        
for d,(e,f) in H:
    mpy[ydcr[e]][xdcr[d]]+=1
    mpy[ydcr[f]][xdcr[d]]+=-1
for j in range(nx+1):
    for i in range(ny):
        mpy[i+1][j]+=mpy[i][j]

v=[[0]*(nx+1) for i in range(ny+1)]
q=deque([(xdcr[0],ydcr[0])])
v[ydcr[0]][xdcr[0]]=1

while q:
    cx,cy=q.popleft()
    ans+=(xdc[cx]-xdc[cx+1])*(ydc[cy]-ydc[cy+1])
    for dx,dy in [(-1,0),(1,0),(0,1),(0,-1)]:
        nbx=cx+dx
        nby=cy+dy
        if (not 0<=nbx<nx) or (not 0<=nby<ny) or v[nby][nbx]==1:
            continue
        if dy!=0:
            if mpx[cy+(dy+1)//2][cx]==0:
                q.append((nbx,nby))
                v[nby][nbx]=1
        else:
            if mpy[cy][cx+(dx+1)//2]==0:
                q.append((nbx,nby))
                v[nby][nbx]=1
if ans>=inf:
    ans='INF'
print(ans)

Measured memory_bytes: 363700
#include <iostream>
#include <fstream>
#include <vector>
#include <cstring>
#include <algorithm> // sort
#include <map> // sort

#define REP(i, n) for (long long i = 0; i < (n); i++) 
typedef long long ll;
static const ll MOD = 1000000007;
static const ll INF = 1000000000000000000LL;
using namespace std;

//2N本の串がある
//串は2本1セットで刺せる具の数は、min(a,b)
//最も具材を刺せる組合せを探す

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

    vector <ll> l(2*n);

    REP(i,2*n)
    {
        cin >> l.at(i);
    }

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


    int res = 0;

    for(ll i = 0; i < 2*n; i+=2)
    {
        res += l.at(i); 
    }

    cout << res << endl;

    return 0;    
}



Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <boost/multiprecision/cpp_int.hpp>
#define rep(i,a,b) for(ll i=a;i<b;i++)
#define ull unsigned long long
#define pb push_back
#define PF push_front //deque
// #define mp make_pair
#define pq priority_queue
// const int128_t mod=1000000007;
#define f first
#define s second
#define pii pair< int, int >
#define vi vector<int>
#define vpii vector<pii>
#define debug(v) for(auto i:v) cout<<i<<" ";
#define tc int t; cin >> t; while(t--)
#define ll long long
using namespace boost::multiprecision;
using namespace std;
void optimizeIO(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
}


const int N=1000005;
ll fact[N],invfact[N];
int128_t power(int128_t x,int128_t y, int128_t mod){
  if(y<=0) return 1LL;
  int128_t z=power(x,y/2,mod);
  if(y%2) return (((z*z)%mod)*x)%mod;
  return (z*z)%mod;
}
//
// void pre(){
//   fact[0]=invfact[0]=invfact[1]=fact[1]=1;
//   rep(i,2,N) fact[i]=(i*fact[i-1])%mod;
//   rep(i,2,N) invfact[i]=(invfact[i-1]*power(i,mod-2))%mod;
// }
// ll nCr(ll n,ll k){ return (((fact[n]*invfact[n-k])%mod)*invfact[k])%mod; }
//
//
//
// const int N1=1e6+1;
// vector<int> isprime(N1,1),prime;
// void seive(){
//   rep(i,2,sqrt(N1)+1){
//       if(isprime[i]){
//         for(int j=i*i;j<N1;j+=i) isprime[j]=0;
//         prime.pb(i);
//       }
//   }
//   rep(i,sqrt(N1)+1,N1) if(isprime[i]) prime.pb(i);
// }
//
//
//
// struct dsu {
//     vector<int> par, rank;
//     dsu(int n): par(n+1), rank(n+1) {
//         for (int i = 0; i <= n; i++) {
//             par[i] = i;
//             rank[i]= 1;
//         }
//     }
//     int root(int a) {
//         if (a == par[a]) return a;
//         return par[a] = root(par[a]);
//     }
//     void merge(int a, int b) {
//         a = root(a);
//         b = root(b);
//         if (a == b) return;
//         if (rank[a] > rank[b]) swap(a, b);
//         par[b] = a;
//     }
//     set<int> parent(int n){
//         set<int> s;
//         for(int i=1;i<=n;i++){
//             s.insert(root(i));
//         }
//         return s;
//     }
// };

void solve(){
  // int n,k;
  // cin>>n>>k;
  // // ll ans=0;
  // // rep(i,1,n/k+1){
  // //   int left=n-i*k;
  // //
  // //   ans=(ans+nCr(left+i-1,i-1))%mod;
  // // }
  // ll dp[n][k];
  // rep(i,0,n) rep(j,0,i+1) dp[i][j]=
  // cout<<ans<<endl;

  ull n,x,m;
  cin>>n>>x>>m;
  ull z=x,last=x;
  map<ull,ull> m1;
  vector<ull> v1;
  v1.push_back(last);
  m1[last]=0;
  int idx=-1,idx2=-1;
  rep(i,1,n){
    last=(last*last)%m;
    z=z+last;
    if(last==0) break;
    if(n>10000000 && m1.find(last)!=m1.end()){
      idx=m1[last];
      idx2=i;
      break;
    }
    else{
      m1[last]=i;
      v1.push_back(last);
    }
  }
  if(idx2!=-1 ){
    ull cycle_sum=accumulate(v1.begin()+idx,v1.end(),0LL);
    ull ans=accumulate(v1.begin(),v1.end(),0LL);
    ull len=v1.size()-idx;
    ull l=n-idx2;
    ull num=l/len,num2=l%len;
    ans=ans+cycle_sum*num+accumulate(v1.begin()+idx,v1.begin()+idx+num2,0LL);
    cout<<ans<<endl;
  }
  else cout<<z<<endl;
}

int main(){
    optimizeIO();
    int r=1;
    // pre();
    {solve();}
}


Measured memory_bytes: 11620
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define mp make_pair
#define fi first
#define se second
const int maxn=20;
const int maxm=2<<16;
const int maxe=maxn*2;
const ll mod=1e9+7;
const int inf=0x3f3f3f3f;
int n,m,k;


int main(){
    scanf("%d%d",&n,&k);
    ll ans=0;
    for(int b=k+1;b<=n;b++){
        ans+=b-max(k,1);
        int num=(n+1-b)/b;
        ans+=num*(b-k);
        int lef=n+1-b-num*b;
        if(lef>=k+1)ans+=lef-k;
    }
    printf("%lld\n",ans);
    return 0;
}


Measured memory_bytes: 256
#include<stdio.h>
using namespace std;

int a = 0, b = 0;
char op;
int main() {
	while (1) {
		scanf("%d %c %d", &a, &op, &b);
		if (op == '?') {
			break;
		}
		else if (op == '+') {
			printf("%d\n", a + b);
		}
		else if (op == '-') {
			printf("%d\n", a - b);
		}
		else if (op == '*') {
			printf("%d\n", a * b);
		}
		else if (op == '/') {
			printf("%d\n", a / b);
		}

	}
}


Measured memory_bytes: 2700
#include <bits/stdc++.h>
using namespace std;
long long gcd(long long x,long long y){
  if(x%y==0){
    return y;
  }
  return gcd(y,x%y);
}
long long lcm(long long p,long long q){
  return (p*q)/gcd(p,q);
}
int main(){
  long long a,b;
  cin>>a>>b;
  cout<<lcm(a,b)<<endl;
  return 0;
}


Measured memory_bytes: 3612
#include <cstdio>
#include <algorithm>
#define ll long long int
using namespace std;
ll X;
ll yin[100001];
ll cal(int a, int b)
{
	ll res = a*a*a*a+a*a*a*b+a*a*b*b+a*b*b*b+b*b*b*b;
	return res;
}
int main()
{
	scanf("%lld", &X);
	for(int i=1;i*i<=X;i++)
	{
		if(X%i==0)
		{
			yin[++yin[0]] = i;
			yin[++yin[0]] = X/i;
		}
	}
	sort(yin+1, yin+1+yin[0]);
	
/*	for(int i=1;i<=yin[0];i++)
	    printf("第%d个因子: %d\n", i, yin[i]);*/
	    
	for(int i=1;i<=yin[0];i++)  //yin[i]表示a-b 
	{
		for(int b=-5001;b<=5001;b++)
		{
			int a = b+yin[i];
			if(yin[i]*cal(a, b)==X)
			{
				printf("%d %d\n", a, b);
				return 0;
			}
		}
	}
	return 0;
}

Measured memory_bytes: 1712
N, M=map(int, input().split())
s=[list(map(int, input().split())) for i in range(M)]
p=list(map(int, input().split()))

ans=0

for i in range(2**N):
    swi=bin(i)[2:].rjust(N, "0")
    lights=1

    for j in range(M):
        cnt=0
        for k in range(1, s[j][0]+1):
            if swi[s[j][k] -1] == "1":
                cnt+=1

        if cnt%2 != p[j]:
            lights=0
    
    if lights==1:
        ans+=1

print(ans)

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


using namespace std;

#define endl '\n'
#define PB push_back
#define MP make_pair
#define LL long long
#define FOR(i,a,b) for(int i = (a); i <= (b); i++)
#define RE(i,n) FOR(i,1,n)
#define REP(i,n) FOR(i,0,(int)(n)-1)
#define R(i,n) REP(i,n)
#define VI vector<int>
#define PII pair<int,int>
#define LD long double
#define FI first
#define SE second
#define st FI
#define nd SE
#define ALL(x) (x).begin(), (x).end()
#define SZ(x) ((int)(x).size())

typedef long long ll;

bool file=0,rt=1;
clock_t tStart ;
void FAST_IO();
////////////////////////

int main() {

    //FAST_IO();
    ios_base::sync_with_stdio(0);
    cin.tie(NULL);
    cout << setprecision(5);
    cout << fixed;

    int n, m;

    cin >> n >> m;
    vector< pair<ll, ll> > a;

    for(int i = 0; i < n; i++) {

        int t1, t2;

        cin >> t1 >> t2;

        a.push_back(make_pair(t1, t2));
    }

//    cout << endl;

    sort(a.begin(), a.end());
//
//     for(int i = 0; i < n; i++) {
//
//        cout << a[i].first << " " << a[i].second << endl;
//    }
//

    ll sum = 0, buy = 0;

    for(int i = 0; i < n; i++) {

        if(buy == m) break;

        if(a[i].second + buy <= m) {

            sum += a[i].first * a[i].second;
            buy += a[i].second;
        }

        else if(a[i].second + buy > m && buy < m) {

            sum += a[i].first * (m-buy);
            buy += (m-buy);
        }
    }

    cout << sum << endl;


    return 0;
}

void FAST_IO()
{
    ios_base::sync_with_stdio(0);
    cin.tie(NULL);
    //cout.tie(NULL);
    //cout.setf(ios::fixed);
    //cout.precision(2);
    if(rt && file){ tStart = clock(); }
    if(file){
    #ifndef _offline
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    #endif
    }
}




Measured memory_bytes: 2420
# -*- coding: utf-8 -*-
n = int(input())
h = [int(i) for i in input().split()]

flag = True
for i in reversed(range(n - 1)):
    if h[i] - h[i + 1] == 1:
        h[i] -= 1
    elif h[i] > h[i + 1]:
        flag = False
if flag:
    print("Yes")
else:
    print("No")


Measured memory_bytes: 14396
import sys

sys.setrecursionlimit(10**6)
int1 = lambda x: int(x)-1
p2D = lambda x: print(*x, sep="\n")
def II(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def LI(): return list(map(int, sys.stdin.readline().split()))
def LLI(rows_number): return [LI() for _ in range(rows_number)]
def SI(): return sys.stdin.readline()[:-1]

n=II()
xy=[]
for _ in range(n):
    u,v=MI()
    xy.append((u+v,u-v))
xy.sort()
l=xy[0][0]
t=b=xy[0][1]
ans=0
for x,y in xy:
    ans=max(ans,x-l,t-y,y-b)
    t=max(t,y)
    b=min(b,y)
print(ans)


Measured memory_bytes: 86196
a = input().rstrip().split(" ")
K = int(a[0])
A = int(a[1])
B = int(a[2])

bis = 1

if B - A > 1:
    if K >= A + 1:
        # bis = (K - (A - 1)) // 2 * (B - A) + A
        koukan = (K - (A - 1)) // 2
        koukan_turn = koukan * 2
        nokori_turn = K - koukan_turn
        bis += koukan * (B - A) + nokori_turn
    else:
        bis += K
else:
    bis += K
    
print(bis)

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

int main() {
  int n,d,x; cin >>n >>d >>x;
  vector<int> a(n);
  for (int i=0; i<n; i++) cin >>a.at(i);
  
  int cnt = 0;
  for (int i=0; i<n; i++){
    cnt += (d-1)/a.at(i) + 1;
  }
  cout <<cnt+x <<endl;
}


Measured memory_bytes: 256
a, b, c = map(str, input().split())
max = int(a+b) + int(c)
if max < int(a) + int(b+c):
    max = int(a) + int(b+c)

elif max < int(c+a) + int(b):
    max = int(c+a) + int(b)
print(max)

Measured memory_bytes: 3060
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vl = vector<ll>;
using vvl = vector<vl>;
using vi = vector<int>;
using vvi = vector<vi>;
#define ote(x) cout<<(x)<<endl
#define all(x) (x).begin(),(x).end()
#define rp(i,s,e) for(int i=(s);i<(e);++i)
#define rpz(i,e) rp(i,0,e)

int main(){
	string S; cin>>S;
	int ans = 0;
	ans += S[0]=='+'? 1:-1;
	ans += S[1]=='+'? 1:-1;
	ans += S[2]=='+'? 1:-1;
	ans += S[3]=='+'? 1:-1;
	ote(ans);
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define REP(i,n) for(int i=0;i<(n);i++)
#define N 200000
#define INF 1000000000
typedef long long ll;
#define ALL(v) (v).begin(),(v).end()
#define SZ(x) int(x.size())
#define OUT(a) cout<<(a)<<endl
typedef pair<int,int> P;
const int MAX = 1000000;
const int MOD = 1000000007;
int main(){
	int n;
    cin>>n;
    map<string,int>m;
    REP(i,n){
        string s;
        cin>>s;
        sort(ALL(s));
    m[s]++;
    }
    ll ans=0;
    for(auto i:m){
        int t=i.second;
        ans+=(ll)t*(t-1)/2;
    }
    OUT(ans);
	return 0;
}

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

int main(){
  int n;
  cin >> n;
  vector<int> s(n);
  int score = 0, mi = 100000;
  for(int i = 0; i < n; i++){
    int now;
    cin >> now;
    score += now;
    if(now % 10) mi = min(mi, now);
  }
  
  if(score % 10) cout << score << endl;
  else if(mi % 10) cout << score - mi << endl;
  else cout << 0 << endl;
}

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


 
int main() {
    long long int n,m,temp,i,l,cons1=0;
    string s;
    cin>>n>>m>>s;
    long long int t[s.length()]={0};
    temp=n;
    for(i=0;i<s.length();i++)
    {
        if(s[i]=='1')
        cons1++;
        else
        cons1=0;
        if(cons1==m)
        break;
    }
    i=0;
    if(cons1==m)
    cout<<-1;
    
    else
    {
    while(1)
    {
        l=m;
        if((temp-m)>0)
        {
            while(s[temp-l]!='0')
            {
                --l;
            }
            t[i++]=l;
            temp-=l;
            
        }
        else
        {
            t[i]=temp;
            break;
        }
        
    }
    for(l=i;l>=0;--l)
    cout<<t[l]<<" ";
    }
    
 
   
        
    return 0;
}


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

#include <ext/pb_ds/assoc_container.hpp> 
#include <ext/pb_ds/tree_policy.hpp> 
using namespace __gnu_pbds; 
  
#define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update> 
 
#define FS              ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define ll              long long int
#define ld              long double
#define pb              push_back
#define bp              __builtin_popcount
#define sz              size()
#define ff              first
#define ss              second
#define vll             vector<ll>
#define vbool           vector<bool>
#define vpll            vector<pair<ll,ll>>
#define pll             pair<ll,ll>
#define vllv            vector<vector<ll>>
#define setpri(x)       cout<<setprecision(x)<<fixed;
#define all(v)          v.begin(),v.end()
#define allr(v)         v.rbegin(),v.rend()
#define yesr {cout<<"YES"<<endl;return;}
#define nor {cout<<"NO"<<endl;return;}
// getline (std::cin,name);
ll MOD=1e9+7;
ll ceil1(ll n,ll x){return (n-1)/x+(n>0);}

ll gcd(ll a,ll b){return __gcd(a,b);}
ll lcm(ll a,ll b){return (max(a,b)/gcd(a,b))*min(a,b);}

ll pow1(ll n,ll m ,ll mod=MOD );
ll pow2(ll n,ll k);

ll modinv(ll n,ll mod=MOD){  return pow1(n,mod-2,mod);}

bool func(pair<ll,ll> &a,pair<ll,ll> &b ){
        if(a.ff != b.ff)return a.ff < b.ff;
        return a.ss > b.ss;
}
ll const N=(ll)1e5+11;
ll const LG=(ll)log2(N)+1;


void solve(){
        ll i,j,k,l,n,m,x,y,z,r;
        
        cin>>n>>m>>k;
        
        cout<<m*(k/n)<<endl;
        
        
        
        
        
}       
int main(){
        FS;
        
        ll i,j,k,n,m,x,y,z,q;
        q=1;
        // cin>>q;
        while(q--){
                solve();
        }
        return 0;
}


ll pow1(ll n,ll m,ll mod){
        if(m==0)return 1;
        
        if(m%2==0)return pow1((n*n)%mod,m/2,mod);
    	
    	return (pow1((n*n)%mod,m/2,mod)*n)%mod;
}

ll pow2(ll n,ll k){
        ll ans=1;
            while(k>0){
                if(k%2==1)ans=ans*n;
                n=n*n;
                k/=2;
            }
            return ans;
}

Measured memory_bytes: 3552
#include <bits/stdc++.h>
#include <fstream>
#define inf INFINITY
#define file freopen( "input.txt" , "r" , stdin) ; freopen( "output.txt" , "w" , stdout) ; 
#define Gamed ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define _3102_ main()
#define endl '\n'
typedef long long ll ;
typedef unsigned long long ull ; 
typedef long double ld ; 
using namespace std ;
const int N = 1e5+100  ; 
const ll mod = 1e9 + 7  ;




int _3102_ {
    Gamed
    ll  ans[N][3] , n  ; 
    cin >> n ;
    for ( int i = 0 ; i < n ; i ++ ){
        cin >> ans[i][0] >> ans[i][1] >> ans[i][2] ; 
    }  
    for ( int i = 1 ; i < n ; i ++){
        ans[i][0] += ( max ( ans[i-1][2] , ans[i-1][1] )) ;
        ans[i][1] += ( max ( ans[i-1][0] , ans[i-1][2] )) ;
        ans[i][2] += ( max ( ans[i-1][0] , ans[i-1][1] )) ;
    }
    n -- ; 
    cout << max ( ans[n][0] , max ( ans[n][1] , ans[n][2])) ; 
    return 0;
}

Measured memory_bytes: 2560
#include<bits/stdc++.h>
#define F(x,y,z) for (int x=y;x<=z;++x)
#define LL long long
#define ct continue
#define maxlo 2147483645
using namespace std;
int maxh,ansh,n,x[105],y[105],h[105],t;
int main()
{
	scanf("%d",&n);
	F(i,1,n)
		scanf("%d%d%d",&x[i],&y[i],&h[i]);
	F(i,0,100)
		{
			F(j,0,100)
				{
					maxh=maxlo;
					t=0;
					F(k,1,n)
						if (h[k]==0)
							maxh=min(maxh,abs(x[k]-i)+abs(y[k]-j));
						else
							{
								if (t!=0 && h[k]+abs(x[k]-i)+abs(y[k]-j)!=ansh)
									{
										maxh=-1;
										break;
									}
								t++;
								ansh=h[k]+abs(x[k]-i)+abs(y[k]-j);
							}
					if (ansh<=maxh)
						{
							printf("%d %d %d\n",i,j,ansh);
							return 0;
						}
				}
		}
	return 0;
}



Measured memory_bytes: 256
#include<iostream>
#include<cstdio>
#include<cstring>
#include<string>
#include<vector>
#include<cmath>
#include<algorithm>
#include<map>
#include<queue>
#include<deque>
#include<iomanip>
#include<tuple>
#include<cassert>
#include<set>
using namespace std;
typedef long long int LL;
typedef pair<int,int> P;
typedef pair<LL,int> LP;
const int INF=1<<30;
const LL MAX=1e9+7;

void array_show(int *array,int array_n,char middle=' '){
    for(int i=0;i<array_n;i++)printf("%d%c",array[i],(i!=array_n-1?middle:'\n'));
}
void array_show(LL *array,int array_n,char middle=' '){
    for(int i=0;i<array_n;i++)printf("%lld%c",array[i],(i!=array_n-1?middle:'\n'));
}
void array_show(vector<int> &vec_s,int vec_n=-1,char middle=' '){
    if(vec_n==-1)vec_n=vec_s.size();
    for(int i=0;i<vec_n;i++)printf("%d%c",vec_s[i],(i!=vec_n-1?middle:'\n'));
}
void array_show(vector<LL> &vec_s,int vec_n=-1,char middle=' '){
    if(vec_n==-1)vec_n=vec_s.size();
    for(int i=0;i<vec_n;i++)printf("%lld%c",vec_s[i],(i!=vec_n-1?middle:'\n'));
}

int main(){
    int n,m;
    int i,j,k;
    int a,b,c;
    cin>>a>>b>>c;
    if(a<=b*c)cout<<"Yes"<<endl;
    else cout<<"No"<<endl;
}

Measured memory_bytes: 3632
#include <iostream>
#include <vector>
#include <algorithm>
#include <cstring>
using namespace std;
typedef pair<int, int> pii;

int n, k, m;
long t;
vector<long> c, d;
long dp[110][100010];
const int MOD = 1e9 + 7;

int main(){
	cin >> n >> k;
	t = n;
	c.push_back(0);
	for (int i = 1; i*i <= n; ++i){
		c.push_back(i);
		c.push_back(n/i);
	}
	sort(c.begin(), c.end());
	for (auto i = 0; i < c.size()-1; ++i){
		d.push_back(c[i+1] - c[i]);
	}
	m = d.size();
	memset(dp, 0, sizeof(dp));
	dp[0][0] = 0;
	for (int j = 0; j < m; ++j) dp[0][j+1] = (dp[0][j] + d[j]) % MOD;
	for (int i = 1; i < k; ++i){
		for (int j = 1; j <= m; ++j){
			dp[i][j] = (dp[i][j-1] + (dp[i-1][m-j+1]*d[j-1])%MOD)%MOD;
		}
	}
	printf("%d", dp[k-1][m]);
}

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

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
const int inf = 0x3f3f3f3f;
const int mod = 1e9 + 7;
const int maxn = 2e5 + 100;

struct node {
    int u, v, w;
} e[100];
int tot = 0;
int b[100];

int main() {

    int l;
    scanf("%d", &l);
    for (int i = 1; i < 20; i++) {
        e[tot++] = {i, i + 1, 0};
    }
    b[0] = 1;
    int to = 0;
    for (int i = 1; i <= 21; i++) {
        b[i] = b[i - 1] * 2;
        if (b[i] - 1 < l) to = i;
    }
    for (int i = 1; i <= to; i++) {
        e[tot++] = {i, i + 1, b[i - 1]};
    }

    int now = b[to];
    while (now != l) {
        int rest = l - now;
        to = 0;
        for (int i = 1; i <= 21; i++) {
            if (b[i] - 1 < rest) to = i;
        }
        e[tot++] = {to + 1, 20, now};
        now += b[to];
    }
    printf("%d %d\n", 20, tot);
    for (int i = 0; i < tot; i++) {
        printf("%d %d %d\n", e[i].u, e[i].v, e[i].w);
    }
    return 0;
}


Measured memory_bytes: 764
#include "bits/stdc++.h"
#define double long double
#define int long long
#define mii map<int,int>
#define low lower_bound
#define upp upper_bound
#define inf 1000000007 //10^9+7
#define rep(i,n) for(int i=0;i<n;i++)
#define all(vec) vec.begin(),vec.end()
#define sort(vec) sort(all(vec));
#define rever(vec) reverse(all(vec));
#define bisea binary_search
#define unsort(vec) sort(vec); rever(vec);
#define cend cout<<endl;
#define F first
#define S second
using namespace std;
signed main() {
  int n;
  cin>>n;
  vector<int>vec(n);
  int sum=0;
  rep(i,n) {
    cin>>vec.at(i);
    sum+=vec.at(i);
  }
  unsort(vec);
  sum-=vec.at(0);
  if(vec.at(0)<sum) {
    cout<<"Yes"<<endl;
  }
  else {
    cout<<"No"<<endl;
  }
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#define ll long long
#define inf 1000000000
#define infll 1000000000000000000ll
#define vi vector<int>
#define vll vector<ll>
#define pb push_back
#define pii pair<int,int>
#define pll pair<ll,ll>
#define pdd pair<double,double>
#define mpr make_pair
#define fi first
#define se second
#define pq priority_queue<int>
#define pqll priority_queue<ll>
#define up(x,y) (x<(y)?x=(y):0)
#define dn(x,y) (x>(y)?x=(y):0)
#define ad(x,y) (x=(x+(y))%mod)
#define mod 998244353
#define N 309
using namespace std;

int m,n,b[N]; bitset<N> a[N];
int read(){
	int x=0; char ch=getchar(); bool flag=0;
	while (ch<'0' || ch>'9'){ if (ch=='-') flag=1; ch=getchar(); }
	while (ch>='0' && ch<='9'){ x=x*10+ch-'0'; ch=getchar(); }
	return flag?-x:x;
}
ll readll(){
	ll x=0; char ch=getchar(); bool flag=0;
	while (ch<'0' || ch>'9'){ if (ch=='-') flag=1; ch=getchar(); }
	while (ch>='0' && ch<='9'){ x=x*10+ch-'0'; ch=getchar(); }
	return flag?-x:x;
}
int ksm(int x,int y){
	int ans=1;
	for (; y; y>>=1,x=(ll)x*x%mod) if (y&1) ans=(ll)ans*x%mod;
	return ans;
}
int main(){
	scanf("%d%d",&m,&n);
	int i,j,cnt=0;
	for (i=1; i<=m; i++)
		for (j=0; j<n; j++) a[i][j]=(read()>0);
	for (i=1; i<=m; i++){
		for (j=0; j<n; j++) if (a[i][j])
			if (b[j]) a[i]^=a[b[j]]; else{
				b[j]=i; cnt++; break;
			}
	}
	int t=(ksm(2,m)-ksm(2,m-cnt)+mod)%mod;
	printf("%lld\n",(ll)t*ksm(2,n-1)%mod);
	return 0;
}


Measured memory_bytes: 256
#include <stdio.h>
#include <stdlib.h>
int main(){
  int i,j,n;
  int maxv,minv;
 
  scanf("%d",&n);
  if(n < 2 || 200000 < n){
    exit(1);
  }
  int R[n];
 
  for(i = 0; i< n; i++){
    scanf("%d",&R[i]);
    if(R[i] < 1 || 10000000000 < R[i]){
      exit(1);
    }
  }
  minv = R[0];
  maxv = R[1]-R[0];
  for(j = 1; j <= n-1; j++){
    if(maxv <= R[j]-minv){
      maxv = R[j]-minv;
    }
    if(R[j] < minv){
      minv = R[j];
    }
  }
  printf("%d\n",maxv);
  return 0;
}

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

using namespace std;

int main(){

 int a,b,c;
 cin>>a>>b>>c;

 long long ani =  a*100+b*10+c;

 if(ani % 4 == 0)
    cout<<"YES"<<endl;
 else
    cout<<"NO"<<endl;



 return 0;
}


Measured memory_bytes: 256
//コンパイラ最適化用
#pragma GCC optimize("O3")

#include<iostream>//入出力

using namespace std;
typedef unsigned int ll;

#define REP(i,n) for(ll i=0;i<ll(n);i++)
#define MOD 1000000007 //10^9+7:合同式の法

signed main(){
  	ll s[2001],t[2001],dp[2001][2001]={0};
    //入力の高速化用のコード
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    ll n,m;cin>>n>>m;
    REP(i,n){cin>>s[i];}
    REP(i,m){cin>>t[i];}
    REP(i,n+1){dp[i][0]=1;}
    REP(i,m+1){dp[0][i]=1;}
    REP(i,n){
        REP(j,m){
            if(s[i]==t[j]){
                dp[i+1][j+1]+=(dp[i+1][j]+dp[i][j+1])%MOD;
            }else{
                dp[i+1][j+1]+=(dp[i+1][j]+dp[i][j+1]-dp[i][j]+MOD)%MOD;
            }
        }
    }
    cout<<dp[n][m]<<"\n";
}


Measured memory_bytes: 19284
sa = gets.chomp.split('')
sb = gets.chomp.split('')
sc = gets.chomp.split('')

head = sa.shift

loop do
  case head
  when 'a'
    if sa.empty?
      puts 'A'
      break
    end
    head = sa.shift
  when 'b'
    if sb.empty?
      puts 'B'
      break
    end
    head = sb.shift
  when 'c'
    if sc.empty?
      puts 'C'
      break
    end
    head = sc.shift
  end
end


Measured memory_bytes: 1788
#include <iostream>
#include <iomanip>
#include <vector>
#include <string>
#include <algorithm>
#include <cmath>
#include <stack>
#include <queue>
#include <functional>
#include <limits.h>
#include <set>
#include <map>
#include <tuple>
using namespace std;

#define ll long long
#define ull unsigned long long
#define rep(i,N) for (int i=0;i<N;i++)
#define loop(i,N,M) for(int i=N;i<M;i++)
#define MAX(v) *max_element(v.begin(),v.end())
#define MIN(v) *min_element(v.begin(),v.end())
#define SORTL2S(type,v) sort(v.begin(),v.end(),greater<type>())
#define SORTS2L(type,v) sort(v.begin(),v.end())
#define SORTMF(v,func) sort(v.begin(),v.end(),func)

//変数
ll N, K;
vector<ll> vec;

//解法
void solve() {


	SORTS2L(ll, vec);

	ll ans = vec[N - 1] - vec[0];
	for (ll i = 0; i <= N - K; ++i) {
		ans = min(ans, vec[i+K-1] - vec[i]);
	}

	cout << ans;

	return;
}

int main() {
	//入力

	cin >> N >> K;
	vec.resize(N);
	rep(i, N) cin >> vec[i];

	solve();
	cout << endl;
	return 0;
}

Measured memory_bytes: 1024
#include<cstdio>
#define N 300003
inline int min(int x,int y){return x<y?x:y;}
inline int calc(int w,int x,int y,int z)
{
    if(z<1)w+=1-z,x+=1-z,y+=1-z;
    if(1<z)w+=z-1;
    if(x<1)w+=1-x<<1,y+=1-x,x=1;
    if(y<1)w+=1-y<<1,x+=1-y,y=1;
    return w>>1;
}
int a[N],b[N],c[N],d[N],i,j,m,n,x,y,z;
int main()
{
    scanf("%d%d",&n,&m);
    for(i=1;i<=n;i++)scanf("%d",a+i);
    for(i=1;i<=n;i++)scanf("%d",b+i),x+=b[i]/(m<<1),b[i]%=m<<1;
    for(m-a[n]<<1<b[n]?x++:0,*c=*d=i=1;i<n;i++)
    if(!b[i])c[i]=c[i-1],d[i]=d[i-1];
    else if(b[i]<=a[i]<<1&&b[i]<=m-a[i]<<1)c[i]=c[i-1]+1,d[i]=d[i-1]-1,z++;
    else if(b[i]<=a[i]<<1)c[i]=c[i-1]+1,d[i]=d[i-1]+1,z++;
    else if(b[i]<=m-a[i]<<1)c[i]=c[i-1]-1,d[i]=d[i-1]-1,z++;
    else x++,c[i]=c[i-1],d[i]=d[i-1];
    for(d[i=n]=d[n-1];--i;)d[i]=min(d[i],d[i+1]);
    for(i=1;i<n;i++)c[i]=min(c[i-1],c[i]);
    for(i=1,y=calc(z,1,d[1],d[n])+1;i<n;i++)if(b[i]&&b[i]<=a[i]<<1&&b[i]<=m-a[i]<<1)j++,y=min(y,calc(z,c[i],(j<<1)+d[i+1],(j<<1)+d[n])+1);
    return 0&printf("%lld\n",(long long)(x+y)*(m<<1));
}

Measured memory_bytes: 4864
require 'pp'
$DEBUG ? define_method(:dpp){|e|pp e} : define_method(:dpp){|e|}

# Nと空白区切の入力値を数値の配列で返却する
def gets_n_and_i_list()
  return gets.chomp.to_i, gets.chomp.split("")
end
n, clist = gets_n_and_i_list

# h = clist.size / 2
# ans = 0

# bc = clist[0..h]
# ac = clist[h...clist.size]

# a = [bc.count("W"),ac.count("R")].min
# b = [bc.count("R"),ac.count("W")].min

# puts [a,b].max

sc = clist.sort

ans = 0
0.upto(n-1) do |i|
  if clist[i] != sc[i]
    ans += 1
  end
end

puts ans / 2

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


int main(){
  vector<int> a;
  vector<int>::iterator location;
  int num,N,i;
    cin>>N;
  for(i=0;i<N;i++){
    cin>>num;
	if(binary_search(a.begin(),a.end(),num)){
      break;
    }else{
      location=upper_bound(a.begin(),a.end(),num);
      a.insert(location,num);
    }
  }
  if(i==N){
    cout<<"YES"<<endl;
  }else{
     cout<<"NO"<<endl;
  }
  return 0;
}

Measured memory_bytes: 1400
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
using namespace std;
int main()
{
  int a,b,c;
  cin >> a >> b >> c;
  int ans = 3;
  
  if ( a == b){
    ans--;
  }
  if (a == c){
    ans--;
  }
  if (b == c){
    ans--;
  }
  
  if ( a == b && b == c ){
    ans = 1;
  }
  
  cout << ans << endl;
  return 0;
}


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

bool isprime(int p) {
	if (p == 1) return false;
	for (int i=2; i<p; i++) {
		if (p % i == 0) return false;
	}
	return true;
}

int main() {
	int N;
	cin >> N;
	for (int i=31; i<=55555; i+=30) {
		if (isprime(i) == true) {
			if (i != 31) cout << " ";
			cout << i;
			N--;
		}
		if (N == 0) break;
	}
	cout << endl;
	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <iomanip>
// std::cout << std::setprecision(2) << 3.141; // "3.1"
#include <algorithm>
#include <vector>
#include <string>
#include <cmath>
#include <map>
// #include <bits/stdc++.h> all

using namespace std;

typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> plglg;
typedef pair<double, ll> pdlg;
typedef tuple<int, int, int> tiii;
typedef tuple<ll, ll, ll> tlglglg;
typedef tuple<double, double, double> tddd;

static const int giga = pow(10,9);
double pi = 3.141592653589793238463;

int main(void){

  double a,b,x; cin >> a >> b >> x;

  if(x >= a*a*b/2){
    cout << setprecision(10) << (atan(2*((b-(x/(a*a)))/a))*180)/pi << endl;
  } else {
    cout << setprecision(10) << 90 - (atan((2*x)/(a*b*b))*180)/pi << endl;
  }

  
  return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <cstring>
#include <algorithm>
#include <functional>
#include <cmath>
#include <set>
#include <queue>
#include <vector>
#include <climits>
#include <sstream>
#include <iomanip>
#include <map>
#include <stack>
using namespace std;

int main()
{
	long long X, t;
	cin >> X >> t;

	cout << max(0ll, X - t) << endl;

	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define ll long long 
#define endl "\n"
#define pb push_back
#define f(i,n) for(i=0;i<n;i++)
#define F(i,a,b) for(i=a;a<=b;i++)
#define arr(a,n) for( i=0;i<n;i++)cin>>a[i];
#define fi first
#define se second
#define mp make_pair
#define mod 1000000007
#define YES cout<<"YES"<<endl;
#define Yes cout<<"Yes"<<endl;
#define NO cout<<"NO"<<endl;
#define No cout<<"No"<<endl;
#define yes cout<<"yes"<<endl;
#define no cout<<"no"<<endl;
#define vi vector<ll>
#define ed end()
#define bg begin()
#define sz size()
#define ln length()
#define s() sort(a,a+n);
#define sr() sort(a,a+n,greater<ll>());
#define v()  sort(v.begin(),v.end());
#define vr() sort(v.begin(),v.end(),greater<ll>());
#define mod 1000000007
#define fast() ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
ll gcd(ll a, ll b){if(!b)return a;return gcd(b, a % b);}
ll power(ll x,ll y,ll p){ll res=1;x%=p;while(y>0){if(y&1)res=(res*x)%p;y=y>>1;x=(x*x)%p;}return res;}
int main() {
    /*#ifndef ONLINE_JUDGE
        // for getting input from input.txt
        freopen("input.txt", "r", stdin);
        // for writing output to output.txt
        freopen("output.txt", "w", stdout);
    #endif*/
        /* 
        Ofcourse it's Hard.
        It's supposed to be Hard.
        If it's easy everyone would do it.
        HARD IS WHAT MAKES IT GREAT

        YESTERDAY U SAID TOMORROW

        SLOWLY BECOMING THE PERSON I 
        SHOULD HAVE BEEN A LONG TIME AGO

        SAME TASK CAN'T BE FOUND DIFFICULT TWICE

        BTBHWSITW

        SPRH TU KAB P

        CP IS ALL ABOUT THINKING 
        YOU HAVE MUCH MORE POTENTIAL THAN U THINK

        AJIT SHIDDAT 10

        UR DAILY ROUTINE 


        */

fast();
//ll t;cin>>t;while(t--)
{
    ll n,mn=INT_MAX;
    cin>>n;
    ll a[n];
    for(int i=0;i<n;i++)
    {
       cin>>a[i]; 
    }
    ll pre[n],suf[n];
    pre[0]=a[0],suf[n-1]=a[n-1];
    for(int i=1;i<n;i++)
    {
        pre[i]=a[i]+pre[i-1];
    }
    for(int i=n-2;i>=0;i--)
    {
        suf[i]=a[i]+suf[i+1];
    }
    for(int i=0;i<n-1;i++)
    {
        ll temp=abs(suf[i+1]-pre[i]);
        mn=min(mn,temp);
    }
    cout<<mn<<endl;
}
return 0;
}

Measured memory_bytes: 4992
#include <bits/stdc++.h>
#define DEBUG if(0)
#define lli long long int
#define ldouble long double
using namespace std;

const int maxN = 2e5; int n;
const int inf = 1e6;
char c[maxN + 1];

// unordered_map<int, int> memo[maxN];
int memo[maxN][2];
int solve(int i = 0, int whites = 0, bool valid = true)
{
  if (i == n) return valid ? 0 : inf;
  if (memo[i][whites > 0] != -1) return memo[i][whites > 0];
  // if (memo[i].count(whites)) memo[i][whites];

  int ans = 0;
  if (c[i] == 'R' && whites)
  {
    ans = min(whites + solve(i + 1, 0, valid),
              1 + solve(i + 1, whites + 1, valid));
  }
  else
  {
    if (c[i] == 'R')
      ans = solve(i + 1, whites, valid);
    else
      ans = solve(i + 1, whites + 1, valid);
  }
  return memo[i][whites > 0] = ans;
  // return memo[i][whites] = ans;
}

int main()
{
  while (scanf("%d", &n) != EOF)
  {
    // for (int i = 0; i < n; i++) memo[i].clear();
    memset(memo, -1, sizeof(memo));

    scanf(" %s", c);
    int ans = inf;

    int w = 0, r = 0;
    for (int i = 0; i < n; i++)
      if (c[i] == 'W') w++;
      else r++;

    int redToLeft = r;
    for (int i = 0; i < r; i++)
      redToLeft -= c[i] == 'R';
    int whiteToRight = w;
    for (int i = n - 1, j = 0; j < w; i--, j++)
      whiteToRight -= c[i] == 'W';
    ans = min({ans, redToLeft, whiteToRight});

    printf("%d\n", ans);
  }
  return 0;
}
// WRWWRWRR
// RRRRWWWW
// 

Measured memory_bytes: 5524
#include <bits/stdc++.h>
using namespace std;
#define int long long int
#define pb push_back
#define N 500100
#define MOD 1000000007
#define fn(i,n) for(int i=0;i<n;i+=1)
#define rep(i,l,r) for(int i=l;i<=r;i+=1)
#define INF 100000000000000
#define pii pair<int,int>
#define speed ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
int power(int x,int y){
    int res=1LL;
    while(y){
        if(y&1){
            res=(res*x)%MOD;
        }
        x=(x*x)%MOD;
        y=(y>>1);
    }
}

int a[111];
signed main()
{
    
    speed
    int n;cin>>n;
    fn(i,n)cin>>a[i];
    int ans=INF;
    rep(i,1,100){
        int cnt=0;
        fn(j,n){
            cnt+=((a[j]-i)*(a[j]-i));
        }
        ans=min(ans,cnt);
    }
    cout<<ans<<endl;


    

    
    return 0;
}

Measured memory_bytes: 256
// ITP1-ITP1_9_D:	Transformation
// 2018.3.8

#include <stdio.h>

void print (char *str, int a, int b)
{
  int i;
  for (i = a; i <= b; i++)
    {
      putchar(str[i]);
    }
  putchar('\n');
};

void reverse (char *str, int a, int b)
{
  char temp[1000] = {0};
  int i;
  for (i = a; i <= b; i++)
    {
      temp[i] = str[i];
    }
  for (i = b; i >= a; i--)
    {
      str[a + b - i] = temp[i];
    }
};

void replace (char *str, int a, int b, char *p)
{
  int i;
  for (i = a; i <= b; i++)
    {
      str[i] = p[i - a];
    }
};


int main (void)
{
  char str[1000] = {0};
  char instruction[10] = {0};
  int q;
  int c;
  int i;
  
  scanf("%s\n", str);
  scanf("%d\n", &q);
  
  while(q--)
    {
      i = 0;
      while((c = getchar()) != ' ')
	{
	  instruction[i] = c;
	  i++;
	}
      
      switch(instruction[2])
	{
	case 'i':
	  {
	    int a, b;
	    scanf("%d %d\n", &a , &b);
	    print(str, a, b);
	    break;
	  }
	case 'v':
	  {
	    int a, b;
	    scanf("%d %d\n", &a , &b);
	    reverse(str, a, b);
	    break;
	  }
	case 'p':
	  {
	    int a, b;
	    char p[1000] = {0};
	    scanf("%d %d %s\n", &a , &b, p);
	    replace(str, a, b, p);
	    break;
	  }
	}
    }
  return 0;
}



Measured memory_bytes: 2048
#include <iostream>
#include <fstream>
#include <cstdio>
#include <cmath>
#include <vector>
#include <string>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <deque>
#include <bitset>
#include <algorithm>
#include <complex>
#include <array>
#include <functional>
using namespace std;
 
#define REP(i,n) for(int i=0; i<n; ++i)
#define FOR(i,a,b) for(int i=a; i<=b; ++i)
#define FORR(i,a,b) for (int i=a; i>=b; --i)
#define ALL(c) (c).begin(), (c).end()
 
typedef long long ll;
typedef vector<int> VI;
typedef vector<ll> VL;
typedef vector<double> VD;
typedef vector<VI> VVI;
typedef vector<VL> VVL;
typedef vector<VD> VVD;
typedef pair<int,int> P;
typedef pair<ll,ll> PL;

template<typename T> void chmin(T &a, T b) { if (a > b) a = b; }
template<typename T> void chmax(T &a, T b) { if (a < b) a = b; }

int in() { int x; scanf("%d", &x); return x; }
ll lin() { ll x; scanf("%lld", &x); return x; }

int main(void){
    double x;
    cin >> x;
    x /= 3.0;
    double ans = x * x * x;
    printf("%.15f\n", ans);

    return 0;
}


Measured memory_bytes: 256
N = int(input())
L = list(map(int, input().split()))
L.sort()
 
from bisect import bisect_left 
cnt = 0
for i in range(0,N-2):
  for j in range(i+1,N-1):
    t = L[i]+L[j]
    idx = bisect_left(L,t,j+1)
    cnt += max(0,idx-j-1)
print(cnt)

Measured memory_bytes: 3316
s = list(input(''))

n = len(s)
s1 = []
s2 = []
count = 0

for i in range((n-1)//2):
    s1.append(s[i])


for j in range((n + 3)//2 - 1,n):
    s2.append(s[j])

if s == list(reversed(s)) and s2 == list(reversed(s2)) and s1 == list(reversed(s1)):
    count = 1

# print(reversed(s))
# print(s1)
# print(s2)
# print(count)
if count == 1:
    print('Yes')
else:
    print('No')

Measured memory_bytes: 3064
#include <bits/stdc++.h>
//#include <boost/multiprecision/cpp_int.hpp>
//namespace mp = boost::multiprecision;

using namespace std;

const double PI = 3.14159265358979323846;
typedef long long ll;
const double EPS = 1e-9;
#define rep(i, n) for (int i = 0; i < (n); ++i)
//#define rep(i, n) for (ll i = 0; i < (n); ++i)
typedef pair<ll, ll> P;
const ll INF = 10e17;
#define cmin(x, y) x = min(x, y)
#define cmax(x, y) x = max(x, y)
#define ret() return 0;

double equal(double a, double b) {
    return fabs(a - b) < DBL_EPSILON;
}

std::istream &operator>>(std::istream &in, set<int> &o) {
    int a;
    in >> a;
    o.insert(a);
    return in;
}

std::istream &operator>>(std::istream &in, queue<int> &o) {
    ll a;
    in >> a;
    o.push(a);
    return in;
}

bool contain(set<int> &s, int a) { return s.find(a) != s.end(); }

//ofstream outfile("log.txt");
//outfile << setw(6) << setfill('0') << prefecture << setw(6) << setfill('0') << rank << endl;
// std::cout << std::bitset<8>(9);
//const ll mod = 1e10;

typedef priority_queue<ll, vector<ll>, greater<ll> > PQ_ASK;

int main() {
    int k, q;
    cin >> k >> q;
    vector<ll> ds(k);
    rep(i, k) cin >> ds[i];

    rep(_, q) {

        int n, x, m;
        cin >> n >> x >> m;

        vector<ll> ds2 = ds;
        for (ll &l : ds2) l %= m;

        ll s = accumulate(ds2.begin(), ds2.end(), 0ll);
        ll zero = count(ds2.begin(), ds2.end(), 0);

        ll ma = (n - 1) / k;
        ll y = x + ma * s;
        zero *= ma;

        ll tail = (n - 1) % k;
        y += accumulate(ds2.begin(), ds2.begin() + tail, 0ll);
        zero += count(ds2.begin(), ds2.begin() + tail, 0);

        ll f = (y / m - x / m);

        cout << n - 1 - f - zero << endl;


    }
}


Measured memory_bytes: 3680
#define _USE_MATH_DEFINES
#include <iostream>
#include <string>
#include <list>
#include <vector>
#include <queue>
#include <algorithm>
#include <climits>
#include <cstring>
#include <cmath>
#include <stack>
#include <iomanip>
#include <tuple>
#include <functional>
#include <cfloat>
#include <map>

//LLONG_MAX
#define int long long
#define CONTAINS(v,n) (find((v).begin(), (v).end(), (n)) != (v).end())
#define SORT(v) sort((v).begin(), (v).end())
#define RSORT(v) sort((v).rbegin(), (v).rend())
#define ARY_SORT(a, size) sort((a), (a)+(size))
#define MAX(a,b) (((a) > (b)) ? (a) : (b))
#define MIN(a,b) (((a) < (b)) ? (a) : (b))
#define REMOVE(v,a) (v.erase(remove((v).begin(), (v).end(), (a)), (v).end()))
#define REVERSE(v) (reverse((v).begin(), (v).end()))
#define LOWER_BOUND(v,a) (lower_bound((v).begin(), (v).end(), (a)))
#define UPPER_BOUND(v,a) (upper_bound((v).begin(), (v).end(), (a)))
#define REP(i, n) for (int (i) = 0; (i) < (n); (i)++)
#define CONTAINS_MAP(m, a) (m).find((a)) != m.end()
using namespace std;


int N;
int a[100001];
int b[100001];
int c[100001];
int s[100001];
int w[100001];
int all;
int tbl[1000000] = {};

int tento_cnt;

void tento_sub(int l, int m, int r)
{
	if (r - l <= 1) return;

	tento_sub(l, l + (m - l) / 2, m);
	tento_sub(m, m + (r - m) / 2, r);

	int l_index = l;
	int r_index = m;

	int index = l;
	while (l_index < m || r_index < r)
	{
		if (l_index == m)
		{
			w[index++] = s[r_index++];
		}
		else if (r_index == r)
		{
			w[index++] = s[l_index++];
		}
		else if (s[l_index] <= s[r_index])
		{
			w[index++] = s[l_index++];
		}
		else if (s[l_index] > s[r_index])
		{
			tento_cnt += (m - l_index);
			w[index++] = s[r_index++];
		}
		
		
	}

	memcpy(s + l, w + l, sizeof(int) * (r - l));
}

void tento()
{
	tento_cnt = 0;
	tento_sub(0, (N + 1) / 2, N + 1);
}

bool isOK(int index)
{
	//int n = c[index];
	int n = index;

	for (int i = 0; i < N; i++)
	{
		b[i] = (a[i] < n) ? -1 : 1;
	}
	s[0] = 0;
	for (int i = 1; i <= N; i++)
	{
		s[i] = s[i - 1] + b[i - 1];
	}

	tento();
	int t = tento_cnt;

	int pat = (all - t);
	if (pat * 2 >= all)
	{
		return false;
	}
	else
	{
		return true;
	}
}

int binary_search()
{
	int left = -1;
	int right = 1000000001;
	while (right - left > 1)
	{
		int mid = left + (right - left) / 2;
		if (isOK(mid))
			right = mid;
		else
			left = mid;
	}
	return left;
}

signed main()
{
	cin >> N;
	REP(i, N) cin >> a[i];

	memcpy(c, a, sizeof(a));
	ARY_SORT(c, N);

	all = ((N + 1) * N) / 2;

	int ans = binary_search();

	//ans = MAX(0, MIN(N - 1, ans));
	//cout << c[ans] << endl;

	cout << ans << endl;

	//N = 5;
	//s[0] = 3;
	//s[1] = 1;
	//s[2] = 7;
	//s[3] = 9;
	//s[4] = 5;

	//tento();
	//cout << tento_cnt << endl;

	return 0;
}








Measured memory_bytes: 5888
#include <stdio.h>

int main (){

  int n,i,j,x;

  scanf("%d",&n);

    for(i=1;i<=n;i++){

      x=i;

      if(i%3==0){

        printf(" %d",i);

      }else{
        while(x>0){
          if(x%10==3){

         printf(" %d",i);

         break;

          }else{
            x=x/10;
          }
        }
      }
    }

    printf("\n");
    return 0;
}

Measured memory_bytes: 600
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int A,B,K;
  cin >> A >> B >> K;
  int k = 0;
  for (int i = min(A,B); i > 0; i--) {
    if (A % i == 0 && B % i == 0) {
      k++;
    }
    if (k == K) {
      cout << i << endl;
      break;
    }
  }
  
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#include<iostream>
using namespace std;
 
int main() {
  int a,b,tap(1);
  int ans = 0;

  cin >> a >> b;

  while(tap < b){
      tap--;
      tap += a;
      ans++;
  }
  cout << ans;
   
}
   


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

using namespace std;
using ll = long long;
// #define int ll
using PII = pair<ll, ll>;

#define FOR(i, a, n) for (ll i = (ll)a; i < (ll)n; ++i)
#define REP(i, n) FOR(i, 0, n)
#define ALL(x) x.begin(), x.end()

template<typename T> T &chmin(T &a, const T &b) { return a = min(a, b); }
template<typename T> T &chmax(T &a, const T &b) { return a = max(a, b); }
template<typename T> bool IN(T a, T b, T x) { return a<=x&&x<b; }
template<typename T> T ceil(T a, T b) { return a/b + !!(a%b); }

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

template<class S,class T>
ostream &operator <<(ostream& out,const pair<S,T>& a) {
    out<<'('<<a.first<<','<<a.second<<')'; return out;
}
template<class T>
ostream &operator <<(ostream& out,const vector<T>& a){
    out<<'[';
    for(const T &i: a) out<<i<<',';
    out<<']';
    return out;
}
template<class T>
ostream &operator <<(ostream& out, const set<T>& a) {
    out<<'{';
    for(const T &i: a) out<<i<<',';
    out<<'}';
    return out;
}
template<class T, class S>
ostream &operator <<(ostream& out, const map<T,S>& a) {
    out<<'{';
    for(auto &i: a) out<<i<<',';
    out<<'}';
    return out;
}

int dx[] = {0, 1, 0, -1}, dy[] = {1, 0, -1, 0}; // DRUL
const int INF = 1<<30;
const ll LLINF = 1LL<<60;
const ll MOD = 1000000007;

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

    ll r, d, x;
    cin >> r >> d >> x;

    REP(i, 10) {
        x = r * x - d;
        cout << x << endl;
    }

    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
//#include <boost/multiprecision/cpp_ll.hpp>
//typedef boost::multiprecision::cpp_ll ll;
typedef long double dd;
#define i_7 (ll)(1E9+7)
//#define i_7 998244353
#define i_5 i_7-2
ll mod(ll a){
    ll c=a%i_7;
    if(c>=0)return c;
    return c+i_7;
}
typedef pair<ll,ll> l_l;
ll inf=(ll)1E18;
#define rep(i,l,r) for(ll i=l;i<=r;i++)
#define pb push_back
ll max(ll a,ll b){if(a<b)return b;else return a;}
ll min(ll a,ll b){if(a>b)return b;else return a;}
void Max(ll &pos,ll val){pos=max(pos,val);}//Max(dp[n],dp[n-1]);
void Min(ll &pos,ll val){pos=min(pos,val);}
void Add(ll &pos,ll val){pos=mod(pos+val);}
dd EPS=1E-9;
#define endl "\n"
#define fastio ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);


int main(){fastio
    ll n,k;cin>>n>>k;
    ll ans=0;
    ll hoge;
    rep(i,k,n+1){
        hoge=mod((i*(2*n-i+1))/2-(i*(i-1))/2+1);
        //cout<<hoge<<endl;
        ans=mod(ans+hoge);
    }
    cout<<ans<<endl;
    
}



Measured memory_bytes: 3652
<?php
  declare(strict_types=1);

  fscanf(STDIN, "%i", $n);
  $xs = explode(" ", fgets(STDIN));

  $i = 0;
  $wildcards = 0;
  $colors = [];
  while ($i < $n)
  {
      $c = (int)($xs[$i] / 400);
      if ($c >= 8)
      {
          ++$wildcards;
      }
      else
      {
          $colors[$c] = 1;
      }

      ++$i;
  }

  $num_given = array_sum($colors);
  echo max(1, $num_given), " ", $num_given + $wildcards, PHP_EOL;


Measured memory_bytes: 4728
n1, n2 = [int(i) for i in input().split()]

n3 = []

for i1 in range(n1):
    n3.append(int(input()))

n3.sort(reverse=True)

m1 = 1000000000
t1 = 0
for i2 in range(n1 - n2 + 1):
    t1 = n3[i2] - n3[i2 + n2 - 1]
    if t1 < m1:
        m1 = t1
print(m1)

Measured memory_bytes: 7484
#include<iostream>
using namespace std;
int main(){
	int m,k;
	cin >> m >> k;
	if(m==0){
		if(k==0) cout << 0 << ' ' << 0 << endl;
		else cout << -1 << endl;
		return 0;
	}
	if(m==1){
		if(k==0) cout << 0 << ' ' << 0 << ' ' << 1 << ' ' << 1 << endl;
		else cout << -1 << endl;
		return 0;
	}
	if(k>=(1<<m)) cout << -1 << endl;
	else{
		for(int i=(1<<m)-1;i>=1;i--) cout << (i^k) << ' ';
		cout << k << ' ';
		for(int i=1;i<(1<<m);i++) cout << (i^k) << ' ';
		cout << k << endl;
	}
	return 0;
}


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

using namespace std;

int main()
{
    int n;
    int ara[100];
    int ara2[100];
    int counting = 0;
    cin >> n;
    for(int i = 0; i < n; i++)
    {
        int x;
        cin >> x;
        ara[i] = x;
        ara2[i] = x;
    }
    sort(ara, ara+n);
    for(int i = 0; i < n; i++)
    {
        if(ara[i] == ara2[i])
            counting++;
    }
    if((n - counting) <= 2)
        cout << "YES" << endl;
    else
        cout << "NO" << endl;

    return 0;
}


Measured memory_bytes: 256
#include <iostream>
 using namespace std ;
 int main()
{
 int a,b, c, d,e;
 cin>>a;
cin>>b;
 c=(a*2-1);
 d=(b*2-1);
 e=(a+b);
 if (a > b)
 {
   cout<<c<<endl;
 }
 if  (a < b)
 {
   cout<<d<<endl;
 }
  if (a == b)
{
  cout<<e<<endl;
}
return 0;
}



Measured memory_bytes: 3588