akhauriyash/Code-Regression huggingface dataset:
/* ---------- STL Libraries ---------- */
// IO library
#include <cstdio>

#include <fstream>
#include <iomanip>
#include <ios>
#include <iostream>

// algorithm library
#include <algorithm>

#include <cmath>
#include <numeric>
#include <random>
#include <cstring>
#include <cassert>

// container library
#include <array>
#include <bitset>
#include <deque>
#include <map>
#include <unordered_map>
#include <queue>
#include <set>
#include <string>
#include <tuple>
#include <vector>
#include <stack>

// type
#include <cstdint>
#include <functional>

/* ---------- Namespace ---------- */
using namespace std;

/* ---------- Type ---------- */
using ll = long long;
#define int ll
template <class T> using MaxHeap = priority_queue<T>;
template <class T> using MinHeap = priority_queue<T, vector<T>, greater<T>>;
#define P pair<ll, ll>

/* ---------- Constants  */
const double PI = 3.141592653589793238462643383279;
const ll MOD = 1e9 + 7;
const int INF = 1LL << 55;

/* ---------- Functions */
template<class T> bool chmax(T &a, const T &b) { if (a < b) { a = b; return true; } return false; }
template<class T> bool chmin(T &a, const T &b) { if (a > b) { a = b; return true; } return false; }

/* v-v-v-v-v-v-v-v-v Main Part v-v-v-v-v-v-v-v-v */
signed main() {
    cin.sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);

    int X;
    cin >> X;
    int cnt = X / 500;
    int remain = X - cnt * 500;
    int cnt2 = remain / 5;
    cout << cnt * 1000 + cnt2 * 5 << endl;

    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <map>
#include <set>
#include <algorithm>
#include <fstream>
#include <string>
#include <math.h>
#include <cstdlib>
#include <istream>
#include <sstream>
#include <cctype>
#include <iomanip>
//cout << fixed << setprecision(20) << *** << endl;
#define rep(i,N) for(int i=0;i<(int)N;++i)
typedef long long ll;
using namespace std;
//ユークリッド
ll gcd(ll a,ll b){
	ll t;
	if(a<b){
		t=a;
		a=b;
		b=t;
	}
	if(a%b==0)return b;
	return gcd(b,a%b);
}
//階乗
ll Factorial(ll a){
	ll b=1;
	for(ll i=a;i>=1;i--){
		b=b*i;
	}
	return b;
}
//素数判定
bool prime(ll n){
	for(ll i=2;i*i<=n;i++){
		if(n%i==0) return false;
	}
	return true;
}
int main()
{
	ll N,p,q;
	vector<ll>P,Q,V;
	cin>>N;
	for(ll i=1;i<=N;i++){
		ll t;
		cin>>t;
		P.push_back(t);
		V.push_back(i);
	}
	for(ll i=1;i<=N;i++){
		ll t;
		cin>>t;
		Q.push_back(t);
	}
	rep(i,Factorial(N)){
		bool F=false;
		rep(j,N){
			if(V[j]!=P[j])break;
			if(V[j]==P[j]&&j==N-1)F=true;
		}
		if(F==true){
			p=i+1;
			break;
		}
		next_permutation(V.begin(),V.end());
	}
	sort(V.begin(),V.end());
	rep(i,Factorial(N)){
		bool F=false;
		rep(j,N){
			if(V[j]!=Q[j])break;
			if(V[j]==Q[j]&&j==N-1)F=true;
		}
		if(F==true){
			q=i+1;
			break;
		}
		next_permutation(V.begin(),V.end());
	}
	cout<<abs(p-q)<<endl;
}

Measured memory_bytes: 256
N, M = map(int, input().split())
# 任意の値、要素数で初期化
l = [0] * N
for i in range(M):
    # 1 2 が入力されたらリストの 0と1 をインクリメントする
    a, b = [int(x) - 1 for x in input().split()]
    l[a] += 1
    l[b] += 1

for i in range(N):
    print(l[i])

Measured memory_bytes: 3060
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;

#define REP(i,n) for(long long i = 0; i < (n); i++)
#define FOR(i, m, n) for(long long i = (m);i < (n); ++i)
#define ALL(obj) (obj).begin(),(obj).end()
#define SPEED cin.tie(0);ios::sync_with_stdio(false);

template<class T> using V = vector<T>;
template<class T, class U> using P = pair<T, U>;

const ll MOD = (ll)1e9 + 7;
const ll MOD2 = 998244353;
const ll HIGHINF = (ll)1e18;
const ll LOWINF = (ll)1e15;
const long double PI = 3.1415926535897932384626433;

template<typename T> vector<T> make_v(size_t N,T init){return vector<T>(N,init);}
template<typename... T> auto make_v(size_t N,T... t){return vector<decltype(make_v(t...))>(N,make_v(t...));}
template <class T> void corner(bool flg, T hoge) {if (flg) {cout << hoge << endl; exit(0);}}
template <class T, class U>ostream &operator<<(ostream &o, const map<T, U>&obj) {o << "{"; for (auto &x : obj) o << " {" << x.first << " : " << x.second << "}" << ","; o << " }"; return o;}
template <class T>ostream &operator<<(ostream &o, const set<T>&obj) {o << "{"; for (auto itr = obj.begin(); itr != obj.end(); ++itr) o << (itr != obj.begin() ? ", " : "") << *itr; o << "}"; return o;}
template <class T>ostream &operator<<(ostream &o, const multiset<T>&obj) {o << "{"; for (auto itr = obj.begin(); itr != obj.end(); ++itr) o << (itr != obj.begin() ? ", " : "") << *itr; o << "}"; return o;}
template <class T>ostream &operator<<(ostream &o, const vector<T>&obj) {o << "{"; for (int i = 0; i < (int)obj.size(); ++i)o << (i > 0 ? ", " : "") << obj[i]; o << "}"; return o;}
template <class T, class U>ostream &operator<<(ostream &o, const pair<T, U>&obj) {o << "{" << obj.first << ", " << obj.second << "}"; return o;}
template <template <class tmp>  class T, class U> ostream &operator<<(ostream &o, const T<U> &obj) {o << "{"; for (auto itr = obj.begin(); itr != obj.end(); ++itr)o << (itr != obj.begin() ? ", " : "") << *itr; o << "}"; return o;}
void print(void) {cout << endl;}
template <class Head> void print(Head&& head) {cout << head;print();}
template <class Head, class... Tail> void print(Head&& head, Tail&&... tail) {cout << head << " ";print(forward<Tail>(tail)...);}
template <class T> void chmax(T& a, const T b){a=max<T>(a,b);}
template <class T> void chmin(T& a, const T b){a=min<T>(a,b);}
void YN(bool flg) {cout << ((flg) ? "YES" : "NO") << endl;}
void Yn(bool flg) {cout << ((flg) ? "Yes" : "No") << endl;}
void yn(bool flg) {cout << ((flg) ? "yes" : "no") << endl;}

int main() {
	int A,B; cin >> A >> B;
	if(A>=13) cout << B << endl;
	else if(6 <= A && A <= 12) cout << B/2 << endl;
	else cout << 0 << endl;
	

	return 0;
}


Measured memory_bytes: 256
import java.util.*;
public class Main {
    public static void main(String [] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int M = sc.nextInt();
        Map<Integer,ArrayList<Integer>> Edge = new HashMap<>();
        Map<Integer,ArrayList<Integer>> Edge2 = new HashMap<>();
        Map<Integer,ArrayList<Integer>> Edge3 = new HashMap<>();
        int DP [] = new int[N+1];
        Arrays.fill(DP,0);
        ArrayList<Integer> S = new ArrayList<>();
        Queue<Integer> L = new ArrayDeque<>();
        for(int i=0;i<M;i++){
            int x = sc.nextInt();
            int y = sc.nextInt();
            if(Edge.get(y)==null){
                ArrayList<Integer> E = new ArrayList<>();
                ArrayList<Integer> E2 = new ArrayList<>();
                E.add(x);
                E2.add(x);
                Edge.put(y,E);
                Edge3.put(y,E2);
            }
            else{
                Edge.get(y).add(x);
                Edge3.get(y).add(x);
            }
            if(Edge2.get(x)==null){
                ArrayList<Integer> E = new ArrayList<>();
                E.add(y);
                Edge2.put(x,E);
            }
            else Edge2.get(x).add(y);
        }
        int max = 0;
        for(int i=1;i<N+1;i++) if(Edge.get(i)==null) L.add(i);
        while(L.size()!=0) {
            int source = L.poll();
            S.add(source);
            if(Edge2.get(source)!=null){
                for(int sink:Edge2.get(source)){
                    Edge.get(sink).remove(Edge.get(sink).indexOf(source));
                    DP[sink] = Math.max(DP[sink],DP[source]+1);
                    if(max<DP[sink])max =DP[sink];
                    if(Edge.get(sink).size()==0) L.add(sink);
                }
            }
        }
        System.out.println(max);
    }
}

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

typedef long long ll;

int main(){
    //freopen("in.txt", "r", stdin);
    ll n;
    ll a, mini = __LONG_LONG_MAX__;
    cin>>n;

    for (int i=0;i<5;++i){
        cin>>a;
        mini = min(a, mini);
    }

    ll ans = n/mini;
    if (n%mini != 0) ans++;
    ans += 4;
    cout<<ans<<endl;

    return 0;
}

Measured memory_bytes: 256
object Main extends App {
  @scala.annotation.tailrec
  def isPrime(x: Int, count: Int): Boolean =
    if (x % count == 0) false
    else if (x < count * count) true
    else isPrime(x, count + 1)
  @scala.annotation.tailrec
  def loop(i: Int): Int = if(i == 2) 2 else if (isPrime(i, 2)) i else loop(i + 1)
  val sc = new java.util.Scanner(System.in)
  val x = sc.nextInt()
  println(loop(x))
}


Measured memory_bytes: 55384
#include<iostream>
#include<string>
#include<cstring>
#include<string.h>
#include <bits/stdc++.h>
using namespace std;
int main(){
long long sum=0;
string s;cin>>s;
string x;cin>>x;
if(x==s){
	cout<<0;
}
else{
for(long long i=0;i<s.size();i++){
	if(s[i]!=x[i]){
		sum++;
	}
}
cout<<sum;
}
}

Measured memory_bytes: 3920
#include<bits/stdc++.h>
#define int long long
using namespace std;
int read(){
	char c=getchar();while (c!='-'&&(c<'0'||c>'9'))c=getchar();
	int kk=1,k=0;if (c=='-')kk=-1,c=getchar();
	while (c>='0'&&c<='9')k=k*10+c-'0',c=getchar();return kk*k;
}int n,a[1000000],ans;
signed main(){
	n=read();for (int i=1;i<=n;i++)a[i]=read()+a[i-1];
	ans=1e15;for (int i=1;i<n;i++)ans=min(ans,abs(a[n]-a[i]*2));
	cout<<ans<<endl;
}


Measured memory_bytes: 1792
#include<cstdio>
#include<vector>
#include<set>
using namespace std;

int m, n;
vector<pair<int, int> > want;
set<pair<int, int> > real;

int main()
{
  while(scanf("%d", &m) && m) {
    //init
    want.clear();
    real.clear();

    int x, y;
    for(int i = 0; i < m; i++) {
      scanf("%d%d", &x, &y);
      want.emplace_back(x, y);
    }

    scanf("%d", &n);
    for(int i = 0; i < n; i++) {
      scanf("%d%d", &x, &y);
      real.emplace(x, y);
    }

    for(auto star: real) {
      int dx = star.first  - want[0].first;
      int dy = star.second - want[0].second;

      int i;
      for(i = 0; i < m; i++) {
        if(real.find(make_pair(want[i].first + dx, want[i].second + dy)) == real.end()) break;
      }

      if(i == m) printf("%d %d\n", dx, dy);
    }
  }

  return 0;
}



Measured memory_bytes: 2708
lst = list(input())
r = ['R', 'U', 'D']
l = ['L', 'U', 'D']
ans = True
for i, e in enumerate(lst):
  ii = i +1
  if ii%2 == 0 and e not in l:
    ans = False
    break
  if ii%2 != 0 and e not in r:
    ans = False
    break
print('Yes' if ans else 'No')

Measured memory_bytes: 3060
#include <bits/stdc++.h>
using namespace std;
 
int main(){
  int x,n;
  cin >> x >> n;
  bool arrayOfLight[102] = {false};
  
  int temp;
  for (int i = 0; i < n; i++){
	cin >> temp;
    arrayOfLight[temp] = true;
  }
  
  int ans = 0;
  
  for (int i = 0; i <= 101; i++){
    if (arrayOfLight[i] == false){
      if(abs(x-i) < abs(x-ans)){
        ans = i;
      }
    }
  }
         
  cout << ans;
  return 0;
}



Measured memory_bytes: 3632
#include <iostream>

using namespace std;

#define rep(i, a, n) for(int i = a; i < (n); ++i)

int main(){
  int n, y;
  scanf("%d%d", &n, &y);

  rep(i, 0, n+1) {
    rep(j, 0, n+1) {
      int k = n - i - j;
      if (k < 0) continue;
      //printf("%d %d %d\n", i, j, k);
      if (i*10000 + j*5000 + k*1000 == y) {
        printf("%d %d %d\n", i, j, k);
        exit(0);
      }
    }
  }
  printf("-1 -1 -1\n");
}

Measured memory_bytes: 256
#include <cstdio>
#include <cassert>
#include <algorithm>    
#include <iostream>
#include <vector>
#include <queue>
#include <map>
#include <set>
#include <iomanip>
#include <cstring>
#include <cmath>
#include <bitset>
#define pb push_back
#define mk make_pair
#define eb emplace_back
#define eps 1e-8
#define fi first
#define se second
#define all(x) (x).begin(),(x).end()
#define int long long
using namespace std;

typedef long double ld;
typedef unsigned int ui;
typedef pair<int,int> pii;
typedef tuple<int, int, int> tiii;
typedef unsigned long long ull; 
typedef vector<int> vii;
typedef vector<long double> vd;
const int inf = 1e9;
const int INF = 1e18;
const int M = 1e9 + 7;
//__int128

const int maxn = 3e5;
int a[maxn], b[maxn];
signed main()
{
#ifndef ONLINE_JUDGE
    // freopen("in.txt", "r", stdin);
    // freopen("out.txt", "w", stdout);
#endif
    ios::sync_with_stdio(false);
    cin.tie(0);
    int n;
    cin >> n;
    for(int i = 1; i <= n; ++i) {
    	cin >> a[i];
    }
    int res = 0;
    for(int i = n; i >= 1; --i) {
    	int t = 0;
    	for(int j = i + i; j <= n; j += i) {
    		if(b[j]) {
    			t ^= 1;
    		}
    	}
    	if(t != a[i]) {
    		b[i] = 1;
    		++res;
    	}
    }
    cout << res << endl;
    for(int i = 1; i <= n; ++i){
    	if(b[i]) {
    		cout << i << endl;
    	}
    }

    return 0;
}

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

int main(){
    int q;
    cin >> q;
    map<string, int> mp;
    for(int i=0; i<q; i++){
        int a;
        string key;
        cin >> a >> key;
        if(a == 0){
            int x;
            cin >> x;
            mp[key] = x;
        }else if(a == 1){
            auto itr = mp.find(key);
            if( itr != mp.end() ) {
                cout << mp[key] << endl;
            } else {
                cout << 0 << endl;
            }
        }else if(a == 2){
            mp.erase(key);
        }else{
            string r;
            cin >> r;
            auto left = mp.lower_bound(key);
            auto right = mp.upper_bound(r);
            for(auto itr = left; itr != right; ++itr) {
                cout << itr->first << " " << itr->second << endl;
            }
        }
    }
    return 0;
}


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

int main() {

	int a, b, c; cin >> a >> b >> c;
	bool can = false;
	for (int i = 1; i <= b; i++) {
		if (a * i % b == c) {
			can = true;
			break;
		}
	}
	if(can) cout << "YES" << endl;
	else  cout << "NO" << endl;
	return 0;
}

Measured memory_bytes: 256
#include<iostream>

using namespace std;

int main()
{

    int n;
    cin>>n;

    int k;
    cin>>k;

    int T=0;

    for(int i=0;i<k;i++)
    {
        int x;
        cin>>x;

        T|=(1<<x);
    }

    for(int i=0;i<(1<<n);i++)
    {
        if((i&T)==T) cout<<i<<":";
        else continue;

        for(int j=0;j<n;j++)
        {
            if((i>>j)&1) cout<<" "<<j;
        }
        cout<<endl;
    }

    return 0;
}



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

int main() {
  int N;
  cin>>N;
  vector<int>V(N);
  for(int i=0;i<N;i++)cin>>V.at(i);
  int count,X;
  count=0;
  X=0;
  for(int i=0;i<N-1;i++){
    if(V.at(i)>=V.at(i+1))count++;
    else count=0;
      X=max(X,count);
  }
  cout<<X<<endl;

   
}

Measured memory_bytes: 640
/* ***********************************************
Author        :yang12138
Created Time  :2017年07月07日 星期五 16时21分15秒
File Name     :B.cpp
************************************************ */
#include <iostream>
#include <stdio.h>
#include <cstring>
#include <algorithm>
#include <string>
#include <math.h>
#include <cstdlib>
#include <vector>
#include <queue>
#include <set>
#include <map>
using namespace std;
#define mem(a,b) memset(a,b,sizeof(a))
typedef long long ll;
typedef pair<int,int>pii;
#define lson (root<<1)
#define rson (root<<1|1)

const int N=1e5+10;
const int mod=1e9+7;

ll fact[N],inv[N];

ll quick_pow(ll base,ll n){
	ll ans=1;
	while(n){
		if(n&1) ans=ans*base%mod;
		base=base*base%mod;
		n>>=1;
	}
	return ans;
}

void init(){

	fact[0]=inv[0]=1;
	for(int i=1;i<N;i++){
		fact[i]=fact[i-1]*i%mod;
		inv[i]=quick_pow(fact[i],mod-2);
	}

}

ll C(int n,int m){
	return fact[n]*inv[m]%mod*inv[n-m]%mod;
}

int inter(int l1,int r1,int l2,int r2){
	return max(0,min(r1,r2)-max(l1,l2)+1);
}

int a[N],pre[N],ans[N];
int main(){
    //freopen("in.txt","r",stdin);
    //freopen("out.txt","w",stdout);

	init();
	
	int n;
	scanf("%d",&n);
	int l,r;
	for(int i=1;i<=n+1;i++){
		scanf("%d",a+i);
		if(pre[a[i]]!=0){
			r=i,l=pre[a[i]];
		}
		pre[a[i]]=i;
	}

	for(int i=1;i<=n+1;i++){
		ans[i]=C(n+1,i);
	}

	int L=l-1,R=n+1-r;
	for(int i=0;i<=L+R;i++){
		ans[i+1]-=C(L+R,i);
		ans[i+1]=(ans[i+1]+mod)%mod;
	}

	for(int i=1;i<=n+1;i++){
		printf("%d\n",ans[i]);
	}
 
    return 0;
}


Measured memory_bytes: 3968
module global_variables
  integer,parameter::max_n = 200
  integer,parameter::inf = 1000000000
  integer n
  integer::a(max_n)
end module global_variables
program main
  use global_variables
  implicit none
  integer i,res,tmp
  read *, n
  read *, (a(i),i=1,n)
  res = inf
  do i=1,n
    tmp = 0
    do while (a(i) > 0 .and. ibits(a(i),0,1)==0)
      tmp = tmp + 1
      a(i) = a(i) / 2
    enddo
    res = min(res,tmp)
  enddo
  print '(i0)', res
end program main


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

int main(){
	int n;
	cin >> n;
	vector<int> a(n);
	rep(i, n) cin >> a[i];
	vector<int> b(n);
	rep(i, n) cin >> b[i];
	vector<int> c(n-1);
	rep(i, n - 1) cin >> c[i];
	rep(i, n) a[i]--;

	int ans = 0;
	rep(i, n) {
		ans += b[a[i]];
	}

	rep(i, n - 1) {
		if (a[i] + 1 == a[i + 1]) {
			ans += c[a[i]];
		}
	}
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 256
#pragma GCC optimize("Ofast")
#include <bits/stdc++.h>

using namespace std;

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

#define fi first
#define se second
#define mp make_pair
#define fastIO ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);

const int N = 1005;
ll a[N];
bool ok[N];

int main(){
    fastIO;
    int n;
    cin >> n;
    vector<pii> pr[2];
    for(int i = 1; i <= n; i ++ ){
        cin >> a[i];
        pr[i%2].push_back(mp(a[i],i));
    }
    ll mx = -(ll)1e18;
    ll pref = 0;
    int id;
    vector<int> ord;
    for(int par = 0 ; par < 2; par ++ ){
        pref=0;
        id = -1;
        sort(pr[par].begin(), pr[par].end());
        reverse(pr[par].begin(), pr[par].end());
        for(int j = 0 ; j < pr[par].size(); j ++ ){
            pref += pr[par][j].fi;
            if(pref > mx){
                mx = pref;
                id = j;
            }
        }
        
        if(id != -1){
            for(int i = 1; i <= n; i ++ )
                ok[i] = false;
            for(int j = 0 ; j <= id; j ++ ){
                ok[pr[par][j].se] = true;
            }
            vector<bool> ff;
            for(int j = 1; j <= n; j ++ ){
                ff.push_back(ok[j]);
            }
            vector<int> cord;
            while(ff.size() > 1){
                if(ff[0] == false){
                    cord.push_back(0);
                    ff.erase(ff.begin());
                }
                else if(ff.back() == false){
                    cord.push_back((int)ff.size() - 1);
                    ff.pop_back();
                }
                else{
                    for(int j = 0 ; j < ff.size() ; j ++ ){
                        if(ff[j] == 0){
                            if(ff[j - 1] == 0 && ff[j + 1] == 0){
                                ff.erase(ff.begin() + j + 1);
                                ff.erase(ff.begin() + j);
                                cord.push_back(j);
                                break;
                            }
                            else if(ff[j - 1] == 1 && ff[j + 1] == 1){
                                ff.erase(ff.begin() + j + 1);
                                ff.erase(ff.begin() + j);
                                cord.push_back(j);
                                break;
                            }
                        }
                    }
                }
            }
            ord = cord;
        }
    }
    cout << mx << "\n" << ord.size() << "\n";
    for(auto p : ord)
        cout << p + 1 << "\n";
    return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
priority_queue<int>pr, pg, pc;
int aa[100005], bb[100005];
int main()
{
    int x, y, a, b, c, p;
    scanf("%d %d %d %d %d", &x, &y, &a, &b, &c);
    for(int i=0; i<a; i++)scanf("%d", &aa[i]);
    for(int i=0; i<b; i++)scanf("%d", &bb[i]);
    for(int i=0; i<c; i++)scanf("%d", &p), pc.push(-p);
    sort(aa, aa+a, greater<int>());sort(bb, bb+b, greater<int>());
    for(int i=0; i<x; i++)pr.push(-aa[i]);
    for(int i=0; i<y; i++)pg.push(-bb[i]);
    while(!pc.empty())
    {
        int p= -pc.top();
        pc.pop();
        int r= -pr.top();
        int g= -pg.top();
        if(p>r || p>g)
        {
            if(p-r>p-g)pr.pop(), pr.push(-p);
            else pg.pop(), pg.push(-p);
        }
    }
    long long res= 0;
    while(!pr.empty())res+= -pr.top(), pr.pop();
    while(!pg.empty())res+= -pg.top(), pg.pop();
    printf("%lld\n", res);
    return 0;
}


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

int main(){
  int N;
  double T,A;
  cin >> N >> T >> A;
  
  pair<double,int>t[N];
  for(int i=0;i<N;++i){
    double H;
    cin >> H;
    double diff = abs(A-(T-H*0.006));
    
    t[i] = make_pair(diff,i+1);
  }
  
  sort(t,t+N);
  
  cout << t[0].second << endl;
  return 0;
}

Measured memory_bytes: 3792
#include <stdio.h>

#define LL long long
#define ULL unsigned long long
#define UI unsigned int
#define UC unsigned char
#define UL unsigned long

int main() {
	int N;
	scanf("%d", &N);
	int a[N], iSigma = 0;
	for (int i = 0; i < N; i++) {
		scanf("%d", &a[i]);
		iSigma ^= a[i];
	}

	for (int i = 0; i < N; i++)
		printf("%d ", iSigma ^ a[i]);
	printf("\n");
	
	return 0;
}


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

#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rept(i,k,n) for(int i = (k); i < (int)(n); i++)
#define all(v) v.begin(), v.end()
#define Sort(v) sort(v.begin(),v.end())
#define Reverse(v) reverse(v.begin(),v.end())

typedef long long ll;
typedef pair<int,int> Pii;
typedef pair<long long,long long> Pll;

int main() {
    int k,n;
    cin>>k>>n;
    vector<int> a(n);
    rep(i,n) cin>>a[i];
    Sort(a);
    int ma = 0;
    rep(i,n-1) ma = max(a[i+1]-a[i],ma);
    cout<<min(k-ma,a[n-1]-a[0])<<endl;
}


Measured memory_bytes: 1024
using System;
using static System.Console;
using System.Linq;
using System.Collections.Generic;

namespace Main
{
    class Program
    {
        static void Main(string[] args)
        {
            int[] tmp = ReadLine().Split(' ').Select(int.Parse).ToArray();
            int X = tmp[0];
            int Y = tmp[1];
            int Z = tmp[2];

            WriteLine("{0} {1} {2}",Z,X,Y);
        }
    }
}

Measured memory_bytes: 13268
#include <iostream>

long int n, d, x, y, ans = 0;

int main()
{
    std::cin >> n >> d;
    d = d * d;
    for (int i = 0; i < n; i++) {
        std::cin >> x >> y;
        if (d >= x * x + y * y) {
            ans++;
        }
    }
    std::cout << ans << std::endl;
    return 0;
}

Measured memory_bytes: 3540
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		long[] array = new long[n];
		for(int i = 0;i<n;i++) {
			array[i] = sc.nextLong();
		}
		sc.close();

		long ans = 0L;
		for(int i=0;i<n;i++) {
			long a = array[i];
			for(int j=i+1;j<n;j++) {
				long b = array[j];
				for(int k=j+1;k<n;k++) {
					long c = array[k];
					long max;
					long min;
					long mid;
					if(a>=b) {
						max = a;
						min = b;
						if(max>=c) {
							mid = c;
						} else {
							mid = max;
							max = c;
						}
					}else {
						max = b;
						min = a;
						if(max>=c) {
							mid = c;
						} else {
							mid = max;
							max = c;
						}
					}
					long sa = min - mid;
					if(sa<0) {
						sa = -1L*sa;
					}

					if(min+mid>max&&sa<max&&(a!=b&&a!=c&&b!=c)) {
						ans++;
					}

				}

			}

		}
		System.out.println(ans);

	}
}

Measured memory_bytes: 36828
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <deque>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>

using namespace std;

typedef long long ll;

#define MOD 1000000007

int main() {
  int n;
  ll d;
  cin >> n >> d;
  vector<ll> x(n), y(n);
  for (int i = 0; i < n; ++i) {
    cin >> x[i] >> y[i];
  }
  int ans = 0;
  for (int i = 0; i < n; ++i) {
    ll dist = x[i] * x[i] + y[i] * y[i];
    if (dist <= d * d) ans++;
  }
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 6408
#include <iostream>
#include <fstream>
#include <set>
#include <map>
#include <string>
#include <vector>
#include <queue>
#include <deque>
#include <stack>
#include <functional>
#include <algorithm>
#include <climits>
#include <cmath>
#include <iomanip>
using namespace std;
#define ll long long int
#define rep(i,n) for( int i = 0; i < n; i++ )
#define rrep(i,n) for( int i = n; i >= 0; i-- )
#define REP(i,s,t) for( int i = s; i <= t; i++ )
#define RREP(i,s,t) for( int i = s; i >= t; i-- )
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define INF 2000000000
#define mod 1000000007
#define INF2 1000000000000000000


int main(void)
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    int N; cin >> N;
    rep(i, N) {
        int a; cin >> a;

        if(a % 2 == 1) {
            cout << "first" << endl;
            return 0;
        }
    }
    cout << "second" << endl;

    return 0;
}


Measured memory_bytes: 3528
/**
    In the name of Allah, the Most Gracious, the Most Merciful.
**/

#include<bits/stdc++.h>
using namespace std;

typedef long long ll;

const int N = 1e2 + 5;
const int M = 1e6 + 7;

int n;
int ara[3][N], dp[3][N];

int rec(int i, int j) {
    if( i == 2 || j == n ) return 0;
    if( i == 1 && j == n ) return 0;
    int &ret = dp[i][j];
    if( ret != -1 ) return ret;
    ret =  ara[i][j] + max(rec(i+1, j), rec(i, j+1));
    return ret;
}

int main() {
    #ifdef _OFFLINE_
        freopen("A.txt", "r", stdin);
    #endif /// _OFFLINE_

    cin >> n;
    for(int i=0; i<2; i++) {
        for(int j=0; j<n; j++) {
            cin >> ara[i][j];
        }
    }
    memset(dp, -1, sizeof dp);
    int ans = rec(0, 0);
    cout << ans << "\n";

    return 0;
}


Measured memory_bytes: 256
#include <cstdio>
#include <iostream>
#include <cstdlib>
#include <unordered_map>
#include <map>
#include <unordered_set>
#include <set>
#include <vector>
#include <string>
#include <cstring>
#include <sstream>
#include <algorithm>
#include <cmath>
#include <queue>
#include <stack>
#include <list>
#include <array>
#include <deque>
#include <bitset>
typedef long long ll;
using namespace std;
#define trace(x) cerr << #x << " is " << x << endl;
ll dp[3001][3001][3];
const ll MOD = 998244353;

ll solve(vector<int>&a, int n, int k) {
    dp[0][0][0] = 1;
    for(int i=0;i<n;i++){
        for(int j=0;j<=k;j++){
            (dp[i+1][j][0] += dp[i][j][0]) %= MOD;
            (dp[i+1][j][1] += dp[i][j][0] + dp[i][j][1]) %= MOD;
            (dp[i+1][j][2] += dp[i][j][0] + dp[i][j][1] + dp[i][j][2]) %= MOD;
            if(j + a[i] <= k){
                (dp[i+1][j+a[i]][1] += dp[i][j][0] + dp[i][j][1]) %= MOD;
                (dp[i+1][j+a[i]][2] += dp[i][j][0] + dp[i][j][1]) %= MOD;
            }
        }
    }
    return dp[n][k][2];
}

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int n, k;
    cin >> n >> k;
    vector<int> a(n);
    for(int i=0;i<n;i++) {
        cin >> a[i];
    }
    cout << solve(a, n, k) <<endl;
    return 0;
}

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

int main(){
	double r, S, L, PI = 3.14159265358979;
	cin >> r;

	S = r * r * PI;
	L = 2 * r * PI;

	printf("%f %f\n", S, L);

	return 0;

}


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

long long int modPow(long long int a, long long int n){//繰り返し自乗法(a^n mod p)。計算量 O(logN)
    long long int p = pow(10, 9) + 7;//任意のp(素数) modのやつで使える 
    if(n == 0){
        return 1;
    }
    if(n == 1){
        return a % p;
    }
    if (n % 2 == 1){ 
        return (a * modPow(a, n - 1)) % p;
    }      
    long long t = modPow(a, n / 2);
    return (t * t) % p;
}

int main(){
    int x;
    cin >> x;
    if(x >= 30){
        cout << "Yes" << endl;
    }else{
        cout << "No"<< endl;
    }
}

Measured memory_bytes: 3636
#include <iostream>
#include <vector>
#include <string>
#include <set>
#include <map>
#include <algorithm>
#include <fstream>
#include <cmath>
const int mod=1e9+7;
using LL=long long;
using std::cout;using std::endl;using std::cin;
using std::vector;using std::string;using std::set;using std::multiset;
using std::pair;using std::map;
using std::min;using std::max;
using std::make_pair;using std::swap;
std::ostream& operator<<(std::ostream& os,std::map<int,int>& obj){for(std::map<int,int>::iterator itr=obj.begin();itr!=obj.end();itr++){os<<itr->first<<"^"<<itr->second<<" ";}return os;}
std::ostream& operator<<(std::ostream& os,std::vector<std::map<int,int>>& obj){for(auto itr=obj.begin();itr!=obj.end();itr++){os<<*itr<<std::endl;}return os;}
std::ostream& operator<<(std::ostream& os,std::vector<int>& obj){for(auto itr=obj.begin();itr!=obj.end();itr++){os<<*itr<<" ";}return os;}
std::ostream& operator<<(std::ostream& os,std::vector<std::vector<int>>& obj){for(auto itr=obj.begin();itr!=obj.end();itr++){os<<*itr<<std::endl;}return os;}

namespace ndifix{
template<class T> void sort(T &v){std::sort(v.begin(),v.end());}
template<class T> void rsort(T &v){std::sort(v.rbegin(),v.rend());}

}


int main(){
  int n;
  while(cin>>n){
    if(n==0)return 0;
    vector<int> a(n);for(int i=0;i<n;i++)cin>>a[i];
    ndifix::sort(a);
    int sum=0;for(int i=0;i<n;i++)sum+=a[i];
    int ans=0;for(int i=0;i<n;i++)if(a[i]*n<=sum)ans++;else break;
    cout<<ans<<endl;
  }
  return 0;
}



Measured memory_bytes: 3148
N = int(input())
s = [list(input()) for _ in range(N)]
l = []
for st in s:
    st.sort()
    l.append("".join(st))
l.sort()
cnt = 0
c = 1
for i in range(N-1):
    if l[i]==l[i+1]:
        c += 1
    else:
        if c>1:
            cnt += (1+(c-1))*(c-1)//2
        c = 1
print(cnt+(1+(c-1))*(c-1)//2)

Measured memory_bytes: 31884
#include <stdio.h>
#include <algorithm>
#include <iostream>
#include <vector>
#include <assert.h>
#include <map>
#include <set>
#include <unordered_set>
#include <unordered_map>
#include <math.h>
#include <string>
#include <string.h>
#include <queue>
#include <complex>
#include <iomanip>
#include <stack>
using namespace std;
typedef long long int ll;
typedef unsigned long long int ull;
ll mod=1e9+7;
double eps=1e-7;
ll exp(ll x,ll y){if(y<0) return 0; ll ret=1;for(;y;y>>=1,x=(x*x)%mod){if(y&1)ret=(ret*x)%mod;}return ret;}
ull pexp(ull x,ull y){if(y<0) return 0; ull ret=1; for(;y;y>>=1,x=(x*x)){if(y&1)ret=(ret*x);}return ret;}
ll gcd(ll x,ll y){if(!x||!y) return x+y; return x%y==0?y:gcd(y,x%y);}
ll lcm(ll x,ll y){return x*(y/gcd(x,y));}
ll bsum(ll u,ll b){ll ret=0;if(u<b)return u;while(u){ret+=u%b;u/=b;}return ret;}
ll prival(ll u,ll p){ll cn=0;while(u%p==0){cn++;u=u/p;}return cn;}
ll minv(ll a,ll b){return 1<a?b-minv(b%a,a)*b/a:1;}
ll extm(ll a,ll b){ll ret=0;while(a!=0){if(a%2==1){ret+=b;ret%=mod;}a>>=1;b=(2*b)%mod;}return ret;}   
ll eaphi(ll x){ll t=x,ret=x,i;for(i=2;i*i<=x;i++){if(t%i==0){ret-=ret/i;while(t%i==0) t/=i;}}if(t!=1) ret-=ret/t;return ret;}
ll eadivc(ll x){ll ret=0;ll i;for(i=1;i*i<=x;i++){if(x%i==0 && i*i!=x) ret+=2;if(x%i==0 && i*i==x) ret+=1;}return ret;}
ll eadivs(ll x){ll ret=0;ll i;for(i=1;i*i<=x;i++){if(x%i==0 && i*i!=x) ret+=i+x/i;if(x%i==0 && i*i==x) ret+=i;}return ret;}
ll ndig(ll x, ll b){ll ret=0;while(x){x/=b; ret++;}return ret;}
ll rev(ll n, ll b){ll ret=0;while(n){ret=b*ret+n%b; n/=b;}return ret;}
ll sq(ll x){ll t=(ll)sqrt(x); for(ll i=t-2 ; i<=t+2 ; i++) if(i*i==x) return abs(i); return -1;}
ll extexp(ll x,ll y){if(y<0) return 0; ll ret=1;for(;y;y>>=1,x=extm(x,x)){if(y&1)ret=extm(ret,x);}return ret;}
bool isprime(ll x){if(x<=1) return false; for(ll i=2;i*i<=x;i++){if(x%i==0){return false;}}return true;}
int n, h, w;
int a[11111];
vector< pair<int, int> > ord;
int fin[111][111];

int main(void)
{
	ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
	int i, j, cur=1; cin>>h>>w>>n;
	for(i=1 ; i<=n ; i++) cin>>a[i];
	for(i=1 ; i<=h ; i++)
	{
		if(i%2==1)
		{
			for(j=1 ; j<=w ; j++)
			{
				fin[i][j]=cur;
				a[cur]--;
				if(!a[cur]) cur++;
			}
		}
		else
		{
			for(j=w ; j>=1 ; j--)
			{
				fin[i][j]=cur;
				a[cur]--;
				if(!a[cur]) cur++;
			}
		}
	}
	for(i=1 ; i<=h ; i++)
	{
		for(j=1 ; j<=w ; j++)
		{
			cout<<fin[i][j]<<" ";
		}
		cout<<"\n";
	}
	return 0;
}

// 제출하기 전에 생각햇나요?
// it may be easier/harder than you think
// ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);

Measured memory_bytes: 384
N, P = list(map(int, input().split()))
A = list(map(int, input().split()))


for i in range(len(A)):
	A[i] = A[i] % 2

num1 = A.count(1)
num0 = A.count(0)

if P == 0:
	if num1 <= 1:
		print(2 ** (num0))
	else:
		print(2 ** (num0 + num1 - 1))
else:
	if num1 == 0:
		print(0)
	else:
		print(2 ** (num0 + num1 - 1))


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

#define rep(i,x,y) for(ll i=(x);i<(y);i++)
#define rrep(i,x,y) for(ll i=(ll)(y)-1;i>=(x);i--)
#define all(x) (x).begin(),(x).end()
#ifdef LOCAL
#define dump(x)  cerr << #x << " = " << (x) << endl
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl
#define dassert(...) assert(__VA_ARGS__)
#else
#define dump(x)
#define debug(x)
#define dassert(...)
#endif
//#define int long long

typedef long long ll;
const ll MOD = 1e9 + 7;
const long double EPS = 1e-8;

long long getGcd(long long a, long long b) {
    if (a < b) swap(a, b);
    long long r = a % b;
    while(r!=0){
        a = b;
        b = r;
        r = a % b;
    }
    return b;
}

void solve(long long K){
    ll sum = 0;
    rep(a,1,K+1) rep(b,1,K+1) rep(c,1,K+1) {
        ll gcd = getGcd(getGcd(a, b), c);
        sum += gcd;
    }
    cout << sum << endl;
}

signed main(){
    // ios_base::sync_with_stdio(false);
    // cin.tie(NULL);
    long long K;
    scanf("%lld",&K);
    solve(K);
    return 0;
}


Measured memory_bytes: 3764
//### In The Name Of GOD ###

//%% Remember; (((He))) is The (((Accepter))) %%

// GOD IS GREATER ...

#include <bits/stdc++.h>

using namespace std;

typedef long long ll ;
typedef long double ld ;

#define int ll
#define pb push_back
#define bp pop_back
#define pf push_front
#define fp pop_front
#define X first
#define Y second
#define IO ios_base::sync_with_stdio(false);
#define sz(a) (int)(a.size())
#define sg(a, b) (a + b - 1) / b

const int MOD = 1000 * 1000 * 1000 + 7;
const int INF = 8 * 1000 * 1000 + 200;
const int MAXN =  100 * 1000 + 1;
const int MLOG = 18;
const int NMAX = 20;

signed main(){
	IO;
	int n, m, ans = 0;
	cin >> n >> m;
	ans += min(n, m / 2);
	m -= min(n * 2, m);
	//`cout << ans << ' ' << m << ' ';
	ans += m / 4;
	cout << ans;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
using namespace std;
gp_hash_table<int, int> table;
typedef tree < int,  null_type,  less<int>,  rb_tree_tag,  tree_order_statistics_node_update > ordered_set;
typedef long long ll;
#define pb push_back
#define pi (acos(-1))
#define ull  unsigned long long
#define ld long double
#define all(v) v.begin(), v.end()
///freopen("input.txt","r",stdin);
///freopen("output.txt","w",stdout);
ll LCM(ll a, ll b)
{
    ll g = __gcd(a,b);
    return (a/g)*b ;
}
string numtostr(ll n)
{
    ostringstream str1 ;
    str1 << n ;
    return str1.str();
}
ll strtonum(string s)
{
    ll x ;
    stringstream str1(s);
    str1 >> x ;
    return x ;
}
string s,t;
int l,i,a=0;
int main(void)
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
   cin>>s>>t;
   l=s.length();
   for(i=0;i<l;++i)
   {
       if(s[i]!=t[i])
        ++a;
   }
   cout<<a;
    return 0;
}


Measured memory_bytes: 3820
import math
A, B = map(int, input().split())
 
 
def prime_factorize(n):
    a = [1]
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    a.sort()
    return a
 
 
print(len(list(set(prime_factorize(math.gcd(A, B))))))

Measured memory_bytes: 9112
#include<bits/stdc++.h>
typedef long long ll;
typedef unsigned long long ull;
using namespace std;
#define pb push_back
int dy[]={0, 0, 1, -1, 0};
int dx[]={1, -1, 0, 0, 0};
 
#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 (int i=0;i<(n);i++)
#define RREP(i,n) for (int i=(n)-1;i>=0;i--)

int main(){
    int n;
    scanf("%d",&n);
    printf("ABC%d\n",n);
    return 0;
}



Measured memory_bytes: 256
#include <iostream>
#include <map>
using namespace std;
int dp[30][80];
int main() {
  map<int, int> m;
  for (int i = 2; i < 100; i++) {
    bool p = true;
    for (int j = 2; j * j <= i; j++) {
      if (i % j == 0) p = false;
    }
    if (p) m[i] = 0;
  }
  int n; cin >> n;
  for (int i = 2; i <= n; i++) {
    int ii = i;
    for (auto x: m) {
      while (ii % x.first == 0) {
        m[x.first]++;
        ii /= x.first;
      }
    }
  }
  int i = 0;
  dp[0][1] = 1;
  for (auto x: m) {
    for (int j = 0; j <= x.second; j++) {
      for (int k = 1; k <= 75; k++) {
        if ((j + 1) * k > 75) break;
        dp[i + 1][(j + 1) * k] += dp[i][k];
      }
    }
    i++;
  }
  cout << dp[m.size()][75] << endl;
  return 0;
}


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

using namespace std;

int main()
{
    int N, K;
    string S;

    cin >> N >> K;
    cin >> S;

    char* Si = &S[K-1];

    switch(*Si){
        case 'A':
            *Si = 'a';
        break;
        case 'B':
           *Si = 'b';
        break;
        case 'C':
            *Si = 'c';
        break;
    }

    cout << S << endl;
    
    return 0;
}

Measured memory_bytes: 256
from statistics import mean, median,variance,stdev
import numpy as np
import sys
import math
import fractions
import itertools
import copy

def j(q):
    if q==1: print("YES")
    else:print("NO")
    exit(0)


def ct(x,y):
    if (x>y):print("GREATER")
    elif (x<y): print("LESS")
    else: print("EQUAL")

def ip():
    return int(input())


#n = ip()                              #入力整数1つ
#n,m= (int(i) for i in input().split())      #入力整数横2つ
#a,b,c = (int(i) for i in input().split())    #入力整数横3つ
#n,a,b,c= (int(i) for i in input().split())  #入力整数横4つ
#a = [int(i) for i in input().split()]        #入力整数配列
a = input()                                  #入力文字列
#a = input().split()                          #入力文字配列
#n = ip()                      #入力セット(整数改行あり)(1/2)
#a=[ip() for i in range(n)]    #入力セット(整数改行あり)(2/2)
#a=[input() for i in range(h)]
#jの変数はしようできないので注意
#全足しにsum変数使用はsum関数使用できないので注意
b = input()
for i in range(len(a)):
    print(a[i],end='')
    if i == len(b):break
    print(b[i],end='')

Measured memory_bytes: 21888
N,K=map(int,input().split())
AB=[[0,0]for _ in range(N)]

for i in range(N):
    AB[i]=list(map(int,input().split()))
AB.sort()

ans=0
i=0
while K>0 and i<N:
    K-=AB[i][1]
    ans=AB[i][0]
    i+=1

print(ans)


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

using namespace std;
#define rep(i,n) for(long long i=0; i<(long long)(n);i++)
//rep…「0からn-1まで」の繰り返し
#define rep2(i,s,n) for(long long i=s; i<=(long long)(n);i++)
//rep2…「sからnまで」の繰り返し
#define repr(i,s,n) for(long long i=s;i>=(long long)(n);i--)
//repr…「ｓからnまで」の降順の繰り返し

typedef long long ll;

const int inf = 1e9+7;
const int mod = 1e9+7;

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

    int cnt=0,ans=0;

    rep(i,3){
        if(s[i]=='R')cnt++;
        else cnt=0;

        ans=max(cnt,ans);
    }

    cout<<ans<<endl;
}


Measured memory_bytes: 3620
import time
startTimeProblem=time.time()

import fileinput, sys, itertools
from math import *
from bisect import *
from heapq import *
from collections import *

def lcm(a, b):  
    return (a*b)/gcd(a, b)

class InputHelper:
    def __init__(self):
        self.myinput = fileinput.input()

    def isLocal(self):
        return not fileinput.isstdin()

    def int(self):
        return int(self.myinput.readline().rstrip())

    def ints(self):
        return [int(_) for _ in self.myinput.readline().rstrip().split()]

    def str(self):
        return self.myinput.readline().rstrip()

    def strs(self):
        return [_ for _ in self.myinput.readline().rstrip().split()]

class OutputHelper:
    def int(self, a):
        print(a)    

    def ints(self, a):  
        print(" ".join([str(_) for _ in a]))
    
    def intsNL(self, a):
        for _ in a:
            print(_)
    
    def str(self, s):
        print(s)

    def strs(self, s):
        print(" ".join([_ for _ in s]))

    def strsNL(self, s):
        for st in s:
            print(st)

class ListNode:
    def __init__(self, val):
        self.val = val
        self.next = None
        self.prev = None

In = InputHelper()
Out = OutputHelper()

######################################

r = In.int()





print(2*pi*r)


######################################

if len(sys.argv)>2 and sys.argv[2]=="TIMEIT":
    fin = (time.time()-startTimeProblem)*1000
    print("{:.2f}".format(fin) + "ms")

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

char getNext(char prev, char input, char testimony) {
	char res;
	if (prev == 'S' && input == 'S' && testimony == 'o') res = 'S';
	if (prev == 'S' && input == 'S' && testimony == 'x') res = 'W';
	if (prev == 'S' && input == 'W' && testimony == 'o') res = 'W';
	if (prev == 'S' && input == 'W' && testimony == 'x') res = 'S';
	if (prev == 'W' && input == 'S' && testimony == 'o') res = 'W';
	if (prev == 'W' && input == 'S' && testimony == 'x') res = 'S';
	if (prev == 'W' && input == 'W' && testimony == 'o') res = 'S';
	if (prev == 'W' && input == 'W' && testimony == 'x') res = 'W';
	return res;
}

bool check(string s, string t) {
	int n = s.size();
	bool ok = true;
	for (int i = 0; i < n; i++) {
		if (t[i] == 'S' && s[i] == 'o') {
			if (i == 0) {
				if (t[1] != t[n - 1]) ok = false;
			}
			else if (i == n - 1) {
				if (t[n - 2] != t[0]) ok = false;
			}
			else {			
				if (t[i - 1] != t[i + 1]) ok = false;
			}
		}
		if (t[i] == 'S' && s[i] == 'x') {
			if (i == 0) {
				if (t[1] == t[n - 1]) ok = false;
			}
			else if (i == n - 1) {
				if (t[n - 2] == t[0]) ok = false;
			}
			else {
				if (t[i - 1] == t[i + 1]) ok = false;
			}			
		}
		if (t[i] == 'W' && s[i] == 'o') {
			if (i == 0) {
				if (t[1] == t[n - 1]) ok = false;
			}
			else if (i == n - 1) {
				if (t[n - 2] == t[0]) ok = false;
			}
			else {
				if (t[i - 1] == t[i + 1]) ok = false;
			}
		}
		if (t[i] == 'W' && s[i] == 'x') {
			if (i == 0) {
				if (t[1] != t[n - 1]) ok = false;
			}
			else if (i == n - 1) {
				if (t[n - 2] != t[0]) ok = false;
			}
			else {
				if (t[i - 1] != t[i + 1]) ok = false;
			}
		}
	}
	return ok;
}

bool getOk(string s, string &t) {
	bool res = false;
	char prev = t[0];
	char now = t[1];
	char next;
	for (int i = 1; i < s.size()- 1; i++) {
		next = getNext(prev, now, s[i]);
		if (i <= s.size() - 2) {
			t[i + 1] = next;
		}
		prev = now;
		now = next;
	}
	return check(s, t);
}

int main() {

	int n; cin >> n;
	string s; cin >> s;
	string t;

	t.resize(n);
	t[0] = 'S';
	t[1] = 'S';
	if (getOk(s, t)) {
		cout << t << endl;
		return 0;
	}
	t.resize(n);
	t[0] = 'W';
	t[1] = 'S';
	if (getOk(s, t)) {
		cout << t << endl;
		return 0;
	}
	t.resize(n);
	t[0] = 'S';
	t[1] = 'W';
	if (getOk(s, t)) {
		cout << t << endl;
		return 0;
	}
	t.resize(n);
	t[0] = 'W';
	t[1] = 'W';
	if (getOk(s, t)) {
		cout << t << endl;
		return 0;
	}	
	cout << -1 << endl;
    return 0;
}

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

#define rep(i,n) for(int i=0; i<n ; ++i)
#define REP(i,a,b) for(int i=a; i<b; ++i)
using ll = long long;
using vi = vector<int>;
using vl = vector<ll>;
using vvi = vector<vector<int>>;
using vvl = vector<vector<ll>>;

//プロトタイプ宣言
void faster(void);
ll gcd(auto , auto);
ll get_digent(auto);
ll POW(auto , auto);
ll vec_max(auto & , string);
ll vec_min(auto & , string);

int main(){
  faster();
  int n;
  cin >> n;
  string s,t;
  cin >> s >> t;
  int cnt=n;
  for(int i=n-1;i>=0;i--){
    string sub1,sub2;
    sub1 = s.substr(n-i-1,i+1);
    sub2 = t.substr(0,i+1);
    if(sub1 == sub2) break;
    cnt--;
  }
  cout << n*2-cnt << endl;
}


























//以下、ライブラリ

//同期解除
void faster(void){
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
}

//ユークリッドの互除法
ll gcd(auto a, auto b) {
  return (b ? gcd(b, a%b) : a);
} 

//桁数取得
ll get_digent(auto x){
  string s;
  s = to_string(x);
  ll digent = s.size();
  return digent;
} 

//べき乗計算
ll POW(auto x, auto y){
  if(y==0) return 1;
  if(y%2 == 1){
    ll temp = POW(x,y-1);
    return (temp*x);
  }
  else{
    ll temp = POW(x,y/2);
    return temp*temp;
  }
} 

//配列内の最大要素の添え字取得or要素取得
ll vec_max(auto &v, string s){
  auto itr = max_element(v.begin(),v.end());
  ll element = *itr;
  ll place = itr - v.begin();
  if(s == "element") return element;
  else if(s == "place") return place;
  else return -1;
}

//配列内の最小要素の添え字取得or要素取得
ll vec_min(auto &v, string s){
  auto itr = min_element(v.begin(),v.end());
  ll element = *itr;
  ll place = itr - v.begin();
  if(s == "element") return element;
  else if(s == "place") return place;
  else return -1;
}

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

int ctoi(char c) {
	switch (c) {
		case '0': return 0;
		case '1': return 1;
		case '2': return 2;
		case '3': return 3;
		case '4': return 4;
		case '5': return 5;
		case '6': return 6;
		case '7': return 7;
		case '8': return 8;
		case '9': return 9;
		default: return 0;
	}
}


int main() {
    string S;
    cin >> S;
    int n = S.size();
    long long int answer = 0;

    long int tmp = 0;
    for (int bit = 0; bit < (1 << (n-1));bit++) {
        tmp = ctoi(S.at(0));
        for (int i = 0; i < n - 1; i++){
            if (bit & (1 << i)) {
                answer += tmp;
                tmp = ctoi(S.at(1+i));
            }
            else {
                tmp *= 10;
                tmp += ctoi(S.at(i+1));
            }
        }
        answer += tmp;
    }
    cout << answer << endl;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define INF 2000000000
#define MOD 1000000007
#define EPS (1e-10)

using namespace std;

int main(int argc, char *argv[]) {
	
	string s,t; cin >> s >> t;

	for (int i = 0; i < s.size() + 1; i++) {
		string tmp = s.substr(s.size() - 1, 1);
		s = tmp + s.substr(0,s.size() - 1);
		if (s == t) {
			cout << "Yes" << endl;
			return 0;
		}
	}
	cout << "No" << endl;

	return 0;
}


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

int main(void){
    int N, X, d = 0, ans = 0;
    cin >> N >> X;
    int L[N];
    for (int i = 0; i < N; i++){
        cin >> L[i];
    }
    for (int i = 0; i < N; i++){
        if(d <= X){
            ans++;
        }
        d += L[i];
    }

    if(d <= X){
            ans++;
        }
    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 256
def main():
    input()
    array = sorted(int(x) for x in input().split())
    maximum = 1000001
    counter = [0] * maximum

    for x in array:
        if counter[x] != 0:
            counter[x] = 2
            continue
        else:
            for multiple in range(x, maximum, x):
                counter[multiple] += 1
    ans = 0
    for x in array:
        if counter[x] == 1:
            ans += 1
    print(ans)


if __name__ == '__main__':
    main()


Measured memory_bytes: 32232
#include<iostream>
using namespace std;
int main() {
	//a<b<c
	int a,b,c,k;
	cin>>a>>b>>c>>k;
	int idex=0;
	while(b<=a) {
		b*=2;
		idex++;
	}
	while(c<=b) {
		c*=2;
		idex++;
	}
	if(idex<=k) cout<<"Yes"<<endl;
	else cout<<"No"<<endl;
}

Measured memory_bytes: 3616