akhauriyash/Code-Regression huggingface dataset:
#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <unordered_map>
#include <unordered_set>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <typeinfo>
#include <utility>
#include <valarray>
#include <vector>
#define _GLIBCXX_DEBUG
#define INF 100000010
using namespace std;
const int mod = 1000000007;


int main(){
 
  int64_t a,b,N;
  cin>>a>>b>>N;
  if(b>N){
    cout<<floor((a*N)/b)<<endl;
  }
  else cout<<floor((a*(b-1))/b)<<endl;
}


Measured memory_bytes: 3752
#include <bits/stdc++.h>
using namespace std;
int east[400100];
int west[400100];
vector<int> looking;
char strings[400100];

int main() {
	int n; 
	char dir;

	cin >> n;

	for(int i = 0; i < n; i++) {
		cin >> dir;
		strings[i] = dir;
		
		if(dir == 'E') east[i+1] = east[i] + 1;
		else east[i+1] = east[i];
	}

	for(int i = n - 1; i >=0 ; i--) {
		
		if(strings[i] == 'W') west[i-1] = west[i] + 1;
		else west[i-1] = west[i];
	}

	for(int i = 0; i < n; i++) {
		looking.push_back(east[i] + west[i]);
	}

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

	cout << n - (looking[n-1]) - 1 << endl;
}

Measured memory_bytes: 5108
#include<iostream>
using namespace std;
int main() {
   int m, n, x, y;
   cin >> n >> m;
   int a[n][m] = {};
   int c[n]={};
   for (int i=0; i<n; i++) {
       for (int j=0; j<m; j++) {
           cin >> x;
           a[i][j] = x;
       }
   }
   for (int k=0; k<m; k++) {
       cin >> y;
       for (int l=0; l<n; l++) {
           a[l][k] = a[l][k] * y;
       }
   }

   for (int o=0; o<n; o++) {
       for (int p=0; p<m; p++) {
           c[o] += a[o][p];
       }
       cout << c[o] << endl;
   }
   return 0;
}


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

int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    string S;
    cin >> S;
    if (S == "AAA" || S == "BBB")
    {
        cout << "No" << endl;
    }
    else
    {
        cout << "Yes" << endl;
    }
    return 0;
}

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

int main() {
    int a, b;
    cin >> a >> b;
    int fail_count = 0;
    for (int i = a; i <= b; i++)
    {
        string s;
        s = to_string(i);
        int head = 0, tail = s.size() - 1;
        while (head <= tail)
        {
            if (s[head++] != s[tail--])
            {
                fail_count++;
                break;
            }
        }
    }
    cout << (b - a + 1) - fail_count << endl;
}

Measured memory_bytes: 256
/*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
Code author: Saurabh Singhal
Code copy karne vaale tera muh kaala
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/

#include<bits/stdc++.h>
#define mp(a,b) make_pair(a,b)
#define pb push_back
#define ppb pop_back

using namespace std;
typedef long long int ll;
typedef vector<int> vi_t;
typedef vector<ll> vll_t;
int t=1;
vll_t a,b;
int  main(){
	// #ifndef ONLINE_JUDGE
 //    // for getting input from input.txt
 //    freopen("input.txt", "r", stdin);
 //    // for writing output to output.txt
 //    freopen("output.txt", "w", stdout);
	// #endif
	ll n;
	cin>>n;
	vector<int>v(n);
	for(int i=0;i<n;i++){
		cin>>v[i];
	}
	sort(v.begin(),v.end());
	cout<<v[n/2]-v[(n-1)/2]<<endl;
}

Measured memory_bytes: 640
#!usr/bin/env python3
from collections import defaultdict, deque, Counter, OrderedDict
from functools import reduce, lru_cache
import collections, heapq, itertools, bisect
import math, fractions
import sys, copy

def L(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline().rstrip())
def S(): return list(sys.stdin.readline().rstrip())
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI1(): return [int(x) - 1 for x in sys.stdin.readline().split()]
def LS(): return [list(x) for x in sys.stdin.readline().split()]
def IR(n): return [I() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def LIR1(n): return [LI1() for _ in range(n)]
def SR(n): return [S() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
def LR(n): return [L() for _ in range(n)]

sys.setrecursionlimit(1000000)
dire = [[1, 0], [0, 1], [-1, 0], [0, -1]]
dire8 = [[1, 0], [1, 1], [0, 1], [-1, 1], [-1, 0], [-1, -1], [0, -1], [1, -1]]
MOD = 1000000007

def main():
    s = S()
    q = I()
    Q = LR(q)

    turned = False
    q = deque()
    for c in s:
        q.append(c)

    for query in Q:
        if query[0] == "1":
            turned = not turned
        else:
            _, f, c = query
            if (not turned and f == "1") or (turned and f == "2"):
                q.appendleft(c)
            else:
                q.append(c)


    if turned:
        q.reverse()
    ans = "".join(q)
    print(ans)


if __name__ == '__main__':
    main()

Measured memory_bytes: 143360
a, b, c, d = map(int, input().split())

if a < 0 and b < 0 and c < 0 and d < 0:
    print(a * c)
if a < 0 and b < 0 and c < 0 and d > 0:
    print(a * c)
if a < 0 and b < 0 and c > 0 and d > 0:
    print(b * c)

if a < 0 and b > 0 and c < 0 and d < 0:
    print(a * c)
if a < 0 and b > 0 and c < 0 and d > 0:
    print(max(a*c, b*d))
if a < 0 and b > 0 and c > 0 and d > 0:
    print(b * d)

if a > 0 and b > 0 and c < 0 and d < 0:
    print(a * d)
if a > 0 and b > 0 and c < 0 and d > 0:
    print(b * d)
if a > 0 and b > 0 and c > 0 and d > 0:
    print(b * d)

if a == 0:
    if c <= 0 and d <= 0:
        print(0)
    if c <= 0 and d > 0:
        print(b*d)
    if c > 0 and d > 0:
        print(b*d)
elif b == 0:
    if c <= 0 and d <= 0:
        print(a * c)
    if c <= 0 and d > 0:
        print(a * c)
    if c > 0 and d > 0:
        print(0)
elif c == 0:
    if a <= 0 and b <= 0:
        print(0)
    if a <= 0 and b > 0:
        print(d * b)
    if a > 0 and b > 0:
        print(d * b)
elif d == 0:
    if a <= 0 and b <= 0:
        print(a * c)
    if a <= 0 and b > 0:
        print(a * c)
    if a > 0 and b > 0:
        print(0)


Measured memory_bytes: 9328
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

public class MainClass
{
	public static void Main(string[] args)
	{
		int n = int.Parse(Console.ReadLine());
		string[] input = Console.ReadLine().Split(' ');
		
		int back = 0;
		int mieru=0;
		int min = 0;
		for(int i = 0; i < n; i++)
		{
			int h = int.Parse(input[i]);
			if(h>=back&&h>=min)mieru++;
			min = Math.Max(min,h);
		}
		Console.WriteLine(mieru);
	}

	public static int Clamp(int val, int max, int min = 0)
	{
		return Math.Min(max, Math.Max(min, val));
	}


}

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

const int N=2e5+5;
char s[N],st[N];

int main()
{
	//freopen("1.in","r",stdin);
	scanf("%s",s+1);
	int top=0;
	for(char *i=s+1;*i;++i)
	{
		if(st[top]=='S'&&*i=='T')--top;
		else st[++top]=*i;
	}
	printf("%d\n",top);
}

Measured memory_bytes: 640
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

#define ll              long long
#define pb              push_back
#define ppb             pop_back
#define endl            '\n'
#define mii             map<ll,ll>
#define pii             pair<ll,ll>
#define vi              vector<ll>
#define vs              vector<string>
#define all(a)          (a).begin(),(a).end()
#define F               first
#define S               second
#define sz(x)           (ll)x.size()
#define hell            1000000007
#define inf             (ll)1e18 + 5
#define PI              (double)3.14159265358979323844
#define DECIMAL(n)      cout << fixed << setprecision(n);
#define rep(i,a,b)      for (ll i=a;i<b;i++)
#define repr(i,a,b)     for (ll i=a-1;i>=b;i--)
#define bitcount(a)     (ll)__builtin_popcount(a)
#define lbnd            lower_bound
#define ubnd            upper_bound
#define mp              make_pair
#define ios             ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define ordered_set     tree<ll, null_type,less<ll>, rb_tree_tag,tree_order_statistics_node_update>
#define trace(...)      __f(#__VA_ARGS__, __VA_ARGS__)

template <typename Arg1>
void __f(const char* name, Arg1&& arg1){
    std::cerr << name << " : " << arg1 << endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args){
    const char* comma = strchr(names + 1, ',');std::cerr.write(names, comma - names) << " : " << arg1<<" | ";__f(comma+1, args...);
}

using namespace std;
using namespace __gnu_pbds;

/*----------------------Graph Moves----------------*/
//const int fx[]={+1,-1,+0,+0};
//const int fy[]={+0,+0,+1,-1};
//const int fx[]={+0,+0,+1,-1,-1,+1,-1,+1};   // Kings Move
//const int fy[]={-1,+1,+0,+0,+1,+1,-1,-1};  // Kings Move
//const int fx[]={-2, -2, -1, -1,  1,  1,  2,  2};  // Knights Move
//const int fy[]={-1,  1, -2,  2, -2,  2, -1,  1}; // Knights Move
/*------------------------------------------------*/

//primes for hashing 937,991,1013,1409,1741

void solve() {
    ll a,b,n;
    cin>>a>>b>>n;

    cout<<( ( a*min(n,b-1) )/b )<<endl;
}

signed main() {
    ios
    ll test=1;
    //cin>>test;
    while (test--) solve();
    return 0;
}

Measured memory_bytes: 3648
#include <iostream>
#include <cmath>
#include <algorithm>
#include <string> //文字列
#include <iomanip> //doubleの桁数指定
#include <list> //前後に数値を入れれる配列



#define REP(i,m,n) for(int i = (int) (m);i < (int) (n);i++) //forの短縮
#define rep(i,n) REP(i,0,n) //REPが0の時
#define ll long long int

using namespace std;

double PI = 3.141592653589793; //円周率

//常設関数↓

//最大公約数
ll gcd(ll a, ll b) {
	if (b == 0) return a;
	return gcd(b, a % b);
}

//最小公倍数
ll lcm(ll a, ll b) {
	return a * b / gcd(a, b);
}

//degree → radian
ll chg_DegRad(int deg) {
	return deg * PI / 180.0;
}

//radian → degree
ll chg_RadDeg(int rad) {
	return rad * 180.0 / PI;
}

//提出コード↓

ll n, m;
ll x[1010], y[1010], z[1010];
ll a[8][1010];
ll ans;


int main() {
	cin >> n >> m;
	rep(i, n) cin >> x[i] >> y[i] >> z[i];

	rep(i, n) {
		a[0][i] = x[i] + y[i] + z[i];
		a[1][i] = x[i] + y[i] + -z[i];
		a[2][i] = x[i] + -y[i] + z[i];
		a[3][i] = x[i] + -y[i] + -z[i];
		a[4][i] = -x[i] + y[i] + z[i];
		a[5][i] = -x[i] + y[i] + -z[i];
		a[6][i] = -x[i] + -y[i] + z[i];
		a[7][i] = -x[i] + -y[i] + -z[i];
	}
	rep(i, 8) {
		sort(a[i], a[i] + n);
		reverse(a[i], a[i] + n);
	}
	rep(i, 8) {
		ll ret = 0;
		rep(j, m) {
			ret += a[i][j];
		}
		ans = max(ans, ret);
	}
	cout << ans << endl;
	



	




	return 0;
}



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

#define vec                vector<int>
#define vecll              vector<ll>
#define vecst              vector<string>
#define vecb               vector<bool>
#define vec2(var, n, m)    vector<vector<int>> var(n, vector<int>(m, 0))
#define vecll2(var, n, m)  vector<vector<ll>> var(n, vector<ll>(m, 0))

#define rep(i,n)         for(ll i=(ll)0; i<(ll)n; i++)
#define REP(i,m,n)       for(ll i=(ll)m; i<(ll)n; i++)
#define arr(var, n)      vec var(n); rep(i,n){cin >> var[i];}
#define arrll(var, n)    vecll var(n); rep(i,n){cin >> var[i];}
#define arrst(var, n)    vecst var(n); rep(i,n){cin >> var[i];}
#define all(var)         (var).begin(), (var).end()
#define sortall(var)     sort(all(var))
#define uniqueall(v)     v.erase(unique(v.begin(), v.end()), v.end());
#define f_sum(var)       accumulate(all(var), 0)
#define f_sumll(var)     accumulate(all(var), 0LL)
#define chmin(v1, v2)    v1 = min(v1, v2)
#define chmax(v1, v2)    v1 = max(v1, v2)
#define mp(v1, v2)       make_pair(v1, v2)
#define pb(var)          push_back(var)
#define prt(var)         cout << (var) << "\n"
#define prtd(n, var)     cout << fixed << setprecision(n) << var << "\n"
#define prtfill(n, var)  cout << setw(n) << setfill('0') << var;
#define prt2(v1, v2)     cout << v1 << " " << v2 << "\n"
#define prt3(v1, v2, v3) cout << v1 << " " << v2 << " " << v3 << "\n"
#define prtall(v)        rep(i,v.size()){cout<<v[i]<<(i!=v.size()-1?" ":"\n");}
void prtok(bool ok){prt(ok ? "yes" : "no");}
//----------------------------------------------------------------

int main(void) {
  int n;
  cin >> n;
  arr(a,n);

  deque<int> dq;

  rep(i,n){
    if(i%2==1) dq.push_back(a[i]);
    else dq.push_front(a[i]);
  }

  if(n%2==0) reverse(all(dq));
  prtall(dq);
}


Measured memory_bytes: 3840
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("filed 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 s:String = read();
    if s == "ABC" {
        println!("ARC");
    } else {
        println!("ABC");
    }
}

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

using namespace std;

int main()
{
  int x, y;
  cin >> x >> y;

  int g[13] = {};
  g[4] = g[6] = g[9] = g[11] = 1;
  g[2] = 2;

  if(g[x] == g[y]) cout << "Yes" << endl;
  else cout << "No" << endl;
}

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


int main() {
  int N, M; cin >> N >> M;
  int E[8][8];
  for(int i=0; i<8; i++) for(int j=0; j<8; j++) E[i][j]=0;
  int a,b;
  for(int i=0; i<M; i++){
    cin >> a >> b; a--; b--;
    E[a][b]=1; E[b][a]=1;
  }
  
  stack<int> path;
  int reached[8]={}, result=0;
  int search=0;
  
  path.push(0);
  reached[0]=1;
  while(path.empty()==0){
    if(path.size()==N){
      result++;
      search=path.top();
      reached[search]=0;
      path.pop();
    }else{
      bool forward=false;
      if(search!=N-1){
        for(int i=search+1; i<N; i++){
          if(E[path.top()][i]==1&&reached[i]==0){
            path.push(i);
            reached[i]=1;
            search=0;
            forward=true;
            break;
          }
        }
      }
      if(forward==false){
        search=path.top();
        reached[search]=0;
        path.pop();
      }
    }
  }
  cout << result << endl;
}

Measured memory_bytes: 256
d,g=map(int,input().split())
data=[]
cp=[]
for  i in range(1,d+1):
    p,c=map(int,input().split())
    data.append(p)
    cp.append(c)
a=99999999
for i in range(1024):
    ct=0
    ans=0
    tmp=data[:]
    for j in range(d):
        if i&(1<<j):
            ct+=100*(j+1)*data[j]+cp[j]
            ans+=data[j]
            tmp[j]=0
            
    p=len(tmp)-1
    while ct<g :
        if tmp[p]>1:
            ct+=100*(p+1)
            tmp[p]-=1
            ans+=1
        else:
            p-=1
        if p<0:
            ans=99999999
            break
    a=min(a,ans)
print(a)
    

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

// 1-indexed
// s[1...n]
class rolling_hash {
public:
    rolling_hash(std::string const& s)
        : n(s.size()),
          mod({999999937LL, 1000000007LL})
    {
        for(int i = 0; i < 2; ++i) {
            hs[i].resize(n + 1);
            p[i].resize(n + 1);
            hs[i][0] = 0;
            p[i][0] = 1;
            for(int j = 0; j < n; ++j) {
                hs[i][j + 1] = (hs[i][j] * base + s[j]) % mod[i];
                p[i][j + 1] = p[i][j] * base % mod[i];
            }
        }
    }

    // s[i...]
    long long query(int idx, int i) const {
        return hs[i][idx];
    }
    // s[l + 1...r]
    long long query(int l, int r, int i) const {
        return ((hs[i][r] - hs[i][l] * p[i][r - l]) % mod[i] + mod[i]) % mod[i];
    }

private:
    int n;
    std::vector<long long> hs[2];
    std::vector<long long> p[2];

    const std::array<long long, 2> mod;
    static const long long base = 29LL;
};

int main() {
    string S, T;
    cin >> S >> T;
    rolling_hash hs1(S), hs2(T);
    int res = 0;
    for(int i = 1; i + T.size() - 1 <= S.size(); ++i) {
        int lb = i - 1, ub = i + T.size();
        while(ub - lb > 1) {
            int m = (ub + lb) / 2;
            if(hs1.query(i - 1, m, 1) == hs2.query(0, m - i + 1, 1)) {
                lb = m;
            } else {
                ub = m;
            }
        }
        int l = lb;
        lb = i - 1, ub = i + T.size();
        while(ub - lb > 1) {
            int m = (ub + lb) / 2;
            if(hs1.query(m - 1, i + T.size() - 1, 1) == hs2.query(m - i, T.size(), 1)) {
                ub = m;
            } else {
                lb = m;
            }
        }
        int r = ub;

        res += l + 2 == r;
    }
    cout << res << endl;
}


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

using namespace std;

typedef long long ll;

const int N = 60;

ll a[N];

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

    for (int i = 1; i <= n ; i ++ ) cin >> a[i];

    ll ans = 0;
    ll index;

    bool is = true;
    while(is)
    {
        ll maxs = 0;
        for (int i = 1; i <= n ; i ++ )
        {
            if(maxs < a[i])
            {
                maxs = a[i];
                index = i;
            }
        }

        if(maxs >= n)
        {
            ll x = maxs / n;
            ans += x;
            a[index] %= n;
            for (int i = 1; i <= n ; i ++ )
            {
                if(i != index) a[i] += x;
            }
        }
        else
        {
            is = false;
        }
    }

    cout << ans << endl;

    return 0;
}


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

//--------------------------------------------
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define RFOR(i,a,b) for(int i=(b)-1;i>=(a);i--)
#define REP(i,n) FOR(i,0,n)
#define RREP(i,n) RFOR(i,0,n)
#define LL long long
#define INF INT_MAX/3

//--------------------------------------------
const double EPS = 1e-14;
const double PI  = acos(-1.0);

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

int main(){
  string s;

  cin >> s;

  cout << s.at(0) << s.size() - 2 << s.at(s.size() - 1) << "\n";
}


Measured memory_bytes: 256
def main():
    sx, sy, tx, ty = map(int, input().split())

    tx = tx - sx
    ty = ty - sy

    def f1():
        s = ""
        s = s + "U" * ty
        s = s + "R" * tx
        return s

    def b1():
        s = ""
        s = s + "D" * ty
        s = s + "L" * tx
        return s

    def f2():
        s = ""
        s = s + "L" + "U" * (ty + 1)
        s = s + "R" * (tx + 1) + "D"
        return s

    def b2():
        s = ""
        s = s + "R" + "D" * (ty + 1)
        s = s + "L" * (tx + 1) + "U"
        return s

    print(f1() + b1() + f2() + b2())


if __name__ == "__main__":
    main()

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

#define endl '\n'
#define ends ' '
#define die(x) return cout << x << endl, 0
#define all(v) v.begin(), v.end()
#define sz(x) (int)(x.size())
void debug_out() { cerr << endl; }
template <typename Head, typename... Tail>
void debug_out(Head H, Tail... T) { cerr << ends << H; debug_out(T...); }
#define debug(...) cerr << "{" << #__VA_ARGS__ << "}:", debug_out(__VA_ARGS__)
typedef long long ll;
typedef pair<int, int> pii;
const int INF = 1e9;
const ll MOD = 1e9 + 7;
 
////////////////////////////////////////////////////////////////////

const int N = 7e2 + 5;

bool DP[N][N];
bool A[N][N];
vector<int> G[N];
int M[N], C[2];

bool DFS(int v, int c = 1) {
	M[v] = c, C[c - 1]++;
	for (int u : G[v]) if ((M[u] && c == M[u]) || (!M[u] && !DFS(u, 3 - c))) return false;
	return true;
}
int nC2(int n) { return n * (n - 1) / 2; }

int main() {

	ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
	mt19937 Rnd(time(0));
	
	int n, m; cin >> n >> m;
	for (int i = 0; i < m; i++) {
		int v, u; cin >> v >> u;
		A[v][u] = A[u][v] = true;
	}
	for (int i = 1; i <= n; i++) for (int j = 1; j <= n; j++) if (i != j && !A[i][j]) G[i].push_back(j);
	vector<pii> V;
	for (int i = 1; i <= n; i++) if (!M[i]) {
		C[0] = C[1] = 0;
		bool bip = DFS(i);
		if (!bip) die(-1);
		V.push_back(make_pair(C[0], C[1]));
	}
	DP[0][0] = 1;
	for (int i = 0; i < sz(V); i++) {
		int a = V[i].first, b = V[i].second;
		for (int j = 0; j <= n; j++) {
			if (j >= a) DP[i + 1][j] |= DP[i][j - a];
			if (j >= b) DP[i + 1][j] |= DP[i][j - b];
		}
	}
	int ans = INF;
	for (int i = 1; i < n; i++) if (DP[sz(V)][i]) ans = min(ans, nC2(i) + nC2(n - i));
	cout << ans << endl;

	return 0;
}


Measured memory_bytes: 6208
#include <iostream>
#include <math.h>
using namespace std;

int main() {
  int N;
  cin >> N;
  
  int W[N];
  for (int i = 0; i < N + 1; i++) cin >> W[i];
  
  int m = 100 * N;
  for (int i = 0; i < N; i++) {
    int x, y;
    x = y = 0;
    
    for (int j = 0; j <= i; j++) x += W[j];
    for (int j = i + 1; j < N; j++) y += W[j];

    if (abs(x - y) < m) m = abs(x - y);
  }
  
  cout << m << endl;
}

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

macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        let mut next = || { iter.next().unwrap() };
        input_inner!{next, $($r)*}
    };
    ($($r:tt)*) => {
        let stdin = std::io::stdin();
        let mut bytes = std::io::Read::bytes(std::io::BufReader::new(stdin.lock()));
        let mut next = move || -> String{
            bytes
                .by_ref()
                .map(|r|r.unwrap() as char)
                .skip_while(|c|c.is_whitespace())
                .take_while(|c|!c.is_whitespace())
                .collect()
        };
        input_inner!{next, $($r)*}
    };
}

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

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

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

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

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

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

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

fn abc(mut X: Vec<i32>) -> i32 {
    X.sort();
    let a = X.pop().unwrap()*10;
    let b = X.pop().unwrap();
    let c = X.pop().unwrap();
    return a+b+c
}

fn main() {
    /*
    assert_eq!(abc(), "Yes");
    assert_eq!(abc(101), "No");
    assert_eq!(abc(999999999), "Yes");
    */
    input!{
        X: [i32; 3]
    }
    let result = abc(X);

    println!("{}", result);
}



Measured memory_bytes: 4352
#include<bits/stdc++.h>
using namespace std;
int dp[109][10009];

int main(){
  int n,s=10000;
  int a[109];
  cin>>n;
  for(int i=0;i<n;i++){
    cin>>a[i];
  }
  dp[0][0]=true;
  for(int i=0;i<n;i++){
    for(int j=0;j<=s;j++){
      if(j-a[i]<0){
	dp[i+1][j]=dp[i][j];
      }
      else{
	dp[i+1][j]=dp[i][j]|dp[i][j-a[i]];
      }
    }
  }
  int ans=0;
  for(int i=0;i<=s;i++){
    if(dp[n][i]&&i%10!=0){
      ans=i;
    }
  }
  cout<<ans<<endl;
  return(0);
}


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

int n, x[128], y[128], h[128];

int main () {
    cin >> n;
    for ( int i = 0 ; i < n ; i ++ ) {
        cin >> x[i] >> y[i] >> h[i];
    }

    for ( int cy = 0 ; cy <= 100 ; cy ++ ) {
        for ( int cx = 0 ; cx <= 100 ; cx ++ ) {

            int cH = 1;

            for ( int i = 0 ; i < n ; i ++ ) {
                int expH = abs( cx - x[i] ) + abs( cy - y[i]  ) + h[i];
                if ( h[i] )  {
                    cH = max( cH, expH );
                }
            }

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


                if ( cH - abs( cx - x[i] ) - abs( cy - y[i]  ) < 0 ) {
                    if ( h[i] == 0 ) { }
                    else { ok = 0; }
                }else {
                    if ( cH - abs( cx - x[i] ) - abs( cy - y[i]  ) != h[i] ) { ok = 0; }
                }
            }

            if ( ok ) {
                cout << cx << " " << cy << " " << cH << "\n";
                return 0;
            }
        }
    }
    cout << 12/0 << "\n";
    return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<iomanip>
#include<cmath>
#include<string>
#include<cstring>
#include<vector>
#include<list>
#include<algorithm>
#include<map>
#include<set>
#include<queue>
#include<stack>
using namespace std;
typedef long long ll;
#define fi first
#define se second
#define mp make_pair
#define rep(i, n) for(int i=0;i<n;++i)
#define rrep(i, n) for(int i=n;i>=0;--i)
const int inf=1e9+7;
const ll mod=1e9+7;
const ll mod1=998244353;
const ll big=1e18;
const double PI=2*asin(1);

int bit[200005];

void add(int x) {
  while(x<200005) {
    bit[x]++;
    x += x&-x;
  }
}

ll sum(int x) {
  ll ans = 0;
  while(x>0) {
    ans += bit[x];
    x -= x&-x;
  }
  return ans;
}

int main() {
  string S;
  cin>>S;
  vector<char> arr;
  map<char, int> amap;
  for(int i=0;i<S.size();++i) {
    if(amap[S[i]]==0) arr.push_back(S[i]);
    amap[S[i]]++;
  }
  int one = 0;
  char onechr;
  for(int i=0;i<arr.size();++i) {
    if(amap[arr[i]]%2==1) {
      one++;
      onechr = arr[i];
    }
  }
  if(one>1) {
    cout<<-1<<endl;
    return 0;
  }
  string S1;
  map<char, int> bmap;
  int N = S.size();
  for(int i=0;i<S.size();++i) {
    if(amap[S[i]]%2==1) {
      if(bmap[S[i]]>=amap[S[i]]-1) continue;
      S1.push_back(S[i]);
      bmap[S[i]] += 2;
    }
    else {
      if(bmap[S[i]]>=amap[S[i]]) continue;
      S1.push_back(S[i]);
      bmap[S[i]] += 2;
    }
  }
  int num;
  if(S.size()%2==0) {
    num = S1.size();
    for(int i=num-1;i>=0;--i) {
      S1.push_back(S1[i]);
    }
  }
  else {
    S1.push_back(onechr);
    num = S1.size()-1;
    for(int i=num-1;i>=0;--i) {
      S1.push_back(S1[i]);
    }
  }
  map<char, vector<int> > cmap;
  for(int i=0;i<S1.size();++i) {
    cmap[S1[i]].push_back(i+1);
  }
  map<char, int> dmap;
  vector<int> arr1;
  for(int i=0;i<S1.size();++i) {
    arr1.push_back(cmap[S[i]][dmap[S[i]]]);
    dmap[S[i]]++;
  }
  ll ans = 0;
  for(int i=0;i<arr1.size();++i) {
    ans += i-sum(arr1[i]);
    add(arr1[i]);
  }
  cout<<ans<<endl;
}



Measured memory_bytes: 6436
#include "bits/stdc++.h"

using namespace std;
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; }

//using Matrix = vector< vector<int> >;
typedef long long ll;
typedef pair<int, int> P;
const int INF = 1 << 30;
int dx[5] = {0, 0, 1, -1, 0}, dy[5] = {1, -1, 0, 0, 0};

int q;

bool is_prime[100010];
void seive() {
	for(int i=0;i<=100005;i++) is_prime[i] = true;

	is_prime[0] = is_prime[1] = false;
	for(int i=2;i<=100005;i++) {
		if(is_prime[i]) {
			for(int j = 2 * i; j <= 100005; j += i) {
				is_prime[j] = false;
			}
		}
	}
	return ;
}

int a[100010], b[100010];

int main(void){
	cin>>q;
	seive();

	for(int i=0;i<=100005;i++) if(is_prime[i] && is_prime[(i + 1) / 2]) a[i] = 1;
	for(int i=1;i<=100005;i++) b[i] = b[i - 1] + a[i];

	for(int i=0;i<q;i++) {
		int l, r; cin>>l>>r;

		int ans = b[r] - b[l - 1];
		printf("%d\n", ans);
	}

	return 0;
}

Measured memory_bytes: 1536
#include<iostream>
#include<cstdio>
#include<cstring>
#include<cstdlib>
#include<algorithm>

using namespace std;

typedef long long ll;

ll n,x;

inline ll gcd(ll a,ll b)
{
	if(b==0)return a;
	return gcd(b,a%b);
}

int main()
{
	scanf("%lld%lld",&n,&x);
	printf("%lld\n",3*(n-gcd(n,x)));
	return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <algorithm>
#include <cmath>
using namespace std;
int main(){
	int n;
	cin>>n;
	int d,x;
	cin>>d>>x;
	int a[100];
	int c=0;
	for(int i=0;i<n;i++)cin>>a[i];
	for(int i=0;i<n;i++){
		for(int j=1;j<=d;j+=a[i])c++;
	}
	cout<<c+x<<endl;
	return 0;
}


Measured memory_bytes: 256
//Dragon_warrior7(IITK)
#include <bits/stdc++.h>
// #include <ext/pb_ds/assoc_container.hpp>
// #include <ext/pb_ds/tree_policy.hpp>
using namespace std;
//using namespace __gnu_pbds;
#define ll long long
#define pb push_back
#define nl cout << '\n'
#define sor(x) sort(x.begin(), x.end())
#define rev(v) reverse(v.begin(), v.end())
#define lb(v, temp) lower_bound(v.begin(), v.end(), temp)
#define ub(v, temp) upper_bound(v.begin(), v.end(), temp)
#define fi first
#define se second
#define llmax 1000000000000000000
#define pll pair<ll, ll> 
#define ull unsigned ll
#define vll vector<ll> 
#define rub cout << "\n------------------------------------\n"
#define deb(args...) { string _s = #args; replace(_s.begin(), _s.end(), ',', ' '); stringstream _ss(_s); istream_iterator<string> _it(_ss); err(_it, args); }

void err(istream_iterator<string> it) {}
template<typename T, typename... Args>
void err(istream_iterator<string> it, T a, Args... args) 
{
	cout << *it << " = " << a;
	nl;
	err(++it, args...);
}
//typedef  tree < int ,  null_type ,  greater<int> ,  rb_tree_tag ,  tree_order_statistics_node_update > oset;
void read(vector<ll> &v)
{
	for (int i = 0; i < v.size(); i++)
		cin >> v[i];
}
// const int mod=1e9+7;
// ll power(ll a,ll b) {ll res=1;a%=mod; assert(b>=0); for(;b;b>>=1){if(b&1)res=res*a%mod;a=a*a%mod;}return res;}
// ll modInverse(ll a){return power(a,mod-2);}
ll n,m,a,b,c,k,temp,x,y;
void solveforthiscase(const int & test)
{//deb(test);
cin>>n;
cout<<(n+1)/2;







return ;
}
int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);
	int test=1;
// 	cin>>test;
    for(int i=1;i<=test;i++)
    {
        solveforthiscase(i);
    }
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <string>
#include <math.h>
using namespace std;
 
int main() {
  int N;
  
  
  string S;
  cin >> N;
  cin >> S;

  if(N%2 != 0){
  cout << "No" << endl;
  }
  int i = 0;
  if(N%2 == 0){
    while (i < N/2){
      if (S.at(i) != S.at((N/2)+i)){
        cout << "No" << endl;
      break;
      }
    i ++;
    }
    if(i == N/2){
    cout << "Yes" << endl;
    }
     }
  
}

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

int main(void){
  int n, hotel, ans = 1;
  cin >> n;
  vector<int> hotels;
  for(int i = 0; i < n; i++){
    cin >> hotel;
    sort(hotels.begin(), hotels.end());
    if(i != 0 && hotels[i-1] <= hotel) ans++;
    hotels.push_back(hotel);
  }
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 256
#include<algorithm>
#include <iostream>
#include<cstdio>
#include<cmath>
#include<iomanip>
#include<string>
#include<cstdlib>
#include<ctime>
#include<vector>
#include<map>
using namespace std;

int main(){
//srandom((unsigned long)time(NULL));

int n;
cin>>n;

double x[n];
string u[n];
double ans=0.0;
for(int i=0;i<n;i++){
    cin>>x[i]>>u[i];
    if(u[i]=="JPY"){
        ans+=x[i];
    }else{
        ans+=x[i]*380000.0;
    }
}

cout<<ans<<endl;



return 0;
}

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

int main()
{
    int n;cin>>n;
    ll x;
    ll ans=1;
    ll k=1e18;
    int f=0;
    for(int i=1;i<=n;i++){
        cin>>x;
        if(!x) f=2;
        if(f) continue;
        if(k/ans<x)
            f=1;
        ans*=x;
    }
    if(f==1) cout<<-1;
    else if(f==2) cout<<0;
    else cout<<ans;
    return 0;
}



Measured memory_bytes: 3636
#include <stdio.h>
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cmath>
#include <vector>
#include <string.h>
#include <stdlib.h>
using namespace std;

int main(){

    int N; string S;
    cin >> N;
    cin >> S;
    // cout << N << endl;
    // cout << S << endl;
    string T1 = S.substr(0, (int) N/2);
    string T2 = S.substr(N/2, (int) N/2);

    // cout << T1 << endl;
    // cout << T2 << endl;
    if(T1 == T2 && N%2 == 0) cout << "Yes" << endl;
    else cout << "No" << endl;

}

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

int main() {
  string S;
  cin >> S;
  if(S=="SUN"){
    cout << 7 << endl;
  }
  else if(S=="MON"){
    cout << 6 << endl;
  }
  else if(S=="TUE"){
    cout << 5 << endl;
  }
  else if(S=="WED"){
    cout << 4 << endl;
  }
  else if(S=="THU"){
    cout << 3 << endl;
  }
  else if(S=="FRI"){
    cout << 2 << endl;
  }
  else if(S=="SAT"){
    cout << 1 << endl;
  }
  
}


Measured memory_bytes: 256
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		long n = in.nextLong();
		long[] a = new long[5];
		long min = Long.MAX_VALUE;
		for(int i=0;i<5;i++) {
			a[i] = in.nextLong();
			if(a[i]<min) min = a[i];
		}
		System.out.println((n/min)+(n%min==0?4:5));
		in.close();

	}

}


Measured memory_bytes: 23124
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(n);i++)
#define all(v) v.begin(),v.end()
#define len(x) (ll)(x).length()
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
const int INF=1e9;
const int di[] = {-1,0,1,0};
const int dj[] = {0,-1,0,1};

int func(int x){
  if(x%100!=0) return 0;
  return func(x/100)+1;
}

int main(){
  ll x,y;
  cin>>x>>y;
  int ans=0;
  while(x<=y){
    ans++;
    x*=2;
  }
  cout<<ans<<endl;
}

Measured memory_bytes: 3608
using System;
using System.Linq;
using CompLib.Util;

public class Program
{

    public void Solve()
    {
        var sc = new Scanner();
        int r = sc.NextInt();

        Console.WriteLine(Math.PI * (r + r));
    }

    public static void Main(string[] args) => new Program().Solve();
}

namespace CompLib.Util
{
    using System;
    using System.Linq;

    class Scanner
    {
        private string[] _line;
        private int _index;
        private const char Separator = ' ';

        public Scanner()
        {
            _line = new string[0];
            _index = 0;
        }

        public string Next()
        {
            while (_index >= _line.Length)
            {
                _line = Console.ReadLine().Split(Separator);
                _index = 0;
            }

            return _line[_index++];
        }

        public int NextInt() => int.Parse(Next());
        public long NextLong() => long.Parse(Next());
        public double NextDouble() => double.Parse(Next());
        public decimal NextDecimal() => decimal.Parse(Next());
        public char NextChar() => Next()[0];
        public char[] NextCharArray() => Next().ToCharArray();

        public string[] Array()
        {
            _line = Console.ReadLine().Split(Separator);
            _index = _line.Length;
            return _line;
        }

        public int[] IntArray() => Array().Select(int.Parse).ToArray();
        public long[] LongArray() => Array().Select(long.Parse).ToArray();
        public double[] DoubleArray() => Array().Select(double.Parse).ToArray();
        public decimal[] DecimalArray() => Array().Select(decimal.Parse).ToArray();
    }
}


Measured memory_bytes: 27624
#include <iostream>
#include<cmath>
using namespace std;
void arraycout(int *arrayy,int n){
    for(int u=0;u<n;u++){//出力
        if(u==n-1){
            cout<<arrayy[u]<<endl;
        }else{
            cout<<arrayy[u]<<' ';
        }
    }
    
}
void insertionSort(int* suu,int n){

    for(int i=1;i<n;i++){
        arraycout(suu,n);
        int v=suu[i];
        int j=i-1;
        while(j>=0&&suu[j]>v){
            suu[j+1]=suu[j];
            j=j-1;
        }
        
        suu[j+1]=v;
    }
    
    
}





int main(){
    int n;
    cin>>n;
    int suu[n];
    for(int i=0;i<n;i++){
        cin>>suu[i];
    }
    
    insertionSort(suu,n);
    arraycout(suu,n);
    return 0;
}


Measured memory_bytes: 3108
#include<iostream>
#include<stdio.h>
//#include <bits/stdc++.h>
#include<vector>
#include<float.h>
#include<iomanip>
#include<algorithm>
#include<string>
#include<cstring>
#include<math.h>
#include<cmath>
#include<sstream>
#include<set>
#include<map>
#include<queue>
#include<cassert>
#include<cmath>
#include<cstdint>


     
#define INF 1e9
#define LINF 1e19
#define rep(i,n)for(int i=0;(i)<(int)(n);i++)
#define REP(i,a,b)for(int i=(int)(a);(i)<=(int)(b);i++)
#define VEC(type, c, n) std::vector<type> c(n);for(auto& i:c)std::cin>>i;
#define vec(type,n) vector<type>(n)
#define vvec(m,n) vector<vector<int>> (int(m),vector<int>(n))
#define ALL(a)  (a).begin(),(a).end()
#define chmin(a, b) a = min(a, b)
#define chmax(a, b) a = max(a, b)
#define pb push_back
#define sz size()
     
using namespace std;
using ll = long long;
using Graph = vector<vector<int>>;
using P = pair<ll, ll>;

     
const ll MOD = 1e9 + 7;
const ll ZER = 0;



int main(){
    int n;
    cin >> n;
    vector<double> a(n);
    double ave = 0;
    rep(i, n){
        cin >> a[i];
        ave += a[i];
    }
    ave /= n;
    double res = INF;
    int id = 0;
    rep(i, n){
     // cout << abs(ave - a[i]) << " " << res << endl;
        if(res > abs(ave - a[i])){
            res = abs(ave - a[i]);
            id = i;
        }
    }
    cout << id << endl;
}





Measured memory_bytes: 3188
K, N = gets.split.map(&:to_i)
a = []
a = gets.split.map(&:to_i)

ans, dis = 10e6
N.times do |i|
  dis = a[(i+N-1)%N] - a[i]
  if dis <= 0
    dis += K
  end
  ans = [ans, dis].min
end
puts ans

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



int main()
{
    ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
    ///freopen("input.in", "r", stdin);
    ///freopen("output.out", "w", stdout);
    ll n, m;
    cin >> n >> m;
    vector <pll> a(n + 1);
    for (ll i = 1; i <= n; ++i)
        cin >> a[i].first >> a[i].second;
    ll dp[n + 1][m + 1]{};
    for (ll i = 1; i <= n; ++i) {
        for (ll j = 0; j <= m; ++j) {
            if (j - a[i].first >= 0)
                dp[i][j] = max(dp[i][j], dp[i - 1][j - a[i].first] + a[i].second);
            dp[i][j] = max(dp[i][j], dp[i - 1][j]);
        }
    }
    cout << dp[n][m];
    return 0;
}

/**


**/


Measured memory_bytes: 79232
#include <bits/stdc++.h>
using namespace std;
#define MOD 1000000007
#define pb push_back
#define xx first
#define yy second
#define sz(x) ((int)x.size())
#define all(x) x.begin(),x.end()
#define rep(i,n) for(int i=0;i<n;i++)
#define repp(i,k,n) for(int i=k;i<n;i++)
typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> iv;
typedef pair<int,int> iip;
typedef map<int,int> mii;
template <typename T>
void dbg(T t){cerr<<t<<endl ;}
template<typename T, typename... Args>
void dbg(T t, Args... args) {cerr << t <<" ";dbg(args...) ;}


int main(){
	int n;
	cin>>n;
	if(n==1)cout<<1;
	else{
		int d =2;
		while(d<=n){
			d*=2;
		}	
		cout<<d/2;
	}
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using sqvec = vector<vector<int>>;
int main(){
  long long n, W, all_W=0;
  int V=0;
  cin >> n >> W;
  //sqvec a(vector<int>(n));
  long long w[n], v[n];
  for(int i = 0; i < n; i++){
    cin >> w[i] >> v[i];
    V += v[i];
    all_W += w[i];
  }
  
  long long dp[n+1][V+1];
  for(long long i = 0; i < V+1; i++){
    dp[0][i] = 100000000000;
  }
  dp[0][0] = 0;
 
  for(int i = 1; i < n+1; i++){
    for(long long sum_v = 0; sum_v < V + 1; sum_v ++){
      if(sum_v >= v[i-1]){
        dp[i][sum_v] = min(dp[i-1][sum_v], dp[i-1][sum_v - v[i-1]] + w[i-1]);
      }else{
        dp[i][sum_v] = dp[i-1][sum_v];
      }
    }
  }
  
  long long res = 0;
  for(int sum_v = 0; sum_v < V+1; sum_v++){
    if(dp[n][sum_v] <= W) {
      res = sum_v;
    }
  }
  cout << res << endl;
}


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

namespace ABC086A
{
    class Program
    {
        static void Main(string[] args)
        {
            int a, b;
            var word = Console.ReadLine().Split(' ');
            a = int.Parse(word[0]);
            b = int.Parse(word[1]);
            int c = a * b % 2;
            if (c > 0)
                Console.WriteLine("Odd");
            if (c == 0)
                Console.WriteLine("Even");

            Console.ReadKey();

        }
    }
}


Measured memory_bytes: 11092
#include <iostream>
using namespace std;
#include<cmath>
#include<iomanip>
#define PI acos(-1)

int main(){
    int A,B,H,M;
    double time, gap;
    cin >> A >> B >> H >> M;
    time = H * 60 + M;
    gap = time / (12.0*60.0) - M / (60.0);
    gap = abs(gap);
    if (gap > 0.5)
        gap = 1.0 - gap;
    cout << setprecision(12) << sqrt(pow(A,2) + pow(B,2) - 2.0 * A * B * cos(gap * 2.0 * PI));
    return 0;
}


Measured memory_bytes: 4228
#include <iostream>
using namespace std;
#include<bits/stdc++.h>
typedef long long ll;
#define int long long
#define ff first
#define ss second
#define md 1000000007
#define md1 998244353
#define pb push_back
#define in insert
#define mkp make_pair
#define f(i,yha,wha) for(ll i=yha;i<wha;i++)
#define rf(i,wha,yha) for(ll i=wha;i>=yha;i--)
#define f0(n) for(ll i=0;i<n;i++)
#define f1(n) for(ll i=1;i<=n;i++)
#define fg(i,yha,wha,gap) for(ll i=yha;i<wha;i+=gap)
#define mpll map<ll,ll>
#define len(p) (ll)p.size()
#define pll pair<ll,ll>
#define all(v) v.begin(),v.end()
#define mem(a,t) memset(a,t,sizeof(a))
#define endl "\n"
#define ar array
#define vl vector<ll>
#define vpll vector<pair<ll,ll>>


void flash()
{
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
}

void solve()
{
	ll n;
	cin>>n;
	float ans=2*n*(22*1.0/7);
	cout<<ans;
	
}


int32_t main()
{
  flash();
  int t;
  t = 1;
//  cin >> t;
  while (t--)
  {
    solve();
  }
  return 0;
}

Measured memory_bytes: 3804
#include <bits/stdc++.h>
using namespace std;
/// Typedef
typedef long long           ll;
typedef vector<int>         vi;
typedef pair<int,int>       pii;

#define pb                  push_back
#define ppb                 pop_back
#define MP                  make_pair
#define ff                  first
#define ss                  second
#define sf                  scanf
#define pf                  printf
#define SQR(x)              ((x)*(x))
#define loop(i, y)          for(int i=0; i<int(y); i++)
#define FOR(i, x, y)        for(int i=int(x); i<int(y); i++)
#define ROF(i, x, y)        for(int i=int(x); i>=int(y); i--)
#define all(c)              c.begin(), c.end()
#define sz(c)               int(c.size())
#define clr(x, y)           memset(x, y, sizeof(x))
#define si(x)               scanf("%d", &x)
#define sii(x, y)           scanf("%d %d", &x, &y)
#define siii(x, y, z)       scanf("%d %d %d", &x, &y, &z)
#define sl(x)               scanf("%lld", &x)
#define sll(x, y)           scanf("%lld %lld", &x, &y)
#define slll(x, y, z)       scanf("%lld %lld %lld", &x, &y, &z)

#ifdef VAMP
     #define debug(...) __f(#__VA_ARGS__, __VA_ARGS__)
    template < typename Arg1 >
    void __f(const char* name, Arg1&& arg1){
        cout << name << " = " << arg1 << std::endl;
    }
    template < typename Arg1, typename... Args>
    void __f(const char* names, Arg1&& arg1, Args&&... args){
        const char* comma = strchr(names+1, ',');
        cout.write(names, comma - names) << " = " << arg1 <<" | ";
        __f(comma+1, args...);
    }
#else
    #define debug(...)
#endif
///******************************************START******************************************


template <class T> inline T bigMod(T p,T e,T M){ ll ret = 1; for(; e > 0; e >>= 1){ if(e & 1) ret = (ret * p) % M; p = ((ll)p * p) % M; } return (T) ret;}
template <class T> inline T modInv(T a,T M){return bigMod(a,M-2,M);}

/// Constants
#define MAX                 2000056
#define MOD                 1000000007
#define eps                 1e-9
#define INF                 0x3f3f3f3f3f3f3f3f // 4,557,430,888,798,830,399
#define inf                 0x3f3f3f3f // 1,061,109,567
#define PI                  acos(-1.0)  // 3.1415926535897932
#define VT                  int

ll fact[MAX], invFact[MAX];

ll nCr(int n, int r){
    return (fact[n] * invFact[r] % MOD * invFact[n - r] % MOD);
}

ll getBelowRes(int n, int r){
    return (nCr(n+r, r) + MOD - 1) % MOD;
}

int main(){
    #ifdef VAMP
        clock_t tStart = clock();
        freopen("input.txt", "r", stdin);
        freopen("output.txt", "w", stdout);
    #endif
    fact[0] = 1;
    FOR(i, 1, MAX) fact[i] = (fact[i-1] * i) % MOD;
    invFact[MAX - 1] = modInv(fact[MAX - 1], 1LL*MOD);
    ROF(i, MAX-2, 0) invFact[i] = (invFact[i+1] * (i+1)) % MOD;

    int r1, c1, r2, c2; sii(r1, c1), sii(r2, c2);


    ll res = (getBelowRes(r2+1, c2+1) + getBelowRes(r1, c1) - getBelowRes(r2+1, c1) - getBelowRes(r1, c2+1) + MOD * 5LL) % MOD;

    cout<<res<<endl;


    #ifdef VAMP
        fprintf(stderr, "\n>> Runtime: %.10fs\n", (double) (clock() - tStart) / CLOCKS_PER_SEC);
    #endif
    return 0;
}

Measured memory_bytes: 31488
import java.io.File;
import java.io.IOException;
import java.util.ArrayDeque;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Comparator;
import java.util.Deque;
import java.util.List;
import java.util.Scanner;

public class Main {
 
	public static void main(String[] args) throws IOException {
		//File file = new File("input.txt");
		//Scanner sc = new Scanner(file);
		
		Scanner sc = new Scanner(System.in);
		
		int N = sc.nextInt();
		int i = sc.nextInt();
		
		System.out.println(N - i + 1);
	}
}

Measured memory_bytes: 23892
s=list(map(int,input().split()))
a=0
b=0
c=min(s[0],s[1])
for i in range(c,0,-1):
  if a==s[2]:
    break
  if s[0]%i==0:
    if s[1]%i==0:
      a+=1
      b=i
print(b)

Measured memory_bytes: 3060
#include <cstdio>
#include <cstring>

char s[100];
int main()
{
	scanf("%s",s);
	int n=strlen(s);
	for (int i=0;i<n-1;i++)
		if (s[i]=='A' && s[i+1]=='C')
		{
			printf("Yes\n");
			return 0;
		}
	printf("No\n");
	return 0;
}

Measured memory_bytes: 128
import java.util.*;

public class Main {

    public static void main(String[] args) {
        // write your code here
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int p = sc.nextInt();
        int odd = 0;
        for (int i = 0; i < n; i++) {
            if (sc.nextInt() % 2 == 1) {
                odd++;
            }
        }
        if (odd < 1) {
            System.out.println(p == 0 ? (long) Math.pow(2, n) : 0);
        } else {
            System.out.println((long) Math.pow(2, n - 1));
        }
    }
}

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

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

int main() {
	int A, B;
	cin >> A >> B;

	int ans = 0;
	for (int i = A; i <= B; ++i) {
		string str = to_string(i);
		bool f = true;
		for (int j = 0; j < str.size() / 2; ++j) {
			if (str[j] != str[str.size() - 1 - j]) {
				f = false;
				break;
			}
		}
		if (f) {
			ans++;
		}
	}

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


Measured memory_bytes: 3696
#include<stdio.h>
void out(int A[],int N){
	int i;
	for(i=0;i<N;i++){
		if(i>0)printf(" ");
		printf("%d",A[i]);}
	printf("\n");}
void insertionsort(int A[],int N){
	int i,j,v;
	for(i=1;i<N;i++){
		v=A[i];
		j=i-1;
		while(j>=0&&A[j]>v){
			A[j+1]=A[j];
			j--;}
		A[j+1]=v;
		out(A,N);}}
int main(){
	int A[100],N,i;
	scanf("%d",&N);
	for(i=0;i<N;i++)scanf("%d",&A[i]);
	out(A,N);
	insertionsort(A,N);
	return 0;}


Measured memory_bytes: 2636
#include <stdio.h>

int main(void){
	int n,i,j;
	int v[100];
	scanf("%d", &n);
	for (i=0; i<n; i++){
		scanf("%d", &v[i]);
	}
	for (j=0; j<n-1; j++){
		printf("%d ", v[n-1-j]);
	}
	for (j=n-1; j<n; j++){
		printf("%d", v[n-1-j]);
	}
	putchar('\n');
	return 0;
}

Measured memory_bytes: 600
N, K = gets.chomp.split.map(&:to_i)
array = gets.chomp.split.map(&:to_i)

city = Array.new(N, false)

now = array[0]
hist = [1]
city[0] = true

(2..K).each do |kaisuu|
  if city[now - 1] == false

    hist.push now
    city[now - 1] = true
    now = array[now - 1]

  else

    # p [kaisuu, now]
    # p hist

    nokori_kaisuu = (K - (kaisuu))
    first = hist.find_index(now)
    # p first
    kurikaesi = hist[first..-1]
    # p kurikaesi
    # p nokori_kaisuu
    index = nokori_kaisuu % (kurikaesi.size)
    now = kurikaesi[index]
    # p now
    now = array[now - 1]
    break
  end
end

puts now


Measured memory_bytes: 31696
import java.lang.System.*;
import java.util.*;

public class Main {
  public static void main(String[] args) {
    Scanner S = new Scanner(System.in);
    String s = S.nextLine();
    String t = S.nextLine();

    String p = t.replaceFirst(".$", "");
     if (s.equals(p)) {
        System.out.println("Yes");
      } else {
        System.out.println("No");
      }
  }
}



Measured memory_bytes: 35780