akhauriyash/Code-Regression huggingface dataset:
import java.util.*;
import java.io.*;

public class Main {
    public static void main(String[] args) {
        FastScanner sc = new FastScanner();
        double n = sc.nextDouble();
        double ans = 1;
        if (n % 2 == 0) {
            ans /= 2;
            System.out.printf("%.6f%n", ans);
            return;
        }
        ans = ((n + 1) / 2) / n;
        System.out.printf("%.6f%n", ans);
    }
}

class FastScanner {
    private final InputStream in = System.in;
    private final byte[] buffer = new byte[1024];
    private int ptr = 0;
    private int buflen = 0;

    private boolean hasNextByte() {
        if (ptr < buflen) {
            return true;
        } else {
            ptr = 0;
            try {
                buflen = in.read(buffer);
            } catch (IOException e) {
                e.printStackTrace();
            }
            if (buflen <= 0) {
                return false;
            }
        }
        return true;
    }

    private int readByte() {
        if (hasNextByte())
            return buffer[ptr++];
        else
            return -1;
    }

    private static boolean isPrintableChar(int c) {
        return 33 <= c && c <= 126;
    }

    public boolean hasNext() {
        while (hasNextByte() && !isPrintableChar(buffer[ptr]))
            ptr++;
        return hasNextByte();
    }

    public String next() {
        if (!hasNext())
            throw new NoSuchElementException();
        StringBuilder sb = new StringBuilder();
        int b = readByte();
        while (isPrintableChar(b)) {
            sb.appendCodePoint(b);
            b = readByte();
        }
        return sb.toString();
    }

    public long nextLong() {
        if (!hasNext())
            throw new NoSuchElementException();
        long n = 0;
        boolean minus = false;
        int b = readByte();
        if (b == '-') {
            minus = true;
            b = readByte();
        }
        if (b < '0' || '9' < b) {
            throw new NumberFormatException();
        }
        while (true) {
            if ('0' <= b && b <= '9') {
                n *= 10;
                n += b - '0';
            } else if (b == -1 || !isPrintableChar(b)) {
                return minus ? -n : n;
            } else {
                throw new NumberFormatException();
            }
            b = readByte();
        }
    }

    public int nextInt() {
        long nl = nextLong();
        if (nl < Integer.MIN_VALUE || nl > Integer.MAX_VALUE)
            throw new NumberFormatException();
        return (int) nl;
    }

    public double nextDouble() {
        return Double.parseDouble(next());
    }
}


Measured memory_bytes: 21332
import java.util.Scanner;

class Main{
	public static void main (String[]args){
		Scanner scan = new Scanner(System.in);
		int S = scan.nextInt();
		
		int h = S / 3600;
		int m = (S - (h * 3600)) / 60;
		int s = (S - (h * 3600))- m * 60;
		
		System.out.println(h + ":" + m + ":" + s);
	}
}


Measured memory_bytes: 26196
#include<bits/stdc++.h>
using namespace std;
int N;
int C[500],S[500],F[500];
int main()
{
	scanf("%d",&N );
	for (int i=0; i <N -1; i ++) scanf ("%d%d%d",&C[i],&S[i],& F[i]);
	for (int i=0; i < N ; i ++)
	{
		int t =0;
		for ( int j = i ;j <N -1; j ++)
		{
			if (t<S[j]) t=S[ j ];
			else if (t%F[j]==0);
			else t=t+F[j]-t%F[j];
			t += C [ j ];
		}
	cout<<t<<"\n";
	}
}

Measured memory_bytes: 256
package main

import (
	"bufio"
	"fmt"
	"os"
)

func main() {
	scanner := bufio.NewScanner(os.Stdin)
	var N int
	scanner.Scan()
	fmt.Sscanf(scanner.Text(), "%d", &N)

	if N < 1000 {
		fmt.Println("ABC")
	} else {
		fmt.Println("ABD")
	}
}


Measured memory_bytes: 640
/**
 *  author: MahfuzAhmed
 *  created: 25.08.2019
**/

#include <bits/stdc++.h>
using namespace std;
#define debug(x) cout << '>' << #x << ':' << x << endl;
//~ const double pi = 2*acos(0.0);
//~ const long long mod = 1e9+7;
//~ const int max_n = 1e6+5;
typedef long long ll;

vector<pair<pair<string,int>,int>> v2;

int main(int argc, char* argv[]){
    ios_base::sync_with_stdio(0);
    cin.tie(NULL);
       
    #ifdef _DEBUG
    freopen("input.txt","r",stdin);
    //freopen("output.txt","w",stdout);
    #endif
    
    int n; cin >> n;
    
    
    
    for(int i=0;i<n;i++){
        string s; int x; cin >> s >> x;
        
        v2.push_back(make_pair(make_pair(s, -x), i));
    }
    
    sort(v2.begin(), v2.end());
    
    for(auto a:v2){
        cout << a.second+1 << "\n";
    }
    
    
    
    return 0;
}


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

struct node{
    long long value;
    int index;
};

bool comp(const node& lhs, const node& rhs){
    return lhs.value < rhs.value;
}

int main(){
    int n;
    cin >> n;
    vector<node> v;
    long long y;
    long long x[n];
    for(int i = 0; i < n; i++){
        cin >> y;
        x[i] = y;
        node p = {y, i};
        v.push_back(p);
    }
    sort(v.begin(), v.end(), comp);
    node a = v[n/2 - 1];
    long long value_a = a.value;
    int index_a = a.index;
    node b = v[n/2];
    long long value_b = b.value;
    int index_b = b.index;
    for(int i = 0; i < n; i++){
        if(x[i] <= value_a){
            cout << value_b << endl;
        } else {
            cout << value_a << endl;
        }
    }
    return 0;
}


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

//#define int long long
#define REP(i,n) for(int i=0;i<n;i++)
#define INF 1000000000
struct S {int x,d;};
int n,m;
int dp[152][1002][80];
vector<S> a[152];

signed main(){
  while(cin>>n>>m,n){
    REP(i,n+2)a[i].clear();
    REP(i,n){
      int k,x,d;
      cin>>k;
      REP(j,k){
        cin>>x>>d;
        a[i+1].push_back({x,d});
      }
    }
    REP(i,n+2)REP(j,1000)REP(k,m+1)dp[i][j+1][k]=INF;
    REP(j,1000)a[0].push_back({j+1,0});
    REP(j,1000)a[n+1].push_back({j+1,0});
    REP(j,1000)dp[0][j+1][0]=0;
    REP(i,n+2){
      for(S s:a[i]){
        for(S t:a[i+1]){
          REP(c,m+1){
            dp[i+1][t.x][c]=min(dp[i+1][t.x][c],dp[i][s.x][c]+(s.d+t.d)*abs(s.x-t.x));
          }
        }
        if(i+1>n)continue;
        for(S u:a[i+2]){
          REP(c,m){
            dp[i+2][u.x][c+1]=min(dp[i+2][u.x][c+1],dp[i][s.x][c]+(s.d+u.d)*abs(s.x-u.x));
          }
        }
      }
    }
    int ans=INF;
    REP(j,1000)REP(c,m+1)ans=min(ans,dp[n+1][j+1][c]);
    cout<<ans<<endl;
  }
  return 0;
}

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

int main(void) {
    int n;cin>>n;
    vector<int> result_front;
    vector<int> result_back;
    if (n % 2 == 0) {
        for (int i = 0; i < n; i++) {
            int a;cin>>a;
            if (i % 2 == 0) {
                result_back.push_back(a);
            } else {
                result_front.push_back(a);
            }
        }
    } else {
        for (int i = 0; i < n; i++) {
            int a;cin>>a;
            if (i % 2 == 0) {
                result_front.push_back(a);
            } else {
                result_back.push_back(a);
            }
        }
    }
    // 結果出力
    reverse(result_front.begin(), result_front.end());
    for (int i = 0; i < result_front.size(); i++) {
        cout << result_front.at(i);
        if (i < result_front.size() - 1) cout << " ";
    }
    for (int i = 0; i < result_back.size(); i++) {
        cout << " " << result_back.at(i);
    }
    cout << endl;
    return 0;
}

Measured memory_bytes: 3188
function Main(input) {
    const inputs = input.split('\n');
    input = inputs[0];
  
	var end = input.substr(-1, 1);
    if (end === "s"){
      console.log( input + "es");
    }else{
      console.log( input + "s");
    }
}
//*この行以降は編集しないでください（標準入出力から一度に読み込み、Mainを呼び出します）
Main(require("fs").readFileSync("/dev/stdin", "utf8"));


Measured memory_bytes: 29636
#include <bits/stdc++.h>
typedef long long ll;
constexpr int MAXN = 1e4 + 10, mo = 998244353;
inline ll fpm(ll a, ll b = mo - 2)
{
	ll res = 1;
	while (b)
	{
		if (b & 1) res = res * a % mo;
		a = a * a % mo;
		b >>= 1;
	}
	return res;
}
char a[MAXN], b[MAXN];
int fact[MAXN], invfac[MAXN], f[MAXN][MAXN];
inline int C(int n, int m)
{
	if(n < m || n < 0 || m < 0) return 0;
	return 1ll * fact[n] * invfac[m] % mo * invfac[n - m] % mo;
}
int main()
{
	scanf("%s%s", a, b);
	const int n = strlen(a);
	for(int i = fact[0] = 1; i <= n; ++i)
		fact[i] = 1ll * fact[i - 1] * i % mo;
	invfac[n] = fpm(fact[n]);
	for(int i = n; i; --i)
		invfac[i - 1] = 1ll * invfac[i] * i % mo;
	int s1 = 0, s2 = 0;
	for(int i = 0; i < n; s1 += (a[i] == '1' && b[i] == '1'), s2 += (a[i] == '1' && b[i] == '0'), ++i);
	for(int i = 0; i <= s2; ++i)
		f[0][i] = 1ll * fact[i] * fact[i] % mo;
	for(int i = 1; i <= s1; ++i)
		for(int j = 1; j <= s2; ++j)
			f[i][j] = (1ll * f[i - 1][j] * i % mo * j % mo + 1ll * f[i][j - 1] * j % mo * j % mo) % mo;
	int ans = 0;
	for(int i = 0; i <= s1; ++i)
		ans = (ll)(ans + 1ll * f[s1 - i][s2] * fact[i] % mo * fact[i] % mo * C(s1, i) % mo * C(s1 + s2, i) % mo) % mo;
	printf("%d\n", ans);
	return 0;
}

Measured memory_bytes: 389632
#include<iostream>
#include<cstdio>
#include<cstring>
#include<string>
#include<algorithm>
#include<bitset>
#include<vector>
#include<deque>
#include<list>
#include<queue>
#include<map>
#include<set>
#include<stack>
#include<cmath>
#include<iomanip>
#include <functional>
using namespace std;
typedef long long ll;
const int mod = 1000000007;
const int INF = 1 << 28;
const double EPS = 1e-10;
//cout << fixed << std::setprecision(9)
//memset(a, 0, sizeof(a));
//--------------------------

int main()
{
	int a[3];
	cin >> a[0] >> a[1] >> a[2];
	sort(a, a + 3);
	cout << a[0] * a[1] / 2 << endl;

	return 0;
}


Measured memory_bytes: 768
#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>;
 
const ll INF = ll(1e18)+1;
 
int main() {
  int n; ll k;
  cin >> n >> k;
  vector<ll> a(n);
  rep(i,n) cin >> a[i];
  sort(a.begin(), a.end());
  ll l = -INF, r = INF;
  while (l+1 < r) {
    ll x = (l+r)/2;
    bool ok = [&]{
      ll tot = 0;
      rep(i,n) {
        if (a[i] < 0) {
          int l = -1, r = n;
          while (l+1<r) {
            int c = (l+r)/2;
            if (a[c]*a[i] < x) r = c; else l = c;
          }
          tot += n-r;
        } else {
          int l = -1, r = n;
          while (l+1<r) {
            int c = (l+r)/2;
            if (a[c]*a[i] < x) l = c; else r = c;
          }
          tot += r;
        }
        if (a[i]*a[i] < x) tot--;
      }
      tot /= 2;
      return tot < k;
    }();
    if (ok) l = x; else r = x;
  }
  cout << l << endl;
  return 0;
}

Measured memory_bytes: 1792
#include<bits/stdc++.h>
		using namespace std;
		#define ll long long
		#define endl "\n"
		void solve();
		int main()
		{
			ios_base::sync_with_stdio(false);
			cin.tie(NULL);

		/*#ifndef ONLINE_JUDGE
			freopen("input.txt","r",stdin);
			freopen("output.txt","w",stdout);
		#endif*/
		
			int t=1;
			//cin>>t;
			while(t--){
			solve();
			cout << endl;
			}

			cerr << "time taken : "	<< (float)clock() / CLOCKS_PER_SEC << " secs" << endl; 
			return 0;		
		}
		void solve(){
			int sx,sy,tx,ty;
			cin>>sx>>sy>>tx>>ty;
			const int dx=abs(tx-sx),dy=abs(ty-sy);
			for (int i = 0; i < dx; ++i)
			{
				cout<<'R';
			}
			for (int i = 0; i < dy; ++i)
			{
				cout<<'U';
			}
			for (int i = 0; i < dx; ++i)
			{
				cout<<'L';
			}
			for (int i = 0; i < dy+1; ++i)
			{
				cout<<'D';
			}
			for (int i = 0; i < dx+1; ++i)
			{
				cout<<'R';
			}
			for (int i = 0; i < dy+1; ++i)
			{
				cout<<'U';
			}
			cout<<'L';
			cout<<'U';
			for (int i = 0; i < dx+1; ++i)
			{
				cout<<'L';
			}
			for (int i = 0; i < dy+1; ++i)
			{
				cout<<'D';
			}
			cout<<'R';
		}
	

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

using namespace std;

typedef long long ll;
typedef long double ld;
typedef pair<ll,ll> pll;
typedef pair<int, int> pii;

#define REP(i,n) for(ll i=0;i<n;i++)
#define REP1(i,n) for(ll i=1;i<=n;i++)
#define pb push_back
#define mp make_pair
#define X first
#define Y second
#define lwb lower_bound
#define N 100010
#define M 200010
#define endl "\n"

ll gcd(ll a_,ll b_){if(b_>a_)swap(b_,a_);return (b_==0?a_:gcd(b_,a_%b_));}

int main(){
	ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(NULL);
	
	unsigned long long int lcm, gcd, x, y, ans = 0, ans2 = 0, a, b, c, d;
	
	cin >> a >> b >> c >> d;
	
	x = b / c;
	y = (a - 1) / c;
	ans = x - y;
	
//	cout << "ans = " << ans << endl;
	
	x = b / d;
	y = (a - 1) / d;
	ans += x - y;
//	cout << "ans = " << ans << endl;
	
	gcd = __gcd(c, d);
	lcm = (c * d) / gcd;
	
	ans2 = ((b / lcm) - ((a - 1) / lcm));
	
	cout << b - a + 1 - ans + ans2 << endl;
	
	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <cstring>
#include <cstdio>
#include <queue>
#include <algorithm>
#include <vector>
#define FOR(i,l,r) for(int (i) = (l); (i) <= (r); (i)++)
using namespace std;
const long long maxn = 305;
const long long oo = 3000000000000ll;
long long n;
long long aim[maxn][maxn];
long long dis[maxn][maxn];
struct Node{
	long long a,b,d;
	Node(long long a,long long b,long long d):a(a),b(b),d(d){}
	friend bool operator < (const Node &x, const Node &y){
		return x.d < y.d;
	}
};
vector <Node> vec;
inline void update(long long a,long long b){
	FOR(i,1,n) dis[i][b] = min(dis[i][b],dis[i][a]+dis[a][b]);
	FOR(i,1,n) dis[a][i] = min(dis[a][i],dis[a][b]+dis[b][i]);
	FOR(i,1,n) dis[i][b] = dis[b][i] = min(dis[i][b],dis[b][i]);
	FOR(i,1,n) dis[a][i] = dis[i][a] = min(dis[i][a],dis[a][i]);
	FOR(i,1,n) FOR(j,1,n) {
		dis[i][j] = min(dis[i][j], dis[i][a]+dis[a][j]);
		dis[i][j] = min(dis[i][j], dis[i][b]+dis[b][j]);
	}
}
inline bool check(){
	FOR(k,1,n) FOR(i,1,n) FOR(j,1,n) dis[i][j] = min(dis[i][j],dis[i][k]+dis[k][j]);
	FOR(i,1,n) FOR(j,1,n) if(dis[i][j] != aim[i][j]) return 0;
	return 1;
}
void work(){
	long long ans = 0;
	FOR(i,1,n) FOR(j,1,n) vec.push_back(Node(i,j,aim[i][j]));
	sort(vec.begin(),vec.end());
	for(long long i = 0; i < vec.size(); i++){
		if(dis[vec[i].a][vec[i].b] < vec[i].d) {cout << "-1" << endl; return;}
		if(dis[vec[i].a][vec[i].b] > vec[i].d) {
			dis[vec[i].a][vec[i].b] = vec[i].d;
			update(vec[i].a,vec[i].b);
			ans += vec[i].d;
		}
	}
	if(check()) cout << ans << endl;
	else cout << "-1" << endl;
}
int main(){
#ifdef __APPLE__
	freopen("main.in","r",stdin);
#endif
	cin >> n;
	FOR(i,1,n)FOR(j,1,n) cin >> aim[i][j];
	FOR(i,1,n)FOR(j,1,n) dis[i][j] = oo;
	work();
	return 0;
}


Measured memory_bytes: 6132
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <stdint.h>
#include <math.h>
using namespace std;

int main()
{
    int N; cin >> N;
    int str[100];
    for( int i = 0; i < N; ++i ){
        cin >> str[i];
    }
    int minValue = INT_MAX;
    for( int i = -100; i <= 100; ++i ){
        int64_t t = 0;
        for( int k = 0; k < N; ++k ){
            t += (i - str[k]) * (i - str[k]); 
        }
        if( minValue > t ){
            minValue = t;
        }
    }
    cout << minValue << endl;
    return 0;
}

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

#define ll long long
#define all(x) x.begin(), x.end()
#define boost() ios_base::sync_with_stdio(0)
#define in insert
#define pb push_back
#define mp make_pair
#define F first
#define S second
#define sz(x) x.size()

using namespace std;

const int N = int(1e5) + 5;
const int INF = int(1e9) + 7;
const ll MINF = 1e18;
int n, m;
int kol[N];
bool can[N];
void solve () {
  cin >> n >> m;
  for (int i = 1; i <= n; i ++) {
    kol[i] = 1;
  }    
  can[1] = 1;
  for (int i = 1; i <= m; i ++) {
    int x, y;
    cin >> x >> y;
    if (can[x] == 1) {
      if (kol[x] == 1) {
        can[x] = 0;  
      }
      can[y] = 1;
      kol[x] --;
      kol[y] ++;
    }
    else {
      kol[x] --;
      kol[y] ++;
    }
  }
  int ans = 0;
  for (int i = 1; i <= n; i ++)  {
    if (can[i]) ans ++;
  }
  cout << ans;
}

int main () {
    boost ();
    int TT = 1;
//  cin >> TT;    
    while (TT --) {
      solve ();
    }
  return 0;
}

Measured memory_bytes: 768
#include<bits/stdc++.h>
using namespace std;
typedef long long unsigned int ll;

// definition {{{ 1

// scaning {{{ 2
#define Scd(x) scanf("%d", &x)
#define Scd2(x,y) scanf("%d%d", &x, &y)
#define Scd3(x,y,z) scanf("%d%d%d", &x, &y, &z)

#define Scll(x) scanf("%llu", &x)
#define Scll2(x,y) scanf("%llu%llu", &x, &y)
#define Scll3(x,y,z) scanf("%llu%llu%llu", &x, &y, &z)

#define Scc(c) scanf("%c", &c);
#define Scs(s) scanf("%s", s);
#define Scstr(s) scanf("%s", &s);
// }}} 2

// constants {{{ 2
#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))
// }}} 2

// systems {{{ 2
#define Rep(x,y) for(int x = 0; x < y; x++)
#define Repe(x,y,z) for(int x = z; x < y; x++)
// }}} 2

// output {{{ 2
#define YesNo(a) (a)?printf("Yes\n"):printf("No\n");
// }}} 2

// }}} 1

int main() {

    int W,H;

    Scd2(H,W);

    static char s[1002][1002];
    Rep(i,H){
        Scs(s[i]);
    }

    static int bl[1002][1002] = {};

    Rep(i,H){
        Rep(j,W){
            bl[i][j] = INF;
        }
    }

    int cnt = INF;
    Rep(i,H){
        Rep(j,W){
            cnt = min( ++cnt, bl[i][j] );
            if(s[i][j] == '#')
                cnt = 0;
            bl[i][j] = min(cnt,bl[i][j]);
        }
        cnt = INF;
        for( int j = W-1; j >= 0; j-- ){
            cnt = min( ++cnt, bl[i][j] );
            if(s[i][j] == '#')
                cnt = 0;
            bl[i][j] = min(cnt,bl[i][j]);
        }
    }
    Rep(j,W){
        cnt = INF;
        Rep(i,H){
            cnt = min( ++cnt, bl[i][j] );
            if(s[i][j] == '#')
                cnt = 0;
            bl[i][j] = min(cnt,bl[i][j]);
        }
        cnt = INF;
        for( int i = H-1; i >= 0; i-- ){
            cnt = min( ++cnt, bl[i][j] );
            if(s[i][j] == '#')
                cnt = 0;
            bl[i][j] = min(cnt,bl[i][j]);
        }
    }

    int ans = 0;
    Rep(i,H){
        Rep(j,W){
            ans = max(ans,bl[i][j] );
        }
    }
    printf("%d\n", ans);


    return 0;
}



Measured memory_bytes: 5120
#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 repc(i, n) for (int i = 0; i <= int(n); i++)
#define rrepc(i, n) for (int i = int(n); i >= 0; i--)
#define repi(i, a, b) for (int i = int(a); i < int(b); i++)
#define repic(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 bit32(x) (1 << (x))
#define bit64(x) (1ll << (x))
#define sz(v) ((int) v.size())

using namespace std;

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

inline void yes() { cout << "Yes" << endl; exit(0); }
inline void no() { cout << "No" << endl; exit(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) { x = max(x, y); }
template <typename T> inline void amin(T &x, T y) { x = min(x, y); }
template <typename T> inline T exp(T x, i64 n, T e = 1) { T r = e; while (n > 0) { if (n & 1) r *= x; x *= x; n >>= 1; } return r; }
template <typename T> istream& operator>>(istream &is, vector<T> &v) { each(x, v) is >> x; return is; }
template <typename T> ostream& operator<<(ostream &os, vector<T> &v) { rep(i, v.size()) { if (i) os << ' '; os << v[i]; } return os; }
void solve(); int main() { ios::sync_with_stdio(0); cin.tie(0); cout << fixed << setprecision(16); solve(); return 0; }

void solve() {
  int x;
  cin >> x;
  int ans = 0;
  {
    int c = x / 500;
    ans += c * 1000;
    x -= c * 500;
  }
  {
    int c = x / 5;
    ans += c * 5;
  }
  cout << ans << endl;
}

Measured memory_bytes: 256
#include <stdio.h>

int main(void){
  int x, y;

  scanf("%d %d", &x, &y);

  if(x==2)
  puts("No");

  if(x==4||x==6||x==9||x==11){
    if(y==4||y==6||y==9||y==11)
      puts("Yes");
      else
      puts("No");

  }

  if(x==1||x==3||x==5||x==7||x==8||x==10||x==12){
    if(y==1||y==3||y==5||y==7||y==8||y==10||y==12)
    puts("Yes");
    else
    puts("No");

  }

  return 0;
}


Measured memory_bytes: 128
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define F first
#define S second
#define pii pair<int, int>
#define eb emplace_back
#define all(v) v.begin(), v.end()
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define rep3(i, l, n) for (int i = l; i < (n); ++i)
#define sz(v) (int)v.size()
#define endl '\n'
const int inf = 1000000007;
const ll INF = 1e18;
int mod = 998244353;
// int mod = 1000000007;
#define abs(x) (x >= 0 ? x : -(x))
#define lb(v, x) (int)(lower_bound(all(v), x) - v.begin())
#define ub(v, x) (int)(upper_bound(all(v), x) - v.begin())
template<typename T1, typename T2> inline bool chmin(T1 &a, T2 b) { if (a > b) { a = b; return 1; } return 0; }
template<typename T1, typename T2> inline bool chmax(T1 &a, T2 b) { if (a < b) { a = b; return 1; } return 0; }
ll gcd(ll a, ll b) { if (b == 0) return a; return gcd(b, a % b); }
ll lcm(ll a, ll b) { return a / gcd(a, b) * b; }
ll pow(ll a, int b) { return b ? pow(a * a, b / 2) * (b % 2 ? a : 1) : 1; }
ll modpow(ll a, ll b, ll _mod) { return b ? modpow(a * a % _mod, b / 2, _mod) * (b % 2 ? a : 1) % _mod : 1; }
template<class T, class U> ostream& operator << (ostream& os, const pair<T, U>& p) { os << p.F << " " << p.S; return os; }
template<class T> ostream& operator << (ostream& os, const vector<T>& vec) { rep(i, sz(vec)) { if (i) os << " "; os << vec[i]; } return os; }
template<typename T> inline istream& operator >> (istream& is, vector<T>& v) { rep(j, sz(v)) is >> v[j]; return is; }
template<class T, class T2> inline void add(T &a, T2 b) { a += b; if (a >= mod) a -= mod; }


void solve();

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cout << fixed << setprecision(10);

  int T;
  // cin >> T;
  T = 1;

  while (T--) {
    solve();
  }
}

void solve() {
  int n;
  cin >> n;
  cout << 2 * 3.141592 * n << endl;
}


Measured memory_bytes: 3800
# -*- coding: utf-8 -*-
K, T = map(int, input().split(' '))
A = list(map(int, input().split(' ')))
A = [(-a, i) for i, a in enumerate(A)]

import heapq
heapq.heapify(A)

prev = -1
while len(A) > 1:
    a, i = heapq.heappop(A)
    if i == prev:
        b, j = heapq.heappop(A)
        prev = j

        heapq.heappush(A, (a, i))
        b += 1
        if b != 0:
            heapq.heappush(A, (b, j))

    else:
        prev = i
        a += 1
        if a != 0:
            heapq.heappush(A, (a, i))



print(- A[0][0] - 1)







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

#define rep(i, n) rep2(i, 0, n)
#define rep2(i, m, n) for (ll i = m; i < (n); i++)

using ll = long long;
using pii = pair<int, int>;
using Vi = vector<int>;

int main() {
  int N,K;
  cin >> N >> K;
  if(N%K==0){
    cout << 0 << endl;
  }
  else{
    cout << 1 << endl;
  }
  
    
}      
 

Measured memory_bytes: 3608
class Ball
    attr_reader :id, :x, :y

    def initialize(id, x, y)
        @id = id
        @x = x
        @y = y
    end
end

n = gets.chomp!.to_i

balls = n.times.map {|i|
  x, y = gets.chomp!.split(" ").map!(&:to_i)
  Ball.new(i, x, y) 
}

diff2 = {}
diff = {}

balls.permutation(2).each do |ball1, ball2|
  diff_x = ball1.x - ball2.x
  diff_y = ball1.y - ball2.y
  key = "#{diff_x},#{diff_y}"
  diff[key] = (diff[key] || 0) + 1
  diff2[key] = (diff2[key] || {})
  diff2[key][ball1.id] = ball1.id
end

#require 'pp'
#pp diff2

count = diff2.inject(0) {|m, (_, v)| m = (v.count > m) ? v.count : m } 
count2 = diff.inject(0) {|m, (_, v)| m = (v > m) ? v : m } 

puts n - count2


Measured memory_bytes: 3196
#include <stdio.h>
int main() {
     char a[4], b[4], c[4];
     scanf("%s", a);
     scanf("%s", b);
     scanf("%s", c);

     printf("%c", a[0]);
     printf("%c", b[1]);
     printf("%c", c[2]);
     printf("\n");
     return 0;
}


Measured memory_bytes: 128
#include <bits/stdc++.h>
#define PI 3.1415926535897
using namespace std;
typedef long long ll;
const int INF = 1000000000;
const ll LINF = 1000000000000000000; //1e18
const double EPS = 1e-10;

int gcd(int a, int b)
{
    if (a % b == 0)
    {
        return (b);
    }
    else
    {
        return (gcd(b, a % b));
    }
}

int main(void)
{
    ll A, B, C, D;
    cin >> A >> B >> C >> D;
    A--;

    ll gcd_num = gcd(C, D);
    // printf("gcd = %d\n", gcd_num);

    // from 1 to A
    ll toAbyC = A / C;
    ll toAbyD = A / D;
    ll toAbyCD = A / ((C * D) / gcd_num);

    ll totalA = toAbyC + toAbyD - toAbyCD;
    //from 1 to B
    ll toBbyC = B / C;
    ll toBbyD = B / D;
    ll toBbyCD = B / ((C * D) / gcd_num);

    ll totalB = toBbyC + toBbyD - toBbyCD;

    // from A to B
    ll AB = totalB - totalA;
    ll ans = (B - A) - AB;

    cout << ans << "\n";
    return (0);
}

Measured memory_bytes: 256
#include <stdio.h>
#include <algorithm>
#include <assert.h>
#include <bitset>
#include <cmath>
#include <complex>
#include <deque>
#include <functional>
#include <iostream>
#include <limits.h>
#include <map>
#include <math.h>
#include <queue>
#include <set>
#include <stdlib.h>
#include <string.h>
#include <string>
#include <time.h>
#include <unordered_map>
#include <unordered_set>
#include <vector>

#pragma warning(disable:4996)
#pragma comment(linker, "/STACK:336777216")
using namespace std;

#define mp make_pair
#define all(x) (x).begin(), (x).end()
#define ldb ldouble

typedef tuple<int, int, int> t3;
typedef long long ll;
typedef unsigned long long ull;
typedef double db;
typedef long double ldb;
typedef pair <int, int> pii;
typedef pair <ll, ll> pll;
typedef pair <ll, int> pli;
typedef pair <db, db> pdd;

int IT_MAX = 1 << 18;
const ll MOD = 1000000007;
const int INF = 0x3f3f3f3f;
const ll LL_INF = 0x3f3f3f3f3f3f3f3f;
const db PI = acos(-1);
const db ERR = 1e-10;
#define szz(x) (int)(x).size()
#define rep(i, n) for(int i=0;i<n;i++)
#define Se second
#define Fi first

int main() {
	int x, y = 0, t;
	scanf("%d", &x);
	t = x;
	while (t) {
		y += t % 10;
		t /= 10;
	}
	if (x % y == 0) printf("Yes\n");
	else printf("No\n");
	return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main()
{
long long int i,idx,k,j,n,a[100000],mx=0;
    map<long long int,long long int>m;
    vector<long long int>v;
    cin>>n;
    idx=0;
    for(i=0;i<n;i++){cin>>a[i];}
    sort(a,a+n,greater<int>());
    for(i=0;i<n;i++){m[a[i]]++;}
     for(j=0;j<n;j++){
   if(m[a[j]]>=4){
            if(idx==0){v.push_back(a[j]);
       v.push_back(a[j]);idx=1;m[a[j]]=-1;}
        else{v.push_back(a[j]);m[a[j]]=-1;}
        }
   else if(m[a[j]]>=2&&m[a[j]]<=3){
      v.push_back(a[j]);m[a[j]]=-1;idx=1;
    }
      }
    if(v.size()<2){cout<<"0\n";}
    else{cout<<v[0]*v[1]<<endl;}
     }

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

/*
int main(){
    int N;
    cin >> N;
    int d[N] = {};
    for(int i=0; i<N; i++){
        cin >> d[i];
    }
    int sum = 0, ans = 0;
    for(int i=0; i<N;i++){
        for(int j=i+1; j<N; j++){
            sum += d[j];
        }
        ans += d[i]*sum;
        sum = 0;
    }
    cout << ans << endl;
    return 0;
}
*/


int main(){
    int N;
    cin >> N;
    int d[N] = {};
    for(int i=0; i<N; i++){
        cin >> d[i];
    }
    int sum = 0, ans = 0;
    for(int i=N-1; i>0; i--){
        sum += d[i];
        ans += d[i-1]*sum;
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define FASTIO ios::sync_with_stdio(false);cin.tie(0);
#define ADD +
#define SUBTRACT -
#define MULTIPLY *
#define DIVIDE /
#define MOD %
#define INCREMENT(x) ++x
#define DECREMENT(x) --x
#define in(a,b) cin>>a>>b;
#define out(a,b) cout<<a<<endl<<b<<endl;
#define scan(a) scanf("%d",&a);
#define print(a) printf("%d\n",a);
#define scanii(a,b) scanf("%d %d",&a,&b);
#define printii(a,b) printf("%d\n%d\n",a,b);
#define scaniii(a,b,c) scanf("%d %d %d",&a,&b,&c);
#define pub push_back
#define pob pop_back
#define puf push_front
#define pof pop_front
#define ll long long
#define ull unsigned long long
#define sll signed long long
#define pi acos(-1)
#define mod 1000000007
#define TRUE 1
#define FALSE 0
#define ZERO 0
#define MP make_pair
#define F first
#define S second
#define f1(i,a) for(int i=0;i<a;++i)
#define f2(i,a) for(int i=a-1;i>=0;--i)
#define en puts("");
#define elif else if
typedef ll int lli;
typedef sll int slli;
typedef ull int ulli;
const int sz=10000;
using namespace std;

int clue();
int result();
void show();
bool check();


// bool cmp(pair<int,int>p,pair<int,int>q) {
//     return p.first>q.first;//descending by first
//     return p.first<q.first;//ascending by first
//     return p.second>q.second;//descending by second
//     return p.second<q.second;//ascending by second
// }

bool cmp(int p,int q) {
    return p>q;//descending
    // return p<q;//ascending
}

int main() {

    int t;
    // cin>>t;
    t=1;
    while(t-->0) {
        clue();
    }
    return 0;
}
int clue() {

    int s,w;
    cin>>s>>w;
    (s>w)?cout<<"safe"<<endl:cout<<"unsafe"<<endl;
    
    return 0;
}

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

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

#define FOR(i, n, m) for (ll(i) = (m); (i) < (n); ++(i))
#define REP(i, n) FOR(i, n, 0)
#define OF64 std::setprecision(10)

const ll MOD = 1000000007;
const ll INF = (ll)1e15;

int main()
{
    ll N;
    cin >> N;
    FOR(i, 10, 1)
    {
        FOR(j, 10, 1)
        {
            if (i * j == N)
            {
                cout << "Yes" << endl;
                return 0;
            }
        }
    }
    cout << "No" << endl;
    return 0;
}

Measured memory_bytes: 256
n = int(input())
lst = list(map(int,input().split()))

put = [0] * n

for i in reversed(range(n)):
    if sum(put[i::i+1])%2 != lst[i]:
        put[i] = 1

print(sum(put))
for index,i in enumerate(put):
    if i==1:
        print(index+1)

Measured memory_bytes: 8380
import sys
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
read = sys.stdin.buffer.read
sys.setrecursionlimit(10 ** 7)
INF = float('inf')

S = input()
T = input()

if T in S + S:
    print('Yes')
else:
    print('No')

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

int main(){
  string S, T;
  cin >> S >> T;
  string ans = "No";
  
  for(int i=0; i<S.size(); i++){
    char t = T.at(0);
   for(int j=0; j<T.size()-1; j++){
     T.at(j) = T.at(j+1);
   }
     T.at(T.size()-1) = t;
   if(S == T){
     ans = "Yes";
   }
  }
  
  cout << ans << endl;
}

Measured memory_bytes: 256
import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int k = sc.nextInt();
        int[] x = new int[n];
        int ans = Integer.MAX_VALUE;
        for (int i = 0; i < n; i++) {
            x[i] = sc.nextInt();
        }
        for (int i = 0; i < n - k + 1; i++) {
            int min = Math.min(Math.abs(x[i]) + Math.abs(x[i] - x[i + k - 1]),
                    Math.abs(x[i + k - 1]) + Math.abs(x[i] - x[i + k - 1]));
            if (ans > min)
                ans = min;
        }
        System.out.println(ans);
    }
}


Measured memory_bytes: 52068
#include<iostream>

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

using namespace std;

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

    int ans = 0;
    for(int i = 1; i <= k - 1; i++){
        for(int j = i + 1; j <= k; j++){
            if((i % 2 == 1 && j % 2 == 0) || (i % 2 == 0 && j % 2 == 1)){
                ans++;
            }
        }
    }

    cout << ans << endl;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
string S;
bool dfs(int sum,int d,string ans){
  if(d>S.size()-1){
    return sum==7;
  }
  
if(dfs(sum+S[d]-'0',d+1,ans)){
  ans[d-1]='+';
  
  return true;
}
  if(dfs(sum-(S[d]-'0'),d+1,ans)){
    ans[d-1]='-';
    return true;
  }
  return false;
}

int main(){
  cin>>S;
  cout<<S[0];
  string ans;
 if(dfs(S[0]-'0',1,ans)){
   for(int i=0;i<3;i++){
     cout<<ans[i]<<S[i+1];
   }
 }
  cout<<"=7"<<endl;
}


Measured memory_bytes: 256
import sys
read = sys.stdin.read
from collections import Counter
def main():
    n, *s = read().split()
    n = int(n)
    sc = Counter(s)
    scm = sc.most_common()
    maxnum = scm[0][1]
    r = []
    for scme in scm:
        if scme[1] == maxnum:
            r.append(scme[0])
        else:
            break
    r.sort()
    print(*r, sep="\n")

if __name__ == '__main__':
    main()

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

int main(){
  int n, k;
  cin >> n >> k;
  
  int ans = 0;
  rep(i,n){
    int h;
    cin >> h;
    if(h >= k) ans++;
  }
  
  cout << ans << endl;
}

Measured memory_bytes: 256
from string import ascii_lowercase as T
S = input()
if len(S) != 26:
  A = [0] * 26
  offset = ord('a')
  for s in S:
    A[ord(s)-offset] = 1
  print(S + chr(A.index(0)+offset))
elif S == T[::-1]:
  print(-1)
else:
  k = 25
  while S[k-1] > S[k]:
    k -= 1
  x = S[k-1]
  Y = sorted(S[k-1:])
  print(S[:k-1] + Y[Y.index(x) + 1])

Measured memory_bytes: 9868
#include <bits/stdc++.h>
#define mod 1000000007
#define MAXN 200000 + 5
#define ll long long
#define int long long
using namespace std;
 
#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define all(arr) arr.begin() , arr.end()
#define FAST ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
#define rep(i , a , n) for(int i = a ; i < n ; i++)
#define s(arr) sort(all(arr))
#define r(arr) reverse(all(arr))
#define rs(arr) s(arr) ; r(arr)
#define con continue
#define endl "\n"
 
//debug
#define trace1(x)                cout<<#x<<": "<<x<<endl
#define trace2(x, y)             cout<<#x<<": "<<x<<" | "<<#y<<": "<<y<<endl
#define trace3(x, y, z)          cout<<#x<<":" <<x<<" | "<<#y<<": "<<y<<" | "<<#z<<": "<<z<<endl

signed main(){
    FAST;
    int n , d , a;
    cin >> n >> d >> a;
    vector< pair <int , int> > arr(n);
    rep(i , 0 , n){
        cin >> arr[i].ff >> arr[i].ss;
    }
    sort(all(arr));
    int ans = 0;
    int i = 0 , j = 0;
    int mark[n];
    int curr = 0;
    memset(mark , 0 , sizeof mark);
    while(i < n){
        curr += mark[i];
        arr[i].ss -= curr * a;
        if (arr[i].ss <= 0)
        {
            i++;
            continue;
        }
        j = max(i , j);
        while(j < n && ((arr[j].ff - arr[i].ff) <= (2 * d)))
            j++;
        if (j != i)
            j--;
        int req = arr[i].ss / a + ((arr[i].ss % a) ? 1 : 0);
        ans += req;
        //trace2(i , ans);
        i++;
        curr += req;
        if (j + 1 < n)
            mark[j + 1] = mark[j + 1] - req;
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 4992
#include <iostream>
using namespace std;
typedef long long ll;
ll h, w, res = 11000000000;
int main(void){
    // Your code here!
    cin >> h >> w;
    for (int i = 1; i < h; i++) {
        ll a, b, c, ma, mi;
        a = i * w;
        b = w / 2 * (h - i);
        c = (w + 1) / 2 * (h - i);
        ma = max(a, max(b, c));
        mi = min(a, min(b, c));
        res = min(res, ma - mi);
    }
    for (int i = 1; i < w; i++) {
        ll a, b, c, ma, mi;
        a = i * h;
        b = h / 2 * (w - i);
        c = (h + 1) / 2 * (w - i);
        ma = max(a, max(b, c));
        mi = min(a, min(b, c));
        res = min(res, ma - mi);
    }
    if (h % 3 == 0) res = 0;
    else res = min(res, w);
    if (w % 3 == 0) res = 0;
    else res = min(res, h);
    cout << res << endl;
}


Measured memory_bytes: 256
#include <stdio.h>

int main(){
  int i,j,q,N,k,a[3][3],c=0,s[3],t[3],x=0,y=0;
  
  for(i=0;i<3;i++){
    for(j=0;j<3;j++){
      scanf("%d",&a[i][j]);//9x9ができた確認済み
    }
  }
  
 scanf("%d",&N);        //sumi
 // printf("%d",N);
  int b[N];
  for(i=0;i<N;i++){
    scanf("%d",&b[i]);
 
  }          //sumi
  // printf("%d\n",b[4]);
  for(k=0;k<N;k++){ 
   for(i=0;i<3;i++){
    for(j=0;j<3;j++){
      if(a[i][j]==b[k])
        a[i][j]=0;
    }
   }
  }//sumi
 
 /*  for(i=0;i<3;i++){
    for(j=0;j<3;j++){
  printf("%d\n",a[i][j]);  //観測用
    }
  }*/
  for(i=0;i<3;i++){
    t[i]=0;s[i]=0;
  }
  
  for(i=0;i<3;i++){
    for(j=0;j<3;j++){
      s[i]+=a[i][j];
    }
  }
    if(s[1]==0||s[0]==0||s[2]==0)
      c++;
   for(i=0;i<3;i++){
    for(j=0;j<3;j++){
      t[i]+=a[j][i];
    }
   }
      if(t[1]==0||t[0]==0||t[2]==0)
         c++;
   for(i=0;i<3;i++){
     x+=a[i][i];
     y+=a[i][2-i];
   }
     if(x==0||y==0)
    c++;

     if(c>0)
  printf("Yes");
     else
       printf("No");
}

Measured memory_bytes: 128
/**
 * 関節点 : https://onlinejudge.u-aizu.ac.jp/courses/library/5/GRL/3/GRL_3_A
 * 橋 : https://onlinejudge.u-aizu.ac.jp/courses/library/5/GRL/3/GRL_3_B
 * */

#include <bits/stdc++.h>
using namespace std;
#define INF 1<<29
#define all(v) (v).begin(), (v).end()

int V, E; //頂点数 辺の数
vector<vector<int>> G(V); //頂点の隣接リスト
vector<int> ord_pre(V, INF); //行きがけ順の記録
vector<int> lowlink(V, INF); //lowlinkの記録
vector<pair<int, int>> Bridges; //橋のリスト
vector<int> ArticulationPoints; //関節点のリスト

int pre = 0; //行きがけ順序

void recdfs(int p, int u){ //p : uの親
  ord_pre[u] = pre++; //uの番号を確定する
  lowlink[u] = ord_pre[u];

  int cnt = 0; //DFS木次数カウント
  bool isArt = false; //関節点か否か

  for(int v: G[u]){ //uから行ける頂点vについて
    if(ord_pre[v]==INF){ //未訪問ならばuの子なので
      cnt++;

      recdfs(u, v); //uの子であるvの番号を確定させる //vのlowlinkも確定
      lowlink[u] = min(lowlink[u], lowlink[v]);

      if(ord_pre[u] < lowlink[v])Bridges.push_back({u,v}); //橋の判定してリストに入れる
      if(p!=-1 && ord_pre[u]<=lowlink[v])isArt = true; //根以外の関節点判定

    }else if( v != p ){
      //このとき uv が後退辺
      lowlink[u] = min(lowlink[u], ord_pre[v]);
    }
  }
  if(p==-1 && cnt>1)isArt = true; //根の関節点判定
  if(isArt)ArticulationPoints.push_back(u); //関節点だったらリストに入れる
}


int main(){
  cin>>V>>E;
  G.resize(V);
  for(int i=0; i<E; i++){
    int s,t;
    cin>>s>>t; //s--;t--;
    G[s].push_back(t);
    G[t].push_back(s);
  }

  ord_pre.assign(V, INF);
  lowlink.assign(V,INF);
  pre = 0;
  recdfs(-1, 0);

  //* 3a
  sort(all(ArticulationPoints));
  for(int x: ArticulationPoints)cout<<x<<endl;
  //*/

  /* 3b
  for(auto &x: Bridges){
    if(x.first>x.second)swap(x.first, x.second);
  }
  sort(all(Bridges));
  for(auto x: Bridges)cout<<x.first<<" "<<x.second<<endl;
  //*/
}


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

typedef int64_t Int;
#define all(x) (x).begin(), (x).end()
 
const double EPS = 1e-10;
const Int INF = 1e18;
const int inf = 1e9;
const Int mod = 1e9+7;

bool print_space_enable = false;
void print() { 
    cout << endl; 
    print_space_enable = false;
}

template <class Head, class... Tail>
void print(Head&& head, Tail&&... tail) {
    if (print_space_enable) cout << " ";
    cout << fixed << setprecision(15) << head;
    print_space_enable = true;
    print(std::forward<Tail>(tail)...);
}

template<typename T>
void print(vector<T> v) {
    for (size_t i = 0; i < v.size(); i++) {
        if (i > 0) std::cout << " ";
        std::cout << v[i];
    }
    std::cout << std::endl;
}

int main() {
    Int a, b, c;
    Int k;
    cin >> a >> b >> c >> k;
    for (Int i = 0; i <= k; i++) {
        for (Int j = 0; j <= k - i; j++) {
            Int aa = a;
            Int bb = b;
            Int cc = c;
            for (Int x = 0; x < i; x++) {
                aa *= 2;
            }
            for (Int x = 0; x < j; x++) {
                bb *= 2;
            }
            for (Int x = 0; x < k - i - j; x++) {
                cc *= 2;
            }
            if (aa < bb and bb < cc) {
                print("Yes");
                return 0;
            }
        }
    }
    print("No");
    return 0;
}

Measured memory_bytes: 3632
#include <bits/stdc++.h>
#define REP(i,n,N) for(int i=n;i<N;i++)
#define p(S) cout<<S<<endl
using namespace std;


int main(){
	int N;
	while(cin>>N,N){
		int n,d,maxX=200,minX=200,maxY=200,minY=200;
		pair<int,int> hako[200];//y,x
		hako[0]={200,200};
		REP(i,1,N){
			cin>>n>>d;
			if(d==0){
				hako[i]={hako[n].first,hako[n].second-1};
				minX=min(minX,hako[n].second-1);
			}else if(d==1){
				hako[i]={hako[n].first+1,hako[n].second};
				maxY=max(maxY,hako[n].first+1);
			}else if(d==2){
				hako[i]={hako[n].first,hako[n].second+1};
				maxX=max(maxX,hako[n].second+1);
			}else{
				hako[i]={hako[n].first-1,hako[n].second};
				minY=min(minY,hako[n].first-1);
			}
		}


		cout<<maxX-minX+1<<" "<<maxY-minY+1<<endl;
	}

	return 0;
}

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

using namespace std;
typedef long long ll;
#define int ll

#define REP(i,n) for(int i=0;i<n;++i)
#define SORT(name) sort(name.begin(), name.end())
#define ZERO(p) memset(p, 0, sizeof(p))
#define MINUS(p) memset(p, -1, sizeof(p))
#if 1
#  define DBG(fmt, ...) printf(fmt, ##__VA_ARGS__)
#else
#  define DBG(fmt, ...)
#endif

const ll LLINF = (1LL<<60);
const int INF = (1LL<<30);
const double DINF = std::numeric_limits<double>::infinity();
const int MOD = 1000000007;
#define MAX_N 100010

signed main()
{
    string S;
    cin >> S;
    int red = 0, blue = 0;
    REP(i, S.length()) {
        if(S[i] == '0') { red++; }
        else { blue++; }
    }
    printf("%lld\n", min(red, blue) * 2);
    return 0;
}


Measured memory_bytes: 512
#include<bits/stdc++.h>
using namespace std;
using i64 = long long;

int main(){
    i64 n,a[200001],sum{},ans{};
    i64 MOD = 1000000007;
    cin>>n;
    for(i64 i=0;i<n;i++){
        cin>>a[i];
        sum += a[i];
    }
    for(i64 i=0;i<n-1;i++){
        sum -= a[i];
        ans += ((sum%MOD)*a[i])%MOD;
        ans = ans%MOD;
    }
    cout<<ans<<endl;
    return 0;
}


Measured memory_bytes: 5068
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>

long S;

int main(int argc, char *argv[]) {
	int sr;
	int x,y;
	int v;

	sr=scanf("%ld", &S);

	v=1000000000;

	x = (v-S%v)%v;
	y = (S+x)/v;

	printf("0 0 1000000000 1 %d %d\n", x, y);

	return 0;
}



Measured memory_bytes: 128
import math
n = input()
n = int(n)
spl_list = [1]
for i in range(1,round(math.sqrt(n)) + 1):
  if n % i == 0:
    spl_list.append(i)

max_i = max(spl_list)
max_j = n / max_i
print(round(max_i + max_j -2))
  


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

#define f first
#define s second
#define pb push_back
#define ppb pop_back
#define mp make_pair
#define all(x) x.begin(), x.end()

using namespace std;

typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;
                                           	
const int N = 5e5 + 123, M = 2e3 + 123, inf = 1e9 + 123, mod = 1e9 + 7;
const ll INF = 1e18;

int dp[M][M];

int main() {
	cin.tie(0);
	cout.tie(0);
	ios_base::sync_with_stdio(0);
	int n, m;
	cin >> n >> m;
	char a[n + 1][m + 1];
	for (int i = 1; i <= n; i++) {
		for (int j = 1; j <= m; j++) {
			cin >> a[i][j];
		}
	}
	dp[1][1] = 1;
	for (int i = 1; i <= n; i++) {
		for (int j = 1; j <= m; j++) {
			if (i >= 2) {
				dp[i][j] = (dp[i - 1][j] + dp[i][j]) % mod;
			}
			if (j >= 2) {
				dp[i][j] = (dp[i][j - 1] + dp[i][j]) % mod;
			}
			if (a[i][j] == '#') {
				dp[i][j] = 0;
			}
		}
	}
	cout << dp[n][m] % mod;
	return 0;   	
}                                                         

Measured memory_bytes: 11392
#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <tuple>
#include <string>
#include <set>
#include <map>
using namespace std;
using ll = long long;



int main() {
	int n;
	cin >> n;
	if (n % 10 == 3) cout << "bon" << endl;
	else if (n % 10 == 0 || n % 10 == 1 || n % 10 == 6 || n % 10 == 8) cout << "pon" << endl;
	else cout << "hon" << endl;

	return 0;
}

Measured memory_bytes: 3608
N,K=map(int, input().split())
X=list(map(int, input().split()))

ans=float('inf')
for l in range(N-K+1):
  r=l+K-1
  ans=min(ans,min(abs(X[l]),abs(X[r]))+abs(X[l]-X[r]))
print(ans)

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

int main()
{
  int n,k;
  cin >> n;
  cin >> k;
  int num = 1;
  for(int i = 0;i < n;i++){
    if(num*2 < (num +k)) num = num * 2;
    else num = num + k;
  }
  cout << num << endl;
}


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



int main(){

int N,X,T,A;

scanf("%d%d%d",&N,&X,&T);

if(N%X!=0){
    A = (N / X) + 1;
}

else{
    A = (N / X);
}

T = T*A;

printf("%d",T);




}

Measured memory_bytes: 1708
/**
 *  Circle and Points (PKU 1981)
 *  by Kenji Inoue, 2007-01-05
 **/

#include <iostream>
#include <complex>

using namespace std;

typedef complex<double> P;

#define EPS (1e-6)

P p[300];
P tmp;

int main() {
  int n;
  while (cin >> n, n) {
    for (int i=0; i<n; i++) {
      cin >> p[i].real() >> p[i].imag();
    }

    int ans = 1;
    for (int i=0; i<n; i++) {
      for (int j=i+1; j<n; j++) {
        P v = p[i] - p[j];
        double absv = abs(v);
        if (absv > 2.0 + EPS) { continue; }

        P m = p[j] + (v / 2.0);
        P unv = (v * P(0, 1)) / absv; // unit normal vector
        P nv = sqrt(1.0 - absv*absv/4.0) * unv;
        for (int s=0; s<2; s++) {
          nv *= -1;
          P c = m + nv; // center point of the circle

          int cnt = 0;
          for (int k=0; k<n; k++) {
            // if (abs(p[k] - c) < 1.0 + EPS) { cnt++; } // too slow
            tmp = p[k] - c;
            if ( tmp.real()*tmp.real() + tmp.imag()*tmp.imag() < 1.0 + EPS ) { cnt++; }
          }
          if (cnt > ans) { ans = cnt; }
        }
      }
    }

    cout << ans << endl;
  }

  return 0;
}

Measured memory_bytes: 984
import math

a, b, h, m = map(int, input().split())
c = m*6 - (60*h + m)*0.5
kakudo = abs(c)
if kakudo >= 180:
    kakudo = 360 - kakudo
else:
    pass
ccos = math.cos(math.radians(kakudo))
rans = a*a + b*b - 2*a*b*ccos
print(math.sqrt(rans))

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

#define ll                     long long
#define loop( i,a)             for(i=0;i<a;i++)
#define loop1(i,a)             for(i=1;i<=a;i++)
#define loopi(a)               for(ll i=0;i<a;i++)
#define ppp(a)                 cout<<a<<endl;
#define sscd(a)                scanf("%lf",&a)
#define sss(a)                 cin>>a
#define scc(a)                 scanf("%c",&a)
#define FOR(i,a,b)             for(i=a;i<b;i++)
#define FORE(i,a,b)            for(i=a;i<=b;i++)
#define reverses(s)            reverse(s.begin(),s.end())
#define inf                    9000000000000000
#define pii                    3.1415926536
#define pb(a)                  push_back(a)
#define pppp(a,b)              cout<<a<<"  "<<b;
#define newline                printf("\n");
#define sorted(a)               sort(a.begin(),a.end())


int main()
{
    ll n,h,a,b,mx=-1,p=0,c,life,dead=0;
    cin>>n>>h;
    vector<ll>k;
    vector<ll>th;
    loopi(n)
    {
        cin>>a>>b;
        k.push_back(a);
        th.push_back(b);
    }

    c=0;
    life=h;
    sort(k.begin(),k.end(),greater<int>());
    sort(th.begin(),th.end(),greater<int>());
    for(unsigned int i=0;i<n;i++)
    {
//        cout<<i<<" ";
//        ppp(th[i])
        if(th[i]<k[0])
            break;
        life-=th[i];
        c++;
        if(life<=0)
        {
            ppp(c)
            return 0;
        }
    }
//    ppp(life)
//    ppp(c)
//    ppp("k")
//    pppp("mx",k[p])
//    newline
//    ppp(ceil(life*1.00/k[p]))

        c+=ceil(life*1.00/k[0]);

    ppp(c)
    return 0;
}



Measured memory_bytes: 2036