akhauriyash/Code-Regression huggingface dataset:
#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>;

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

//---main---------------------------------------------
int main(){
    //main
    int N;
    cin >> N;
    int A[N], B[N];
    rep(i,N) cin >> A[i] >> B[i];
    sort(A,A+N);
    sort(B,B+N);


    int ans;
    if(N%2==0) ans = (B[N/2-1] + B[N/2]) - (A[N/2-1]+A[N/2]) + 1;
    else ans = B[(N+1)/2-1] - A[(N+1)/2-1] + 1;
    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 5164
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// 入力受け取り
		Scanner in = new Scanner(System.in);
		double N = in.nextDouble();
		double K = in.nextDouble();

		double y = 1;
		double sum = 0;

		// サイコロの目：１～Nで場合分け
		for ( int die = 1; die <= N; die++, y = 1.0 ) {

			// K以上になるまでコインを振る
			while ( die * y < K ) {
				y *= 2;
			}
			// 表が出続ける確率*サイコロのその目が出る確率
			sum += (1 / y) * (1 / N);
		}
		
		System.out.println(sum);
		in.close();
	}
}


Measured memory_bytes: 23380
#include<bits/stdc++.h>
using namespace std;
const int N=1e5+100;
inline void solve(int ql,int qr,int cl,int cr){
	for(int  i=1;i<cl;++i)cout<<0<<' ';
	cout<<(cl+1)/2+cr-(cr+1)/2<<' '<<cl-(cl+1)/2+(cr+1)/2<<' ';
	for(int  i=1;i<cr;++i)cout<<0<<' ';
}
char s[N];
int main()
{
	scanf("%s",s+1);
	int n=strlen(s+1);
	for(int  l=1,r;l<=n;l=r+1){
		r=l;
		while(r<n&&s[r+1]=='R')++r;
		int len=r-l+1;
		while(r<n&&s[r+1]=='L')++r;
		solve(l,r,len,r-l+1-len);
	}
	return 0;
}


Measured memory_bytes: 512
#include <bits/stdc++.h>
using namespace std;
struct tpl {
    string s;
    int x,ind;
};
bool comp(tpl a,tpl b) {
    if (a.s==b.s) return a.x>b.x;
    return a.s<b.s;
}
int main() {
    int n,x;
    cin>>n;
    vector<tpl> v;
    string str;
    for (int i=0; i<n; i++) {
        cin>>str>>x;
        v.push_back({str,x,i});
    }
    sort(v.begin(),v.end(),comp);
    for (int i=0; i<v.size(); i++) {
        cout<<v[i].ind+1<<'\n';
    }
}

Measured memory_bytes: 3592
import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        
        Scanner sc = new Scanner(System.in);
        String S = sc.next();
        String slist[] = S.split("");
        if(S.length()==2){
            System.out.println(S);
        }
        if(S.length()==3){
            String S1 = slist[2] + slist[1] + slist[0];
            System.out.println(S1);
        }
        
    }
}


Measured memory_bytes: 39252
<?php
$n = trim(fgets(STDIN));
$a = explode(' ',trim(fgets(STDIN)));
rsort($a);
$s = $a[0];
for ($i=1; $i < $n;$i++) { 
    $s = $i % 2 === 1 ? $s - $a[$i] : $s + $a[$i];
}
echo $s;
?>

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

int main(){
	cin.tie(0),ios::sync_with_stdio(false);
	string s,t; cin>>s>>t;
	vector<int>sc(26,-1),tc(26,-1);
	string ans="Yes"s;
	for(int i=0;i<s.size();++i){
		int S=s.at(i)-'a',T=t.at(i)-'a';
		if(sc.at(T)!=-1&&sc.at(T)!=S)ans="No"s;
		if(tc.at(S)!=-1&&tc.at(S)!=T)ans="No"s;
		sc.at(T)=S,tc.at(S)=T;
	}
	cout<<ans<<"\n"s;
}


Measured memory_bytes: 3872
K_S = input().split()
K = int(K_S[0])
S = int(K_S[1])

total_xy = -1
expected_z = -1
range_xy = range(0, K + 1)
count_pattern = 0
for x in range_xy:
    for y in range_xy:
        expected_z = S - (x + y)
        if expected_z >=0 and expected_z <= K:
            count_pattern += 1

print(count_pattern)


Measured memory_bytes: 3060
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		double r = sc.nextDouble();
		double pi = Math.PI;
		double area = pi * r * r;
		double length = 2 * pi * r;
		System.out.printf("%f %f", area, length);
	}
}



Measured memory_bytes: 28280
#include<iostream>		
#include<cstdio>
#include<algorithm>
using namespace std;
int max1, min1;
int a[200010];

int main(){
	int n;
	cin >> n;
	for (int i = 0; i < n; i++) {
		cin >> a[i];
	}
	min1 = min(a[1], a[0]);
	max1 = a[1] - a[0];
	for (int i = 2; i < n; i++) {
		max1 = max(max1, a[i] - min1);
		min1 = min(min1, a[i]);
	}
	cout << max1 << endl;
}


Measured memory_bytes: 3896
#include<iostream>
#include<map>
#include<set>
#include<string>
#include<algorithm>
#include<cmath>
#include<vector>
#include<queue>
#include<stack>
#include<limits>
#include<sstream> 
#include<unordered_map>      

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef int itn;

const int inf = numeric_limits<int>::max() >> 2;
const ll linf = numeric_limits<ll>::max() >> 2;
const ull ulinf = numeric_limits<ull>::max() >> 2;
const double pi = acos(-1);
const int dx[4]={1,0,-1,0};
const int dy[4]={0,1,0,-1};
const int dx8[8]={-1,0,1,-1,1,-1,0,1};
const int dy8[8]={-1,-1,-1,0,0,1,1,1};

#define p_queue(i) priority_queue<i> 
#define rp_queue(i) priority_queue<i, vector<i>, greater<i>> 
#define umap(i,j) unordered_map<i,j>
#define P(p) cout<<(p)<<endl
#define PS(p) cout<<(p)<< " "
#define PN cout << endl
#define rep(i,m,n) for(int i = (m); i < (int)(n); i++)
#define rrep(i,m,n) for(int i = (n-1); i >= (int)(m); i--)
#define inrep(n,a) for(int i = 0; i < (int)(n); i++)cin >> a[i];
#define mod(i) ((i)%(ll)(1e9 + 7))
#define divm(a,b) (mod(a * modpow((ll)b,(ll)(1e9+5))))
#define rsort(a,b,c) sort(a, b, greater<c>())
#define vsort(v) sort(v.begin(), v.end())
#define rvsort(v,c) sort(v.begin(), v.end(), greater<c>()) 
#define ft first
#define sd second
#define pb push_back
#define it insert
#define sz(x) ((int)(x).size())
#define lb(a,n,k) (lower_bound(a,a+n,k) - (a)) 
#define vlb(a,k)  (lower_bound(a.begin(),a.end(),k) - a.begin())
#define ub(a,n,k) (upper_bound(a,a+n,k) - (a)) 
#define vub(a,k)  (upper_bound(a.begin(),a.end(),k) - a.begin())
#define YES cout<<"YES"<< endl
#define NO cout<<"NO"<<endl
#define Yes cout<<"Yes"<<endl
#define No cout<<"No"<<endl  
#define yes cout<<"yes"<<endl
#define no cout<<"no"<<endl
#define ret return

/*
ll modpow(ll i,ll j){ ll tmp=1; while(j){ if(j%2)tmp=mod(tmp*i);i=mod(i*i);j/=2;}return tmp;}
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
ll lcm(ll a, ll b) { return a / gcd(a, b) * b; }
*/

/*
vector<string> split(const string &str, char sep){
    vector<string> v;
    stringstream ss(str);
    string buffer;
    while( getline(ss, buffer, sep) ) {
        v.push_back(buffer);
    }
    return v;
}
*/

/*
ll ncr[100][100];
ll nCr(int n, int r){if(n==r) ret ncr[n][r] = 1; if(r==0) ret ncr[n][r] = 1; if(r==1) ret ncr[n][r] = n;if(ncr[n][r]) ret ncr[n][r]; ret ncr[n][r] = nCr(n-1,r) + nCr(n-1,r-1);}

ll npr[100][100]={};
ll nPr(int n,int r){if(npr[n][r])ret npr[n][r];if(r==0)ret npr[n][r] = 1;if(r==1)ret npr[n][r] = n;ret npr[n][r] = n * nPr(n-1,r-1);}

ll nHr(int n,int r){ret nCr(n+r-1,r);}
*/

///////////////////////////////////////////////////////////////////////////



int main(){
    string s;
    cin >> s;

    if(s[0] != s[1] || s[1] != s[2])Yes;
    else No;
    return  0;
}


Measured memory_bytes: 256
import java.util.Scanner;
 
public class Main {
	public static void main(String[] args) {
      Scanner sc = new Scanner(System.in);
      int N =sc.nextInt();
      String S=sc.next();
      String T=sc.next();
      char[] a =S.toCharArray();
      char[] b =T.toCharArray();
      
      for(int i=0; i<N; i++){
      System.out.print(a[i]+""+b[i]);
      }
    }
}

Measured memory_bytes: 21844
import sys
input = sys.stdin.readline

def I(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))

def main():
    mod=10**9+7
    H,W=MI()
    N=I()
    a=LI()
    
    ans=[[0]*W for _ in range(H)]
    now=1
    for i in range(H):
        for jj in range(W):
            if i%2==1:
                j=W-1-jj
            else:
                j=jj
                

            if a[now-1]<=0:
                now+=1
            ans[i][j]=now
            a[now-1]-=1
            
    for i in range(H):
        print(' '.join(map(str, ans[i])))

            
            

main()


Measured memory_bytes: 40304
import java.util.*;
import java.io.*;
class Main{

	static int compute(int A[], int n)
	{
		return n;
	}
	public static void main(String[] args) throws IOException {
     Scanner sc=new Scanner(System.in);
      int n=sc.nextInt();
      System.out.println(n*n*n);
    }
}

Measured memory_bytes: 22740
#include<bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define ll long long
#define P pair<int,int>
#define PI 3.141592653589793
const int INF = 1001001001;
const ll MX = 1e18;
const int mod = 1000000007;
template<class T> inline bool chmax(T& a, T b) {
	if (a < b) {
		a = b;
		return true;
	}
	return false;
}

ll dp[105][100005];
ll v[105];
ll w[105];

int main() {
	ll n, W,V=0;
	cin >> n >> W;
	vector<ll> v(n), w(n);
	rep(i, n) {
		cin >> w[i] >> v[i];
		V += v[i];
	}
	rep(i, 105)rep(j, 100005) dp[i][j] = INF;
	dp[0][0] = 0;
	rep(i, n) {
		rep(j, V + 1) {
			if (j - v[i] >= 0) {
				dp[i + 1][j] = min(dp[i][j], dp[i][j - v[i]] + w[i]);
			}
			else {
				dp[i + 1][j] = min(dp[i][j], dp[i + 1][j]);
			}
		}
	}
	for (int i = V; i >= 0; i--) {
		if (dp[n][i] <= W) {
			cout << i << endl;
			return 0;
		}
	}
}
	

Measured memory_bytes: 85664
#include <iostream>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  int N, M, C;
  int B[20], A;
  cin >> N >> M >> C;
  for (int i=0; i<M; i++) {
    cin >> B[i];
  }
  int ret = 0;
  for (int i=0; i<N; i++) {
    int score = C;
    for (int j=0; j<M; j++) {
      cin >> A;
      score += A * B[j];
    }
    ret += (score > 0);
  }
  cout << ret << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
const int N = 305;
double dp[N][N][N];
int main()
{
    ios::sync_with_stdio(0);
    cin.tie(0);
    int n, a[4] = {};
    cin >> n;
    for (int i = 0; i < n; ++i) {
        int x;
        cin >> x;
        ++a[x];
    }
    dp[0][0][0] = 0;
    for (int s = 1; s <= n; ++s) 
        for (int i = s; i >= 0; --i)
            for (int j = s - i; j >= 0; --j) {
                int k = s - i - j;
                auto & d = dp[i][j][k];
                d = 0;
                if (i)
                    d += i * dp[i - 1][j][k];
                if (j)
                    d += j * dp[i + 1][j - 1][k];
                if (k)
                    d += k * dp[i][j + 1][k - 1];
                d += n;
                d /= s;
            }
    cout << fixed << setprecision(16) << dp[a[1]][a[2]][a[3]] << endl;
}


Measured memory_bytes: 219392
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <cmath>
#define rep(i, n) for(int i = 0; i < n; i++)
#define REP(i, m, n) for(int i = m; i < n; i++)
#define ALL(v) v.begin(),v.end()
#define INF 1e9
typedef long long ll;
using namespace std;

int main() {
    int n; cin >> n;
    vector<int> v(n);
    vector<int>ans;
    int maxnum=0;
    int max2 =0;
    rep(i,n){
        cin >> v[i];
        max2 = max(max2,v[i]);
        if(max2>=maxnum){
            swap(max2,maxnum);
        }
    }

    for(auto num: v){
        if(num==maxnum){
            cout << max2 << endl;
        }else{
            cout << maxnum << endl;
        }
    }



    return 0;
}

Measured memory_bytes: 2432
from itertools import accumulate
n = int(input())
mp = [list(map(int, input().split())) for _ in range(n)]
acc_arr = [list(accumulate([0] + line)) for line in mp]
ans = max([max(line) for line in mp])
for i in range(n + 1):
  for j in range(i + 1, n + 1):
    acc = 0
    for k in range(n):
      add = acc_arr[k][j] - acc_arr[k][i]
      if acc + add > 0:
        acc = acc + add
        ans = max(acc, ans)
      else:
        acc = 0
print(ans)


Measured memory_bytes: 6416
use std::io::*;
use std::str::FromStr;

fn read<T: FromStr>() -> T {
    let stdin = stdin();
    let stdin = stdin.lock();
    let token: String = stdin
        .bytes()
        .map(|c| c.expect("failed to read char") as char)
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect();

    token.parse().ok().expect("failed to parse token")
}

fn main() {
    let n: u32 = read();
    let s: String = read();
    let ans: Vec<&str> = s.matches("ABC").collect();

    println!("{}", ans.len());
}


Measured memory_bytes: 4352
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
ll a[55],sum,k,n;
void big(){
    ll mx=-1,pos=-1;
    for(ll i=1;i<=n;i++)if(a[i]>mx)mx=a[i],pos=i;
    ll val = mx/n;
    sum=0;
    for(ll i=1;i<=n;i++){
        a[i]+=(i==pos)?-n*val:val;
        sum+=a[i];
    }
    k+=val;
}
void small(){
    while(1){
        ll mx=-1,pos=-1;
        for(ll i=1;i<=n;i++)if(a[i]>mx)mx=a[i],pos=i;
        if(mx<n)return;
        for(ll i=1;i<=n;i++)a[i]+=(i==pos)?-n:1;
        k++;
    }
}
int main(){
    ios_base:: sync_with_stdio(false);
    cin.tie(NULL); cout.tie(NULL);
    cin>>n;
    for(ll i=1;i<=n;i++)cin>>a[i],sum+=a[i];
    while(sum>1e5)big();
    small();
    cout<<k;
}

Measured memory_bytes: 256
n, k = map(int, input().split())
p = list(map(int, input().split()))
s = max = sum(p[0 : k])
x = 0
for i in range(0, n - k):
    s = s - p[i] + p[i + k]
    if s > max:
        max = s
        x = i + 1
ans = 0
for i in range(x, x + k):
    ans += (p[i] + 1) / 2
print('{:.12f}'.format(ans))

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

using namespace std;

const int H = 1000 + 7;

#define mp make_pair
#define pb push_back
#define st first
#define nd second

typedef long long ll;
typedef vector<ll> vl;
typedef pair<int, int> ii;
typedef pair<ll,ll> pll;

int main() {
  int h, w;
  cin >> h >> w;
  string s[H];
  for(int i = 1; i <= h; ++i) {
    s[i] = ".";
  }
  for(int i = 1; i <= h; ++i) {
    string stemp;
    cin >> stemp;
    s[i] += stemp;
    s[i] += ".";
  }

  int ans = 0;
  queue<ii> q;
  while(!q.empty()) q.pop();
  queue<int> step;
  while(!step.empty()) step.pop();
  for(int i = 1; i <= h; ++i) {
    for(int j = 1; j <= w; ++j) {
      if(s[i][j] == '#') {
        q.push(ii(i, j));
        step.push(0);
      }
    }
  }
  int dy[] = {-1, 0, 1, 0};
  int dx[] = {0, 1, 0, -1};
  while(!q.empty()) {
    ii qf = q.front(); q.pop();
    int y = qf.first;
    int x = qf.second;
    int curstep = step.front(); step.pop();
    ans = max(curstep, ans);
    for(int i = 0; i < 4; ++i) {
      int ny = y + dy[i];
      int nx = x + dx[i];
      if(ny > 0 && nx > 0 && ny <= h && nx <= w && s[ny][nx] == '.') {
        s[ny][nx] = '#';
        q.push(ii(ny, nx));
        step.push(curstep + 1);
      }
    }
  }
  cout << ans << endl;
  return 0;
}
/*
 && ((i > 0 && s[i - 1][j] == '#') || (i < h - 1 && s[i + 1][j] == '#') || (j > 0 && s[i][j - 1] == '#') || (j < w - 1 && s[i][j + 1] == '#'))
*/


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

using ll = long long;
using pii = pair<int, int>;
template <class T>
using V = vector<T>;
template <class T>
using VV = V<V<T>>;

#define pb push_back
#define eb emplace_back
#define mp make_pair
#define fi first
#define se second
#define rep(i, n) rep2(i, 0, n)
#define rep2(i, m, n) for (int i = m; i < (n); i++)
#define ALL(c) (c).begin(), (c).end()

constexpr ll TEN(int n) { return (n == 0) ? 1 : 10 * TEN(n - 1); }

template <class T, class U>
void chmin(T& t, const U& u) {
    if (t > u) t = u;
}
template <class T, class U>
void chmax(T& t, const U& u) {
    if (t < u) t = u;
}

template <class T, class U>
ostream& operator<<(ostream& os, const pair<T, U>& p) {
    os << "(" << p.first << "," << p.second << ")";
    return os;
}

template <class T>
ostream& operator<<(ostream& os, const vector<T>& v) {
    os << "{";
    rep(i, v.size()) {
        if (i) os << ",";
        os << v[i];
    }
    os << "}";
    return os;
}

#ifdef LOCAL
void debug_out() { cerr << endl; }
template <typename Head, typename... Tail>
void debug_out(Head H, Tail... T) {
    cerr << " " << H;
    debug_out(T...);
}
#define debug(...) \
    cerr << __LINE__ << " [" << #__VA_ARGS__ << "]:", debug_out(__VA_ARGS__)
#define dump(x) cerr << __LINE__ << " " << #x << " = " << (x) << endl
#else
#define debug(...) (void(0))
#define dump(x) (void(0))
#endif

const int B = 3000;
ll dp[60][6000];

int main() {
    int N, A;
    cin >> N >> A;
    dp[0][B] = 1;
    rep(i, N) {
        int x;
        cin >> x;
        x -= A;
        rep(j, 6000) {
            if (!dp[i][j]) continue;
            dp[i + 1][j] += dp[i][j];
            dp[i + 1][j + x] += dp[i][j];
        }
    }
    ll ans = dp[N][B] - 1;
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 896
import java.awt.*;
import java.awt.geom.*;
import java.io.*;
 
import java.util.*;
class Main {
 
 
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        double r = sc.nextDouble();
 
        System.out.printf("%.6f %.6f",r*r*Math.PI,2 * Math.PI*r);
    }
}


Measured memory_bytes: 28304
import sys
from sys import exit
from collections import deque
from bisect import bisect_left, bisect_right, insort_left, insort_right
from heapq import heapify, heappop, heappush
from itertools import product, permutations, combinations, combinations_with_replacement
from functools import reduce
from math import gcd, sin, cos, tan, asin, acos, atan, degrees, radians

sys.setrecursionlimit(10**6)
INF = 10**20
eps = 1.0e-20
MOD = 10**9+7

def lcm(x,y):
    return x*y//gcd(x,y)
def lgcd(l):
    return reduce(gcd,l)
def llcm(l):
    return reduce(lcm,l)
def powmod(n,i,mod):
    return pow(n,mod-1+i,mod) if i<0 else pow(n,i,mod)
def div2(x):
    return x.bit_length()
def div10(x):
    return len(str(x))-(x==0)
def perm(n,mod=None):
    ans = 1
    for i in range(1,n+1):
        ans *= i
        if mod!=None:
            ans %= mod
    return ans
def intput():
    return int(input())
def mint():
    return map(int,input().split())
def lint():
    return list(map(int,input().split()))
def ilint():
    return int(input()), list(map(int,input().split()))
def judge(x, l=['Yes', 'No']):
    print(l[0] if x else l[1])
def lprint(l, sep='\n'):
    for x in l:
        print(x, end=sep)
def ston(c, c0='a'):
    return ord(c)-ord(c0)
def ntos(x, c0='a'):
    return chr(x+ord(c0))
class counter(dict):
    def __init__(self, *args):
        super().__init__(args)
    def add(self,x,d=1):
        self.setdefault(x,0)
        self[x] += d
    def list(self):
        l = []
        for k in self:
            l.extend([k]*self[k])
        return l
class comb():
    def __init__(self, n, mod=None):
        self.l = [1]
        self.n = n
        self.mod = mod
    def get(self,k):
        l,n,mod = self.l, self.n, self.mod
        k = n-k if k>n//2 else k
        while len(l)<=k:
            i = len(l)
            l.append(l[i-1]*(n+1-i)//i if mod==None else (l[i-1]*(n+1-i)*powmod(i,-1,mod))%mod)
        return l[k]
def pf(x):
    C = counter()
    p = 2
    while x>1:
        k = 0
        while x%p==0:
            x //= p
            k += 1
        if k>0:
            C.add(p,k)
        p = p+2-(p==2) if p*p<x else x
    return C

N,A=ilint()
A.sort()
tmp=0
ans=0
for i in range(N-1):
    if A[i+1]<=2*(tmp+A[i]):
        ans+=1
    else:
        ans=0
    tmp+=A[i]
print(ans+1)

Measured memory_bytes: 89752
#include <iostream>
#include <algorithm>
#include <vector>
#define rep(i,n) for(int i=0;i<n;++i)
#define rep1(i,n) for(int i=1;i<=n;++i)
using namespace std;
int main()
{
  int n,m;
  cin >> n >> m;
  int x = 100*(n-m) + 1900*m;
  cout << ((1<<m))*x << "\n";
  return 0;
}


Measured memory_bytes: 256
#include <cstdio>

int solve(int n, int r)
{
  if (n == 1) {
    if (r < 10) return 1;
    else return 0;
  } else {
    int a=0;
    for(int i=0;i<10&&r-i>=0;i++){
      a+=solve(n-1,r-i);
    }
    return a;
  }
}

int main()
{
  int n;
  while(~scanf("%d",&n)){
    printf("%d\n",solve(4,n));
  }
}

Measured memory_bytes: 0
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define repr(i, n) for (int i = (n); i >= 0; --i)
#define FOR(i, m, n) for (int i = (m); i < (n); ++i)
#define FORR(i, m, n) for (int i = (m); i >= (n); --i)
#define equals(a, b) (fabs((a) - (b)) < EPS)
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
const ll mod = 1000000007;
//const ll mod = 998244353;
const int inf = 1e9 + 10;
const ll INF = 1e18;
const ld EPS = 1e-10;
const int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1};
const int dy[8] = {0, 1, 0, -1, 1, 1, -1, -1};
template<class T> bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T> bool chmin(T &a, const T &b) { if (a>b) { a=b; return 1; } return 0; }



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

  string s;
  cin >> s;

  cout << s.substr(0, 3) << '\n';

  




  
  return 0;
}

Measured memory_bytes: 3612
#pragma GCC optimize("Ofast")

#include <bits/stdc++.h>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/assoc_container.hpp>
#include <random>

using namespace std;
using namespace __gnu_pbds;

typedef long long ll;

typedef
tree<ll, null_type, less<ll>, rb_tree_tag, tree_order_statistics_node_update> orderedSet;

#define pb push_back
#define F first
#define S second
#define all(a) (a).begin(), (a).end()

#define for1(i0, l0, r0) for (int i0 = l0; i0 < r0; ++i0)
#define for2(i0, l0, r0) for (int i0 = l0; i0 <= r0; ++i0)
#define forn(i0, n0) for (int i0 = 0; i0 < n0; ++i0)
#define forn1(i0, n0) for (int i0 = 1; i0 < n0; ++i0)
#define forr(i0, n0) for (int i0 = n0; i0 >= 0; --i0)
#define forr1(i0, r0, l0) for (int i0 = r0; i0 > l0; --i0)
#define forr2(i0, r0, l0) for (int i0 = r0; i0 >= l0; --i0)

#define Sort(a) sort(all(a))
#define Reverse(a) reverse(all(a))
#define relaxMax(a, b) a = max(a, b)
#define relaxMin(a, b) a = min(a, b)

typedef long double ld;
#define ui unsigned int
#define ull unsigned long long

typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<double, double> pdd;
typedef pair<string, string> pss;

typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<double> vd;
typedef vector<ld> vld;
typedef vector<bool> vb;
typedef vector<string> vs;

typedef vector<pii> vpii;
typedef vector<pll> vpll;
typedef vector<pdd> vpdd;

typedef vector<vi> vvi;
typedef vector<vd> vvd;
typedef vector<vll> vvll;
typedef vector<vb> vvb;

#define vpss vector<pss>
#define vvs vector<vs>
#define vvpii vector<vpii>
#define vvpll vector<vpll>
#define vpt vector<pt>
#define vvvi vector<vvi>
#define vsi vector<set<int>>
#define ss second
#define ff first

#define printvi(arr) for (int x0 : arr) cout << x0 << ' '; cout << '\n';
#define printvll(arr) for (ll x0 : arr) cout << x0 << ' '; cout << '\n';
#define printpair(pair0) cout << pair0.F << ' ' << pair0.S << '\n';
#define printvp(arr) for (auto pair0 : arr) printpair(pair0);
#define initArray(arr, N0, X0) memset(arr, X0, N0 * sizeof(int))
//mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

void init() {
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    //cout.precision(16);
    //freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);
}

void go(int a, int b, int c, int k){
    if (k == 0){
        if (a < b && b < c){
            cout << "Yes\n";
            exit(0);
        }
        return;
    }
    go(2 * a, b, c, k - 1);
    go(a, 2 * b, c, k - 1);
    go(a, b, 2 * c, k - 1);
}

void solve() {
    int a, b, c, k;
    cin >> a >> b >> c >> k;
    go(a, b, c, k);
    cout << "No\n";
}

bool multitest = false;

int main() {
    init();
    int t = 1;
    if (multitest) cin >> t;
    forn(i, t) solve();
}

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

#define M 1000000007
#define FOR(i, s, n) for (ll i = (s); i < (n); ++i)
#define FORALL(i, n) for (ll i = 0; i < (n); ++i)
#define MOD 1000000007
#define ff first
#define ss second
#define pll pair<long long, long long>
#define pii pair<int,int>
#define fast ios_base::sync_with_stdio(false)
#define countbits(x) __builtin_popcount(x)
#define pb(x) push_back((x))
#define vll vector<ll>
#define all(x) x.begin(),x.end()
#define print(x) cout << x << endl
#define debug print("reaching\n")
#define mll map<ll,ll>
#define lsb(i) i&(-i)
#define printv(x) \
	FORALL(i, x.size()) \
	{ \
		cout << x[i] << ' '; \
	} \
	cout << endl \
;
#define printm(m) \
	for(auto i: m){\
		cout<<i.ff<<' '<<i.ss<<endl; \
	}\
;

template <typename T>
T extGcd(T a, T b, T &x, T &y)
{
	if (b == 0)
	{
		x = 1;
		y = 0;
		return a;
	}
	else
	{
		int g = extGcd(b, a % b, y, x);
		y -= a / b * x;
		return g;
	}
}

template <typename T>
T modInv(T a, T m)
{
	T x, y;
	extGcd(a, m, x, y);
	return (x % m + m) % m;
}
// vector<map<ll,ll>> m(2);
long long binpow(long long a, long long b) {
    a %= MOD;
    long long res = 1;
    while (b > 0) {
        if (b & 1)
            res = res * a % MOD;
        a = a * a % MOD;
        b >>= 1;
    }
    return res;
}



bool com1(pll a, pll b){
	ll n = a.first + a.second;
	ll m = b.first + b.second;
	if(n == m) return 0;
	return n > m;
}
bool com2(pll a, pll b){
	ll n = -a.first + a.second;
	ll m = -b.first + b.second;
	if(n == m) return 0;
	return n > m;
}
bool com3(pll a, pll b){
	ll n = a.first - a.second;
	ll m = b.first - b.second;
	if(n == m) return 0;
	return n > m;
}
int main()
{
	fast;
	// cin.tie(0);
	// cout.tie(0);
	// #ifndef ONLINE_JUDGE
	// freopen("input.txt", "r", stdin);
	// freopen("output.txt", "w", stdout);
	// #endif

	int t=1;
	// cin>>t;
	ll tot=t;
	while(t--){
		ll n;
		cin>>n;
		vector<pll> v;
		FORALL(i,n){
			ll x,y;
			cin>>x>>y;
			v.push_back({x,y});
		}
		sort(all(v), com1);
		ll dist = abs(v[0].first - v[n-1].first) + abs(v[n-1].second - v[0].second);


		sort(all(v), com2);
		dist = max(dist, abs(v[0].first - v[n-1].first) + abs(v[n-1].second - v[0].second));
		sort(all(v), com3);
		dist = max(dist, abs(v[0].first - v[n-1].first) + abs(v[n-1].second - v[0].second));
		print(dist);
	}

	return 0;
}

Measured memory_bytes: 7488
s = list(range(1,1001)) + list(range(1001,0,-1))
while True:
    try:
        n = int(input())
    except:
        break

    ans = 0
    for i in range(min(n+1,2001)):
        if 0 <= n-i <= 2000:
            ans += s[i] * s[n-i]
    print(ans)


Measured memory_bytes: 5628
#include <iostream>
#include <string>

int main(void){
  
  std::string s;
  std::cin >> s;

  bool flag = true;
  for(int i=0; i<s.size(); i++){
    if(i%2==0 && s[i]=='L'){
      flag = false;
      break;
    }
    if(i%2==1 && s[i]=='R'){
      flag = false;
      break;
    }
  }

  std::cout << (flag ? "Yes" : "No") << std::endl;
  
  return 0;
}


Measured memory_bytes: 256
from fractions import gcd
from datetime import date, timedelta
from heapq import*
import math
from collections import defaultdict, Counter, deque
import sys
from bisect import *
import itertools
import copy
sys.setrecursionlimit(10 ** 7)
MOD = 10 ** 9 + 7


def modpow(a, n, mod):
    res = 1
    while n > 0:
        if n & 1:
            res = res * a % mod
        a = a * a % mod
        n >>= 1
    return res



def main():
    n = int(input())
    if n % 2 == 0:
        print((n - 1) // 2)
    else:
        print(n//2)

    
    

        
        
        
            

    
   


if __name__ == '__main__':
    main()


Measured memory_bytes: 68716
#include <stdio.h>
//>w^h
int main(void) {
	double w, h;
	int x, y;
	scanf("%lf%lf", &w, &h);
	scanf("%d%d", &x, &y);

	printf("%lf ", w * h / 2);
	if (x == w / 2 && y == h / 2)
		printf("1\n");
	else
		printf("0\n");
	return 0;
}

Measured memory_bytes: 128
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i,n) for( int i = 0; i < n; i++ )
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define INF 2000000000
#define mod 1000000007
#define INF2 1000000000000000000


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

    stringstream A;
    string S; 
    cin >> S;

    rep(i, 4) {
        A << S[i];
    }
    if (A.str() == "YAKI") cout << "Yes" << endl;
    else cout << "No" << endl;

    return 0;
}


Measured memory_bytes: 256
/**
 * Created by karayuu on 2020/04/26
 */

fun main(args: Array<String>) {
  val n = readLine()!!.toInt()
  val s = mutableListOf<String>()
  (1..n).forEach {
    s.add(readLine()!!)
  }

  println(s.toSet().size)
}


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

int main() {
	int n;
	cin >> n;
	vector<vector<int>>uvw(n-1, vector<int>(3,0));
	for (int i = 0; i < n-1; i++) {
		cin >> uvw.at(i).at(0) >> uvw.at(i).at(1) >> uvw.at(i).at(2);
		uvw.at(i).at(0)--;
		uvw.at(i).at(1)--;
	}
	vector<vector<vector<int>>>graph(n, vector<vector<int>>(0, vector<int>(2)));
	for (int i = 0; i < n - 1; i++) {
		int x, y, z;
		x = uvw.at(i).at(0);
		y = uvw.at(i).at(1);
		z = uvw.at(i).at(2);
		graph.at(x).push_back({ y,z });
		graph.at(y).push_back({ x,z });
	}
	vector<vector<int>>parent(n, vector<int>(2,-1));
	parent.at(0) = { 0,0 };
	queue<int>pq;
	pq.push(0);
	while (pq.size() > 0) {
		int x = pq.front();
		for (int i = 0; i < graph.at(x).size(); i++) {
			int y = graph.at(x).at(i).at(0);
			int z = graph.at(x).at(i).at(1);
			if (parent.at(y).at(0) == -1) {
				parent.at(y).at(0) = x;
				parent.at(y).at(1) = z;
				pq.push(y);
			}
		}
		pq.pop();
	}
	vector<int>dist(n,-1);
	dist.at(0) = 0;
	pq.push(0);
	while (pq.size() > 0) {
		int x = pq.front();
		for (int i = 0; i < graph.at(x).size(); i++) {
			int y = graph.at(x).at(i).at(0);
			if (dist.at(y) == -1) {
				dist.at(y) = dist.at(x) + graph.at(x).at(i).at(1);
				pq.push(y);
			}
		}
		pq.pop();
	}
	for (int i = 0; i < n; i++)cout << abs(dist.at(i))%2 << endl;
}

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

int main() {
    int h, w, a, b;
    cin >> h >> w >> a >> b;
    for (int i = 0; i < h; i++) {
        for (int j = 0; j < w; j++) {
            if ((i < b && j < a) || (i >= b && j >= a))
                cout << 0;
            else
                cout << 1;
        }
        cout << endl;
    }
    return 0;
}

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

using namespace std;

int main()
{
    int n,c=0,h;
    cin>>n>>h;
    int a[n];
    for(int i=0;i<n;i++)
    {
        cin>>a[i];
        if(a[i]>=h)
            c++;
    }
    cout<<c;
    return 0;
}


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

int maxn = 1e6 + 1;
vector<vector<int>> g(maxn);
vector<int> vl(maxn, -1);
void dfs(int v, int num) {
    vl[v] = num;
    for (auto to : g[v]) {
        if (vl[to] == -1) {
            dfs(to, num);
        }
    }
    return;
}

int w, h;
vector<pair<int, int>> d = {{0, 1}, {0, -1}, {1, 0}, {-1, 0}};
vector<string> mp(1e3);

bool check(int i, int j) {
    return (i >= 0 && i < h && j >= 0 && j < w && mp[i][j] == '.');
}


int32_t main() {
    // ios_base::sync_with_stdio(false);
    // cin.tie(0);
    // cout.tie(0);
    cin >> h >> w;
    int c1, c2; cin >> c1 >> c2; c1--; c2--;
    int d1, d2; cin >> d1 >> d2; d1--; d2--;
    for (int i = 0; i < h; i++) {
        cin >> mp[i];
    }
    for (int i = 0; i < h; i++) {
        for (int j = 0; j < w; j++) {
            if (mp[i][j] == '#') continue;
            for (auto el : d) {
                int ni = i + el.first, nj = j + el.second;
                if (check(ni, nj)) {
                    int u = i * w + j, v = ni * w + nj;
                    g[u].push_back(v);
                }
            }
        }
    }
    int cnt = 0;
    for (int i = 0; i < h; i++) {
        for (int j = 0; j < w; j++) {
            if (mp[i][j] == '#') continue;
            int v = i * w + j;
            if (vl[v] == -1) {
                dfs(v, cnt); cnt++;
            }
        }
    }
    vector<vector<int>> ng(cnt);
    vector<int> dist(cnt, -1);
    for (int i = 0; i < h; i++) {
        for (int j = 0; j < w; j++) {
            if (mp[i][j] == '#') continue;
            for (int ni = i - 2; ni <= i + 2; ni++) {
                for (int nj = j - 2; nj <= j + 2; nj++) {
                    if (check(ni, nj)) {
                        if (vl[i * w + j] != vl[ni * w + nj])
                            ng[vl[i * w + j]].push_back(vl[ni * w + nj]);
                    }
                }
            }
        }
    }
    queue<int> q;
    int start = vl[c1 * w + c2], finish = vl[d1 * w + d2];
    q.push(start); dist[start] = 0;
    while (!q.empty()) {
        int st = q.front();
        q.pop();
        for (auto el : ng[st]) {
            if (dist[el] == -1) {
                dist[el] = dist[st] + 1;
                q.push(el);
            }
        }
    }
    cout << dist[finish] << endl;


    return 0;
}


Measured memory_bytes: 77704
/*
author: madhav_1999 aka orthodoxparadox
22 March 2020 at 5:27 PM
*/

#include <bits/stdc++.h>
#include <ext/pb_ds/detail/standard_policies.hpp>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;

#define dbl long double
#define int ll
#define ll long long
#define pii pair<int, int>
#define len(x) (int) x.size()
#define rev(a) reverse(all(a))
#define oiint ostream_iterator<int>(cout, " ") 
#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define endl '\n'
#define all(a) a.begin(), a.end()
#define initialise(a, x) memset(a, x, sizeof(a))
#define onlyunique(v) v.erase(unique(all(v)), v.end()); //only for sorted vector
#define inf 2e18
#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize ("O3")
#pragma GCC optimize ("unroll-loops")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#define _CRT_SECURE_NO_WARNINGS
#ifdef MADHAV
#define dbg(...) __f(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1>
void __f(const char* name, Arg1&& arg1){cerr << name << " : " << arg1 << endl;}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args){
	const char* comma = strchr(names + 1, ',');
	cerr.write(names, comma - names) << " : " << arg1 << "  ";
	__f(comma + 1, args...);}
#else
#define dbg(...) 42
#endif
template <typename X> ostream& operator << (ostream& x,const vector<X>& v){for(int i=0;i<v.size();++i) x<<v[i]<<" ";return x;} 
template <typename X> ostream& operator << (ostream& x,const set<X>& v){for(auto it:v) x<<it<<" ";return x;} 
template <typename X, typename Y> ostream& operator << (ostream& x, const pair<X,Y>& v) {x<<v.ff<<" "<<v.ss;return x;} 
template <typename T, typename S> ostream& operator << (ostream& os, const map<T, S>& v) { for (auto it : v) os << it.first << "=>" << it.second << endl; return os; }
typedef tree <int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;
mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());
struct pair_hash {inline std::size_t operator()(const std::pair<int, int> & v) const {return v.first*31+v.second;}};
const int MOD = 1e9 + 7;

int takemod(int a, int mod = MOD){a%=mod;if(a<0)a+=mod;return a;}

int fast_exp(int base, int expo, int mod = MOD) {
	int res=1;
	while(expo>0) {
		if(expo&1) res=(res*base)%mod;
		base=(base*base)%mod;
		expo>>=1;}
	return res;}

int modinv(int a, int mod = MOD){return takemod(fast_exp(takemod(a), mod-2, mod), mod);}


void solve()
{
	int n, m;
	cin >> n >> m;
	int ans = (n * (n - 1))/2 + (m * (m - 1))/2;
	cout << ans;
}

signed main(){
	ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
	#ifdef MADHAV
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
	freopen("error.txt", "w", stderr);
	#endif
	clock_t t1, t2;
	t1 = clock();

	int tt = 1;
	// cin >> tt;
	while(tt--)
	{
		solve();
	}
	#ifdef MADHAV
	t2 = clock(); cerr << "time taken: " << (t2-t1)/(dbl)CLOCKS_PER_SEC;
	#endif
	return 0;
}

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

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

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef pair<int,int> P;
typedef long long ll;
ll gcd(ll a, ll b){
    if(b == 0) return a;
    return gcd(b,a%b);
}

int main() {
	int H,W;
	cin >> H >> W;
	vector<vector<char>> data(H+2, vector<char>(W+2));
	for(int i = 1;i<=H;i++){
		for(int j = 1;j<=W;j++){
			cin >> data[i][j];
		}
	}
	int c = 0;//爆弾の個数

	for(int i = 1;i<=H;i++){
	  for(int j = 1;j<=W;j++){
			c = 0;
        if(data[i][j] == '.'){
		 for(int x =i-1;x<=i+1;x++){
		   for(int y =j-1;y<=j+1;y++){
             if(data[x][y] == '#') c++;
			}
		 }
	     data[i][j] = to_string(c)[0];
        }
  	  }
	}

	for(int i = 1;i<=H;i++){
		for(int j = 1;j<=W;j++){
			if(j<W) cout << data[i][j];
			if(j == W) cout <<data[i][j] <<  endl;
		}
	}
}

Measured memory_bytes: 256
import java.util.*;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		while (true) {
			int n = sc.nextInt();
			if (n == 0)
				break;
			Line[] lines = new Line[n + 1];
			for (int i = 0; i < n + 1; i++) {
				int m = sc.nextInt();
				lines[i] = new Line(i, m);
				for (int j = 0; j < m; j++) {
					lines[i].x[j] = sc.nextInt();
					lines[i].y[j] = sc.nextInt();
				}
				if (i == 0)
					lines[0].moveCenter();
				else
					lines[i].checkline(lines[0]);
			}
			System.out.println("+++++");
		}
		sc.close();
	}
}

class Line {
	int id;
	int m;
	int[] x;
	int[] y;

	Line(int i, int m) {
		id = i;
		this.m = m;
		x = new int[m];
		y = new int[m];
	}

	void checkline(Line anotherline) {
		moveCenter();
		for (int i = 0; i < 4; i++) {
			turn();
			if (check(anotherline)) {
				System.out.println(id);
				return;
			}
		}
		reverse();
		moveCenter();
		for (int i = 0; i < 4; i++) {
			turn();
			if (check(anotherline)) {
				System.out.println(id);
				return;
			}
		}
	}

	void reverse() {
		int[] tx = new int[m];
		int[] ty = new int[m];
		for (int i = 0; i < m; i++) {
			tx[i] = x[i];
			ty[i] = y[i];
		}
		for (int i = 0; i < m; i++) {
			x[i] = tx[m - 1 - i];
			y[i] = ty[m - 1 - i];
		}
	}

	void turn() {
		for (int i = 0; i < m; i++) {
			int t = x[i];
			x[i] = -y[i];
			y[i] = t;
		}
	}

	void moveCenter() {
		for (int i = 0; i < m; i++) {
			x[i] -= x[m - 1];
			y[i] -= y[m - 1];
		}
	}

	boolean check(Line anotherline) {
		boolean b = this.m == anotherline.m;
		if (b)
			for (int i = 0; i < this.m; i++)
				b = b && (this.x[i] == anotherline.x[i])
						&& (this.y[i] == anotherline.y[i]);
		return b;
	}
}

Measured memory_bytes: 29264
function koch(n,ax,ay,bx,by){
    if(n===0) return false;
    
    const sx = (ax*2+bx)/3;
    const sy = (ay*2+by)/3;
    const tx = (bx*2+ax)/3;
    const ty = (by*2+ay)/3;
    const ux = (tx-sx)*Math.cos(Math.PI/3)-(ty-sy)*Math.sin(Math.PI/3) + sx;
    const uy = (tx-sx)*Math.sin(Math.PI/3) + (ty-sy)*Math.cos(Math.PI/3) +sy;
    
    koch(n-1,ax,ay,sx,sy);
    console.log(sx+" "+sy);
    koch(n-1,sx,sy,ux,uy);
    console.log(ux+" "+uy);
    koch(n-1,ux,uy,tx,ty);
    console.log(tx+" "+ty);
    koch(n-1,tx,ty,bx,by);
}
let num = parseInt(require("fs").readFileSync("/dev/stdin","utf-8").trim());
console.log(0,0);
koch(num,0,0,100,0);
console.log(100,0);


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

int main()
{
    int a,b,c,d;
    cin>>a>>b>>c>>d;
    if(abs(a-c)<=d)cout<<"Yes"<<endl;
    else
    {
        if(abs(a-b)>d)cout<<"No"<<endl;
        else{
            if(abs(b-c)>d)cout<<"No"<<endl;
            else
                cout<<"Yes"<<endl;
        }
    }
    //cout << "Hello world!" << endl;
    return 0;
}


Measured memory_bytes: 256
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int K = sc.nextInt();
        int X = sc.nextInt();
        
        int s = X-(K-1);
        int e = X+(K-1);
        if (K==1) {
            System.out.println(X);
        } else {
            for (int i=s; i<=e; i++) {
                System.out.println(i);
            }
        }
    }
}

Measured memory_bytes: 21332
#include <bits/stdc++.h>
using namespace std;
int main(){
    int n,sum=0;
    cin >> n;
    vector<int> a(n);
    for(int i=0;i<n;i++){
        cin >> a.at(i);
    }
    sort(a.begin(),a.end());
    reverse(a.begin(),a.end());
    for(int i=0;i<n;i++){
        if(i%2){
            sum-=a.at(i);
        }else{
            sum+=a.at(i);
        }
    }
    cout << sum << endl;
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <map>
#include <cmath>
#include <queue>
#include <numeric>
#include <climits>
#include <iterator>
#include <iomanip>
#include <stack>
#include <set>
#include <cstdio>
#include <bitset>
#include <functional>
#include <tuple>
#include <list>
#include <deque>
#include <sstream>
using namespace std;
const constexpr int INF = 1e9;
#define FOR(i, a, n) for (ll i = (ll)a; i<(ll)n; ++i)
#define REP(i, n) FOR(i, 0, n)

typedef long long ll;
typedef vector<int> VI;
const constexpr ll MOD = 1e9+7;
struct Less{
   bool operator()(const pair<string, int>&a, const pair<string, int>&b){
        if(a.first==b.first){
            return a.second < b.second;
        }
       return a.first < b.first;
    }
};

ll extGCD(ll a, ll b, ll& x, ll& y){
    if(b==0){
        x=1;
        y=0;
        return a;
    }
    ll d = extGCD(b, a%b, y, x);
    y -= a/b*x;
    return d;
}
ll GCD(ll a, ll b){
    if(a<b) swap(a, b);
    if(b==0) return a;
    return GCD(b, a%b);
}
int par[100010], rr[100010];
void init(){
    for(int i=0; i<100010; ++i){
        par[i]=i;
        rr[i]=0;
    }
}
int root(int x){
    return par[x] == x ? x:par[x] = root(par[x]);
}
bool same(int x, int y){
    return root(x)==root(y);
}
void unite(int x, int y){
    x = root(x);
    y = root(y);
    if(x==y) return ;
    
    if(rr[x]<rr[y]){
        par[x] = y;
    }else{
        par[y] = x;
        if(rr[x]==rr[y]) rr[x]++;
    }
}

ll pow_mod(ll x, ll n){
    ll res = 1;
    while(n>0){
        if(n&1){
            res = res*x%MOD;
        }
        x = x*x%MOD;
        n>>=1;
    }
    return res;
}
int main() {
    ll N, M; cin >> N >> M;
    string S, T; cin >> S >> T;
    
    ll g = GCD(N, M);
    ll ans = N*M/g;
    bool flag = true;
    if(N%M==0||M%N==0){
        if(N>M){
          for(int i=0; i<M; ++i){
                if(T[i]!=S[i*ans/M]) flag = false;
          }
        }else{
          for(int i=0; i<N; ++i){
              if(S[i]!=T[i*ans/N]) flag = false;
            }
    }   
    }else{
        ll s = ans/N; // 3
        ll t = ans/M; // 5 s*tで一致が起こる
            for(int i=0; i*t<N&&i*s<M; i++){
            if(S[i*t]!=T[i*s]) flag = false;
                if(!flag) break;
            }
    }
    if(flag) cout << ans << endl;
    else cout << -1 << endl;
    return 0;
}

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

// int/long:		-2147483648 - 2147483648 (-2^31 <= int < 2^31)
// long/long long:	-9223372036854775808 - 9223372036854775807 (-2^63 <= long < 2^63)
#define	INF (1<<29)
//536870912

#define	MOD 1000000007

int	main() {
	long N;
	cin >>N;
	long S=0;
	for (long i=1; i<sqrt(N); i++) {
		if (0==N%i) {
			long m=N/i;
			m--;
			if (m>i)
				S+=m;
		}
	}
	cout <<S <<endl;
	return 0;
}



Measured memory_bytes: 256
import heapq
def dijkstra(adj, start, goal=None):
    num = len(adj)          # グラフのノード数
    dist = [float('inf') for i in range(num)]  # 始点から各頂点までの最短距離を格納する
    #prev = [None for i in range(num)]  # 最短経路における，その頂点の前の頂点のIDを格納する
    dist[start] = 0
    # プライオリティキュー．各要素は，(startからある頂点vまでの仮の距離, 頂点vのID)からなるタプル
    q = []
    heapq.heappush(q, (0, start))  # 始点をpush
    while q:
        prov_cost, src = heapq.heappop(q)  # pop
        # プライオリティキューに格納されている最短距離が，現在計算できている最短距離より大きければ，distの更新をする必要はない
        #if dist[src] < prov_cost:
            #continue
        # 他の頂点の探索
        for dest in range(num):
            cost = adj[src][dest]
            if cost != float('inf') and dist[dest] > dist[src] + cost:
                dist[dest] = dist[src] + cost  # distの更新
                # キューに新たな仮の距離の情報をpush
                heapq.heappush(q, (dist[dest], dest))
                #prev[dest] = src                      # 前の頂点を記録
    return dist
n, m = map(int, input().split())
mat = [[float('inf')] * n for _ in range(n)]
for i in range(m):
    a, b, c = map(int, input().split())
    mat[a - 1][b - 1] = c
    mat[b - 1][a - 1] = c
for i in range(n):
    mat[i][i] = 0
mat2 = []
for i in range(n):
    mat2.append(dijkstra(mat, i))
ans = 0
for i in range(n):
    for j in range(i, n):
        if mat[i][j] != float('inf') and mat[i][j] != mat2[i][j]:
            ans += 1
print(ans)
'''input
3 3
1 2 1
1 3 1
2 3 3
'''

Measured memory_bytes: 3568
using System;
using System.Linq;//リストの使用
using System.Collections.Generic;
using System.Text;//テキストの高速出力に必要
class Program
{
	static void Main()
	{
		int n = int.Parse(Console.ReadLine());
		long[] nums = new long[n];
    for(int i = 0; i < n; i++) nums[i] = long.Parse(Console.ReadLine());
    long answer = nums[0]-1;
    long lastNum = 1;

    for(int i = 1; i < n; i++)
    {
      if(nums[i] == lastNum+1) lastNum++;
      else if(nums[i] > lastNum+1)
      {
        answer++;
        answer += (nums[i]-lastNum-2)/(lastNum+1);
      }
    }

		Console.WriteLine(answer);
	}
}

Measured memory_bytes: 17336
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
//template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
 
/* attention
    long longのシフト演算には気をつけよう
    タイポした時のデバッグが死ぬほどきつくなるので変数名は最低3字くらい使った方がいいかも
    sizeは(int)とキャストしよう
    ごちゃごちゃ場合分けを考える前に全探索は考えましたか？
*/


const ll inf = 1LL<<59;

int N;
vector<vector<ll>> d(110, vector<ll>(110, inf));

void floyd(){
    for(int k=0; k<N; ++k){
        for(int i=0; i<N; ++i){
            if(d[i][k] == inf) continue;
            for(int j=0; j<N; ++j){
                if(d[k][j] == inf) continue;

                chmin(d[i][j], d[i][k]+d[k][j]);
            }
        }
    }
}

int main(){
    int M; cin >> N >> M;
    vector<int> a(M), b(M), c(M);

    for(int i=0; i<M; ++i){
        cin >> a[i] >> b[i] >> c[i];
        --a[i]; --b[i];
        d[a[i]][b[i]] = d[b[i]][a[i]] = c[i];
    }

    for(int i=0; i<N; ++i) d[i][i] = 0;
    floyd();

    int ans = 0;
    for(int i=0; i<M; ++i){
        bool flg = false;
        for(int s=0; s<N; ++s){
            for(int t=0; t<N; ++t){
                if(d[s][t] == d[s][a[i]]+c[i]+d[b[i]][t]) flg = true;
            }
        }
        if(!flg) ++ans;
    }

    cout << ans << endl;
}

Measured memory_bytes: 384
s = list(input())
k = int(input())
subs = []
for i in range(min(k,len(s))):
  for j in range(len(s)-i):
    subs.append(''.join(s[j:j+i+1]))
subs = list(set(subs))
subs.sort()
#print(subs)
print(subs[k-1])

Measured memory_bytes: 5084
//Caracal vs Monster

#include<bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i,x,y) for(int i=x;i<y;i++)
#define gcd(a,b) __gcd(a,b)
#define lcm(a,b) a / __gcd(a, b) * b
#define range(a) (a).begin(),(a).end()
const int inf = 2147483647;

int main (){
    ll H;cin >> H;
    ll Ans=0,i=0;
    for(i=0;H!=0;i++){
        H/=2;
        Ans += pow(2,i);
    }
    cout << Ans << endl;
    return 0;
}

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

typedef pair<int,int> pii;
typedef long long ll;
typedef vector<int> vi;

#define rep(i,j) for(int i=0;i<(j);i++)
#define reps(i,j,k) for(int i=j;i<=k;i++)
#define in(i,j,k) ((i)>=(j)&&(i)<=(k))
#define INF (1<<28)
#define pb(i) push_back(i)
#define fs first
#define sc second

const char dx[]={0,1,0,-1},dy[]={1,0,-1,0};

ll dp[51][51][2501];

int main(){
	int n,a;
	cin >> n >> a;
	vector<ll> v(n);
	rep(i,n)cin >> v[i];
//	rep(i,n) cout << v[i] <<endl;
	dp[0][0][0] = 1;
	reps(i,1,n){
		rep(j,i){
			rep(k,50*n){
					dp[i][j][k] += dp[i-1][j][k];
					if(k+v[i-1]<2501) dp[i][j+1][k+v[i-1]] += dp[i-1][j][k];
			}
		}
	}
	ll cnt = 0;
	reps(j,1,n){
		cnt += dp[n][j][a*j];
	}
	cout << cnt << endl;
	return 0;
}


Measured memory_bytes: 26368
N,M = map(int, input().split())
mNum=0
MNum=10**10
for i in range(M):
    tm,tM = map(int, input().split())
    if(mNum<tm):
        mNum=tm
    if(MNum>tM):
        MNum=tM
print(max(MNum-mNum+1,0))

Measured memory_bytes: 3060