akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;
#define all(v) v.begin(), v.end()
#define repi(i,n) for(int i=0;i<(int)(n);i++)
#define repd(i,n) for(int i=(int)(n);i>=0;i--)
#define repm(i,m) for(auto i=m.begin();i!=m.end();i++)

int main()
{
    int N;
    string S;
    cin >> N >> S;
    if(N%2 == 0){
        repi(i,N/2){
            if(S.at(i) != S.at(N/2 + i)){
                cout << "No" << endl;
                return 0;
            }
        }
        cout << "Yes" << endl;
    }else{
        cout << "No" << endl;
    }
    return 0;
}

Measured memory_bytes: 256
#a
x = int(input())
if x<600:
    print(8)
elif(x<800):
    print(7)
elif(x<1000):
    print(6)
elif(x<1200):
    print(5)
elif(x<1400):
    print(4)
elif(x<1600):
    print(3)
elif(x<1800):
    print(2)
elif(x<2000):
    print(1)

Measured memory_bytes: 9116
#include<bits/stdc++.h>
using namespace std;
const int MAXN = 3e5 + 5;
const int MAXP = 1e6 + 5;
typedef long long ll;
template <typename T> void chkmax(T &x, T y) {x = max(x, y); }
template <typename T> void chkmin(T &x, T y) {x = min(x, y); } 
template <typename T> void read(T &x) {
	x = 0; int f = 1;
	char c = getchar();
	for (; !isdigit(c); c = getchar()) if (c == '-') f = -f;
	for (; isdigit(c); c = getchar()) x = x * 10 + c - '0';
	x *= f;
}
int n, m, q, P, f[MAXN];
int tot, point[MAXN][2][3];
int x[MAXN], y[MAXN], w[MAXN];
int find(int x) {
	if (f[x] == x) return x;
	else return f[x] = find(f[x]);
}
void merge(int x, int y) {
	f[find(x)] = find(y);
}
bool same(int x, int y) {
	return find(x) == find(y);
}
bool vis[2][MAXP];
int main() {
	read(n), read(m), read(q), read(P); int g = P;
	for (int i = 1; i <= m; i++) {
		read(x[i]), read(y[i]), read(w[i]);
		g = __gcd(g, abs(w[i] - w[1]));
	}
	P = __gcd(3 * g, P);
	for (int i = 1; i <= n; i++)
	for (int p = 0; p <= 1; p++)
	for (int q = 0; q <= 2; q++) {
		point[i][p][q] = ++tot;
		f[tot] = tot;
	}
	int z = w[1] % g;
	for (int x = z, i = 0; i <= P; i++, x = 2 * x % P)
		vis[i & 1][x] = true;
	for (int i = 1; i <= m; i++) {
		int tx = x[i], ty = y[i];
		int tw = (w[i] - z) % P / g;
		for (int p = 0; p <= 1; p++)
		for (int q = 0; q <= 2; q++)
			merge(point[tx][p][q], point[ty][p ^ 1][(2 * q + tw) % 3]);
	}
	for (int i = 1; i <= q; i++) {
		bool res = false;
		int s, t, r; read(s), read(t), read(r);
		for (int p = 0; p <= 1; p++)
		for (int q = 0; q <= 2; q++)
			res |= same(point[t][0][0], point[s][p][q]) && vis[p][(r + z + (3 - q) * g) % P];
		if (res) puts("YES");
		else puts("NO");
	}
	return 0;
}

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

#ifdef LOCAL
#define debug(var) cerr << (#var) << " = " << (var) << endl;
#else
#define debug(var)
#endif

void init() {
  ios_base::sync_with_stdio(0);
  cin.tie(0); cout.tie(0);
}

void solve() {
  int x, y, z; scanf("%d%d%d", &x, &y, &z);
  printf("%d %d %d", z, x, y);
}

int main() {
  init();
  int t = 1; //scanf("%d", &t);
  while (t--) {
    solve();
  }
  return 0;
}


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

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

  ll MOD = 1e9 + 7;
  int s = L.size();
  vector<ll> lt(s, 0), eq(s, 0);

  lt[0] = 1;
  eq[0] = 2;
  for (int i = 1; i < s; i++) {
    if (L[i] == '1') {
      lt[i] = 3 * lt[i - 1] + 1 * eq[i - 1];
      eq[i] = 0 * lt[i - 1] + 2 * eq[i - 1];
    } else {
      lt[i] = 3 * lt[i - 1] + 0 * eq[i - 1];
      eq[i] = 0 * lt[i - 1] + 1 * eq[i - 1];
    }
    lt[i] %= MOD;
    eq[i] %= MOD;
  }

  ll ans = lt[s - 1] + eq[s - 1];
  ans %= MOD;
  cout << ans;

  return 0;
}

Measured memory_bytes: 2048
#include<iostream>
#include<string>
#include<cstdio>
#include<algorithm>
#include <stdio.h>
#include<iostream>
#include<iomanip>
#include<cmath>
#include<array>
#include<vector>
#include<set>
#include <utility>
#include <map>
#include<queue>
using namespace std;



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

  int v[1100];
  for(int i=0;i<n;i++)
  cin>>v[i];

  sort(v,v+n);
  double ans=v[0];
  for(int i=1;i<n;i++)
  ans=(ans+v[i])/2.0;

  cout<<ans<<endl;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define rrep(i,n) for (int i = (n)-1; i >= 0; i--)
#define rep2(i,s,n) for (int i = (s); i < (n); ++i)
#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define pb push_back
#define eb emplace_back
#define vi vector<int>
#define vvi vector<vector<int>>
#define vl vector<ll>
#define vvl vector<vector<ll>>
#define vd vector<double>
#define vs vector<string>
#define vc vector<char>
#define vb vector<bool>
#define vp vector<P>
using namespace std;
using ll = long long;
using P = pair<int,int>;
using LP = pair<ll,ll>;
template<class S,class T> istream& operator>>(istream &is,pair<S,T> &p) { return is >> p.first >> p.second; }
template<class S,class T> ostream& operator<<(ostream &os,const pair<S,T> &p) { return os<<'{'<<p.first<<","<<p.second<<'}'; }
template<class T> istream& operator>>(istream &is,vector<T> &v) { for(T &t:v){is>>t;} return is; }
template<class T> ostream& operator<<(ostream &os,const vector<T> &v) { os<<'[';rep(i,v.size())os<<v[i]<<(i==v.size()-1?']':','); return os; }
void Yes(bool b) { cout << (b ? "Yes" : "No") << endl; }
void YES(bool b) { cout << (b ? "YES" : "NO") << endl; }
template<class T> bool chmin(T& a,T b) {if(a > b){a = b; return true;} return false;}
template<class T> bool chmax(T& a,T b) {if(a < b){a = b; return true;} return false;}
const int inf = 1001001001;
const ll linf = 1001001001001001001;

int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr); cout.tie(nullptr);
    int h,w,n;
    cin >> h >> w >> n;
    vvi ans(h,vi(w));
    int ni = 0,nj = 0;
    auto paint = [&](int c) {
        ans[ni][nj] = c;
        if(ni&1) {
            if(nj > 0) nj--;
            else ni++;
        } else {
            if(nj < w-1) nj++;
            else ni++;
        }
    };
    rep(i,n) {
        int a;
        cin >> a;
        rep(_,a) paint(i+1);
    }
    rep(i,h) rep(j,w) cout << ans[i][j] << (j < w-1 ? " " : "\n");
}


Measured memory_bytes: 384
#include <bits/stdc++.h>
using namespace std;
int N;
string W[110];
int main(){
  cin >> N;
  cin >> W[0];
  for(int i=1;i<N;i++){
    cin >> W[i];
    for(int j=0;j<i;j++){
      if(W[i]==W[j]){
        cout << "No" << endl;
        return 0;
      }
    }
    if(W[i].front()==W[i-1].back());
    else{
      cout << "No" << endl;
      return 0;
    }
  }
  cout << "Yes" << endl;
  return 0;
}


Measured memory_bytes: 256
#include"bits/stdc++.h"
using namespace std;
#define REP(k,m,n) for(ll (k)=(m);(k)<(n);(k)++)
#define rep(i,n) REP((i),0,(n))
using ll=long long;

int main()
{
	int N;
	cin>>N;
	int X = ceil(N*100.0/108);
	//cout<<X<<endl;
	if(N==X*108/100){
		cout<<X<<endl;
	}else{
		cout<<":("<<endl;
	}
	return 0;
}


Measured memory_bytes: 256
def parse(yaml, pos, props, cur_lv = -1)
  cur = ""
  while pos < yaml.size
    line = yaml[pos]
    lv = 0
    while line[0] == ' '
      line = line[1..-1]
      lv += 1
    end
    if lv <= cur_lv
      return pos
    end
    dat = line.split(':')
    if dat.size == 1
      child = {}
      # it has children
      pos = parse(yaml, pos + 1, child, lv)
      props[dat[0]] = child
    else
      props[dat[0]] = dat[1][1..-1]
      pos += 1
    end
  end
  return pos
end


query = gets.chomp.split(".")[1..-1]
yaml = []
while s = gets
  yaml << s.chomp
end

props = {}
parse(yaml, 0, props)
for v in query
  if props.is_a?(Hash) && props.member?(v)
    props = props[v]
  else
    puts "no such property"
    exit 0
  end
end

if props.is_a?(String)
  puts "string \"#{props}\""
else
  puts "object"
end

Measured memory_bytes: 8956
/*
 * main.c
 *
 *  Created on: 2020/07/27
 *      Author: 113896
 */
#include <stdio.h>

int main() {

	int H, W;
	while (1) {
		scanf("%d%d", &H, &W);
		if (H == 0 && W == 0) break;
		for (int i = 0; i < H; i++) {
			for (int j = 0; j < W; j++) {
				if (i == 0 || j == 0 || i == H-1 || j == W-1) {
					printf("#");
				} else {
					printf(".");
				}
			}
			printf("\n");
		}
		printf("\n");
	}

	return 0;
}




Measured memory_bytes: 2036
#include <iostream>
#include <cstdlib>
#include <time.h>
#include <algorithm>
#include <map>
#include <queue>
#include <stack>
#include <vector>
#include <array>
#include <string>
#include <iomanip>
#include <cstring>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define mp make_pair
#define eb emplace_back
#define f first
#define s second
#define sz(x) (ll)x.size()
using namespace std;
using namespace __gnu_pbds;

typedef long long int ll;
typedef tree<ll, null_type, less<ll>, rb_tree_tag, tree_order_statistics_node_update> osSet;

using pll = pair<ll, ll>;

const ll maxN = 1e5;
const ll INF = 1e17;
const ll MOD = 1e9 + 7;

ll xs[] = {-1, 1, 0, 0, -1, 1, 1, -1};
ll ys[] = {0, 0, -1, 1, -1, 1, -1, 1};

ll segtree[maxN << 2];
ll lazy[maxN << 2];
ll A[maxN];

inline ll left(ll x){
	return x << 1;
}

inline ll right(ll x){
	return (x<<1) + 1;
}

ll func(ll x){
	return (x*(x+1))/2;
}

ll _pow(ll b, ll p){
	if(p == 0) return 1;
	if(p == 1) return b;
	ll exB = b*b;
	if(p&1) return b*_pow(exB, p/2);
	return _pow(exB, p/2);
}

int main(){
	cin.sync_with_stdio(false);
	cin.tie(0);
	ll n;
	cin >> n;
	vector<ll> vlp;
	for(ll i=1; _pow(6,i) < maxN; i++)
		vlp.emplace_back(_pow(6, i));
	for(ll i=1; _pow(9,i) < maxN; i++)
		vlp.emplace_back(_pow(9, i));
	vlp.emplace_back(1);
	sort(begin(vlp),end(vlp));
	ll dp[n+1];
	dp[0] = 1;
	for(ll i=1; i<=n;i++){
		dp[i] = INF;
		for(ll j=0; j<sz(vlp); j++){
			if(vlp[j] <= i)
				dp[i] = min(dp[i], 1+dp[i-vlp[j]]);
			else
				break;
		}
	}
	cout << dp[n]-1;
	return 0;
}

Measured memory_bytes: 4372
#include <bits/stdc++.h>
using namespace std;
int main() {
    long long n, h; cin >> n >> h;
    long long a[h]; long long sum = 0;
    for (int i = 0; i < h; i++) {
        cin >> a[i];
        sum += a[i];
    }
    if (sum >= n) {
        cout << "Yes" << endl;
    } else {
        cout << "No" << endl;
    }
}


Measured memory_bytes: 1024
#include<bits/stdc++.h> 
using namespace std; 
// Binary indexed tree supporting binary search.
 
 
#define x first
#define y second
 
#define forn(i, n) for(int i = 0; i < int(n); ++i)
 
typedef pair<int, int> pii;
//#define forn(i, a,b) for (int i = (int) a; i <= (int) b; ++i)
struct query{
	int a,b,c,d;
};
int main(){
    ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
    int N,M;
    cin>>N>>M;
    if(N%2 == 1){
    	int x = (2*((N-1)/2))-1;
	    int pa = 0;
	    int st = 1;
	    for(int j = x ; j>=1;j-=2){
	    	cout<<st<<" "<<j+st<<'\n';
	    	st++;
	    	pa++;
	    	if(pa==M){
	    		break;
			}
		}
	}
    else{
    	int x = N-2;
	    int pa = 0;
	    int st = 1;
	    int upd = 1;
	    for(int j = x ; j>=1;j-=2){
	    	if(upd && j<=(N/2)){
	    		j--;
	    		upd = 0;
			}
	    	cout<<st<<" "<<j+st<<'\n';
	    	st++;
	    	pa++;
	    	if(pa==M){
	    		break;
			}
		}
	}
	return 0;	
}

Measured memory_bytes: 3656
import java.util.Scanner;
     
    public class Main {
    	public static void main (String[] args) {
    		Scanner sc = new Scanner(System.in);
    		
    		int a = sc.nextInt();
    		int b = sc.nextInt();
    		int c = sc.nextInt();
    		
    		int maxab = Math.max(a, b); 
    		int minab = Math.min(a, b);
    		
    		int max = Math.max(maxab, c);
    		int min = Math.min(minab, c);
    		
    		System.out.println(max - min);
    		
    	}
    }

Measured memory_bytes: 22612
#include<bits/stdc++.h>
using namespace std;
char a[110];
int main()
{
	cin>>a;
	int l=strlen(a),pd=0;
	for(int i=0;i<l;i++)
	{
		if(a[i]=='C')pd=1;
		if(pd==1&&a[i]=='F')
		{
			cout<<"Yes";
			return 0;
		}
	}
	cout<<"No";
	return 0;
} 

Measured memory_bytes: 256
// Author: Amey Bhavsar
// ID: bhavsar
// IDE: Geany/Ubuntu
// Platform: AtCoder Beginner Contest 174

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

typedef long long ll;

#define rep(i,a,b) for(auto i=a;i<b;i++)
#define repD(i,a,b) for(auto i=a;i>=b;i--)
#define pb push_back
#define mp make_pair
#define ff first
#define ss second

// to be used with algorithms that processes a container Eg: find(all(c),42)
#define all(x) (x).begin(), (x).end() //Forward traversal
#define rall(x) (x).rbegin, (x).rend() //reverse traversal
// traversal function to avoid long template definition
#define tr(c,i) for(__typeof__((c)).begin() i = (c).begin(); i != (c).end(); i++)
//find version works for all containers. This is present in std namespace.
#define cpresent(c,x) (find(all(c),x) != (c).end())
#define MOD 1000000007
// ll fe (ll x, ll y) {
	// ll ans = 1;
	// while (y>0) {
		// if (y&1) {
			// ans = (x*ans) % MOD;
		// }
		// y /= 2;
		// x = (x*x) % MOD;
	// }
	// return (ans % MOD);
// }

// ll modmul(ll a, ll b) {
    // return ((a%MOD) * (b%MOD)) % MOD;
// }

// ll modadd(ll a , ll b){
    // return((a%MOD)+(b%MOD)+MOD)%MOD;
// }

// ll modsub(ll a , ll b){
    // return((a%MOD) - (b%MOD) + MOD)%MOD;
// }
// from math import sqrt, floor, pi, cos, sin, log, log2
// k=int(input())
// if (k%2 == 0):
	// print(-1)
	// exit(0)
// a = 7
// for i in range(10**6):
	// if (a % k == 0):
		// print(i+1)
		// exit(0)
	// a*=10;
	// a+=7;
// print(-1)


int main() {
	ios_base::sync_with_stdio(false);cin.tie(NULL);
	
	int k;
	cin >> k;
	if (k % 2 == 0 || k%5 == 0) {
		cout << -1 << '\n';
		return 0;
	}
	unsigned long long a = 7;
	for (int i=0; i<min(2*k,(int)1e6); i++) {
		// if (a % k == 0) {
			// cout << a << '\n';
			// cout << i+1 << '\n';
			// return 0;
		// }
		a %= k;
		if (a == 0) {
			cout << i+1 << '\n';
			return 0;
		}
		a *= 10;
		a += 7;
	}
	
	
	
	cout << -1 << '\n';
	return 0;
}


Measured memory_bytes: 3604
package main

import (
	"fmt"
)

type dice struct {
	t, s, e, w, n, b int
}

func (d *dice) rotate(s string) {
	switch s {
	case "E":
		d.t, d.e, d.w, d.b = d.w, d.t, d.b, d.e
	case "W":
		d.t, d.e, d.w, d.b = d.e, d.b, d.t, d.w
	case "S":
		d.t, d.s, d.b, d.n = d.n, d.t, d.s, d.b
	case "N":
		d.t, d.s, d.b, d.n = d.s, d.b, d.n, d.t
	}
}

func (d *dice) equal(t dice) bool {
	return d.t == t.t && d.s == t.s && d.e == t.e && d.w == t.w && d.n == t.n && d.b == t.b
}

// サイコロ3
func main() {
	var t1, s1, e1, w1, n1, b1 int
	fmt.Scan(&t1, &s1, &e1, &w1, &n1, &b1)
	d1 := dice{t: t1, s: s1, e: e1, w: w1, n: n1, b: b1}

	var t2, s2, e2, w2, n2, b2 int
	fmt.Scan(&t2, &s2, &e2, &w2, &n2, &b2)
	d2 := dice{t: t2, s: s2, e: e2, w: w2, n: n2, b: b2}

	s := "No"
	for _, v := range "EEENEEENEEESEEESEEENEEEN" {
		if d1.equal(d2) {
			s = "Yes"
			break
		}
		dir := string(v)
		d1.rotate(dir)
	}
	fmt.Println(s)
}



Measured memory_bytes: 1152
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int nmax=100005;
struct edge{ll to;ll cost;};
vector<edge> tree[nmax];
ll d[nmax],t[nmax],h[nmax];
bool vis[nmax];
ll n;
void dijkstra(ll s){
  priority_queue<pair<ll,ll>,vector<pair<ll,ll>>,greater<pair<ll,ll>>> pq;
  fill(d,d+n,1e18);
  d[s]=0;
  pq.push(make_pair(0,s));
  while(!pq.empty()){
    pair<ll,ll> p=pq.top();
    pq.pop();
    ll v=p.second;
    if(d[v]<p.first){
      continue;
    }
    for(auto x:tree[v]){
      edge e=x;
      if(d[e.to]>d[v]+e.cost){
        d[e.to]=d[v]+e.cost;
        pq.push(make_pair(d[e.to],e.to));
      }
    }
  }
}
vector<vector<int>> g(nmax);
void dfs(int u){
  stack<int> st;
  st.push(u);
  h[u]=0;
  vis[u]=0;
  while(!st.empty()){
    int p=st.top();
    st.pop();
    for(auto x:g[p]){
      if(!vis[x]&&t[x]<=d[x]){
        h[x]=h[p]+1;
        vis[x]=true;
        st.push(x);
      }
    }
  }
}
int main(){
  ll u,v;cin >> n >> u >> v;
  u--,v--;
  for(int i=0;i<n-1;i++){
    int a,b;cin >> a >> b;
    a--,b--;
    tree[a].push_back(edge{b,1});
    tree[b].push_back(edge{a,1});
    g[a].push_back(b);
    g[b].push_back(a);
  }
  dijkstra(u);
  for(int i=0;i<n;i++){
    t[i]=d[i];
  }
  dijkstra(v);
  ll ans=0;
  dfs(u);
  for(int i=0;i<n;i++){
    if(h[i]){
      ans=max(ans,d[i]);
    }
  }
  cout << max((ll)0,ans-1) << endl;
}

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

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

    if (S == "SUN") {
        cout << 7;
    }
    else if (S == "MON") {
        cout << 6;
    }
    else if (S == "TUE") {
        cout << 5;
    }
    else if (S == "WED") {
        cout << 4;
    }
    else if (S == "THU") {
        cout << 3;
    }
    else if (S == "FRI") {
        cout << 2;
    }
    else {
        cout << 1;
    }

    return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#define N (100005)
#define ll long long
#define debug(x) cerr<<#x<<" : "<<x<<endl
#define CM cerr<<(&MOP2-&MOP1)/1024.0/1024.0<<endl
using namespace std;
template <class T> inline T Min(T x, T y){
    return x<y?x:y;
}
template <class T> inline T Max(T x, T y){
    return x>y?x:y;
}
bool MOP1;
int n;
bool MOP2;
int main(){
	scanf("%d",&n);
	int ans=0,cnt=0,res;
	scanf("%d",&res);
	for(int i=2;i<=n;i++){
		int tmp;
		scanf("%d",&tmp);
		if(tmp<=res)cnt++;
		else cnt=0;
		if(cnt>ans)ans=cnt;
		res=tmp;
	}
	printf("%d\n",ans);
	return 0;
}






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

using namespace std;

int main()
{
//    ios_base::sync_with_stdio(false);
//    cin.tie(0);
	ll n;
	map<string,ll> a;
	string s;
	ll i,j,t,k;
	cin >> n;
	for(i=0;i<n;i++){
		cin >> s ;
		a[s]++;
	}
	vector<string> ans;
	k=0;
	for(auto it:a){
		if(it.second==k){
			ans.push_back(it.first);
		}
		if(it.second>k){
			ans.clear();
			ans.push_back(it.first);
			k=it.second;
		}
	}
	for(i=0;i<ans.size();i++){
		cout << ans[i] << endl;
	}
    return 0;
}

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

int GetDigit(int num){
    return to_string(num).length();
}

int main() {
    int N;
    cin >> N;
    int ans = 0;

    int digit;
    for (int i = 1; i < N+1; i++) {
        digit = GetDigit(i);
        if (digit % 2) ans++;
    }

    cout << ans << endl;
}

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

const int len = 1e4+5;
char a[len], b[len];
int n;

bool check(int st){
    for (int i = st; i < n; i++)
        if (a[i] != b[i-st]) return false;
    return true;
}

int main(){
    scanf("%d %s %s", &n, &a, &b);

    int ans = 2*n;
    for (int i = 0; i < n; i++)
        if (check(i)){
            ans = i+n;
            break;
        }

    printf("%d\n", ans);
    return 0;
}


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

using namespace std;
struct UnionFind {
	vector<long long> par; // par[i]:iの親の番号　(例) par[3] = 2 : 3の親が2

	UnionFind(long long N) : par(N) { //最初は全てが根であるとして初期化
		for (long long i = 0; i < N; i++) par[i] = i;
	}

	long long root(long long x) { // データxが属する木の根を再帰で得る：root(x) = {xの木の根}
		if (par[x] == x) return x;
		return par[x] = root(par[x]);
	}

	void unite(long long x, long long y) { // xとyの木を併合
		long long rx = root(x); //xの根をrx
		long long ry = root(y); //yの根をry
		if (rx == ry) return; //xとyの根が同じ(=同じ木にある)時はそのまま
		par[rx] = ry; //xとyの根が同じでない(=同じ木にない)時：xの根rxをyの根ryにつける
	}
	bool same(long long x, long long y) {
		long long rx = root(x);
		long long ry = root(y);
		return rx == ry;
	}
};

int main() {
	long long N, M;
	cin >> N >> M;
	vector<pair<long long, long long>> E(M);
	for (long long i = 0; i < M; i++) cin >> E[i].first >> E[i].second;
	vector<long long> Ans(M);
	UnionFind UF(N);
	vector<long long> Nums(N, 1);
	Ans[M - 1] = N * (N - 1) / 2;
	for (long long i = M - 1; i >= 1; i--) {
		long long a = E[i].first, b = E[i].second;
		Ans[i - 1] = Ans[i];
		if (!UF.same(a - 1, b - 1)) {
			long long ra = UF.root(a - 1);
			long long rb = UF.root(b - 1);
			Ans[i - 1] -= Nums[ra]*Nums[rb];
			UF.unite(a - 1, b - 1);
			Nums[rb] += Nums[ra];
			Nums[ra] = 0;
		}
	}
	for (long long a : Ans) cout << a << endl;
}

Measured memory_bytes: 7156
import sys

inf = float("inf")

# import random
# from collections import deque, Counter, OrderedDict,defaultdict
# from heapq import nsmallest, nlargest, heapify,heappop ,heappush, heapreplace
# from math import ceil,floor,log,sqrt,factorial,pi,gcd
# from bisect import bisect,bisect_left,bisect_right,insort,insort_left,insort_right

def get_array(): return list(map(int, sys.stdin.readline().strip().split()))
def get_ints(): return map(int, sys.stdin.readline().strip().split())
def input(): return sys.stdin.readline().strip()

A1,A2,A3 = get_ints()
s = A1+A2+A3
if s>=22:
 	print("bust")
else:
	print("win")

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

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

    set<int> num;
    for(int i=1; i<=7; i++){
        for(int j=1; j<=7; j++){
            for(int k=1; k<=7; k++){
                int d = i + j + k;
                if(d <= 9){
                    vector<int> v;
                    for(int a=0; a<i; a++) v.push_back(3);
                    for(int b=0; b<j; b++) v.push_back(5);
                    for(int c=0; c<k; c++) v.push_back(7);

                    //for(auto e : v) cout << e;
                    //cout << endl;
                    
                    do{
                        int test = 0;
                        int l = d;
                        int p = 1;
                        while(l > 0){
                            //cout << test << endl;
                            test += v[l-1] * p;
                            l -= 1;
                            p *= 10;
                        }
                        num.insert(test);
                    }while(next_permutation(v.begin(),v.end()));
                }
            }
        }
    }
    vector<int> sgs;
    for(auto x : num){
        //if(x <= 10000) cout << x << endl;
        sgs.push_back(x);
    }

    cout << upper_bound(sgs.begin(),sgs.end(),n) - sgs.begin() << endl;
    return 0;
}

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

int main(){
long long int a[1000000],n,MIN,MAX,SUM;
MIN=100000000;
MAX=-100000000;
SUM=0;
cin>>n;
for(int i=0;i<n;i++){
cin>>a[i];
if(MIN>a[i]){
MIN=a[i];
}
if(MAX<a[i]){
MAX=a[i];
}
SUM += a[i];
}
cout<<MIN<<" "<<MAX<<" "<<SUM<<endl;
return 0;
}


Measured memory_bytes: 3156
#!/usr/bin/env python

def GCD(a, b):
	dummy1 = max(a, b)
	dummy2 = min(a, b)
	while True:
		dummy = dummy1 % dummy2
		dummy1 = dummy2
		dummy2 = dummy
		if(dummy == 0):
			break

	return dummy1

while True:
	N = input()
	if not N:
		break
	cost = []
	E = []
	root = N * (N - 1) / 2
	for i in range(N):
		S = raw_input().split()
		c1, c2, e1, e2 = list(map(int,S))
		cost.append((c1, c2))
		root -= e1 + e2
		e1 -= 1
		e2 -= 1
		E.append((e1, e2))
	def nums(e):
		N_lst1 = []
		N_lst2 = []
		val_lst1 = []
		val_lst2 = []
		if E[e][0] != -1:
			N_lst1, val_lst1 = nums(E[e][0])
		else:
			N_lst1 = [1]
			val_lst1 = []
		
		if E[e][1] != -1:
			N_lst2, val_lst2 = nums(E[e][1])
		else:
			N_lst2 = [1]
			val_lst2 = []
		
		mul1 = cost[e][0]
		for num in val_lst1:
			mul1 *= num
		mul2 = cost[e][1]
		for num in val_lst2:
			mul2 *= num
		for i in range(len(N_lst1)):
			N_lst1[i] *= mul2
		for i in range(len(N_lst2)):
			N_lst2[i] *= mul1
		
		return N_lst1 + N_lst2, val_lst1 + val_lst2 + [cost[e][0] + cost[e][1]]
	N_lst, v_lst = nums(root - 1)
	#print N_lst
	num_GCD = N_lst[0]
	for num in N_lst:
		num_GCD = GCD(num, num_GCD)
	
	for i in range(len(N_lst)):
		N_lst[i] //= num_GCD
	#print N_lst
	print sum(N_lst)
	


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

int main(){
    int a, b;
    cin >> a >> b;

    int plug_acc = 0;
    int tap_acc = 0;
    while (1){
        tap_acc += 1;
        plug_acc += a;
        if (plug_acc >= b){
            break;
        } else {
            plug_acc -= 1;
        }
    }
    if (b == 1){
        cout << 0 << endl;
    } else {
        cout << tap_acc << endl;
    }

    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
 using namespace std;
 struct knife
 {
     int ai;
     bool f;
 }m[2000018];
 inline int read()
 {
   int p=0,f=1;char c=getchar();
   while(c<'0'||c>'9'){if(c=='-') f=-1;c=getchar();}
   while(c>='0'&&c<='9'){p=p*10+c-'0';c=getchar();}
   return f*p;}
 int N,H,ans;
 bool cmp(knife x,knife y)
 {
     return x.ai>y.ai;
 }
 int main()
 {
     N=read(),H=read();
     for(int i=1;i<=N;i++)
         m[i].ai=read(),
      m[i+N].ai=read(),
         m[i+N].f=true;
     sort(m+1,m+1+N*2,cmp); 
     int ans=0;           
     for(int i=1;i<=2*N;i++)
        {
          if(m[i].f)
            {ans++;
             H-=m[i].ai;}
          else
             {
              int u=H%m[i].ai;
              ans+=H/m[i].ai;
              if(u)ans++;
            H=-1;
             }
           if(H<=0)
             {printf("%d",ans);
              return 0;}
        }
 }

Measured memory_bytes: 1792
#include"bits/stdc++.h"
using namespace std;
namespace ORIGIN {
	#define LL long long
	#define VLL vector<long long>
	#define SORT(x) sort(x.begin(),x.end())
	#define REVE(x) reverse(x.begin(),x.end())
	#define rep(i,n) for(int i=0;i<n;i++)
	#define COUT(x) cout<<x<<endl
	double pai = 3.1415926535;
	string atc = "atcoder";
	typedef pair<long long, long long> data_t;
	string strnum = "0123456789";
	string alpS = "abcdefghijklmnopqrstuvwxyz";
	string alpL = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
	int sizealp = (int)(alpS.size());
	int mod = 1e9 + 7;
	bool test = false;
}
using namespace ORIGIN;

void Test(char a) {
	if (test) {
		printf("%c", a);
	}
}
int gcd(LL a, LL b) {
	if (a == 0 || b == 0)return 0;
	if (a < b)swap(a, b);
	if (a % b == 0)return b;
	else gcd(b, a % b);
}

int main() {
	int N, M;
	cin >> N >> M;
	VLL X(M);
	rep(i, M)cin >> X[i];
	SORT(X);
	if (M <= N) {
		COUT(0);
		return 0;
	}
	else if (N == 1) {
		COUT(X[M - 1] - X[0]);
		return 0;
	}
	vector<int> dif;
	for (int i = 1; i < M; i++)
		dif.push_back(X[i] - X[i - 1]);
	int ans=0;
	SORT(dif);
	for (int i = 0; i < M - N; i++) {
		ans += dif[i];
	}
	COUT(ans);
  //rep(i,dif.size())COUT(dif[i]);
}

Measured memory_bytes: 1660
import java.util.Scanner;

public class Main {

	public static Scanner scanner = new Scanner(System.in);

	public static void main(String[] args) {

		int a = input();
		int b = input();

		System.out.print(a * b);
		System.out.print(" ");
		System.out.println(2 * (a + b));

		close();

	}

	public static int input() {

		return scanner.nextInt();

	}

	public static void close() {

		if (scanner != null) {

			scanner.close();

		}
	}
}

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

string s;
vector<string> ans;

void solve(int now, string nows);

int main() {
  while(1) {
    cin >> s;
    if(s == "#") break;
    solve(24, s);
    sort(ans.begin(), ans.end());
    ans.erase(unique(ans.begin(), ans.end()), ans.end());
    cout << ans.size() << endl;
    if(ans.size() <= 10)
      for(int i = 0; i < ans.size(); ++i)
        cout << ans[i] << endl;
    else {
      for(int i = 0; i < 5; ++i) cout << ans[i] << endl;
      for(int i = 0; i < 5; ++i)
        cout << ans[ans.size() - 5 + i] << endl;
    }
    ans.erase(ans.begin(), ans.end());
  }
  return 0;
}

void solve(int now, string nows) {
  if(now == -1) {
    ans.push_back(nows);
    return;
  }
  for(int i = 0; i < nows.size(); ++i)
    if(nows[i] == 'a' + now) {
      string nexts = nows;
      nexts[i] = 'a' + now + 1;
      solve(now - 1, nexts);
    }
    else if(nows[i] == 'a' + now + 1)
      return;
  solve(now - 1, nows);
}


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

int main () {
    ll sum=0;
    int n;
    cin>>n;
    for(int i=1;i<=n;i++){
        if(i%3==0||i%5==0)
        {}
        else
            sum+=i;
    }
    cout<<sum;
}

Measured memory_bytes: 3640
#include<stdio.h>
int main(){
    int s[200], p[100], i, j, l=0, k=0, count=0;
    while((s[l++]=getchar())!='\n'){}
    for(i=0; i<l-1; i++)s[l-1+i]=s[i];
    while((p[k++]=getchar())!='\n'){}
    for(i=0; i<l-1; i++){
        for(j=0; j<k-1; j++)if(s[i+j]==p[j])count++;
        if(count==k-1){
            count=-1;
            break;
        }else count=0;
    }
    if(count==-1)printf("Yes\n");
    else printf("No\n");
    return 0;
}

Measured memory_bytes: 524
#define _CRT_SECURE_NO_WARNINGS
#pragma comment(linker, "/STACK:256000000")
#define _USE_MATH_DEFINES
#include<iostream>
#include<vector>
#include<string>
#include<stack>
#include<algorithm>
#include<cmath>
#include<set>
#include<queue>
#include<sstream>
#include<utility>
#include<map>
#include<ctime>
#include<cstdio>
#include<cassert>
#include<functional>
#include<unordered_map>
#include<deque>
#include<cmath>





using namespace std;

typedef long long ll;
typedef long double ld;
typedef unsigned int uint;
typedef unsigned long long ull;
typedef pair<ll, ll> pll;
typedef pair<int, int> pii;
typedef pair<char, char> pcc;
typedef pair<double, double> pdd;

#define show(x) cerr << x
#define debug(x) show(#x << ": " << (x) << endl)

const long double PI = 3.14159265358979323846;
const long double eps = 1e-5;
const ll INF = numeric_limits<int>::max();
const ll LINF = numeric_limits<ll>::max();
const ll mod = 1000 * 1000 * 1000 + 7;



void solve() {
    int n, p, q;
    cin >> n >> p >> q;
    vector<int> a(n), b(n), c(n);
    for (int i = 0; i < n; ++i) {
        cin >> a[i] >> b[i] >> c[i];
    }
    vector<vector<int> > d(500, vector<int>(500, INF));
    d[0][0] = 0;
    for (int i = 0; i < n; ++i) {
        for (int id1 = d.size() - 1; id1 >= 0; --id1) {
            for (int id2 = d.size() - 1; id2 >= 0; --id2) {
                if (d[id1][id2] == INF)
                    continue;
                int x = id1 + a[i], y = id2 + b[i];
                d[x][y] = min(d[x][y], d[id1][id2] + c[i]);
            }
        }
    }
    int res = INF;
    for (int i = 1; i < 500; ++i) {
        for (int j = 1; j < 500; ++j) {
            if (i * q == j * p) {
                res = min(res, d[i][j]);
            }
        }
    }
    if (res == INF)
        res = -1;
    cout << res << endl;
}


//#define LOCAL

int main() {
    ios_base::sync_with_stdio(0);cin.tie(nullptr);cout.tie(nullptr);
#ifdef LOCAL
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif
    solve();



#ifdef LOCAL
    cerr << "Time elapsed: " << 1.0 * clock() / CLOCKS_PER_SEC << " s.\n";
#endif	
    return 0;
}


Measured memory_bytes: 1280
import java.util.*;
import java.io.*;

class Main {


  

  public static void main(String[] args) {
    Scanner in = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
    int H = in.nextInt();
    int W = in.nextInt();
    int MAX = 1000000007;
    char[][] A = new char[H][W];
    for (int i = 0; i < H; i++) {
      A[i] = in.next().toCharArray();
    }

    // for (int i = 0; i < H; i++) {
    //   for (int j = 0; j < W; j++) {
    //     System.out.print(A[i][j]);
    //   }
    //   System.out.println();
    // }

    int[][] dp = new int[H + 1][W + 1];
    dp[0][1] = 1;
    for (int i = 1; i <= H; i++) {
      for (int j = 1; j <= W; j++) {
        if (A[i - 1][j - 1] == '#') {dp[i][j] = 0;}
        else {
          dp[i][j] = (dp[i - 1][j] + dp[i][j - 1]) % MAX;
        }
      }
    }


    


    System.out.println(dp[H][W]);
  }

}

Measured memory_bytes: 37608
#!/usr/bin/env python
# -*- coding: utf-8 -*-

"""
input:
5 4
0 1
1 2
2 3
3 4

output:
0 1
1 2
2 3
3 4
"""

import sys
sys.setrecursionlimit(int(1e5))


def generate_adj_table(_v_info):
    for v_detail in _v_info:
        v_from, v_to = map(int, v_detail)
        init_adj_table[v_from].append(v_to)
        # undirected graph
        init_adj_table[v_to].append(v_from)
    return init_adj_table


def graph_dfs(u, visited, parent, low, disc):
    global Time
    # Count of children in current node
    children = 0

    # Mark the current node as visited and print it
    visited[u] = True

    # Initialize discovery time and low value
    disc[u] = Time
    low[u] = Time
    Time += 1

    # Recur for all the vertices adjacent to this vertex
    for v in adj_table[u]:
        # If v is not visited yet, then make it a child of u
        # in DFS tree and recur for it
        if not visited[v]:
            parent[v] = u
            children += 1
            graph_dfs(v, visited, parent, low, disc)

            # Check if the subtree rooted with v has a connection to
            # one of the ancestors of u
            low[u] = min(low[u], low[v])

            ''' If the lowest vertex reachable from subtree
            under v is below u in DFS tree, then u-v is
            a bridge'''
            if low[v] > disc[u]:
                ans.append(sorted([u, v]))
        elif v != parent[u]:  # Update low value of u for parent function calls.
            low[u] = min(low[u], disc[v])

    return None


def bridge():
    visited = [False] * vertices
    disc = [float("Inf")] * vertices
    low = [float("Inf")] * vertices
    parent = [-1] * vertices

    for v in range(vertices):
        if not visited[v]:
            graph_dfs(v, visited, parent, low, disc)

    return ans


if __name__ == '__main__':
    _input = sys.stdin.readlines()
    vertices, edges = map(int, _input[0].split())
    v_info = map(lambda x: x.split(), _input[1:])
    Time = 0
    ans = []

    init_adj_table = tuple([] for _ in range(vertices))
    adj_table = generate_adj_table(v_info)
    res = bridge()
    res.sort()
    for ele in res:
        print(*ele)

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

using namespace std;
typedef long long ll;
typedef pair<int, int> pint;
#define REP(i, n) for(int i = 0; i < (int)(n); i++)
#define IREP(i, n) for(int i = (int)(n) - 1; i >= 0; i--)
#define ALL(x) (x).begin(), (x).end()
#define MOD 1000000007
#define IMAX INT_MAX
#define IMIN INT_MIN
#define LMAX LLONG_MAX
#define LMIN LLONG_MIN
template<typename T> inline void chmin(T &a, T b){ if(a > b) a = b; }
template<typename T> inline void chmax(T &a, T b){ if(a < b) a = b; }
template<typename T> inline void xch(T &a, T &b){ T w = a; a = b; b = w; }


int main() {
    int A, B, H, M;
    cin >> A >> B >> H >> M;
    double argA = M_PI * ((double)H + (double)M / 60.0) / 6.0;
    double argB = M_PI * (double)M / 30.0;
    double Ax = A * cos(argA);
    double Ay = A * sin(argA);
    double Bx = B * cos(argB);
    double By = B * sin(argB);
    double ans = sqrt((Ax - Bx) * (Ax - Bx) + (Ay - By) * (Ay - By));
    printf("%.16f\n", ans);
    return 0;
}


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

typedef long long ll;
const int M=200010;

struct Node *null;
struct Node
{
	ll v;int t;
	Node *lch,*rch;
	Node() {}
	Node(ll _v) : v(_v),t(1),lch(null),rch(null) {}
	bool isbad() {return lch->t*3>t*2+10||rch->t*3>t*2+10;}
	void update() {t=lch->t+rch->t+1;}
}*root,*vec[M];
int tot;

void dfs(Node *p)
{
	if(p==null) return;
	dfs(p->lch);
	vec[tot++]=p;
	dfs(p->rch);
}

Node *divide(int l,int r)
{
	if(l==r) return null;
	int mi=l+r>>1;
	Node *p=vec[mi];
	p->lch=divide(l,mi);
	p->rch=divide(mi+1,r);
	p->update();
	return p;
}

void rebuild(Node *&p)
{
	tot=0;
	dfs(p);
	p=divide(0,tot);
}

Node **top;
void insert(Node *&p,ll v)
{
	if(p==null)
	{
		p=new Node(v);
		top=&null;
		return;
	}
	if(v<p->v) insert(p->lch,v);
	else insert(p->rch,v);
	p->update();
	if(p->isbad()) top=&p;
	if(p==root&&*top!=null) rebuild(*top);
}

int query(Node *p,ll v)
{
	if(p==null) return 0;
	if(v<p->v) return query(p->lch,v);
	return p->lch->t+1+query(p->rch,v);
}

int n,k;
ll a[M],ans;

int main()
{
	ios::sync_with_stdio(false);
	root=null=new Node;
	insert(root,0);
	cin>>n>>k;
	for(int i=1;i<=n;i++)
	{
		cin>>a[i];
		a[i]+=a[i-1]-k;
		ans+=query(root,a[i]);
		insert(root,a[i]);
	}
	cout<<ans;
	return 0;
}

Measured memory_bytes: 13824
a, b = map(int, input().split())
def sxor(n):
    p = 0
    res = 0
    xor = (n&1)^((n>>1)&1)
    res |= xor
    p += 1
    if n&1 == 0:
        res |= n
    return res
if a == b:
    print(a)
elif a == 0:
    print(sxor(b))
else:
    print(sxor(a-1)^sxor(b))


Measured memory_bytes: 3064
bingo = []
3.times { bingo += gets.split.map(&:to_i) }
n = gets.to_i
nums = []
n.times { nums << gets.to_i }
called = []
nums.each do |num|
  bingo.each_with_index { |b, i| called << i if num == b }
end

bingo_list = [
  [0, 1, 2],
  [3, 4, 5],
  [6, 7, 8],
  [0, 3, 6],
  [1, 4, 7],
  [2, 5, 8],
  [0, 4, 8],
  [2, 4, 6],
]

finished = bingo_list.any? do |list|
  list.all? { |c| called.include?(c) }
end

puts finished ? "Yes" : "No"  


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

namespace AtCoder.Abc
{
    //https://atcoder.jp/contests/abc081/tasks/abc081_a
    class Abc_081_A
    {
        public static void Main(string[] args)
        {
            var sw = new System.IO.StreamWriter(Console.OpenStandardOutput()) { AutoFlush = false };
            Console.SetOut(sw);

            // 文字列の入力
            string s = Console.ReadLine();

            int result;

            result = s.Length - s.Replace(1.ToString(), "").Length;

            Console.WriteLine(result);

            Console.Out.Flush();
        }
    }
}


Measured memory_bytes: 13140
import sys
def fastio():
    from io import StringIO
    from atexit import register
    global input
    sys.stdin = StringIO(sys.stdin.read())
    input = lambda : sys.stdin.readline().rstrip('\r\n')
    sys.stdout = StringIO()
    register(lambda : sys.__stdout__.write(sys.stdout.getvalue()))
fastio()

def debug(*var):
    print(*var, file=sys.stderr)

INF = 10**20
MOD = 10**9 + 7
I = lambda:list(map(int,input().split()))
# from math import gcd
# from collections import defaultdict as dd, Counter
# from bisect import bisect_left as bl, bisect_right as br

n, = I()
s, t = input().split()
for i in range(n):
    print(s[i], t[i], sep = '', end = '')

Measured memory_bytes: 38420
#include <bits/stdc++.h>
typedef long long ll;
#define SZ(x) ((int)(x).size())

using namespace std;


int main() {

	int N;
	cin >> N;

	vector<int> A(N + 1);
	for (int i = 0; i < N+1; i++)
	{
		cin >> A[i];
	}

	vector<int> B(N);
	for (int i = 0; i < N; i++)
	{
		cin >> B[i];
	}

	ll ans = 0;
	for (int i = 0; i < N; i++)
	{
		//B[i]でA[i]のモンスターを倒す
		ll mons = min(A[i], B[i]);
		B[i] -= mons; //倒せるモンスターの数が減る
		ans += mons;

		//B[i]でA[i+1]のモンスターを倒す
		mons = min(A[i + 1], B[i]);
		A[i + 1] -= mons; //残りのモンスターの数が減る
		ans += mons;
	}

	cout << ans << endl;



	return 0;
}

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

int count[2010];

int main() {
  
  vector<int> count(2010,0);
  
  int n,x,y;
  cin >>n>>x>>y;
  
  for(int i=0;i<n-1;i++){
    for(int j=i+1;j<n;j++){
      int k;
      k=min(j-i,abs(x-1-i)+abs(y-1-j)+1);
      count[k]++;
    }
  }
  
  for(int i=1;i<n;i++){
    cout << count[i] <<endl;
  }
  
  return 0;
}

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

char s[1];

int main() {
	ios::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
	
	cin >> s[0];
	if (s[0] >= 'a')
	{
		cout << "a\n";
	}
	else {
		cout << "A\n";
	}
	
	
	return 0;
}


Measured memory_bytes: 3576
//...Bismillahir Rahmanir Rahim...
// Code by    Asad Bin Saber
// 19 04 2020

#include <bits/stdc++.h>

using namespace std;

typedef long long ll;

#define    pi    acos(-1.0)

void task()
{
    int r;
    float ans;

    cin >> r;

    ans = 1.0*2*pi*r;

    cout << ans << "\n";
}

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

    //clock_t tStart = clock();

    //freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);

    task();

    //printf("Time taken: %.3fs\n", (double)(clock() - tStart)/CLOCKS_PER_SEC);

    return 0;
}



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

int main(){
    int H,W;
    
    while(1){
        cin >> H >> W;
        if(H==0 && W==0)break;
        for ( int i = 0; i < H; i++ ){
            for ( int j = 0; j < W; j++ ){
                if((i+j)%2 == 0){
                    cout<<"#";
                }
                else{
                    cout<<".";
                }
            }cout << endl;
        }cout << endl;
    }
    
    return 0;
}


Measured memory_bytes: 3072
#include<stdio.h>

#define N 2000001

int n;

void Counting_Sort(int a[],int b[],int k){
  int i, j, c[N];

  for(i=0; i<=k; i++) c[i]=0;

  for(j=1; j<=n; j++) c[a[j]]++;

  for(i=1; i<=k ;i++) c[i]+=c[i-1];

  for(j=n; j>0; j--) {
    b[c[a[j]]]=a[j];
    c[a[j]]--;
  }
  for(i=1;i<=n;i++){
    printf("%d",b[i]);
    if(i!=n) printf(" ");
  }
  printf("\n");
 

}


int main(){
  int i,  max=0;
 static  int a[N],b[N];
  scanf("%d",&n);

  for(i=1; i<=n; i++){
    scanf("%d",&a[i]);
    if(a[i]>max)  max=a[i];
  }
  
  Counting_Sort(a,b,max);
   

  return 0;
}

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

int main(){
    int k;
    cin >> k;
    queue<long long> A;
    for(int i=1;i<10;i++){
        A.push(i);
    }
    long long temp;
    for(int i=0;i<k-1;i++){
        temp=A.front();
        if(temp%10 != 0){
            A.push(temp*10 +temp%10 -1);
        }
        A.push(temp*10 +temp%10);
        if(temp%10 != 9){
            A.push(temp*10 +temp%10 +1);
        }
        A.pop();
    }

    cout << A.front() << endl;
    return 0;
}

Measured memory_bytes: 1792
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <queue>
#include <vector>

using namespace std;

int main(){
	
	int A, B, C, D, P;
	
	cin >> A >> B >> C >> D >> P;
	
	int cost1, cost2;
	
	cost1 = A * P;
	
	cost2 = max(0, P - C) * D + B;
	
	cout << min(cost1, cost2) << endl;
	
	return 0;
}

Measured memory_bytes: 3108
n,k = map(int, input().split())
mod = 1000000007
ans = 0
for i in range(k,n+2):
    j = i-1 
    if i == k:
        min = (j*j+j)//2 % mod
        max = sum(list(range(n,n-k,-1)))%mod
    else:
        min += j %mod
        max += (n-i+1) % mod
    ans += max - min +1
    ans %= mod
print(ans)

Measured memory_bytes: 16720
#include<iostream>
#include<algorithm>
#include<vector>
#include<map>     
using namespace std;
int main(){
  int n,m;
  cin>>n>>m;
  map<int,int> mp;
  long long ans=0;
  int s=0;
  mp[0]=1;
  
  for(int i=0;i<n;i++){
    int a;
    cin>>a;
    s+=a;
    s%=m;
    ans+=mp[s];
    mp[s]++;
  }
  cout<<ans<<endl;
  return 0;
}

Measured memory_bytes: 3200
# D - Equals

import sys
from collections import deque

N, M = map(int, sys.stdin.readline().split())
p = list(map(int, sys.stdin.readline().split()))
xy = sys.stdin.readlines()

neighbor = [[] for _ in range(N)]
for idx in range(M):
    x,y = map(int, xy[idx].split())
    neighbor[x-1].append(y-1)
    neighbor[y-1].append(x-1)
    
can_swap = []
visited = [-1]*N

for start in range(N):
    if visited[start] == -1:
        tmp = [start] # startから到達可能なpointのリスト
        d = deque([start])
        while d:
            current_point = d.pop()
            visited[current_point] = 1
            for next_point in neighbor[current_point]:
                if visited[next_point] == -1:
                    d.append(next_point)
                    tmp.append(next_point)
        can_swap.append(tmp)                

ans = 0
for idx_group in can_swap:
    tmp_p = [p[idx]-1 for idx in idx_group]
    ans += len(set(tmp_p) & set(idx_group))

print(ans)

Measured memory_bytes: 103568
/**********WRITTEN BY ALMOREX***********/
#include<bits/stdc++.h>
#define mod 1000000007
#define PI 3.141592653
#define vec vector
#define pb push_back
#define pop pop_back
#define prt(x) cout<<x<<endl
#define all(x) x.begin(), x.end()
#define show(x) cout<<#x<<'='<<x<<endl
#define show2(x,y) cout<<#x<<'='<<x<<','<<#y<<'='<<y<<endl
#define test unsigned long long int test; cin >> test; while(test--)
#define inp_arr(a,n) for (long long int i=0; i < n; i++) {cin>>a[i];}
#define show_arr(a,n) for (long long int i=0; i < n; i++) {cout<<a[i]<<' ';} cout<<endl;
typedef long double lld;
typedef long long int ll;
typedef unsigned long long int ull;
using namespace std;
int main(int argc, char const *argv[])
{
    ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
    ll a,b;
    cin >> a >> b;
    cout << (a*b) << endl;
    return 0;
}
/*
AtCoder:almorex
CodeChef:almorex
CodeForces:almorex11
*/
/***********WRITTEN BY ALMOREX***********/

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

using namespace std;

using ll = long long;
using ull = unsigned long long;
using db = double;
using ii = pair <int, int>;

#define int long long
#define FOR(a, b, c) for(int a = b, _c = c; a <= _c; ++a)
#define ROF(a, b, c) for(int a = b, _c = c; a >= _c; --a)
#define ALL(a, b) for(auto &a : b)
#define fi first
#define se second
#define pb push_back
#define all(a) a.begin(), a.end()
#define reset(f, x) memset(f, x, sizeof(f))
#define bit(x, i) (x >> (i - 1) & 1ll)
#define onbit(x, i) (x | (1ll << (i - 1)))
#define offbit(x, i) (x & ~(1ll << (i - 1)))
const int N = 2e5 + 5;
const ll mod = 1e9 + 7;

int n, sz[N];
vector <int> ad[N];
ll gt[N], inv[N], f[N];

int pw(int x, int i) {
  int b = 1;
  for(; i; i >>= 1, x = x * x % mod) if(i & 1) b = b * x % mod;
  return b;
}
void dfs(int u, int par) {
  sz[u] = 1;
  for(auto &v : ad[u]) {
    if(v != par) {
      dfs(v, u);
      sz[u] += sz[v];
    }
  }
}
void dfs2(int u, int par) {
  for(auto &v : ad[u]) {
    if(v != par) {
      f[v] = f[u] * sz[v]  % mod;
      sz[u] = n - sz[v];
      sz[v] = n;
      f[v] = f[v] * pw(sz[u], mod - 2) % mod;
      dfs2(v, u);
      sz[v] = n - sz[u];
      sz[u] = n;
    }
  }
}
main() {
  ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
  cin >> n;
  FOR(i, 1, n - 1) {
    int u, v;
    cin >> u >> v;
    ad[u].push_back(v);
    ad[v].push_back(u);
  }
  gt[0] = 1;
  FOR(i, 1, n) gt[i] = gt[i - 1] * i % mod;
  dfs(1, 0);
  f[1] = gt[n];
  FOR(i, 1, n) f[1] = f[1] * pw(sz[i], mod - 2) % mod;
  dfs2(1, 0);
  FOR(i, 1, n) {
    cout << f[i] << '\n';
  }
}


Measured memory_bytes: 20464
#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>

int main() {
	int H, W, h, w,a;
	scanf("%d%d%d%d", &H, &W, &h, &w);
	a = (H - h) * (W - w);
	printf("%d",a);
	return 0;
}


Measured memory_bytes: 128
#ifdef DEBUG

#else

#    pragma GCC optimize("O3,no-stack-protector")
#    pragma GCC optimize("unroll-loops")

#    if __cplusplus < 201703L
#        pragma GCC target("avx")
#    else
#        pragma GCC target("avx2")
#    endif

#endif
// 実数の場合
// #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")

#define _USE_MATH_DEFINES
#include <bits/stdc++.h>
#define dump(x) cout << x << endl
typedef int64_t Int;
typedef long double Ld;

using namespace std;
using Graph = vector<vector<Int>>;

const double pi = M_PI;
const Int MOD = 1000000007;

string rev(string s) {
    reverse(s.begin(), s.end());
    return s;
}

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

    string s;
    cin >> s;
    int n = s.size();
    reverse(s.begin(), s.end());
    vector<string> aa({rev("dream"), rev("dreamer"), rev("erase"), rev("eraser")});

    bool ans = false;
    for (int i = 0; i < n;) {
        bool tem = false;
        for (int j = 0; j < 4; j++) {
            if (equal(s.begin() + i, s.begin() + i + aa[j].size(), aa[j].begin(), aa[j].end())) {
                i += aa[j].size();
                tem = true;
                break;
            }
        }
        if (!tem) {
            break;
        }
        if (i == n) {
            ans = true;
        }
    }

    if (ans) {
        cout << "YES" << endl;
    } else {
        cout << "NO" << endl;
    }

    return 0;
}

Measured memory_bytes: 512
import java.sql.SQLOutput;
import java.util.Scanner;

public class Main {
  public static void main(String[] args) {
    Scanner scan = new Scanner(System.in);
    int K = scan.nextInt();
    int X = scan.nextInt();

    int max = X + K - 1;
    int sa = max - X;
    if (max > 1000000) {
      max = 1000000;
    }
    int min = X - sa;
    if (min < -1000000) {
      min = -1000000;
    }

    for (int i = min; X > i; i++) {
      System.out.print(i + " ");
    }
    for (int i = X; i < max; i++) {
      System.out.print(i + " ");
    }
    System.out.print(max);

  }

}


Measured memory_bytes: 21844