akhauriyash/Code-Regression huggingface dataset:
//Powerful Discount Tickets

#include<bits/stdc++.h>
using namespace std;
using ll = long long;
#define int long long
#define rep(i,x,y) for(ll i=x;i<y;i++)
#define irep(i,a) for(auto i = a.begin(); i != a.end(); ++i)
#define nvarep(n,a) ll n;cin>>n;vector<ll>a(n);rep(i,0,n)cin>>a[i]
#define vecrep(n,a,type) vector<type>a(n);rep(i,0,n)cin>>a[i]
#define lcm(a,b) (a/__gcd(a, b)*b)
#define range(a) (a).begin(),(a).end() 
#define pb push_back
#define mp make_pair
#define nnn "\n"
#define spa " "
using p = pair<ll, string>;
using garph = vector<vector<ll>>;
const int inf = 2147483647;//2*10^9
const ll INF = 9223372036854775807;//9*10^18

signed main (){
    int n,m;cin>>n>>m;
    priority_queue<int>a;
    rep(i,0,n){
        int c;cin>>c;
        a.push(c);
    }
    rep(i,0,m){
        int c = a.top();
        a.pop();
        c/=2;
        a.push(c);
    }
    int sum = 0;
    while(!a.empty()){
        int c = a.top();
        a.pop();
        sum += c;
    }
    cout<<sum<<nnn;
    return 0;
}

Measured memory_bytes: 4224
#include <iostream>
#include <assert.h>
#include <vector>
#include <unordered_map>
#include <queue>
#include <climits>
#include <cmath>
#include <algorithm>
using namespace std;
int main(){
  std::cin.tie(0);
  std::ios::sync_with_stdio(false);
  int X;
  cin >> X;
  if (X < 600) {
    cout << 8 << endl;
  } else if (X < 800) {
    cout << 7 << endl;
  } else if (X < 1000) {
    cout << 6 << endl;
  } else if (X < 1200) {
    cout << 5 << endl;
  } else if (X < 1400) {
    cout << 4 << endl;
  } else if (X < 1600) {
    cout << 3 << endl;
  } else if (X < 1800) {
    cout << 2 << endl;
  } else {
    cout << 1 << endl;
}
  return 0;

}


Measured memory_bytes: 3636
function main()
	n,l = map(x->parse(Int,x), split(readline()))
	k = Array{String}(n)
	for i in 1:n
		k[i] = chomp(readline())
	end
	k = sort(k)
	for i in 1:n
		print(k[i])
	end
end

main()

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

const int INF = 1e9 + 10;
const ll MOD = 1e9 + 7;

void printv(vector<ll> v) {
  for (ll i : v)
    cout << i << " ";
  cout << endl;
}

int main() {
  ll n;
  cin >>n;
  vector<ll> cnt_y(n+1);
  for (ll i = 1; i <= n; ++i) {
    for (ll j = 1; i*j<=n; j++){
      cnt_y[i*j]++;
    }
  }
  ll ans = 0;
  for (ll i=1; i<=n; i++){
    ans += i * cnt_y[i];
  }
  cout << ans <<endl;
}


Measured memory_bytes: 81376
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

class Main {

    public static void main(String[] args) throws Exception {

        try {

            BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

            String[] inputNumbers = br.readLine().split(" ");
            int firstNumber = Integer.parseInt(inputNumbers[0]);
            int secondNumber = Integer.parseInt(inputNumbers[1]);
            int thirdNumber = Integer.parseInt(inputNumbers[2]);

            if (thirdNumber >= firstNumber && thirdNumber <= secondNumber) {
                System.out.println("Yes");

            } else {

                System.out.println("No");

            }

        } catch (IOException | NumberFormatException e) {
            e.printStackTrace();
            System.exit(0);
        } catch (final Exception e) {
            e.printStackTrace();
            System.exit(0);
        }
    }
}

Measured memory_bytes: 20692
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (n); i++)
#define rep2(i, x, n) for (int i = x; i < (n); i++)
#define all(n) begin(n), end(n)
struct cww
{
    cww()
    {
        ios::sync_with_stdio(false);
        cin.tie(0);
    }
} star;
const long long INF = numeric_limits<long long>::max();
typedef long long ll;
typedef vector<int> vint;
typedef vector<char> vchar;
typedef vector<vector<int>> vvint;
typedef vector<ll> vll;
typedef vector<vector<ll>> vvll;
typedef unsigned long long ull;
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 (b < a)
    {
        a = b;
        return 1;
    }
    return 0;
}
template <typename T>
vector<T> make_v(size_t a) { return vector<T>(a); }

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

template <typename T, typename V>
typename enable_if<is_class<T>::value != 0>::type
fill_v(T &t, const V &v)
{
    for (auto &e : t)
        fill_v(e, v);
}
int main()
{
    int H, W, K, ans = INT_MAX / 2;
    cin >> H >> W >> K;
    auto S = make_v<char>(H, W);
    rep(i, H) rep(j, W) cin >> S[i][j];
    vint cnt(H); //cnt[i]は横に切ったあと、上から第i成分に何個1が入ってるか

    for (int bit = 0; bit < (1 << (H - 1)); bit++) //(bit & (1<<i)) == 1 ⇔ i番目の境界で切る
    {
        int tmp = 0;
        fill_v(cnt, 0);
        for (int w = 0; w < W; w++) //できるだけ縦に切りたくないのでギリギリまでひきのばす
        {
            auto prev = cnt; 
            int j = 0; //横に切ったときの上から第j成分を見る
            for (int i = 0; i < H; i++)
            {
                if (S[i][w] == '1')
                    cnt[j]++;
                if ((bit & (1 << i))) //切ったフラグが立ってたらjを1増やす
                {
                    j++;
                }
            }
            for (int i = 0; i < H; i++)
            {
                if (cnt[i] > K) //条件に反してたら
                {
                    tmp++; //今見てる1個手前で切る
                    for (int l = 0; l < cnt.size(); l++)
                    {
                        cnt[l] -= prev[l]; //切ったので1個前の分は減らす
                        if (cnt[l] > K) //それでもだめなら
                        {
                            tmp = INT_MAX / 2;
                        }
                    }
                }
            }
        }
        for (int i = 0; i < H; i++) //横に切った分をカウント
        {
            if (bit & (1 << i))
            {
                tmp++;
            }
        }
        chmin(ans, tmp);
    }
    cout << ans;
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#include<set> 
#include<math.h>
#define pai 3.14159265358979323846264338327950288;
#define keta(n) cout << fixed << setprecision((n));
using ll = long long;
int main(){
  string s;
  cin>>s;
  int size = s.size();
  cout<<s[0]<<size-2<<s[size-1];
  



}


Measured memory_bytes: 256
// #define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <algorithm>
#include <vector>
#include <cstdlib>
#include <cstdio>
#include <string>
#include <cmath>
using namespace std;


int solve(int n){
	// n!を素因数分解して5*2 のセットが何個あるか.
	// 　n! = n * (n-1) * (n-2) * ... * 1 に5が何個含まれているか
	//     n / 5 で、nまでの各数字の中で5の倍数がいくつあるかわかる
	//       その5の倍数は、さらに多くの5を含んでいる可能性があるよー 100とか.

	// if n=10000
	//  10000 / 5 = 2000  2000個の5の倍数がある
	//   n=2000           その2000個について、さらに5が素因数として含まれているか見る(他は5の倍数ではない)
	//    2000 / 5 = 400  400個の5の倍数がある　素因数「5」がまだ400個あった
	//     n=400
	//      n / 5 = 80 , 80/5=16 , 16/5=3 , 3/5=no
	//       素因数「5」の個数は  2000 + 400 + 80 + 16 + 3 = 2499.

	int ans = 0;

	while (1){
		int temp = n / 5;
		if (temp == 0)	break;
		else
		{
			ans += temp;
			n /= 5;
		}
	}
	return ans;
}


int main(){
	int n;
	while (cin >> n, n){
		cout << solve(n) << endl;
	}

	return 0;
}

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

using namespace std;
inline void prep ()
{
  cin.tie (0);
  cin.sync_with_stdio (0);
};
const double pi = acos(-1.);
//printf(%.12lf\n,mid);
// __builtin_popcount(int) count 1's in binary
// get decimal part of number
/*
double intpart;
double thiss = modf((double)(n*m)/(double)k, &intpart);
*/
// round = (int)(num+.5)
int mod = 998244353;

long long mymod(long long num){
  if (num< 0 && !(num%mod == 0)){
    if (mod == 1){
      return 0;
    }
    return mod-abs(num)%mod;
  }else{
    return num%mod;
  }
}

/*string sentence = And I feel fine...;
    istringstream iss(sentence);
*/  

double eps = .000000001;

int main ()
{
  prep();
  int n;
  cin >> n;
  cout << n*n*n;
  return 0; 
}

Measured memory_bytes: 256
#include <stdio.h>

int main(void){
    int a,b;
    scanf("%d %d", &a, &b);
    
    if(a >= 13){
        printf("%d\n", b);
    }else if(a >= 6){
        printf("%d\n", b/2);
    }else{
        puts("0");
    }
    
    return 0;
}

Measured memory_bytes: 128
use std::io::*;
use std::str::*;

fn read<T: FromStr>() -> Option<T> {
    let stdin = stdin();
    let s = stdin
        .bytes()
        .map(|c| c.unwrap() as char)
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect::<String>();
    s.parse::<T>().ok()
}

fn main() {
    let s: String = read().unwrap();

    if s[2..3] == s[3..4] && s[4..5] == s[5..6] {
        println!("Yes")
    } else {
        println!("No")
    }
}


Measured memory_bytes: 4352
#include<bits/stdc++.h>
using namespace std;
int ans=1,k,n;
int main()
{
	cin>>n>>k;
	for(int i=1;i<=n;i++)
	{
	    if(ans>k) ans+=k;
        else ans*=2;
	}
	cout<<ans<<endl;
	return 0;
}

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

pair<int, int> dhw[] = { // <h, w>
        { 1, 0},
{ 0,-1},        { 0, 1},
        {-1, 0},
{ 2,-2},{ 2,-1},{ 2, 0},{ 2, 1},{ 2, 2},
{ 1,-2},{ 1,-1},        { 1, 1},{ 1, 2},
{ 0,-2},                        { 0, 2},
{-1,-2},{-1,-1},        {-1, 1},{-1, 2},
{-2,-2},{-2,-1},{-2, 0},{-2, 1},{-2, 2}
};

int main() {
  int h, w; cin>>h>>w;
  int sh, sw, eh, ew; cin>>sh>>sw>>eh>>ew; --sh; --sw; --eh; --ew;
  vector<string> s(h); rep(i,h) cin>>s[i];

  const int INF = 1e9;
  vector<vector<int>> dist(h,vector<int>(w,INF));
  dist[sh][sw] = 0;
  // deque<P> q;
  deque<pair<int, int>> q;
  q.emplace_back(sh, sw);

  while (!q.empty()) {
    int i = q.front().first;
    int j = q.front().second;
    int d = dist[i][j];
    q.pop_front();
    // if (dist[i][j] != d) continue;

    rep(v,4) {
      // int ni = i+di[v], nj = j+dj[v];
      int ni = i+dhw[v].first, nj = j+dhw[v].second;
      if (ni < 0 || ni >= h || nj < 0 || nj >= w) continue;
      if (s[ni][nj] == '#') continue;
      if (dist[ni][nj] <= d) continue;
      dist[ni][nj] = d;
      q.emplace_front(ni,nj);
    }

		for(int v=4; v<24; ++v){
      int ni = i+dhw[v].first, nj = j+dhw[v].second;
			if (ni < 0 || ni >= h || nj < 0 || nj >= w) continue;
			if (s[ni][nj] == '#') continue;
			if (dist[ni][nj] <= d+1) continue;
			dist[ni][nj] = d+1;
			q.emplace_back(ni,nj);
    }

  }

	cout<< (dist[eh][ew]==INF? -1:dist[eh][ew]) <<endl;
}


Measured memory_bytes: 9460
using System;
using System.Collections.Generic;
using System.Linq;

namespace ProgramingStudying2
{
    class Program
    {

        static void Main(string[] args)
        {
            var n = Console.ReadLine();
            if(n[0] == '9' || n[1] == '9')
            {
                Console.WriteLine("Yes");
            }
            else
            {
                Console.WriteLine("No");
            }
        }
    }
}


Measured memory_bytes: 25888
def check_distance(i,j):

    if j<=X or i>=Y:
        dis = j - i
    else:
        dis1 = j - i
        dis2 = abs(i-X) + 1 + abs(j - Y)
        dis = min(dis1,dis2) 
    return dis


N,X,Y = map(int,input().split())

K = []
for i in range(1,N):
    K.append(0)

for i in range(1,N):
    for j in range(i+1,N+1):
        dis = check_distance(i,j)
        K[dis-1] += 1
for k in K:
    print(k)


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

using namespace std;

typedef long long ll;
typedef vector<ll> vl;
typedef long double ld;
typedef vector<ld> vd;
typedef bool bl;
typedef vector<bl> vb;
typedef vector<vl> mt;
typedef unordered_map<ll,unordered_map<ll,ll>> graph;
typedef pair<ll,ll> pl;
typedef pair<ld,ld> pd;
typedef vector<string> vs;
typedef vector<vs> table;
typedef vector<vl> v2;
typedef vector<v2> v3;
typedef vector<v3> v4;


const ll e5 = 1 << 20;
const ll mod = 1000000007;
const ll e3 = 1 << 13;
const ll INF = 1ll << 50;

ll n;


int main(){
  cin >> n;
  cout << n*(n-1)/2 << endl;

}


Measured memory_bytes: 256
#include <stdio.h>

int main(void)
{
  int a, b;

  scanf("%d", &a);
  scanf("%d", &b);

  if(a > b){
    printf("a > b\n");
  }
  if(a < b) {
    printf("a < b\n");
  }
  if(a == b){
    printf("a == b\n");
  }

  return 0;
}

Measured memory_bytes: 1816
#include <bits/stdc++.h>
#include <cstdlib>
#include <cmath>
#include <algorithm>
using namespace std;
using ll = long long;
using P = pair<int,int>;
using Graph= vector<vector<int>>; 
#define rep(i,n) for (ll i=0; i < (n); ++i)
#define rep2(i,n,m) for(ll i=n;i<=m;i++)
#define rep3(i,n,m) for(ll i=n;i>=m;i--)
#define pb push_back
#define eb emplace_back
#define ppb pop_back
#define mpa make_pair
const ll INF=1e18 ;
inline void chmax(ll& a,ll b){a=max(a,b);}
inline void chmin(ll& a,ll b){a=min(a,b);}
 ll dp[100005] ; 
int main(){
 int n,m;cin>>n>>m ;
 vector<int> A(m) ;rep(i,m) cin>>A[i] ;
 
 dp[0]=1 ;
 rep(i,m){
   dp[A[i]]=-1 ;
 }
 if(m!=0){
 if(A[0]==1) dp[1]=0 ;
 else dp[1]=1;
 }
 else{
   dp[1]=1 ;
   }
   rep2(i,2,n){
  if(dp[i]==-1) dp[i]=0 ;
  else{
    dp[i]=(dp[i-1]+dp[i-2])%1000000007ll ;
  }
   
 }
  cout<<dp[n] <<endl;
  return 0;
  }

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

int main()
{
	long long n, y; cin >> n >> y;

	bool can = false;
	
	long long a, b, c;
	
	a = b = c = -1;
	
	for (long long i = 0; i <= n; i++) {
		for (long long j = 0; j <= n; j++) {
			long long tmp =  n - i - j;
			if (tmp < 0) continue;
			if (10000 * i + 5000 * j + 1000 * tmp == y) {
				a = i;
				b = j;
				c = tmp;
				break;
			}
		}
	}	
	
	cout << a << " " << b << " " << c << endl;
	return 0;
}

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

using namespace std;

int main (void) {
    int N, K;
    cin >> N >> K;

    double ans = 0;
    double tmp_ans;
    int score;
    for ( int first_score=1; first_score<=N; first_score++ ) {
        score = first_score;
        tmp_ans = (double) 1 / N;
        while ( score < K ) {
            tmp_ans /= 2;
            score *= 2;
        }
        ans += tmp_ans;
    }

    printf("%.10lf\n", ans);
    return 0;
}


Measured memory_bytes: 3708
#include<bits/stdc++.h>
#define S 2500005
#define N 1005
using namespace std;
typedef pair<int,int> P;
struct d{
  int a,b,c;
  d(){}
  d(int A,int B,int C){
    a=A,b=B,c=C;
  };
  bool operator<(const d&r)const{
    if(a!=r.a)return a<r.a;
    return b<r.b;
  }
};

int n,slen,tlen,r[S];
char s[S],t[N];
d ran[S];
P a[S];

void init(){
  for(int i=0;i<slen;i++)r[i]=s[i];
  int x=1;
  r[slen]=0;
  while(1){
    for(int i=0;i<slen;i++){
      int o=i+x;
      if(o>slen)o=slen;
      ran[i]=d(r[i],r[o],i);
    }
    sort(ran,ran+slen);
    int cnt=1;
    for(int i=0;i<slen;i++){
      r[ran[i].c]=cnt;
      if(ran[i].a==ran[i+1].a&&ran[i].b==ran[i+1].b)
	continue;
      cnt++;
    }
    if(x>slen)break;
    x*=2;
  }
  for(int i=0;i<slen;i++)a[i]=P(r[i],i);
  sort(a,a+slen);
}

bool bynary_search(){
  int L=0,R=slen;
  while(L<R){
    int M=(L+R)/2;
    if(strncmp(s+a[M].second,t,tlen)<0)L=M+1;
    else R=M;
  }
  if(!strncmp(s+a[L].second,t,tlen))return true;
  return false;
}

int main(){
  scanf("%s%d",s,&n);
  slen=strlen(s);
  init();  
  while(n--){
    scanf("%s",t);
    tlen=strlen(t);
    if(bynary_search())printf("1\n");
    else printf("0\n");
  }
  return 0;
}

Measured memory_bytes: 42148
#include "bits/stdc++.h"
#include<unordered_map>
#include<unordered_set>
#pragma warning(disable:4996)
using namespace std;
using ld = long double;
const ld eps = 1e-9;

//// < "d:\d_download\visual studio 2015\projects\programing_contest_c++\debug\a.txt" > "d:\d_download\visual studio 2015\projects\programing_contest_c++\debug\b.txt"


int main() {
	while (1) {

		int N, M; cin >> N;
		if (!N)break;
		cin >> M;
		string st; cin >> st;
		int num = 0;
		map<int, long long int>mp;
		for (int i = 0; i < st.size(); ++i) {
			bool isi = st[i] == 'I';
			if (num % 2 == isi) {
				if (num>2) {
					mp[(num-1) / 2]++;
				}
				num = isi;

			}
			else {
				num++;
			}
		}
		if (num>2) {
			mp[(num - 1) / 2]++;
		}
		long long int ans = 0;
		for (auto m : mp) {
			ans += max(0ll, m.second*(m.first - N + 1));
		}
		cout << ans << endl;
	}
	return 0;
}

Measured memory_bytes: 3944
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <functional>
#include <numeric>
#include <stack>
#include <queue>
#include <map>
#include <set>
#include <utility>
#include <sstream>
#include <complex>
#include <fstream>
#include <bitset>
#include <time.h>
#include <tuple>
#include <iomanip>

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll, ll> P;
typedef vector<ll> V;
typedef complex<double> Point;

#define PI acos(-1.0)
#define EPS 1e-10
const ll INF = 1e12;
const ll MOD = 1e9 + 7;

#define FOR(i,a,b) for(ll i=(a);i<(b);i++)
#define rep(i,N) for(ll i=0;i<(N);i++)
#define ALL(s) (s).begin(),(s).end()
#define EQ(a,b) (abs((a)-(b))<EPS)
#define EQV(a,b) ( EQ((a).real(), (b).real()) && EQ((a).imag(), (b).imag()) )
#define fi first
#define se second
#define N_SIZE (1LL << 20)
#define NIL -1

ll sq(ll num) { return num*num; }
ll mod_pow(ll x, ll n) {
	if (n == 0)return 1;
	if (n == 1)return x%MOD;
	ll res = sq(mod_pow(x, n / 2));
	res %= MOD;
	if (n % 2 == 1) {
		res *= x;
		res %= MOD;
	}
	return res;
}
ll mod_add(ll a, ll b) { return (a + b) % MOD; }
ll mod_sub(ll a, ll b) { return (a - b + MOD) % MOD; }
ll mod_mul(ll a, ll b) { return a*b % MOD; }

string s;
ll k;
set<string> ss;

int main() {
	cin >> s >> k;
	rep(i, 5) {
		rep(j, s.size()) {
			if (j + (i + 1) > s.size())break;
			ss.insert(s.substr(j, i + 1));
		}
	}
	auto it = ss.begin();
	rep(i, k - 1) {
		it++;
	}
	cout << *it << endl;
}

Measured memory_bytes: 1152
n = int(raw_input())
A = map(int, raw_input().split(" "))
count = 0

def merge(left, right):
    global count
    
    sorted_list = list()
    left_index = 0
    right_index = 0

    while left_index < len(left) and right_index < len(right):
        if left[left_index] <= right[right_index]:
            sorted_list.append(left[left_index])
            left_index += 1

        else:
            sorted_list.append(right[right_index])
            right_index += 1
            
        count += 1

    if left:
        sorted_list.extend(left[left_index:])
        count += len(left[left_index:])
    if right:
        sorted_list.extend(right[right_index:])
        count += len(right[right_index:])
        

    return sorted_list


    
def mergeSort(A):
    if len(A) <= 1:
        return A

    mid = len(A) // 2
    left = A[:mid]
    right = A[mid:]

    left = mergeSort(left)
    right = mergeSort(right)

    return list(merge(left, right))

print " ".join(map(str, mergeSort(A)))
print count

Measured memory_bytes: 63036
#include <bits/stdc++.h>
#define ll  long long
#define ull unsigned long long  
using namespace std;
#define  inf 1e6+18
#define fastio ios_base::sync_with_stdio(false); cin.tie(NULL)
#define mod 1000000007
#define  f1(i,n) for(i=1;i<=n;i++)
#define f0(i,n)  for(i=0;i<n;i++)
#define w(x)   while(x--)
const int maxn=500001;
#define  pq priority_queue
#define  ff first
#define  ss second 
#define pb  push_back
#define lb lower_bound
ll dp[2001];
ll solve(ll s)
{
	if(s==0)
		return 1;
	if(s<0)
		return 0;
	if(dp[s]!=-1)
		return dp[s];
	ll ans=0;
		for(int i=3;i<=s;i++)
		{
			ans=(ans+solve(s-i))%mod;
		} 
		dp[s]=ans;
		return ans;
}


int main()
{
	fastio;
	int t;
	//cin>>t;
	
		ll i,j,k,m,n,s;
		cin>>s;
		
	memset(dp,-1,sizeof(dp));
	k=0;
	
     	k=(k+solve(s))%mod;
     
     cout<<k;
		

	
}

Measured memory_bytes: 3628
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
    ($($r:tt)*) => {
        let s = {
            use std::io::Read;
            let mut s = String::new();
            std::io::stdin().read_to_string(&mut s).unwrap();
            s
        };
        let mut iter = s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
}

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

macro_rules! read_value {
    ($iter:expr, ( $($t:tt),* )) => {
        ( $(read_value!($iter, $t)),* )
    };
    ($iter:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($iter, $t)).collect::<Vec<_>>()
    };
    ($iter:expr, chars) => {
        read_value!($iter, String).chars().collect::<Vec<char>>()
    };
    ($iter:expr, usize1) => {
        read_value!($iter, usize) - 1
    };
    ($iter:expr, $t:ty) => {
        $iter.next().unwrap().parse::<$t>().expect("Parse error")
    };
}

fn main() {
    input! {
        n: usize,
        k: f64
    }
    let mut sum = 0.0;
    for i in 1..n+1 {
        let mut x = i as f64;
        let mut p = 0;
        while x < k {
            p += 1;
            x *= 2.0;
        }
        sum += (0.5f64).powf(p as f64) / (n as f64);
    }
    println!("{}", sum);
}


Measured memory_bytes: 4352
#include <algorithm>
#include <cmath>
#include <iostream>
#include <string>
#include <vector>
#include <numeric>
#include <cstdio>
typedef long long ll;
#define all(x) (x).begin(), (x).end()  // sortなどの引数を省略
#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
#define max3(x, y, z) max(x, max(y, z))

#ifdef _MSC_FULL_VER  //デバッグ出力
#define dout cout
#define debug() if (true)
#define check(x) std::cout << "★" << #x << "の値:" << (x) << endl
#define pass(x) std::cout << "☆" << x << endl
#else
#define dout \
  if (false) cout
#define debug() if (false)
#define check(x) \
  if (false) cout << "★" << #x << "の値:" << (x) << endl
#define pass(x) \
  if (false) cout << "☆" << x << endl
#endif
using namespace std;
int main() {
  int a;
  cin >> a;
  cout << (a / 2) * ((a+1)/2);
}
/*
//よく使うやつ
int N;
cin >> N;
vector<int> list(N);
for (int i = 0; i < N; i++) {
cin >> list[i];
}
// for文
for (int i = 0; i < N; i++) {
}
//配列
vector<int> list;
list.at(i)
vector<vector<int>> list(10, vector<int>(10));
sort(all(list));
sort(all(list), greater<int>());
//配列の内容表示
dout << "====listの内容====\n";
for (int i = 0; i < N; i++) dout << list[i] << endl;
dout << "====ここまで====\n";
*/


Measured memory_bytes: 256
N = int(raw_input())
A = map(int, raw_input().split())
D = dict()
for a in A:
   if not a in D:
      D[a] = 0
   D[a] += 1

total = 0
for num, count in D.iteritems():
   if count > 1: total += count - 1
if total % 2 != 0: total += 1
print N - total

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

int main() {
  int N;
  int K;
  cin >> N >> K;

  string str;
  cin >> str;

  if(str.at(K-1)=='A'){
    str.at(K-1)='a';
  }

  else if(str.at(K-1)=='B'){
    str.at(K-1)='b';
  }

  else if(str.at(K-1)=='C'){
    str.at(K-1)='c';
  }

  cout << str << endl;


}

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

int main() {
  string S, T;
  cin >> S >> T;
  if (T.length() != S.length() + 1) {
    cout << "No" << endl;
  } else if (T.find(S) != 0) {
    cout << "No" << endl;
  } else {
    cout << "Yes" << endl;
  }
}

Measured memory_bytes: 3624
#include <stdio.h>

int main()
{   int n,k,cnt=0,x=1;
    scanf("%d%d",&n,&k);
    while(cnt<n){
        if(x*2<x+k){
            x*=2;
        }else{
            x+=k;
        }
        cnt++;
    }
    printf("%d",x);
    return 0;
}


Measured memory_bytes: 128
#include <stdio.h>
#define _USE_MATH_DEFINES
#include <math.h>
#include <vector>
#include <algorithm>
#include <queue>

using namespace std;

int main(){
    int n;
    scanf("%d", &n);
    vector<vector<int>> vviEdge(n + 1);
    for (int i = 0; i < n-1; i++){
        int a,b;
        int nLength;
        scanf("%d %d %d", &a, &b, &nLength);
        if(nLength % 2 == 0){
            vviEdge[a].push_back(b);
            vviEdge[b].push_back(a);
        }
        else {
            vviEdge[a].push_back(b+n);
            vviEdge[b].push_back(a+n);
        }
    }
  
    vector<char> viColor(n + 1, -1);
    viColor[1] = 1;
    queue<int> qiSearchNum;
    qiSearchNum.push(1);
    while(!qiSearchNum.empty()){
        int i = qiSearchNum.front();
        qiSearchNum.pop();
        for(int j = 0; j < vviEdge[i].size(); j++){
            if(vviEdge[i][j] <= n){
                if(viColor[vviEdge[i][j]] == -1){
                    viColor[vviEdge[i][j]] = viColor[i];
                    qiSearchNum.push(vviEdge[i][j]);
                }
            }
            else {
                if(viColor[vviEdge[i][j]-n] == -1){
                    viColor[vviEdge[i][j]-n] = 1 - viColor[i];
                    qiSearchNum.push(vviEdge[i][j]-n);
                }
            }
        }
    }
    for(int i = 1; i <= n; i++){
        printf("%d\n", viColor[i]);
    }
    return 0;
}


Measured memory_bytes: 8264
N, K = map(int,input().split())
if K>((N-1)*(N-2))//2:
    print(-1)
else:
    ans = []
    for i in range(N-1):
        ans.append([1,i+2])
    if N!=2:
        k = 2
        l = 2
        for i in range(((N-1)*(N-2))//2-K):
            if l==N:
                k+=1
                l=k+1
            else:
                l+=1
            ans.append([k,l])
    print(len(ans))
    for i in ans:
        print(*i)

Measured memory_bytes: 4120
#include <stdio.h>

int main(void){
    int a,b;
    int c;
    scanf("%d %d", &a, &b);
    c = a*b;
    if (c % 2 == 0)
    {
        printf("Even");
    }else{
        printf("Odd");
    }
    return 0;
}

Measured memory_bytes: 1724
#sub f{my$x=$_;$p=0;$p=$M[$x]+=$-=($M[$_]||&f)+1-$M[$x]for@$x;$p}
#sub f{my$x=$_;$M[$x]+=$-=($M[$_]||&f)+1-$M[$x]for@$x;$M[$x]}
sub f{my$m=\$M[$_];$$m+=$-=($M[$_]||&f)+1-$$m for@$_;$$m}
<>;
/ /,push@{$`},$'+0for<>;
map$a[&f]=1,1..1e5;print$#a


Measured memory_bytes: 115712
#include<iostream>
#include<cstdio>
#include<cmath>
#include<string>
#include<cstring>
#include<algorithm>
using namespace std;
int main(){
	long long n,t=2;
	cin>>n;
	for(int i=0;i<n;i++){
		t=(t+1)*2;
	}
	cout<<t;
	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);
		
		while(true){
		    int x = sc.nextInt();
		    int y = sc.nextInt();
		    if ( x == 0 && y == 0 ) break;  
		

		
	     if(y<x){
	    	 System.out.println(y + " " + x );

	     }
	     else {
	    	 System.out.println(x + " " + y );

	     }
		}  
	}

}



Measured memory_bytes: 35704
#include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i = 0; i < (n) ; i++)
#define rrep(i,n) for(int i = n-1; i >= 0 ; i--)
typedef long long ll;
constexpr auto INFI = 2147483647;
const ll INFL = 9223372036854775807;

int main(){

  int n, k;
  cin >> n >> k;
  vector<int> sunuke(n,0);
  int d, a;
  rep(i,k){
    cin >> d;
    rep(j,d){
      cin >> a;
      sunuke[a - 1]++;
    }
  }

  int ans = 0;
  rep (i,n) {
    if (sunuke[i] == 0) ans++;
  }
  cout << ans << endl;

  return 0;
}

Measured memory_bytes: 3592
import sys
input = sys.stdin.readline
from collections import *

N = int(input())
uv = [tuple(map(int, input().split())) for _ in range(N-1)]
ans = N*(N+1)*(N+2)//6
sub = 0

for u, v in uv:
    u, v = min(u, v), max(u, v)
    sub += u*(N-v+1)

ans -= sub
print(ans)

Measured memory_bytes: 95772
import heapq
from operator import sub, add
import sys
input = sys.stdin.readline
# sys.setrecursionlimit(100000)


def eval_cake(cake):
    res = 0
    for i in range(3):
        res += abs(cake[i])
    return res


def merge_cake(a, b):
    cake = [None, None, None]
    for i in range(3):
        cake[i] = a[i] + b[i]
    return tuple(cake)


def main():
    n, m = [int(i) for i in input().strip().split()]
    cakes = [tuple([int(i) for i in input().strip().split()]) for _ in range(n)]
    candidates = []
    for i in range(8):
        ops = [None, None, None]
        for j in range(3):
            if i >> j & 1:
                ops[j] = add
            else:
                ops[j] = sub

        hq = []

        for a, b, c in cakes:
            res = 0
            res = ops[0](res, a)
            res = ops[1](res, b)
            res = ops[2](res, c)
            heapq.heappush(hq, -res)
        ans = 0
        for _ in range(m):
            ans += -1 * heapq.heappop(hq)
        candidates.append(ans)
    print(max(candidates))
    return


if __name__ == "__main__":
    main()


Measured memory_bytes: 75860
N = gets.to_i
res = Array.new(10, 0)
N.times{
  a = gets.to_i
  rr = res.map{ |x| x }
  res.each{ |x| x = (a + x); rr[x%10] = [rr[x%10], x].max }
  res = rr
#  p res
}
p res[1..-1].max


Measured memory_bytes: 3836
#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
#define INF (1<<30)
#define INFLL (1ll<<60)
typedef pair<int, int> P;
typedef pair<int, P> E;
#define MOD (1000000007ll)
#define l_ength size

void mul_mod(ll& a, ll b){
	a *= b;
	a %= MOD;
}

void add_mod(ll& a, ll b){
	b += MOD;
	a += b;
	a %= MOD;
}

vector<int> g[100100],v;

int c[100100],p[100100];

queue<int> q;

int main(void){
	int n,m,i,j,a,b,s=0;
	fill(c,c+100100,0);
	fill(p,p+100100,INF);
	cin >> n >> m;
	for(i=1; i<(n+m); ++i){
		cin >> a >> b;
		--a; --b;
		++c[b];
		g[a].push_back(b);
	}
	for(i=0; i<n; ++i){
		if(!c[i]){
			p[i] = 0;
			q.push(i);
			break;
		}
	}
	while(!q.empty()){
		a = q.front();
		q.pop();
		v.push_back(a);
		for(i=(g[a].l_ength()-1); i>=0; --i){
			b = g[a][i];
			--c[b];
			if(!c[b]){
				q.push(b);
			}
		}
	}
	for(i=0; i<n; ++i){
		a = v[i];
		for(j=(g[a].l_ength()-1); j>=0; --j){
			p[g[a][j]] = (a+1);
		}
	}
	for(i=0; i<n; ++i){
		cout << p[i] << endl;
	}
	return 0;
}


Measured memory_bytes: 7544
import java.lang.*;
import java.lang.Number.*;
import java.math.*;
import java.util.*;

class RealNumber{ // a/b
    public BigInteger a;
    public BigInteger b;
    public RealNumber(BigInteger aa, BigInteger bb){
	a = aa;
	b = bb;
    }
    public RealNumber(String sa, String sb){
	a = new BigInteger(sa);
	b = new BigInteger(sb);
    }
    public void add(RealNumber r){
	BigInteger G=b.gcd(r.b);
	BigInteger tmpb=b.multiply(r.b.divide(G));
	a=a.multiply(r.b.divide(G)).add(r.a.multiply(b.divide(G)));
	b=tmpb;
    }
    public BigDecimal toBigDecimal(int r){
	BigDecimal ret = new BigDecimal(a);
	ret = ret.divide(new BigDecimal(b),r,BigDecimal.ROUND_DOWN);
	return ret;
    }
    public void out(){
	System.out.println(a+" / " +b);
    }
}

class Main{
    final static int MAX = 13000;
    public static void main(String  []s ){
	Scanner sc = new Scanner(System.in);
	RealNumber table[] = new RealNumber[MAX];
	RealNumber R = new RealNumber(new BigInteger("1"),new BigInteger("1"));
	table[1]=R;
	for(int i = 2; i < MAX; ++i){
	    R.add( new RealNumber(Integer.toString(1),Integer.toString(i)) );
	    table[i] = new RealNumber( R.a, R.b );
	    //table[i].out();
	}
	//table[4].out();
	while(true){
	    int n,k,m,r;
	    BigDecimal ans=new BigDecimal(0);
	    n = sc.nextInt();
	    k = sc.nextInt();
	    m = sc.nextInt();
	    r = sc.nextInt();
	    if(n==0&&k==0&&m==0&&r==0)break;
	    BigDecimal bdn = new BigDecimal(n);
	    if(m == 0){
		ans = BigDecimal.ONE.divide(bdn,r+10,BigDecimal.ROUND_DOWN);
	    }else{
		//System.out.println("A");
		ans = BigDecimal.ONE.divide(bdn,r+10,BigDecimal.ROUND_DOWN);
		//System.out.println("B");
		BigDecimal bdtmp = new BigDecimal(table[n-1].a);
		//table[4].out();
		//System.out.println("C");
		bdtmp = bdtmp.divide( new BigDecimal(table[n-1].b), r+10, BigDecimal.ROUND_DOWN);
		//System.out.println(bdtmp);
		ans = ans.add(ans.multiply(bdtmp));
	    }
	    System.out.println( ans.divide(BigDecimal.ONE,r,BigDecimal.ROUND_DOWN) );
	}
    }
}

Measured memory_bytes: 45000
// Sea the world.

#include <cmath>
#include <ctime>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <algorithm>
#include <fstream>
#include <sstream>
#include <vector>
#include <string>
#include <bitset>
#include <queue>
#include <map>
#include <set>
#include <unordered_map>
#include <unordered_set>

using namespace std;

// SELF TEMPLATE CODE BGEIN

#define SZ(x) ((int)((x).size()))
#define OUT(x) printf(#x" %d\n", x)
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define repf(i,a,b) for (int i = (a); i <= (b); ++i)
#define repd(i,a,b) for (int i = (a); i >= (b); --i)
#define repcase int t, Case = 1; for (scanf ("%d", &t); t; --t)

typedef long long int64;
typedef pair<int, int> pii;

int sgn(double x) { return (x > 1e-8) - (x < -1e-8); }
int count_bit(int x) { return x == 0? 0 : count_bit(x >> 1) + (x & 1); }

template<class T> inline void to_min(T &a, const T b) { if (b < a) a = b; }
template<class T> inline void to_max(T &a, const T b) { if (b > a) a = b; }

// SELF TEMPLATE CODE END

void solve(const string& s) {
  string target = "CODEFESTIVAL2016";
  int ret = 0;
  rep (i, 16) {
    ret += (s[i] != target[i]);
  }
  cout << ret << endl;
}

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

  string s;
  while (cin >> s) {
    solve(s);
  }
  return 0;
}


Measured memory_bytes: 384
x1,x2,x3,x4,x5=map(int,input().split())
list=[]
list.append(x1)
list.append(x2)
list.append(x3)
list.append(x4)
list.append(x5)
for i in range(5):
  if list[i]==0:
    print(i+1)
    break

Measured memory_bytes: 9180
#include <bits/stdc++.h>
#define ll long long
#define MAX 2999
ll mod = pow(10,9) + 7;
ll dp[22][1<<21];

using namespace std;

int main()
{
    int n;
    cin >> n;
    int A[n][n];
    for(int i=0; i<n; i++){
        for(int j=0; j<n; j++) cin >> A[i][j];
    }

    for(int i=0; i<=n; i++){
        for(int j=0; j<(1<<n); j++) dp[i][j] = 0;
    }

    dp[0][0] = 1;

    for(int i=1; i<=n; i++){
        for(int mask = 0; mask < int(1<<n); mask++){
            int k = __builtin_popcount(mask);
            if(k != i) continue;
            for(int j=0; j<n; j++){
                if(A[i-1][j] == 1 && int(mask&(1<<j)) != 0){
                    dp[i][mask] = (dp[i][mask]%mod + dp[i-1][int(mask^(1<<j))]%mod)%mod;
                }
            }
        }
    }

    cout << dp[n][(1<<n)-1];
}


Measured memory_bytes: 360704
def s(): return input()
def i(): return int(input())
def S(): return input().split()
def I(): return map(int,input().split())
def X(): return list(input())
def L(): return list(input().split())
def l(): return list(map(int,input().split()))
count = 0
ans = -1

K = i()
N = "7"
s = 10
if K == 7 or K == 1:
    print(1)
    exit()
if K % 2 == 0:
    print(-1)
    exit()
mod = 7 % K

for i in range(10**7):
    if mod == 0:
        print(i+1)
        exit()
    else:
        mod *= 10
        mod += 7
        mod %= K
print(-1)


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

int main( void )
{
    int n;
    cin >> n;
    int ans;
    if ( n % 2 == 0 )
    {
        ans = ( n / 2 ) * ( n / 2 );
    }
    else
    {
        ans = ( n / 2 ) * ( n / 2 + 1 );
    }
    cout << ans << endl;

    return 0;
}


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

int main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);

 
        int r;
        cin >> r;

        double ans = 2*(22.0 / 7.0) * (double)(r);
        cout << ans;
    

    return 0;
}

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

int32_t main() {
    
   int a,b;
   cin >> a >> b;
   int n=1+floor(log10(b));
   int x=(int)pow(10,n);
   int p=(a*x)+b;
   
   int q=(int)sqrt(p);
   if(q*q==p)
   cout << "Yes";
   else
   cout << "No";
    
    return 0;
}

Measured memory_bytes: 512
#include <bits/stdc++.h>
#include <typeinfo>
#include <cxxabi.h>
#ifdef LOCAL
#include "dbgtoki.hpp"
#define DUMP(i) dump((string)TOSTRING(i), demangle(typeid(i).name()), __LINE__ , i) 
#else
#define DUMP(i) 
#endif

#define TOSTRING(x) #x
#define SZ(x) (int)(x).size()
#define REP(i,n) for(int i=0;i<(n);i++)
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define ALL(s) (s).begin(), (s).end()
#define UNIQUE(v) v.erase( unique(v.begin(), v.end()) , v.end());

using namespace std;
typedef long long unsigned int llu;
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vll;
const int EPS = 1e-9;
const int MOD = 1e9+7;

int main (){
  cin.tie(0);
  ios::sync_with_stdio(false);
  int a,b;
  cin >> a >> b;
  if(a >= 9 || b >= 9){
    cout << ":(" << endl;
  }else{
    cout << "Yay!" << endl;
  }
  return 0;
}



Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <numeric>
#include <iomanip>

using namespace std;    
typedef long long ll;
#define all(x) (x).begin(),(x).end()
#define rall(x) (x).rbegin(),(x).rend()

vector<int> rem(11);
int sw[11][11];

int N, M;
int ans;

void dfs(vector<int>v ,int depth ){
    if(depth == N){
        //for(int i = 0; i <= N; i++) cout << v[i] ;
        //cout << endl;
        int cnt = 0;
        for(int i = 1; i <= M; i++){
            int sw_cnt = 0;
            for(int j = 1; j <= N; j++){
                if(sw[i][j] == 1 && v[j] == 1) {
                    sw_cnt ++;
                }
            }
           // if(v[1] == 0 && v[2] == 1) cout << "swcnt:" << sw_cnt << endl;
            if( (sw_cnt % 2) == rem[i] ){
                cnt ++;
            } 
        }
        //cout << "cnt:" << cnt << endl;
        if(cnt == M){
            ans ++;
            //cout << "ams" << endl;
            //for(int i = 0; i <= N; i++) cout << v[i] ;
            //cout << endl;
            for(int i = 1; i <= M; i++){
                for(int j = 1; j <= N; j++){
              //      cout << sw[i][j];
                }
             //   cout << endl;
            }
        } 
    }
    else{
        for(int i = 0; i < 2; i++){
            v[depth + 1] = i;
            dfs(v, depth + 1); 
        }
    }


}

int main(){

    cin >> N >> M;

    //[i][j]:電球iはスイッチj
    for(int i = 0; i <= 10; i++){
        for(int j = 0; j <= 10; j++){
            sw[i][j] = 0;
        }
    }

    for(int i = 1; i <= M; i++){
        int k;
        cin >> k;
        for(int ik = 0; ik < k; ik++){
            int s;
            cin >> s;
            sw[i][s] = 1; 
        }
    }

    

    for(int i = 1; i <= M; i++){
        for(int j = 1; j <=N ; j++){
     //       cout << sw[i][j];
        }
      //  cout << endl;
    }

    for(int i = 0; i < M; i++){
        cin >> rem[i+1];
    }

   // cout<< "r" << endl;
    for(int i  = 1; i <= M; i++){
     //   cout << rem[i] << endl;
    }

    vector<int> v(11);
    dfs(v, 0);
    cout << ans << endl;


}

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

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

  vector<int> c(n);
  for (int i = 0; i < m; ++i) {
    int a, b;
    cin >> a >> b;

    ++c[a - 1];
    ++c[b - 1];
  }

  for (int i = 0; i < n; ++i) {
    cout << c[i] << endl;
  }
  return 0;
}


Measured memory_bytes: 256
#include<stdio.h>

int main(int argc, char const *argv[]){
	long long i,n,m,a,b,p=1000000007;
	scanf("%lld %lld",&n,&m);
	if(n==m){
		a=1;
		for(i=n;i>0;i--){
			a*=i;
			a%=p;
		}
		printf("%lld\n",(a*2%p)*a%p);
	}else if(n==(m+1)){
		a=1;
		for(i=m;i>0;i--){
			a*=i;
			a%=p;
		}
		b=a*n%p;
		printf("%lld\n",a*b%p);
	}else if(m==(n+1)){
		a=1;
		for(i=n;i>0;i--){
			a*=i;
			a%=p;
		}
		b=a*m%p;
		printf("%lld\n",a*b%p);
	}else printf("0\n");
	return 0;
}

Measured memory_bytes: 128
L[2001],i,j,k,s;main(){for(;~scanf("%d",L+k++););for(qsort(L+1,*L,4,"\x8b\7+\6Ð");i++<*L;)for(j=i;j++<*L;)for(k=j;k++<*L;)s+=L[k]<L[i]+L[j];printf("%d",s);}

Measured memory_bytes: 128
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Map.Entry;
import java.util.PriorityQueue;
import java.util.Scanner;

class Main {
    static final int MOD = 1000000007;
    static final int INF = 1 << 30;
    static final int ALF = 26;

    Main() {
        Scanner sc = new Scanner(System.in);
        int R = sc.nextInt();
        System.out.println(Math.PI*R*2);
    }

    public static void main(String[] args) {
        new Main();
    }
}


Measured memory_bytes: 35988
#include<iostream>
#include<cstdio>
#include<algorithm>
using namespace std;
typedef long long LL;

//计算 1^2^3...^n
LL Xor(LL n) {
	if (n%4==1) return 1;
	else if (n%4==2) return n+1;
	else if (n%4==3) return 0;
	else return n;
}

int main()
{
	LL A,B; cin>>A>>B;
	if (A==0) cout<<Xor(B); 
	else cout<<((Xor(A-1)) ^ (Xor(B)));
	return 0;
}

Measured memory_bytes: 256
#include <cstdio>
#include <iostream>
#include <string>
#include <vector>
#include <sstream>
#include <map>
#include <set>
#include <queue>
#include <algorithm>
#include <cmath>
#include <cstring>
#include <typeinfo>
#include <numeric>
#include <functional>
#include <unordered_map>
#include <bitset>
#include <stack>
#include <assert.h>
#include <unordered_set>
#include <random>
#include <atcoder/all>


using namespace std;
using namespace atcoder;
using ll = long long;
using ull = unsigned long long;

const ll INF = 1e18;
const ll MOD = 1e9 + 7;


#define REP(i, n) for(ll i = 0; i < n; i++)


















ll op(ll a, ll b){
    return a + b;
}

ll e(){
    return 0;
}

int main(){
    ll n, Q;
    cin >> n >> Q;
    vector<ll> a(n);
    segtree<ll, op, e> tree(a);
    REP(i, n){
        cin >> a[i];
        tree.set(i, a[i]);
    }
    REP(i, Q){
        ll q;
        cin >> q;
        if(q == 0){
            ll p, x;
            cin >> p >> x;
            tree.set(p, tree.get(p) + x);
        }
        else{
            ll l, r;
            cin >> l >> r;
            cout << tree.prod(l, r) << endl;
        }
    }
}

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

int main()
{
  int a, b, c, X, count = 0;
  cin >> a >> b >> c >> X;

  for (int i = 0; i <= a; i++)
  {
    for (int j = 0; j <= b; j++)
    {
      for (int k = 0; k <= c; k++)
      {
        if ((500 * i) + (100 * j) + (50 * k) == X)
        {
          count++;
        }
      }
    }
  }
  cout << count << endl;
}


Measured memory_bytes: 3636
n, y = map(int,input().split())

import sys
for yukichi in range(n+1):
    for ichiyo in range(n+1):
        if 0 <= n - (yukichi + ichiyo) <= n and n - (yukichi + ichiyo) == (y - (10000 * yukichi + 5000 * ichiyo))/1000:
            print(yukichi, ichiyo, n - yukichi - ichiyo)
            sys.exit()
            
print('-1 -1 -1')

Measured memory_bytes: 3060
n = int(input())
p = [x for x in map(int, input().split())]

cnt = 0
for i in range(n-2):
    l = [p[i], p[i+1], p[i+2]]
    if max(l) != p[i+1] and min(l) != p[i+1]:
        cnt += 1

print(cnt)

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

int main() {
  int N, A, B;
  int x;
  cin >> N >> A >> B;
  x = N * A;
  if(x <= B){
    cout << x << endl;
  }
  else {
    cout << B << endl;
  }
  return 0;
}

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

#define ll long long
#define vi vector<int>
#define vl vector<ll>
#define pii pair<int,int>
#define pll pair<ll,ll>
// pll pp; -> (pp.first,pp.second)
// vector<vl> pp(n,vl(2)); sort(pp.begin(),pp.end(),[](vl a,vl b){return a[0]<b[0];});

#define REP(i,n) for(ll (i)=0;(i)<(n);(i)++)
#define RREP(i,n) for(ll (i)=(n)-1;(i)>=0;(i)--)
#define FOR(i,a,b) for(ll (i)=(a);(i)<(b);(i)++)
#define FORR(i,a,b) for(ll (i)=(b)-1;(i)>=(a);(i)--)
#define DEBUG(x) cout << #x << ": " << x << endl
#define CHMAX(a,b) a=max((a),(b))
#define CHMIN(a,b) a=min((a),(b))
/*}}}*/
int main() {
  string s;
  cin >> s;
  ll ans;
  if(s=="SUN") ans = 7;
  if(s=="MON") ans = 6;
  if(s=="TUE") ans = 5;
  if(s=="WED") ans = 4;
  if(s=="THU") ans = 3;
  if(s=="FRI") ans = 2;
  if(s=="SAT") ans = 1;
  
  //cout << fixed << setprecision(10);
  cout << ans << endl;
  return 0;
}


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

int main(){
    int s,s1,s2,s3;
    cin >> s;
    s1 = s / 100;
    s2 = (s - s1 * 100) / 10;
    s3 = s - s1 * 100 - s2 * 10; 
    cout << s1 + s2 + s3;
}


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

#define MOD (1000000000+7)

int main()
{
	int n, k;
	cin >> n >> k;
	vector<int> a( n );
	for( int i = 0; i < n; i++ ) {
		cin >> a[i];
	}

	vector<vector<vector<long long>>> dp( n + 1, vector<vector<long long>>( 256, vector<long long>( n + 1 ) ) );
	dp[0][0][0] = 1;
	for( int i = 0; i < n; i++ ) {
		for( int j = 0; j < n + 1; j++ ) {
			for( int kk = 0; kk < 256; kk++ ) {
				dp[i + 1][kk][j] += dp[i][kk][j];
				dp[i + 1][kk][j] %= MOD;
				int K = kk ^ a[i];
				dp[i + 1][K][j + 1] += dp[i][kk][j];
				dp[i + 1][K][j + 1] %= MOD;
			}
		}
	}
	long long ans = 0;
	long long fac = 1;
	for( int j = 1; j < n + 1; j++ ) {
		fac *= j;
		fac %= MOD;
		ans += dp[n][k][j] * fac % MOD;
		ans %= MOD;
	}

	cout << ans << endl;
}


Measured memory_bytes: 21632
#include <stdio.h>
#define LL long long
#define eps 1e-6
int main(){
	LL a,b,c;
	double d;
	scanf("%lld%lf",&a,&d);
	d+=eps;
	b=d*100;
	//printf("a=%lld b=%lld c=%lld %lld\n",a,b,a*b,a*b/100);
	c=a*b/100;
	printf("%lld\n",c);
}

Measured memory_bytes: 1752
#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;
typedef tree<int, null_type, less<int>, rb_tree_tag,tree_order_statistics_node_update> ordered_set;

#define scan(x) do{while((x=getchar())<'0'); for(x-='0'; '0'<=(_=getchar()); x=(x<<3)+(x<<1)+_-'0');}while(0)
char _;
#define complete_unique(a) a.erase(unique(a.begin(),a.end()),a.end())
#define all(a) a.begin(),a.end()
#define println printf("\n");
#define readln(x) getline(cin,x);
#define pb push_back
#define endl "\n"
#define INT_INF 0x3f3f3f3f
#define LL_INF 0x3f3f3f3f3f3f3f3f
#define MOD 1000000007
#define MOD2 1494318097
#define SEED 131
#define mp make_pair
#define fastio cin.tie(0); cin.sync_with_stdio(0);

#define MAXN 105

typedef unsigned long long ull;
typedef long long ll;
typedef long double ld;
typedef unordered_map<int,int> umii;
typedef pair<int,int> pii;
typedef pair<double,double> pdd;
typedef pair<ll,ll> pll;
typedef pair<int,pii> triple;
typedef int8_t byte;

mt19937 g1(time(0));

int randint(int a, int b){return uniform_int_distribution<int>(a, b)(g1);}
ll randlong(ll a,ll b){return uniform_int_distribution<long long>(a, b)(g1);}

ll gcd(ll a, ll b){return b == 0 ? a : gcd(b, a % b);}
ll lcm(ll a, ll b){return a*b/gcd(a,b);}
ll fpow(ll  b, ll exp, ll mod){if(exp == 0) return 1;ll t = fpow(b,exp/2,mod);if(exp&1) return t*t%mod*b%mod;return t*t%mod;}
ll divmod(ll i, ll j, ll mod){i%=mod,j%=mod;return i*fpow(j,mod-2,mod)%mod;}

char s[MAXN];
int len,K;
set<char> se;

inline pair<int,pii> calc(int l, int r){
	int cnt = 1, res = 0, fst = -1;
	for(int i=l+1; i<=r; i++){
		if(s[i] == s[i-1]) cnt++;
		else{
			if(fst == -1) fst = cnt;
			else res+=cnt/2;
			cnt = 1;
		}
	}
	return mp(res,mp(fst,cnt));
}

int main(){
	scanf("%s %d",s+1,&K); len = (int)strlen(s+1);
	if(len == 1) return 0*printf("%d\n",K/2);
	for(int i=1; i<=len; i++) se.insert(s[i]);
	if(se.size() == 1) return 0*printf("%lld\n",1LL*len*K/2);
	pair<int,pii> tmp = calc(1,len);
	if(s[1] != s[len]) printf("%lld\n",1LL*(tmp.first+tmp.second.first/2+tmp.second.second/2)*K);
	else{
		ll res = 1LL*tmp.first*K;
		res+=1LL*(tmp.second.first+tmp.second.second)/2*(K-1);
		res+=tmp.second.first/2+tmp.second.second/2;
		printf("%lld\n",res);
	}
}

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

const int MAXN = 15;
const int mod = 1000000007;
typedef long long LL;
void reduce(int & x) { x += x >> 31 & mod; }
int out[MAXN], n, m;
int f[1 << 15];
inline bool g(int x) { return (x & 3) == 0 || (x & 3) == 3; }
inline int h(int x) { return 1 << __builtin_popcount(x); }
#define X (T >> j & 1)
int main() {
	std::ios_base::sync_with_stdio(false), std::cin.tie(0);
	std::cin >> n >> m;
	for (int i = 1, x, y; i <= m; ++i)
		std::cin >> x >> y, out[--x] |= 1 << --y;
	f[0] = 1; const int U = 1 << n;
	int ans = 1; while (m--) reduce(ans += ans - mod);
	for (int i = 1; i != U; ++i) if (g(i)) {
		for (int S = i; S; S = S - 1 & i) if (g(S)) {
			int T = i - S, t = 1;
			for (int j = 0; j != n; ++j) if (i >> j & 1)
				t = (LL) t * (h(out[j] & (X ? S : T)) - X) % mod;
			reduce(f[i] += (LL) t * f[T] % mod - mod);
		}
	}
	reduce(ans -= f[U - 1]);
	std::cout << ans << '\n';
	return 0;
}


Measured memory_bytes: 384