akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <list>
#include <cmath>

using namespace  std;// namespace

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    int n;
    cin >> n;
    list<int> A;
    list<int>::iterator cursor = A.end();
    int command,value;
    
    for (int i = 0;i < n;++i) {
        cin >> command;
        switch(command){
            case 0:
                cin >> value;
                cursor = A.insert(cursor,value);
                break;
            case 1:
                cin >> value;
                for (int j = 0; j < fabs(value); ++j) {
                    if(value > 0){
                        cursor++;
                    }
                    else{
                        cursor--;
                    }
                }
                break;
            case 2:
                cursor = A.erase(cursor);
                break;
        }
    }
    list<int>::iterator it = A.begin();
    for(;it!=A.end();++it){
        cout << *it << endl;
    }
}


Measured memory_bytes: 18684
#include<iostream>
#include<algorithm>
#include<vector>
#include<string>
#include<map>
#include<cassert>
#include<deque>
 
using namespace std;
 
#define sz(x) (int)(x.size())
#define fr(i, a, b) for(int i=a;i<b;++i)
#define fdr(i, a, b) for(int i=b-1;i>=a;--i)
#define mp make_pair
#define pb push_back
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
 
/////////////////

int const N = 311;
int const INF = 1e9 + 41;

int f[N], ans;
int a[N][N], n, m, cnt[N];

pii getMaxi(){
	fr(i, 1, m+1) cnt[i] = 0;
	fr(i, 0, n){
		fr(j, 0, m){
			if(f[a[i][j]]){
				++cnt[a[i][j]];
				break;
			}
		}
	}
	pii ret = mp(0, 0);
	fr(i, 1, m+1){
		ret = max(ret, mp(cnt[i], i));
	}

	return ret;
}

void solve(){
	cin >> n >> m;
	fr(i, 0, n) fr(j, 0, m) cin >> a[i][j];
	ans = INF;

	fr(i, 1, m+1) f[i] = 1;
	fr(t, 0, m){
		pii p = getMaxi();
		ans = min(ans, p.first);
		f[p.second] = 0;
	}

	cout << ans << endl;
}
 
int main(){
#ifdef _DEBUG
	freopen("input.txt","r",stdin);
	freopen("output.txt","w",stdout);
#endif
 
	solve();
 
 
	return 0;
}

Measured memory_bytes: 640
#include <bits/stdc++.h>
#define pb emplace_back
#define fi first
#define se second
#define int long long
using namespace std;
mt19937_64 rang(chrono::high_resolution_clock::now().time_since_epoch().count());
int rng(int l) { uniform_int_distribution<int> uid(0, l - 1); return uid(rang); }

int32_t main() {
	ios::sync_with_stdio(false); cin.tie(NULL); cout.precision(10); srand(chrono::high_resolution_clock::now().time_since_epoch().count());
	int mod = 1e9 + 7;
	int n; cin >> n;
	int k; cin >> k;
	std::vector<int> pdp(100005, 1);
	std::vector<int> tpdp(100005, 0);
	vector<int> a(n); for (int o = 0; o < n; o++) { cin >> a[o]; }
	for (int i = 0; i < n; ++i) {
		for (int j = 0; j <= a[i]; ++j)
			tpdp[j] = pdp[j];
		for (int j = a[i] + 1; j < 100005; ++j) 
			tpdp[j] = ((pdp[j] - pdp[j - a[i] - 1]) % mod + mod) % mod;
		for (int i = 1; i < 100005; ++i) 
			tpdp[i] = (tpdp[i] + tpdp[i - 1]) % mod;
		pdp = tpdp;
	}
	if (k == 0) cout << 1;
	else
	cout << ((pdp[k] - pdp[k - 1]) % mod + mod) % mod;
}

Measured memory_bytes: 1792
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long long int llint;
typedef pair<ll, ll> pa;
#define MM 1000000000
#define MOD MM+7
#define MAX 101000
#define MAP 110
#define initial_value -1
#define Pair pair<int,int>
#define chmax(a,b) (a<b ? a=b:0)
#define chmin(a,b) (a>b ? a=b:0)
#define INF (1 << 29) //536870912
int dx[4] = {-1,0,1,0};
int dy[4] = {0,-1,0,1};
string s,t;
int main(){
    int R,G; cin >> R >> G;
    cout << 2*G - R << endl;
}



Measured memory_bytes: 256
s = input()
n = len(s)+1
l = [0]*n
r = [0]*n

for i in range(1,n):
    if s[i-1]=='<':
        l[i]=l[i-1]+1

for i in range(1,n):
    if s[-i]=='>':
        r[-i-1]=r[-i]+1

ans = 0
for i in range(n):
    ans +=max(l[i],r[i])
print(ans)


Measured memory_bytes: 51016
// abc127_a
#include <bits/stdc++.h>
using namespace std;
int main(void){
  int A, B;
  cin >> A >> B;
  if(A >= 13){
    cout << B << endl;
  }else if(A >= 6 && A <= 12){
    cout << B / 2 << endl;
  }else{
    cout << 0 << endl;
  }
  return 0;
}

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

using namespace std;

const ll mod=1000000007;
const ll inf=1e18;

int main(){

  ll n,a,b;
  cin >> n >> a >>b;
  if(n*a<=b)cout << n*a << endl;
  else cout << b<< endl;;

}

Measured memory_bytes: 3612
#include <iostream>
#include <algorithm>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <string.h>
#include <vector>
#include <queue>
#include <cmath>
#include <bitset>
#include <complex>
#include <functional>
#include <numeric>
#include <iomanip>

#define SPBR(w, n) std::cout<<(w + 1 == n ? '\n' : ' ');
#define YES cout << "YES" << endl
#define Yes cout << "Yes" << endl
#define NO cout << "NO" << endl
#define No cout << "No" << endl
#define ALL(i) (i).begin(), (i).end()
#define FOR(i, a, n) for(int i=(a);i<(n);++i)
#define RFOR(i, a, n) for(int i=(n)-1;i>=(a);--i)
#define REP(i, n) for(int i=0;i<int(n);++i)
#define RREP(i, n) for(int i=int(n)-1;i>=0;--i)
#define IN(a, x, b) (a<=x && x<b)
#define OUT(a, x, b) (x<a || b<=x)
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }

#define int ll
using ll = long long;
using ull = unsigned long long;
using ld = long double;
const int MOD = 1000000007;
/* const int MOD = 998244353; */
const int INF = 1e18;
const double PI = acos(-1);

using namespace std;
struct INIT { INIT(){
  cin.tie(0); ios::sync_with_stdio(false);
  cout << fixed << setprecision(10);
}}INIT;


signed main() {
  vector<int> x(5);
  REP(i, 5) cin >> x[i];

  REP(i, 5){
    if(x[i] == 0){
      cout << i+1 << "\n";
    }
  }

  return 0;
}


Measured memory_bytes: 3596
import sys
import copy

stdin = sys.stdin
def ns(): return stdin.readline().rstrip()
def ni(): return int(stdin.readline().rstrip())
def nm(): return map(int, stdin.readline().split())
def nl(): return list(map(int, stdin.readline().split()))


def switch(s):
    if s == '0':
        return '1'
    else:
        return '0'


def main():
    S = list(input())
    S_1 = copy.copy(S)
    S_2 = copy.copy(S)
    ans_1 = 0
    for i in range(1, len(S_1)):
        if S_1[i] == S_1[i - 1]:
            S_1[i] = switch(S_1[i])
            ans_1 += 1
    ans_2 = 1
    S_2[0] = switch(S_2[0])
    for i in range(1, len(S_2)):
        if S_2[i] == S_2[i - 1]:
            S_2[i] = switch(S_2[i])
            ans_2 += 1
    print(min(ans_1, ans_2))


if __name__ == '__main__':
    main()


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

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

#define REP(i, n) for (int i = 0; i < (int)(n); i++)
#define FOR(i, a, b) for (int i = (int)(a); i < (int)(b); i++)
#define FORR(i, a, b) for (int i = (int)(b)-1; i >= (int)(a); i--)

#define DEBUG(x) cout << #x << ": " << (x) << endl
#define DEBUG_VEC(v) cerr<<#v<<": ";REP(__i,(v).size())cerr<<((v)[__i])<<", ";cerr<<endl
#define PRINT(x) cout << x << endl
#define all(x) x.begin(),x.end()

int main() {
    int m1,d1,m2,d2;
    cin >> m1 >> d1 >> m2 >> d2;
    if(d1>d2){
        cout << 1 << endl;
    }else{
        cout << 0 << endl;
    }

}



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


// original: http://hos.ac/slides/20140319_bit.pdf
template <class T>
struct BinaryIndexedTree {
  int n;
  std::vector<T> bit;
  BinaryIndexedTree(int n): n(n), bit(n+1) {}

  void build(const std::vector<T> &v) {
    for (int x = 1; x <= n; ++x) bit[x] = v[x-1];
    for (int x = 1; x < n; ++x) bit[x + (x & -x)] += bit[x];
  }

  void add(int a, T w) { // 0-indexed
    assert(0 <= a && a < n);
    for (int x = a+1; x <= n; x += x & -x) bit[x] += w; // 1-indexed
  }

  T sum(int a) { // [0, a)
    assert(0 <= a && a <= n);
    T ret = 0;
    for (int x = a; x > 0; x -= x & -x) ret += bit[x]; // 1-indexed
    return ret;
  }

  T sum(int l, int r) { return sum(r)-sum(l); } // 0-indexed, [l, r)
};

using BIT = BinaryIndexedTree<int>;

int main() {
  int n; cin >> n;
  string s; cin >> s;
  int q; cin >> q;
  vector<BIT> bits;
  for (int i = 0; i < 26; ++i) { 
    bits.push_back((BIT){n});
  }
  vector<int> ld(n);
  for (int i = 0; i < n; ++i) {
    int d = s[i] - 'a';
    bits[d].add(i, 1);
    ld[i] = d;
  }
  for (int i = 0; i < q; ++i) {
    int type;
    cin >> type;
    if (type == 1) {
      int a; char c;
      cin >> a >> c; --a;
      int d = c - 'a';
      if (ld[a] == d) continue;
      int bd = ld[a];
      bits[bd].add(a, -1);
      bits[d].add(a, 1);
      ld[a] = d;
    }
    else {
      int l, r;
      cin >> l >> r;
      --l;
      int cnt = 0;
      for (int d = 0; d < 26; ++d) {
        int sum = bits[d].sum(l, r);
        if (sum > 0) ++cnt;
      }
      cout << cnt << endl;
    }
  }
}


Measured memory_bytes: 53764
#include <iostream>
#include <vector>
#include <utility>
using namespace std;

vector<int> v[100009];
pair<int, int> eg[100009];
long long ans[100009], s[100009];
int ds[100009];

int uf(int n)
{
	if (n == ds[n]) return n;
	return ds[n] = uf(ds[n]);
}

int main()
{
	ios::sync_with_stdio(false);
	cin.tie(0); cout.tie(0);
	int n, m; cin >> n >> m;
	for (int i = 0; i < m; i++)
		cin >> eg[i].first >> eg[i].second;
	long long p = 1LL * n * (n - 1) / 2LL;
	ans[m - 1] = p;
	for (int i = 1; i <= n; i++) {
		ds[i] = i; s[i] = 1;
	}
	for (int i = m - 1; i >= 1; i--) {
		int ua = uf(eg[i].first), ub = uf(eg[i].second);
		if (ua != ub) {
			p -= s[ua] * s[ub];
			ds[ub] = ua; s[ua] += s[ub];
		}
		ans[i - 1] = p;
	}
	for (int i = 0; i < m; i++)
		cout << ans[i] << '\n';
	return 0;
}

Measured memory_bytes: 6400
#include <iostream>
#include <string>
#include <cmath>
#include <algorithm>
#include <vector>
#include <set>
#include <map>
#include <list>
#include <stack>
#include <queue>

#define FOR(i, b, e) for(int i = (int)(b); i < (int)(e); ++i)
#define RFOR(i, b, e) for(int i = (int)(e-1); i >= 0; --i)
#define REP(i, n) FOR(i, 0, n)
#define RREP(i, n) RFOR(i, 0, n)
#define REPC(x,c) for(const auto& x:(c))
#define VS vector<string>
#define VI vector<int>
#define VVI vector<vector<int>>
#define ALL(x) (x).begin(),(x).end()
#define PAIR pair<int,int>
#define UNIQUE(v) v.erase( unique(v.begin(), v.end()), v.end() );

using  ll = long long;

using namespace std;

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

	REPC(c, s) {
		if (c == '1')cout << "9";
		else if (c == '9')cout << "1";
	}
	cout << endl;
}

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

#define INF 1e9
#define LLINF 1e18
#define pi 3.14159265358979323
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
typedef long long ll;

int gcd(int a, int b) {
    if(a % b == 0) {
        return b;
    }
    else {
        return(gcd(b, a % b));
    }
}


int main() {
    int n, h, w;
    cin >> n >> h >> w;
    cout << (n - h + 1) * (n - w + 1) << endl;
}

Measured memory_bytes: 3616
from math import ceil,floor,comb,factorial,gcd,sqrt,log2,cos,sin,tan,acos,asin,atan,degrees,radians,pi,inf
from itertools import accumulate,permutations,combinations,product,combinations_with_replacement
from collections import deque,defaultdict,Counter
from bisect import bisect_left,bisect_right
from operator import itemgetter
from heapq import heapify,heappop,heappush
from queue import Queue,LifoQueue,PriorityQueue
from copy import deepcopy
from time import time
import string
import sys
sys.setrecursionlimit(10 ** 7)
def input() : return sys.stdin.readline().strip()
def INT()   : return int(input())
def MAP()   : return map(int,input().split())
def LIST()  : return list(MAP())

n = INT()
a = sorted(LIST())

chk = True
if n % 2 == 0:
    for i in range(n):
        if a[i] != i//2 * 2 + 1:
            chk = False
else:
    for i in range(n):
        if a[i] != (i+1)//2 * 2:
            chk = False
if chk:
    ans = pow(2, n//2, 10**9+7)
    print(ans)
else:
    print(0)

Measured memory_bytes: 21552
#include <bits/stdc++.h>
 
using namespace std;
 
int main() {
    int n;
    cin >> n;
 
    if ((n & -n) == n) {
        cout << "No";
        return 0;
    }
 
    int logn = 0;
    while ((1 << (logn + 1)) - 1 <= n) logn++;

    cout << "Yes\n";
 
    for(int i = 1; i < (1 << logn) - 1; i++) {
        cout << i << " " << i + 1 << '\n'; 
        cout << n + i << " " << n + i + 1 << '\n';
    }
    cout << (1 << logn) - 1 << " " << n + 1 << '\n';
    
    int tar = -1;
    if ((n - (1 << logn) + 1) % 2) {

        int lastBit = n & - n;
        //cout << lastBit << '\n';
        tar = n ^ lastBit;
        cout << tar << " " << tar + 1 << '\n';
        cout << tar << " " << lastBit << '\n';
        cout << lastBit + 1 << " " << n + tar + 1 << '\n';
        cout << n + tar <<  " " << n + tar + 1 << '\n';
        cout << n << " " << tar << '\n';
        cout << 2 * n << " " << lastBit << '\n';
    }
    for(int i = (1 << logn); i < n; i += 2) if (i != tar) {
        cout << i << " " << i + 1 << '\n';
        cout << i + 1 << " " << 1 << '\n';
        cout << i + n << " " << 1 << '\n';
        cout << i + 1 + n << " " << i + n << '\n';
    }
}


Measured memory_bytes: 2560
#include <bits/stdc++.h>
#define fi first
#define se second
#define rep(i,n) for(int i = 0; i < (n); ++i)
#define drep(i,n) for(int i = (n)-1; i >= 0; --i)
#define srep(i,s,t) for (int i = s; i < t; ++i)
#define rng(a) a.begin(),a.end()
#define maxs(x,y) (x = max(x,y))
#define mins(x,y) (x = min(x,y))
#define limit(x,l,r) max(l,min(x,r))
#define lims(x,l,r) (x = max(l,min(x,r)))
#define isin(x,l,r) ((l) <= (x) && (x) < (r))
#define pb push_back
#define sz(x) (int)(x).size()
#define pcnt __builtin_popcountll
#define uni(x) x.erase(unique(rng(x)),x.end())
#define show(x) cout<<#x<<" = "<<x<<endl;
#define PQ(T) priority_queue<T,v(T),greater<T> >
#define bn(x) ((1<<x)-1)
#define dup(x,y) (((x)+(y)-1)/(y))
#define newline puts("")
#define v(T) vector<T>
#define vv(T) v(v(T))
using namespace std;
typedef long long int ll;
typedef unsigned uint;
typedef unsigned long long ull;
typedef pair<int,int> P;
typedef set<int> S;
typedef queue<int> Q;
typedef queue<P> QP;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vl;
typedef vector<P> vp;
inline int in() { int x; scanf("%d",&x); return x;}
const ll LINF = 1001002003004005006ll;
const int INF = 1001001001;
const int MOD = 1000000007;
#define dame { puts("-1"); return 0;}
#define yn {puts("YES");}else{puts("NO");}
  
int main() {
  int A,B;
  cin >> A >> B;
  int num = 0;
  int ans = 1;
  while(true) {
    
    if(ans >= B) {
      break;
    }
    ans += A-1;
    num++;
  }
  cout << num << endl;
  return 0;
}

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

using namespace std;

int main(){
  string s, t;
  cin>>s>>t;
  long long int ans=0;

  for(int i=0; i<s.size(); i++){
    if(s[i]!=t[i]) ans+=1; 
  }

  cout<<ans<<endl;
}


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

int main() {
  int A, B;
  cin >> A >> B;

  if ((A % 500) <= B) {
    cout << "Yes" << endl;
  }else{
    cout << "No" << endl;
  }
  // ここにプログラムを追記
}

Measured memory_bytes: 256
n=gets.to_i


arr=gets.split.map(&:to_i)
sum=arr.inject(:+)


group1=arr[0]
group2=arr[1]
group3=arr[2]
group4=sum-arr[0]-arr[1]-arr[2]




j=3
loop{
   
   if  (group4-group3).abs>(group4-arr[j]-group3-arr[j]).abs
       group3+=arr[j]
       group4-=arr[j]
       j+=1
       
     else 
         break
     end
}


left2=1
left3=2
left4=j
ans=[group1,group2,group3,group4].max-[group1,group2,group3,group4].min


(n-4).times{
    
    
    
    group2+=arr[left3]
    group3-=arr[left3]
    left3+=1
    
    loop{
        if (group2-group1).abs>(group2-arr[left2]-group1-arr[left2]).abs
            group2-=arr[left2]
            group1+=arr[left2]
            left2+=1
            
            
            
            
        else
            break
        end
        }
    
    
    
    
    
    loop{
        
        if (group4-group3).abs>(group4-arr[left4]-group3-arr[left4]).abs
            group4-=arr[left4]
            group3+=arr[left4]
            left4+=1
            
            
            
            
        else
            break
        end
        
        
        
        
        
        
    }
    
ans=[[group1,group2,group3,group4].max-[group1,group2,group3,group4].min,ans].min
    
    
    
    
    
}

p ans






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

template<class t> void vin(vector<t>& v, int n) {
    v.resize(n);
    for (int i = 0; i < n; ++i) {
        cin >> v[i];
    }
}

struct Cake {
    int b, w, d;
    Cake(int b, int w, int d) :b(b), w(w), d(d) {}
    bool operator<(const Cake& r) const {
        if (b != r.b) return b < r.b;
        else return w*d < r.w*r.d;
    }
    static bool compare_area(const Cake& c1, const Cake& c2) {
        return c1.w*c1.d < c2.w*c2.d;
    }
};

int main() {
    int n, w, d, p, s;
    while (cin >> n >> w >> d and w and d) {
        vector<Cake> c;
        c.push_back(Cake(0, w, d));
        rep(i, n) {
            cin >> p >> s;
            p--;
            sort(c.begin(), c.end());
            s = s%(c[p].w+c[p].d);
            if (s < c[p].w) {
                c.push_back(Cake(i+1, c[p].w-s, c[p].d));
                c[p] = Cake(i+1, s, c[p].d);
            }
            else {
                s -= c[p].w;
                c.push_back(Cake(i+1, c[p].w, c[p].d-s));
                c[p] = Cake(i+1, c[p].w, s);
            }
        }
        sort(c.begin(), c.end(), Cake::compare_area);
        rep(i, n) cout << c[i].w*c[i].d << " ";
        cout << c[n].w*c[n].d << endl;
    }
}


Measured memory_bytes: 3004
#include <stdio.h>
int main(void){
    char s[6];
    for (int i=0;i<6;i++){
        scanf("%c",&s[i]);
    }
    if (s[2] == s[3] && s[4] == s[5]){
        printf("Yes");
    }else{
        printf("No");
    }
}


Measured memory_bytes: 128
#include <bits/stdc++.h>
using namespace std;
#define endl "\n"
#define int long long
#define ar array<int,2>
#define inf 1000000000000000000 
int mod=1e9+7;
int min(int a,int b){return (a<b)?a:b;}
int max(int a,int b){return (a>b)?a:b;}
int fp(int a,int b){if(b==0) return 1;int x=fp(a,b/2);x=(x*x)%mod;if(b&1) x=(x*a)%mod;return x;}


const int N=1e4+5;
int d;
string s,tmp;
int sz;

int dp[N][2][101];
int pw[N];

void solve(int pos,int lm)
{
  
  if(dp[pos][lm][0]!=-1)
        return;
    
    if(pos==s.size())
    {
    //    cout<<tmp<<endl;
        for(int i=0;i<d;i++)
        dp[pos][lm][i]=0;
        dp[pos][lm][0]=1;
        return;
    }
  

    for(int i=0;i<d;i++)
        dp[pos][lm][i]=0;

    int l=0;
    int r=9;

    if(lm)
        r=s[pos]-'0';

    for(int i=l;i<=r;i++)
    {
       // tmp.push_back(i+'0');
        int nlm=0;
        if(lm&&i==r)
            nlm=1;
        solve(pos+1,nlm);
        for(int j=0;j<d;j++)
        {
            int x=(i+j)%d;
            dp[pos][lm][x]+=dp[pos+1][nlm][j];
            if(dp[pos][lm][x]>=mod)
                dp[pos][lm][x]-=mod;
        }
    }
}

signed main() {
 ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL); 
 memset(dp,-1,sizeof(dp));
 int n;
 cin>>s>>d;
 sz=s.size();
 pw[0]=1;
 for(int i=1;i<=sz;i++)
    pw[i]=(pw[i-1]*10)%d;
 solve(0,1);
 int ans=(dp[0][1][0]-1+mod)%mod;
 cout<<ans<<endl;
}

Measured memory_bytes: 20576
w,h,n = map(int,input().split())
#x_list = [int(1) for i in range(w+1)]
#y_list = [int(1) for i in range(h+1)]
#print(x_list)
#print(y_list)
min_x = 0
max_x = w
min_y = 0
max_y = h
for i in range(n):
    x,y,a = map(int,input().split())
    if a==1:
        min_x = max(min_x,x)
    elif a==2:
        max_x = min(max_x,x)
    elif a==3:
        min_y = max(min_y,y)
    else:
        max_y = min(max_y,y)
if min_x > max_x or min_y > max_y:
    print(0)
else:
    print((max_x-min_x)*(max_y-min_y))

Measured memory_bytes: 9100
h,n = map(int,input().split())
a = [0]*n
for i in range(n):
    a[i] = list(map(int,input().split()))
dp = [float("Inf")]*(h+1)
dp[0] = 0
for i in range(h):
    for A,B in a:
        dp[min(i+A,h)] = min(dp[min(i+A,h)],dp[i]+B)
print(dp[-1])

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

int main(){
	int a,b,c,d,e,k;
	cin>>a>>b>>c>>d>>e;
	cin>>k;
/*	if(b-a<=k && c-b<=k && d-c<=k && e-d<=k){
		cout<<"Yay!";
	}	else{
		cout<<":(";
	}*/
	
	if(e-a>k){
		cout<<":(";
	}	else{
		cout<<"Yay!";
	}
	return 0;
}


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

typedef long long ll;

ll pow_ans(ll x, ll n) {
    ll res = 1;
    while (n > 0) {
        x %= 1000000007;
        if (n & 1) { res *= x, res %= 1000000007;}
        x %= 1000000007;
        x *= x;
        n >>= 1;
    }
    return res;
}

int main() {
    ll x;
    ll y;
    cin >> x >> y;
    cout << pow_ans(x, y) % 1000000007 << endl;
}


Measured memory_bytes: 3096
#include <stdio.h>
#include <math.h>

typedef struct{
  double x;
  double y;
}Point;


void Kohho(Point,Point,int);


int main(){
  Point a,b;
  int n;

  scanf("%d",&n);

  a.x=0;
  a.y=0;
  b.x=100;
  b.y=0;

printf("%.8f %.8f\n",a.x,a.y);
Kohho(a,b,n);
printf("%.8f %.8f\n",b.x,b.y);

return 0;
}

void Kohho(Point a,Point b,int d){
  Point s,t,u;
  double th;
  th=M_PI*60.0/180.0;

  if(d==0)return ;

s.x=(2.0*a.x+1.0*b.x)/3.0;
s.y=(2.0*a.y+1.0*b.y)/3.0;
t.x=(1.0*a.x+2.0*b.x)/3.0;
t.y=(1.0*a.y+2.0*b.y)/3.0;
u.x=(t.x-s.x)*cos(th)-(t.y-s.y)*sin(th)+s.x;
u.y=(t.x-s.x)*sin(th)+(t.y-s.y)*cos(th)+s.y;

Kohho(a,s,d-1);
printf("%.8f %.8f\n",s.x,s.y);
Kohho(s,u,d-1);
printf("%.8f %.8f\n",u.x,u.y);
Kohho(u,t,d-1);
printf("%.8f %.8f\n",t.x,t.y);
Kohho(t,b,d-1);
}

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

int main() {
  int a,b,c;
  vector<int> d(3);
  rep(i,3){
    cin>>d[i];
  }
  sort(d.begin(),d.end());
  a=d[0];b=d[1];c=d[2];
  int ans=0;
  while(a<c-1){
    a+=2;
    ans++;
  }
  while(b<c-1){
    b+=2;
    ans++;
  }
  if(a==c&&b==c){}
  else if(a!=c&&b!=c){
    ans++;
  }else{
    ans+=2;
  }
  cout<<ans<<endl;
}

Measured memory_bytes: 256
#include<vector>
#include<iostream>
#include<stdio.h>
#include<stdlib.h>
#include <iostream>
#include <algorithm>
#include <map>
#include <cmath>
#define INF 100000000000000
using namespace std;
typedef long long llong;

//int isalpha(char ch): ch がアルファベットなら true を返す
//int isdigit(char ch): ch が数字なら true を返す
//int islower(char ch): ch が小文字なら true を返す
//int isupper(char ch): ch が大文字なら true を返す
//int tolower(char ch): ch の小文字を返す
//int toupper(char ch): ch の大文字を返す

//string型
//size()	文字数を返す
//insert()	（指定した場所に）文字・文字列を挿入する
//erase()	（指定した場所の）文字・文字列を削除する
//clear()	すべての文字を削除する
//substr()	文字列の（指定した）部分文字列を返す
//replace()	（指定した）部分文字列を新しい文字列に置換する
//文字列の比較は、<=や==などを使え
//replace関数を使い、簡単に文字列を置換
//リバース関数：reverse(str.begin(), str.end());
//map<type, type> dict;で宣言
//グラフ理論用変数
//vector<vector<llong> > graph(N);

//ソート
//降順sort(v.begin(), v.end(), std::greater<Type>());

int main(){
    llong ans=0;

    llong N,M;
    llong A,B;
    char flg;
    cin >> N >> M;
    llong H[N];
    vector<vector<llong> > graph(N);
    for(int i=0; i<N; i++){
        cin >> H[i];
    }
    for(int i=0; i<M; i++){
        cin >> A >> B;
        graph[A-1].push_back(B-1);
        graph[B-1].push_back(A-1);
    }
    for(int i=0; i<N; i++){
        flg = 0;
        for(int j=0; j<graph[i].size(); j++){
            if(H[i]<=H[graph[i][j]]){
                flg = 1;
                break;
            }
        }
        //そもそも辺が存在しない場合
        if(graph[i].size()==0){
            flg = 0;
        }
        if(flg==0){
            ans++;
        }
    }
    cout << ans << endl;
}

Measured memory_bytes: 9484
#include <iostream>
#include <string>
#include <vector>
#include <map>
#include <algorithm>
#include <cmath>
#include <sstream>
#include <iomanip>
#include <set>
using namespace std;
typedef long long int ll;

#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define YES cout << "YES" << endl
#define Yes cout << "Yes" << endl
#define yes cout << "yes" << endl
#define NO cout << "NO" << endl
#define No cout << "No" << endl
#define no cout << "no" << endl

const int INF = 1001001001;
const int mod = 1000000007;
#define PI 3.14159265359;

void P(int x) {cout << x << endl;}
void P(long x) {cout << x << endl;}
void P(double x) {cout << x << endl;}
void P(ll x) {cout << x << endl;}
void P(string x) {cout << x << endl;}
void P(char x) {cout << x << endl;}

ll gcd(ll a, ll b) { return b?gcd(b,a%b):a;}
ll lcm(ll a, ll b) { return a/gcd(a,b)*b;}

int main() {
  int p, q, r;
  cin >> p >> q >> r;
  int ans = p + q + r - max({p, q, r});
  P(ans);

  return 0;

}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

#define sf scanf
#define pf printf
#define pb push_back
#define mp make_pair
#define PI ( acos(-1.0) )
#define mod 998244353LL
#define IN freopen("nocross.in","r",stdin)
#define OUT freopen("nocross.out","w",stdout)
#define FOR(i,a,b) for(i=a ; i<=b ; i++)
#define DBG pf("Hi\n")
#define INF 2000000000
#define i64 long long int
#define eps (1e-8)
#define xx first
#define yy second
#define off 2
#define sq(x) ((x)*(x))

using namespace __gnu_pbds;
using namespace std ;

typedef tree< pair<i64,i64>, null_type, less< pair<i64,i64> >, rb_tree_tag, tree_order_statistics_node_update> ordered_set;

#define maxn 300005

vector < pair<int,int> > vp ;
int cnt[105] ;

int main()
{
    int i , j , k , l , m , n ;

    scanf("%d",&n) ;

    for( i=1 ; i<=n ; i++ )
    {
        int a ;
        scanf("%d",&a) ;
        cnt[a]++ ;
        vp.pb( mp(a,i) ) ;
    }

    sort(vp.begin(),vp.end()) ;

    int mxDis = vp.back().xx ;

    int fl = 1 ;
    if( (mxDis%2==0 && cnt[mxDis/2]!=1) || ( mxDis%2==1 && cnt[ (mxDis+1)/2 ]!=2 ) )
    {
        fl = 0 ;
    }
    int ret = 0 ;
    for(i=(mxDis+1)/2 + 1 ; i<= mxDis ; i++)
    {
        ret += cnt[i] ;
        if( cnt[i]<2 )
        {
            fl = 0 ;
        }
    }
    ret += cnt[ (mxDis+1)/2 ] ;

    if(ret<n) fl = 0;
    if(fl==0)
    {
        printf("Impossible\n") ;
        return 0;
    }

    printf("Possible\n") ;

    return 0 ;
}


Measured memory_bytes: 256
import java.util.Scanner;

public class Main implements Runnable {

    private static int MOD = 1_000_000_007;

    public static void main(String[] args) {
        // Run with 32MB stack
        Thread thread = new Thread(null, new Main(), "", 32 * 1024 * 1024);
        thread.start();
    }

    @Override
    public void run() {
        final Scanner scanner = new Scanner(System.in);
        solve(scanner);
    }

    static void solve(Scanner scanner) {
        long A = Integer.parseInt(scanner.next());
        long B = Integer.parseInt(scanner.next());
        long ans = A * B / gcd(A, B);
        System.out.println(ans);
    }

    static long gcd(long x, long y) {
        if (x < y) {
            return gcd(y, x);
        }
        if (y == 0) {
            return x;
        }
        return gcd(y, x % y);
    }
}


Measured memory_bytes: 24020
def main():
    N = int(input())
    s = 0
    for i in range(1, N+1):
        if i % 3 == 0 and i % 5 == 0:
            pass
        elif i % 3 == 0:
            pass
        elif i % 5 == 0:
            pass
        else:
            s += i
    print(s)
main()

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

int main() {
  int n,x;
  cin >>n >>x ;
   
  vector<int>l(n,0);
  for(int i=0; i<n; i++){
    cin >>l[i];
  }
  
  int sum =0;
  int count =1;
  
  for(int i=0; i<n; i++){
    sum+=l[i];
    if(sum<=x){
      count++;
    }
    else{
      break;
    }
  }
  cout <<count <<endl;
}		

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

char data[2048][2048];
int danger[2048][2048];
struct Pt{int w, h;};
//int stk[2048];
int biggest[2048];
Pt stk[2048];
void handle(int& top, int& ans, int a, int b, int h)
{
  while (top > 1 && h < stk[top-1].h)
  {
    int w = a - stk[top-2].w;
    int h = stk[top-1].h;
    int s = w * h;
    if (s > ans) ans = s;
    --top;
  }
  stk[top++] = {b, h};
}
int main()
{
  int h, w; scanf("%d %d", &h, &w);
  for (int i = 0; i < h; ++i) scanf("%s", data[i]);
  for (int i = 1; i < h; ++i)
    for (int j = 1; j < w; ++j)
    {
      int c = 0;
      c ^= data[i-1][j-1] == '#';
      c ^= data[i-1][j] == '#';
      c ^= data[i][j-1] == '#';
      c ^= data[i][j] == '#';
      danger[i][j] = c;
    }
  int ans = max(h, w);
  for (int i = 1; i < h; ++i)
  {
    for (int j = 1; j < w; ++j)
    if (danger[i][j]) biggest[j] = i;
    int top = 0;
    int total = 0;
    stk[top++] = {0, 0};
    for (int j = 0; j < w;)
    {
      if (biggest[j] > 0) handle(top, ans, j, j, i - biggest[j] + 1);
      int k = j;
      while (k + 1 < w && biggest[k+1] == 0) ++k;
      handle(top, ans, j, k + 1, i + 1);
      j = k + 1;
    }
    while (top > 1)
    {
      --top;
      int s = stk[top].h * (w - stk[top-1].w);
      if (s > ans) ans = s;
    }
  }
  printf("%d\n", ans);
  return 0;
}

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

using u32 = uint32_t;
using u64 = uint64_t;
using i32 = int32_t;
using i64 = int64_t;

int main()
{
	std::ios_base::sync_with_stdio(0);
	
	u32 n;

	std::cin >> n;

	std::vector<u32> v;
	v.reserve(n);

	for(u32 i=0; i<n; i++)
	{
		u32 x;
		std::cin >> x;
		v.push_back(x);
	}

	u64 ans = 0;

	std::sort(v.begin(), v.end());

	for(u32 a=0; a<n; a++)
	{
		for(u32 b=a+1; b<n; b++)
		{
			/*for(u32 c=b+1; c<n; c++)
			{
				if(a == b || b == c) continue;
				if((v[a] < v[b] + v[c]) && (v[b] < v[a] + v[c]) && (v[c] < v[b] + v[a]))
				{
					std::clog << v[a] << " " << v[b] << " " << v[c] << "\n";
					ans++;
				}
			}*/
			
			auto sum = v[a]+v[b];
			
			auto ub = std::lower_bound(v.begin()+b, v.end(), sum);
			ub--;
			if(*ub==sum) ub--;
			/*std::clog << v[a] << " " << v[b] << " ";
			if(ub == v.end()) std::clog << "inf";
			else std::clog << *ub;*/
			auto num = std::distance(v.begin()+b, ub);
			ans+=num;
			//std::clog << " " << num << "\n";
		}
	}

	std::cout << ans << "\n";
	
	return 0;
}

Measured memory_bytes: 256
import java.util.*;

/**
 * Created by Santa on 2016/10/16.
 */
public class Main {

    static int N;
    static int A;
    static long B;
    static long C;
    static int[] map = new int[1000000];
    static int min = 9994999;




    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);

        int N = scanner.nextInt();
        int ans = 0;
        for (int i = 0; i < N; i++) {
            long temp = scanner.nextInt();

            while(temp > 0){
                if(temp % 2 == 0){
                    temp /= 2;
                    ans++;
                }else{
                    break;
                }
            }
        }

        System.out.println(ans
        );


    }

}



Measured memory_bytes: 39300
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ConsoleApp3
{
    class Program
    {
        static void Main(string[] args)
        {
            Main main = new Main();
            main.Calc();
        }
    }
    class Main { 

        public void Calc()
        {
            var input = Console.ReadLine().Split().Select(int.Parse).ToList();
            var A = input[0];
            var B = input[1];
            var K = input[2];
            var cnt = 0;
            var ans = 0;
            for(var i = 1000;0 < i; i--)
            {
                if(A % i == 0 && B % i == 0)
                {
                    cnt++;
                    if (cnt == K)
                    {
                        ans = i;
                        break;
                    }
                }
            }
            Console.WriteLine(ans);
            Console.ReadLine();
        }
    }
}


Measured memory_bytes: 13268
#include <cstdio>
#include <iostream>
#include <algorithm>
#include <cstring>
#include <vector>
#include <set>
#include <map>
#include <cmath>
#include <list>
#include <ctime>
#include <sstream>
#include <queue>
#include <stack>
#include <bitset>
#include <numeric>
#include <cassert>
using namespace std;
typedef vector<int> vi;
typedef pair<int,int> pii;
typedef long long ll;
#define FOR(x, b, e) for(int x=(b); x<=(e); ++x)
#define FORD(x, b, e) for(int x=((int)(b))-1; x>=(e); --x)
#define REP(x, n) for(int x=0; x<(n); ++x)
#define ALL(c) c.begin(),c.end()
#define sz(x) ((int)((x).size()))
#define pb push_back
#define st first
#define nd second
#define mp(x,y) make_pair(x,y)
typedef short int sint;

#define sim template < class c
#define ris return * this
#define dor > debug & operator <<
#define eni(x) sim > typename \
  enable_if<sizeof dud<c>(0) x 1, debug&>::type operator<<(c i) {
sim > struct rge { c b, e; };
sim > rge<c> range(c i, c j) { return rge<c>{i, j}; }
sim > auto dud(c* x) -> decltype(cerr << *x, 0);
sim > char dud(...);
struct debug {
#ifdef LOCAL
~debug() { cerr << endl; }
eni(!=) cerr << boolalpha << i; ris; }
eni(==) ris << range(begin(i), end(i)); }
sim, class b dor(pair < b, c > d) {
  ris << "(" << d.first << ", " << d.second << ")";
}
sim dor(rge<c> d) {
  *this << "[";
  for (auto it = d.b; it != d.e; ++it) {
	*this << ((it != d.b) ? ", " : "") << *it;
  }
  ris << "]";
}
#else
sim dor(const c&) { ris; }
#endif
};
#define imie(...) " [" << #__VA_ARGS__ ": " << (__VA_ARGS__) << "] "

int main() {
	ios_base::sync_with_stdio(false);


	long long x, sum = 0;
	cin >> x;
	for (int i = 1; i<=x;++i) {
		if (i % 3 == 0 || i%5 == 0) {
			continue;
		}
		sum += i;
	}
	cout << sum << endl;
}

Measured memory_bytes: 3640
#include<bits/stdc++.h>
#define ll long long
#define mo 1000000007
using namespace std;
template <typename T> void read(T &x){
	x=0;char c=getchar();int fh=1;
	while (!isdigit(c)){if (c=='-')fh=-1;c=getchar();}
	while (isdigit(c))x=x*10+c-'0',c=getchar();
	x*=fh;
}
int dp[200010],n,a[200010],ansn;
int main(){
	read(n);dp[0]=1;
	for (int i=1;i<=n;i++) read(a[i]);
	for (int i=1;i<=n;i++) if (a[i]!=a[i-1])dp[a[i]]=(dp[a[i]]+dp[a[i-1]])%mo;
	cout<<dp[a[n]]<<endl;
	return 0;
}


Measured memory_bytes: 1792
#!/usr/bin/env/ python3
N = int(input())
S = input()
#A, B, C = input().split()
#A, B, C, X, Y = map(int, input().split())

#N = int(input())
#H, W = map(int, input().split())
#S = [input() for _ in range(H)]
#print(A[0][0])

ans = 0
for tmp_num in range(1000):
    tmp = str(tmp_num).zfill(3)
    digit = 0
    for i in range(N):
        if S[i] == tmp[digit]:
            digit += 1
            if digit == 3:
                ans += 1
                break
print(ans)


Measured memory_bytes: 42492
// STRIVER_79 
// Lets goto the next level 
// AIM 6* at CC and CM at CF *__* 

#include <algorithm>
#include <bits/stdc++.h>
#include <unordered_map>
#include <unordered_set>
using namespace std;
#define mod (int)(1e9 + 21)
#define all(a) a.begin(),a.end()
#define for0(i, n) for (int i = 0; i < n; i++)
#define for1(i, n) for (int i = 1; i <= n; i++)
#define loop(i,a,b) for (int i = a; i < b; i++)
#define bloop(i,a,b) for (int i = a ; i>=b;i--)
#define tc(t) int t; cin >> t; while (t--)
#define int long long
#define ll long long 
#define pb emplace_back
#define fio ios_base::sync_with_stdio(false), cin.tie(NULL)
#define in(x) scanf("%intd", &x)
#define rr return 0
#define prec(n) fixed<<setprecision(n)
#define maxheap priority_queue<int>
#define minheap priority_queue<int, vector<int>, greater<int> >
#define inf (int)(1e18)
#define ini(a, i) memset(a, i, sizeof(a))
#define fi first
#define se second
#define kitna se
#define endl "\n"
#define pi pair<int, int>
#define LL long long 
const int MAXN = (int)((1e5) + 10);
int gcd(int a,int b) { if (a == 0) return b; return gcd(b%a, a);}
int max(int a,int b){if(a>b) return a; else return b;}
int min(int a,int b){if(a<b) return a; else return b;}  
bool isPrime(int N){ for(int i=2;i*i<=N;++i){if(N%i==0) return false;}return true;}
int cbrt(int x){ int lo=1,hi=min(2000000ll,x);while(hi-lo>1){int mid=(lo+hi)/2;if(mid*mid*mid<x){lo=mid;}else hi=mid;}if(hi*hi*hi<=x) return hi;else return lo;} 
const int dx[4] = {-1, 1, 0, 0};
const int dy[4] = {0, 0, -1, 1};
const int nax =  (int)(1*1e5+10);

// int SPF[N+5];

// void SOF()
// {
//     SPF[1] = 1;
//     for (int i=2; i<N; i++)
//         SPF[i] = i;
//     for (int i=4; i<N; i+=2)
//         SPF[i] = 2;
 
//     for (int i=3; i*i<N; i++)
//         {
//         if (SPF[i] == i)
//             {
//             for (int kon=i*i; kon<N; kon+=i)
//                 if (SPF[kon]==kon)
//                    SPF[kon] = i;
//             }
//         }
// }
int a[nax][3];
int n; 
int dp[nax][3]; 

int func(int ind, int kon)
{
	if(ind==n) return 0; 
	if(dp[ind][kon]!=-1) return dp[ind][kon]; 
	int ans = -1e9+5; 
	if(kon==0)
	{
		ans = max(ans,a[ind][1] + func(ind+1,1)); 
		ans = max(ans,a[ind][2] + func(ind+1,2)); 
	}
	else if(kon==1)
	{
		ans = max(ans,a[ind][0] + func(ind+1,0)); 
		ans = max(ans,a[ind][2] + func(ind+1,2)); 
	}
	else 
	{
		ans = max(ans,a[ind][1] + func(ind+1,1)); 
		ans = max(ans,a[ind][0] + func(ind+1,0)); 
	}

	return dp[ind][kon]=ans;
}





signed main(){
// #ifndef ONLINE_JUDGE
//   // for getting input from input.txt
//   freopen("input.txt", "r", stdin);
//   // for writing output to output.txt
//   // freopen("output.txt", "w", stdout);
//   #endif
// fio;
int t=1; 
//cin >> t;
// string s; 
// getline(cin,s);

while(t--)
{
	ini(dp,-1);
    cin >> n;
    for0(i,n)
    {
    	for0(j,3)
    	cin >> a[i][j]; 
    }

    cout << max(func(0,0),max(func(0,1),func(0,2)));

}

rr;
}

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

using namespace std;

int main() {
    int N, K, C;
    cin >> N >> K >> C;
    string S;

    cin >> S;
    int L[200000] = {}, R[200000] = {};
    int cnt = 1;
    for (int i = 0; i < N; ++i) {
        if (S[i] != 'x') {
            L[i] = cnt;
            i += C;
            if (cnt >= K) {
                break;
            } else{
                cnt++;
                continue;
            }
        }
    }

    for (int i = N - 1; i >= 0; --i) {
        if (S[i] != 'x') {
            R[i] = cnt;
            cnt--;
            i -= C;
            if (cnt <= 0) {
                break;
            }
        }
    }

    for (int i = 0; i < N; ++i) {
        if (L[i] == R[i] && L[i] != 0) {
            cout << i + 1 << endl;
        }
    }
    return 0;
}


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

#define int long long

const int inf = 2e18;

map<pair<int, int>, int> dp;


int n, W;

int last;

int go(int pos, int value, int bal_w) {
    
}
        

int32_t main() {
    cin >> n >> W;
    vector<pair<int, int> > data;
    int maxv = 0;

    for(int i = 0; i < n; i++) {
        int w, v;
        cin >> w >> v;
        data.push_back({w, v});
        maxv += v;
    }

    vector<int> cur(maxv + 1, inf), next(maxv + 1, inf);
    cur[0] = 0;
    for(int i = 0; i < n; i++) {
        for(int j = 0; j <= maxv; j++) {  
            int v = data[i].second, w = data[i].first;  
            next[j] = min(next[j], cur[j]);
            next[j + v] = min(next[j + v], w + cur[j]);
        }
        cur = next;
    }

    int ans;
    for(int i = 0; i <= maxv; i++) {
        if(cur[i] != inf and cur[i] <= W) {
            ans = i;
        }
    }
    cout << ans;
}



Measured memory_bytes: 1792
Module Program
  Sub Main
    Dim s=GetInts()
    Dim x=s(0),a=s(1),b=s(2)
    Dim ans=If(b-a<=0,"delicious",If(b-a<=x,"safe","dangerous"))
    Console.WriteLine(ans)
  End Sub
  
  '/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
  Function Gets() As String()
    Gets = Console.ReadLine().Split(" "c)
  End Function
  Function GetInts() As Integer()
    Dim s = Gets(), r(UBound(s)) As Integer
    For i As Integer=0 To UBound(s): r(i)=s(i): Next i
    GetInts = r
  End Function
End Module

Measured memory_bytes: 22352
#include<stdio.h>
#include<iostream>
#include<iomanip>
#include<string>
#include<vector>
#include<queue>
#include<stack>
#include<map>
#include<set>
#include<algorithm>
#include<string>
#include<math.h>
#include<numeric>
#include<complex>
#include<ctype.h>

using namespace std;
typedef long long ll;

#define REP(i,n) for(int i=0;i<n;++i)
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define ALL(v) (v).begin(), (v).end()
#define p(s) cout<<(s)<<endl
#define p2(s, t) cout << (s) << " " << (t) << endl
#define pn(s) cout << (#s) << " " << (s) << endl

const ll mod = 1e9 + 7;
const ll inf = 1e18;

void pV(vector<ll> A){
    cout << "[vector]" << endl;
    for(int i=0; i<A.size(); i++){
        cout << A[i] << " ";
    }
    cout << endl;
}

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    
    // input
    int x, y;
    cin >> x >> y;

    p(x + y/2);
    
    return 0;
}

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

typedef long long ll;
typedef long double ld;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vll;
typedef vector<vll> vvll;
typedef vector<char> vc;
typedef vector<vc> vvc;
typedef vector<pii> vpii;
typedef vector<pair<ll,ll> > vpll;
typedef vector<vector<pair<ll,ll> > > vvpll;
typedef vector<bool> vb;
typedef map<int,int> mii;
typedef map<char,int> mci;
typedef map<ll,ll> mll;

#define FIO ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define all(x) x.begin() , x.end()
#define pb push_back
#define bs binary_search
#define lb lower_bound
#define ub upper_bound
#define mp make_pair
#define F first
#define S second
#define left (node << 1)
#define right (node << 1) + 1
// #define mod 998244353
#define mod 1000000007 

#define trace1(x)                       cerr<<#x<<": "<<x<<endl
#define trace2(x, y)                    cerr<<#x<<": "<<x<<" | "<<#y<<": "<<y<<endl
#define trace3(x, y, z)                 cerr<<#x<<": " <<x<<" | "<<#y<<": "<<y<<" | "<<#z<<": "<<z<<endl
#define trace4(x, y, z , t)             cerr<<#x<<": " <<x<<" | "<<#y<<": "<<y<<" | "<<#z<<": "<<z<<" | "<<#t<<": "<<t<<endl
#define trace5(x, y, z , t , u)         cerr<<#x<<": " <<x<<" | "<<#y<<": "<<y<<" | "<<#z<<": "<<z<<" | "<<#t<<": "<<t<<" | "<<#u<<": "<<u<<endl
#define trace6(x, y, z , t , u , v)     cerr<<#x<<": " <<x<<" | "<<#y<<": "<<y<<" | "<<#z<<": "<<z<<" | "<<#t<<": "<<t<<" | "<<#u<<": "<<u<<" | "<<#v<<": "<<v<<endl

#define repa(i,sta,end,inc) for(int i = sta ; i <= end ; i += inc)
#define repb(i,sta,end,inc) for(int i = sta ; i >= end ; i -= inc)

ll power(ll x , ll y , ll z){ll res = 1;x %= z;while(y){if(y&1){res = res * x % z;}x = x*x % z;y /= 2;}return res%z;}
ll gcd(ll a , ll b){return (b == 0 ? a : gcd(b , a % b));}

const int N = 2 * 100000 + 5;
const int inf = (1<<30);

void solve(){
    double r , pi = 3.14159265359;
    cin >> r;
    cout << setprecision(10) << 2*pi*r << endl;
}


int main(){
    FIO;
    int T = 1;
    // cin >> T;
    repa ( i , 1 , T , 1){
        solve();
    }
    return 0;
}


Measured memory_bytes: 3796
#include <bits/stdc++.h>
using namespace std;
#define REP(i, n) for(int i = 0; i < (n); i++)
#define REPR(i, n) for(int i = n - 1; i >= 0; i--)
#define FOR(i, m, n) for(int i = m; i < n; i++)
#define FORR(i, m, n) for(int i = m; i >= n; i--)
#define SORT(v, n) sort(v, v+n);
#define VSORT(v) sort(v.begin(), v.end());
#define ll long long
#define pb(a) push_back(a)

ll mod = 1e09;

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

  ll w, h, n;
  cin >> w >> h >> n;

  ll x[n], y[n], a[n];

  ll xmax = w, xmin = 0, ymax = h, ymin = 0;

  REP(i, n){
    cin >> x[i] >> y[i] >> a[i];
    if(a[i] == 1) xmin = max(xmin, x[i]);
    else if(a[i] == 2) xmax = min(xmax, x[i]);
    else if(a[i] == 3) ymin = max(ymin, y[i]);
    else ymax = min(ymax, y[i]);
  }

  if(xmax <= xmin || ymax <= ymin) cout << 0;
  else{
    ll ans = (xmax - xmin) * (ymax - ymin);
    cout << ans << endl;
  }



  return 0;
}


Measured memory_bytes: 256
/* Author - thiolhub */

#include <bits/stdc++.h>

using namespace std;

#define ll              long long int
#define ld              long double
#define db              double
#define pi              3.1415926535897932384626
#define PI              acos(-1.0)
#define endl            "\n"
#define mod             1000000007
#define mk              make_pair
#define pb              push_back
#define pii             pair<int,int>
#define vi              vector<int>
#define mii             map<int,int>
#define pqb             priority_queue<int>
#define pqs             priority_queue<int,vi,greater<int> >
#define setbits(x)      __builtin_popcountll(x)
#define zrobits(x)      __builtin_ctzll(x)
#define ps(x,y)         fixed<<setprecision(y)<<x
#define w(t)            ll t; cin>>t; while(t--)
#define sc(a)	        scanf("%lld",&a);
#define pr(a)	        printf("%lld\n",a)
#define f(i,a,n)		for(ll i=a;i<n;i++)
#define m(a)		    memset(a,0,sizeof(a))
#define FastIO          ios_base::sync_with_stdio(0);cin.tie(0),cout.tie(0)

int main(){ FastIO;

ll i,j=0,n;cin>>n;
for(i=1;i<=n;i++)
{
	if(i%3!=0 && i%5!=0) j+=i;
}
cout<<j;

return 0;
}


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

int main()
{
	int N, Y;
	cin >> N >> Y;
	for(int a=0; a<=N; a++){
		for(int b=0; b<=N; b++){
			int c = N - a - b;
			if(0 <= c && c <= N
				&& a * 1000 + b * 5000 + c * 10000 == Y){
				cout << c << " " << b << " " << a << endl;
				return 0;
			}
		}
	}
	cout << "-1 -1 -1" << endl;
	return 0;
}


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

struct Card{char suit, value;};

void bubble(struct Card A[], int N){
    for(int i = 0; i < N; i++){
        for(int j = N - 1; j >= i; j--){
            if(A[j].value < A[j - 1].value){
                Card t = A[j]; A[j] = A[j - 1]; A[j - 1] = t;
            }
        }
    }
}

void selection(struct Card A[], int N){
    for(int i = 0; i < N; i++){
        int minj = i;
        for( int j = i; j < N; j++){
            if(A[j].value < A[minj].value) minj = j;
        }
        Card t = A[i]; A[i] = A[minj]; A[minj] = t;
    }
}

void print(struct Card A[], int N){
    for(int i = 0; i < N; i++){
        if(i > 0)cout << " ";
        cout << A[i].suit << A[i].value;
    }
    cout << endl;
}

//バブルソートと選択ソートの結果を比較
bool isStable(struct Card C1[], struct Card C2[], int N){
    for(int i = 0; i < N; i++){
        if(C1[i].suit != C2[i].suit) return false;
    }
    return true;
}

int main(){
    int N;
    cin >>N;
    Card C1[N], C2[N];
    for(int i = 0; i < N; i++){
        cin >>C1[i].suit >>C1[i].value;
    }

    for(int i = 0; i < N; i++)C2[i] = C1[i];

    bubble(C1, N);
    selection(C2, N);

    print(C1,N);
    cout << "Stable" << endl;
    print(C2, N);
    cout << (isStable(C1, C2, N) ? "Stable" : "Not stable") << endl;
}


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

#define FOR(i,s,t) for(int i=s;i<t;i++)
#define REP(i,n) FOR(i,0,n)
#define PRINT(s) cout << s << "\n"
#define SORT(A) sort(A.begin(), A.end())
#define EACHPRINT(A, T) for_each(begin(A), end(A), [&](T i){ cout << i << " "; });cout << "\n"

typedef long lint;
typedef pair<lint, lint> P;

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    lint N; cin >> N;
    lint T; cin >> T;
    lint A; cin >> A;

    long double res = T+100000;
    lint idx = -1;
    
    REP(i, N) {
      lint H; cin >> H;
      long double res2 = abs(T - 0.006*H -A);

      if(res2 < res) {
        idx = i;
        res = res2;
      }
      
    }

    cout << idx+1 << "\n";

    return 0;
}


Measured memory_bytes: 256