akhauriyash/Code-Regression huggingface dataset:
package main

import (
	"fmt"
)

const MOD = 1000000007

func ModAdd(a, b int64) int64 {
	return (a + b) % MOD
}

func ModMul(a, b int64) int64 {
	return a * b % MOD
}

func ModSub(a, b int64) int64 {
	r := (a%MOD - b%MOD) % MOD
	if r < 0 {
		r += MOD
	}
	return r
}

func ModDiv(a, b int64) int64 {
	return a % MOD * ModInv(b) % MOD
}

func ModPow(a, n int64) int64 {
	var r int64 = 1
	for n > 0 {
		if n&1 == 1 {
			r = r * a % MOD
		}
		a = a * a % MOD
		n >>= 1
	}
	return r
}

func ModInv(a int64) int64 {
	var b, u, v int64 = MOD, 1, 0
	for b > 0 {
		t := a / b
		a -= t * b
		a, b = b, a
		u -= t * v
		u, v = v, u
	}
	u %= MOD
	if u < 0 {
		u += MOD
	}
	return u
}

type Q struct {
	idx, value int
	a, b       int
	index      int
}

type QS []*Q

func (p QS) Len() int           { return len(p) }
func (p QS) Less(i, j int) bool { return p[i].value > p[j].value }
func (pq QS) Swap(i, j int) {
	pq[i], pq[j] = pq[j], pq[i]
	pq[i].index = i
	pq[j].index = j
}

func (pq *QS) Push(x interface{}) {
	n := len(*pq)
	item := x.(*Q)
	item.index = n
	*pq = append(*pq, item)
}

func (pq *QS) Pop() interface{} {
	old := *pq
	n := len(old)
	item := old[n-1]
	old[n-1] = nil  // avoid memory leak
	item.index = -1 // for safety
	*pq = old[0 : n-1]
	return item
}

func FactoredPrimeNumber(num int) map[int]int {
	m := map[int]int{}
	return factor(m, num, 2)
}

func factor(result map[int]int, num, pnum int) map[int]int {
	if pnum*pnum > num {
		if num != 1 {
			result[num] += 1
		}
		return result
	}

	if num%pnum == 0 {
		num /= pnum
		result[pnum]++
	} else {
		pnum++
	}
	return factor(result, num, pnum)
}

func GCD(a, b int) int {
	if b == 0 {
		return a
	}
	return GCD(b, a%b)
}

func LCM(a, b int) int {
	return a * b / GCD(a, b)
}

type P struct {
	l, r int
}

func main() {
	var S string
	fmt.Scanf("%s\n", &S)

	m := map[string]int{}

	for _, s := range []rune(S) {
		m[string(s)]++
	}
	if len(m) == 2 {
		for _, v := range m {
			if v == 2 {
				fmt.Println("Yes")
				return
			}
		}
	}

	fmt.Println("No")
}

func Reverse(runes []rune) []rune {
	for i, j := 0, len(runes)-1; i < j; i, j = i+1, j-1 {
		runes[i], runes[j] = runes[j], runes[i]
	}
	return runes
}


Measured memory_bytes: 512
import sys
from typing import Callable, List, NoReturn


def main() -> NoReturn:
    scan: Callable[[], str] = sys.stdin.readline

    n, m = map(int, scan().rstrip().split())  # type: int, int
    h: List[int] = [int(h_i) for h_i in scan().rstrip().split()]

    paths: List[List[int]] = [[] for _ in range(n)]
    for _ in range(m):
        a, b = map(int, scan().rstrip().split())  # type: int, int
        (paths[a - 1]).append(b - 1)
        (paths[b - 1]).append(a - 1)

    flags: List[bool] = [True for _ in range(n)]

    for observatory in range(n):
        if flags[observatory]:
            for adjacent in paths[observatory]:
                if h[observatory] <= h[adjacent]:
                    flags[observatory] = False
                else:
                    flags[adjacent] = False

    print(sum(flags))


if __name__ == '__main__':
    main()


Measured memory_bytes: 31444
#include <bits/stdc++.h>
#define _GLIBCXX_DEBUG
#define rep(i ,n) for(int i = 0 ; i < (n) ; i ++ )
#define all(x) (x).begin(),(x).end()
using ll = long long;
using namespace std;

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





Measured memory_bytes: 256
import sys
input = sys.stdin.readline

n = int(input())

H = list(map(int, input().split()))

can_c = [0]*n

for i in reversed(range(n-1)):

    if H[i] >= H[i+1]:
        can_c[i] += can_c[i+1] + 1

print(max(can_c))


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

const int MX = 100005;

int main() {
  int n;
  cin >> n;
  vector<ll> cnt(MX);
  rep(i,n) {
    int a;
    cin >> a;
    cnt[a]++;
  }
  ll tot = 0;
  rep(i,MX) tot += i*cnt[i];

  int q;
  cin >> q;
  rep(i,q) {
    int b, c;
    cin >> b >> c;
    tot -= b*cnt[b];
    tot -= c*cnt[c];
    cnt[c] += cnt[b]; cnt[b] = 0;
    tot += b*cnt[b];
    tot += c*cnt[c];
    cout << tot << endl;
  }
  return 0;
}


Measured memory_bytes: 4036
#include <iostream> // cout, endl, cin
#include <string> // string, to_string, stoi
#include <vector> // vector
#include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound
#include <utility> // pair, make_pair
#include <tuple> // tuple, make_tuple
#include <cstdint> // int64_t, int*_t
#include <cstdio> // printf
#include <map> // map
#include <queue> // queue, priority_queue
#include <set> // set
#include <stack> // stack
#include <deque> // deque
#include <unordered_map> // unordered_map
#include <unordered_set> // unordered_set
#include <bitset> // bitset
#include <cctype> // isupper, islower, isdigit, toupper, tolower
#include <cmath>
#include <iomanip>
#include <ctype.h>

using namespace std;
using ll = long long;
using PAIR = pair<int, int>;
using PAIRLL = pair<ll, ll>;
using vi = vector<int>;
using vvi = vector<vi>;

#define TR ","
#define rep(i,N) for(int i=0;i<(int)N;++i)

ll GCD(ll x, ll y) {
    if (y == 0) return x;
    else return GCD(y, x % y);
}

ll LCM(ll x, ll y) {
    return x / GCD(x, y) * y;
}

ll wazu = 76543217;

ll inv(ll x) {
    if (x == 1) { return 1; }
    if (x == 0) { return 0; }
    else {
        ll a = (wazu - inv(wazu % x) * (wazu / x)) % wazu;
        if (a >= 0) { return a; }
        else { return wazu + a; }
    }
}

bool my_compare(pair<string, int> a, pair<string, int> b) {
    if (a.first != b.first) {
        return a.first < b.first;
    }

    if (a.second != b.second) {
        return a.second > b.second;
    }
    else {
        return true;
    }
}

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

    if (a % x == 0) {
        cout<< b / x - a / x + 1 <<endl;
    }
    else {
        cout << b / x - a / x << endl;
    }

}

Measured memory_bytes: 256
#include <algorithm>
#include <cassert>
#include <cfloat>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <deque>
#include <iostream>
#include <limits>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <tuple>
#include <unordered_map>
#include <unordered_set>
#include <vector>
 
#define FOR(i,k,n) for (int (i)=(k); (i)<(n); ++(i))
#define rep(i,n) FOR(i,0,n)
#define all(v) begin(v), end(v)
#define debug(x) std::cerr<< #x <<": "<<x<<"\n"
#define debug2(x,y) std::cerr<< #x <<": "<< x <<", "<< #y <<": "<< y <<"\n"
 
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<vector<int> > vvi;
typedef vector<ll> vll;
typedef vector<vector<ll> > vvll;
typedef deque<bool> db;
template<class T> using vv=vector<vector< T > >;

// cout vector
template<typename T> ostream& operator<<(ostream& s, const vector<T>& v) {
  int len = v.size(); s << "\n";
  for (int i = 0; i < len; ++i) {
    s << v[i]; if (i < len - 1) s << "\t";
  }
  s << "\n"; return s;
}

// cout 2-dimentional vector
template<typename T> ostream& operator<<(ostream& s, const vector< vector<T> >& vv) {
  int len = vv.size();
  for (int i = 0; i < len; ++i) { s << vv[i]; }
  return s;
}

int main() {
  int a, b;
  cin >> a >> b;
  if (a * b % 2 == 1) {
    printf("Yes\n");
  } else {
    printf("No\n");
  }
  return 0;
}


Measured memory_bytes: 888
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main () {
    int A, B;
    cin >> A >> B;
    for (int i = 1; i <= 10000; i++) {
        int a = (long double)(i) * 0.08;
        int b = (long double)(i) * 0.10;
        if (a == A && b == B) {
            cout << i << endl;
            return 0;
        }
    }
    puts("-1");
}

Measured memory_bytes: 256
/*BISMILLAH
THE WHITE WOLF
NO DREAM IS TOO BIG AND NO DREAMER IS TOO SMALL*/

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<long long> vll;
typedef vector<int> vi;

#define io ios_base::sync_with_stdio(false)
#define pb push_back

#define eb emplace_back
#define mod   1000000007
#define PI 2*acos(0.0)
#define all(r)(r).begin(),(r).end()
#define dbg(a) cout<<#a<<" ->->->-> "<<a<<"\n"
#define inf 1000000000000000000
#define N 2000000
int dirx[] = {1, -1,0, 0}, diry[] = {0, 0, 1, -1};



//=============================================ASIFAZAD==============================================//
vi prime;
bitset<N> ck;
int vis[2000000], pp;

void seive()
{
    for(int i = 3; 1LL*i*i <= N; i+=2)
        if(ck[i] == 0)
            for(int j = i*i; j<= N; j+= 2*i)
                ck[j] = 1;
    prime.pb(2);
    for(int i = 3; i<= N; i+=2)
        if(!ck[i])
            prime.pb(i);
}

void prime_fact(int num)
{
    for(auto x: prime)
    {
        if(1LL*x*x > num)
            break;
        if(num%x == 0)
        {
            while(num%x == 0)
                num/= x;
            if(vis[x])
                pp = 0;
            vis[x] = 1;
        }
    }
    if(num > 1)
    {
        if(vis[num])
            pp = 0;
        vis[num] = 1;
    }
}

int32_t main()
{
    io;
    seive();
    pp = 1;
    int n;
    cin>>n;
    int sp = 0;
    for(int i = 0; i< n;i++)
    {
        int x;
        cin>>x;
        prime_fact(x);
        sp = __gcd(sp, x);
    }
    if(pp)
        cout<<"pairwise coprime";
    else if(sp == 1)
        cout<<"setwise coprime";
    else
        cout<<"not coprime";
    return 0;
}


Measured memory_bytes: 8152
#include <algorithm>
#include <iostream>
#include <string>
#include <vector>

using Task = std::pair<int, int>;
using Tasks = std::vector<Task>;

std::string solve(Tasks tasks)
{
  std::sort(
      tasks.begin(),
      tasks.end(),
      [](const Task& lhs, const Task& rhs) { return lhs.second < rhs.second; });
  int time = 0;
  for (const auto& t : tasks) {
    time += t.first;
    if (time > t.second) return "No";
  }

  return "Yes";
}

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

  Tasks tasks(n);
  for (auto& p : tasks) {
    std::cin >> p.first >> p.second;
  }

  std::cout << solve(std::move(tasks)) << std::endl;
}


Measured memory_bytes: 1792
'use strict';
var data = '';
process.stdin.on('end', function() {
    var inputs = data.toString().trim().split('\n');
    var params = inputs[1].split(' ').map(Number);
    var sum = params.reduce(function(a,b) {
      return a + b;
    });
    var min = params[0];
    var max = params[0];
    for (var i = 0; i < params.length; i++) {
      min = Math.min(min,params[i]);
      max = Math.max(max,params[i]);
    }

    console.log(min, max, sum);

});

process.stdin.resume();
process.stdin.setEncoding('utf8');
process.stdin.on('data', function(chunk) {
  data += chunk;
});

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

using namespace std;

#define INF 1000007
#define MOD 1000000007
#define maxn 10001
#define FOR(i, a, b) for (int i = (a); i < (b); i++)
#define rep(i, n) FOR(i, 0, n)
#define int long long
const double PI = acos(-1);
typedef pair<int, int> P;

int gcd(int a, int b)
{
    return b ? gcd(b, a % b) : a;
}

int lcm(int a, int b) { return a / gcd(a, b) * b; }

int mpow(int N, int P, int M) //繰り返し自乗法
{
    if (P == 0)
        return 1;
    if (P % 2 == 0)
    {
        int t = mpow(N, P / 2, M);
        return t * t % M;
    }
    return N * mpow(N, P - 1, M) % M;
}

int counter(int x) //bit計算
{
    if (x == 0)
        return 0;
    return counter(x >> 1) + (x & 1);
}

vector<bool> prime(maxn + 1, true); //素数テーブル
void prime_table(void)
{
    prime[0] = false;
    prime[1] = false;
    for (int i = 2; i * i <= maxn; i++)
    {
        if (!prime[i])
        {
            continue;
        }
        for (int j = i + i; j <= maxn; j += j + i)
        {
            prime[j] = false;
        }
    }
}

bool IsPrime(int num) //素数判定
{
    if (num < 2)
        return false;
    else if (num == 2)
        return true;
    else if (num % 2 == 0)
        return false;

    double sqrtNum = sqrt(num);
    for (int i = 3; i <= sqrtNum; i += 2)
    {
        if (num % i == 0)
        {
            return false;
        }
    }

    return true;
}
vector<int> divisor(int n) //約数列挙
{
    vector<int> ret;
    for (int i = 1; i * i <= n; i++)
    {
        if (n % i == 0)
        {
            ret.push_back(i - 1);
            if (i * i != n)
            {
                ret.push_back((n / i) - 1);
            }
        }
    }
    sort(ret.begin(), ret.end());
    return (ret);
}

signed main()
{
    int X, Y;
    cin >> X >> Y;
    int ans = 0;
    while (X <= Y)
    {
        X *= 2;
        ans++;
    }
    cout << ans << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
#define REP(i,n) for (ll i = 0; i < (n); ++i)
#define RREP(i, n) for (ll i = (n) - 1; i >= 0; --i)
#define ALL(v) (v).begin(), (v).end()
template<class T>
using reverse_priority_queue = priority_queue<T, vector<T>, greater<T>>;


int main(){
    ll n;
    cin >> n;
    map<string, ll> count;
    REP(i, n){
        string si;
        cin >> si;
        count[si]++;
    }
    string key[4] = {"AC", "WA", "TLE", "RE"};
    for(const auto& k : key){
        cout << k << " x " << count[k] << endl;
    }
    return 0;
}


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

using namespace std;
using ll  = long long;
using ii  = pair < int , int >;
using pll = pair < ll , ll >;
using i3  = pair < int , ii >;
using vi  = vector < int >;
using vl  = vector < ll >;
using vii = vector < ii >;
using vi3 = vector < i3 >;

const int N = 100 + 5;
const ll INF = 1e12;
const double eps = 1e-9 , PI = acos(-1);

int n;
string s[N];

void solve(){
    scanf("%d %*d" , &n);

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

    sort(s , s + n);

    for(int i = 0 ; i < n ; i ++){
        printf("%s" , s[i].c_str());
    }

}

main(){
    int t = 1;
    //scanf("%d" , &t);

    while( t -- ){
            solve();
    }

    return 0;
}





Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int r[100005];
int origin[100005];
int n,m;
/*
struct node
{
	int l;
	int r;
}order[100005];
*/
int find(int x)
{
	if(r[x]!=x)
	{
		r[x]=find(r[x]);
	}
	return r[x];
}
void _union(int a,int b)
{
	int a1=find(a);
	int b1=find(b);
	if(a1!=b1);
	r[a1]=b1;
}
int main()
{
	cin>>n>>m;
	for(int i=1;i<=n;i++)
	{
		scanf("%d",&origin[i]);
		r[i]=i;
	}
	for(int i=1;i<=m;i++)
	{
		int l,r;
		scanf("%d%d",&l,&r);
		if(find(l)!=find(r))
		_union(l,r);
	}
	int ans=0;
	for(int i=1;i<=n;i++)
	{
		//find(i);
		//find(origin[i]);
		//cout<<i<<' '<<r[i]<<endl;
		if(find(i)==find(origin[i]))
		ans++;
	}
	cout<<ans;
	
} 

Measured memory_bytes: 1024
#include<stdio.h>

int main()
{
 int S;
 int h,m,s;
 scanf("%d\n",&S);
 h=S/3600;
 m=(S-3600*h)/60;
 s=S-3600*h-60*m;
 printf("%d:%d:%d\n",h,m,s);

 return 0;

}

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

const int K = 18, N = 1<<K, M = 1e9+7;
int prod[N][K];
int a[N];

vector<pair<int, int>> vp[N];

void add(int x, int z, int mul) {
    assert(vp[x].empty() || vp[x].back().first <= z);
    if (vp[x].empty() || vp[x].back().first < z)      vp[x].push_back({z, mul});
    else {
        vp[x].back().second += mul;
        if (vp[x].back().second >= M) vp[x].back().second -= M;
    }
}

int rgt[N];

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

    int k;
    cin>>k;

    int L = 1<<(k-1), R = 2*L-1;

    for (int i=L; i<=R; i++) {
        prod[i][0] = i;
        for (int j=1; j<k; j++) {
            prod[i][j] = (1LL*prod[i][j-1]*(i>>j))%M;
        }
    }


    for (int i=L; i<2*L; i++) {
        int x;
        cin>>x;
        a[i] = x+L-1;
    }

     for (int k1=k-1; k1>=0; k1--) {
        for (int k2=k-1; k2>=0; k2--) {
            for (int i=L; i<2*L; i++) {
                int x = a[i];
                int pr = (1LL*prod[i][k1]*prod[x][k2])%M;

                int a1 = (i>>k1), a2 = (x>>k2);
                add(a2, a1, pr);
            }
        }
    }

    long long ans = 0;
    for (int i=1; i<=L; i++) {
        int ll = 2*i, rr = 2*i+1;

        for (auto pr: vp[rr])       rgt[pr.first] = pr.second;

        for (auto pr: vp[ll]) {
            int x = pr.first;
            if (x == 1) continue;
            long long con = (1LL*pr.second*rgt[x^1])%M;
            con = (con*i)%M;
            con = (con*(x>>1))%M;
            ans += con;
        }

        for (auto pr: vp[rr])       rgt[pr.first] = 0;
    }
    cout<<ans%M<<endl;
}


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

using namespace std;

int main(){
    int N,ans=0,x=0;
    cin >> N;
    vector<int> H(N);
    for(int i=0;i<N;i++){
        cin >> H[i];
    }

    for(int i=1;i<N;i++){
        if(H[i-1]>=H[i]){
            x++;
        }else{
            ans = max(ans,x);
            x=0;
        }
    }

    ans = max(ans,x);

    cout << ans << endl;
}

Measured memory_bytes: 640
#include<iostream>
#include<cstdio>
#include<cstring>
#include<cmath>
#include<algorithm>
#include<set>
using namespace std;
typedef long long LL;
const int INF=0x3f3f3f3f;
const int MAXN=1e5+5;
int a[MAXN];

int main()
{
    int n;
    while(scanf("%d",&n)!=EOF)
    {
        bool flag=false;
        int four=0,one=0,two=0;
        for(int i=1;i<=n;++i)
        {
            scanf("%d",&a[i]);
            {
                if(a[i]%4==0) four++;
                else if(a[i]%2==0) two++;
                else one++;
            }
        }
        if(one>four+1||(one==four+1&&two!=0)) printf("No\n");
        else printf("Yes\n");
    }
    return 0;
}

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

int main(){
  int n, k;
  cin >> n >> k;
  vector <int> h(n);
  for (int i = 0; i < n; i++){
    cin >> h.at(i);
  }
  sort(h.begin(), h.end(), greater<int>());
  int dif = pow(10, 9) + 1;
  for (int i = 0; i < n-k+1; i++){
    if (h.at(i)-h.at(i+k-1) < dif){
      dif = h.at(i)-h.at(i+k-1);
    }
  }
  cout << dif << endl;
}
    

Measured memory_bytes: 640
#include <iostream>
#include <sstream>
#include <iomanip>
#include <algorithm>
#include <cmath>
#include <string>
#include <vector>
#include <list>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <bitset>
#include <numeric>
#include <climits>
#include <cfloat>
using namespace std;

int main()
{
    bool first = true;
    for(;;){
        int a, b;
        cin >> a >> b;
        if(a == 0)
            return 0;

        if(!first)
            cout << endl;
        else
            first = false;

        bool na = true;
        for(int i=a; i<=b; ++i){
            if(i%400 == 0 || (i%100 != 0 && i%4 == 0)){
                cout << i << endl;
                na = false;
            }
        }
        if(na)
            cout << "NA" << endl;
    }
}

Measured memory_bytes: 0
#include <bits/stdc++.h>
#define print(...) {for(auto x: __VA_ARGS__) cout<<x<<" ";}
#define debug(...) {cout<<#__VA_ARGS__": ";print(__VA_ARGS__);cout<<endl;}
using namespace std;

// 中心を通る線を引く
long w, h, x, y;

int main() {
    cin >> w >> h >> x >> y;

    cout << fixed << setprecision(10) << (1.00 * w * h)/ 2 << " ";
    cout << (w == 2*x && h == 2*y) << endl;
}


Measured memory_bytes: 256
def resolve():
    from collections import defaultdict, deque
    N, M = [int(i) for i in input().split()]
    AABB = [[int(i) - 1 for i in input().split()] for _ in range(M)]
    dic = defaultdict(set)
    for a, b in AABB:
        dic[a].add(b)
        dic[b].add(a)
    groups = [-1 for _ in range(N)]
    group = 0
    groupmemcnt = [0 for _ in range(N)]
    for i in range(N):
        if groups[i] != -1:
            continue
        groups[i] = group
        groupmemcnt[group] += 1
        que = deque(list(dic[i]))
        while len(que) > 0:
            j = que.popleft()
            if groups[j] != -1:
                continue
            groups[j] = group
            groupmemcnt[group] += 1
            que.extend(list(dic[j]))
        group += 1
    print(max(groupmemcnt))
    return

resolve()


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

#define REP(i, n) for(int i = 0; i < (int)(n); i++)
#define INF  numeric_limits<int>::max()
#define NINF numeric_limits<int>::min()

using namespace std;
using ll = long long;

int A, B, K;

int gcd(int a, int b) {
    if(a < b) swap(a, b);
    int r = a % b;
    a = b;
    b = r;
    return (r == 0) ? a : gcd(a, b);
}

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

    std::cin >> A >> B >> K;

    int gcb = gcd(A, B);

    int cnt = 0;
    int div = 0;
    while(cnt < K) {
        div++;
        if(gcb % div == 0) {
            cnt++;
        }
    }

    std::cout << gcb / div << std::endl;

    return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <vector>
#include <set>
#include <map>
#include <cmath>
#include <ctime>
#include <string>
#include <cstring>
#include <complex>
using namespace std;

typedef long long ll;
typedef pair<int, int> pii;
#define mp make_pair


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

    ll n, a, b, c, d;
    cin >> n >> a >> b >> c >> d;
    n--;

    b -= a;

    if (d == 0) {
        if (b == 0)
            cout << "YES" << endl;
        else
            cout << "NO" << endl;
        return 0;
    }

    for (ll i = -n; i <= n; i++) {
        ll x = abs(b + i * c);
        ll y = x / d;
        ll m = n - abs(i) - y;
        if (m < 0) continue;
        x %= d;
        if (m > 0) m = 1 + (m - 1) % 2;
        if (m == 0) {
            if (x == 0) {
                cout << "YES" << endl;
                return 0;
            }
        } else if (m == 1) {
            if (c <= x && x <= d) {
                cout << "YES" << endl;
                return 0;
            }
        } else {
            if (x <= d - c) {
                cout << "YES" << endl;
                return 0;
            }
        }
    }
    cout << "NO" << endl;
    return 0;
}

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

int main(void)
{
  char w[101];
  int c['z'-'a'+1] = {0};
  
  cin >> w;
  for ( int i=0; w[i]!='\0'; i++ ) {
    c[w[i]-'a']++;
  }
  for ( int i=0; i<'z'-'a'; i++ ) {
    if ( c[i] % 2 != 0 ) {
      cout << "No" << endl;
      goto no;
    }
  }
  cout << "Yes" << endl;
  no:
  
  return 0;
}

Measured memory_bytes: 256
#pragma GCC optimize("Ofast")
#include<bits/stdc++.h>
using namespace std;
struct __INIT{__INIT(){cin.tie(0);ios::sync_with_stdio(false);cout<<fixed<<setprecision(15);}} __init;
#define max3(a,b,c) max(a,max(b,c))
#define min3(a,b,c) min(a,min(b,c))
#define MOD 1000000007
#define INF (1<<30)
#define LINF (lint)(1LL<<56)
#define endl "\n"
#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define reprev(i,n) for(int (i)=(n-1);(i)>=0;(i)--)
#define Flag(x) (1<<(x))
#define Flagcount(x) __builtin_popcount(x)
#define pint pair<int,int>
#define pdouble pair<double,double>
#define plint pair<lint,lint>
typedef long long lint;
int dx[8]={1,1,0,-1,-1,-1,0,1};
int dy[8]={0,1,1,1,0,-1,-1,-1};

lint segdata[(1<<19)-1];
lint lazy[(1<<19)-1];

lint neutral(){
    return 0; //単位元
}
lint calc(lint a,lint b){
    return a+b; //演算
}
void seginit(){
    rep(i,(1<<19)-1) segdata[i]=neutral();
}
void update(lint i,lint x){ // i番目の値をxに更新
    i+=(1<<18)-1;
    segdata[i]=x;
    while(i>0){
        i=(i-1)/2;
        segdata[i]=calc(segdata[i*2+1],segdata[i*2+2]);
    }
}
void eval(lint k,lint l,lint r){
    if(lazy[k]){
        segdata[k]+=lazy[k];
        if(r-l>1) lazy[2*k+1]+=lazy[k]/2,lazy[2*k+2]+=lazy[k]/2;
        lazy[k]=0;
    }
}
void add(lint a,lint b,lint x,lint k,lint l,lint r){
    eval(k,l,r);
    if(r<=a || b<=l) return;
    if(a<=l && r<=b){
        lazy[k]+=(r-l)*x;
        eval(k,l,r);
    }
    else{
        add(a,b,x,2*k+1,l,(l+r)/2);
        add(a,b,x,2*k+2,(l+r)/2,r);
        segdata[k]=calc(segdata[2*k+1],segdata[2*k+2]);
    }
}
lint seg(lint a,lint b,lint k,lint l,lint r){
    eval(k,l,r);
    if(r<=a || b<=l) return neutral();
    if(a<=l && r<=b) return segdata[k];
    else{
        lint left=seg(a,b,k*2+1,l,(l+r)/2);
        lint right=seg(a,b,k*2+2,(l+r)/2,r);
        return calc(left,right);
    }
}
lint query(lint a,lint b){
    return seg(a,b+1,0,0,1<<18); //a~b(閉区間）の範囲での演算
}
void rangeadd(lint a,lint b,lint x){ //a~b(閉区間)にxを加算
    add(a,b+1,x,0,0,1<<18); 
    return;
}

int main(void){
    seginit();
    lint N,D,A;
    cin >> N >> D >> A;
    plint X[N];
    lint place[N];
    lint ans=0;
    rep(i,N) cin >> X[i].first >> X[i].second;
    sort(X,X+N);
    rep(i,N) place[i]=X[i].first;
    rep(i,N) update(i,(X[i].second+A-1)/A);
    rep(i,N){
        lint hp=query(i,i);
        if(hp<=0) continue;
        ans+=hp;
        lint last=upper_bound(place,place+N,place[i]+2*D)-place;
        rangeadd(i,last-1,-hp);
    }
    cout << ans << endl;
}

Measured memory_bytes: 12672
import java.util.Scanner;
public class Main{
 public static void main(String[] args){
   Scanner sc = new Scanner(System.in);
   int N = sc.nextInt();
   int X = sc.nextInt();
   int[] Larr = new int[N];
   for(int i =1;i<=N;i++){
    Larr[i-1] = sc.nextInt(); 
   }
int sum = 0;
int count = 0;
   while(count < N && sum <= X)
   {
   sum = sum + Larr[count];
   count++;
   }
   if(sum <=X && count ==N) count++;
   System.out.println(count);
 }
}

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

int main(){
    int64_t N;
    int64_t ans;
    // int64_t mid_left,mid_right;
    //long double mid_left,mid_right;
    int64_t mid_left,mid_right;
    cin >> N;
    vector<int64_t> A(N,0);
    vector<int64_t> B(N,0);
    for(int64_t i = 0; i<N; i++){
        cin >> A.at(i) >> B.at(i);
    }
    sort(A.begin(), A.end());
    sort(B.begin(), B.end());
    if(N%2 == 0){
        // mid_left = (A.at(N/2-1)+A.at(N/2))/2;
        // mid_right = (B.at(N/2-1)+B.at(N/2))/2;
        // ans = (mid_right-mid_left)*2+1;
        ans = B.at(N/2-1)+B.at(N/2)-A.at(N/2-1)-A.at(N/2)+1;
    }else{
        mid_left = A.at((N-1)/2);
        mid_right = B.at((N-1)/2);
        ans = mid_right-mid_left+1;
    }

    cout << ans << endl;
}


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

int main() {
  int n;
  string s;
  cin >> n >> s;
  
  int count = 0;
  
  for(int i=0; i<n-2; i++) {
    if(s.at(i) == 'A' && s.at(i+1) == 'B' && s.at(i+2) == 'C')
      count++;
  }
  
  cout << count << endl;
}

Measured memory_bytes: 256
#include <cstring>
#include <cstdio>
#include <map>
#define MOD 998244353
typedef __int128 LL;
std::map<LL, int> vis[105];
int calc(int n, LL mask)
{
	if (!n)
		return 1;
	if (vis[n].count(mask))
		return vis[n][mask];
	int &res = vis[n][mask];
	res = calc(n - 1, mask >> 1) * (mask & 1 ? 2 : 1) % MOD;
	LL full = 0;
	for (int i = 1; i <= n; i++)
	{
		full = full << 1 | 1;
		LL rem = mask & full;
		for (int j = i << 1; j <= n; j += i)
		{
			rem &= mask >> j - i;
			res = (res + (long long)calc(i, rem) * calc(n - j, mask >> j)) % MOD;
		}
	}
	return res;
}
char str[105];
int main()
{
	// freopen("AGC020-E.in", "r", stdin);
	scanf("%s", str);
	int n = strlen(str);
	LL mask = 0;
	for (int i = n - 1; i >= 0; i--)
		mask = mask << 1 | str[i] - '0';
	printf("%d\n", calc(n, mask));
	return 0;
}


Measured memory_bytes: 3712
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
#define REP(i, n) for (int i = 0, i##_len = (n); i < i##_len; ++i)
#define FOR(i, a, b) for (int i = (a), i##_len = (b); i < i##_len; i++)
#define ALL(x) (x).begin(), (x).end()  // sortなどの引数を省略したい
#ifdef _DEBUG
#define PRE_COMMAND             \
    std::cin.rdbuf(in.rdbuf()); \
    std::cout << fixed << setprecision(15);
#else
#define PRE_COMMAND cout << fixed << setprecision(15);
#endif
const double EPS = 1e-10, PI = acos(-1.0);
template <class T> auto MAX(T& seq) {
    return *max_element(seq.begin(), seq.end());
}
template <class T> auto MIN(T& seq) {
    return *min_element(seq.begin(), seq.end());
}
template <class T> auto SUM(T& seq) {
    T temp{0};
    auto& temp2 = temp[0];
    return accumulate(seq.begin(), seq.end(), temp2);
}
template <class T> void SORT(T& seq) { sort(seq.begin(), seq.end()); }
template <class T, class S> void SORT(T& seq, S& sort_order) {
    sort(seq.begin(), seq.end(), sort_order);
}
template <class T> void SORTR(vector<T>& seq) {
    sort(seq.begin(), seq.end(), greater<T>());
}
template <class T, class S, class R> long long pow(T n_0, S k_0, R mod_0) {
    long long n = n_0, k = k_0, mod = mod_0, now = 1;
    while (true) {
        if (k & 1) { now = now * n % mod; }
        if ((k >>= 1) == 0) { return now; }
        n = (n * n) % mod;
    }
}
template <typename T> istream& operator>>(istream& is, vector<T>& vec) {
    for (T& x : vec) is >> x;
    return is;
}

int main() {
    PRE_COMMAND
    int n;
    cin >> n;
    vi a(n), b(n), c(n);
    vl d(n, 0);
    cin >> a >> b >> c;
    SORT(a);
    SORT(b);
    SORT(c);
    int j = 0, k = 0;
    ll ans = 0;
    while (j < n && k < n) {
        if (b[j] < c[k]) {
            d[j] = n - k;
            j++;
        } else {
            k++;
        }
    }
    for (int i = n - 2; i >= 0; i--) { d[i] += d[i + 1]; }
    int i = 0;
    j = 0;
    while (i < n && j < n) {
        if (a[i] < b[j]) {
            ans += d[j];
            i++;
        } else {
            j++;
        }
    }
    cout << ans << endl;
}

Measured memory_bytes: 5368
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <iomanip>
#include <math.h>
#include <numeric>
#include <complex>
#include <queue>
#include <deque>
#include <stack>
#include <map>
#include <unordered_map>
#include <set>
#include <bitset>
#include <functional>
#include <assert.h>
using ll=long long;
#define int ll
#define rng(i,a,b) for(int i=int(a);i<int(b);i++)
#define rep(i,b) rng(i,0,b)
#define gnr(i,a,b) for(int i=int(b)-1;i>=int(a);i--)
#define per(i,b) gnr(i,0,b)
#define eb emplace_back
#define all(x) x.begin(),x.end()
#define SZ(x) ((int)x.size())
#define fi first
#define se second
const int INF = 1e15;
using namespace std;

template<class T> using vc=vector<T>;
template<class T> using vvc=vc<vc<T>>;

using pi=pair<int,int>;
using vi=vc<int>;

template<class T>
inline bool chmax(T &a,T b){if(a<b){a=b;return true;}return false;}
template<class T>
inline bool chmin(T &a,T b){if(a>b){a=b;return true;}return false;}

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

    int N,M; cin >> N >> M;
    vi G[N];
    int H[N];
    rep(i,N) cin >> H[i];
    rep(i,M){
        int a,b; cin >> a >> b;
        a--; b--;
        G[a].eb(b);
        G[b].eb(a);
    }
    int ans=0;
    rep(i,N){
        bool can=true;
        for(auto a:G[i]){
            if(H[i]<=H[a]) can=false;
        }
        if(can) ans++;
    }
    cout << ans << endl;
}

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

int arr[100005];
int main()
{
	int n;
	cin >> n;
	for (int i = 1; i <= n; i++)
	{
		int a;
		cin >> a;
		arr[a] = i;
	}
	for (int i = 1; i <= n; i++)
	{
		cout << arr[i] << " ";
	}
}

Measured memory_bytes: 1152
#include<stdio.h>
int n,m,a[10],b[15],c[10];
int main()
{
    for(int i=1;i<=9;i++)
            scanf("%d",&a[i]);
    scanf("%d",&n);
    for(int i=1;i<=n;i++)
        scanf("%d",&b[i]);
    for(int k=1;k<=n;k++)
        for(int i=1;i<=9;i++)
            if(a[i]==b[k])
            {
                c[i]++;
                break;
            }
    if(c[1]&&c[2]&&c[3]||c[4]&&c[5]&&c[6]||c[7]&&c[8]&&c[9]||c[1]&&c[5]&&c[9]||c[3]&&c[5]&&c[7]||c[1]&&c[4]&&c[7]||c[2]&&c[5]&&c[8]||c[3]&&c[6]&&c[9])
        printf("Yes");
    else
        printf("No");
    return 0;
}

Measured memory_bytes: 128
import java.util.Scanner;

class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        boolean flag = true;
        while(flag){
            int m = sc.nextInt();
            int f = sc.nextInt();
            int r = sc.nextInt();
            
            if(m == -1 && f == -1 && r == -1){
                flag = false;
            }else {
                testResult(m,f,r);
            }
        }
    }
        static void testResult(int m,int f,int r){
            if(m+f >= 80) System.out.println("A");
            if(m+f >= 65 && m+f < 80) System.out.println("B");
            
            if(m == -1 || f == -1){
              System.out.println("F");
            }else {
               if(m+f >= 50 && m+f < 65) System.out.println("C");
               if(m+f >= 30 && m+f < 50){
                   if(r >= 50)System.out.println("C");
                   else System.out.println("D");
               } 
               if(m+f < 30) System.out.println("F");
            }
                
            }
}


Measured memory_bytes: 26408
#include "bits/stdc++.h"
using namespace std;
using ll=long long;
#define print(n) cout<<n<<endl
#define rep(i,a,n) for(ll i=a;i<n;i++)
#define ALL(s) s.begin(),s.end()
#define P pair<ll,ll>
#define vl vector<ll>
#define vi vector<int>
#define vvl vector<vector<ll>>
#define vvi vector<vector<int>>
const int M=200111;
const int inf=1000000007;
const int mod=1000000007;
const double PI = 3.1415926535897932384626433;
const long long INF=1e18;
int dx[4]={-1,0,1,0},dy[4]={0,-1,0,1};
int ddx[8]={1,-1,0,0,1,-1,-1,1},ddy[8]={0,0,1,-1,1,-1,1,-1};


struct UnionFind {
	vector<int> par;
	UnionFind(int n) : par(n, -1) { }

	int root(int x) {
		if (par[x] < 0) return x;
		else return par[x] = root(par[x]);
	}

	bool same(int x, int y) {
		return root(x) == root(y);
	}

	bool merge(int x, int y) {
		x = root(x); y = root(y);
		if (x == y) return false;
		if (par[x] > par[y]) swap(x, y); // merge technique
		par[x] += par[y];
		par[y] = x;
		return true;
	}

	int size(int x) {
		return -par[root(x)];
	}
};

vvl comb(int n) {
	vvl v(n + 1,vl(n + 1, 0));
	for (int i = 0; i < v.size(); i++) {
		v[i][0] = 1;
		v[i][i] = 1;
	}
	for (int j = 1; j < v.size(); j++) {
		for (int k = 1; k < j; k++) {
			v[j][k] = (v[j - 1][k - 1] + v[j - 1][k]);
		}
	}
	return v;
}

void sosu(ll x,bool f[]){
	ll y=x;
	for(ll i=2;i<=sqrt(y);i++){
		if(x%i==0){
			x/=i;
			f[i]=true;
			i--;
		}
	}
}

ll gcd(ll x,ll y){
	if(y)return gcd(y,x%y);
	else return x;
}

int keta(ll a){
	int ke=1;
	while(a/=10)ke++;
	return ke;
}

vector<long long> enum_divisors(long long N) {
	vector<long long> res;
	for (long long i = 1; i * i <= N; ++i) {
		if (N % i == 0) {
			res.push_back(i);
			// 重複しないならば i の相方である N/i も push
			if (N/i != i) res.push_back(N/i);
		}
	}
	// 小さい順に並び替える
	sort(res.begin(), res.end());
	return res;
}

ll zyou(ll x,ll n){
	ll y=1;
	rep(i,0,n){
		y*=x;
	}
	return y;
}


int main() {
	int x,n,p;
	bool num[103]={};
	cin>>x>>n;
	rep(i,0,n){
		cin>>p;
		num[p]=true;
	}
	int div=1000,ans=0;
	rep(i,0,102){
		if(num[i]==false){
			if(abs(x-i)<div){
				div=abs(x-i);
				ans=i;
			}
		}
	}
	print(ans);


}


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


using namespace std;

int main(){
  cin.tie(0);
  ios::sync_with_stdio(0);
  string a, b;
  cin >> a;
  cin >> b;
  for(int i = 0; i < b.size(); i++){
    cout << a[i] << b[i];
  }
  if(a.size() > b.size()){
    cout << a[a.size() - 1];
  }
  cout << "\n";
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
 
using namespace __gnu_pbds;
using namespace std;
 
typedef long long int ll;
typedef unsigned long long int sll;
typedef long double ld;
#define A 1000000007
#define D 100000000000000ll
#define B 998244353ll
#define C 1000000000000000000ll
#define M 4000
#define FAST ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define oset tree<pair<ll,ll>, null_type,greater<pair<ll,ll>>, rb_tree_tag,tree_order_statistics_node_update> 
#define pb push_back
#define pf push_front
#define pob pop_back
#define pof pop_front
#define mxe(v) *max_element(v.begin(),v.end())
#define mne(v) *min_element(v.begin(),v.end())
#define rev(v) reverse(v.begin(),v.end())
#define sor(v) sort(v.begin(),v.end())
#define bs binary_search
#define lb(v,x) lower_bound(v.begin(),v.end(),x)
#define ub(v,x) upper_bound(v.begin(),v.end(),x)
#define ve vector
#define br break
#define PI acos(-1)
#define subt cerr << "Time : " << 1000 * ((double)clock()) / (double)CLOCKS_PER_SEC << "ms\n" 

int main() 
{
    FAST;
    ll d,t,s;
    cin>>d>>t>>s;
    if(s*t>=d)
        cout<<"Yes";
    else
        cout<<"No";
    subt;
    return 0;
}

Measured memory_bytes: 3792
var input = function()
{
  return require('fs').readFileSync('/dev/stdin', 'utf8').split('\n');
};

var out = function(x,index,array)
{
  if (index != array.length -1)
  {
    require('util').print(x + " ");
  }
  else
  {
    require('util').print(x + "\n");
  }
  return x;
}


var array = input();
array[1].split(' ').reverse().forEach(out);

Measured memory_bytes: 8600
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.List;
import java.util.Scanner;
import java.util.regex.Matcher;
import java.util.regex.Pattern;


public class Main {
	static Scanner sc = new Scanner(System.in);

	public static void main (String [] args){
		//		String [][] boad = new String[4][4];
		int n = Integer.parseInt(sc.next());
//		int m = Integer.parseInt(sc.next());
		List <Integer> list = new ArrayList<Integer>();
		int b = 0;
//		int c = 0;
		String d = null;
//		for(int i = 0;i<n;i++){
//			list.add(Integer.parseInt(sc.next()));
//		}
		
		if(n==5||n==7||n==3){
			d = "YES";
		}else{
			d = "NO";
		}
		System.out.println(d);
		System.out.flush();
		sc.close();
	}
}

Measured memory_bytes: 21972
#include <bits/stdc++.h>
#define REP(i,n,N) for(int i=n;i<N;i++)
#define DREP(i,n,N) for(int i=n;i>=N;i--)
#define print(S) cout<<S<<endl;
using namespace std;

int main() {
	int a,z;
	string S;
	cin>>S;
	REP(i,0,S.size()){
		if(S[i]=='A'){
			a=i;
			break;
		}
	}
	REP(j,a+1,S.size()){
		if(S[j]=='Z'){
			z=j+1;
		}
	}
	print(z-a);
}

Measured memory_bytes: 640
// writer: w33z8kqrqk8zzzx33
#include <bits/stdc++.h>
using namespace std;
 
#define iter(i, a, b) for(int i=(a); i<(b); i++)
#define rep(i, a) iter(i, 0, a)
#define rep1(i, a) iter(i, 1, (a)+1)
#define log(a) cerr<<"\033[32m[DEBUG] "<<#a<<'='<<(a)<<" @ line "<<__LINE__<<"\033[0m"<<endl
#define all(a) a.begin(), a.end()
#define fi first
#define se second
#define pb push_back
#define mp make_pair
 
using ll=long long;
using pii=pair<int, int>;
//#define int ll
const int MOD = 1000000007;

vector<int> A;
int n;

int ansify(int el, ll lim) {
    ll v = A[el];
    if(!v) return (lim >= 0)?(A.size()-1):0;
    int l = 0, r = n-1, ans = (v < 0)?n:(-1);
    while(l <= r) {
        int mid = (l+r)/2;
        if(v*A[mid] <= lim) {
            ans = mid;
            if(v < 0) r = mid-1;
            else l = mid+1;
        } else {
            if(v < 0) l = mid+1;
            else r = mid-1;
        }
    }
    if(v < 0) {
        int cnt = 0; if(ans <= el) cnt = -1;
        cnt += (n-ans); return cnt;
    } else {
        int cnt = 0; if(el <= ans) cnt = -1;
        cnt += (ans+1); return cnt;
    }
}

ll ttt(ll lim) {
    ll ans = 0;
    rep(i, n) ans += ansify(i, lim);
    return ans/2;
}

signed main() {
    ios_base::sync_with_stdio(false); cin.tie(0);
    cin >> n;
    ll K; cin >> K;
    rep(i, n) {
        int t; cin >> t;
        A.pb(t);
    }
    sort(all(A));
    ll l = -1000000000000000009ll, r = -l, ans = r;
    while(l <= r) {
        ll mid = (l+r)/2;
        if(K <= ttt(mid)) {
            ans = mid;
            r = mid-1;
        } else l = mid+1;
    }
    cout << ans << endl;
}



Measured memory_bytes: 1528
n = gets.to_i
s = n.times.map { gets.to_i }
list = [-1]
s.each{ |a|
  if list[-1] < a
    list << a
  else
    i = (1...list.size).bsearch{ |x| list[x] >= a } - 1
    list[i + 1] = a
  end
}
puts list.size - 1

Measured memory_bytes: 10480
var x = require('fs').readFileSync('/dev/stdin', 'utf-8');

function main(input) {
  var temp = input.split(' ');
  var a = parseInt(temp[0]);
  var b = parseInt(temp[1]);
  var length = (a + b)*2;
  var area = a*b;

  console.log(area + ' ' + length);
}

main(x);


Measured memory_bytes: 15124
#include <set>
#include <map>
#include <list>
#include <queue>
#include <stack>
#include <cmath>
#include <ctime>
#include <cstdio>
#include <vector>
#include <string>
#include <bitset>
#include <cctype>
#include <cstdlib>
#include <cstring>
#include <utility>
#include <numeric>
#include <complex>
#include <sstream>
#include <regex>
#include <fstream>
#include <iomanip>
#include <cassert>
#include <iostream>
#include <iterator>
#include <algorithm>
using namespace std;
using ll = long long;
using VL=vector<ll>;

#define rep(i, n) for(int i = 0;i < n;i++)
#define repr(i, n) for(int i = n;i >= 0;i--)
#define FOR(i, m, n) for(int i = m;i < n;i++)
const long long INF =  999999999;

int main(){
  double b,ans;
  cin>>b;
  ans=2*b*M_PI;
  cout<<printf("%.6f",ans)<<endl;
}


Measured memory_bytes: 3736
#include <cmath>
#include<iostream>
#include <functional>
#include <string>
#include <sstream>
#include <vector>
#include <algorithm>
#include <stdio.h>
#include <iomanip>
using namespace std;
 
int main(){    
  long long N,W,H,count=0;
  cin >> H >> W >> N;
  long long sum=0;

  if(H<W){
    while(N>sum){
      sum += W;
      count++;
    }
  }
  if(H>=W){
    while(N>sum){
      sum += H;
      count++;
    }
  }
  cout << count <<endl;
}


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

ll a, b, c, k;

int main()
{
	ios::sync_with_stdio(false);
	cin >> a >> b >> c >> k;
	
	ll ans = 0;
	if (k - a > 0) ans += a;
	else ans = k;
	if (k - a - b > 0) ans -= (k - a - b);
	cout << ans << endl; 
	return 0;
}


Measured memory_bytes: 3636
#include <iostream>
#include <algorithm>

using namespace std;

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

	long long ans = 1;
	long long t;
	for (int i = 0; i < n; i++) {
		cin >> t;
		ans = ans / __gcd(ans, t) * t;
	}

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


Measured memory_bytes: 256
#include <iostream>
#include <math.h>

using namespace std;

int main()
{
    int e;
    while (cin >> e && e > 0)
    {
        int minimum = 1000000;
        for (int z = 0; pow(z, 3) <= e; z++)
        {
            int x = 0, y = 0;
            y = sqrt(e - pow(z, 3));
            x = e - pow(z, 3) - pow(y, 2);
            minimum = min(minimum, x + y + z);
        }
        cout << minimum << endl;
    }

    return 0;
}


Measured memory_bytes: 3232
#include <iostream>
using namespace std;
int main() {
    string s;
    cin >> s;
    int N=s.size();
    int apos,zpos;
    int i = 0;
    int j = 0;
    while ( i < N  ) {
        if (s[i]=='A'){
            apos=i;
            break;
        }
        ++i;
    }
    while (j <N) {
        if (s[N-j]=='Z'){
            zpos=N-j;
            break;
        }
        ++j;
    }
    cout << zpos - apos + 1;
    return 0;
}

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

#define ll long long
#define ldb long double
#define rep(i, x, n, j) for(int i=x;i<(int)n;i+=j)
#define F first
#define S second
#define per(i, x, n, j) for(int i=(int)n-1;i>=0;i-=j)
#define all(v) v.begin(),v.end()
#define sz(a) (int)a.size()

const int N = 2000100;
const ll MOD = 1e9+7;
const ll inf = 1e18+5;

typedef vector<int> vi;
typedef pair<int, int> pii;
typedef vector<ll> vl;
typedef pair<ll, ll> pll;

int _;

bool fxn(ll x, ll y){
	while(x>1){
		if(x%y!=0) return false;
		else x/=y;
	}
	return true;
}

int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	ll n; cin >> n;
	vector<ll> f;
	for(ll i=1; i<=sqrt(n); ++i){
		if(n%i==0){
			f.push_back(i);
			if(i!=n/i) f.push_back(n/i);
		}
	}
	sort(all(f));
	f.erase(f.begin());
	
	ll done[sz(f)]={0};
	for(int i=0; i<sz(f); ++i){
		if(done[i]!=0) continue;
		int item = f[i];
		for(int j=0; j<sz(f); ++j){
			ll g = f[j];
			if(g%item==0 && fxn(g, item)==1)
			done[j]=1;
			else if(g%item==0 && fxn(g, item)==0)
			done[j]=-1;
			else continue;
		}
		done[i]=1;
	}

	vector<ll> v;
	for(int i=0; i<sz(f); ++i){
		if(done[i]==1) v.push_back(f[i]);
	}

	sort(all(v));
	ll j=0, counter=0;

	while(n>1){
		if(n%v[j]==0){
			n/=v[j];
			++counter;
		}
		++j;
		if(j==sz(v)) break;
	}

	cout << counter << endl;
	return 0;
}


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

struct item{
    char name[20];
    int time;
};

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

    int n, q;
    queue<item> Q;
    item a, e;
    int sum = 0;

    cin >> n >> q;

    for (int i = 0; i < n; i++)
    {
        cin >> a.name >> a.time;
        
        if (a.time <= q)
        {
            cout << a.name << " " << a.time + sum << '\n';
            sum += a.time;
        }
        else
        {
            a.time -= q;
            Q.push(a);
            sum += q;
        }
    }

    while (!Q.empty())
    {
        e = Q.front();
        if (e.time <= q)
        {
            cout << e.name << " " << e.time + sum << '\n';
            Q.pop();
            sum += e.time;
        }
        else
        {
            e.time -= q;
            Q.push(e);
            Q.pop();
            sum += q;
        }
    }

    return 0;
}


Measured memory_bytes: 3384
#include <iostream>
#include <string>
#include <algorithm>
#include <functional>
#include <vector>
#include <utility>
#include <cstring>
#include <iomanip>
#include <numeric>
#include <limits>
#include <cmath>
#include <cassert>

using namespace std;
using ll = long long;

const int INF = 1<<30;
const int MOD = (int)1e9 + 7;
const int MAX_N = (int)1e5 + 5;
#define debug(x) cout << #x << ": " << x << endl

signed main(void)
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    int h, w, a, b; cin >> h >> w >> a >> b;
    int area = h * w;
    int use = (h / a) * (w / b) * a * b;
    cout << area - use << endl;
    return 0;
}




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


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

    int t1, t2;


    t1 = c / b;
    t2 = a / d;

    if(c % b != 0)
        t1++;

    if(a % d != 0)
        t2++;

    if(t1 <= t2)
        cout << "Yes";
    else
        cout << "No";






    return 0;

}


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

int main() {
    long long k;
    cin >> k;

    queue<long long> q;

    for (int i = 1; i <= 9; i++) {
        q.push((long long)i);
    }

    for (long long i = 1; i <= 100000; i++) {
        long long x = q.front();
        long long push_x = 10 * x ;
        //if(x < 100) {
            push_x += x % 10;
        //}
        q.pop();
        //cout << "pop " << x << endl;
        if(i == k) {
            cout << x << endl;
            return 0;
        }
        if(push_x % 10 != 0) {
            //cout << "push " << push_x - 1 << endl;
            q.push(push_x - 1);
        }
        q.push(push_x) ;
        //cout << "push " << push_x << endl;
        if(push_x % 10 != 9) {
            //cout << "push " << push_x + 1 << endl;
            q.push(push_x + 1);
        }
    }
}

Measured memory_bytes: 1792