akhauriyash/Code-Regression huggingface dataset:
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 N=sc.nextInt();
		String S=sc.next();
		int x=0;
		int max=0;
		for(int i=0;i<N;i++) {
			max=Math.max(max, x);
			if(S.charAt(i)==68)x--;
			else x++;
		}
		max=Math.max(max, x);
		p(max);
		
		}

	
	//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);};
	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: 21844
#include<bits/stdc++.h>
using namespace std;
#define For(i,m,n) for(int i=m;i<n;i++)
#define FOR(i,n) for(int i=0;i<n;i++)
#define ll long long
#define ull unsigned long long
#define lli long long int
#define pb push_back
# define M_PI           3.14159265358979323846  /* pi */
ll mob=1000000007;
using namespace std;
int main()
{ 

ll n,m;cin>>n>>m;
int a[m];
FOR(i,m)cin>>a[i];
ll sum=0;
FOR(i,m) sum+=a[i];
if(sum>n) cout<<-1;
else cout<<n-sum;



return 0;
}











Measured memory_bytes: 3676
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define rep(i, n) for(ll i=0; i<n; i++)
#define repr(i, s, e) for(ll i=s; i>=e; i--)
#define reps(i, s, e) for(ll i=s; i<=e; i++)
#define inf 1e18
#define all(v) v.begin(),v.end()
#define ceil(a, b) (a+b-1)/b
#define ok cout << "ok" << endl;
#define sp << " " <<
template<typename T> inline bool chmax(T &a, T b){ if(a<b) a=b; return a<b; }
template<typename T> inline bool chmin(T &a, T b){ if(b<a) a=b; return b<a; }
template<typename T> void vdeb(T v){
    cout << "#vector set debug" << endl;
    for(auto vv : v) cout << vv << " ";
    cout << endl;
}
template<typename T1, typename T2> void adeb(T1 arr[], T2 n){
    cout << "#adebug" << endl;
    for(int i=0; i<=n; i++) cout << arr[i] << " ";
    cout << endl;
}
template<typename T1> void mdeb(T1 mp){
    cout << "#map pair debug" << endl;
    for(auto const& m : mp) cout << m.first sp m.second << endl;
}
template<typename A, size_t N, typename T>
void Fill(A (&array)[N], const T &val){ fill((T*)array, (T*)(array+N), val); }
void ans(bool b){ cout << (b ? "Yes" : "No") << endl; }
void ans2(bool b){ cout << (b ? "YES" : "NO") << endl; }
int dx[] = {1, 0, -1, 0, 1, -1, 1, -1};
int dy[] = {0, 1, 0, -1, 1, -1, -1, 1};


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

    int n, m;
    ll t, tmp;
    map<ll, int> d;
    cin >> n;
    rep(i, n){
        cin >> tmp;
        d[tmp]++;
    }
    cin >> m;
    bool res = true;
    rep(i, m){
        cin >> t;
        auto itr = d.find(t);
        if(itr == d.end()) res = false;
        else if(itr->second == 0) res = false;
        else{
            itr->second--;
        }
    }

    ans2(res);

    //mdeb(d);

    return 0;
}


Measured memory_bytes: 12800
A, B = [int(x) for x in input().split(' ')]
C, D = A + 1, B + 1

for i in range(int(min(A / 0.08, B * 10, C / 0.08, D * 10) // 1),
               int(max(A / 0.08, B * 10, C / 0.08, D * 10) // 1) + 1):
  if int(i * 0.08 // 1) == A and int(i * 0.1 // 1) == B:
    print(i)
    break
else:
  print(-1)

Measured memory_bytes: 38384
#include<cstdio>
 
long long gcd(long long a,long long b)
{
	if(b==0)
		return a;
	return gcd(b,a%b);
}
 
int main()
{
	int T;
	long long A,B,C,D;
	scanf("%d",&T);
	while(T--)
	{
		scanf("%lld%lld%lld%lld",&A,&B,&C,&D);
		if(A<B||B>D)
		{
			puts("No");
			continue;
		}
		if(B<=C+1)
		{
			puts("Yes");
			continue;
		}
		A=A-((A-C-1)/B)*B;
		if(A<C)
			A+=B;
		if(A<B)
		{
			puts("No");
			continue;
		}
		
		long long nA=(A-B)+((C-(A-B)-1)/D+1)*D;
		long long delta=nA-A;
		if(delta==0)
		{
			puts("Yes");
			continue;
		}
		delta=(delta%B+B)%B;
		{
			long long d=gcd(delta,B);
			if(B-C-1>=d)
			{
				puts("No");
				continue;
			}
			long long r=(A-B)%d;
			if(((B-1)%d>=(C+1)%d)&&(B-1)%d>=r&&r>=(C+1)%d)
			{
				puts("No");
				continue;
			}
			if(((B-1)%d<(C+1)%d)&&((B-1)%d>=r||r>=(C+1)%d))
			{
				puts("No");
				continue;
			}
			puts("Yes");
		}
	}
	
	return 0;
}


Measured memory_bytes: 256
# -*- coding: utf-8 -*-
import fractions

N = int(input())
A = list(map(int, input().split()))


def calc(monsters):
    if len(monsters) == 1:
        return monsters[0]

    min_monster = min(monsters)
    min_index = monsters.index(min_monster)
    new_monsters = []
    for i in range(len(monsters)):
        if i == min_index:
            new_monsters.append(monsters[i])

        remndr = monsters[i] % min_monster
        if remndr != 0:
            new_monsters.append(remndr)

    return calc(new_monsters)


ans = calc(A)
print(ans)

Measured memory_bytes: 16240
#include <iostream>

using namespace std;

void rto(int rt){
    int ht,mt;
    for(ht=0;rt>=3600;++ht)rt-=3600;
        cout<<'0'<<ht<<':';
        for(mt=0;rt>=60;++mt)rt-=60;
        if(mt<10)cout<<'0'; cout<<mt<<':';
        if(rt<10)cout<<'0'; cout<<rt<<endl;
}
int main()
{
    int rt,trt,h,m,s;
    while(1)
    {
        cin>>h>>m>>s;if(h==-1&m==-1&s==-1)return 0;
        rt=7200-(h*3600+m*60+s);
        rto(rt);
        trt=3*rt;
        rto(trt);
    }
}

Measured memory_bytes: 1160
#include <iostream>
#include <stdio.h>
#include <algorithm>
#include <string>
#include <cmath>
#include<math.h>
using namespace std;

int main() {
	int n, a; cin >> n;
	bool ans = 1;
	for (int i = 0; i < n; i++){
		cin >> a;
		if (a % 2 != 1 && a % 3 != 0 && a % 5 != 0) {
			cout << "DENIED" << endl;
			return 0;
		}
	}
	cout << "APPROVED" << endl;
}

Measured memory_bytes: 3632
#pragma GCC optimize ("O3")

#include <bits/stdc++.h>

using namespace std;

#ifdef LOCAL
#include <prettyprint.hpp>
#define debug(...)  cerr << "[" << #__VA_ARGS__ << "]: ", d_err(__VA_ARGS__);
#else
#define debug(...) 83;
#endif

void d_err() {
    cerr << endl;
}

template <typename H, typename... T>
void d_err(H h, T... t) {
    cerr << h << " ";
    d_err(t...);
}

template <typename T>
void print(T x) {
    cout << x << endl;
}

#define ALL(x) (x).begin(), (x).end()
#define FOR(i, m, n) for (int i = (m); i < (n); ++i)
#define REVFOR(i, m, n) for (int i = (n - 1); i >= (m); --i)
#define REP(i, n) FOR(i, 0, n)
#define REVREP(i, n) REVFOR(i, 0, n)
#define fi first
#define se second
#define pb push_back
#define mp make_pair
#define eb emplace_back
#define bcnt __builtin_popcountll

typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef pair<ll,ll> Pll;
typedef pair<int,int> Pin;

ll INF = 1e16;
int inf = 1e9;
ll MOD = 1e9+7;

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

    map<int, int> m;

    FOR(x, 1, 101) FOR(y, 1, 101) FOR(z, 1, 101) {
        m[x * x + y * y + z * z + x * y + y * z + z * x]++;
    }

    FOR(i, 1, N + 1) {
        print(m[i]);
    }
    
}


Measured memory_bytes: 5344
import java.util.*;
import java.math.BigInteger;
 
public class Main {
    public static void main(String[] args) {

        Scanner scan = new Scanner(System.in);
        
        int x = scan.nextInt();
        int y = scan.nextInt();

        if (y % 2 == 0 && y >= 2 * x && y <= 4 * x) {
            System.out.println("Yes");
        } else {
            System.out.println("No");
        }
    }
}

Measured memory_bytes: 35748
import java.util.Scanner;
public class Main{
	public static void main(String[] args){
		new Main().run();
	}
	public void run(){
		Scanner scan = new Scanner(System.in);
		int[][] dx = {{0,1,2},{0,3,6},{0,4,8},{1,4,7},{3,4,5},{6,7,8},{2,4,6},{2,5,8}};
		int fl = 0;	
		while(scan.hasNext()){
			String str = scan.nextLine().replaceAll("o","14").replaceAll("s","18").replaceAll("x","23");
			fl = 0;
			for(int i = 0;i < 8;i++){
				int t = Integer.parseInt(str.charAt(2*dx[i][0])+""+str.charAt(2*dx[i][0]+1)) 
					+ Integer.parseInt(str.charAt(2*dx[i][1])+""+str.charAt(2*dx[i][1]+1)) 
					+ Integer.parseInt(str.charAt(2*dx[i][2])+""+str.charAt(2*dx[i][2]+1));
				if(t == 42){
					fl = 1;
					break;
				}else if(t == 69){
					fl = 2;
					break;
				}
			}
			System.out.println((fl == 0)?"d":(fl == 1)?"o":"x");
		}
	}
}

Measured memory_bytes: 17236
#B
S = input()
Slist = list(S)
ans = 'Yes'
for k in range (int(len(Slist) / 2)):
    if Slist[k] != Slist[len(Slist) - k - 1]:
        ans = 'No'
N = len(Slist)
if ans == 'Yes':
    for k in range (int(int((N)/2)/2)):
        if Slist[k] != Slist[int((N-1)/2) - k - 1]:
            ans = 'No'
if ans == 'Yes':
    for k in range (int(int((N)/2)/2)):
        if Slist[N-k-1] != Slist[int((N+3)/2) + k - 1]:
            ans ='No'
print(ans)


Measured memory_bytes: 3064
from itertools import accumulate

N = int(input())
A = list(map(int, input().split()))

cumA = list(accumulate(A))

l_index = 0
r_index = 2
cumA_max = cumA[-1]

diff = cumA_max

for i in range(1, len(A)-2):
  # iで切った左の部分列において、l_iで切った時、左より右の方が大きいときは1ずらせる
  while cumA[l_index] < cumA[i] - cumA[l_index + 1]:
    l_index += 1

  # iで切った右の部分列において、r_iで切った時、左より右の方が大きいときは1ずらせる
  while cumA[r_index] - cumA[i] < cumA_max - cumA[r_index + 1]:
    r_index += 1
        
  left = cumA[l_index]
  center = cumA[i] - cumA[l_index]
  right = cumA[r_index] - cumA[i]
  last = cumA_max - cumA[r_index]

  diff = min(diff, max(left, center, right, last) - min(left, center, right, last))

print(diff)

Measured memory_bytes: 24168
#include<iostream>
#include<string>
#include<algorithm>
#include<map>
#include<set>
#include<utility>
#include<vector>
#include<cmath>
#include<cstring>
#include<cstdio>
#include<time.h>
#define loop(i,a,b) for(int i=a;i<b;i++) 
#define rep(i,a) loop(i,0,a)
#define rp(a) while(a--)
#define pb push_back
#define mp make_pair
#define all(in) in.begin(),in.end()
const double PI=acos(-1);
const double EPS=1e-10;
using namespace std;
typedef long long ll;
typedef vector<int> vi;
int main(){
	char d[4]={'[',']','(',')'};
	string s;
	while(getline(cin,s),s!="."){
		rep(i,s.size()){
			bool h=false;
			rep(j,4)if(s[i]==d[j])h=true;
			if(!h){
				s.erase(s.begin()+i);
				i--;
			}
		}
		while(1){
			int it;
			if((it=s.find("[]"))!=string::npos)s.erase(it,2);
			else if((it=s.find("()"))!=string::npos)s.erase(it,2);
			else break;
		}
		if(s=="")cout<<"yes"<<endl;
		else cout<<"no"<<endl;
	}
}

Measured memory_bytes: 1192
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using vl = vector<ll>;
template<class T> using vc = vector<T>;
template<class T> using vvc = vector<vector<T>>;

#define eb emplace_back
#define all(x) (x).begin(), (x).end()
#define rep(i, n) for (ll i = 0; i < (n); i++)
#define repr(i, n) for (ll i = (n)-1; i >= 0; i--)
#define repe(i, l, r) for (ll i = (l); i < (r); i++)
#define reper(i, l, r) for (ll i = (r)-1; i >= (l); i--)
#define repa(i,n) for (auto& i: n)

template<class T> inline bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T> inline bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
void init() {cin.tie(0);ios::sync_with_stdio(false);cout << fixed << setprecision(15);}

#ifdef DEBUG
template <class T, class N> void verr(const T& a, const N& n) { rep(i, n) cerr << a[i] << " "; cerr << "\n" << flush; }
ll dbgt = 1; void err() { cerr << "passed " << dbgt++ << "\n" << flush; }
template<class H, class... T> void err(H&& h,T&&... t){ cerr<< h << (sizeof...(t)?" ":"\n") << flush; if(sizeof...(t)>0) err(forward<T>(t)...); }
#endif

const ll INF = 5e18;
const ld EPS = 1e-11;
const ld PI = acos(-1.0L);
const ll MOD = 1e9 + 7;
// const ll MOD = 998244353;
//--------------------------------------------------------------------------------//

int main() {
    init();

    ll N, K;
    cin >> N >> K;
    ll ans = N * (N + 1) * (N + 1) / 2 - K * (K - 1) * (N + 1) / 2 - N * (N + 1) * (2 * N + 1) / 6 + K * (K - 1) * (2 * K - 1) / 6 + (N - K + 2);

    cout << ans % MOD << endl;
}

Measured memory_bytes: 3688
/*
                                                                           __                _________
                                                                          /  \              /  ______/
                                                                         /    \            /  /
                                                                        /  __  \          /  /
                                                                       /  /  \  \         |  |
                                                                      /  /____\  \        \  \
                                                                     /  ________  \        \  \______
                                                                    /__/        \__\        \________\
	
	I_love_Hacked;
	I_hate_pretest past;
	
    coder:xxjAc
    date:2018/3/4 
    
    I_love_Ac;
    I_hate_WA;
    I_hate_Tle;
    I_hate_RE;
    I_hate_CE;
    I_hate_Mle;
    
    I love Accepts very much;
*/
#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <queue>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>
using namespace std;
const int inf=1000000007;
int main(){
	int n;
	cin>>n;
	int k=n/3;
	cout<<k<<endl;
	return 0;
} 

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef vector<int> vi;
#define INF (1e9)

int main() {
  int N, K;
  cin >> N >> K;
  vi A(N);
  for (int i = 0; i < N; i++) {
    cin >> A[i];
  }

  while (K--) {
    vi B(N + 1);
    for (int i = 0; i < N; i++) {
      B[max(0, i - A[i])]++;
      B[min(N, i + A[i] + 1)]--;
    }
    int s = 0;
    bool f = true;
    for (int i = 0; i < N; i++) {
      s += B[i];
      A[i] = s;
      f &= s == N;
    }
    if (f) break;
  }

  for (int i = 0; i < N; i++) {
    cout << A[i] << ' ';
  }
  cout << endl;
}


Measured memory_bytes: 4856
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
#define rep(i,N) for(int i = 0; i < (N); i++)
#define erep(i,N) for(int i = N; i >= 0; i--)
const ll INF = 1000000000;
const ll mod = 1000000007;
#define PI 3.1415926535
using Graph = vector<vector<int>>;
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true;} return false;}
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true;} return false;}
typedef pair<int, int> pair;
bool seen[100000];
void dfs(const Graph &G, int v) {
    seen[v] = true; // v を訪問済にする
 
    // v から行ける各頂点 next_v について
    for (auto next_v : G[v]) { 
        if (seen[next_v]) continue; // next_v が探索済だったらスルー
        dfs(G, next_v); // 再帰的に探索
    }
}

//dpTable
int dp[100050];

int main(){
    ll X,K,D;
    cin >> X >> K >> D;
    if (X < 0) {
        ll a = (abs(X) + D - 1) / D;
        if (a > K) {
            cout << abs(X + D * K) << endl;
        }
        else {
            ll b = abs(X) % D;
            if (b == 0) b = D;
            if ((K - a) % 2 == 0) {
                cout << abs(D - b) << endl;
            }
            else cout << abs(b) << endl;
        }
    }
    if (X == 0) {
        if (K % 2 == 0) cout << 0 << endl;
        else cout << abs(D) << endl;
    }
    if (X > 0) {
        ll a = (abs(X) + D - 1) / D;
        if (a > K) {
            cout << abs(X - D * K) << endl;
        }
        else {
            ll b = abs(X) % D;
            if (b == 0) b = D;
            if ((K - a) % 2 == 0) {
                cout << abs(D - b) << endl;
            }
            else cout << abs(b) << endl;
        }
    }
    return 0;
}


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

using namespace std;

using ll = long long;
using ld = long double;

using vi = vector<int>;
using vvi = vector<vi>;
using vll = vector<ll>;
using vvll = vector<vll>;
using vb = vector<bool>;
using vs = vector<string>;

typedef pair<ll, ll> P;

#define bit(n) (1LL << (n))

//#define int long long

#define all(v) v.begin(), v.end()

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

#define FOR(i, a, b) for (ll i = (a); i < (b); i++)
#define FORm(i, m) for (auto i = m.begin(); i != m.end(); i++)

template <class T>
inline void chmax(T& a, T b) {
  a = std::max(a, b);
}
template <class T>
inline void chmin(T& a, T b) {
  a = std::min(a, b);
}

#define mod (ll)(1e9 + 7)
const long long INF = 1LL << 60;

// Warshall-Floyd
// O(V^3)
void warshall_floyd(ll V, vvll& cost) {
  for (int k = 0; k < V; k++) {
    for (int i = 0; i < V; i++) {
      for (int j = 0; j < V; j++) {
        cost[i][j] = min(cost[i][j], cost[i][k] + cost[k][j]);
      }
    }
  }
}

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

  ll n, m;
  cin >> n >> m;

  vll a(m), b(m), c(m);
  rep(i, m) {
    cin >> a[i] >> b[i] >> c[i];
  }

  // 最終的にiからjの最小コストはcost[i][j]となる。
  vvll cost = vvll(n + 1, vll(n + 1, INF));
  rep(i, n + 1) {
    // 自分自身へ移動するコストは0
    cost[i][i] = 0;
  }

  rep(i, m) {
    cost[a[i]][b[i]] = c[i];
    cost[b[i]][a[i]] = c[i];
  }

  warshall_floyd(n + 1, cost);

  ll ans = 0;

  rep(i, m) {
    if (cost[a[i]][b[i]] != c[i]) {
      ans++;
    }
  }

  cout << ans << endl;

  return 0;
}


Measured memory_bytes: 384
import sys
def main():
    N=int(sys.stdin.readline())
    p=[float(x) for x in sys.stdin.readline().split()]
    dp=[[0 for _ in range(N+1)] for _ in range(N+1)]
    dp[0][0]=1.0
    for i in range(1,N+1):
        dp[i][0]=dp[i-1][0]*(1-p[i-1])
        for j in range(1,i+1):dp[i][j]=dp[i-1][j-1]*p[i-1]+dp[i-1][j]*(1-p[i-1])
    print(sum(dp[N][N//2+1:]))
if __name__=='__main__':main()


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

#define pb push_back
#define mp make_pair
#define fs first
#define se second

typedef long long LL;

int x,a,b;

int main() {
  //  freopen("test.txt","r",stdin);
    cin >> x >> a >> b;
    int now  = a - b;
    if ( now < 0 && abs(now) >= x + 1) {
        cout << "dangerous";
        return 0;
    }
    if ( now >=0 && now <= x) {
        cout << "delicious";
        return 0;
    }
    cout << "safe";
}



Measured memory_bytes: 256
use std::io;
use std::f64::consts::PI;

fn input() -> f64 {
    let mut s = String::new();
    io::stdin().read_line(&mut s).expect("");
    s.trim().parse().unwrap()
}

fn main() {
    let r = input();
    println!("{} {}", PI*r*r, 2.0*PI*r);
}



Measured memory_bytes: 5056
from math import floor,ceil,sqrt
import fractions
import collections
import itertools
from collections import deque
X=int(input())
"""
l=[]
for i in range(1,ceil(sqrt(X))+1):
    if X%i==0:
        l.append(i)
        l.append(X//i)
l=list(set(l))
l2=l
for i in range(len(l)):
    l2.append(-l[i])
#print(l2)
l2.sort()
if len(l)!=0:
    for i in l2:
        x=X//i
        #print(i,x)
        n=(x-pow(i,4))/(pow(i,2)+1)
        #print(n)
        if (5*pow(i,4)+20*x)>=0:
            if sqrt((5*pow(i,4)+20*x)).is_integer()==True:
                #print(x,i)
                m=int(sqrt((5*pow(i,4)+20*x)))
                if (-5*i*i+m)%10==0:
                    y=(-5*i*i+m)//10
                    #print(i,y)
                    if pow(i,2)+4*y>=0:
                        if sqrt(pow(i,2)+4*y).is_integer()==True:
                            z=int(sqrt(pow(i,2)+4*y))
                            if (-i+z)%2==0:
                                b=(-i+z)//2
                                a=i+b
                                print(a,b)
                                break
                            elif (-i - z) % 2 == 0:
                                b = (-i - z) // 2
                                a = i + b
                                print(a, b)
                                break
                elif (-5*i*i-m)%10==0:
                    y=(-5*i*i+m)//10
                    #print(i,y)
                    if pow(i,2)+4*y>=0:
                        if sqrt(pow(i,2)+4*y).is_integer()==True:
                            z=int(sqrt(pow(i,2)+4*y))
                            if (-i+z)%2==0:
                                b=(-i+z)//2
                                a=i+b
                                print(a,b)
                                break
                            elif (-i - z) % 2 == 0:
                                b = (-i - z) // 2
                                a = i + b
                                print(a, b)
                                break
"""
flag=0
#こんなことしなくても全探査で通る!
#A>0にて
#A=iの時A^5-B^5の最小は
#i^5-(i-1)^5
#i^5-(i-1)^5が10^9を超えていれば、その範囲の中で全探査すれば、必ず入力の解を持つものに出会えるはず(このiをmaxとする)
#A<=0にて
#A=iの時、A^5ーB^5の最小は
#i^5-(i+1)^5
#i^5-(i+1)^5が10^9を超えていれば、その範囲の中で全探査すれば、必ず入力の解を持つものに出会えるはず(このiをminとする)
i=0
while pow(i+1,5)-pow(i,5)<10**9:        #A>0にて、pow(i+1,5)-pow(i,5)が10^9を超える点を探す
    #print(pow(i+1,5)-pow(i,5))
    i=i+1
ma=i
#print(ma)
i=0
#input()
while pow(i,5)-pow(i-1,5)<10**9:        #A<=0にて、pow(i,5)-pow(i-1,5)が10^9を超える点を探す
    #print(pow(i, 5) - pow(i-1, 5))
    i=i-1
mi=i
#print(ma,mi)
for i in range(mi-2,ma+2):          #余裕を持って、mi-2からma+2の間を
    for j in range(mi-2,ma+2):      #全探査すれば余裕で通るはず
        if pow(i,5)-pow(j,5)==X:
            print(i,j)
            flag=1
            break
    if flag==1:
        break










Measured memory_bytes: 73152
#include <bits/stdc++.h>
typedef long long ll;
typedef long double ld;
using namespace std;
#define F first
#define S second
#define pb push_back
#define all(x) (x).begin(), (x).end()
#define SZ(x) (int)(x).size()
//#define int ll

const int N = 2e5 + 10;
vector<int> g[N];
int h[N], ans[N];

void dfs(int v, int par) {
  h[v] = h[par] ^ 1;
  for (auto u : g[v]) {
    if (u != par) {
      dfs(u, v);
    }
  }
}

signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n;
  cin >> n;
  for (int i = 1; i < n; i++) {
    int a, b;
    cin >> a >> b;
    g[a].pb(b);
    g[b].pb(a);
  }
  dfs(1, 0);
  vector<int> cnt(2);
  for (int i = 1; i <= n; i++) {
    ans[i] = h[i] + 1;
    cnt[h[i]]++;
  }
  vector<int> have(2);
  have[0] = (n + 2) / 3;
  have[1] = (n + 1) / 3;
  vector<int> cur(4);
  iota(all(cur), 0);
  if (cnt[0] < have[0] || cnt[1] < have[1]) {
    swap(cnt[0], cnt[1]);
    for (int i = 1; i <= n; i++) {
      h[i] ^= 1;
      ans[i] = h[i] + 1;
    }
    if (cnt[0] < have[0] || cnt[1] < have[1]) {
      assert(cnt[0] >= have[0] || cnt[1] >= have[1]);
      bool kek = (cnt[1] < have[1]);
      for (int i = 1; i <= n; i++) {
        if (kek) {
          h[i] ^= 1;
        }
        if (!h[i]) {
          cout << cur[3] << ' ';
          cur[3] += 3;
        }
        else {
          if (have[0] > 0) {
            cout << cur[1] << ' ';
            cur[1] += 3;
            have[0]--;
          }
          else if (have[1] > 0) {
            cout << cur[2] << ' ';
            cur[2] += 3;
            have[1]--;
          }
          else {
            cout << cur[3] << ' ';
            cur[3] += 3;
          }
        }
      }
      assert(have[0] == 0);
      assert(have[1] == 0);
      cout << '\n';
      exit(0);
    }
  }
  for (int i = 1; i <= n; i++) {
    if (cnt[h[i]] > have[h[i]]) {
      ans[i] = 3;
      cnt[h[i]]--;
    }
  }
  assert(cnt[0] == have[0]);
  assert(cnt[1] == have[1]);
  for (int i = 1; i <= n; i++) {
    cout << cur[ans[i]] << ' ';
    cur[ans[i]] += 3;
  }
  cout << '\n';
} 

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

int n;
long long m;
vector < long long > a;
vector < long long > pref;

long long f (int x) {
	long long geq = 0;
	for (int i = 0; i < n; ++i) {
		int j = lower_bound(a.begin(), a.end(), x - a[i]) - a.begin();
		geq += n - j;
	}
	return geq;
}

long long ans (int x) {
	long long geq = 0;
	for (int i = 0; i < n; ++i) {
		int j = lower_bound(a.begin(), a.end(), x - a[i]) - a.begin();
		geq += (pref[n] - pref[j]) + a[i] * ((long long)n - (long long)j);
	}
	return geq;
}

signed main () {
	cin >> n >> m;
	a.assign(n, 0);
	pref.assign(n + 1, 0);
	for (int i = 0; i < n; ++i) 
		cin >> a[i];
	sort(a.begin(), a.end());
	for (int i = 0; i < n; ++i)
		pref[i + 1] = pref[i] + a[i];
	int left = 1, right = 2e5, best; 
	while (right - left > 1) {
		int mid = (left + right) >> 1;
		if (f(mid) >= m)
			left = mid;
		else
			right = mid;
	}
	if (f(right) >= m)
		best = right;
	else
		best = left;
	left = 1, right = 2e5;
	int adding;
	while (right - left > 1) {
		int mid = (left + right) >> 1;
		if (f(best + mid) < f(best))
			right = mid;
		else
			left = mid;
	}
	if (f(best + left) < f(best))
		adding = left;
	else
		adding = right;
	long long f1 = f(best), f2 = f(best + adding);
	long long ans1 = ans(best), ans2 = ans(best + adding);
	long long answer = ans2 + ((m - f2) * ((ans1 - ans2) / (f1 - f2)));
	cout << answer << '\n';
}


Measured memory_bytes: 1792
#include <iostream>
#include <algorithm>
#include <vector>
#include <queue>
#include <set>
#include <cmath>
#include <string>
#include <fstream>
#define FOR(i,a,b) for(int i=a;i<b;i++)
#define ROF(i,a,b) for(int i=b-1;i>=a;i--)
#define FI first
#define SE second
#define VE vector<int>
#define PB push_back
#define LL long long
#define YES(i) cout<<(i?"YES":"NO")<<endl
#define Yes(i) cout<<(i?"Yes":"No")<<endl
using namespace std;
//
const int INF=1e9+7;
const int MOD=1e9+7;
//
int N;
int A[100];
int C[100];
int main(){
  cin>>N;
  int M=0,m=INF;
  FOR(i,0,N){
    cin>>A[i];
    M=max(M,A[i]);
    m=min(m,A[i]);
    C[A[i]]++;
  }
  if((M+1)/2!=m){
    cout<<"Impossible"<<endl;
  }else{
    if(M%2==1){
      if(C[m]!=2){
        cout<<"Impossible"<<endl;
        return 0;        
      }
      FOR(i,m+1,M+1){
        if(C[i]<2){
          cout<<"Impossible"<<endl;
          return 0;
        }
      }
    }else{
      if(C[m]!=1){
        cout<<"Impossible"<<endl;
        return 0;
      }
      FOR(i,m+1,M+1){
        if(C[i]<2){
          cout<<"Impossible"<<endl;
          return 0;
        }
      }
    }
    cout<<"Possible"<<endl;
  }
  return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define repI(i, d, n) for (int i = (d); i < (n); ++i)
#define reps1(i, n) for (int i = 1; i < (n); ++i)
using namespace std;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }

using ll = long long;
using P = pair<int, int>;
using Pl = pair<ll, ll>;
using M = map<int, int>;
ll const INF = 1ll<<61;
double pi = 3.141592653589793238;

void calc(int x) {
  repI(i, -200, 200) {
    repI(j, -200, 200) {
      if (pow(i, 5) - pow(j, 5) == x) {
        cout << i << " " << j << endl;
        return;
      }
    }
  }
  return;
}

int main() {
  ll x;
  cin >> x;
  calc(x);

  return 0;
}


Measured memory_bytes: 4092
#include<bits/stdc++.h>
#define fast ios::sync_with_stdio(false), cin.tie(0);
#define ll long long
#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define endl '\n'

using namespace std;

main()
{
    fast;
    int n,i;
    ll x,y;
    cin>>n>>x;
    ll ans=0;
    for (i=0;i<n;i++)
    {
        cin>>y;
        ans=__gcd(ans,abs(x-y));
    }
    cout<<ans<<endl;
}

Measured memory_bytes: 256
import java.util.*;

public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        long n = sc.nextLong();
        long k = sc.nextLong();
        long pattern = k;
        for(int i = 0; i < n-1; i++){
            pattern = pattern * (k-1);
        }
        System.out.print(pattern);
    }
}

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

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

use std::cmp::min;
use std::collections::HashSet;

fn main() {
    let s: Vec<char> = read::<String>().chars().collect();
    let k: usize = read();
    let mut set: HashSet<String> = HashSet::new();

    for i in 0..s.len() {
        let mut buffer = String::from(s[i].to_string());
        set.insert(buffer.to_string());
        for j in i + 1..min(s.len(), i + k) {
            buffer += &s[j].to_string();
            set.insert(buffer.to_string());
        }
    }

    let mut uniq: Vec<String> = set.into_iter().collect();
    uniq.sort();
    println!("{}", uniq[k - 1]);
}


Measured memory_bytes: 6396
let m = 1039999

let split_on_char sep s =
  let open String in
  let r = ref [] in
  let j = ref (length s) in
  for i = length s - 1 downto 0 do
    if get s i = sep then begin
      r := sub s (i + 1) (!j - i - 1) :: !r;
      j := i
    end
  done;
  sub s 0 !j :: !r

let to_x = Array.make 128 0

let to_key s =
  let n = String.length s in
  let rec doit i p acc =
    if i = n then acc
    else doit (i + 1) (5*p) (acc + p*(to_x.(Char.code s.[i]))) in
  doit 0 1 0

let to_h1 k = k mod m
let to_h2 k = 1 + (k mod (m - 1))

let insert s t =
  let k = to_key s in
  let h1 = to_h1 k in
  let h2 = to_h2 k in
  let rec doit i =
    let h = (h1 + h2*i) mod m in
    if t.(h) = s then ()
    else if t.(h) = "\000" then t.(h) <- s
    else doit (i + 1) in
  doit 0

let find s t =
  let k = to_key s in
  let h1 = to_h1 k in
  let h2 = to_h2 k in
  let rec doit i =
    let h = (h1 + h2*i) mod m in
    if t.(h) = s then true
    else if t.(h) = "\000" then false
    else doit (i + 1) in
  doit 0

let () =
  to_x.(Char.code 'A') <- 1;
  to_x.(Char.code 'C') <- 2;
  to_x.(Char.code 'G') <- 3;
  to_x.(Char.code 'T') <- 4;
  let n = read_int () in
  let t = Array.make m "\000" in
  for _ = 0 to n - 1 do
    match split_on_char ' ' (read_line ()) with
    | ["insert"; s] -> insert s t
    | ["find"; s] -> print_endline (if find s t then "yes" else "no")
    | _ -> ()
  done

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

typedef long l;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<int, string> pis;
typedef pair<long, long> pll;

#define EACH(t, c) for (auto&& t : c)
#define ALL(c) begin(c), end(c)
#define FOR(i, s, e) for (int i = (s); i < (int)(e); ++i)
#define REP(i, n) FOR(i, 0, n)
#define endl '\n'
#define F first
#define S second
#define pb push_back
#define mp make_pair

const int DX[] = {1, 0, -1, 0, 1, 1, -1, -1}, DY[] = {0, 1, 0, -1, 1, -1, 1, -1};
const int MOD = (int)1e9 + 7;
const int INF = 999999999;

int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int n;
  string str;

  cin >> n >> str;

  int res = 0;

  REP(i, n) {
    bool count1[30], count2[30];
    REP(j, 30) {
      count1[j] = count2[j] = false;
    }
    REP(j, i) {
      count1[str[j] - 'a'] = true;
    }

    FOR(j, i, n) {
      count2[str[j] - 'a'] = true;
    }

    int tmp = 0;
    REP(j, 30) {
      if (count1[j] && count2[j]) {
        tmp++;
      }
    }

    res = max(tmp, res);
  }

  cout << res << endl;
}



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

#define for_(i,a,b) for(int i=(a);i<(b);++i)
#define size_of(a) (int)(a).size()

class Alphabet {
public:
	static const int N = 4;
	
	int toInt(char c) {
		if (c == 'A') return 0;
		if (c == 'C') return 1;
		if (c == 'G') return 2;
		if (c == 'T') return 3;
		return -1;
	}
};

class Trie {
private:
	struct Node {
		vector< int > link;
		bool end;
		Node(int n) : link(n, -1),  end(false) {}
	};
	
	Alphabet& alph;
	vector< Node > node;
	
public:
	Trie(Alphabet& alph_) : alph(alph_) {
		node.push_back(Node(alph.N));
	}
	
	void insert(string& str) {
		insert(str, 0, 0);
	}
	
	void insert(string& str, int i, int vi) {
		if (i == size_of(str)) {
			node[vi].end = true;
			return;
		}
		
		int ci = alph.toInt(str[i]);
		
		if (node[vi].link[ci] != -1) {
			insert(str, i + 1, node[vi].link[ci]);
		} else {
			node.push_back(Node(alph.N));
			node[vi].link[ci] = size_of(node) - 1;
			insert(str, i + 1, node[vi].link[ci]);
		}
	}
	
	bool find(string& str) {
		return find(str, 0, 0);
	}
	
	bool find(string& str, int i, int vi) {
		if (i == size_of(str)) return node[vi].end;
		
		int ci = alph.toInt(str[i]);
		
		if (node[vi].link[ci] == -1) return false;
		return find(str, i + 1, node[vi].link[ci]);
	}
};

int main() {
	Alphabet alph;
	Trie trie(alph);
	
	int n;
	cin >> n;
	
	for_(i,0,n) {
		string op, str;
		cin >> op >> str;
		
		if (op == "insert") {
			trie.insert(str);
		} else {
			if (trie.find(str)) cout << "yes" << endl;
			else cout << "no" << endl;
		}
	}
}

Measured memory_bytes: 35284
X, N = gets.chomp.split.map(&:to_i)
if N.zero?
  puts X
  return 
end
ps = gets.chomp.split.map(&:to_i)

0.step do |i|
  unless ps.include?(X - i)
    puts X - i
    break
  end

  unless ps.include?(X + i)
    puts X + i
    break
  end

end

Measured memory_bytes: 14272
#include <iostream>
#include <vector>
#include <algorithm>
#define repeat(i,n) for (int i = 0; (i) < (n); ++(i))
#define whole(f,x,...) ([&](decltype((x)) y) { return (f)(begin(y), end(y), ## __VA_ARGS__); })(x)
using namespace std;
template <typename F>
void xorshift64(int n, uint64_t x, F f) {
    repeat (i,n) {
        f(x);
        x ^= x << 13;
        x ^= x >> 7;
        x ^= x << 17;
    }
}
int main() {
    int n, k, x0; cin >> n >> k >> x0; -- k;
    if (x0 == 0) {
        cout << 0 << endl;
        return 0;
    }
    vector<int> cnt(256);
    xorshift64(n, x0, [&](uint64_t x) {
        cnt[int8_t(x >> 56) + 128] += 1;
    });
    int acc = 0;
    int j = 0;
    for (; acc + cnt[j] <= k; ++ j) {
        acc += cnt[j];
    }
    vector<uint64_t> a;
    xorshift64(n, x0, [&](uint64_t x) {
        if (int8_t(x >> 56) + 128 == j) a.push_back(x);
    });
    whole(sort, a);
    cout << int64_t(a[k - acc]) << endl;
    return 0;
}

Measured memory_bytes: 7096
if isfile("mystdin.txt");mystdin=open("mystdin.txt","r");redirect_stdin(mystdin);end
pI(x)=parse(Int,x)
pM(x::Array{SubString{String},1})=map(pI,x)
function main()
  ans::BigInt=1
  n=pI(readline())
  l=pM(split(readline()))
  if 0 in l
    print(0)
    return 0
  end
  for i in l
    ans*=i
    if ans>10^18
      print(-1)
      return 0
    end
  end
  println(ans)
end
main()
if isdefined(Base, :mystdin);close(mystdin);end


Measured memory_bytes: 188660
local mfl = math.floor
local alltask = {}
local stagetask = {}
local a = {}
local tot = 1
local function bdp_prepare(n)
  for i = 1, n do
    tot = tot * 2
    stagetask[i] = {}
  end
  local a0 = io.read("*n")
  for i = 1, tot - 1 do
    a[i] = io.read("*n")
    if a[i] < a0 then
      alltask[i] = {tot, i}
    else
      alltask[i] = {i, tot}
    end
  end
  a[tot] = a0
  a[tot + 1] = 0
  for i = 1, tot - 1 do
    local ti = i
    local cnt = 0
    for j = 1, n do
      if ti % 2 == 1 then
        cnt = cnt + 1
        ti = ti - 1
      end
      ti = mfl(ti / 2)
    end
    table.insert(stagetask[cnt], i)
  end
end

local function bdp_walk(src, dst)
  local l1 = alltask[dst][1]
  local l2 = alltask[dst][2]
  local r1 = alltask[src][1]
  local r2 = alltask[src][2]
  if l1 == r1 or l2 == r1 then r1 = tot + 1 end
  if l1 == r2 or l2 == r2 then r2 = tot + 1 end
  if a[l1] < a[r1] then
    alltask[dst][1] = r1
    if a[l1] < a[r2] then
      alltask[dst][2] = r2
    else
      alltask[dst][2] = l1
    end
  else
    alltask[dst][1] = l1
    if a[l2] < a[r1] then
      alltask[dst][2] = r1
    else
      alltask[dst][2] = l2
    end
  end
end
local function bdp_doall(n)
  for stage = 1, n - 1 do
    local stlen = #stagetask[stage]
    for i_stagetask = 1, stlen do
      local used = stagetask[stage][i_stagetask]
      local mul = 1
      local tmp = used
      for j = 1, n do
        if tmp % 2 == 0 then
          bdp_walk(used, used + mul)
        else
          tmp = tmp - 1
        end
        tmp = mfl(tmp / 2)
        mul = mul * 2
      end
    end
  end
end

local n = io.read("*n")
bdp_prepare(n)
bdp_doall(n)
local prv = 0
for i = 1, tot - 1 do
  local cur = a[alltask[i][1]] + a[alltask[i][2]]
  if cur < prv then cur = prv end
  print(cur)
  prv = cur
end


Measured memory_bytes: 29024
#include "iostream"
#include "algorithm"
#include "cstring"
#include "cstdio"
#include "cmath"
#include "vector"
#include "map"
#include "set"
#include "queue"
using namespace std;
#define MAXN 200006
//#define int long long
#define rep(i, a, b) for (int i = (a), i##end = (b); i <= i##end; ++i)
#define per(i, a, b) for (int i = (a), i##end = (b); i >= i##end; --i)
#define pii pair<int,int>
#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define eb emplace_back
#define vi vector<int>
#define all(x) (x).begin() , (x).end()
#define mem( a ) memset( a , 0 , sizeof a )
typedef long long ll;
int n , m;
int a , b , c; 
int A[MAXN];

void solve() {
	cin >> a >> b;
	cout << a * b << endl; 
}

signed main() {
//    int T;cin >> T;while( T-- ) solve();
    solve();
}



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


void solve(long long N, std::vector<long long> A){
    long long ans = 0;
    long long b =0;
    for(int i=1;i<N;i++){
        long long c =max(A[i-1]-A[i],b);
        ans +=c;
        A[i]+= c;
    }
    cout<<ans<<endl;
}

// Generated by 1.1.7.1 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
int main(){
    long long N;
    scanf("%lld",&N);
    std::vector<long long> A(N);
    for(int i = 0 ; i < N ; i++){
        scanf("%lld",&A[i]);
    }
    solve(N, std::move(A));
    return 0;
}


Measured memory_bytes: 4812
#include <iostream>
#include <map>

using namespace std;


int main () {
  int n, i;
  int *num;
  long long  ret = 0;
  map<long long, long long> mp;
	
  cin >> n;
  
  num = (int*)calloc(n, sizeof(int));
  
  for ( i = 0; i< n; i++ ) {
    cin >> num[i];
    mp[num[i]] += 1;
  }
  
  /* コンビネーション算出 */
  for (auto itr = mp.begin(); itr != mp.end(); ++itr ) {
    ret += itr->second * (itr->second - 1) / 2;
  }

  /* n回繰り返す */
  for ( i = 0; i < n; i++ ) {
  	cout << ret - (mp[num[i]] - 1) << "\n" << endl;
  }
  
	return 0;
}

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

using E = System.Linq.Enumerable;

public class Program
{
    public static void Main()
    {
        var n = long.Parse(Console.ReadLine());

        var sum = 0L;
        for (int k = 1; k <= n; ++k)
        {
            var t = n / k;
            var s = t * (t + 1) / 2;
            sum += k * s;
        }

        Console.WriteLine(sum);
    }
}


Measured memory_bytes: 27308
#include <iostream>
#include <cstdlib>
#include <cstdio>
#include <cmath>
#include<ctime>
#include<random>
#include<cstring>
#include<cstdlib>
#include<cstdint>
#include<iomanip>
#include<fstream>
#include<strstream>
#include<vector>
#include<list>
#include<map>
#include<set>
#include<utility>
#include<functional>
#include<string>
#include<sstream>



#define ll long long
#define US unsigned
#define UINT unsigned int
#define repeat for(int c=0; c<n; c++) 
#define e18 1000000000000000000
#define e9  1000000000


using namespace std;
std::random_device rnd;

int main() {



		string name;
		string ans;
		cin >> name;
		for (int c = 0; c < 3; c++) {
			ans += name[c];
		}

		cout << ans;

	return 0;
}

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

int main(){
  int n,m;
  cin >> n >> m;
  int a[n],b[m],c[m];
  map<int,int> d;
  for(int i=0;i<n;i++){
    cin >> a[i];
    d[(-1)*a[i]]++;
  }
  for(int i=0;i<m;i++){
    cin >> b[i] >> c[i];
    d[(-1)*c[i]] += b[i];
  }
  long long sum=0,cnt=0;
  for(auto i:d){
    long long e = i.second;
    if(cnt+e>n) e = n-cnt;
    sum += e*i.first*(-1);
    cnt += e;
  }
  cout << sum << endl;
}


Measured memory_bytes: 10752
#include<bits/stdc++.h>
using namespace std;
#define ll        long long
#define  sci(x)   scanf("%d", &x)
#define  scl(x)   scanf("%lld", &x)
#define  scd(x)   scanf("%lf", &x)
#define l0(i,n)   for(ll i=0; i<n; i++)

int main ()
{
	ios::sync_with_stdio(0);
	cin.tie(0);
	//CODE TONOY
	int n,d;
	cin >> n >> d;
	cout << (n + d * 2) / (d * 2 + 1) << endl;

	return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<algorithm>
#include<map>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;
ll inf = 1000000007;
ll a[100005];
int main() {
	int n;
	cin >> n;
	for (int i = 0; i < n; i++) {
		cin >> a[i];
	}
	map<int, int>mp;
	for (int i = 0; i < n; i++) {
		mp[a[i]]++;
	}

	int ans = 0;
	for (auto id : mp) {
		int x = id.first;
		int n = id.second;
		
		if (n < x)ans += n;
		else ans += n - x;
	}
	cout << ans << endl;
	return 0;
}

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

int main(){
	int n, k, x, y;
	cin >> n >> k >> x >> y;
	int ans=0;
	if(n<k)	ans=n*x;
	if(n>=k) ans=k*x+(n-k)*y;
	cout << ans << endl;
}


Measured memory_bytes: 3600
while true
  n = gets.to_i
  if n == 0
    break
  end

  i = 0
  h = Array.new(n)
  while i < n
    h[i] =gets.chomp.split(" ")
    i += 1
  end

  m = gets.to_i
  i = 0
  out = ""

  while i < m
    x  = gets.chomp
    j = 0
    while j < n
      if x == h[j][0]
        x = h[j][1]
        break
       end
      j += 1
    end
    out += x
    i+= 1
  end

  puts out
end

Measured memory_bytes: 14128
#include <iostream>
#include <cstdio>
#include <string>

using namespace std;

string s;

int main(void)
{
	int i;
	
	cin >> s;
	
	for (i = 0; i < s.size(); i += 2)
	{
		printf("%c", s[i]);
	}
	printf("\n");
	
	return 0;
}

Measured memory_bytes: 512
import java.util.Arrays; 
import java.util.LinkedList;
import java.util.PriorityQueue;
import java.util.Scanner;

public class Main {
	
	public static final int MAX = 3;
	public static final int SIZE = MAX * MAX;
	
	public static int[][] move_dir = new int[][]{{1, 0}, {0, 1}, {-1, 0}, {0, -1}};
	public static int[] use = new int[]{0, 1, 2, 3};
	public static int[] ref = new int[]{2, 3, 0, 1};
	
	public static boolean is_sat(int x, int y, char[] piece, char[][][] press){
		for(int dir = 0; dir < move_dir.length; dir++){
			final int nx = x + move_dir[dir][0];
			final int ny = y + move_dir[dir][1];
			
			if(!is_ok(nx, ny)){
				continue;
			}else if(press[ny][nx][0] == '?'){
				continue;
			}
			
			if((piece[use[dir]] ^ press[ny][nx][ref[dir]]) != ('a' ^ 'A')){
				//System.out.println(piece[use[dir]] + " " + press[ny][nx][ref[dir]]);
				return false;
			}
		}
		
		return true;
	}
	
	public static boolean is_ok(int x, int y){
		if(x < 0 || y < 0 || x >= MAX || y >= MAX){
			return false;
		}else{
			return true;
		}
	}
	
	public static final int dfs(final int x, final int y, boolean[] using, char[][] pieces, char[][][] press){
		final int next_x = x == MAX - 1 ? 0 : x + 1;
		final int next_y = x == MAX - 1 ? y + 1 : y;
		
		if(y == MAX && x == 0){
			/*
			for(int i = 0; i < MAX; i++){
				for(int j = 0; j < MAX; j++){
					System.out.println(Arrays.toString(press[i][j]));
				}
			}
			System.out.println();
			*/
			return 1;
		}
		
		//System.out.println(x + " " + y);
		
		int sum = 0;
		
		for(int use_piece = 0; use_piece < SIZE; use_piece++){
			if(using[use_piece]){
				continue;
			}
			using[use_piece] = true;
			
			for(int rotate = 0; rotate < 4; rotate++){
				//System.out.println(Arrays.toString(pieces[use_piece]));
				char tmp = pieces[use_piece][0];
				for(int i = 0; i < 3; i++){
					pieces[use_piece][i] = pieces[use_piece][i + 1];
				}
				pieces[use_piece][3] = tmp;
				//System.out.println("rotate :" + Arrays.toString(pieces[use_piece]));
				
				if(is_sat(x, y, pieces[use_piece], press)){
					for(int i = 0; i < 4; i++){
						press[y][x][i] = pieces[use_piece][i];
					}
					
					sum += dfs(next_x, next_y, using, pieces, press);
					
					for(int i = 0; i < 4; i++){
						press[y][x][i] = '?';
					}
				}
			}
			
			using[use_piece] = false;
		}
		
		return sum;
	}
	
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		
		final int T = sc.nextInt();
		
		char[][] pieces = new char[SIZE][4];
		char[][][] press  = new char[MAX][MAX][4];
		boolean[] using = new boolean[SIZE];
		
		for(int tt = 0; tt < T; tt++){
			for(int i = 0; i < SIZE; i++){
				pieces[i] = sc.next().toCharArray();
			}
			
			for(int i = 0; i < MAX; i++){
				for(int j = 0; j < MAX; j++){
					Arrays.fill(press[i][j], '?');
				}
			}
			Arrays.fill(using, false);
			
			System.out.println(dfs(0, 0, using, pieces, press));
		}
		
		sc.close();
	}
}

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

const string YES = "Yes";
const string NO = "No";

void solve(long long N, std::vector<long long> t, std::vector<long long> x, std::vector<long long> y){
    t.insert(t.begin(), 0);
    x.insert(x.begin(), 0);
    y.insert(y.begin(), 0);

    for(int i=1; i<=N; i++){
        auto dt = t[i]-t[i-1];
        auto dxy = abs(x[i]-x[i-1])+abs(y[i]-y[i-1]);
        if(dt < dxy || (dt-dxy)%2==1){
            cout << NO << endl;
            return;
        }
    }
    cout << YES << endl;
}

int main(){
    long long N;
    scanf("%lld",&N);
    std::vector<long long> t(N);
    std::vector<long long> x(N);
    std::vector<long long> y(N);
    for(int i = 0 ; i < N ; i++){
        scanf("%lld",&t[i]);
        scanf("%lld",&x[i]);
        scanf("%lld",&y[i]);
    }
    solve(N, std::move(t), std::move(x), std::move(y));
    return 0;
}


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

long long x, total = 0;

int main()
{
    ios_base::sync_with_stdio(false);
    cin >> x;
    total += (x - x % 500) / 500;
    total *= 1000;
    x = x % 500;
    total += x - x % 5;
    cout << total;
}

Measured memory_bytes: 256
dat = input().split(' ')
a = int(dat[0])
b_top = int(dat[-1].split('.')[0])
b_bot = int(dat[-1].split('.')[1])
b = b_top*100 + b_bot

ans = a * b
if ans < 100:
    print(0)
else:
    print(str(ans)[:-2])

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

int main(){
    string S,T;
    long long count = 0;
    long long min = 2000;

    cin >> S;
    cin >> T;

    for(int i=0;i<S.size()-T.size()+1;i++){
        for(int j=0;j<T.size();j++){
            if(S[i+j] != T[j]){
                count++;
            }
        }
        if(min > count){
            min = count;
        }
        count = 0;
    }
    cout << min << endl;

    return 0;
}

Measured memory_bytes: 3628