akhauriyash/Code-Regression huggingface dataset:
from bisect import bisect
from itertools import accumulate

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

accumA = [0] + list(accumulate(A))
accumB = list(accumulate(B))
ans = 0
for i in range(N + 1):
    if accumA[i] > K:
        break
    n = i + bisect(accumB, K - accumA[i])
    ans = max(n, ans)
print(ans)


Measured memory_bytes: 49160
S = input()
flag = True
while flag:
    if S[:7] == 'dreamer':
        if S[:10] == 'dreamerase':
            S = S[5:]
        else:
            S = S[7:]
    elif S[:5] == 'dream':
        S = S[5:]
    elif S[:6] == 'eraser':
        S = S[6:]
    elif S[:5] == 'erase':
        S = S[5:]
    else:
        flag = False
if S:
    print('NO')
else:
    print('YES')

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

int main(){
  int A,B,C,D;
  cin >> A >> B >> C >> D;
  if(B<C||D<A){
    cout << 0 << endl;
  }
  else if(A<=C&&D<=B){
    cout << D-C << endl;
  }
  else if(C<=A&&B<=D){
    cout << B-A << endl;
  }
  else if(A<=C){
    cout << B-C << endl;
  }
  else if(C<=A){
    cout << D-A << endl;
  }
}

Measured memory_bytes: 256
#include"bits/stdc++.h"
#include<atcoder/maxflow.hpp>
using namespace atcoder;
using namespace std;
#define REP(k,m,n) for(int (k)=(m);(k)<(n);(k)++)
#define rep(i,n) REP((i),0,(n))
using ll = long long;
using pll = pair<ll, ll>;
using tp3 = tuple<ll, ll, ll>;
constexpr int INF = 1 << 28;
constexpr ll INFL = 1ll << 60;
constexpr int dh[4] = { 0,1,0,-1 };
constexpr int dw[4] = { -1,0,1,0 };
bool isin(const int H, const int W, const int h, const int w) {
    return 0 <= h && h < H && 0 <= w && w < W;
}
// ============ template finished ============

using pii = pair<int, int>;

int idx(const int N, const int M, int i, int j) {
    if (i < 0 || N <= i || j < 0 || M <= j)return -1;
    return i * M + j;
}

pii reverse(const int M, int num) {
    int i = num / M;
    int j = num % M;
    return make_pair(i, j);
}

string out(pii p) {
    return "(" + to_string(p.first) + "," + to_string(p.second) + ")";
}

int main()
{
    int N, M;
    cin >> N >> M;
    vector<string> S(N);
    rep(i, N)cin >> S[i];

    const int SIZE = N * M;
    mf_graph<int> graph(SIZE + 2);
    vector<pii> edges;

    auto add_edge = [&](int from, int to) {
        if (from < SIZE) {
            auto[i, j] = reverse(M, from);
            if (S[i][j] == '#')return;
        }
        if (to < SIZE) {
            auto[i, j] = reverse(M, to);
            if (S[i][j] == '#')return;
        }
        graph.add_edge(from, to, 1);
        edges.push_back({ from, to });
    };

    rep(i, N) rep(j, M) {
        bool left = (i + j) % 2 == 0;
        if (left) {
            int now = idx(N, M, i, j);
            add_edge(SIZE, now);

            rep(dir, 4) {
                int opp = idx(N, M, i + dh[dir], j + dw[dir]);
                if (opp != -1) add_edge(now, opp);
            }
        }
        else {
            int now = idx(N, M, i, j);
            add_edge(now, SIZE + 1);
        }
    }
    int flow = graph.flow(SIZE, SIZE + 1);
    cout << flow << endl;

    auto angle = [](pii from, pii to) {
        if (from.first < to.first)return 'v';
        if (from.first > to.first)return '^';
        if (from.second < to.second)return '>';
        if (from.second > to.second)return '<';
        assert(false);
        return 'P';
    };

    auto res = graph.edges();
    for (auto edge : res) {
        if (SIZE <= edge.from || SIZE <= edge.to)continue;
        if (edge.cap != edge.flow)continue;
        auto p1 = reverse(M, edge.from);
        auto p2 = reverse(M, edge.to);
        S[p1.first][p1.second] = angle(p1, p2);
        S[p2.first][p2.second] = angle(p2, p1);
    }
    for (auto row : S)cout << row << endl;
    return 0;
}


Measured memory_bytes: 5780
#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <set>

#define int long long

using namespace std;

vector<int> ans[1000000];

signed main() {
	int n, a, b;
	cin >> n >> a >> b;
	if (a * b < n) {
		cout << -1;
		return 0;
	}
	if (a + b - 1 > n) {
		cout << -1;
		return 0;
	}
	int k = 1;
	for (int i = 0; i < a; i++) {
		for (int j = 0; j < b && a - i - 1 + k <= n; j++) {
			ans[i].push_back(k++);
		}
		reverse(ans[i].begin(), ans[i].end());
		for (auto j : ans[i]) {
			cout << j << ' ';
		}
	}
}

Measured memory_bytes: 33792
#include <stdio.h>
#include <string>
#include <algorithm>
#include <set>
#include <map>
#include <vector>
#include <iostream>
#include <math.h>
#include <bitset>
#include <iomanip>
#include <queue>
#include <cstring>
using namespace std;

int main() {
	string s; cin >> s;
	vector<int> z(s.size(),0);
	int l = 0;
	for (int i = 1; i < s.size(); i++) {
		if (s[i] == 'L'&&s[i - 1] == 'R') {
			int j = i,k;
			while (1) {
				if (j == s.size() - 1) { k = s.size(); break; }
				if (s[j] == 'R') { k = j; break; }
				j++;
			}
			z[i - 1]++; z[i]++;
			z[i - 1] += (i - l)/2;
			z[i] += (i - l-1) / 2;
			z[i] += (k - i) / 2;
			z[i-1] += (k - i-1) / 2;
			swap(z[i], z[i - 1]);
			l = k; i = k;
		}
	}
	for (int i = 0; i < s.size(); i++) {
		cout << z[i] << " ";
	}
}





Measured memory_bytes: 1024
H[1<<18],h;p(a){for(*H=a,a=++h;a>1&*H>H[a/2];a/=2)H[a]=H[a/2];H[a]=*H;}q(a,b){for(a=b=1;a<h&H[a]>H[h];H[a]=H[b=(H[b=a*2]<H[b+1]&b<h)+b])a=b;H[a]=H[h];H[h--]=0;}long s;x;a;z;main(){for(;~scanf("%d",&z+!x+!a);)p(z);for(;h;--x<0?s+=z:p(z/2))q(z=H[1]);printf("%ld",s);}

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

using namespace std;
typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;

#define TASKNAME somethinghere

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

	//freopen("input.txt", "r", stdin);
	//freopen(TASKNAME".inp", "r", stdin);
	//freopen(TASKNAME".out", "w", stdout);

    string s;
    cin >> s;
    if(s == "Sunny") cout << "Cloudy";
    if(s == "Cloudy") cout << "Rainy";
    if(s == "Rainy") cout << "Sunny";
}

/* stuff you should look for
	* array bounds
	* special cases (n=1?), set tle
	* do sth instead of nothing and stay organized
	* check for variables with close names
*/


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

#define ll long long
#define IOS ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
ll mod = 1e9+7;
ll INF = 1e17;

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

    if(a>b)
    {
        while(a>0)
        {
            cout<<b;
            a--;
        }
    }
    else
    {
        while(b>0)
        {
            cout<<a;
            b--;
        }
    }
    cout<<endl;
}


Measured memory_bytes: 256
#!usr/bin/env python3
from collections import defaultdict,deque
from heapq import heappush, heappop
from itertools import permutations
import sys
import math
import bisect
import random
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def I(): return int(sys.stdin.readline())
def LS():return [list(x) for x in sys.stdin.readline().split()]
def S():
    res = list(sys.stdin.readline())
    if res[-1] == "\n":
        return res[:-1]
    return res
def IR(n):
    return [I() for i in range(n)]
def LIR(n):
    return [LI() for i in range(n)]
def SR(n):
    return [S() for i in range(n)]
def LSR(n):
    return [LS() for i in range(n)]

sys.setrecursionlimit(1000000)
mod = 1000000007

def solve():
    n = I()
    s = input()
    print(s.count("ABC"))
    return

#Solve
if __name__ == "__main__":
    solve()


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

# define C continue;
# define R return

# define D double
# define I insert
# define ll long long
# define ld long double

# define ull unsigned long long
# define ui unsigned int

# define pb push_back
# define pf push_front

# define vi vector < int >
# define vc vector < char >
# define vs vector < string >
# define vb vector < bool >
# define vd vector < D >
# define vll vector < ll >
# define vull vector < ull >
# define vld vector < ld >
# define PQ priority_queue

# define vvi vector < vector < int > >
# define vvb vector < vector < bool > >
# define vvc vector < vector < char > >
# define vvs vector < vs >
# define vvll vector < vector < ll > >
# define vvd vector < vector < D > >
# define vvld vector < vector < ld > >

# define all(v) (v).begin() , (v).end()
# define allrev(v) (v).rbegin() , (v).rend()
# define allcomp(v) v.begin() , v.end() , comp
# define allrevcomp(v) v.rbegin() , v.rend() , comp

# define pii pair < int , int >
# define pll pair < ll , ll >
# define pld pair < ld , ld >
# define pDD pair < D , D >

# define vpld vector < pld >
# define vpii vector < pii >
# define vpll vector < pll >
# define vpDD vector < pDD >

# define vvpii vector < vector < pii > >
# define F first
# define S second
# define mp make_pair

# define dist(a,b,p,q) sqrt((p-a)*(p-a) + (q-b)*(q-b))

# define pp(n) printf("%.10Lf",n);
# define line cout<<"\n";
# define fast ios_base::sync_with_stdio(false) ; cin.tie(0) ; cout.tie(0);

# define fr(a,b) for(int i = a; i < b; i++)
# define rep(i,a,b) for(int i = a; i < b; i++)

string vow = "aeiou";
int month[] = {-1, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};

const int dxhorse[] = {-2, -2, -1, -1, 1, 1, 2, 2};
const int dyhorse[] = {1, -1, 2, -2, 2, -2, 1, -1};

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

const ld pie = 3.1415926535897932384626 ;
const ll mod = 1e9 + 7 ;
void solve(){
    int n,l;
    cin>>n>>l;
    string str[n];
    string temp;
    fr(0,n) cin >> str[i];
       for(int i = 0; i < n; i++)
       for( int j = i+1; j < n; j++)
       {
          if(str[i] > str[j])
          {
            temp = str[i];
            str[i] = str[j];
            str[j] = temp;
          }

    }
    string ans = "";
    for(int i = 0; i < n; ++i)
    {
       ans+=str[i];

    }
    cout << ans;line



  	return;

}

int main(){
	fast
	int t=1;
	//cin >> t;
	while(t--){
             solve();
    }

	R 0;
}


Measured memory_bytes: 3640
s=input()
memo=[0]*len(s)
string="R"
r_index=0
cnt=0

for i in range(len(s)):
    if string=="R" and s[i]=="R":
        cnt+=1
    elif string=="R" and s[i]=="L":
        r_index=i-1
        memo[r_index]+=(cnt+1)//2
        memo[r_index+1]+=cnt//2
        string="L"
        cnt=1
        continue
    elif string=="L" and s[i]=="L":
        cnt+=1
    elif string=="L" and s[i]=="R":
        memo[r_index+1]+=(cnt+1)//2
        memo[r_index]+=cnt//2
        string="R"
        cnt=1
        
memo[r_index+1]+=(cnt+1)//2
memo[r_index]+=cnt//2

print(" ".join(map(str,memo)))

Measured memory_bytes: 10484
#include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define dup(x,y) (((x)+(y)-1)/(y))
#define ALL(x) (x).begin(), (x).end()
typedef long long ll;
typedef pair<int, int> pii;
const double EPS = 1e-10;
const int INF = 1e9;
const ll LINF = 1e15;
const int MOD = 1e9+7;
const double PI = acos(-1);
int dx[4] = {0,1,0,-1};
int dy[4] = {1,0,-1,0};
typedef pair<ll, ll> pll;

bool is_prime(int N) {
    if (N == 1) return false;
    for (int i = 2; i * i <= N; ++i) {
        if (N % i == 0) return false;
    }
    return true;
}



vector<int> prime_factorize(long long N) {
    vector<int> res;
    for (long long a = 2; a * a <= N; ++a) {
        if (N % a != 0) continue;
        long long ex = 0; // 指数

        // 割れる限り割り続ける
        while (N % a == 0) {
            ++ex;
            N /= a;
        }

        // その結果を push
        res.push_back(a);
    }

    // 最後に残った数について
    if (N != 1) res.push_back(N);
    return res;
}


int main() {
    int N;
    cin >> N;
    vector<ll> A(N);
    for (int i=0; i<N; i++) cin >> A[i];
    bool flag1 = true;
    bool flag2 = true;

    map<ll, ll> mp;
    for (int i=0; i<N; i++){
        if(is_prime(A[i])){if(A[i] != 1) mp[A[i]]++;}
        else{
            vector <int> res = prime_factorize(A[i]);
            for (auto it: res){
                mp[it]++;
            }
        }
    }
        
    for(auto it: mp){
        if(it.second == N) flag1 = false;
        if(it.second > 1) flag2 = false;
    }

    // cout << g << endl;
    if(flag2){
        cout << "pairwise coprime" << endl;
    }else if(flag1){
        cout << "setwise coprime" << endl;
    }else{
        cout << "not coprime" << endl;
    }
}


Measured memory_bytes: 15732
#include <algorithm>
#include <iostream>
#include <vector>
#include <math.h>
#include <set>
#include <map>
#include <string>
#include <stack>
#include <queue>
#include <iomanip>
#include <numeric>
#include <tuple>
#include <bitset>
#define _USE_MATH_DEFINES
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> plglg;
typedef tuple<int, int, int> tiii;
typedef tuple<ll, ll, ll> tlglglg;
int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};
double pi = 3.141592653589793;
ll mod = 1000000007;
int intmax = 2147483647;
int intmin = -2147483648;
ll llmax = 9223372036854775807;
ll llmin = -9223372036854775807;
ll inf = llmax / 2;

ll rgt[200000];
ll lft[200000];
ll rgtend[200000];
ll rgtback[200000];
ll lftend[200000];
ll lftback[200000];

int main() {
    ll N, C;
    cin >> N >> C;
    ll x[N], v[N];
    for (int i = 0; i < N; i++) {
        cin >> x[i] >> v[i];
    }
    rgt[0] = 0;
    lft[0] = 0;
    for (int i = 0; i < N; i++) {
        rgt[i + 1] = rgt[i] + v[i];
        lft[i + 1] = lft[i] + v[N - 1 - i];
    }
    rgtend[0] = 0;
    rgtback[0] = 0;
    lftend[0] = 0;
    lftback[0] = 0;
    for (int i = 0; i < N; i++) {
        rgtend[i + 1] = max(rgtend[i], rgt[i + 1] - x[i]);
        rgtback[i + 1] = max(rgtback[i], rgt[i + 1] - x[i] * 2);
        lftend[i + 1] = max(lftend[i], lft[i + 1] - (C - x[N - 1 - i]));
        lftback[i + 1] = max(lftback[i], lft[i + 1] - (C - x[N - 1 - i]) * 2);
    }
    ll rgtmax = 0;
    ll lftmax = 0;
    for (int i = 0; i < N + 1; i++) {
        rgtmax = max(rgtmax, rgtend[i] + lftback[N - i]);
        lftmax = max(lftmax, lftend[i] + rgtback[N - i]);
    }
    cout << max(rgtmax, lftmax) << endl;
}


Measured memory_bytes: 9600
#include <stdio.h>
int main(void){
    // Your code here!
    char str[200001];
    
    scanf("%200000s",str);
    
    for(int i = 0; str[i] != '\0'; i++){
        if(str[i] == '?'){
            str[i] = 'D';
        }
    }
    
    printf("%s\n",str);
}

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

ll N, M;
ll x;

void input () {
    cin >> N >> M;
}

void solve() {
    x = N / 2 + (N % 2);
}

int main(void){
    // Your code here!
    input();
    solve();
    cout << ((M<=x)?"YES":"NO") << endl;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#define fastIO ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);

using namespace std;

int main(){
	fastIO
  int arr[5];
  for(int i=0;i<5;i++){
    cin>>arr[i];
  }
  for(int i=0;i<5;i++){
    if(arr[i]==0){
    cout<<i+1<<endl;
      break;
    }
  }
  return 0;
}
    
  
  

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

int main(){
  int A,B,C,D;
  cin>>A>>B>>C>>D;
  
  if(A+B==C+D) cout<<"Balanced"<<endl;
  if(A+B<C+D) cout<<"Right"<<endl;
  if(A+B>C+D) cout<<"Left"<<endl;
}

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

int main()
{
  string s, t;
  cin >> s >> t;
  rep(i, 3){
    if(s[i] != t[2 - i]){
      cout << "NO" << endl;
      return 0;
    }
  }
  cout << "YES" << endl;
              
                                                                                               
                                                                                               
  
  return 0;
}


Measured memory_bytes: 3604
#include<bits/stdc++.h>
#define ll long long
#define endl "\n"
#define pb push_back
#define f(i,n) for(int i=0;i<n;i++)
#define f1(i,n) for(int i=1;i<n;i++)
#define rf(i,n) for(int i=n-1;i>=0;i--)
#define rep(a,b,c) for(int a=b;a<c;a++)
#define repn(a,b,c) for(int a=b;a<=c;a++)
#define PI 3.1415926535897932384626433832795
#define fi first
#define se second
#define mp(x,y) make_pair
#define pii pair<int,int>
#define pll pair<ll,ll>
#define BIN(n,x) bitset<n>(x)  //bitshift works on 32 bit integers only
#define mod (ll)1000000007
using namespace std;
typedef vector<ll> vl;
typedef vector<int> vi;
typedef vector<vector<int>> vvi;
typedef vector<pair<int,int>> vpi;
typedef vector<pair<ll,ll>> vpl;
//nC2
ll C2(ll n){
    ll ans= max(((n*(n-1))/2),(ll)0);
    return ans;
}
//square
ll sq(ll n){
    return n*n;
}

//GCD
ll gcd(ll a,ll b){
    if(a<b){
        swap(a,b);
    }
    if(b==0){
        return a;
    }    
    else{
        return gcd(b,a%b);
    }
}

//LCM
ll lcm(ll a,ll b){
    if(a==0 || b==0){
        return 0;
    }
    else{
        return((ll)((a*b)/gcd(a,b)));
    }
}

//sort pair by second values
bool sortsec(const pair<ll,ll> &a, const pair<ll,ll> &b){ 
    return (a.second < b.second); 
}

//Binary Exponentiation
ll BinExp(ll a, ll b, ll m){
    a%=m;
    ll res =1;
    while(b>0){
        if(b&1){
            res = (res * a)%m;
        }
        a=(a*a)%m;
        b>>=1;
    }
    return res;
}

//All Non-Empty SubSequences(O(2*n))
vvi SubSeq;
void allSub(vector<int> arr, int index,vector<int> subarr){
    if (index == arr.size()){ 
        int l = subarr.size(); 
        if (l != 0){
            SubSeq.pb(subarr); 
        }
    } 
    else{ 
        allSub(arr, index + 1, subarr); 
        subarr.push_back(arr[index]); 
        allSub(arr, index + 1, subarr); 
    } 
    return; 
} 

int main(){
    
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);

    int n;
    cin>>n;
    if(n%10==3){
        cout<<"bon"<<endl;
    }
    else if(n%10 ==0 || n%10 ==1 || n%10 ==6 || n%10 ==8){
        cout<<"pon"<<endl;
    }
    else{
        cout<<"hon"<<endl;
    }
    


    return 0;
}



Measured memory_bytes: 3664
#include <iostream>
#include <algorithm>
#include <numeric>
#include <vector>
#include <string>
using namespace std;
int main()
{
	int n;
	cin >> n;
	vector<int> v(n);
	vector<int> c(n);
	for (int i = 0; i < n; i++) {
		cin >> v[i];
	}
	for (int i = 0; i < n; i++) {
		cin >> c[i];
	}
	int ans = 0;
	for (int i = 0; i < n; i++) {
		if (v[i] - c[i] > 0) {
			ans += v[i] - c[i];
		}
	}
	cout << ans;

	return 0;
}

Measured memory_bytes: 764
/**
 *    Author:   Jay Sabale
 *	       
**/

#include<bits/stdc++.h>

using namespace std;
 
// Competetive Template:
typedef long long int lli;
typedef unsigned long long int ulli;
typedef long double ldb;
typedef vector <lli> vl;
typedef vector <string> vs;
typedef vector < pair <long, long> > vll;

// Debugging :
void __print(int x) {cerr << x;}
void __print(long x) {cerr << x;}
void __print(long long x) {cerr << x;}
void __print(unsigned x) {cerr << x;}
void __print(unsigned long x) {cerr << x;}
void __print(unsigned long long x) {cerr << x;}
void __print(float x) {cerr << x;}
void __print(double x) {cerr << x;}
void __print(long double x) {cerr << x;}
void __print(char x) {cerr << '\'' << x << '\'';}
void __print(const char *x) {cerr << '\"' << x << '\"';}
void __print(const string &x) {cerr << '\"' << x << '\"';}
void __print(bool x) {cerr << (x ? "true" : "false");}

template<typename T, typename V>
void __print(const pair<T, V> &x) {cerr << '{'; __print(x.first); cerr << ','; __print(x.second); cerr << '}';}
template<typename T>
void __print(const T &x) {int f = 0; cerr << '{'; for (auto &i: x) cerr << (f++ ? "," : ""), __print(i); cerr << "}";}
void _print() {cerr << "]\n";}
template <typename T, typename... V>
void _print(T t, V... v) {__print(t); if (sizeof...(v)) cerr << ", "; _print(v...);}
#ifndef ONLINE_JUDGE
#define debug(x...) cerr << "[" << #x << "] = ["; _print(x)
#else
#define debug(x...)
#endif
 
#define pb push_back
#define pf push_front
#define popb pop_back
#define popf pop_front
#define ba  back
#define si size()
#define be begin()
#define en end()
#define le length()
#define mp make_pair 
#define mt make_tuple
#define fi first
#define se second
#define gcd __gcd
#define maxe *max_element
#define mine *min_element
#define deb debug
 
#define forz(i,n) for(lli i=0; i<n; i++)
#define rep(i,k,n) for (lli i = k; i < n; i++)
#define deci(n)  fixed<<setprecision(n)
#define high(n) __builtin_popcount(n)
#define parity(n) __builtin_parity(n)
#define ctz(n)  __builtin_ctz(n)
#define mod 1000000007
#define mod2 998244353
#define kira ios::sync_with_stdio(0), cin.tie(0),cout.tie(0)

// Printing Data :
#define pvec(v) forz(i,v.si) cout<<v[i]<<" "; cout<<endl;
#define parr(arr, n) forz(i,n) cout<<arr[i]<<" "; cout<<endl;
#define p1(i) cout<<i<<endl;
#define p2(i, j) cout<<i<<" "<<j<<endl;
#define p3(i, j, k) cout<<i<<" "<<j<<" "<<k<<endl;
#define p4(i, j, k, l) cout<<i<<" "<<j<<" "<<k<<" "<<l<<endl;

typedef pair <lli,lli> pll;
 
// CODE BEGINS :

int main()
{
    kira;

    lli R; cin>>R;
    ldb PI = 3.141592;

    cout<<deci(10)<<((ldb)2*PI*R)<<endl;

    return 0;
}




















































Measured memory_bytes: 3784
#pragma region include
#include <iostream>
#include <iomanip>
#include <stdio.h>

#include <sstream>
#include <algorithm>
#include <cmath>
#include <complex>

#include <string>
#include <cstring>
#include <vector>
#include <tuple>
#include <bitset>

#include <queue>
#include <complex>
#include <set>
#include <map>
#include <stack>
#include <list>

#include <fstream>
#include <random>
//#include <time.h>
#include <ctime>
#pragma endregion //#include
/////////
#define REP(i, x, n) for(int i = x; i < n; ++i)
#define rep(i,n) REP(i,0,n)
/////////
#pragma region typedef
typedef long long LL;
typedef long double LD;
typedef unsigned long long ULL;
#pragma endregion //typedef
////定数
const int INF = (int)1e9;
const LL MOD = (LL)1e9+7;
const LL LINF = (LL)1e18;
const double PI = acos(-1.0);
const double EPS = 1e-9;
/////////
using namespace::std;

void solve(){
	int N;
	string str;
	cin >> N >> str;
	/////
	string ans = "";
	int now = 0;
	for(int i=0;i<N;++i){
		if( str[i] == '(' ){
			ans += str[i];
			++now;
		}else{//')'
			if( now == 0 ){
				ans = "(" + ans + str[i];
			}else{
				ans += str[i];
				--now;
			}
		}
	}
	for(int i=0;i<now;++i){
		ans += ")";
	}
	cout << ans << endl;
}

#pragma region main
signed main(void){
	std::cin.tie(0);
	std::ios::sync_with_stdio(false);
	std::cout << std::fixed;//小数を10進数表示
	cout << setprecision(16);//小数点以下の桁数を指定//coutとcerrで別	
	
	solve();
}
#pragma endregion //main()


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i, n) for (ll i = 0; i < (ll)(n); ++i)
#define rep2(i, s, n) for (ll i = s; i < (ll)(n); i++)
#define repr(i, n) for (ll i = n; i >= 0; i--)
#define pb push_back
#define COUT(x) cout << (x) << endl
#define COUTF(x) cout << setprecision(15) << (x) << endl
#define ENDL cout << endl
#define DF(x) x.erase(x.begin())  // 先頭文字削除
#define ALL(x) x.begin(), x.end()
#define SORT(x) sort(ALL(x))
#define REVERSE(x) reverse(ALL(x))
#define init() \
  cin.tie(0);  \
  ios::sync_with_stdio(false)
#define debug(x) cerr << "[debug] " << #x << ": " << x << endl;
#define debugV(v)                       \
  cerr << "[debugV] " << #v << ":";     \
  rep(i, v.size()) cerr << " " << v[i]; \
  cerr << endl;
using namespace std;
using ll = long long;
using ld = long double;
using vll = vector<ll>;
using P = pair<ll, ll>;
constexpr ll INF = 0x3f3f3f3f3f3f3f3f;
constexpr double PI = 3.141592653589793238462643383279;
ll getDigit(ll x) {
  return x == 0 ? 1 : log10(x) + 1;
}

ll gcd(ll x, ll y) {
  return y ? gcd(y, x % y) : x;
}

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

vector<P> factorize(ll n) {
  vector<P> result;
  for (ll i = 2; i * i <= n; ++i) {
    if (n % i == 0) {
      result.pb({i, 0});
      while (n % i == 0) {
        n /= i;
        result.back().second++;
      }
    }
  }
  if (n != 1) {
    result.pb({n, 1});
  }
  return result;
}

vll divisor(ll n) {
  vll ret;
  for (ll i = 1; i * i <= n; i++) {
    if (n % i == 0) {
      ret.push_back(i);
      if (i * i != n) ret.push_back(n / i);
    }
  }
  SORT(ret);
  return (ret);
}

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

signed main() {
  init();
  ll n;
  cin >> n;

  ll ans = INF;
  for (ll i = 1; i * i <= n; i++) {
    if (n % i == 0) {
      ll a = getDigit(i);
      ll b = getDigit(n / i);
      ans = min(ans, max(a, b));
    }
  }
  COUT(ans);
  return 0;
}

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

int main()
{
	int n;
	cin>>n;
	int ar[n];
	for(int i=0;i<n;i++)
	{
		cin>>ar[i];
	}
	long int ans=0;
	for(int i=1;i<n;i++)
	{
		if(ar[i]<ar[i-1])
		{
			ans+=(ar[i-1]-ar[i]);
			ar[i]=ar[i-1];
		}
	}
	cout<<ans;
}

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

#define ll long long
#define Fi first
#define Se second
#define Pb push_back
#define vi vector<int>
#define vp vector<pair<int,int>>
#define vvi vector<vector<int>>
#define vvp vector<vector<pair<int,int>>>

const int INF = 1e9;
const int MOD = 1e9+7;
using Graph = vector<vector<int>>; //Caution!! Segmentation Fault!! Don't forget to add +1!

#define all(v) v.begin(),v.end()
#define output_s(a) printf("%s\n",(a).c_str())

#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define Rep(i,n,m) for(int i=(int)(n);i<(int)(m);i++)
#define RepS(i,n,m) for(int i=(int)(n);i<=(int)(m);i++)
#define RRepS(i,n,m) for(int i=(int)(n);i>=(int)(m);i--)
#define RepA(x) for(auto &item:(x))

void CINT(){}
template <class Head,class... Tail>
void CINT(Head&& head,Tail&&... tail){
    cin>>head;
    CINT(move(tail)...);
}    
#define CIN(...) int __VA_ARGS__;CINT(__VA_ARGS__)
#define LCIN(...) ll __VA_ARGS__;CINT(__VA_ARGS__)
#define SCIN(...) string __VA_ARGS__;CINT(__VA_ARGS__)

template<typename TypeInt> //最大公約数
TypeInt GCD(TypeInt a,TypeInt b){
    if(a%b==0) return b;
    else return GCD(b,a%b);
}
template<typename TypeInt> //最小公倍数
TypeInt LCM(TypeInt a,TypeInt b){
    return a*b/GCD(a,b);
}

int IN_int(){
    int x;
    scanf("%d",&x);
    return x;
}

//library----------------------------------------------

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

const int NMAX = 100;
bool flag;

bool cmp(int x,int y){
    return abs(0-x)<abs(0-y);
}

signed main(){
    CIN(X,Y,Z);
    X-=Z;
    int ans=X/(Y+Z);
    printf("%d\n",ans);    

    return 0;
}

Measured memory_bytes: 256
use proconio::input;

#[allow(unused_imports)]
use proconio::marker::{Bytes, Chars, Usize1};
#[allow(unused_imports)]
use std::cmp::*;
#[allow(unused_imports)]
use std::collections::*;
#[allow(unused_imports)]
use std::ops::*;

#[derive(Clone, Debug, Default)]
struct Struct;

//#[proconio::fastout]
fn main() {
    input! {
        k: usize,
        a: usize,
        b: usize,
    }

    // a <= nk <= b
    let n = (a + k - 1) / k;

    println!("{}", if n * k <= b { "OK" } else { "NG" });
}


Measured memory_bytes: 2096
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<n;i++)
#define rrep(i,n) for(int i=n;i>=0;i--)
#define all(v) v.begin(),v.end()
template<typename T>T rad(T deg){return deg*M_PI/180;}

using namespace std;
int main() {
    int a[5];
    rep(i,5) cin >> a[i];
    sort(a,a+5);
    cout << a[4];
    rrep(i,3) cout << " " << a[i];
    cout << endl;
    return 0;
}

Measured memory_bytes: 3076
N = int(input())
cnt = 0
p = 0
t = 0
c = 0
for i in range(N):
    c = int(input())
    if t:
        t = 0
        if c:
            c -= 1
            cnt += 1
    q, m = divmod(c, 2)
    cnt += q
    t = m
print(cnt)


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

int main()
{
    //freopen("input.txt","r",stdin);
    //freopen("output.txt","w",stdout);
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    map<int,int>tack;
    int n;
    cin>>n;
    tack[n]++;
    int count=1;
    while(1)
    {
    count++;
    if(n%2==0)
    {
        n=n/2;
        if(tack[n]!=0)
        {
            cout<<count<<"\n";
            return 0;
        }
        else
        tack[n]++;
    }
    else
    {
        n=n*3+1;
        if(tack[n]!=0)
        {
            cout<<count<<"\n";
            return 0;
        }
        else
        tack[n]++;
    }

    }
    
}

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

using namespace std;

#define all(x) x.begin(), x.end()
typedef vector <int> vi;
typedef pair<int,int> ii;
typedef long long ll;

const int mod = 1e9 + 7;
const ll inf = 3e18 + 5;

int add(int a, int b) { return (a += b) < mod? a : a - mod; }

ll dp[1005][1005];
int n, m;
string s[1005];

ll f(int i, int j){
	if(i < 0 || j < 0 || i >= n || j >= m || s[i][j] != '.') return 0;
	if(i == n - 1 && j == m - 1) return 1;
	if(dp[i][j] != -1) return dp[i][j];
	ll ret = 0;
	ret = add(ret, f(i, j + 1));
	ret = add(ret, f(i + 1, j));
	return dp[i][j] = ret;
}

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

	cin >> n >> m;
	for(int i = 0; i < n; i++){
		cin >> s[i];
	}
	memset(dp, -1, sizeof dp);
	cout << f(0, 0);
}

Measured memory_bytes: 9344
import java.util.Arrays;
import java.util.Scanner;

public class Main {

	static Scanner sc = new Scanner(System.in);

	public static void main(String[] args) {
		while (true) {
			int N = sc.nextInt();
			int M = sc.nextInt();
			if (N == 0) break;
			double[] p = new double[N];
			for (int i = 0; i < N; ++i) {
				p[i] = sc.nextDouble();
			}
			double[][][] dp = new double[N][N][M + 1];
			for (double[][] aa : dp) {
				for (double[] a : aa) {
					Arrays.fill(a, -9);
				}
			}
			for (int i = 0; i < N; ++i) {
				dp[i][i][1] = 0;
				for (int j = 0; j < i; ++j) {
					for (int k = 0; k <= j; ++k) {
						for (int l = 1; l < M; ++l) {
							if (dp[j][k][l] < -7) continue;
							dp[i][k][l + 1] = Math.max(dp[i][k][l + 1], dp[j][k][l] + 0.5 * Math.sin((p[i] - p[j]) * 2.0 * Math.PI));
						}
					}
				}
			}
			double ans = 0;
			for (int i = 0; i < N; ++i) {
				for (int j = 0; j < i; ++j) {
					if (dp[i][j][M - 1] < -7) continue;
					for (int k = i + 1; k < N; ++k) {
						ans = Math.max(ans, dp[i][j][M - 1] + 0.5	* (Math.sin((1.0 + p[j] - p[k]) * 2.0 * Math.PI) + Math.sin((p[k] - p[i]) * 2.0 * Math.PI)));
					}
				}
			}
			System.out.printf("%.6f\n", ans);
		}
	}
}

Measured memory_bytes: 45164
#include <algorithm>
#include <iostream>
#include <string>
#include <vector>
#include <cmath>
#define DEBUG(x) std::cout << '>' << #x << ':' << x << '\n';
#define PRINTVEC(x) for (int i = 0; i < (int)x.size(); i++) std::cout << x[i] << ' '; std::cout << '\n';
#define PRINTP(x) for (int i = 0; i < (int)x.size(); i++) std::cout << x[i].first << ' ' << x[i].second << '\n'; std::cout << '\n';
#define io std::ios_base::sync_with_stdio(false);std::cin.tie(NULL);   
const int INF = 1<<29;
typedef long long ll;



int main()
{
	io;
    #ifndef ONLINE_JUDGE
    //freopen("input.txt", "r", stdin); 
    //freopen("output.txt", "w", stdout);  
    #endif

    std::string s;
    std::cin >> s;
    std::cout << (s[2] == s[3] && s[4] == s[5] ? "Yes" : "No");

    #ifndef ONLINE_JUDGE   
    //std::cout << '\n' << "Time elapsed : " << 1.0 * clock() / CLOCKS_PER_SEC << " sec \n";
    #endif
    return 0;
}


Measured memory_bytes: 256
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#define MOD 1000000007
typedef unsigned long long ull;
typedef   signed long long sll;


#define N_MAX 100
#define M_MAX 100

int n;
int s[N_MAX];

int comp(const void *a, const void *b){
	return *(int*)a - *(int*)b;
}

int solve(){
	int i;
	int ans = 0;
	int min = M_MAX;
	
	for (i = 0; i < n; i++) {
		ans += s[i];
		if (s[i] % 10 && min > s[i]) min = s[i];
	}

	if (ans % 10 == 0) {
		ans -= min;
		if (ans % 10 == 0) ans = 0;
	}

	printf("%d\n", ans);

	return 0;
}

int main(void){
	int i;

	scanf("%d", &n);
	for (i = 0; i < n; i++) {
		scanf("%d", &s[i]);
	}

	solve();

	return 0;
}


Measured memory_bytes: 128
#include<string.h>
#include <iostream>
#include<cstdio>
#include <stack>
#include <vector>
using namespace std;
#define INF 0x7ffffff
typedef long long ll;
const int maxn=1e5+10;
int pre[maxn];
int dis[maxn];
int findset(int x)
{
    if(x==pre[x])   return x;
    int root=findset(pre[x]);
    dis[x]=dis[pre[x]]+dis[x];
    return pre[x]=root;
}
bool unionset(int x,int y,int w)
{
    int fx=findset(x),fy=findset(y);
    if(fx==fy)
        return w==dis[y]-dis[x];
    pre[fy]=fx;
    dis[fy]=dis[x]+w-dis[y];
    return true;
}
int n,m;
int main()
{
   scanf("%d%d",&n,&m);
   for(int i=1;i<=n;i++)
    pre[i]=i;
   bool lose=true;
   for(int i=0;i<m;i++)
   {
       int x,y,w;
   scanf("%d%d%d",&x,&y,&w);
        if(lose)
       lose=unionset(x,y,w);
   }
   if(lose) printf("Yes\n");
   else     printf("No\n");
}

Measured memory_bytes: 1272
import java.util.Scanner;

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

    	if(a > b){
    		int buf = b;
    		b = a;
    		a = buf;
    	}
    	if(b > c){
    		int buf = c;
    		c = b;
    		b = buf;
    	}
    	if(a > b){
    		int buf = b;
    		b = a;
    		a = buf;
    	}

    	System.out.printf("%d %d %d\n", a,b,c);

    }
}

Measured memory_bytes: 26312
import std.stdio;
import std.string;
import std.conv;
import std.typecons;
import std.algorithm;
import std.functional;
import std.bigint;
import std.numeric;
import std.array;
import std.math;
import std.range;
import std.container;
import std.ascii;
import std.format;

void main()
{
	auto ip = readln.chomp.to!int;
	writeln(24 + (24 - ip));
}

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

int main() {
    ll N, D, X;
    cin >> N >> D >> X;
    vector<ll> A(N);
    for (ll i = 0; i < N; i++) {
        cin >> A[i];
        X += (D + A[i] - 1) / A[i];
    }
    cout << X << endl;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define ll long long
int main()
{
    ll n,cap,sum=0,ans=0;
    cin>>n>>cap;
    ll w[n+1],v[n+1];
    for(ll i=1;i<=n;i++)
    {
        cin>>w[i]>>v[i];
        sum+=v[i];
    }
    ll dp[n+1][sum+1],i,j;
    for(i=0;i<=n;i++)
    {
        for(j=0;j<=sum;j++)
        {
            if(i==0&&j==0)
            {
                dp[i][j]=0;continue;
            }
            if(i==0)
            {
                dp[i][j]=INT_MAX;
            }
            else if(j>=v[i])
            {
                ll inc,exc;
                exc=dp[i-1][j];
                inc=dp[i-1][j-v[i]]+w[i];
                dp[i][j]=min(inc,exc);
            }
            else
            {
                dp[i][j]=dp[i-1][j];
            }
            if(dp[i][j]<=cap)
            {
                ans=max(ans,j);
            }
        }
    }
    cout<<ans<<"\n";
}


Measured memory_bytes: 79104
n = int(input())
st = input()
a = list(st.split())
for i in range(n):
    a[i] = int(a[i])
dp = list()
for i in range(n):
    dp.append(0)
for i in range(n):
    if i == 0:
        dp[i] == 0
    elif i == 1:
        dp[i] = abs(a[1] - a[0])
    else:
        dp[i] = min(dp[i - 2] + abs(a[i] - a[i - 2]), dp[i - 1] + abs(a[i] - a[i - 1]))
print(dp[n - 1])

Measured memory_bytes: 11292
#include "bits/stdc++.h"
// Begin Header {{{
#define all(x)      x.begin(), x.end()
#define SIZE(x)     static_cast<i64>(x.size())
#define rep(i,n)    for (i64 i = 0, i ## _limit = (n); i < i ## _limit; ++i)
#define reps(i,s,t) for (i64 i = (s), i ## _limit = (t); i <= i ## _limit; ++i)
#define repr(i,s,t) for (i64 i = (s), i ## _limit = (t); i >= i ## _limit; --i)

#ifdef DBG
#define trace(...) _trace(#__VA_ARGS__, __VA_ARGS__);
#else
#define trace(...)
#endif

using namespace std;
using i64 = int_fast64_t;
using pii = pair<i64, i64>;
template<class T, class U>inline bool chmax(T &a, const U &b){return b>a && (a=b, true);}
template<class T, class U>inline bool chmin(T &a, const U &b){return b<a && (a=b, true);}
constexpr int INF  = 0x3f3f3f3f;
constexpr i64 LINF = 0x3f3f3f3f3f3f3f3fLL;

template<class T>
ostream& operator<< (ostream &os, const vector<T> &vec) {
    rep(i, vec.size()) os << vec[i] << (i+1 == vec.size() ? "" : " ");
    return os;
}

template<class T, class U>
ostream& operator<< (ostream &os, const pair<T, U> &p) {
    return os << p.first << ' ' << p.second;
}

template <class T>
void _trace(const char *s, T&& x)
{
    clog << '{';
    while(*s != '\0') clog << *(s++);
    clog << ":" << setw(3) << x << '}' << endl;
}

template <class Head, class... Tail>
void _trace(const char *s, Head&& head, Tail&&... tail)
{
    clog << '{';
    while(*s != ',') clog << *(s++);
    clog << ":" << setw(3) << head << "}, ";
    for (++s; !isgraph(*s); ++s);
    _trace(s, std::forward<Tail>(tail)...);
}
// }}} End Header

signed main()
{
    // ios::sync_with_stdio(false); cin.tie(nullptr);
    i64 H, W;
    cin >> H >> W;

    const auto slv = [](i64 H, i64 W) {
        i64 ans = LINF;
        reps(i, 1, H-1) {
            {
                const i64 a = i * W;
                const i64 b = (H - i) / 2 * W;
                const i64 c = (H - i + 1) / 2 * W;
                chmin(ans, max({ a, b, c }) - min({ a, b, c }));
            }
            {
                const i64 a = i * W;
                const i64 b = (H - i) * (W / 2);
                const i64 c = (H - i) * ((W + 1) / 2);
                chmin(ans, max({ a, b, c }) - min({ a, b, c }));
            }
        }
        return ans;
    };

    cout << min(slv(H, W), slv(W, H)) << endl;

    return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<algorithm>
#include<cstdio>
#include<cmath>
#include<math.h>
#include<string>
#include<string.h>
#include<stack>
#include<queue>
#include<vector>
#include<utility>
#include<set>
#include<map>
#include<stdlib.h>
#include<iomanip>
 
using namespace std;
 
#define ll long long
#define ld long double
#define EPS 0.0000000001
#define INF 1e9
#define MOD 1000000007
#define rep(i,n) for(i=0;i<n;i++)
#define loop(i,a,n) for(i=a;i<n;i++)
#define all(in) in.begin(),in.end()
#define shosu(x) fixed<<setprecision(x)
typedef vector<int> vi;
int c[10][10]={0};

int min(int a,int b){
	if(a<b)return a;
	return b;
}

void warshall_floyd(){
	int i,j,k;
	rep(k,10){
		rep(i,10){
			rep(j,10){
				c[i][j] = min(c[i][j],c[i][k]+c[k][j]);
			}
		}
	}
}

int main(void){
	int z,w,h,i,j;
	int n;
	int a[201][201]={0};
	int num[10]={0};
	int cnt = 0;
	cin >> h >> w;
	rep(i,10){
		rep(j,10){
			cin >> c[i][j];
		}
	}
	rep(i,h){
		rep(j,w){
			cin >> a[i][j];
			if(a[i][j] != -1){
				num[a[i][j]]++;
			}
			if(a[i][j] == -1 || a[i][j] == 1){
				cnt++;
			}
		}
	}
	if(cnt == h*w){
		cout << 0 << endl;
		return 0;
	}
	warshall_floyd();
	int sum = 0;
	rep(i,10){
		if(num[i] != 0 && i != 1){
			if(i == 0){
				sum += num[i]*c[0][1];
			}else{
				sum += num[i]*c[i][1];
			}
		}
	}
	cout << sum << endl;
	return 0;
}

Measured memory_bytes: 384
#define _CRT_SECURE_NO_WARNINGS
#include <cstdio>
#include <vector>
#include <string>
#include <iostream>
#include <algorithm>
#include <map>
#include <iterator>
#include <functional>
#include <set>
#include <stack>
#include <queue>
#include <deque>
#include <fstream>
#include <iomanip>
#include <numeric>
#include <cmath>
#include <list>
#include <sstream>
#include <cstring>
#include <stdio.h>
using namespace std;
#pragma GCC optimize("O3")
#pragma GCC target("sse4")

typedef double LD;
typedef long long LL;
typedef unsigned long long ULL;
typedef pair<int, int> PII;
typedef pair<LD, LD> PDD;
typedef pair<LL, LL> PLL;
typedef vector<int> VI;
typedef vector<LL> VLL;
typedef vector<char> VCH;
typedef vector<LD> VLD;
typedef vector<string> VS;
typedef vector<VS> VSS;
typedef vector<VI> VVI;
typedef vector<VLL> VVLL;
typedef vector<VCH> VVCH;
typedef vector<PII> VPII;
typedef vector<PLL> VPLL;
typedef vector<PDD> VPDD;
#define MP make_pair
#define PB push_back
#define X first
#define Y second
#define next fake_next
#define prev fake_prev
#define left fake_left
#define right fake_right

#define FOR(i,a,b) for(int i = (a); i < (b); ++i)
#define RFOR(i,b,a) for(int i = (b) - 1; i >= (a); --i)
#define REP(i, t) FOR(i,0,t)
#define ALL(a) a.begin(), a.end()
#define SZ(a) (int)((a).size())
#define FILL(a, value) memset(a, value, sizeof(a))

const LD PI = acos(-1.0);
const LD EPS = 0.5;
const LL INF = 1e9;
const LL mod = 1000003;
const LL LINF = 1e18 + 10;
const LL MAX = 1e5 + 1;

int n;
int k;
VLL a;
VLL s;
VLL best;

int main()
{
	ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
	//freopen("In.txt", "r", stdin);

	cin >> n >> k;
	a.resize(n);
	s.resize(n);
	best.resize(n);
	FOR(i, 0, n)
		cin >> a[i];

	s[0] = a[0];
	FOR(i, 1, n)
		s[i] = s[i - 1] + a[i];

	best[0] = max(0LL, a[0]);
	FOR(i, 1, n)
		best[i] = best[i - 1] + max(0LL, a[i]);

	LL ans = 0;

	FOR(i, 0, n - k + 1)
	{
		LL curr = 0;
		LL x = s[i + k - 1];
		if (i)
			x -= s[i - 1];

		curr = max(curr, x);
		if (i)
			curr += best[i - 1];

		curr += best[n - 1] - best[i + k - 1];
		ans = max(ans, curr);
	}

	cout << ans;
	cin >> n;
	return 0;
}

Measured memory_bytes: 2560
#include<bits/stdc++.h>
using namespace std;
int main()
{
long long n;
cin>>n;
long long ans=0;
for(long long i=1;i<=n;i++)
{
if(i%3!=0 && i%5!=0)
{
ans+=i;
}
}
cout<<ans;
return 0;
}

Measured memory_bytes: 3636
#ifndef TEMPLATE_HPP
#define TEMPLATE_HPP
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < int(n); i++)
#define rrep(i, n) for (int i = int(n) - 1; i >= 0; i--)
#define reps(i, n) for (int i = 1; i <= int(n); i++)
#define rreps(i, n) for (int i = int(n); i >= 1; i--)
#define repc(i, n) for (int i = 0; i <= int(n); i++)
#define rrepc(i, n) for (int i = int(n); i >= 0; i--)
#define repi(i, a, b) for (int i = int(a); i < int(b); i++)
#define repic(i, a, b) for (int i = int(a); i <= int(b); i++)
#define all(a) (a).begin(), (a).end()
#define bit32(x) (1 << (x))
#define bit64(x) (1ll << (x))
#define sz(v) ((int) v.size())
using namespace std;
using i64 = long long;
using f80 = long double;
using vi32 = vector<int>;
using vi64 = vector<i64>;
using vf80 = vector<f80>;
using vstr = vector<string>;
template <typename T> class pqasc : public priority_queue<T, vector<T>, greater<T>> {};
template <typename T> class pqdesc : public priority_queue<T, vector<T>, less<T>> {};
template <typename T> void amax(T &x, T y) { x = max(x, y); }
template <typename T> void amin(T &x, T y) { x = min(x, y); }
template <typename T> T power(T x, i64 n, T e = 1) { T r = e; while (n > 0) { if (n & 1) r *= x; x *= x; n >>= 1; } return r; }
template <typename T> istream& operator>>(istream &is, vector<T> &v) { for (auto &x : v) is >> x; return is; }
template <typename T> ostream& operator<<(ostream &os, vector<T> &v) { rep(i, v.size()) { if (i) os << ' '; os << v[i]; } return os; }
template <typename T, typename U> vector<U> make_vector(T&& n, U&& val) { return vector<U>(forward<T>(n), forward<U>(val)); }
template <typename T, typename... Args> decltype(auto) make_vector(T&& n, Args&&... args) { return vector<decltype(make_vector(forward<Args>(args)...))>(forward<T>(n), make_vector(forward<Args>(args)...)); }
const int INF = 1001001001;
const i64 LINF = 1001001001001001001ll;
const int dx[] = {1, 0, -1, 0, 1, 1, -1, -1};
const int dy[] = {0, 1, 0, -1, 1, -1, 1, -1};
#endif

void solve() {
  int x;
  cin >> x;
  if (x >= 30) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
}

int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout << fixed << setprecision(16);
  cerr << fixed << setprecision(16);
  solve();
  return 0;
}

Measured memory_bytes: 3584
#include<cstdio>
#include<cstring>
#include<cmath>
#include<vector>
#include<algorithm>
#include<map>
#include<set>
#include<queue>

using namespace std;

using ll=long long;
using vi=vector<int>;
using vvi=vector<vi>;
using pii=pair<int,int>;
using vll=vector<ll>;
using vvll=vector<vll>;
using vpii=vector<pii>;

#define PI 3.1415926535897932384626433832795

int align(int offset, int x, int p)
{
	int ret=(offset+x)%p;
	if(ret<0) ret+=p;
	return ret;
}

int main(void)
{
	int n, p;
	char s[200000+2];
	while(scanf("%d%d\n%200000[0-9]\n", &n, &p, s)==3)
	{
		ll ans=0;
		if(p==2 || p==5)
		{
			for(int i=0;i<n;i++)
			{
				int x=s[i]-'0';
				if(x%p==0) ans+=i+1;
			}
			printf("%lld\n", ans);
			continue;
		}

		vi dp(p);
		int u=1;
		int v=0;
		dp[0]=1;
		for(int i=0;i<n;i++)
		{
			int x=(s[n-1-i]-'0')%p;
			v=(v+u*x)%p;
			ans+=dp[v];
			dp[v]++;
			u=(u*10)%p;
		}

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


Measured memory_bytes: 512
#include <bits/stdc++.h>
#include <math.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep2(i, s, n) for (int i = (s); i < (int)(n); i++)
using ll = long long;
using vec = vector<ll>;
using vec2 = vector<vector<ll>>;
ll inf = pow(2,62);

int main(){
    ll a, b, k;cin >> a >> b >> k;
    ll m = max(a, b);
    vec A(1000,-1);
    for(int i = 1;i <= m;i++){
        if(a % i == 0 && b % i == 0){
            A[i] = i;
        }
    }
    sort(A.begin(),A.end());
    reverse(A.begin(),A.end());
    cout << A[k-1] << endl;
}

Measured memory_bytes: 3568
import itertools
N = int(input())
P = tuple(map(int,input().split()))
Q = tuple(map(int,input().split()))

T = list(itertools.permutations(range(1, N+1), N))
for i in range(len(T)):
    if T[i] == P:
        s = i
    if T[i] == Q:
        d = i
print(abs(s-d))

Measured memory_bytes: 45680
#include <iostream>
#include <vector>
#include <algorithm>

using namespace std;

int main(void){
    int a, b, k;
    cin >> a >> b >> k;
    
    vector<int> div;
    for(int i = 1; i <= min(a, b); ++i) {
        if(a % i == 0 && b % i == 0) {
            div.push_back(i);
        }
    }
    sort(div.begin(), div.end());
    
    cout << div[div.size() - k] << endl;
    return 0;
}

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

template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }

using ll = long long;

const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};
const int INF = 1<<30;
const ll mod = 1000000007LL;

int main() {
  int H,W,K;
  cin>>H>>W>>K;
  vector<vector<char>> v(H,vector<char>(W));
  vector<vector<int>> cnt(H+1,vector<int>(W+1,0));
  for(int i = 0; i < H; i++){
    for(int j = 0; j < W; j++) cin>>v[i][j];
  }
  for(int i = 1; i <= H; i++){
    for(int j = 1; j <= W; j++) {
      cnt[i][j]+=(int)(v[i-1][j-1]-'0')+cnt[i-1][j]+cnt[i][j-1]-cnt[i-1][j-1];
    }
  }
  int ans = INF;
  for(int i = 0; i < (1<<(H-1));i++){
    vector<int> cut;
    int t = 0;
    int s = __builtin_popcount(i);
    cut.push_back(0);
    for(int j = 0; j < H-1;j++){
      if(i&(1<<j)) cut.push_back(j+1);
    }
    cut.push_back(H);
    bool can=true;
    for(int j = 1; j <= W;j++){
      for(int k = 1; k < (int)cut.size();k++){
        if(cnt[cut[k]][j]-cnt[cut[k-1]][j]-cnt[cut[k]][t]+cnt[cut[k-1]][t]>K){
          if(t==j-1) {
            can=false;
            break;
          }
          else {
            t=j-1;
            s++;
            j--;
            break;
          }
        }
      }
      if(!can)break;
    }
    if(can) {
      chmin(ans,s);
    }
  }
  cout<<ans<<endl;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#include<cmath>
#include<string>
using namespace std;
int main(){
    string A,B;
    cin>>A>>B;
  	int C=stoi(A+B);
  	int D=sqrt(C);
 
  	if(D*D==C) cout<<"Yes";
  	else cout<<"No";
}


Measured memory_bytes: 256
import sys
input = lambda : sys.stdin.readline().rstrip()
sys.setrecursionlimit(max(1000, 10**9))
write = lambda x: sys.stdout.write(x+"\n")


a,b = list(map(int, input().split()))
def factor(n, m=None):
    # mを与えると、高々その素因数まで見て、残りは分解せずにそのまま出力する
    arr = {}
    temp = n
    M = int(-(-n**0.5//1))+1
    if m is not None:
        M = min(m+1, M)
    for i in range(2, M):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr[i] = cnt

    if temp!=1:
        arr[temp] = 1

    if not arr:
        arr[n] = 1

    return arr
fa = factor(a)
fb = factor(b)
if 1 in fa:
    del fa[1]
if 1 in fb:
    del fb[1]
d = set(list(fa.keys())) & set(list(fb.keys()))
ans = len(d) + 1
print(ans)

Measured memory_bytes: 63528