akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;
int main() {
    string S = "";
    string BE = "";
    string AF = "";
    int be = 0;
    int af = 0;
    cin >> S;
    BE = S.at(0);
    BE += S.at(1);
    be = stoi(BE);

    AF = S.at(2);
    AF += S.at(3);
    af = stoi(AF);

    bool isYYMM = false;
    bool isMMYY = false;
    bool isAMB= false;

    if(af < 13 && af > 0){
        isYYMM = true;
    }
    if(be > 0 && be < 13){
        isMMYY = true;
    }
    if(isYYMM && isMMYY){
        isAMB = true;
    }

    if(isYYMM){
        if(isAMB){
            cout << "AMBIGUOUS";
        } else{
            cout << "YYMM";
        }
    } else{
        if(isMMYY){
            cout << "MMYY";
        } else{
            cout << "NA";
        }
    }
    return 0;
}

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

bool cal(long long n) {
  while(n%2 == 0) n /= 2;
  while(n%3 == 0) n /= 3;
  while(n%5 == 0) n /= 5;
 
  if(n == 1) return true;
  else return false;
}


int main() {
  long long m, n;
  while(cin >> m, m) {
    cin >> n;

    long long ans = 0;
    for(int i = m; i <= n; i++) {
      ans += cal(i);
    }
    cout << ans << endl;
  }
}

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


long long a[200001];

int main(){
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    long long d; cin >> d;
    a[i] += d;
    a[i+1] = a[i];
  }
  long long m = a[n-1];
  long long ans = 1e18;
  for (int i = 0; i < n-1; i++) {
    long long t = m - 2 * a[i];
    ans = min(ans, max(t, -t));
  }
  cout << ans << endl;
  return 0;
}


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

int main() {
  double a, b, h, m;
  cin>>a>>b>>h>>m;
  double diff = abs(30 * h + m / 2.0 - 6 * m);
  double ans;
  if (diff == 0) {
    ans = abs(a-b);
  } else if (diff == 180.0) {
    ans = abs(a+b);
  } else {
    if (diff > 180.0) {
      diff = 360 - diff;
    }
    ans = sqrt(1.0 *a*a+1.0*b*b - 2.0*a*b*cos(1.0*diff/180.0*M_PI));
  }
  printf("%.10lf\n", ans);
}

Measured memory_bytes: 4228
#include<iostream>
#include<cmath>
#include<string>
#include<cstdio>

using namespace std;

int main() {
  double a, b, C;
  cin >> a >> b >> C;
  C = C * M_PI / (double)180;

  double S = (double)1/(double)2 * a * b* (double)sin(C);
  double L = a + b + (double)sqrt(pow(a, 2) + pow(b, 2) - ((2 * a *b * (double)cos(C))));
  double h = (double)b * (double)sin(C);

  printf("%0.5f\n", S);
  printf("%0.5f\n", L);
  printf("%0.5f\n", h);



}

Measured memory_bytes: 3652
def n2a(num):
  if num <= 26:
    return chr(ord("a")+num-1)
  elif num % 26 == 0:
    return n2a(num//26 - 1) + chr(ord("z"))
  else:
    return n2a(num//26) + chr(ord("a")-1 + num%26)
    


N = int(input())

print(n2a(N))

Measured memory_bytes: 9176
#include <bits/stdc++.h>
#define REP(i,n) for (int i=0;i<(n);i++)
#define ALL(a) (a).begin(),(a).end()
#define RFOR(i,a,b) for (int i=(b)-1;i>=(a);i--)
#define REP(i,n) for (int i=0;i<(n);i++)
#define RREP(i,n) for (int i=(n)-1;i>=0;i--)
#define ll long long
#define ull unsigned long long
int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};

using namespace std;

int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
	string s[3];
	REP(i,3) cin >> s[i];
	int turn = 0;
	while(true){
		int erase_num = turn;
		if(s[turn].size() == 0)
			{
				if(turn == 0)cout << "A" << endl;
				else if(turn == 1)cout << "B" << endl;
				else cout << "C" << endl;
				return 0;
			}
			
		if(s[turn][0] == 'a')
			turn = 0;
		else if(s[turn][0] == 'b')
			turn = 1;
		else turn = 2;
		s[erase_num].erase(s[erase_num].begin());
		
	}
  return 0;
}


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

int main(void){
	int n, m, mul=0;
	int **A, *B;

	cin >> n >> m;
	A = new int*[n];
	//A[0] = new int[m*n];
	B = new int[m];
	for (int i = 0; i < n; i++){
		A[i] = new int[m];
	}
	
	for (int i = 0; i < n; i++){
		for (int j = 0; j < m; j++){
			cin >> A[i][j];
		}
	}
	for (int i = 0; i < m; i++){
		cin >> B[i];
	}

	for (int i = 0; i < n; i++){
		mul = 0;
		for (int j = 0; j < m; j++){
			mul += A[i][j] * B[j];
		}
		cout << mul << "\n";
	}

	delete[] A[0];
	delete[] A,B;

	return 0;
}

Measured memory_bytes: 1232
// package app;

import java.math.BigDecimal;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
import java.util.Objects;
import java.util.Scanner;
import java.util.stream.Stream;

public class Main {

    public static void main(final String[] args) throws Exception {

        Scanner sc = new Scanner(System.in);

        long N = sc.nextLong();
        int[] d = new int[(int)N];

        for (int i = 0; i < N; i++) {
            d[i] = sc.nextInt();
        }

        long result = 0;
        for (int i = 0; i < N; i++) {
            for (int j = i + 1; j < N; j++) {
                result += d[i] * d[j];
            }
        }

        System.out.println(result);
    }
}

Measured memory_bytes: 22612
#include<bits/stdc++.h>
using namespace std;
#define mem(a) memset(a,0,sizeof(a))
#define dbg(x) cout<<#x<<" = "<<x<<endl
#define ll long long
//不要再爆long long了！！！！！！！！不要再爆long long了！！！！！！！ 

int main()
{
	char c;
	cin>>c;
	cout<<((c>='a'&&c<='z')?('a'):('A'));
	return 0;
}

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

#define ll long long
using namespace std;
int a[301][301];
int main()
{
    ios::sync_with_stdio(false);cin.tie(0);
    int n;
    cin>>n;
    int a=0,b=0,c=0,d=0;
    for (int i=0;i<n;i++){
        string s;
        cin>>s;
        if(s=="AC") a++;
        else if(s=="WA") b++;
        else if(s=="TLE") c++;
        else d++;
    }
    cout<<"AC x"<<" "<<a<<endl;
    cout<<"WA x"<<" "<<b<<endl;
    cout<<"TLE x"<<" "<<c<<endl;
    cout<<"RE x"<<" "<<d<<endl;
    return 0;
}



Measured memory_bytes: 3608
#include<bits/stdc++.h>
#define lld long long int
#define vec vector<lld>
#define pll pair<lld,lld>
#define pb push_back
#define ss second
#define ff first
#define mp make_pair
#define mod 1000000007
#define answer cout<<endl<<"answer : ";
#define messi ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
using namespace std;
int main() {messi //lld t=0;cin>>t;while(t--){
        lld n=0,m=0,k=0,i=0,j=0,p=0,q=0,x=0,y=0,z=0,ans=0,cnt=0;string s;bool flag=false;
        string a,b;
        cin>>a>>b;
        n=a.size();
        m=b.size();
        lld dp[n+1][m+1];
        memset(dp,0,sizeof(dp));
        vector<char> v;
        for(i=0;i<=n;i++)
            for(j=0;j<=m;j++)
            {
                if(i==0 || j==0) dp[i][j]=0;
                else if(a[i-1]==b[j-1])
                    dp[i][j]=1+dp[i-1][j-1];
                else
                    dp[i][j]=max(dp[i-1][j],dp[i][j-1]);
            }
            i=n,j=m;
            while(i>0 && j>0)
            {
                //cout<<i<<" , "<<j<<endl;
                if(a[i-1]==b[j-1])
                    v.pb(a[i-1]),i--,j--;
                else
                {
                    if(dp[i-1][j]>dp[i][j-1])
                        i--;
                    else
                        j--;
                }
            }
            if(v.size()>0)
                for(i=v.size()-1;i>=0;i--)
                    cout<<v[i];
            cout<<endl;
    //}
	return 0;
}
/*  CODED BY:-
           __        __
 /\   /\  |__)  /\  |  \ |__| \ /  /\
/~~\ /~~\ |  \ /~~\ |__/ |  |  |  /~~\

*/


Measured memory_bytes: 70656
#include <iostream>
#include <cstdio>
#include <vector>
#include <string>
#include <array>
#include <queue>
#include <deque>
#include <set>
#include <list>
#include <map>
#include <stack>
#include <utility>
#include <algorithm>
#include <numeric>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <cctype>
#include <cstring>
#include <climits>
#include <bitset>
#include <random>
#include <functional>
#include <sstream>
#include <iomanip>

using namespace std;

#define _CRT_SECURE_NO_WARNINGS
#define rep(i, n) for(int i=0; i<(n); i++)
#define FOR(i, m, n) for(int i=(m);i<(n);i++)
#define SZ(x) ((int)(x).size())
#define ALL(x) (x).begin(),(x).end()
#define SORT(x) sort((x).begin(),(x).end())
#define REVE(x) reverse((x).begin(),(x).end())
#define MP make_pair
#define PB push_back

typedef vector<int> VI;
typedef vector<string> VS;
typedef vector<vector<int>> VVI;
typedef pair<int, int> PII;
typedef long long LL;

int main() {
	int n, cnt = 0;
	cin >> n;
	VI a(n);
	rep(i, n)cin >> a[i];

	//sort
	rep(i, n) {
		int mini = i;
		FOR(j, i, n) {
			if (a[j] < a[mini])mini = j;
		}
		swap(a[i], a[mini]);
		if (i != mini)cnt++;
	}

	rep(i, n) {
		cout << a[i];
		printf(i == n - 1 ? "\n" : " ");
	}
	cout << cnt << endl;
}


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

#define rep(i,n) for(i = 0;i < n;++i)
#define all(v) v.begin(), v.end()
using ll = long long;

int main()
{
    ll i,j;
    ll n,k;
    cin >> n >> k;
    vector<ll> p(n);
    vector<ll> c(n);
    rep(i,n){
        cin >> p.at(i);
        --p.at(i);
    }
    rep(i,n) cin >> c.at(i);

    vector<vector<ll>> dub(n, vector<ll>(35));
    vector<vector<ll>> cnt(n, vector<ll>(35));
    vector<vector<ll>> mmx(n, vector<ll>(35));
    rep(i,n) dub.at(i).at(0) = p.at(i);
    rep(i,n){
        cnt.at(i).at(0) = c.at(p.at(i));
    }
    rep(i,n){
        mmx.at(i).at(0) = c.at(p.at(i));
    }
    rep(j,34){
        for(i = 0;i < n;++i){
            dub.at(i).at(j+1) = dub.at(dub.at(i).at(j)).at(j);
            cnt.at(i).at(j+1) = cnt.at(i).at(j) + cnt.at(dub.at(i).at(j)).at(j);
            mmx.at(i).at(j+1) = max(mmx.at(i).at(j), cnt.at(i).at(j) + mmx.at(dub.at(i).at(j)).at(j));
        }
    }
    ll ans = -(1ll << 60);
    rep(i,n){
        ll mb = 35;
        ll now = i;
        ll pre = 0;
        while(mb >= 0){
            if((k & (1ll << mb))){
                ans = max(ans, pre + mmx.at(now).at(mb));
                pre += cnt.at(now).at(mb);
                now = dub.at(now).at(mb);
            }
            --mb;
        }
    }
    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 8284
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define ll long long
#define ld long double
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
using P=pair<long long,long long>;
#define rep(i,n) for(long long i=0; i<(long long)n; i++)
#define req(i,n) for(long long i=n-1; i>=0; i--)
#define range(i,a,b) for(long long i=a; i<b; i++)
#define all(x) (x).begin(), (x).end()
#define sz(x) ((long long)(x).size())
#define COUT(x) cout << x << endl
#define pb push_back
#define mp make_pair
#define F first
#define S second
#define onBoard(y,x) (y>=0 && y<h && x>=0 && x<w)
#define pri_que priority_queue
#define vint vector<int>
#define vvint vector<vector<int>>
#define vi vector<int>
#define vvi vector<vector<int>>
#define vs vector<string>
#define vvc vector<vector<char>>
#define vc vector<char>
#define vp vector<pair<int,int>>
#define vb vector<bool>
#define vvb vector<vector<bool>>
#define show(x) cout<<#x<<"="<<x<<endl;
#define SUM(x) accumulate(x.begin(),x.end(),0)
#define MAX(x) *max_element(x.begin(),x.end())
#define MIN(x) *min_element(x.begin(),x.end())
#define couty cout<<"Yes"<<endl
#define coutn cout<<"No"<<endl
#define coutY cout<<"YES"<<endl
#define coutN cout<<"NO"<<endl
#define yn(x) cout<<(x?"Yes":"No")<<endl
#define YN(x) cout<<(x?"YES":"NO")<<endl
long long gcd(long long a,long long b){return b?gcd(b,a%b):a;}
long long lcm(long long a, long long b){return a/gcd(a,b)*b;}
const long long dx[8]={1,0,-1,0,1,-1,-1,1};
const long long dy[8]={0,1,0,-1,1,1,-1,-1};
const long long INF = 1e15;
const long long MOD = 1e9+7;

signed main(){
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    cout<<fixed<<setprecision(15);

    int n; cin >> n;
    set<int> set;
    while(n--){
        int a; cin >> a;
        if(!set.count(a)) set.insert(a);
        else set.erase(a);
    }
    cout<<set.size()<<endl;
}

Measured memory_bytes: 8264
num = int(input())
c = input().split()
h = input().split()

for i in range(len(c)):
  c[i] = int(c[i])
for i in range(len(h)):
  h[i] = int(h[i])
  
sumc = sum(c)
for i in range(len(h)):
  c[i] -= h[i]
  h[i] = abs(c[i])
  if c[i] < 0:
    c[i]=0
    c[i+1] -= h[i]
    if c[i+1] < 0:
      c[i+1]=0
      
sumedc = sum(c)
print(sumc-sumedc)

Measured memory_bytes: 86552
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#pragma GCC optimize("unroll-loops")
#include <bits/stdc++.h>

#define pb push_back
#define sz(x) ((int)(x).size())
#define all(x) (x).begin(),(x).end()
#define ll long long



using namespace std;

void file(){
	#ifndef ONLINE_JUDGE
    	freopen("in.txt", "r", stdin);
	#endif
}
int tc;
const int N=5e5+5,M=2e6+5,MOD=1e9+7,OO=1e9;
std::vector<pair<int,int>> g[N];
ll cst[N];
void dfs(int u, int pp){
	for(auto p : g[u]){
		int v = p.first;
		int w = p.second;
		if(v==pp)continue;
		cst[v]=cst[u]+w;
		dfs(v,u);
	}
}
int main(){
	ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
	//file();	
 	int n;
 	scanf("%d",&n);	

 	for(int i=1;i<n;i++){
 		int a,b,c;
 		scanf("%d %d %d",&a,&b,&c);
 		g[a].pb({b,c});
 		g[b].pb({a,c});
 	}
 	int q,A;

 	scanf("%d %d",&q,&A);

 	dfs(A,0);

 	while(q--){
 		int x,y;
 		scanf("%d %d",&x,&y);
 		printf("%lld\n",cst[x]+cst[y]);
 	}
}		


Measured memory_bytes: 22656
#include <stdio.h>
#include <stdlib.h>


int main() 
{
	int n,i,count;
	scanf("%d",&n);
	char s[n];
	scanf("%s",&s);
	count=n;
	for(i=0;i<n;i++)
	{
		if(s[i]==s[i+1])
		{
		count--;	
		}
	}
	printf("%d",count);
	return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<algorithm>
#include<iomanip>
#include<limits>
#include<deque>
#include<string>
#include<map>
#include<set>
#include <unordered_set>
#include<vector>
#include<cmath>

using namespace std;


int main() {
	string s; cin >> s;
	int i, sum = 0, a = 0;

	for (i = 0; i < s.size(); i++) {
		if (s[i] == 'T') { sum++; }
		else if (s[i] == 'S') { sum--; }
		a = max(a, sum);
	}


	cout << a * 2 << endl;

	return 0;
}

Measured memory_bytes: 640
///Sum of integers
#include<stdio.h>

int N,S;

int f(int n,int m,int s){
    if(m==10){
        if(S==s&&N==n)return 1;
        return 0;
    }

    return f(n,m+1,s)+f(n+1,m+1,s+m);
}
int main(void){
    while(1){
        scanf("%d%d",&N,&S);
        if(N==0&&S==0)break;

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

Measured memory_bytes: 1028
import java.util.*;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int K = sc.nextInt();
		int[] A = new int[N];
		for(int i=0; i<N; i++)
			A[i] = sc.nextInt();
		
		Arrays.sort(A);
		
		int gcd = A[0];
		for(int i=1; i<N; i++)
			gcd = gcd(gcd, A[i]);
		
		System.out.println(A[0]<=K && K<=A[N-1] && K%gcd==0 ? "POSSIBLE" : "IMPOSSIBLE");

		sc.close();
	}
	
	static int gcd(int a, int b) {
		return a==0 ? b : gcd(b%a, a);
	}
}


Measured memory_bytes: 50200
import sys
import fractions
import math
MAX_INT = int(10e12)
MIN_INT = -MAX_INT
mod = 1000000007
sys.setrecursionlimit(1000000)
def IL(): return list(map(int,input().split()))
def SL(): return input().split()
def I(): return int(sys.stdin.readline())
def S(): return input()

N = I()
a = IL()

tmp = MAX_INT
ans = 0
for i in range(N):
  if a[i] <= tmp:
    ans += 1
    tmp = a[i]
print(ans)

Measured memory_bytes: 101580
import sys
read = sys.stdin.readline
n = int(input())
aaa = list(map(int, read().split()))
aaa.sort()
ans = 1
for a in aaa:
    ans *= a
    if ans == 0:
        break
    if ans > 10 ** 18:
        ans = -1
        break
print(int(ans))

Measured memory_bytes: 21728
#include <bits/stdc++.h>
/* Type alias */
using ll = long long;
using ld = long double;

using vec_i = std::vector<int>;
using vec_ll = std::vector<ll>;
using vec_ld = std::vector<ld>;

using set_i = std::set<int>;
using set_ll = std::set<ll>;
using set_ld = std::set<ld>;

using uset_i = std::unordered_set<int>;
using uset_ll = std::unordered_set<ll>;
using uset_ld = std::unordered_set<ld>;

/* IO macros */
#define in(i)            int i; std::cin >> i
#define in2(i, j)        int i, j; std::cin >> i >> j
#define in3(i, j, k)     int i, j, k; std::cin >> i >> j >> k
#define in_(i)           std::cin >> i
#define in2_(i, j)       std::cin >> i >> j
#define in3_(i, j, k)    std::cin >> i >> j >> k
#define in_ll(i)         ll i; std::cin >> i
#define in2_ll(i, j)     ll i, j; std::cin >> i >> j
#define in3_ll(i, j, k)  ll i, j, k; std::cin >> i >> j >> k
#define in_ll_(i)        std::cin >> i
#define in2_ll_(i, j)    std::cin >> i >> j
#define in3_ll_(i, j, k) std::cin >> i >> j >> k
#define in_ld(i)         ld i; std::cin >> i
#define in2_ld(i, j)     ld i, j; std::cin >> i >> j
#define in3_ld(i, j, k)  ld i, j, k; std::cin >> i >> j >> k
#define in_ld_(i)        std::cin >> i
#define in2_ld_(i, j)    std::cin >> i >> j
#define in3_ld_(i, j, k) std::cin >> i >> j >> k
#define in_c(i)          char i; std::cin >> i
#define in2_c(i, j)      char i, j; std::cin >> i >> j
#define in3_c(i, j, k)   char i, j, k; std::cin >> i >> j >> k
#define in_c_(i)         std::cin >> i
#define in2_c_(i, j)     std::cin >> i >> j
#define in3_c_(i, j, k)  std::cin >> i >> j >> k
#define in_str(s)        std::string s; std::cin >> s

#define vec_in(v, n)    auto v=vec_i(n); for(auto &x:v){std::cin>>x;}
#define vec_in_ll(v, n) auto v=vec_ll(n);for(auto &x:v){std::cin>>x;}
#define vec_in_ld(v, n) auto v=vec_ld(n);for(auto &x:v){std::cin>>x;}

#define print(x)   std::cout << x
#define println(x) std::cout << x << "\n"
#define print_fixed(x)   std::cout << std::fixed << x
#define println_fixed(x) std::cout << std::fixed << x << "\n"
#define print_vec(v) for (auto &x:v) { std::cout << x << " ";}
#define println_vec(v) for (auto &x:v) { std::cout << x << " ";} std::cout << "\n";
#define print_long_vec(v) for (auto &x:v) { std::cout << x << "\n";}
#define println_long_vec(v) for (auto &x:v) { std::cout << x << "\n";} std::cout << "\n";

/* Loops */
#define rep(i, n) for (auto i = 0; i < n; ++i)
#define rep2(i, m, n) for (auto i = m; i < n; ++i)

/* Vector manipulation */
#define vec_sort(v) std::sort(v.begin(), v.end())

using namespace std;
/* Code Starts Here*/
int main () {
    std::ios::sync_with_stdio(false);
    cin.tie(NULL);
    in2(A, B);
    println(A * B);
    return 0;
}


Measured memory_bytes: 3608
/*
--------------              |   /
      |                     |  /
      |                     | /
      |             *       |/          |    |         ------            *
      |                     |           |    |        /      \
      |             |       |\          |    |       |       |\          |
   \  |             |       | \         |    |       |       | \         |
    \ |             |       |  \        |    |        \     /   \        |
     V              |       |   \        \__/|         -----     \       |
*/
#include <bits/stdc++.h>
using namespace std;

#define EmiliaMyWife ios::sync_with_stdio(0); cin.tie(NULL);
#define mem(i,j) memset(i,j,sizeof (i));
#define F first
#define S second
#define lowbit(x) ((x)&(-(x)))
#define siz(v) (long long)(v).size()
typedef int64_t ll;
typedef uint64_t ull;
const double EPS  = 1e-8;
const int INF     = 0x3F3F3F3F;
const ll LINF     = 4611686018427387903;
const int MOD     = 1e9+7;
/*-----------------------------------------------------------------------------------------------------*/

vector<int> edge[10];

int solve(int now, int has, int goal) {
	//cout << now << ' ';
	if(has == goal)
		return 1;//cout << '\n', 1;
	int res = 0;
	for(int &a : edge[now]) {
		if((has>>a)&1)
			continue;
		res += solve(a, has|(1<<a), goal);
	}
	return res;
}

signed main() {
	EmiliaMyWife

	int n, m;
	cin >> n >> m;
	for(int i = 0, a, b; i < m; i++) {
		cin >> a >> b;
		a--; b--;
		edge[a].push_back(b);
		edge[b].push_back(a);
	}
	cout << solve(0, 1, (1<<n)-1);

	return 0;
}


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

class Main{
    public static void main(String[] args) {
        Scanner in=new Scanner(System.in);
        myLlist list=new myLlist();

        int n=in.nextInt();
        for(int i=0;i<n;i++){
            String cmd=in.next();
            if(cmd.equals("insert")){
                list.insert(Integer.parseInt(in.next()));
                // list.dump();
            }
            else if(cmd.equals("delete")){
                list.deleteOf(Integer.parseInt(in.next()));
            }
            else if(cmd.equals("deleteFirst")){
                list.deleteFirst();
            }
            else if(cmd.equals("deleteLast")){
                list.deleteLast();
            }
        }

        list.dump();
    }
}

class llNode{
    int num;
    llNode prev,next;

    llNode(int num){
        this.num=num;
    }
}

class myLlist{
    llNode dummy;
    int size;

    myLlist(){
        dummy=new llNode(-1);
        dummy.prev=dummy;
        dummy.next=dummy;

        size=0;
    }

    boolean isEmpty(){
        if(size==0)return true;
        else return false;
    }

    void insert(int x){
        llNode nnode=new llNode(x);

        nnode.next=dummy.next;
        nnode.prev=dummy;
        dummy.next.prev=nnode;
        dummy.next=nnode;
        
        size++;
    }

    void deleteOf(int x){
        llNode node=dummy.next;
        while(node.num!=-1){
            if(node.num==x)break;
            node=node.next;
        }
        if(node.num!=-1)delete(node);
    }
    
    void deleteFirst(){
        delete(dummy.next);
    }

    void deleteLast(){
        delete(dummy.prev);
    }

    private void delete(llNode dnode){
        dnode.prev.next=dnode.next;
        dnode.next.prev=dnode.prev;

        size--;
    }

    void dump(){
        PrintWriter out=new PrintWriter(System.out);
        List<Integer> list=new ArrayList<>();
        llNode node=dummy.next;

        while(node.num!=-1){
            list.add(node.num);
            node=node.next;
        }

        for(int i=0;i<list.size()-1;i++){
            out.print(list.get(i)+" ");
        }
        out.println(list.get(list.size()-1));
        out.flush();
    }
}


Measured memory_bytes: 329108
#include <bits/stdc++.h>
using namespace std;
int main(){
  int N,D;
  cin >> N >> D;
  int ans = N / (2* D + 1);
  if(N%(2 * D + 1) == 0){
    cout << ans <<endl;
  }
  else cout << ans + 1 << endl;
  return 0;
}

Measured memory_bytes: 256
import itertools
N = int(input())
out = 0
num = [0, 0, 0, 0, 0]
for i in range(N):
    name = list(input())
    if name[0] == "M":
        num[0] = num[0] + 1
    elif name[0] == "A":
        num[1] = num[1] + 1
    elif name[0] == "R":
        num[2] = num[2] + 1
    elif name[0] == "C":
        num[3] = num[3] + 1
    elif name[0] == "H":
        num[4] = num[4] + 1
b = 0
e = ()
for n in range(5):
    if num[n] == 0:
        b +=1
    else:
        e += (n,)
if  b >= 3:
    print(0)
else:
    combi = list(itertools.combinations(e,3))
    for c in combi:
        out += num[c[0]]*num[c[1]]*num[c[2]]
    print(out)

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

int findSumOfDigits (int n) {
    int sumOfDigits = 0;
    while (n > 0) {
        sumOfDigits += (n % 10);
        n /= 10;
    }

    return sumOfDigits;
}

int main() {
    int N, A, B;
    cin >> N >> A >> B;
    int sum = 0;
    
//     for (int i = 0; i <= 9; i++) {
//         for (int j = 0; j <= 9; j++) {
//             for (int k = 0; k <= 9; k++) {
//                 for (int l = 0; l<= 9; l++) {
//                     if (i + j + k + l >= A
//                         && i + j + k + l <= B
//                         && 1000 * i + 100 * j + 10 * k + l <= N){
//                             sum += 1000 * i + 100 * j + 10 * k + l;
//                         }

//                 }
//             }
//         }
//     }

//     if (N == 10000 && A == 1) { 
//         sum += 10000;
//     }

    for (int i = 1; i <= N; i++) {
        int c = findSumOfDigits(i);

        if (c >= A && c <= B) {
            sum += i; 
        }

    }

    cout << sum << endl;


    
}

Measured memory_bytes: 256
n = int(input())
a = list(map(int, input().split()))
s = sum(a)
if (2 * s) % (n * (n + 1)) != 0:
    print('NO')
else:
    t = (2 * s) // (n * (n + 1))
    for i in range(n - 1):
        k = a[i - 1] - a[i] + t
        if k % n or k < 0:
            print('NO')
            break
    else:
        print('YES')


Measured memory_bytes: 14252
import collections
url = "https://atcoder.jp//contests/abc111/tasks/arc103_a"

def main():
    input()
    t = list(map(int, input().split()))
    even_lis = t[::2]
    odd_lis = t[1::2]
    e = collections.Counter(even_lis).most_common()
    odd = collections.Counter(odd_lis).most_common()
    if e[0][0] == odd[0][0]:
        if e[0][1] + odd[0][1] == len(t):
            print(e[0][1])
            exit()
        else:
            print((len(t) - max(e[0][1], odd[0][1]) - max(e[1][1], odd[1][1])))
            exit()
    else:
        print(len(t) - e[0][1] - odd[0][1])


if __name__ == '__main__':
    main()


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

using namespace std;

#define ll long long
#define fix cout << fixed; cout << setprecision(0)





void solve() {

	
	int a, b, c, d;
	cin >> a >> b >> c >> d;
	int x = ceil(c / double(b));
	int y = ceil(a / double(d));
	if(x <= y) {
		cout << "Yes";
	}
	else {
		cout << "No";
	}




	
}

int main() {

	ios_base::sync_with_stdio(0);
	cin.tie(NULL);
	fix;
	solve();

	return 0;
}

Measured memory_bytes: 3620
import scala.io.StdIn._

object Main extends App {
  var Array(a, b, c, d) = readLine().split(" ").map(_.toInt)

  var takahashi = false
  var loop: Boolean = true
  while (loop) {
    c -= b
    if (c <= 0) {
      takahashi = true
      loop = false
    }

    a -= d
    if (a <= 0) {
      loop = false
    }
  }

  println(if (takahashi) "Yes" else "No")
}


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

int main()
{
  
  int instance_time;
  int instance_count;
  int timelimit;
  
  cin >> instance_time;
  cin >> instance_count;
  cin >> timelimit;
  
  int make_count = timelimit / instance_time;
  
  int output_count = make_count * instance_count;
  
  cout << output_count;
  
  return 0;
}

Measured memory_bytes: 256
N = int(input())
A = list(map(int,input().split()))
A.sort()
L = [0] * (10 ** 6 + 1)
S = set()

for a in A:
    if L[a]:
        continue
    if a in S:
        L[a] = 1
    S.add(a)
    for i in range(2, 10 ** 6 + 1):
        if a * i > 10 ** 6:
            break
        L[a * i] = 1

ans = 0
for a in A:
    if L[a] == 0:
        ans += 1

print(ans)

Measured memory_bytes: 121668
#include<stdio.h>
#include<string.h>

#define MAX 1000

/*int M(int a,int b){
  if(a > b)return a;
  else return b;
}*/

int lcs(char s1[],char s2[],int len1,int len2){
  int c[MAX+1][MAX+1];
  int i,j;
  int maxl = 0;
  int temp1,temp2;

  for(i=1;i<=len1;i++){
    c[i][0] = 0;
  }
  for(j=1;j<=len2;j++){
    c[0][j] = 0;
  }

  for(i=1;i<=len1;i++){
    for(j=1;j<=len2;j++){
      if(s1[i-1] == s2[j-1]){
        c[i][j] = c[i-1][j-1] + 1;
      }
      else{
	if(c[i-1][j]>c[i][j-1])temp1=c[i-1][j];
	else temp1=c[i][j-1];
        c[i][j]=temp1;
      }
      if(maxl>c[i][j])temp2=maxl;
      else temp2=c[i][j];
      maxl = temp2;
    }
  }

  return maxl;
}


int main(){
  int n;
  int i;
  char s1[MAX+1],s2[MAX+1];

  scanf("%d",&n);

  for(i=0;i<n;i++){
    scanf("%s",s1);
    scanf("%s",s2);
    printf("%d\n",lcs(s1,s2,strlen(s1),strlen(s2)));
  }
  return 0;
}



Measured memory_bytes: 5660
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
const ll mod = 1000000007;
const ll INF = mod * mod;
#define rep(i,n) for(int i=0;i<n;i++)
#define per(i,n) for(int i=n-1;i>=0;i--)
#define Rep(i,sta,n) for(int i=sta;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
#define per1(i,n) for(int i=n;i>=1;i--)
#define Rep1(i,sta,n) for(int i=sta;i<=n;i++)

int main() {
    int N, K, a;
    vector<int> dislike(10);

    cin >> N >> K;
    rep(i, K) cin >> a, dislike[a] = 1;

    string s;
    bool flag;
    for (int i = N; i < 100000; i++) {
        flag = true;
        s = to_string(i);
        rep(j, s.size()) {
            if (dislike[s[j] - '0']) flag = false;
        }

        if (flag) {
            cout << i << endl;
            break;
        }
    }
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using ll =long long;
#define all(v) v.begin(),v.end()
 
int main() {
  ll N;
  cin>>N;
  vector<ll> vec(N,0);
  for(ll i=0;i<N-1;i++) {
ll A;
    cin>>A;
    vec[A-1]++;
  }
  for(ll x:vec) {
cout<<x<<endl;
  }
}


Measured memory_bytes: 4840
A,B,C = map(int,input().split())
l = [A,B,C]

lmax = max(A,B,C)
l.remove(lmax)
lmin = min(l)
l.remove(lmin)
lmid = l[0]
ans = 0
#A,B,Cがすべて同じ場合
if lmax==lmid and lmid == lmin:
    print(0)
    exit()
#lmax==lmidのみ
if lmax==lmid:
    if (lmid-lmin)%2==0:
        ans += (lmid-lmin)//2
        print(ans)
        exit()
    else:
        ans += (lmid-1-lmin)//2
        ans += 2
        print(ans)
        exit()
#lmid==lminのみ
if lmid == lmin:
    ans += lmax - lmid
    print(ans)
    exit()
#A,B,Cがすべて異なる場合
if (lmid-lmin)%2 == 0:
    ans += (lmid-lmin)//2
    ans += lmax - lmid
else:
    ans += (lmid-1-lmin)//2
    ans += (lmax-lmid)
    ans += 2
print(ans)


Measured memory_bytes: 3064
//大文字->小文字 tolower(),逆はtoupper()
//int a = stoi(c); 文字列をintへ
//途中の出力をそのまま残さない
//数値計算 基本はdouble
//map<キー,値> p は辞書。p[キー] = 値
#include <bits/stdc++.h>
#define ALL(a) (a).begin(),(a).end()
#define ll long long int
using namespace std;

// Nの桁数
ll dig(ll N) {
	ll dig = 0;
	while (N) {
		dig++;
		N /= 10;
	}
	return dig;
}
// x,yの最大公約数
ll gcd(ll x, ll y) {
	ll r;
	while (x%y) {
		r = x % y;
		x = y;
		y = r;
	}
	return y;
}


int main() {
	int D; cin >> D;
	if (D == 25)cout << "Christmas" << endl;
	if (D == 24)cout << "Christmas Eve"<< endl;
	if (D == 23)cout << "Christmas Eve Eve" << endl;
	if (D == 22)cout << "Christmas Eve Eve Eve" << endl;
}

Measured memory_bytes: 256
n, m, c = [int(i) for i in input().split()]
b = [int(i) for i in input().split()]
a = [[int(i) for i in input().split()] for j in range(n)]
ans = 0
for i in range(n):
    x = c
    for j in range(m):
        x += b[j]*a[i][j]
    if x > 0:
        ans += 1
print(ans)


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

int main() {
  int x1,y1,x2,y2,x3,y3,x4,y4;
  cin >> x1 >> y1 >> x2 >> y2;

  int dx,dy;
  dx = x2 - x1;
  dy = y2 - y1;

  x3 = x2-dy;
  y3 = y2+dx;

  x4 = x3-dx;
  y4 = y3-dy;
  cout << x3 << " " << y3 << " " << x4<< " " << y4 << endl;
  return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<cstdio>
#define MAX 500005
#define MMIINN -2000000200
using namespace std;

typedef long long ll;

class maxHeap{
 public:
  int index;
  ll maxHeapArray[MAX];

  maxHeap(){
    index = 0;
    for(int i=0;i<MAX;i++)maxHeapArray[i]=MMIINN;
  }

  void Insert(ll v){
    ++index;
    maxHeapArray[index]=v;
    maxHeapify(index);
  }

  ll getLeft(int i){
    //return maxHeapArray[2*i];
    return 2*i;
  }

  ll getRight(int i){
    //return maxHeapArray[2*i+1];
    return 2*i+1;
  }

  ll getValue(int i){
    return maxHeapArray[i];
  }

  void buildMaxHeap(){
    for(int i=index/2;i>=1;i--){
      maxHeapify(i);
    }
  }


 private:

  void maxHeapify(int i){
    ll l = getLeft(i);
    ll r = getRight(i);
   ll largest;
    if(l <= index && maxHeapArray[l] > maxHeapArray[i])largest=l;
    else largest=i;
    if(r<=index && maxHeapArray[r] > maxHeapArray[largest])largest = r;
    if(largest != i){
      ll h;
      h = maxHeapArray[i];
      maxHeapArray[i] = maxHeapArray[largest];
      maxHeapArray[largest] = h;
      maxHeapify(largest);
    } 
  }




};

int main(){
  int n;
  ll val;
  maxHeap MH = maxHeap();
  scanf("%d",&n);
  for(int i=0;i<n;i++){scanf("%lld",&val); MH.Insert(val);
  }
    MH.buildMaxHeap();
  for(int i=1;i<=n;i++){
    printf(" %lld",MH.getValue(i));
  }
  printf("\n");

  return 0;
}

Measured memory_bytes: 4784
import java.util.*;

public class Main {

    public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);
        String n = sc.next();

        String r = "";
        for (char c : n.toCharArray()) {
            r += solve(c);
        }
        System.out.print(r);

    }

    static char solve (char c){
        switch (c) {
            case '1':
                return '9';
            case '9':
                return '1';
            default:
                return c;
        }
    }
}

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

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

  int d, n;
  cin >> d >> n;

  if (n == 100) cout << static_cast<int>(pow(100, d) * (n + 1))  << "\n";
  else cout << static_cast<int>(pow(100, d) * n) << "\n";
}


Measured memory_bytes: 3744
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<iostream>
#include<string>
#include<vector>
#include<map>
#include<set>
#include<stack>
#include<list>
#include<queue>
#include<deque>
#include<algorithm>
#include<numeric>
#include<utility>
#include<complex>
#include<functional>
using namespace std;
typedef long long ll;

const ll LMT = pow(10, 9) + 1;

void solver() {
	ll n, k;
	cin >> n >> k;
	
	ll a[n];
	for (ll i = 0; i < n; i++) cin >> a[i];
	
	/**
	 * 長さの範囲の小さい方から見ていってそれが、すべてのaを"合計"k回まで切断で
	 * その短さにできる最小を考える
	 * 
	 * 各aの切断回数はceil(a/l)-1で求まる(l -> チェックする長さ)
	 * （丁度割り切れるパターン、割り切れないパターンの切断面を数える）
	 * 
	 * 1個1個数えると間に合わないので、NG（LEFT)とOK(RIGHT)の中間を見て、
	 * それを新たなOK/NGとする
	 * 次第にTOP-BOTTOM=1に近づいてゆく
	 * この繰り返しの中でTOP<BOTTOMとなることはない
	 */
	// left -> NG, right -> OK
	ll left = 0, right = LMT;
	while (right - left != 1) {
		
		// 自動キャストで小数点以下切り捨てになる？
		ll mid = (left + right) / 2;
		
		// チェック処理
		ll cnt = 0;
		for (ll i = 0; i < n; i++) {
			cnt += (a[i] / mid);
			cnt -= 1;
			if (a[i] % mid != 0) cnt += 1;
		}
		bool isOK = cnt <= k;
		
		if (isOK) right = mid;
		else left = mid;
	}
	cout << right << endl;
}

int main() {
	solver();
	return 0;
}


Measured memory_bytes: 5164
# -*- coding: utf-8 -*-
"""
Created on Fri Nov 16 23:01:57 2018

@author: maezawa
"""

n = int(input())
sqn = int(n**0.5)+1

is_prime = [True]*(sqn+1)

is_prime[0] = False
is_prime[1] = False

for i in range(2, sqn//2):
    if is_prime[i] == True:
        for j in range(2*i,sqn+1,i):
            is_prime[j] = False

prime_numbers = [i for i in range(sqn+1) if is_prime[i]]

nn = n
ans = []
for p in prime_numbers:
    while nn % p == 0:
        nn = nn // p
        ans.append(p)
if nn != 1:
    ans.append(nn)
print('{}: '.format(n), end = '')
print(*ans)




Measured memory_bytes: 5892
r, g, b, n = map(int, input().split())

cnt = 0
for ri in range(3000 // r + 1):
    left1 = n - ri * r
    for bi in range(left1 // b + 1):
        left2 = left1 - bi * b
        if left2 >= 0 and left2 % g == 0:
            cnt += 1

print(cnt)


Measured memory_bytes: 2940
#include<bits/stdc++.h>
typedef long long ll;
using namespace std;
main(){
    int N,M,T[100],sum = 0;
    cin >> N;
    for(int i = 0;i < N;i++){
        cin >> T[i];
        sum += T[i];
    }
    cin >> M;
    for(int i = 0;i < M;i++){
        int P,X;
        cin >> P >> X;
        cout << sum - T[P-1] + X << endl;
    }
}

Measured memory_bytes: 256
import math


n = int(raw_input())

for i in xrange(n):
    data = map(float, raw_input().strip().split())
    xa = data[0]
    ya = data[1]
    ra = data[2]
    xb = data[3]
    yb = data[4]
    rb = data[5]

    d = math.sqrt((xa - xb)**2 + (ya - yb)**2)
    if d < ra - rb:
        print 2

    elif d < rb - ra:
        print -2

    elif d <= ra + rb:
        print 1
    else:
        print 0

Measured memory_bytes: 4404
n = input()
nine = ''.join(['9' for _ in range(len(n)-1)])
a = str(int(n[0]))
if int(a+nine) <= int(n):
    print(sum([int(i) for i in a+nine]))
else:
    a = str(int(n[0])-1)
    print(sum([int(i) for i in a+nine]))


Measured memory_bytes: 3060
import math


def combination(n, k):
    return math.factorial(n) // math.factorial(n - k) // math.factorial(k)


N, A, B = map(int, input().split())
V = list(sorted(map(int, input().split()), key=lambda x: -x))

s = [0]

for i in range(N):
    s.append(s[-1] + V[i])

max_mean = 0
for i in range(A, B + 1):
    m = s[i] / i
    if max_mean < m:
        max_mean = m

ret = 0

for i in range(A, B + 1):
    m = s[i] / i
    if m == max_mean:
        k = 0
        for p in range(i):
            if V[p] == V[i - 1]:
                k += 1
        ret += combination(V.count(V[i - 1]), k)
print(max_mean)
print(ret)


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

using namespace std;

float D, T, S;

int main(void)
{
    cin >> D >> T >> S;
    float time = D / S;

    if (time > T)
    {
        cout << "No" << endl;
    }
    else
    {
        cout << "Yes" << endl;
    }
}

Measured memory_bytes: 3704
// inputに入力データ全体が入る
function Main(input) {
	// 1行目がinput[0], 2行目がinput[1], …に入る
	input = input.split("\n");
    tmp = input[0].split("/");
	
  var D =tmp[0]+tmp[1]+tmp[2];
   var d =parseInt(D, 10); 
    if(d<=20190430){console.log('Heisei')}else{console.log('TBD');}
  
}
//*この行以降は編集しないでください（標準入出力から一度に読み込み、Mainを呼び出します）
Main(require("fs").readFileSync("/dev/stdin", "utf8"));

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

#define rep(i,n) for(int i=0; i<n; i++)
#define rept(i,a,b) for(int i=a; i<b; i++)
#define all(x) (x).begin(),(x).end()

typedef long long ll;
typedef vector<int> vi;
typedef pair<int,int> P;

const int mod = 1e9 + 7;


int main() {
	ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
	int n;
	cin >> n;
	vector<pair<int,int> > a(n);
	rep(i, n){
		cin >> a[i].first;
		a[i].second = i+1;
	}
	
	sort(all(a));
/*
	rep(i, n){
		rep(j, n){
			if(a[j] == i+1){
				ans[i] = j+1;
				break;
			}
		}
	}
*/

	rep(i, n){
		cout << a[i].second << " ";
	}
	cout << endl;

    return 0;
}



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

using namespace std;
using   ll=long long;

#define fast        	ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)

#define endl        	"\n"
#define pb          	push_back
#define mp          	make_pair
#define F           	first
#define S           	second
#define int             long long int
#define pll				pair<int , int>

#define ALL(v)      	v.begin(),v.end()
#define ALLR(v)     	v.rbegin(),v.rend()
#define pii         	3.14159265358979323
#define inf     		LLONG_MAX
#define ones(x)     	__builtin_popcount(x)
#define fill(a,b)   	memset(a,b,sizeof(a))
#define mod 			1000000007
#define hell            998244353

ll mod_pow(ll a,ll b,ll m)
{
    ll res = 1;
    while(b)
    {
        if(b&1)
        {
        	res=(res*a) % m;
        }
        a=(a*a) % m;
        b>>=1;
    }
    return res;
}

ll mod_inverse(ll a)
{
	return mod_pow(a , mod-2 , mod);
}

void solve() 
{
	int n , x , t;
	
	cin >> n >> x >> t;
	
	cout << ((n+x-1)/x)*t;
}

signed main() {
    fast;

    int t = 1;

	//cin >> t;

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

    return 0;
}


Measured memory_bytes: 3620
N = int( input() )

if N % 2 == 1 or N == 0:
   print(0) 
   exit() 

import math    
ct = 0

M = N // 2
for i in range( math.ceil( math.log(M, 5) ) ) :
   if M >= 5**(i+1) :
      ct += M // ( 5**(i+1) )

print(ct)

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

int main(){
	const int N = 10;
	
	int mountain[N];

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

	int _1st = 0;
	int _2nd = 0;
	int _3rd = 0;

	for (int i = 0; i < N; i++){
		if (mountain[i]>_1st){
			_3rd = _2nd;
			_2nd = _1st;
			_1st = mountain[i];
		}
		else if (mountain[i] > _2nd){
			_3rd = _2nd;
			_2nd = mountain[i];
		}
		else if (mountain[i] > _3rd){
			_3rd = mountain[i];
		}
	}
	cout << _1st << endl;
	cout << _2nd << endl;
	cout << _3rd << endl;

	return 0;
}

Measured memory_bytes: 1160
#include<bits/stdc++.h>
#define PI 3.1415926535897932384626433832795
#define ll long long
#define MP make_pair
#define IN insert
#define PB push_back
#define fr first
#define se second
#define sf scanf
#define pf printf
#define debug(x) cout<<"---------"<<x<<endl;
#define LEN(a) sizeof(a)/sizeof(a[0])
#define MEM(arr,k) memset(arr,k,sizeof arr)
#define input freopen("input","r",stdin)
#define output freopen("output","w",stdout)


int X8[] = {0, 1, 0, -1, 1, -1, 1, -1};
int Y8[] = {1, 0, -1, 0, 1, -1, -1, 1};
int X4[]={+1,-1,+0,+0};
int Y4[]={+0,+0,+1,-1};

using namespace std;

int main()
{
	unsigned long long w,h,x,y,half=0;
	sf("%llu %llu %llu %llu",&w,&h,&x,&y);
	double ans = ((w*h)*1.0)/2.0;
	if(2*x==w && 2*y==h)
		half = 1;

	pf("%.10lf %llu\n",ans,half);
    return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <sstream>
#include <algorithm>
#include <vector>
#include <utility>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <map>
#include <set>
#include <stack>
#include <queue>
 
using namespace std;
 
#define pb(n)	push_back(n)
#define mp(n,m) make_pair(n,m)
#define fi 	first
#define se 	second
#define all(r) (r).begin(),(r).end()

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

typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
 
const int IMAX=((1<<30)-1)*2+1;
const double EPS=1e-10;
//int mod=1000000007;

int h,w;
vector<string> s;
vector<vi> v;
int x,y;
bool f;
char ope[4]={'>','<','^','v'};
int mx[4]={1,-1,0,0};
int my[4]={0,0,-1,1};

void calc(){
	if(v[y][x]){
		f=false;
		return;
	}
	v[y][x]=1;
	for(int i=0; i<4; i++){
		if(s[y][x]==ope[i]){
			x+=mx[i];
			y+=my[i];
			calc();
		}
	}
}


int main(){
	while(cin>>h>>w){
		if(h==0&&w==0)break;
		vector<string> t(h);
		vector<vi> u(h,vi(w,0));
		for(int i=0; i<h; i++)cin>>t[i];
		s=t;
		v=u;
		x=0;
		y=0;
		f=true;
		calc();
		if(f)cout<<x<<" "<<y<<endl;
		else cout<<"LOOP"<<endl;
	}
}

Measured memory_bytes: 1368
import java.io.BufferedReader
import java.io.InputStreamReader
import java.io.PrintWriter

fun main(args: Array<String>) {

    // IO Templates
    val br = BufferedReader(InputStreamReader(System.`in`))
    val out = PrintWriter(System.out)

    val n = br.readLine()!!.toLong()

    val all = MyMod.pow(10, n)
    val noZero = MyMod.pow(9, n)
    val noZeroAndNine = MyMod.pow(8, n)

    out.println((all - 2 * noZero + noZeroAndNine + 10 * MyMod.MOD) % MyMod.MOD)

    out.flush()
}

class MyMod(var value: Long = 0L) {
    operator fun plus(a: Long) {
        value = plus(value, a)
    }

    operator fun minus(a: Long) {
        value = minus(value, a)
    }

    operator fun times(a: Long) {
        value = times(value, a)
    }

    operator fun div(a: Long) {
        value = div(value, a)
    }

    operator override fun equals(other: Any?): Boolean {
        // FIXME: 2020/08/30 定義途中
        return super.equals(other)
    }

    companion object {
        const val MOD: Long = 1000000007L
        fun plus(a: Long, b: Long): Long {
            return (a % MOD + b % MOD) % MOD
        }

        fun minus(a: Long, b: Long): Long {
            return (a % MOD - b % MOD + MOD) % MOD
        }

        fun times(a: Long, b: Long): Long {
            return (a % MOD) * (b % MOD) % MOD
        }

        fun div(a: Long, b: Long): Long {
            return (a % MOD) * (pow(b, MOD - 2) % MOD) % MOD
        }

        /** calc a^b
         *  b <= 0 は1を返す
         */
        fun pow(a: Long, b: Long): Long {
            var a = a
            var b = b
            var result = 1L
            a %= MOD
            while (b > 0) {
                if (b % 2 == 1L) result = result * a % MOD
                a = a * a % MOD
                b = b shr 1
            }
            return result
        }

        // calc inverse element
        fun invEle(a: Long): Long {
            return pow(a % MOD, MOD - 2) % MOD
        }
    }

}

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

int main(void) {
    char mp[2][3], ans[2][3];
    for (int i = 0; i < 2; i++) {
        for (int j = 0; j < 3; j++) {
            cin >> mp[i][j];
            ans[1-i][2-j] = mp[i][j];
        }
    }
    bool flag = false;
    for (int i = 0; i < 2; i++) {
        for (int j = 0; j < 3; j++) {
            if (ans[i][j] != mp[i][j]) {
                flag = true;
                break;
            }
        }
    }
    if (!flag) cout << "YES" << endl;
    else cout << "NO" << endl;
    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
void solve() {
	int K; cin >> K;
	long long int now = 7;
	for(int i = 1;i< 1e7;++i) {
		if (now%K == 0) {
			cout<<(i); return;
		}
		now *= 10;
		now += 7;
		now %= K;
	}
	cout<<(-1);
}



signed main() {
	cin.tie(0);
	ios::sync_with_stdio(false);
	//int q;
	//cin >> q;
	//while (q--)
	solve();

}


Measured memory_bytes: 3612
import scala.io.StdIn.readLine

object Main {

  def main(args: Array[String]) = {
      val n = readLine().split(" ").map(_.toInt)
      val (w,h,x,y,r) = (n(0),n(1),n(2),n(3),n(4))
      println(if(x-r < 0 || y - r < 0 || x + r > w || y + r > h) "No" else "Yes")

  }
}

Measured memory_bytes: 43772
/// wa ^3^

#pragma GCC optimize("O3")

#include<bits/stdc++.h>
                           
#define x first
#define y second
#define pb push_back
#define sz(x) (int) x.size()
 
using namespace std;
 
using ll = long long;
using pii = pair<int, int>;                                   

const int MOD = 1e9 + 7;
const int INF32 = 1e9 + 1e2;

template<typename T> istream 
&operator>>(istream &a, vector<T> &v) { 
for (auto& x : v) a >> x; return a; }

void stndrtn() {
#ifdef accepted
    freopen(".in", "r", stdin);
#endif        
}

const bool flag = 0;

void maincode() {
    int n;
    cin >> n;
    int ans = 1;
    int pv = -1, h = -1;
    for (int x; n--;) {
        cin >> x;
        if (~pv) {
            if (h == -1) {
                if (x > pv) {
                    h = 0;
                } else if (x < pv) {
                    h = 1;
                }
            } else {
                if (h == 0) {
                    if (x < pv) {
                        ans++, h = -1;    
                    }
                } else {
                    if (x > pv) {
                        ans++, h = -1;
                    }
                }
            }
        }
        pv = x;
    }
    cout << ans;
}

int main() {
    ios_base::sync_with_stdio(0);
    cin.tie(nullptr), stndrtn();
    int ts = 1;
    if (flag) 
        cin >> ts;
    while (ts--)
        maincode(); 
    return 0;
}



Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<n;i++)
#define fs first
#define sc second
constexpr int tv[]={-3,-1,1,3};
constexpr int p10[]={100000000,10000000,1000000,100000,10000,1000,100,10,1};
 
int main(){
    int h,v;
    string a="123456789",b="123456789";
    using data=pair<int,int>;
    
    while(cin>>h>>v, h or v){
        int tc[]={v,h,h,v};
        rep(i,9)cin>>a[i];
        rep(i,9)cin>>b[i];
        int sa=stoi("1"+a)-1000000000,sb=stoi("1"+b)-1000000000;

        unordered_map<int,int> s;

        priority_queue<data> q;
        q.emplace(0,sa);
        
        while(1){
            int cost=q.top().fs;
            int board=q.top().sc;
            if(board==sb){
                cout<<-cost<<endl;
                break;
            }
            q.pop();
            int index=to_string(board).find('0');
            if(index==-1)index=0;
            rep(i,4){
                int fixed=(index+tv[i]+9)%9;
                int next=board;
                int fx=board/p10[fixed]%10;
                next=next+(p10[index]-p10[fixed]) * fx;
                int nc=cost-tc[i];
                if((s.find(next)==s.end() || s[next]<cost-tc[i]) && nc>-(h+v)*10){
                    q.emplace(nc, next);
                    s[next]=nc;
                }
            }
        }
    }
}



Measured memory_bytes: 21232