akhauriyash/Code-Regression huggingface dataset:
using System;
using System.Linq;

class H
{
	static void Main()
	{
		var a = Array.ConvertAll(Console.ReadLine().Split(), int.Parse);
		int h = a[0], w = a[1];
		var dp = new int[h].Select(_ => Console.ReadLine().Select(x => x == '.' ? 0 : -1).ToArray()).ToArray();

		dp[0][0] = 1;
		for (int i = 1; i < h; i++)
			if (dp[i][0] == 0) dp[i][0] = 1;
			else break;
		for (int j = 1; j < w; j++)
			if (dp[0][j] == 0) dp[0][j] = 1;
			else break;

		for (int i = 1; i < h; i++)
			for (int j = 1; j < w; j++)
				if (dp[i][j] != -1)
					dp[i][j] = ((dp[i][j - 1] != -1 ? dp[i][j - 1] : 0) + (dp[i - 1][j] != -1 ? dp[i - 1][j] : 0)) % 1000000007;
		Console.WriteLine(dp[h - 1][w - 1]);
	}
}


Measured memory_bytes: 21296
#include<cmath>
#include<cstdio>
#include<cstring>
#include<algorithm>
#include<iostream>
#include<vector>
#include<set>
const int MAXN=5e5+10;
const double eps=1e-8;
const int MOD=1000000007;
using namespace std;
typedef  long long ll;
int main()
{
    int a,b;
    cin>>a>>b;
    cout<<max(max(a+b,a-b),a*b)<<endl;
    return 0;
}



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

namespace AtCoder
{
    class Program
    {
        static void Main(string[] args)
        {
            var abk = Array.ConvertAll(Console.ReadLine().Split(), int.Parse);
            var list = new List<int>();
            for (int i = 0; i < abk[2]; i++)
            {
                list.Add(abk[0] + i);
            }
            for (int i = 0; i < abk[2]; i++)
            {
               list.Add(abk[1] - abk[2] + i + 1);
            }
            list = list.Distinct().Where(s => s >= abk[0]).Where(s => s <= abk[1]).ToList();
            foreach(int i in list)
            {
                Console.WriteLine(i);
            }
        }
    }
}

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

int main()
{
    int a[4], b, c, n = 4;
    a[0] = 6000;
    a[1] = 4000;
    a[2] = 3000;
    a[3] = 2000;

    while( n-- )
    {
        cin >> b >> c;
        cout << a[b-1] * c << endl;
    }

    return 0;
}


Measured memory_bytes: 3100
// A - 高橋君とホテルイージー / Tak and Hotels (ABC Edit) https://atcoder.jp/contests/abc044/tasks/abc044_a

  import io.Source

  object Main extends App {
    val xs = Source.stdin.getLines()
    val n = xs.next().toInt
    val k = xs.next().toInt
    val x = xs.next().toInt
    val y = xs.next().toInt

    println(solve(n, k, x, y))

    def solve(n: Int, k: Int, x: Int, y: Int): String = {
      if (n >= k) {
        (x * k + y * (n - k)).toString
      } else {
        (x * n).toString
      }
    }
  }


Measured memory_bytes: 25540
mn = 2
mx = 2
n = int(input())
k = [int(i) for i in input().split()]
k.reverse()
for i in range(n):
  t1 = (mn + k[i] - 1) // k[i] * k[i]
  t2 = (mx) // k[i] * k[i]
  if t1 > mx:
    print(-1)
    exit()
  mn = t1
  mx = t2 + k[i] - 1
print(mn, mx)

Measured memory_bytes: 14224
n, m = [int(i) for i in input().split()]
ipyo = [[i] + [int(_) for _ in input().split()] + [0] for i in range(m)]

ipyo.sort(key=lambda x: x[2])

cnt = [0] * n
for v in ipyo:
    p = v[1]
    cnt[p - 1] += 1
    v[3] = cnt[p - 1]

ipyo.sort(key=lambda x: x[0])

for v in ipyo:
    print('{0:06d}'.format(v[1]) + '{0:06d}'.format(v[3]))

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

#define INF 1e9
using namespace std;

int main() {

    int N, K; cin >> N >> K;

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

    vector<long long> dp(N+K);
    for (int i = 0; i < N+K; ++i) {
        dp[i] = INF;
    }

    //初期値設定
    dp[0] = 0;

    for (int i = 0; i < N; ++i) {
        for (int j = 0; j < K; ++j) {
            dp[i+j+1] = min(dp[i+j+1], dp[i] + abs(h[i+j+1] - h[i]));
        }
    }

    cout << dp[N-1] << endl;
}


Measured memory_bytes: 1408
//注意:代码模板中的代码将会被复制到任何新创建的文件中，编辑代码模板中的代码，让他帮你自动增加固定代码吧
#include <iostream> 
using namespace std;
int main(){
    int a,b;
    cin>>a>>b;
    b=a-2*b;
    if(b<0)
        cout<<0;
    else
        cout<<b;
}

Measured memory_bytes: 256
#include<iostream>
#include<algorithm>
#include<functional>
#include<cmath>
#include<string>
#include<vector>
using namespace std;
const int mod = 1000000007;
#define ll long long

int main()
{
   int n; cin >> n;
   ll ans = n*(n+1)/2;

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


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

int main() {
  int H, W;
  cin >> H >> W;

  vector<vector<char>> date(H, vector<char>(W));
  for (int i = 0; i < H; i++) {
    for (int j = 0; j < W; j++) {
      cin >> date.at(i).at(j);
    }
    for (int j = 0; j < W; j++) {
      cout << date.at(i).at(j);
    }
    cout << endl;
    for (int j = 0; j < W; j++) {
      cout << date.at(i).at(j);
    }
    cout << endl;
  }
}

Measured memory_bytes: 256
#include <stdio.h>
int main(void)
{
    int n, m, a[51]={0}, b[51]={0}, cnt[51]={0}, i;
    scanf("%d%d", &n, &m);
    for(i=0;i<m;i++){
        scanf("%d%d" ,&a[i], &b[i]);
    }

    for(i=0;i<m;i++){
        cnt[a[i]-1]++;
        cnt[b[i]-1]++;
    }

    for(i=0;i<n;i++){
        printf("%d\n", cnt[i]);
    }

    return 0;
}


Measured memory_bytes: 128
#include<cstdio>
using namespace std;
#define MAX 100
#define RESEARCH 1000


int test[MAX][MAX][MAX], i, j, k, n, r, d[300], a, b, c, x[RESEARCH], y[RESEARCH], z[RESEARCH];

int main(){
  while(1){
    scanf("%d %d %d", &a, &b, &c);
    if(a == 0 && b == 0 && c == 0) break;
    scanf("%d", &n);
    for(i = 0; i < a + b + c; i++)
      d[i] = 2;
    for(i = 0; i < a; i++)
      for(j = 0; j < b; j++)
	for(k = 0; k < c; k++)
	  test[i][j][k] = 2;
    for(i = 0; i < n; i++){
      scanf("%d %d %d %d", &x[i], &y[i], &z[i], &r);
      test[x[i] - 1][y[i] - a - 1][z[i] - (a + b) - 1] = r;
      if(r == 1){
	d[x[i] - 1] = 1;
	d[y[i] - 1] = 1;
	d[z[i] - 1] = 1;
      }
    }
    for(i = 0; i < n; i++){
      if(test[x[i] - 1][y[i] - a - 1][z[i] - (a + b) - 1] == 0){
	if(d[x[i] - 1] == 1 && d[y[i] - 1] == 1) d[z[i] - 1] = 0;
	if(d[y[i] - 1] == 1 && d[z[i] - 1] == 1) d[x[i] - 1] = 0;
	if(d[x[i] - 1] == 1 && d[z[i] - 1] == 1) d[y[i] - 1] = 0;
      }
    }
    for(i = 0; i < a + b + c; i++) printf("%d\n", d[i]);
  }
  return 0;
}

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

typedef long long ll;

#define REP(i, n) for(ll i = 0; i < n; i++)
#define REPR(i, n) for(ll i = n; i >= 0; i--)
#define FOR(i, m, n) for(ll i = m; i < n; i++)
#define ALL(obj) (obj).begin(), (obj).end()
#define INF 1e9
#define LINF 1e18


int main() {
    int K; cin >> K;
    int e,o;
    if(K%2==0){
        e = K/2;
        o = K/2;
    }else{
        e = K/2;
        o = K/2+1;
    }
    
    cout << e*o << endl;
    return 0;
}

Measured memory_bytes: 3520
# python3 (3.4.3)
import sys
input = sys.stdin.readline

# main
N = int(input())
S = input().rstrip()

ans = 0
total = 0
for s in S:
    if s=="I":
        total += 1
    else:
        total -= 1
    ans = max(ans,total)

print(ans)

Measured memory_bytes: 3060
#include <vector>
#include <map>
#include <set>
#include <stack>
#include <queue>
#include <algorithm>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <string>
#include <cstring>
#include <complex>
#include <ctime>
#include <cstdlib>

using namespace std;

inline int to_int(string s) {int v; istringstream sin(s); sin >> v; return v;}
template<class T> inline string to_str(T x) {ostringstream sout; sout << x; return sout.str();}

typedef long long ll;

int main()
{
	double x1, y1, x2, y2, x3, y3;
	double a1, b1, c1, a2, b2, c2;
	double ansx, ansy, ansr;
	int n;
	cin >> n;

	while(n--)
	{
		cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3;
		a1 = 2 * (x2 - x1);
		b1 = 2 * (y2 - y1);
		c1 = x1*x1 - x2*x2 + y1*y1 - y2*y2;
		a2 = 2 * (x3 - x1);
		b2 = 2 * (y3 - y1);
		c2 = x1*x1 - x3*x3 + y1*y1 - y3*y3;
		ansx = (b1*c2 - b2*c1)/(a1*b2 - a2*b1);
		ansy = (c1*a2 - c2*a1)/(a1*b2 - a2*b1);
		ansr = sqrt( (x1-ansx)*(x1-ansx) + (y1-ansy)*(y1-ansy) );
		printf("%.3f %.3f %.3f\n", ansx, ansy, ansr);
	}
}

Measured memory_bytes: 1244
N = int(input())
A = list(map(int, input().split()))
assert len(A) == N

def yes():
    S = set(A)
    if A.count(0) == N:
        return True
    if N % 3 != 0:
        return False
    if len(S) == 3:
        a, b, c = tuple(S)
        return all(A.count(x) == N // 3 for x in S) and a ^ b == c
    if len(S) == 2:
        a, b = tuple(S)
        return (a == 0 or b == 0) and A.count(0) == N // 3

print('Yes' if yes() else 'No')


Measured memory_bytes: 14116
#include <bits/stdc++.h>
using namespace std;
int main(void){
    int N;
    int X[101];
    int cost=0;
    int ans=0;
    cin >>N;
    for(int i=0;i<N;i++){
        cin >>X[i];
    }
    for(int p=0;p<100;p++){
        for(int j=0;j<N;j++){
            cost+=(X[j]-p)*(X[j]-p);
        }
        if(p==0)ans=cost;
        else if(ans>cost){
            ans=cost;
        }
        cost=0;
    }
    cout <<ans<< endl;

    return 0;
}


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

int main()
{
    int A,B;
    cin>>A>>B;
    for(int i=1;i<=4000000;i++)
    {
        int X=i*(0.08);
        int Y=i*(0.1);
        if(X==A&&Y==B) { cout<<i<<endl; return 0;}
    }
    cout<<-1<<endl;
}


Measured memory_bytes: 3640
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp> 
#include <ext/pb_ds/tree_policy.hpp> 
#define ll long long int
#define MOD 1000000007
#define oo 1000000000000000000
#define forr(i,n) for(ll i=0;i<n;i++)
#define fastio ios_base::sync_with_stdio(false); cin.tie(0) ; cout.tie(0);
#define all(x) x.begin(),x.end()
#define eb emplace_back
#define pb push_back
#define vect(x) vector<x>
#define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update> 
 
using namespace __gnu_pbds; 
using namespace std;


ll valueOfIndex(ordered_set&s , ll i){ return *(s.find_by_order(i)); }
ll indexOfValue(ordered_set&s , ll x){ return s.order_of_key(x); }

ll add(ll a, ll b,ll p=MOD) { a%=p; b%=p; return (a+b + p)%p;}
ll mul(ll a, ll b,ll p=MOD) { a%=p; b%=p; return ((__int128)a*b + p)%p;}

ll power(ll x,ll n,ll p=MOD){ if(x==0) return 0; if(n==0 || x==1) return 1LL;
    ll r = (power(x,n/2,p))%p; if(n&1) return mul(mul(r,r,p) , x,p); else return mul(r,r,p);
}




void solve()
{
    ll n;
    cin >> n;
    ll a[n][3];
    forr(i,n)
    {
        cin >> a[i][0] >> a[i][1] >> a[i][2];
    }
    ll dp[n+1][3];
    memset(dp,0,sizeof(dp));
    dp[0][0] = a[0][0];
    dp[0][1] = a[0][1];
    dp[0][2] = a[0][2];
    for(ll i=1;i<n;i++)
    {
        dp[i][0] = a[i][0] + max(dp[i-1][1] ,dp[i-1][2] ) ;
        
        dp[i][1] = a[i][1] + max(dp[i-1][0] ,dp[i-1][2] ) ;
        
        dp[i][2] = a[i][2] + max(dp[i-1][0] ,dp[i-1][1] ) ;
    }
    cout << max(max( dp[n-1][0] , dp[n-1][1] ) , dp[n-1][2] );
    
}


int main()
{
    
    
    fastio
    
    ll tc=1;
   // read(tc);
    while(tc--)
    {
        solve();
    }
    
    return 0;
}

Measured memory_bytes: 4992
#include <cstdio>
#include <algorithm>
using namespace std;
typedef long long ll;
const int N=200010;
int n;
int a[N];
inline int abs(int x){
	return x>=0?x:-x;
}
void readData(){
	scanf("%d",&n);
	for(int i=1;i<=n;i++){
		scanf("%d",&a[i]);
		a[i]-=i;
	}
}
void solve(){
	sort(a+1,a+1+n);
	int mid=a[(n+1)>>1];
	ll ans=0;
	for(int i=1;i<=n;i++)
		ans+=abs(mid-a[i]);
	printf("%lld\n",ans);
}
int main(){
	readData();
	solve();
	return 0;
}


Measured memory_bytes: 896
#include <iostream>
#include <cmath>

using namespace std;

int main(){
  int e,ee,m,x,y,z;
  while (true){
    cin >> e;
    if (!e)
      break;
    x = 0;
    y = 0;
    z = 0;
    m = e;
    while(e>=z*z*z){
      ee = e;
      ee -= z*z*z;
      y =  int(sqrt(ee));
      ee -= y*y;
      x = ee;
      if (m>x+y+z)
	m = x+y+z;
      z++;
    }
    z--;
    cout << m << endl;
  }
  return 0;
}

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

int main() {
  string s;
  cin >> s;
  int count = 0;
  for ( int i = 0; i < 3; i++ ) {
    if (s.at(i) == '1') {
      count ++; 
    }
  }
  cout << count << endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <stdio.h>
#include <queue>
#include <stack>
#include <string.h>
#include <algorithm>
#include <math.h>
#include <map>
#include <set>
#include <vector>
#include <bits/stdc++.h>
#define debug(a) cout<<" ++ "<<a<<" ++ "<<endl;
using namespace std;
const int maxn = 1000005;

int mx[5000005];
int res = 0;
void bulid(int l,int r,int rt)
{
	if(l == r)
	{
		mx[rt] = 0;
		return;
	}
	int mid = (l + r)/2;
	bulid(l,mid,rt*2);
	bulid(mid+1,r,rt*2+1);
	mx[rt] = mx[rt*2] + mx[rt*2+1];
}

void update(int l,int r,int rt,int idex,int num)
{
	if(l==r)
	{
		mx[rt] += num;
		return ;
	}
	int mid = (l + r) / 2;
	if(mid >= idex) update(l,mid,rt*2,idex,num);
	else update(mid+1,r,rt*2+1,idex,num);
	mx[rt] = mx[rt*2] + mx[rt*2+1];
}
void query(int l,int r,int rt,int ll,int rr)
{
	if(l>=ll&&r<=rr)
	{
		res += mx[rt];
		return ;
	}
	int mid=(l+r)/2;
	if(mid>=ll) query(l,mid,rt*2,ll,rr);
	if(mid<rr) query(mid+1,r,rt*2+1,ll,rr);
}
int main()
{
	int n,q;
	scanf("%d %d",&n,&q);
	bulid(1,n,1);
	while(q--)
	{
		int op,x,y;
		scanf("%d %d %d",&op,&x,&y);
		if(op == 0)
			update(1,n,1,x,y);
		else
		{
			res = 0;
			query(1,n,1,x,y);
			printf("%d\n",res);
		}
	}
	return 0;
}



Measured memory_bytes: 4252
n, m = map(int, input().split())

num = []
i = 1
while i * i <= m:
    if m % i == 0:
        num.append(i)
        if m // i != i:
            num.append(m//i)
    i += 1

ans = 0
for i in num:
    if i <= m // n:
        ans = max(ans, i)

print(ans)

Measured memory_bytes: 3060
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll,ll> ii;
const int N=2e6+20;
char s[N];
int main()
{
	while(scanf("%s",s+1)!=EOF)
	{
		int n=strlen(s+1);
		int cnt=0;
		if(s[1]==s[n])
			cnt=n-3;
		else
			cnt=n-2;
		if(cnt%2)
			puts("First");
		else
			puts("Second");
	}
    return 0;
}

Measured memory_bytes: 384
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < n; ++i)
#define ll long long
#define P pair<int,int>
#define fast_io ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
const int MOD = 1000000007;
const int INF = 2002002002;
const ll LLINF = 9009009009009009009;
using namespace std;

int main() {
    fast_io
    int n;
    cin >> n;
    cout << (n+1) / 2 << endl;
    return 0;
}

Measured memory_bytes: 256
N, M = map(int, input().split())
ks = []
for i in range(M):
  tmp = list(map(int, input().split()))
  ks.append(tmp)
p = list(map(int, input().split()))

total = 0
for i in range(int(2**N)):
  bin_val = bin(i)				# 2進数に変換
  bin_val = str(bin_val[2:])	# 先頭２文字を除外し、文字列に変換
  bin_val = bin_val.zfill(N)	# N桁になるように先頭に0を追加
#  print(bin_val)
  
  flag = 1
  for j in range(M):
    count = 0
    k = ks[j][0]
    s = ks[j][1:k+1]
    for l in range(k):      
      if bin_val[s[l]-1] == '1':
        count += 1
    if count % 2 != p[j]:
      flag = 0
      break
  if flag == 1:
    total += 1
print(total)



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

#define int long long
#define w cout
#define e '\n'
#define sz(x) (int)x.size()
template<class T, class U> inline istream& operator>>(istream& str, pair<T, U> &p) { return str >> p.first >> p.second; }
template<class T> inline istream& operator>>(istream& str, vector<T> &a) { for (auto &i : a) str >> i; return str; }

const int N = 1e6 + 10 , mod = 1e9 + 7;

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


Measured memory_bytes: 256
#include<iostream>
#include<algorithm>
#include<string>
#include<vector>
#include<queue>
#include<map>
#include<set>
#include<cmath>
using namespace std;
#define REP(i, limit) for(int i=0; i< limit; ++i)
#define FOR(i, j, limit) for(int i=j; i< limit; ++i)
#define DUMP(a) REP(d,a.size()){cout<<a[d];if(d!=a.size()-1)cout<<" ";else cout<<endl;}
#define ECHO(x) cout<<x<<endl;
#define MEMSET(a, n, x) REP(i, n) a[i]=x;
#define ARRIN(a, n) REP(i, n) cin>>a[i];
#define LL long long
int INF = 2147483647;
LL LINF = 9223372036854775807;
LL MOD = 1000000007;
typedef pair<int, int>P;
typedef pair<LL, LL>PL;
typedef vector<int> vi;
typedef vector<LL> vl;


int main(){
  int n, m, r;
  cin>>n>>m>>r;
  vector<int> rv(r);
  int a, b, c;
  vector<vector<LL>> edge(n, vector<LL> (n, 2000000000));
  REP(i, r){
    cin>>rv[i];
    --rv[i];
  }
  sort(rv.begin(), rv.end());
  REP(i, m){
    cin>>a>>b>>c;
    --a;
    --b;
    edge[a][b]=c;
    edge[b][a]=c;
  }

  REP(k, n){
    REP(i, n){
      REP(j, n){
        edge[i][j] = min(edge[i][j], edge[i][k]+edge[k][j]);
        edge[j][i]=edge[i][j];
      }
    }
  }
  LL ans=LINF, work;
  do{
    work=0;
    REP(i, r-1) work+= edge[rv[i]][rv[i+1]];
    ans=min(ans, work);
  }while(next_permutation(rv.begin(), rv.end()));
  ECHO(ans);

  return 0;
}


Measured memory_bytes: 512
#include <bits/stdc++.h>
#define pb push_back
#define boostup ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
typedef long long int ll;
using namespace std;
int main()
{
    boostup;
    ll n;
    ll a,b;
    cin>>n>>a>>b;
    ll d=ceil((double)a/(double)n);
    ll i,j;
    ll cnt=0;
    for(i=d*n;i<=b;i+=n)
    {
        cnt++;
        break;
    }
    if(cnt==0)
    {
        cout<<"NG"<<endl;
    }
    else
    {
        cout<<"OK"<<endl;
    }
}

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

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

	int temp = 0;
	for (int i = 0; i < S.length(); i++) {
		if (S[i] == 'o') {
			temp++;
		}
	}

	if (temp + (15 - S.length()) >= 8) {
		cout << "YES" << endl;
	}
	else {
		cout << "NO" << endl;
	}



	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <cstring>
#include <string>
#include <vector>
#include <iostream>
#include <cstdio>
#include <cstring>
#include <string>
#include <vector>
#include <algorithm>
#include <cmath>
#include <numeric>
#include <cassert>
#include <memory>
#include <stack>
#include <set>

#define MAX_SIZE 100000000
typedef unsigned long long ull;
using namespace std;

int main() {
  int n; cin >> n;
  if(n % 2 == 0 || n == 1 || n == 9) {
    cout << "NO" << endl;
  } else {
    cout << "YES" << endl;
  }
}


Measured memory_bytes: 256
#include <stdio.h>
int main(void){
  int N, M, i;
  int flag=0;
  double sum = 0;
  scanf("%d %d", &N, &M);
  int a[N];
  for(i=0;i<N;i++){
    scanf("%d",&a[i]);
    sum += a[i];
  }
  
  for(i=0;i<N;i++)
    if(a[i]*4*M >= sum)
     flag++;
  
  
  if(flag >= M)
    printf("Yes\n");
  else
    printf("No\n");
  
  return 0;
}

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

int main(){
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    cout.precision(12);
    cout.setf(ios_base::fixed, ios_base::floatfield);
    
    double l;
    cin >> l;
    cout << pow(l/3.0, 3.0) << endl;
    
    return 0;
}

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

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

#define io ios_base::sync_with_stdio(false)
#define pb push_back
#define eb emplace_back
#define mod    1000000007
#define PI 2*acos(0.0)

bool cmp(int a, int b)
{
    return abs(a)> abs(b);
}


int32_t main()
{
    io;
    int n, k;
    cin>>n>>k;
    int pn = 0;
    vi inp(n);
    for(int i= 0; i< n;i++)
    {
        cin>>inp[i];
        pn += (inp[i] >= 0);
    }
    if(n == k)
    {
        ll ans = 1;
        for(auto x: inp)
            ans = (ans*x)%mod;
        cout<<(ans + mod)%mod;
    }
    else if(pn == 0)
    {
        if(k&1)
            sort(inp.rbegin(), inp.rend());
        else
            sort(inp.begin(), inp.end());
        ll ans = 1;
        for(int i = 0; i<k; i++)
            ans  =(ans*inp[i])%mod;
        cout<<(ans+mod)%mod;
    }
    else
    {
        sort(inp.begin(), inp.end(), cmp);
        int ap = 0, ln = n, lp = n, fn = n, fp = n;
        ll ans = 1;
        for(int i = 0; i< k; i++)
        {
            if(inp[i] >= 0)
            {
                ap++;
                lp = i;
            }
            else
                ln = i;
        }
        for(int i = n; i >= k; i--)
        {
            if(inp[i] >= 0)
                fp = i;
            else
                fn = i;
        }
        if((k-ap)%2 == 0)
        {
            for(int i = 0; i<k ;i++)
                ans = (ans*inp[i])%mod;
            return cout<<(ans + mod)%mod, 0;
        }
        inp.pb(0);
        if(lp == n || 1LL*inp[lp] * inp[fp] >= 1LL*inp[ln]*inp[fn])
            swap(inp[ln] , inp[fp]);
        else
            swap(inp[lp], inp[fn]);
        for(int i = 0; i< k ;i++)
            ans = (ans*inp[i])%mod;
        cout<<(ans +mod)%mod;
    }
    return 0;
}

Measured memory_bytes: 4828
#include <bits/stdc++.h>
using namespace std;
int main(){
int N, K; cin >> N >> K;
vector<int> x(N);
for(int i = 0; i < N; i++){cin >> x[i];}
int ans = 1e9;
for(int i = 0; i <= N - K; i++){
int min1, max_K, min_K;
max_K = x[i + K - 1];
min_K = x[i];
if(min_K >= 0) min1 = max_K;
else if(max_K <= 0) min1 = -min_K;
else min1 = min(abs(min_K)*2+max_K , max_K*2+abs(min_K)) ;
ans = min(ans, min1);
}
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 640
n, c = map(int, input().split())
xv = []
for _ in range(n):
    x, v = map(int, input().split())
    xv.append((x, v))
r1 = [0]
r2 = [0]
px = 0
for x, v in xv:
    r1.append(r1[-1]+v-(x-px))
    r2.append(r2[-1]+v-2*(x-px))
    px = x
l1 = [0]
l2 = [0]
px = 0
for x, v in reversed(xv):
    x = c-x
    l1.append(l1[-1]+v-(x-px))
    l2.append(l2[-1]+v-2*(x-px))
    px = x
def accu_max(li):
    mx = -1
    for i in range(n+1):
        if li[i]>mx:
            mx = li[i]
        else:
            li[i] = mx
accu_max(r1)
accu_max(r2)
accu_max(l1)
accu_max(l2)
ans = 0
for i in range(n+1):
    ans = max(ans, r1[i]+l2[n-i])
    ans = max(ans, l1[i]+r2[n-i])
print(ans)

Measured memory_bytes: 43236
#include<iostream>
#include<string>
using namespace std;
int main()
{
	string str;
	cin >>str;
	bool flag_C=false,flag_F=false;
	for(int i=0;str[i];i++)
	{
		if(str[i]=='C')
			flag_C=true;
		if(str[i]=='F'&&flag_C)
			flag_F=true;
	}
	if(flag_C&&flag_F)
		cout <<"Yes"<<endl;
	else
		cout <<"No"<<endl;
	return 0;
}

Measured memory_bytes: 256
#include <cstdio>
#include <cstring>
#include <iostream>
#include <string>
#include <cmath>
#include <bitset>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <algorithm>
#include <complex>
#include <unordered_map>
#include <unordered_set>
#include <random>
#include <cassert>
using namespace std;
typedef long long int ll;
typedef pair<int, int> P;

int main()
{
	double t, x;
	cin>>t>>x;
	printf("%.9lf\n", t/x);
	return 0;
}

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

long long mod = 1000000007;

void Main() {
  int a, b, c;
  cin >> a >> b >> c;
  cout << max(c - (a - b), 0) << endl;
}

int main() {
  std::cin.tie(nullptr);
  std::ios_base::sync_with_stdio(false);
  std::cout << std::fixed << std::setprecision(15);
  Main();
  return 0;
}

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

using namespace std;
typedef long long ll;

int main(){
  int N; scanf("%d", &N);
  vector<ll> h(N);
  for(int i = 0 ; i < N; i++){
    int a; scanf("%lld", &a); a--; h[a] = i;
  }
  
  set<ll> s;
  
  s.insert(-1); s.insert(N);
  ll ans = 0;
  for(int a = 0; a < N; a++){ 
    s.insert(h[a]);
    auto itr = s.lower_bound(h[a]);
    
    auto r1 = itr; auto r2 = itr;
    r1--; r2++;
    
    ans += (a+1)*(*r2-*itr)*(*itr-*r1);
  }
  
  printf("%lld\n",ans);
  
  return 0;
}
 

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

#define pout(n)  printf ("%d\n", n)
#define rep(i,a,n) for (int i = a;i < n;i++)
#define per(i,n,a) for (int i = n-1;i >= a;i--)
 
typedef long long ll;
using namespace std;
 
int main() {
  int n,k,a = 0;
  cin >> n >> k;

  int l[n];
  rep(i,0,n){
    cin >> l[i];
  }
  sort(l,l+n);
  reverse(l,l+n);

  rep(i,0,k){
    a += l[i];
  }
  pout(a);

	return 0;
}

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

using namespace std;

#define ll long long
#define Coming ios_base :: sync_with_stdio(0);cin.tie(0);cout.tie(0); 
#define endl "\n"

int main()
{
	Coming 
	
	ll n, arr[100005], brr[100005];
	
	cin >> n;
	
	for(ll i = 1; i <= n; i++) cin >> arr[i];
	
	brr[n+1] = 0;
	
	for(ll i = n; i >= 1; i--)
	{
		brr[i] = __gcd(brr[i+1], arr[i]);
	}
	
	ll ans = brr[2],  sum = 0,sum2;
	
	if(n >= 3)
	{
	
	for(ll i = 1; i <= n-2; i++)
	{
	    sum = __gcd(sum, arr[i]);
	    sum2 = __gcd(sum,brr[i+2]);
	    ans = max(ans, sum2);	
	}
	
    }	
	sum2 = __gcd(sum, arr[n-1]);
	ans = max(sum2, ans);
	ans = max(ans, brr[1]);
	
	cout << ans << endl;
	
	return 0;
}


Measured memory_bytes: 1792
#coding: utf-8
A,B,K = map(int, input().split() )

for i in range(K):
    if i%2 ==0: #odd
        if A%2 == 1:
            A = A-1
        tmp = A/2
        A = A-tmp
        B = B+tmp
    else : #even
        if B % 2 ==1:
            B = B-1
        tmp = B/2
        A = A + tmp
        B = B - tmp

print(int(A),int(B))

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

#define rep(i,n) for(int i=0;i<(n);i++)

using namespace std;

int main(){
	int a[]={0,31,28,31,30,31,30,31,31,30,31,30,31};
	int x,y; cin>>x>>y;
	cout<<(a[x]==a[y]?"Yes":"No")<<endl;
	return 0;
}


Measured memory_bytes: 256
import java.util.Scanner;

class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		long N = sc.nextLong(), K = 1;
		while(K * (K + 1) < 2 * N) K++;
		// K * (K + 1) / 2 > N

		for(long k = K; k >= 0; k--) {
			if(N >= k) {
				System.out.println(k);
				N -= k;
			}
			if(N == 0) break;
		}
	}
}

Measured memory_bytes: 23764
def main():
    from sys import exit
    n = int(input())
    a = [int(e) for e in input().split()]
    b = [int(e) for e in input().split()]
    result = 0
    q = [i for i in range(n) if b[i] != a[i]]
    while len(q) != 0:
        nq = []
        c = 0
        for i in q:
            if i == 0 or i == n - 1:
                j = b[(n + i - 1) % n] + b[(n + i + 1) % n]
            else:
                j = b[i - 1] + b[i + 1]
            if j > b[i] - a[i]:
                nq.append(i)
                continue
            c += 1
            k = (b[i] - a[i]) // j
            result += k
            b[i] -= j * k
            if a[i] != b[i]:
                nq.append(i)
        if c == 0 and len(nq) != 0:
            print(-1)
            exit()
        q = nq
    print(result)


main()


Measured memory_bytes: 33752
import math
import copy

#n = int(input())
k, x = [int(i) for i in input().split()]
#table = [[int(i) for i in input().split()] for j in range(n)]
#table = [list(input()) for n in range(h)]
#s = [int(i) for i in input().split()]
#num = [int(i) for i in range(n)]
#s = [input() for i in range(n)]
#s = input()
#list = list(s)
#dp = [[0 for _ in range(2)] for _ in range(13)]

kotae = [0 for i in range(2*k-1)]

for i in range(0,2*k-1) :
    kotae[i] = x-k+1+i

print(*kotae)

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

#define task "D"
#define ALL(v) (v).begin(), (v).end()
#define rep(i, l, r) for (ll i = (l); i <= (r); ++i)
#define Rep(i, r, l) for (ll i = (r); i >= (l); --i)
#define pb push_back
#define F first
#define S second
#define by(x) [](const auto& a, const auto& b) { return a.x < b.x; } // sort(arr, arr + N, by(a));
#define sz(v) v.size()
using ll = long long;
using ld = long double;
using ull = unsigned long long;

using namespace std;

typedef pair<ll,ll> ii;
typedef vector<ll> vi;
typedef vector<ii> vii;
typedef vector<ll> vl;

// Limit
const ll N=103,INF=1e9;
// Struct

// Variables
ll n,W,w[N],v[N],res;
vi val[4];
// Function

int main()
{
	//freopen(task".in","r",stdin);
	//freopen(task".out","w",stdout);
	ios_base::sync_with_stdio(false);cin.tie(nullptr);
	cin >> n >> W;
	rep(i,1,n) cin >> w[i] >> v[i];
	rep(i,1,n) val[w[i]-w[1]].pb(v[i]);
	rep(i,0,3)
	{
	    val[i].pb(INF);
	    sort(ALL(val[i]),greater<ll>());
	    val[i][0]=0;
	    rep(j,1,sz(val[i])-1) val[i][j]+=val[i][j-1];
	}
	rep(i,0,sz(val[0])-1) rep(j,0,sz(val[1])-1) rep(k,0,sz(val[2])-1) rep(l,0,sz(val[3])-1)
	{
	    ll cur_w=w[1]*i+(w[1]+1)*j+(w[1]+2)*k+(w[1]+3)*l;
	    if (cur_w>W) break;
	    res=max(res,val[0][i]+val[1][j]+val[2][k]+val[3][l]);
	    //cout << res << '\n';
	}
	cout << res;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define PI 				acos(-1)
#define mp				make_pair
#define pb				push_back
#define all(a)			(a).begin(), (a).end()
#define srt(a)			sort(all(a))
#define mem(a, h)		memset(a, (h), sizeof(a))
#define f 				first
#define s 				second
#define MOD				1000000007
#define MOD1			998244353
#define EPS				1e-9
#define fore(i, b, e)	for(int i = b; i < e; i++)
#define forg(i, b, e, m)	for(int i = b; i < e; i+=m)

using namespace std;

typedef long long 		ll;
typedef unsigned long long 		ull;
typedef pair<int, int>  ii;
typedef vector<int>     vi;
typedef vector<ii>      vii;
typedef vector<ll>      vll;
const int tam = 10000010;

int main()
{
	ios::sync_with_stdio(false); cin.tie(0);
	//freopen("asd1.txt", "r", stdin);
	//freopen("asd.txt", "w", stdout);
	int n, m;
	cin>>n>>m;
	pair<int,int> ar[n];
	fore(i, 0, n)
		cin>>ar[i].f>>ar[i].s;
	sort(ar, ar + n);
	ll pre = 0;
	int i = 0;
	while(m > 0)
	{
		//cout<<m<<' '<<ar[i].f<<' '<<ar[i].s<<'\n';
		pre += (ll)ar[i].f * (ar[i].s > m ?  m : ar[i].s);
		m -= ar[i].s;
		//cout<<m<<' '<<ar[i].f<<' '<<ar[i].s<<'\n';
		i++;
	}
	cout<<pre<<'\n';	
	return 0;
}

// read the question correctly (is y a vowel? what are the exact constraints?)
// look out for SPECIAL CASES (n=1?) and overflow (ll vs int?) ARRAY OUT OF BOUNDSS2

Measured memory_bytes: 1024
#include<iostream>
#include<stack>
#include<string>
#include<vector>
#include<algorithm>  
using namespace std;
  
int main()
{
    stack<int> S1;
    stack<pair<int, int> > S2;
    char c;
    int sum=0;
    int i,j,a;
    for(i=0; cin >> c ;i++)
    {
        if(c=='\\') S1.push(i);
        else if(c=='/' && S1.size()>0)
        {
            j=S1.top();
            S1.pop();
            sum+=i-j;
            a=i-j;
            while(S2.size()>0 && S2.top().first>j)
            {
                a+=S2.top().second;
                S2.pop();
            }
            S2.push(make_pair(j,a));
        }
    }
      
    vector<int> ans;
    while(S2.size()>0)
    {
        ans.push_back(S2.top().second);
        S2.pop();
    }
    reverse(ans.begin(), ans.end());
    cout << sum << endl;
    cout << ans.size();
    for(i=0;i<ans.size();i++)
    {
       cout << " ";
       cout << ans[i];
    }
    cout << endl;
      
    return 0;
}

Measured memory_bytes: 3180
open System 

let R() = Console.ReadLine()

let f (xs: int array): int =
    let len = Array.length xs
    if len % 2 <> 0 then 
        0
    else
        let xs = Array.sort xs 
        let l = len / 2 - 1 
        let r = len / 2
        xs.[r] - xs.[l]

let _ = R()
let d = R().Split() |> Array.map (string>>int)

f d 
|> printfn "%i"

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

ll mod=1000000007;

ll f(ll x,vector<ll>&dp){
  if(x==1){
    dp.at(x)=1;
    return dp.at(x);
  }
  else if(x==2){
    dp.at(x)=2;
    return dp.at(x);
  }
  if(dp.at(x)!=0){
    return dp.at(x);
  }
  else{
    dp.at(x)=(f(x-2,dp)%mod+f(x-1,dp)%mod)%mod;
    return dp.at(x);
  }
}

int main(){
  ll n,m;cin>>n>>m;
  vector<ll>dp(n+1,0);
  if(m==0){
    cout <<f(n,dp)<<endl;
    return 0;
  }
  vector<ll>a(m);
  cin>>a.at(0);
  for(ll i=1;i<m;i++){
    cin>>a.at(i);
    if(a.at(i)-a.at(i-1)==1){
      cout <<0<<endl;
      return 0;
    }
  }
  vector<ll>s(m+1,0);
  if(m==1){
    s.at(0)=a.at(0)-1;
    s.at(1)=n-a.at(0)-1;
  }
  else{
    for(ll i=0;i<m;i++){
      if(i==0){
        s.at(i)=a.at(i)-1;
      }
      else {
        s.at(i)=a.at(i)-a.at(i-1)-2;
      }
    }
    s.at(m)=n-a.at(m-1)-1;
  }
  ll ans=1;
  for(ll i=0;i<m+1;i++){
    if(s.at(i)==0)continue;
    ans*=f(s.at(i),dp);
    ans%=mod;
  }
  cout <<ans<<endl;
}

Measured memory_bytes: 5576
/*
 push yourself until you succed
*/
#include <bits/stdc++.h>
#define fast_io ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define set_zero(a) memset(a,0,sizeof(a));
#define ll long long int
#define PI 2 * acos(0.0)
#define MAX 1000000000000000000
#define in(a) scanf("%d",&a);
#define out(a) printf("%d",a);
#define INF 1000000 
#define M 1000000007
#define pi 3.14159265 
using namespace std; 
int main(){ 
   fast_io
   ll x;
   cin>>x;
   if(x == 0) cout<<1<<endl;
   else if(x == 1) cout<<0<<endl;
   return 0;
} 

Measured memory_bytes: 3640
main(x,y,z,e,m){for(;scanf("%d",&e),m=e;printf("%d\n",m))for(z=0;z*z*z<=e;z++)for(y=0;y*y+z*z*z<=e;y++)if(x=e-z*z*z-y*y,m>x+y+z)m=x+y+z;exit(0);}

Measured memory_bytes: 0
# -*- coding: utf-8 -*-
s = list(input())

n = len(s)
ans = 0
tmp = []
for i in range(n):
    if len(tmp) != 0 and s[i] == '0' and tmp[len(tmp) - 1] == '1':
        tmp.pop()
        ans += 2
    elif len(tmp) != 0 and s[i] == '1' and tmp[len(tmp) - 1] == '0':
        tmp.pop()
        ans += 2
    else:
        tmp.append(s[i])
    #print(tmp)
print(ans)


Measured memory_bytes: 4652
#include<bits/stdc++.h>
using namespace std;
int n,C[3003][3003],AN[3003],a;
int main() {
	scanf("%d",&n),C[0][0]=1;
	for(int i=1; i<=n; i++) {
		C[i][0]=1;
		for(int j=0; j<=i; j++)C[i][j]=(C[i-1][j]+C[i-1][j-1])%n;
	}
	for(int i=0; i<n; i++) {
		scanf("%d",&a);
		if(a) {
			a=1;
			for(int j=n-1; j>=0; j--) {
				(AN[j]-=C[n-1][j]*a)%=n;
				(a*=-i)%=n;
			}
			AN[0]=(AN[0]+1)%n;
		}
	}
	for(int i=0; i<n; i++)printf("%d ",(AN[i]+n)%n);
	return 0;
}


Measured memory_bytes: 34176
#define _CRT_SECURE_NO_WARNINGS
#include <cstdio>

using namespace std;

int main()
{
    int R, G;
    if (scanf("%d%d", &R, &G) < 2) return 0;

    //(R + X) / 2 = G
    //X = 2G - R

    printf("%d\n", 2 * G - R);
    return 0;
}


Measured memory_bytes: 128
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define zero_pad(num) setfill('0') << std::right << setw(num)
using namespace std;
using ll = long long;
using ld = long double;
using P = pair<int, int>;

int main() {
    int n, k;
    cin >> n >> k;
    if(k > (n - 1) * (n - 2) / 2){
        cout << -1 << endl;
        return 0;
    }
    cout << n - 1 + (n - 1) * (n - 2) / 2 - k << endl;
    rep(i, n - 1)cout << "1 " << i + 2 << endl;
    int cnt = 1;
    for(int i = 1; i < n - 1; i++){
        for(int j = i + 1; j < n; j++){
            if(cnt > (n - 1) * (n - 2) / 2 - k)return 0;
            cout << i + 1 << ' ' << j + 1 << endl;
            cnt++;
        }
    }
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <cstring>
#include <cstdlib>
#include <cmath>
using namespace std;
using ll = long long;

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

    int n;
    cin >> n;

    vector<int> l(n);
    for (int i = 0; i < n; i++) {
        cin >> l[i];
    }
    sort(l.begin(), l.end());

    int r = 0;
    for (int i = 2; i < n; i++) {
        for (int j = 1; j < i; j++) {
            auto end = l.begin() + j;
            auto it = upper_bound(l.begin(), end, l[i] - l[j]);
            r += end - it;
        }
    }

    cout << r << endl;

    return 0;
}

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

// definition {{{ 1

// scaning {{{ 2
#define Scd(x) scanf("%d", &x)
#define Scd2(x,y) scanf("%d%d", &x, &y)
#define Scd3(x,y,z) scanf("%d%d%d", &x, &y, &z)

#define Scll(x) scanf("%llu", &x)
#define Scll2(x,y) scanf("%llu%llu", &x, &y)
#define Scll3(x,y,z) scanf("%llu%llu%llu", &x, &y, &z)

#define Scc(c) scanf("%c", &c);
#define Scs(s) scanf("%s", s);
#define Scstr(s) scanf("%s", &s);
// }}} 2

// constants {{{ 2
#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))
// }}} 2

// systems {{{ 2
#define Rep(x,y) for(int x = 0; x < y; x++)
#define Repe(x,y,z) for(int x = z; x < y; x++)
// }}} 2

// output {{{ 2
#define YesNo(a) (a)?printf("Yes\n"):printf("No\n");
// }}} 2

// }}} 1

int main() {

    int n;
    int a[300];
    float sum = 0;

    Scd(n);
    Rep(i,n){
        Scd(a[i]);
        sum += a[i];
    }

    sum /= n;

    float tmp = INF;
    int ans = 0;

    for( int i = n-1; i >= 0; i-- ){
        if( tmp >= abs<float>( sum - (float)a[i] ) ){
            ans = i;
            tmp = abs<float>( sum - (float)a[i] );
        }
    }


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

    return 0;
}



Measured memory_bytes: 512
//============================================================================
// Name        : DPpractice.cpp
// Author      :
// Version     :
// Copyright   : Your copyright notice
// Description : Hello World in C++, Ansi-style
//============================================================================

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

int n, x;
int v[55] = {0};
bool dp[55][1000005];
int p[1000005] = {0};

int main() {
	while(true){
	for(int i = 2; i < 1000005; i++){
		if(p[i] == 0){
			int now = 2;
			while(now * i < 1000005){
				p[i * now] = 1;
				now++;
			}
		}
	}
	cin >> n >> x;
	if(n == 0 && x == 0) return 0;
	std:memset(dp, false, sizeof(dp));
	for(int i = 0; i < n; i++) cin >> v[i];
	dp[0][0] = true;
	for(int i = 0; i < n; i++){
		for(int j = 0; j <= x; j++){
			if(dp[i][j]){
				int now = 0;
				while(j + now * v[i] <= x){
					dp[i + 1][j + now * v[i]] = true;
					now++;
				}
			}
		}
	}
	int res = 0;
	for(int i = 2; i <= x; i++){
		if(dp[n][i]){
			if(p[i] == 0) res = i;
		}
	}
	if(res == 0){
		cout << "NA" << endl;
		continue;
	}
	cout << res << endl;
}
	return 0;
}



Measured memory_bytes: 60612
#include <stdio.h>
int main(void){
  int N;
  int A,B;
  scanf("%d",&N);
  if(N==1){
    printf("Hello World");
  }
  else if(N==2){
    scanf("%d",&A);
    scanf("%d",&B);
    printf("%d",A+B);
  }
  return 0;
}

Measured memory_bytes: 128
#include <bits/stdc++.h>
const int INF = 1e9;
const int MOD = 1e9+7;
const long long LINF = 1e18;
#define dump(x)  cout << 'x' << ' = ' << (x) << ` `;
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define rep(i,n) for(int i=0;i<(n);++i)
#define REPR(i,n) for(int i=n;i>=0;i--)
#define FOREACH(x,a) for(auto& (x) : (a) )
typedef long long ll;
using namespace std;
typedef pair<ll, ll> P;

template<typename T>
void print(const vector<T> &x) {
    int n = x.size();
    rep(i,n) {
        cout << x[i];
        if (i!=n-1) cout<<" ";
        else cout << endl;
    }
}

template<typename T>
void print(const vector<vector<T>> &x) {
    int n = x.size();
    rep(i,n) {
        rep(j,x[i].size()) {
            cout << x[i][j] << " ";
        }
        cout << endl;
    }
}

template<typename T>
void print(const vector<T> &x, int n) {
    rep(i,n) {
        cout << x[i];
        if (i!=n-1) cout<<" ";
        else cout << endl;
    }
}

template<typename T>
void print(const vector<vector<T>> &x, int n, int m) {
    rep(i,n) {
        rep(j,m) {
            cout << x[i][j] << " ";
        }
        cout << endl;
    }
}

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; }

void input_init() {
    cin.tie(0); ios::sync_with_stdio(false);
}

int main(int argc, char const *argv[]) {
    int n; cin>>n;
    vector<int> cnt(n+1);
    auto calc = [&](ll x) {
        for (int x = 1; x*x <= n; ++x) {
            for (int y = 1; y*y <= n; ++y) {
                int X = x*x; int Y = y*y;
                if (X+Y+x*y > n) break;
                int S = X+Y+x*y;
                for (int z = 1; S+z*z+y*z+z*x <= n; ++z) {
                    int Z = z*z;
                    int A = X+Y+Z+x*y+y*z+z*x;
                    if (A <= n) cnt[A]++;
                }
            }
        }
    };
    calc(n);
    for (int i = 1; i <= n; ++i) cout << cnt[i] << '\n';
    return 0;
}

Measured memory_bytes: 3664
#include <cstdio>

int main()
{
	int x, y;
	scanf("%d %d", &x, &y);
	if ((x == 1 or x ==3 or x == 5 or x == 7 or x == 8 or x == 10 or x == 12) and (y == 1 or y == 3 or y == 5 or y == 7 or y == 8 or y == 10 or y == 12))
	{
		printf("Yes");
	}
	else if ((x == 4 or x == 6 or x == 9 or x == 11) and (y == 4 or y == 6 or y == 9 or y == 11))
	{
		printf("Yes");
	}
	else if ((x == 2) and (y == 2))
	{
		printf("Yes");
	}
	else 
	{
		printf("No");
	}
}


Measured memory_bytes: 1724
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, srt, end) for (long long i = (srt); i < (long long)(end); i++)

int main(){
    ll N;
    cin >> N;
    vector<ll> a(N), b(N);
    rep(i, 0, N) cin >> a[i];
    b = a;
    sort(a.begin(), a.end(), greater<ll>());
    rep(i, 0, N){
        if(b[i] == a[0]) cout << a[1] << endl;
        else cout << a[0] << endl;
    }
    return 0;
}

Measured memory_bytes: 4736
#include <iostream>
#include <sstream>
#include <string>
#include <cassert>
#include <cmath>
#include <climits>
#include <cstdio>
#include <cstring>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <stack>
#include <algorithm>
#include <functional>
#include <numeric>
#include <iomanip>

using namespace std;
typedef unsigned int uint;
typedef long long ll;
typedef unsigned long long ull;

#define REP(i,n) for(int i = 0; i < (int)(n); ++i)
#define FOR(i,a,b) for(int i = (a); i < (int)(b); ++i)
#define ALL(c) (c).begin(), (c).end()
#define SIZE(v) ((int)v.size())

#define pb push_back
#define mp make_pair
#define mt make_tuple

ll N, K, R, S, P;
string T;

ll judge(char player, char machine) {
    if (player == 'r' && machine == 's') return R;
    if  (player == 's' && machine == 'p') return S;
    if  (player == 'p' && machine == 'r' ) return P;
    return 0;
}

ll func(vector<char> &arr) {
    ll dp[N][3];
    auto size = SIZE(arr);
    REP(i, size) {
        if (i == 0) {
            dp[i][0] = judge('r', arr[i]);
            dp[i][1] = judge('s', arr[i]);
            dp[i][2] = judge('p', arr[i]);
        } else {
            dp[i][0] = max(dp[i-1][1], dp[i-1][2]) +  judge('r', arr[i]);
            dp[i][1] = max(dp[i-1][2], dp[i-1][0]) +  judge('s', arr[i]);
            dp[i][2] = max(dp[i-1][0], dp[i-1][1]) +  judge('p', arr[i]);
        }
    }
    ll ans = 0;
    REP(j, 3) ans = max(ans, dp[size-1][j]);
    return ans;
}

int main(void)
{
    cin.sync_with_stdio(false);
    cin >> N >> K >> R >> S >> P >> T;

    ll ans = 0;
    REP(k, K) {
        vector<char> arr;
        ll i = k;
        while(i < N) {
            arr.pb(T[i]);
            i += K;
        }
        ans += func(arr);
    }
    cout << ans << endl;
    return 0;
}



Measured memory_bytes: 2944
/*
 * Created by: Son Dinh
 */ 
#include<bits/stdc++.h>

using namespace std;

#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define sqr(x) (x)*(x)
#define sz(X) (int)(X).size()
#define all(x) x.begin(),x.end()

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> pii;

const int mod=1e9+7;

string s1,s2;
int r1,r2;

int n;
int main(){
    cin>>s1;
    s2=s1;
    n=sz(s1);
    for(int i=1;i<n;++i){
        if(s1[i]==s1[i-1]){
            r1++;
            s1[i]=(!(s1[i-1]%2))+48;
        }
    }
    for(int i=n-2;i>=0;--i){
        if(s2[i]==s2[i+1]){
            r2++;
            s2[i]=(!(s2[i+1]%2))+48;
        }
    }
    cout<<min(r1,r2);
    return 0;
}



Measured memory_bytes: 512
#include<bits/stdc++.h>
using namespace std;
int main(){
	int n,k;
	cin>>n>>k;
	vector<int> h(n);
	for(int i = 0; i < n; i++) cin>>h[i];
	vector<long long> dp(n,INT_MAX);
	dp[0] = 0;
	for(int i = 1; i < n; i++){
		for(int j = 1; j <= k; j++){
			if(j <= i) dp[i] = min(dp[i],dp[i-j]+abs(h[i-j]-h[i]));
		}
	}
	cout<<dp[n-1];
}

Measured memory_bytes: 1408
// -*- mode:c++; coding:utf-8; c-basic-offset:2; -*-
// ALDS1_4-A: Linear Search

#include <cstdio>

static int linear_search(const int as[], const int target)
{
  auto i = 0;
  while (as[i] != target) {
    ++i;
  }
  return i;
}

int main()
{
  int n;
  std::scanf("%d", &n);
  int ss[n+1]; // n+1(sentinel)
  for (auto i = 0; i < n; ++i) {
    std::scanf("%d", &ss[i]);
  }

  int q;
  std::scanf("%d", &q);
  auto c = 0u;
  for (auto i = 0; i < q; ++i) {
    int t;
    std::scanf("%d", &t);
    ss[n] = t; // sentinel
    auto j = linear_search(ss, t);
    if (j != n) ++c;
  }

  std::printf("%d\n", c);
}

// eof

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

int main(){
	for(int r=0; r<3; r++){
		int t[2]={};
		for(int i=0; i<2; i++){
			for(int j=0; j<3; j++){
				int a;
				cin >> a;
				t[i] = t[i]*60 +a;
			}
		}
		int s = t[1]-t[0];
		cout << s/3600 << " ";
		s %= 3600;
		cout << s/60 << " " << s%60 << endl;
	}
	return 0;
}



Measured memory_bytes: 3092
function Main(input){
	var a = input.split("\n")[0].split(' ')[0];
  var result="WA";
  	if(a.startsWith('A')&&a.slice(2,a.length-1).split('C').length===2){
      a=a.charAt(1)+a.slice(2,a.length-1).replace('C',"")+a.charAt(a.length-1);
	 if(a.match(/^[a-z]+$/){result="AC"}
    }
  console.log(result)
}
Main(require('fs').readFileSync('/dev/stdin','utf8')); 

Measured memory_bytes: 7372
#include <bits/stdc++.h>
	#include <set>
	#define ll long long 
	#include <string>
	#define pb push_back
	#define mp make_pair
	# define pi 3.14159265358979323846
	#define mod 1000000007
    #define rep(i,n) for(i=0;i<n;i++)
	using namespace std;
	ll int multiply(ll int a,ll int b)
{
	ll int ans=(a%mod*b%mod)%mod;
	return ans;
}
ll int add(ll int a, ll int b)
{
	ll int ans=(a%mod+b%mod)% mod;	
	return ans;
}

	int power(ll int x,  ll int y, ll int p)  
{  
    ll int res = 1;     // Initialize result  
  
    x = x % p; // Update x if it is more than or  
                // equal to p 
   
    if (x == 0) return 0; // In case x is divisible by p; 
  
    while (y > 0)  
    {  
        // If y is odd, multiply x with result  
        if (y & 1)  
            res = (res*x) % p;  
  
        // y must be even now  
        y = y>>1; // y = y/2  
        x = (x*x) % p;  
    }  
    return res;  
}  
	void fastio()
	{					
		#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
	    ios_base::sync_with_stdio(false);
	    cin.tie(NULL);
	    cout.tie(NULL);

	}
	void solve()
	{
		ll int n;
		
		cin>>n;
		ll int all=power(10,n,mod);
		ll int no_0=power(9,n,mod);
		ll int no_9=power(9,n,mod);
		ll int no_09=power(8,n,mod);
		ll int ans=all%mod;
		ll int d=add(no_0,no_9);
		d=add(d,-no_09);
		ans=add(ans,-d);
		
      if (ans<0)
        ans+=mod;
      ans=ans%mod;

        

		cout<<ans<<endl;

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

Measured memory_bytes: 3636