akhauriyash/Code-Regression huggingface dataset:
#include<cstdio>
#include<cstring>
#include<map>
using namespace std;
int len;
char c[100001];
map<char,char>m;
int main()
{
	m['b']='d',m['d']='b',m['p']='q',m['q']='p';
	scanf("%s",&c);
	len=strlen(c);
	if(len&1)
	{
	    puts("No");
	    return 0;
	}
	for(int i=0;i<len>>1;++i)
	{
		if(c[i]!=m[c[len-i-1]])
		{
			puts("No");
			return 0;
		}
	}
	puts("Yes");
	return 0;
}

Measured memory_bytes: 384
def getN():
    return int(input())
def getNM():
    return map(int, input().split())
def getList():
    return list(map(int, input().split()))
def getArray(intn):
    return [int(input()) for i in range(intn)]
def input():
    return sys.stdin.readline().rstrip()

from collections import defaultdict, deque, Counter
from sys import exit
import heapq
import math
import fractions
import copy
from itertools import permutations
from operator import mul
from functools import reduce
from bisect import bisect_left, bisect_right

import sys
sys.setrecursionlimit(1000000000)
mod = 10 ** 9 + 7

S = input()
st = len(S)
T = input()
nt = len(T)
ans = []
for i in range(st - nt + 1):
    judge = S[i:i + nt]
    flag = True
    for j in range(nt):
        if judge[j] != '?' and judge[j] != T[j]:
            flag = False
    if flag:
        ans.append(i)
alta = list(S)
for i in range(st):
    if alta[i] == "?":
        alta[i] = "a"
strlist = []
if len(ans) > 0:
    for i in ans:
        base = copy.deepcopy(alta)
        for j in range(nt):
            base[i + j] = T[j]
        strlist.append(''.join(base))
    strlist.sort()
    print(strlist[0])
else:
    print('UNRESTORABLE')

    #print(S[i:i + nt])

Measured memory_bytes: 64492
local read = setmetatable({}, {__index = function(t, k) local a = {} for i=1,#k do table.insert(a, '*'..string.sub(k, i, i)) end local r = io.read local u = table.unpack or unpack return function() return r(u(a)) end end})
read.N = function(N) local t={} for i=1,N do t[i]=read.n() end return t end
string.totable = function(s) local t={} local u=string.sub for i=1,#s do t[i] = u(s, i, i) end return t end
string.split = function(s) local t={} for w in string.gmatch(s, "[^%s]+") do table.insert(t, w) end return (table.unpack or unpack)(t) end
local function array(dimension, default_val) local n=dimension local m={}if default_val~=nil then m[1]={__index=function()return default_val end}end for i=2,n do m[i]={__index=function(p, k)local c=setmetatable({},m[i-1])rawset(p,k,c)return c end}end return setmetatable({},m[n])end
----
local N, R= read.nn()
if N >= 10 then
    print(R)
else
    print(R + 100*(10-N))
end


Measured memory_bytes: 1008
N, M = map(int, input().split())
sc = [[int(i) for i in input().split()] for _ in range(M)]

if N == 1 :
  start = 0
else :
  start = 10 ** (N - 1)
  
ret = float('inf')
for i in range(start, 10 ** N) :
  i = str(i)
  for s, c in sc :
    if int(i[s - 1]) != c :
      break
  else :
    ret = min(ret, int(i))
    
if ret == float('inf') :
  print(-1)
else :
  print(ret)

Measured memory_bytes: 38704
#include <bits/stdc++.h>
using namespace std;
#define rep0(i, n) for (long long i = 0; i < (long long)(n); i++)
#define rep1(i,n) for(long long i=1;i<=(long long)(n);i++)
#define all(v) v.begin(),v.end()
#define Sort(v) sort(all(v))
#define Reverse(v) reverse(all(v))
#define Rsort(v) sort(all(v),greater)
#define pub(v) push_back(v)
#define pob(v) pop_back(v)
typedef long long ll;
typedef vector<ll> vel;
typedef vector<vector<ll>> vel2d;
typedef string str;
typedef pair<ll,ll> pal;
typedef vector<str> ves;


int main() {
	ll n,m;
  cin>>n>>m;
  if(n==m){cout<<"Yes"<<endl;}
  else{cout<<"No"<<endl;}
}


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

// c1, c2 テ」ツ??r', 'g', 'b', テ」ツ?凝」ツ?、(c1 != c2)テ」ツ?ョテ」ツ?ィテ」ツ??
// m[c1+c2] テ」ツ?ァ c1, c2 テ」ツ?ァテ」ツ?ェテ」ツ??r', 'g', 'b'テ」ツ?古ィツソツ氾」ツ?」テ」ツ?ヲテ」ツ?湘」ツつ?
map<int,char> m;

// テ・ツ?ィテゥツδィテ・ツ青古」ツ?佚ィツ可イテ」ツ?凝」ツ?ゥテ」ツ??」ツ??
bool isSameColor(const string& s){
	char c[3] = {'r','g','b'};
	for(int i = 0 ; i < 3 ; i++ ){
		int cnt = 0;
		for(int j=0 ; j < s.size() ; j++ ){
			if( s[j] == c[i] )
				cnt++;
		}
		if( cnt == s.size() )
			return true;
	}
	return false;
}

int solve(string s_ ){
	// memo[s] = true テ」ツ?ェテ」ツつ嘉ヲツ篠「テァツエツ「テヲツクツ暗」ツ?ソ
	map<string,bool> memo;
	// q.front().first テ」ツ?ッ ティツ卍ォテ」ツ?ョテァツ環カテヲツ??string) q.front().second テ」ツ?ッテヲツ可凝ヲツ閉ー(int)
	queue< pair<string,int> > q;
	
	// テ・ツ按敕ヲツ慊淌ァツ環カテヲツ?凝」ツつ津」ツつュテ」ツδ・テ」ツδシテ」ツ?ォテ・ツ?・テ」ツつ古」ツつ?
	pair<string,int> ini( s_ , 0  );
	q.push( ini );
	memo[s_] = true;
	
	// テ」ツつュテ」ツδ・テ」ツδシテ」ツ?古ァツゥツコテ」ツ?ォテ」ツ?ェテ」ツつ凝」ツ?セテ」ツ?ァテ」ツδォテ」ツδシテ」ツδ?
	while( !q.empty() ){
		// stirng s; テ」ツ?ッティツ卍ォテ」ツ?ョテァツ環カテヲツ?? int cnt; テ」ツ?ッテヲツ可凝ヲツ閉ー
		string s = q.front().first;
		int cnt = q.front().second;
		q.pop();
		
		// テ・ツ?ィテゥツδィテ・ツ青古」ツ?佚ィツ可イテ」ツ?ェテ」ツつ嘉ヲツ篠「テァツエツ「テァツオツづ、ツコツ?
		if( isSameColor(s) ){
			return cnt;
		}
		
		// テ」ツ?セテ」ツ??ヲツ篠「テァツエツ「テ」ツ?療」ツ?ヲテ」ツ??」ツ?ェテ」ツ??ヲツャツ。テ」ツ?ョテァツ環カテヲツ?凝」ツつ津」ツつュテ」ツδ・テ」ツδシテ」ツ?ォテ・ツ?・テ」ツつ古」ツつ?
		for(int i=1 ; i < s.size() ; i++ ){
			if( s[i-1] != s[i] ){
				char next_color = m[s[i-1]+s[i]];
				char c1 = s[i-1];
				char c2 = s[i];
				s[i-1] = s[i] = next_color;
				if( memo[s] != true ){
					memo[s] = true;
					pair<string,int> next;
					next.first = s;
					next.second = cnt + 1;
					q.push( next );
				}
				s[i-1] = c1;
				s[i] = c2;
			}
		}
	}
	return -1;
}

int main(){
	string s;
	m['r'+'g'] = 'b';
	m['g'+'b'] = 'r';
	m['b'+'r'] = 'g';
	
	while( cin >> s , s != "0" ){
		int ans = solve( s );
		if( ans == -1 )
			cout << "NA" << endl;
		else
			cout << ans << endl;
	}
}

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

using namespace std;
using ll = long long;
// #define int ll
using PII = pair<ll, ll>;

#define FOR(i, a, n) for (ll i = (ll)a; i < (ll)n; ++i)
#define REP(i, n) FOR(i, 0, n)
#define ALL(x) x.begin(), x.end()

template<typename T> T &chmin(T &a, const T &b) { return a = min(a, b); }
template<typename T> T &chmax(T &a, const T &b) { return a = max(a, b); }
template<typename T> bool IN(T a, T b, T x) { return a<=x&&x<b; }
template<typename T> T ceil(T a, T b) { return a/b + !!(a%b); }

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); }

template<class S,class T>
ostream &operator <<(ostream& out,const pair<S,T>& a){
    out<<'('<<a.first<<','<<a.second<<')'; return out;
}
template<class T>
ostream &operator <<(ostream& out,const vector<T>& a){
    out<<'['; for(T i: a) {out<<i<<',';} out<<']'; return out;
}

int dx[] = {0, 1, 0, -1}, dy[] = {1, 0, -1, 0}; // DRUL
const int INF = 1<<30;
const ll LLINF = 1LL<<60;
const ll MOD = 1000000007;

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

    ll n;
    cin >> n;
    string s;
    cin >> s;

    ll cnt1 = 0, cnt2 = 0;
    REP(i, n) {
        if(s[i] == 'R') cnt1++;
        else cnt2++;
    }

    if(cnt1 > cnt2) cout << "Yes" << endl;
    else cout << "No" << endl;

    return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#define pb push_back
#define int long long
#define M 1000000007
//#define M 998244353
using namespace std;
const int inf=4e18;
const double pi=3.14159265358979;
int power(int x,int y)
{
	int res=1;
	x=x%M;
	while(y>0)
	{
		if(y&1)
			res=(res*x)%M;
		y=y>>1;
		x=(x*x)%M;
	}
	return res;
}
int modInverse(int n) 
{ 
    return power(n, M-2); 
}
int nCrModPFermat(int n, int r) 
{ 
   if (r==0) 
      return 1; 
    int fac[n+1]; 
    fac[0] = 1; 
    for (int i=1 ; i<=n; i++) 
        fac[i] = fac[i-1]*i%M; 
    return (fac[n]* modInverse(fac[r]) % M * modInverse(fac[n-r]) % M) % M; 
}
int32_t main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);cout.tie(NULL);
	int x,y;cin>>x>>y;
	if((2*y-x)%3==0&&(2*y-x)>=0&&(2*x-y)%3==0&&(2*x-y)>=0)
	{
		int a=(2*y-x)/3,b=(2*x-y)/3;
		int o=nCrModPFermat(a+b,a);
		cout<<o<<endl;
	}
	else
		cout<<0<<endl;
}

Measured memory_bytes: 5504
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int main()
{
ll n,i,j,k;
cin>>n>>k;
ll dp[n],arr[n];
for(i=0;i<n;i++)
{
cin>>arr[i];
dp[i]=1e12;
}
dp[0]=0;
for(i=1;i<n;i++)
{
for(j=1;j<=k;j++)
if(i-j>=0)
dp[i]=min(dp[i],dp[i-j]+abs(arr[i-j]-arr[i]));
}
cout<<dp[n-1];
return 0;
}

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

#define fi first
#define se second
#define rep(i,n) for(int i = 0; i < (n); ++i)

using namespace std;

typedef long long ll;
typedef pair<int,int> P;
const long long LINF = 1001002003004005006ll;
const int INF = 1001001001;
const int mod = 1000000007;

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

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

  int ans = INF;
  // black := [, i) の黒の個数
  // white := [i, ) を白の個数
  int white = count(s.begin(), s.end(), '.'), black = 0;
  ans = min(ans, white+black);
  for (int i = 0; i < s.length(); i++) {
    if (s[i] == '.') {
      white--;
    } else {
      black++;
    }
    ans = min(ans, white+black);
  }
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 720
import java.util.Scanner;

public class Main {
 public static void main(String[] args){
     Scanner sc = new Scanner(System.in);
     int r = sc.nextInt()*100;
     int b = sc.nextInt()*10;
     int g = sc.nextInt()*1;

     int rbg = r+b+g;
     String ans = null;

     if(rbg%4!=0){
         ans = "NO";
     }else{
         ans ="YES";
     }
     System.out.println(ans);
 }
}



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

using namespace std;

#define fcout(d) cout << fixed << setprecision(d)
#define repU(i,s,t) for(int i = (s); i <= (t); ++i)
#define repD(i,t,s) for(int i = (t); i >= (s); --i)
#define rep(i,n) repU(i,0,n - 1)
#define rep1(i,n) repU(i,1,n)
#define all(v) begin(v),end(v)
#define l_bnd lower_bound
#define u_bnd upper_bound
#define puf push_front
#define pub push_back
#define pof pop_front
#define pob pop_back
#define mkp make_pair
#define mkt make_tuple
#define fir first
#define sec second
#define q_ceil(n,d) ((n - 1) / (d) + 1)
#define parity(a,b) (((a)^(b)) & 1 ^ 1)

typedef long long ll;
typedef unsigned long long ull;
typedef double db;
typedef pair<int,int> pii;
typedef pair<ll,pii> plp;

const pair<int,int> DIR[] = { {1,0},{0,1},{-1,0},{0,-1},{1,1},{-1,1},{-1,-1},{1,-1} };
const int INF_32 = (1 << 30) - 1;
const ll INF_64 = (1LL << 62) - 1;
const int MOD = 1e9 + 7;

ll Pow(ll n, ll m, int mod = MOD){
	ll res = 1,pow = n % mod;
	while(m) {
		if(m & 1) res = (res * pow) % mod;
		pow = (pow * pow) % mod;
		m >>= 1;
	}
	return res;
}

string S;

int main(){
	cin.tie(0);
	ios::sync_with_stdio(false);
	
	cin >> S;
	ll dp[4][4] = {{}};
	int len = S.size(),cnt = 0;
	repD(j,len - 1,0){
		if(S[j] == '?'){
			++cnt;
			rep(i,3) dp[3][i + 1] += dp[2][i];
			rep(i,2) dp[2][i + 1] += dp[1][i];
			++dp[1][1];
		}else{
			if(S[j] == 'C') ++dp[1][0];
			if(S[j] == 'B') rep(i,2) dp[2][i] += dp[1][i];
			if(S[j] == 'A') rep(i,3) dp[3][i] += dp[2][i];
		}
		rep(i,4)rep(k,4) dp[i][k] %= MOD;
	}
	ll ans = 0;
	rep(i,min(cnt + 1,4)) ans = (ans + dp[3][i] * Pow(3,cnt - i) % MOD) % MOD;
	cout << ans << endl;
}





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

int main()
{
	int N = 0;
	std::string S, T, ans;

	std::cin >> N;
	std::cin >> S >> T;

	ans = S;
	for (int i = 0; i < N; i++)
	{
		ans.insert(ans.begin() + 2* i + 1, T[i]);
	}
	
	std::cout << ans << std::endl;

	return  0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
long long f[405][405],n,a[405],p[405],inf=1e18;
int main()
{
    scanf("%lld",&n);
    for(int i=1;i<=n;i++) scanf("%lld",a+i);
    for(int i=1;i<=n;i++) p[i]=p[i-1]+a[i];
    for(int i=1;i<=n;i++)
    for(int j=i-1;j>0;j--){
        f[j][i]=inf;
        for(int k=j;k<i;k++) f[j][i]=min(f[j][i],f[j][k]+f[k+1][i]+p[i]-p[j-1]);
    }
    printf("%lld",f[1][n]);
    return 0;
}

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


#define FOR(i, start, end) for(uint64_t i=start; i<end; i++)
#define REP(i, n) FOR(i, 0, n)

// 最大公約数gcd
// 最小公倍数lcm=m*n/gcd
uint64_t gcd(uint64_t m, uint64_t n) {
  uint64_t temp;
  while (m % n != 0){
    temp = n;
    n = m % n;
    m = temp;
  }
  return n;
}

uint64_t lcm(uint64_t m, uint64_t n) {
  return (m*n)/gcd(m,n);
}

// vector<vector<uint64_t> > v(n+1, vector<uint64_t>(n+1, 0))
// v[n][k]に組み合わせ数が入る。
void comb(vector<vector <uint64_t> > &v){
  for(uint64_t i = 0;i <v.size(); i++){
    v[i][0]=1;
    v[i][i]=1;
  }
  for(uint64_t k = 1;k <v.size();k++){
    for(uint64_t j = 1;j<k;j++){
      v[k][j]=(v[k-1][j-1]+v[k-1][j]);
    }
  }
}

// 掛け算オーバーフロー判定
bool is_product_overflow(uint64_t a, uint64_t b) {

	uint64_t prod = a * b;
	
	return (prod / b != a);
}

//素因数分解
void primeFactorization(uint64_t a, list<uint64_t> &factors){ //素因数分解を出力するプログラム
  long i,sq;
  if(a%2==0){ //偶数の場合
    factors.push_back(2);
    primeFactorization(a/2,factors); //2で割った値で再帰
    return;
  }
  sq = sqrt(a);
  for(i=3;i<=sq;i+=2){ //3以上√a以下の奇数の場合
	if(a%i==0){
	  factors.push_back(i);
      primeFactorization(a/i,factors); //割れた値で再帰
      return;
	}
  }
  //偶数でも3以上√a以下の奇数の場合でも割り切れない場合
  if(a!=1){ //aが1でないなら、a自身は素数
    factors.push_back(a);
  }
}

// フェルマーの小定理
// mod. m での a の逆元 a^{-1} を計算する
// (a/b)%m = a*movinv(b,m)%m  
int64_t modinv(int64_t a, int64_t m) {
    int64_t b = m, u = 1, v = 0;
    while (b) {
        int64_t t = a / b;
        a -= t * b; swap(a, b);
        u -= t * v; swap(u, v);
    }
    u %= m;
    if (u < 0) u += m;
    return u;
}

// 円周率
// M_PI

// #include <iomanip> // setprecisionを使用するのに必要
// cout << std::fixed << std::setprecision(15) << y << endl;

// 昇順
// priority_queue<int, vector<int>, greater<int> > queue;

signed main() {
  int64_t a,b,c;
  cin >> a >> b >> c;
  
  if(a==b&&b!=c) cout << "Yes" << endl;
  else if(b==c&&c!=a) cout << "Yes" << endl;
  else if(a==c&&c!=b) cout << "Yes" << endl;
  else cout << "No" << endl;
   
  return 0;
}




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

using namespace std;

#define FOR(i,a,b) for(int i = (a); i < (b); ++i)
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define all(x) (x).begin(),(x).end()

inline int toInt(string s) {int v; istringstream sin(s);sin>>v; return v;}

typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector< vector<int> > Mat;
typedef tuple<int, int, int, int> T;

const int MOD = (int)1e9+7;
const int INF = (int)1e9;
const int dx[] = {0, 1, 0, -1};
const int dy[] = {1, 0, -1, 0};
const int ddx[] = {0, 1, 1, 1, 0, -1, -1, -1};
const int ddy[] = {1, 1, 0, -1, -1, -1, 0, 1};

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

    int ans = 0;
    rep(i, s.size()){
        if(s[i] == '+') ans++;
        else ans--;
    }

    cout << ans << endl;

    return 0;
}

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

using namespace std;

typedef pair<int,int> pii;
pii p[100005];

int main() {
	int n,m;
	cin >> n >> m;
	for(int i=0;i<m;i++){
		int a,b;
		cin >> a >> b;
		p[i] = pii(b,a);
	}
	sort(p,p+m);
	int cnt=1;
	int prev = p[0].first-1;
	for(int i=0;i<m;i++){
		if(p[i].second>prev){
			prev = p[i].first-1;
			cnt++;
		}
	}
	cout << cnt;

}

Measured memory_bytes: 1024
#include <bits/stdc++.h>
using namespace std;
#define _GLIBCXX_DEBUG
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define all(v) v.begin(), v.end()
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>;
const ll MOD = 1e9+7;
const ll INF = 1LL << 60;
const vi d8x = {1, 0, -1, 0, 1, -1, -1, 1};
const vi d8y = {0, 1, 0, -1, 1, 1, -1, -1};
const vi d4x = {1, 0, -1, 0};
const vi d4y = {0, 1, 0, -1};

//---------------from here-----------------

int main(){
    int n,m; cin>>n>>m;
    vector<pair<int,string>> p(m);
    rep(i,m){
        cin>>p[i].first>>p[i].second;
    }
    vector<pair<bool,int>> result(n,pair<bool,int>(0,0));
    rep(i,m){
        if(result[p[i].first-1].first==true) continue;
        if(p[i].second=="AC"){
            result[p[i].first-1].first=true;
            continue;
        }
        if(p[i].second=="WA"){
            result[p[i].first-1].second++;
        }
    }
    int ac=0;
    int wa=0;
    rep(i,n){
        if(result[i].first==true){
            ac++;
            wa+=result[i].second;
        }
    }
    cout<<ac<<" "<<wa<<endl;
}

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

using namespace std;

int main(){

  int N = 0, L = 0, s=0;

  cin >> N >> L;
  vector<int> a(N);

  for(int i=0; i<N; ++i){
    a[i] = L + i ;
    s += L + i ;
  }

  int ans = 1e9;
  for(int i=0; i<N; ++i){
    int t = s - a[i];
    if ( abs( t - s ) < abs(ans - s) ){
      ans = t;
    }
  }

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


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

using namespace std;

int main() {
    int n,k;
    cin >> n >> k;
    string s;
    cin >> s;
    k = k-1;
    if(s[k] == 'A') s[k]= 'a';
    if(s[k] == 'B') s[k]= 'b';
    if(s[k] == 'C') s[k]= 'c';
    cout << s << endl;
}

Measured memory_bytes: 256
import java.util.ArrayDeque;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Queue;
import java.util.Scanner;
 


public class Main {
	static int a1[]= {0,-1,0,1};
	static int b1[]= {-1,0,1,0};
	private static         Scanner sc = new Scanner(System.in);
	//result = Math.pow(num1, num3)
	//StringBuffer str = new StringBuffer(hoge1);
	//String hoge2 = str.reverse().toString();
	//map.containsKey(A)

	//Map<String, Integer> map = new HashMap<String, Integer>(n);
	/*for ( キーのデータ型 key : マップの名前.keySet() ) {
		データのデータ型 data = マップの名前.get( key );
		
		// keyやdataを使った処理;
	}*/
	//int i = Integer.parseInt(s);
	//Queue<String> qq=new ArrayDeque<>(); //add,poll,peek
	//Deque<String> qq=new ArrayDeque<>();//push,pop,peek
	//ArrayList<String> cc = new ArrayList<>(n);
	//Collections.sort(list);
	//Array.sort(list);   cc.contains(tmp)
	//Arrays.asList(c).contains("a")
	//list.set(1,"walk");//1 1 2 3 5
	static int K,N;
	static int mod =1000000007;
	public static void main(String[] args) {
		int a=sc.nextInt();
		double p=3.141592653589793;
		System.out.println(2*a*p);
		//String S=sc.next();
		//int v[]=new int[a];
		
		
		 
		
	}

	
	//static ArrayList<Integer> cc = new ArrayList<>(10001);
	
	static void p(String ans) {System.out.println(ans);};
	static void p(int ans) {System.out.println(ans);};
	static void p() {System.out.println();};
	static void p(long ans) {System.out.println(ans);};
	static void p(double ans) {System.out.println(ans);};
	public static int gcd(int a, int b) {
        return b == 0 ? a: gcd(b, a % b);
	}
	static String nextPermutation(String s) {
		ArrayList<Character> list=new ArrayList<>();
		for(int i=0;i<s.length();i++) {
			list.add(s.charAt(i));
		}
		int pivotPos=-1;
		char pivot=0;
		for(int i=list.size()-2;i>=0;i--) {
			if(list.get(i)<list.get(i+1)) {
				pivotPos=i;
				pivot=list.get(i);
				break;
			}
		}
		if(pivotPos==-1&&pivot==0) {
			return "Final";
		}
		int L=pivotPos+1,R=list.size()-1;
		
		
		
		int minPos=-1;
		char min =Character.MAX_VALUE;
		
		for(int i=R;i>=L;i--) {
			if(pivot<list.get(i)) {
				if(list.get(i)<min) {
					min=list.get(i);
					minPos=i;
				}
			}
		}
		
		Collections.swap(list, pivotPos, minPos);
		Collections.sort(list.subList(L, R+1));
		
		
		StringBuilder sb=new StringBuilder();
		for(int i=0;i<list.size();i++) {
			sb.append(list.get(i));
		}
		return sb.toString();
	}
}
	


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

#define foreach(i, v) for(__typeof((v).begin()) i = (v).begin(); i != (v).end(); ++ i)
#define BETWEEN(a, x, b) (a<=x&&x<b)

using namespace std;
typedef long long ll;

int F[105];
int P[105][15];

int main(int argc, char *argv[]) {
  ios::sync_with_stdio(false);
	cin.tie(nullptr);
	cout.tie(nullptr);

  int n;cin>>n;
  for(int i=0;i<n;i++){
    for(int j=0;j<10;j++){
      int t;cin>>t;
      if(t) F[i] += (1<<j);
    }
  }
  for(int i=0;i<n;i++){
    for(int j=0;j<=10;j++){
      cin>>P[i][j];
    }
  }
  int ans = -1000*1000*2000;

  for(int i=1;i<(1<<10);i++){
    int res = 0;
    for(int j=0;j<n;j++){
      int t = 0;
      for(int k = 0;k<10;k++){
        if(i&F[j]&(1<<k))t++;
      }
      // if(i==1024)cout<<F[j]<<' '<<t<<endl;
      res += P[j][t];
    }
    // if(res==0)
    //   cout<<i<<' '<<res<<endl;
    ans = max(res,ans);
  }

  cout<<ans<<endl;

  return 0;
}


Measured memory_bytes: 256
n, l = gets.chomp.split.map(&:to_i)

x = -1
v = 0xfffffffff
1.upto(n) do |i|
  w = (l + i - 1).abs
  if w < v
    v = w
    x = i
  end
end

puts n * (n + 2 * l - 1) / 2 - (l + x - 1)

Measured memory_bytes: 1788
#include <bits/stdc++.h>
#define REP(i, n) for (int (i) = 0; (i) < (int)(n); i++) 
#define FOR(i, a, b) for(int (i) = a; (i) < (int)b; i++)
#define RREP(i, n) for(int (i)=((int)(n)-1); (i)>=0; i--)
#define RFOR(i, a, b) for(int (i) =((int)(b)-1); (i)>=(int)a; i--)
#define ALL(v) (v).begin(),(v).end()
#define MOD 1000000007
#define NIL -1
#define FI first
#define SE second
#define MP make_pair
#define PB push_back
#define SZ(x)  (int)x.size()
#define SP(x)  setprecision((int)x)


using namespace std ;
typedef long long ll;
using Graph = vector<vector<int>>;
typedef vector<int> vint;
typedef vector<vint> vvint;
typedef vector<string> vstr;
typedef pair<int, int> pii;
const int INF = 1e9;
const ll LINF = 1e18;
const double EPS = 1e-9;
const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};
ll gcd(ll a, ll b) {return b ? gcd(b, a % b) : a;} //最大公約数
ll lcm(ll a, ll b) {return a / gcd(a, b) * b;} //最小公倍数

//-------------------------------------------------
// 
void yes(){
  cout <<"Yes"<<endl ;
}
void no(){
  cout <<"No"<<endl ;
}


//-------------------------------------------------
// メモ
/*






*/
//-------------------------------------------------


int main()
{
  cin.tie(0);
  ios::sync_with_stdio(false);
  ll k, a, b ;
  cin >> k >> a >> b ;
  ll ans1, ans2 ;
  ans1 = ans2 = 0 ;
  
  ans1 = 1+k ;
  
  k -= (a-1) ;
  
  if(k%2==0){
    ll kk = k/2 ;
    ans2 = kk*b-(kk-1)*a ;
  }
  else{
    ll kk = k/2 ;
    ans2 = kk*b-(kk-1)*a + 1 ;
  }
  
  cout << max(ans1,ans2) <<endl ;
    
  
  return 0 ;

}

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

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

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

    for (int i = 1; i <= n; i++) {
        for (int j = 1; j <= n; j++) {
            for (int k = 1; k <= i; k++) {
                for (int l = 1; l <= j; l++) {
                    sum[i][j] += a[k][l];
                }
            }
        }
    }

    int maxi = sum[1][1];
    for (int i = 1; i <= n; i++) {
        for (int j = 1; j <= n; j++) {
            //maxi = max(maxi, sum[i][j]);
            for (int k = 1; k <= i; k++) {
                for (int l = 1; l <= j; l++) {
                    int temp;
                    temp = sum[i][j] - sum[i][l - 1] - sum[k - 1][j] + sum[k - 1][l - 1];
                    maxi = max(maxi, temp);
                }
            }
        }
    }
    cout << maxi << endl;
    
    /*
    for (int i = 0; i <= n; i++) {
        for (int j = 0; j <= n; j++) {
            cout << sum[i][j] << " ";
        }
        cout << endl;
    }
    */
    return 0;
}

Measured memory_bytes: 3164
#include <bits/stdc++.h>
using namespace std;
#define IOS ios::sync_with_stdio(false), cin.tie(0)
#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(x) (x).begin(), (x).end()
#define dump(x) cout << (x) << endl
#define LMAX 9223372036854775807LL
#define LMIN -9223372036854775807LL
using ll = long long;
template<typename T>
using vec = vector<T>;
using P = pair<ll, ll>;
template <typename A, size_t N, typename T>
void Fill(A (&array)[N], const T &val){
	fill((T *)array, (T *)(array + N), val);
}

const ll INF = 1e16;
const ll MOD = 1e9 + 7;
//int dx[4] = {1,0,-1,0};
//int dy[4] = {0,1,0,-1};
//ll pas[51][52];

signed main(){
	IOS;
	ll n;
	cin >> n;
	string s;
	cin >> s;
	vec<bool> t(n);
	for(int i = 0;i < (1 << 2);i++){
		for(int j = 0;j <= 1;j++){
			if((1 << j) & i)t[j] = true; //isSheep?
			else t[j] = false;
		}
		for(int j = 2;j < n;j++){
			if((t[j - 1] && (s[j - 1] == 'o') || (!t[j - 1] && (s[j - 1] == 'x'))))t[j] = t[j - 2];
			else t[j] = !t[j - 2];
		}
		if((t[n - 1] && (s[n - 1] == 'o') || (!t[n - 1] && (s[n - 1] == 'x'))) && t[0] != t[n - 2])continue;
		if((t[n - 1] && (s[n - 1] == 'x') || (!t[n - 1] && (s[n - 1] == 'o'))) && t[0] == t[n - 2])continue;
		if((t[0] && (s[0] == 'o') || (!t[0] && (s[0] == 'x'))) && t[1] != t[n - 1])continue;
		if((t[0] && (s[0] == 'x') || (!t[0] && (s[0] == 'o'))) && t[1] == t[n - 1])continue;
		for(int j = 0;j < n;j++){
			if(t[j])cout << 'S';
			else cout << 'W';
		}
		cout << endl;
		return 0;
	}
	dump(-1);
}	

Measured memory_bytes: 592
#include<iostream>
#include<algorithm>
#define rep(i,n) for(int i=0;i<(int)n;i++)
using namespace std;
typedef long long ll;
 
const ll INF = (ll)1e16;
ll n,m,l,s,t;
ll a,b,c;
ll r[20],e[20];
ll d[330][300], dis[20][20];
ll cycle[1<<20][20];
 
int main(){
  while(cin >> n >> m >> l >> s >> t, n){
    rep(i,n)rep(j,n)d[i][j] = INF;
    rep(i,n)d[i][i] = 0;
 
    rep(i,m){
      cin >> a >> b >> c; a--; b--;
      d[a][b] = d[b][a] = c;
    }
 
    rep(k,n)rep(i,n)rep(j,n)d[i][j] = min(d[i][j],d[i][k] + d[k][j]);
 
    rep(i,l)cin >> r[i] >> e[i];
    
    rep(i,l+1)rep(j,l+1)dis[i][j] = INF;
    rep(i,l+1)dis[i][i] = 0;
 
    rep(i,l)dis[l][i] = dis[i][l] = d[s-1][r[i]-1];
    rep(i,l)rep(j,l)dis[i][j] = d[r[i]-1][r[j]-1];
 
    rep(i,1<<(l+1))rep(j,l+1)cycle[i][j] = INF;
    cycle[0][l] = 0;
 
    rep(i,1<<(l+1)){
      rep(j,l+1){
	rep(k,l+1){
	  cycle[i|1<<j][k] = min(cycle[i|1<<j][k], cycle[i][j] + dis[j][k]);
	}
      }
    }
 
    int ans = 0;
    rep(bit,1<<(l+1)){
      ll sum = 0;
      rep(i,l){
	if((bit>>i)&1)sum += e[i];
      }
      if(sum + cycle[bit][l] <= t)ans = max(ans,__builtin_popcount(bit));
    }
    cout << ans-1 << endl;
  }
}

Measured memory_bytes: 24396
#include <iostream>
#include <cmath>
#include <algorithm>
#include <string>
using namespace std;

int main(){
  int N;
  cin>>N;
  int x[N];
  for (int i=0;i<N;i++){
    cin>>x[i];
  }
  sort(x,x+N,greater<int>());
  int ml=x[0];
  int sum=0;
  for (int i=1;i<N;i++){
    sum+=x[i];
  }
  if (ml<sum){
    cout<<"Yes";
  }
  else{
    cout<<"No";
  }
  return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h> 
using namespace std;
using ll=long long;
#define fi first
#define se second
map<int,int> mp;
ll gcd(ll a,ll b) {return b ? gcd(b,a%b):a;}
ll lcm(ll c,ll d){return c*d/gcd(c,d);}
int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(0);cout.tie(0);
int n;
cin>>n;
vector<ll> a(n),b(n);
for(int i=0;i<n;i++)cin>>a.at(i)>>b.at(i);
ll ans=0;
for(int i=n-1;i>=0;i--){
    if((a.at(i)+ans)%b.at(i)==0)continue;
    ans+=b.at(i)-(a.at(i)+ans)%b.at(i);
}
cout<<ans<<endl;
}


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

using namespace std;

int main() {
    string s, t;
    bool flag = false;
    cin >> s >> t;
    sort(s.begin(), s.end());
    sort(t.begin(), t.end(), greater<char>());
    if (s.length() < t.length())
        for (int i = 0; i < t.length() - s.length(); i++)
            s.append("a");
    
    for (int i = 0; i< min(t.size(), s.size()); i++) {
        if (t[i] > s[i]) {
            flag = true;
            break;
        }
    }
    if (flag)
        cout << "Yes" << endl;
    else
        cout << "No" << endl;
}


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

int main () {
  int H, W;
  cin >> H;
  cin >> W;
  
  char a[H][W];
  for (int i = 0; i < H; i++) {
    for (int j = 0; j < W; j++) {
      cin >> a[i][j];
    }
  }
  
  for (int s = 0; s < H + 2; s++) {
    if (s == 0 || s == H + 1) {
      for (int t = 0; t < W + 2; t++) {
        cout << '#';
      }
    } else {
      for (int t = 0; t < W + 2; t++) {
        if (t == 0 || t == W + 1){ 
          cout << '#';
        } else {
          cout << a[s - 1][t - 1];
        }
      }
    }
    cout << endl;
  }
}


Measured memory_bytes: 3576
#include<bits/stdc++.h>                                                   //---------------------------------------------------------------
                                                                    
# define ll long long   
# define ld long double                                               
# define mod 1000000007                                                   
# define MAX 100005
# define pi 3.141592653589793238                                                                                  //shortcut keys
                                                                                
# define pb push_back                                                                     
# define mp make_pair 
# define all(x) x.begin(),x.end()                                                      
                                                                  
# define fast ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);        //---------------------------------------------------------------                                       
using namespace std;
int main(){
	ll x;
	cin>>x;
	ll a,b;
	for(ll i=-1000;i<=1000;i++){
		for(ll j=-1000;j<=1000;j++){
			ll y=(ll)(i*i*i*i*i)-(ll)(j*j*j*j*j);
			if(y==x){
				a=i;b=j;break;
			}
			//cout<<i<<" "<<j<<"\n";
		}
	}
		cout<<a<<" "<<b<<'\n';
	
	
}

Measured memory_bytes: 3592
#include<map>
#include<iostream>
#include<deque>
#include<algorithm>
#include<string>
#include<cctype>
#include<iomanip>
#include<vector>
#include<queue>
 
using namespace std;
#define REP(i,b,e) for(int i=(int)b;i<(int)e;i++)
#define rep0(i,n) REP(i,0,n)
#define rep1(i,n) REP(i,1,n+1)
#define shosu setprecision(10)
typedef long long ll;
typedef pair<int,pair<int,pair<int,int>>> P;

ll longinf=1ll<<60;
int inf=1<<29;

int N;
int a[3002];
int main(){
    cin>>N;
    rep0(i,N) cin>>a[i];
    ll su=0;
    rep0(i,N) su+=(a[i]-1);
    cout<<su<<endl;

    return 0;
}

Measured memory_bytes: 384
while True:
    W,H = map(int,input().split())
    if W==0 and H==0:
        break
    print("#"*H)
    for i in range(W-2):
        print("#",end='')
        print("."*(H-2),end='')
        print("#")
    print("#"*H)
    print()
"""
while True:
    a,b=map(int,input().split())
    if a==0 and b==0:break
    f=[[0 for i in range(b)]for j in range(a)]
    for i in range(a):
        for j in range(b):
            if i==0 or i==a-1 or j==0 or j==b-1:
                f[i][j]=1
    for i in range(a):
        for j in range(b):
            if f[i][j]==1:
                print('#',end='')
            else :
                print('.',end='')
        print()
    print()
"""


Measured memory_bytes: 5632
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (long long i = 0; i < (long long)(n); i++)
typedef long long ll;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
const long long INF = 1LL << 60;
const int inf = 1001001001;
 
int main(){

    ll a;
    double b;
    cin >> a >> b;
    ll c=b*100+0.01;
    cout << a*c/100 << endl; 
}


Measured memory_bytes: 3700
def main():
    import sys
    read = sys.stdin.buffer.read
    readline = sys.stdin.buffer.readline
    readlines = sys.stdin.buffer.readlines
    sys.setrecursionlimit(10 ** 7)

    n, k = map(int, readline().split())
    p = list(map(int, readline().split()))
    p.sort()
    print(sum(p[:k]))


if __name__ == '__main__':
    main()


Measured memory_bytes: 62200
#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<iomanip>
#include<math.h>
#include<complex>
#include<queue>
#include<deque>
#include<stack>
#include<map>
#include<set>
#include<bitset>
#include<functional>
#include<assert.h>
#include<numeric>
using namespace std;
typedef pair<int,int> P;
typedef long long ll;
typedef long double ld;
const int inf=1e9+7;
const ll longinf=1LL<<60;
#define REP(i,m,n) for(int i=(int)(m) ; i < (int) (n) ; ++i )
#define rep(i,n) REP(i,0,n)
#define F first
#define S second

const int mx=100010;
const ll mod=1e9+7;

int main(){
  string s,t;
  cin >> s >> t;
  vector<int> sa(mx,0),sb(mx,0),ta(mx,0),tb(mx,0);
  int ssz = s.size(), tsz = t.size();
  rep(i,ssz){
    if(s[i]=='A'){sa[i]++;}else{sb[i]++;}
  }
  rep(i,tsz){
    if(t[i]=='A'){ta[i]++;}else{tb[i]++;}
  }

  vector<int> scnt(ssz+1,0);
  rep(i,ssz){
    scnt[i+1] = scnt[i] + sb[i] + sa[i]*2;
  }
  vector<int> tcnt(tsz+1,0);
  rep(i,tsz){
    tcnt[i+1] = tcnt[i] + tb[i] + ta[i]*2;
  }

  int T; cin >> T;
while(T--){
  int a,b,c,d; cin >> a >> b >> c >> d;
  if(((scnt[b]-scnt[a-1])-(tcnt[d]-tcnt[c-1]))%3==0){
    cout << "YES" << endl;
  } else {
    cout << "NO" << endl;
  }
}
  return 0;
}

Measured memory_bytes: 3200
#include <bits/stdc++.h>
#define f(i,j,k) for(int i=j;i<k;i++)
#define f2(i,j,k) for(int i=j;i>k;i--)
using namespace std;
int main(){
    long long n,ans=0,now=3,k=1;
    cin>>n;
    long long a[n];
    f(i,0,n){
        cin>>a[i];
    }
    if(a[0]>a[1]){
        now=1;
    }
    else if(a[0]<a[1]){
        now=2;
    }
    f(i,2,n){
        if(a[i]>a[i-1]){
            if(now==1&&k>=1){
                ans++;
                k=0;
            }
            else{
                k++;
            }
            now=2;
        }
        else if(a[i]<a[i-1]){
            if(now==2&&k>=1){
                ans++;
                k=0;
            }
            else{
                k++;
            }
            now=1;
        }
    }
    cout<<ans+1<<endl;
    return 0;
}


Measured memory_bytes: 4332
#include<stdio.h>
#include<math.h>
int main(){
  unsigned long long int in1,in2,in3,in4,r,a,b,lcm,sum = 0;
  scanf("%lld %lld %lld %lld",&in1 ,&in2 ,&in3 ,&in4);
  //sum = in2 - in1 + 1;
  
  if(in3 < in4){
    a = in4; b = in3;
  }else{
    b = in4; a = in3;
  }
  
  sum += (in2 - in1 + 1) - ((in2/in3) - (in1 - 1)/in3 + (in2/in4) - (in1 - 1)/in4);
  
  r = a % b;
  while(r != 0){
    a = b;
    b = r;
    r = a % b;
  }
  
  lcm = in3 * in4 / b;
  sum += (in2/lcm) - (in1 - 1)/lcm;
  
  printf("%llu\n",sum);

  return 0;
}

Measured memory_bytes: 128
//R<3S
#include <bits/stdc++.h>
#define hell 1000000007
#define PI 3.14159265358979323844
#define mp make_pair
#define pb push_back
#define fi first 
#define se second
#define ALL(v) v.begin(), v.end()
#define SORT(v) sort(ALL(v))  
#define REVERSE(v) reverse(ALL(v))
#define endl "\n"
#define vecmax(v) max_element(all(v))
#define vecmin(v) min_element(all(v))
#define GCD(m,n) __gcd(m,n)
#define LCM(m,n) m*(n/GCD(m,n))
#define rep(i, n)    for(int i = 0; i < (n); ++i)
#define repA(i, a, n)  for(int i = a; i <= (n); ++i)
#define repD(i, a, n)  for(int i = a; i >= (n); --i)
#define trav(x) for(auto i : x)
#define sz(a) (int)a.size()
#define sl(a) (int)a.length()
#define int long long
#define ld long double 
#define pii std::pair<int, int> 
#define pll std::pair<ll, ll>  
#define vi vector<int>  
#define vl vector<ll>
#define vvi vector<vi > 
#define vii vector<pii >
#define mii map<int,int>
#define mll map<ll,ll>


using namespace std;
int n;
int a[22][22];
int dp[22][((1<<21)+2)];

int find(int i,int bitmask)
{
	if(i==n)return (__builtin_popcount(bitmask)==n);
	if(dp[i][bitmask]!=-1)return dp[i][bitmask];
	
	int tot=0;
	rep(j,n)
	{
		if(a[i][j] && !(bitmask & (1<<j)))
		{
			tot+=find(i+1,bitmask | (1<<j));
			tot%=hell;
		}
	}
	return dp[i][bitmask] = tot;
}


void solve()
  {
	memset(dp,-1,sizeof dp);
	cin>>n;
	rep(i,n)
	{
		rep(j,n)
		{
			cin>>a[i][j];
		}
	}
	
	cout<<find(0,0);


  }



signed main()
{
   std::ios_base::sync_with_stdio(false);
   cin.tie(0);
   cout.tie(0);
   int t;
   t=1;
   //cin>>t;
   while(t--)
    {
        solve();
    }


   return 0;
}


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

#define rep(i, n) for (int i = 0; i < int(n); i++)
#define rrep(i, n) for (int i = int(n) - 1; i >= 0; i--)
#define reps(i, n) for (int i = 1; i <= int(n); i++)
#define rreps(i, n) for (int i = int(n); i >= 1; i--)
#define repc(i, n) for (int i = 0; i <= int(n); i++)
#define rrepc(i, n) for (int i = int(n); i >= 0; i--)
#define repi(i, a, b) for (int i = int(a); i < int(b); i++)
#define repic(i, a, b) for (int i = int(a); i <= int(b); i++)
#define all(a) (a).begin(), (a).end()
#define bit32(x) (1 << (x))
#define bit64(x) (1ll << (x))
#define sz(v) ((int) v.size())

using namespace std;

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

void yes() { cout << "Yes" << endl; exit(0); }
void no() { cout << "No" << endl; exit(0); }
template <typename T> class pqasc : public priority_queue<T, vector<T>, greater<T>> {};
template <typename T> class pqdesc : public priority_queue<T, vector<T>, less<T>> {};
template <typename T> void amax(T &x, T y) { x = max(x, y); }
template <typename T> void amin(T &x, T y) { x = min(x, y); }
template <typename T> T exp(T x, i64 n, T e = 1) { T r = e; while (n > 0) { if (n & 1) r *= x; x *= x; n >>= 1; } return r; }
template <typename T> istream& operator>>(istream &is, vector<T> &v) { for (auto &x : v) is >> x; return is; }
template <typename T> ostream& operator<<(ostream &os, vector<T> &v) { rep(i, v.size()) { if (i) os << ' '; os << v[i]; } return os; }
void solve(); int main() { ios::sync_with_stdio(0); cin.tie(0); cout << fixed << setprecision(16); solve(); return 0; }

const int INF = 1001001001;
const int dx[] = {1, 0, -1, 0};
const int dy[] = {0, 1, 0, -1};

void solve() {
  string s;
  cin >> s;
  cout << s.substr(0, 3) << endl;
}


Measured memory_bytes: 3652
using System;
using System.Linq;

class Program {
  static void Main() {
    var n = Console.ReadLine().Split().Select(int.Parse).ToArray()[0];
    var s = Enumerable.Repeat(0, n).Select(_ => Console.ReadLine()).OrderBy(x => x);
    foreach (var item in s) {
      Console.Write(item);
    }
    Console.WriteLine();
  }
}

Measured memory_bytes: 11616
#include<bits/stdc++.h>
  using namespace std;
  #define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
  #define endl "\n"
  #define all(v) v.begin(),v.end()
  #define f first
  #define s second
  #define PB push_back
  #define MP make_pair
  #define double long double
  #define trace1(x)                cerr<<#x<<": "<<x<<endl
  #define trace2(x, y)             cerr<<#x<<": "<<x<<" | "<<#y<<": "<<y<<endl
  #define trace3(x, y, z)          cerr<<#x<<":" <<x<<" | "<<#y<<": "<<y<<" | "<<#z<<": "<<z<<endl
  #define trace4(a, b, c, d)       cerr<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<endl
  #define trace5(a, b, c, d, e)    cerr<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<" | "<<#e<< ": "<<e<<endl
  #define trace6(a, b, c, d, e, f) cerr<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<" | "<<#e<< ": "<<e<<" | "<<#f<<": "<<f<<endl
  #define cases int testcases;cin>>testcases; while(testcases--)
  #define MOD 998244353
  #define N 100005
  #define INF 1000000000000
  #define eps 1e-6
  #define int long long



int parent[N],sz[N];
void make_set(int n)
{
  for(int i = 0; i <= n; i++)
  {
    parent[i] = i;
    sz[i] = 1;
  }
}

int getParent(int s)
{
  if(s == parent[s])return s;
  else return parent[s] = getParent(parent[s]);
}

void join(int a,int b)
{
  a = getParent(a);
  b = getParent(b);

  if(a != b)
  {
    parent[b] = a;
    sz[a] += sz[b];
    sz[b] = 0;
  }
}

int ans1[N];
int ans2[N];

int32_t main()
{



    int n,m,k;
    cin >> n >> m >> k;

    make_set(n);

     for(int i = 1; i <= m; i++)
     {
      int x,y;
      cin >> x >> y;
     // trace2(sz[x],sz[y]);
      join(x,y);
      ans1[x]++;
      ans1[y]++;

     }

     for(int i = 1; i <= k; i++)
     {
      int x,y;
      cin >> x >> y;
      if(getParent(x) == getParent(y))
      {
        ans2[x]++;
        ans2[y]++;
      }
     }

     for(int i = 1; i <= n; i++)
     {
      int y = getParent(i);
      cout << sz[y] - ans1[i] - ans2[i] - 1 << " ";
     }



    return 0;
}

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

#ifndef M_PI
#define M_PI 3.14159265358979
#endif
#define deg_to_rad(deg) (((deg) / 360) * 2 * M_PI)
#define rad_to_deg(rad) (((rad) / 2 / M_PI) * 360)

using namespace std;

typedef long long ll;
typedef vector<long long> vll;
typedef pair<long long, long long> pll;
typedef pair<double, double> pd;

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

int main() {
    ll i, j, k;
    ll X, Y;
    cin >> X >> Y;
    for(i = 0; i < X + 1; i++) {
        ll leg = 2 * i + 4 * (X - i);
        if(leg == Y) {
            cout << "Yes" << endl;
            return 0;
        }
    }
    cout << "No" << endl;

    return 0;
}


Measured memory_bytes: 3632
#include <iostream>
#include <bits/stdc++.h>
#define fast ios_base::sync_with_stdio(false);cin.tie(NULL)
#define ll long long
#define li long ll
#define pp pair<ll, ll> 
#define lb lower_bound
#define ub upper_bound
#define mk make_pair
#define pb push_back
#define llp(i, x, n) for (ll i = x; i < n; i++)
#define yes cout << "YES" << endl
#define no cout << "NO" << endl
#define fr first
#define ss second
#define mod 1000000007
using namespace std;
int main()
{
	fast;
    string s;
    cin>>s;
    int n=s.size();
    ll sum=0;
    for(int i=0;i<n;i++)
    {
    	sum+=s[i]-'0';
    }
    if(sum%9==0)
    cout<<"Yes"<<endl;
    else
    cout<<"No"<<endl;
}

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

#undef _P
#define _P(...) (void)printf(__VA_ARGS__)
#define FOR(x,to) for(x=0;x<(to);x++)
#define FORR(x,arr) for(auto& x:arr)
#define ITR(x,c) for(__typeof(c.begin()) x=c.begin();x!=c.end();x++)
#define ALL(a) (a.begin()),(a.end())
#define ZERO(a) memset(a,0,sizeof(a))
#define MINUS(a) memset(a,0xff,sizeof(a))
//-------------------------------------------------------

void solve() {
	int i,j,k,l,r,x,y; string s[3];
	cin>>s[0]>>s[1]>>s[2];
	cout<<s[0][0]<<s[1][1]<<s[2][2]<<endl;
}


int main(int argc,char** argv){
	string s;int i;
	if(argc==1) ios::sync_with_stdio(false), cin.tie(0);
	FOR(i,argc-1) s+=argv[i+1],s+='\n'; FOR(i,s.size()) ungetc(s[s.size()-1-i],stdin);
	cout.tie(0); solve(); return 0;
}


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

  if(X % 10 == 3){
    cout << "bon" << endl;
    return 0;
  } else if(X % 10 == 0 || X % 10 == 1 || X % 10 == 6 || X % 10 == 8){
    cout << "pon" << endl;
    return 0;
  }  
  cout << "hon" << endl;
 
}

Measured memory_bytes: 3632
using System;
using System.Collections;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Security.Cryptography.X509Certificates;

namespace Tasks
{
    public class D
    {
        static void Main(string[] args)
        {
            var sw = new StreamWriter(Console.OpenStandardOutput()) { AutoFlush = false };
            Console.SetOut(sw);
            Solve();
            Console.Out.Flush();
        }

        public static void Solve()
        {
            var N = Scanner.Scan<int>();
            var A = Scanner.ScanEnumerable<long>().ToArray();
            var dict = new Dictionary<long, long>();
            foreach (var a in A)
            {
                if (!dict.ContainsKey(a)) dict[a] = 0;
                dict[a]++;
            }

            var comb = dict.Values.Sum(x => x * (x - 1) / 2);

            foreach (var a in A)
            {
                var count = dict[a];
                var sub = count * (count - 1) / 2;
                var add = (count - 1) * (count - 2) / 2;
                Console.WriteLine(comb - sub + add);
            }
        }

        public static class Scanner
        {
            private static Queue<string> queue = new Queue<string>();
            public static T Next<T>()
            {
                if (!queue.Any()) foreach (var item in Console.ReadLine().Trim().Split(" ")) queue.Enqueue(item);
                return (T)Convert.ChangeType(queue.Dequeue(), typeof(T));
            }
            public static T Scan<T>() => Next<T>();
            public static (T1, T2) Scan<T1, T2>() => (Next<T1>(), Next<T2>());
            public static (T1, T2, T3) Scan<T1, T2, T3>() => (Next<T1>(), Next<T2>(), Next<T3>());
            public static (T1, T2, T3, T4) Scan<T1, T2, T3, T4>() => (Next<T1>(), Next<T2>(), Next<T3>(), Next<T4>());
            public static (T1, T2, T3, T4, T5) Scan<T1, T2, T3, T4, T5>() => (Next<T1>(), Next<T2>(), Next<T3>(), Next<T4>(), Next<T5>());
            public static IEnumerable<T> ScanEnumerable<T>() => Console.ReadLine().Trim().Split(" ").Select(x => (T)Convert.ChangeType(x, typeof(T)));
        }
    }
}


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

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

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

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


signed main()
{
    string O, E;
    cin >> O >> E;
    REP(i, O.length()) {
        if(i >= E.length()) {
            printf("%c", O[i]);
        } else {
            printf("%c%c", O[i], E[i]);
        }
    }
    printf("\n");
    return 0;
}


Measured memory_bytes: 384
#include <iostream>
#include <array>
#include <vector>
#include <iomanip>
#include <string>
#include <cmath>
#include <algorithm>
#include <queue>
#include <map>
#include <set>

using namespace std;

typedef long long LL;
typedef vector<LL> VEC;
typedef vector<VEC> VVEC;
typedef  pair<LL,LL> P;


const LL INF=1<<30;
const LL MOD=1000000007;


LL ruijo(int n){
    LL ans2=1;
    for(int i=0;i<n;++i){
        ans2*=2;
    }
    return ans2;
}


int main(){
    LL n;
    cin>>n;
    string s=to_string(n);
    LL f=0;
    for(int i=0;i<s.size();++i){
        f+=s[i]-'0';
        }

        if(n%f==0)cout<<"Yes"<<endl;
        else cout<<"No"<<endl;
}



Measured memory_bytes: 256
// WeirdBugsButOkay

# include <bits/stdc++.h>
 
# define ll long long
# define ld long double
# define pii pair <int,int>
# define pll pair <ll,ll>
# define mp make_pair
# define pb push_back
# define ff first
# define ss second
# define endl '\n'
 
using namespace std;

ll pow3(ll a, ll b, ll m = 1000000007)
{
    ll res = 1;
    while(b > 0)
    {
        if(b & 1)
            res = (res * a) % m;
        a = (a * a) % m;
        b >>= 1;
    }
    return res;
}

void solve()
{
    ll n, m;
    cin >> n >> m;
    ll a[m];
    for(ll i = 0; i < m; i++)
        cin >> a[i];
    ll sum = 0;
    for(ll i = 0; i < m; i++)
        sum += a[i];
    if(sum > n)
        cout << -1;
    else cout << n - sum;
}

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

Measured memory_bytes: 3716
/* test code */
#include <iostream>
#define ll long long
#define rep(i,n) for(int i=0;i<n;i++)
using namespace std;

int main(){
	ll n;
	cin >> n;
	ll a[n];
	ll count[n+1]={};
	rep(i,n){
		cin>>a[i];
		count[a[i]]++;
	}
	ll ans[n+1]={};
	ll sum = 0;
	for(int i=1;i<n+1;i++){
		ans[i] = count[i]*(count[i]-1)/2;
		sum+=ans[i];
	}
	for(int i=1;i<n+1;i++){
		ll coun = count[a[i-1]]-1;
		ll each = coun*(coun-1)/2;
		cout << sum - ans[a[i-1]] + each << endl;
	}
}


Measured memory_bytes: 7296