akhauriyash/Code-Regression huggingface dataset:
x = int(input())
if x >= 1800:
    print(1)
elif x >= 1600:
    print(2)
elif x >= 1400:
    print(3)
elif x >= 1200:
    print(4)
elif x >= 1000:
    print(5)
elif x >= 800:
    print(6)
elif x >= 600:
    print(7)
elif x >= 400:
    print(8)


Measured memory_bytes: 9168
import sys
sys.setrecursionlimit(2147483647)
INF=float("inf")
MOD=10**9+7
input=lambda :sys.stdin.readline().rstrip()
def resolve():
    w,h,x,y=map(int,input().split())
    print(w*h/2,int(w==x*2 and h==y*2))
resolve()

Measured memory_bytes: 38256
# python template for atcoder1
import sys
sys.setrecursionlimit(10**9)
input = sys.stdin.readline


def ceil(x):
    return int((-x)//1*(-1))


N, A, B = map(int, input().split())
hp = [int(input()) for _ in range(N)]
diff = A-B


def check(x, HP):
    cnt = 0
    for i in range(N):
        if HP[i]-B*x <= 0:
            break
        else:
            cnt += ceil((HP[i]-B*x)/diff)
    return cnt <= x


def solve2():
    HP = sorted(hp, reverse=True)
    mi = HP[0]//A
    ma = ceil(HP[0]/B)
    while mi <= ma:
        mid = (mi+ma)//2
        if check(mid, HP):
            ma = mid-1
        else:
            mi = mid+1
    print(mi)


def check2(x, hp):
    l = [a-B*x for a in hp]
    ret = 0
    for a in l:
        if a <= 0:
            continue
        else:
            ret += ceil(a/diff)
    return ret <= x


def solve3():
    mi = max(hp)//A
    ma = ceil(max(hp)/B)
    while mi <= ma:
        mid = (mi+ma)//2
        if check2(mid, hp):
            ma = mid-1
        else:
            mi = mid+1
    print(mi)


solve3()


Measured memory_bytes: 11048
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
 
class Main {
    public static void main(final String[] args) throws Exception {
 
        try (BufferedReader br = new BufferedReader(new InputStreamReader(System.in));) {
            long N = Long.parseLong(br.readLine());
            long ans = 0;
            long base = 100;
            while (base < N) {
                base = base + (base * 1 / 100);
                ans++;
            }
 
            System.out.println(ans);
        } catch (IOException | NumberFormatException e) {
            e.printStackTrace();
            System.exit(0);
        } catch (final Exception e) {
            e.printStackTrace();
            System.exit(0);
        }
    }
}

Measured memory_bytes: 25356
#include <bits/stdc++.h>
#define int long long int
#define endl "\n"
using namespace std;
void solve()
{
	//Enter your code here Tanmay:)
	string s;
	cin>>s;
	int c=0;
	for(int i=0;i<s.size();i++)
	{
		if(s.at(i)!=s.at(s.size()-i-1))
			c++;
	}
	cout<<c/2;
}
signed main() {
	ios::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
	int t=1;
	//cin>>t;
	while(t--)
	{
		solve();
	}
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define modulo 1000000007
#define mod(mod_x) ((((long long)mod_x+modulo))%modulo)
#define Inf 100000000

int main(){
	
	int N,A,B;
	cin>>N>>A>>B;
	
	cout<<min(B,A*N)<<endl;
	
    return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main(){
  string S;
  cin >> S;
  for(int i=0; i< S.size()-1; i++){
    if(S.at(i) == S.at(i+1)){
      cout << i+1 << " " << i+2 << endl;
      break;
    }
    if(S.size() == 2){
      cout << -1 << " " << -1 << endl;
      break;
    }
    if(i <= S.size()-3){
      if(S.at(i) == S.at(i+2)){
        cout << i+1 << " " << i+3 << endl;
        break;
      }
    }
    else if(i == S.size()-2){
      cout << -1 << " " << -1 << endl;
    }
  }
}

Measured memory_bytes: 512
#include <algorithm>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <tuple>
#include <unordered_map>
#include <vector>
using namespace std;
using ll = int64_t;
#define rep(i, j, n) for (int i = j; i < (int)n; ++i)

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

  rep(i, 1, n + 1) {
    ll x = (i + 1) * i / 2;
    if (x >= n) {
      ll iran = x - n;
      rep(j, 1, i + 1) if (j != iran) cout << j << '\n';
      return 0;
    }
  }
  return 0;
}

Measured memory_bytes: 3580
#include<iostream>
#include<cmath>
#include<string>
#include<map>
#include<queue>
using namespace std;
#define N 3
#define N2 9

struct Puzzle{
    int f[N2];
    int space;
    string path;

    bool operator < (const Puzzle &p) const {
        for(int i=0; i<N2; i++){
            if(f[i] == p.f[i]) continue;
            return f[i] > p.f[i];
        }
        return false;
    }
};

static const int dx[4] = {-1, 0, 1, 0};
static const int dy[4] = {0, -1, 0, 1};
static const char dir[4] = {'u', 'l', 'd', 'r'};

bool isTarget(Puzzle p){
    for(int i=0; i<N2; i++)
        if(p.f[i] != (i+1)) return false;
    return true;
}

string bfs(Puzzle s){
    queue<Puzzle> Q;
    map<Puzzle, bool> V;
    Puzzle u, v;
    s.path = "";
    Q.push(s);
    V[s] = true;

    while(!Q.empty()){
        u = Q.front(); Q.pop();
        if( isTarget(u) ) return u.path;
        int sx = u.space / N;
        int sy = u.space % N;
        for(int r=0; r<4; r++){
            int tx = sx + dx[r];
            int ty = sy + dy[r];
            if(tx < 0 || ty < 0 || tx >= N || ty >= N) continue;
            v = u;
            swap(v.f[u.space], v.f[tx*N + ty]);
            v.space = tx*N + ty;
            if( !V[v] ){
                V[v] = true;
                v.path += dir[r];
                Q.push(v);
            }
        }
    }

    return "unsolvable";
}

int main(){
    Puzzle in;

    for(int i=0; i<N2; i++){
        cin >> in.f[i];
        if(in.f[i] == 0){
            in.f[i] = N2;
            in.space = i;
        }
    }
    string ans = bfs(in);
    cout << ans.size() << endl;

    return 0;
}


Measured memory_bytes: 30636
n = int(input())
s = input()
l = [[0,0],[0,1],[1,0],[1,1]]
for i in range(4):
  for j in range(1,n-1):
    if s[j] == 'o':
      if l[i][-1] == 0:
        l[i].append(l[i][-2])
      else:
        l[i].append(1-l[i][-2])
    else:
      if l[i][-1] == 0:
        l[i].append(1-l[i][-2])
      else:
        l[i].append(l[i][-2])
  if (s[0]=='o' and l[i][0]==0 and l[i][1]!=l[i][-1]) or (s[0]=='o' and l[i][0]==1 and l[i][1]==l[i][-1]) or (s[0]=='x' and l[i][0]==0 and l[i][1]==l[i][-1]) or (s[0]=='x' and l[i][0]==1 and l[i][1]!=l[i][-1]):
    continue
  if (s[-1]=='o' and l[i][-1]==0 and l[i][0]!=l[i][-2]) or (s[-1]=='o' and l[i][-1]==1 and l[i][0]==l[i][-2]) or (s[-1]=='x' and l[i][-1]==0 and l[i][0]==l[i][-2]) or (s[-1]=='x' and l[i][-1]==1 and l[i][0]!=l[i][-2]):
    continue
  for j in l[i]:
    print('SW'[j],end='')
  exit()
print(-1)

Measured memory_bytes: 63172
#include <stdio.h>

int gcd(int x,int y)
{
  int r;
  while(y>0)
  {
    r=x%y;
    x=y;
    y = r;
  }
  return x;
}
int main()
{
  int x,y,tmp;
  scanf("%d%d",&x,&y);
  if(y>x)
  {
    tmp = x;
    x = y;
    y = tmp;
  }
  printf("%d\n",gcd(y,x%y));
  return 0;
}



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

int main()
{
  int H, W, h, w;
  int res=0;
  cin >> H >> W >> h >> w;

  res = H*W - H*w - W*h + h*w;

  cout << res << endl;
}

Measured memory_bytes: 256
use std::io::{BufRead, Read};

pub struct Scanner<R>
where
    R: BufRead,
{
    reader: R,
}

impl<R> Scanner<R>
where
    R: BufRead,
{
    pub fn new(reader: R) -> Self {
        Self { reader }
    }

    pub fn next<T>(&mut self) -> T
    where
        T: ::std::str::FromStr,
        <T as ::std::str::FromStr>::Err: ::std::fmt::Debug,
    {
        self.reader
            .by_ref()
            .bytes()
            .map(|b| b.unwrap() as char)
            .skip_while(|c| c.is_whitespace())
            .take_while(|c| !c.is_whitespace())
            .collect::<String>()
            .parse::<T>()
            .unwrap()
    }
}

fn main() {
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).unwrap();
    let ret: String = s
        .bytes()
        .map(|b| match b {
            _ if 65 <= b && b < 97 => (b + 32) as char,
            _ if 97 <= b && b <= 122 => (b - 32) as char,
            _ => b as char,
        })
        .collect();
    print!("{}", ret);
}



Measured memory_bytes: 5028
#include<iostream>
#include<algorithm>
using namespace std;
int main()
{
	int a,b;
	cin>>a>>b;
	if(a<=0&&b>=0)cout<<"Zero"<<endl;
	else if((b-a)%2==0&&b<0)cout<<"Negative"<<endl;
	else cout<<"Positive"<<endl;
	return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define FOR(i,l,r) for(ll i=(l);i<(r);++i)
#define REP(i,n) FOR(i,0,n)
#define REPS(i,n) FOR(i,1,n+1)
#define RFOR(i,l,r) for(ll i=(l);i>=(r);--i)
#define RREP(i,n) RFOR(i,n-1,0)
#define RREPS(i,n) RFOR(i,n,1)
#define pb push_back
#define eb emplace_back
#define SZ(x) ((ll)(x).size())
#define all(x) (x).begin(),(x).end()
#define rall(x) (x).rbegin(),(x).rend()
template<class T = ll> using V = vector<T>;
template<class T = ll> using VV = V<V<T>>;
template<class T> inline bool chmin(T& a, T b) {if (a > b) {a = b; return true; }return false; }
template<class T> inline bool chmax(T& a, T b) {if (a < b) {a = b; return true; }return false; }
inline void Yes(bool b = true) {cout << (b ? "Yes" : "No") << '\n';}
inline void YES(bool b = true) {cout << (b ? "YES" : "NO") << '\n';}
inline void err(bool b = true) {if(b) {cout << -1 << '\n'; exit(0);}}
template<class T> inline void fin(bool b = true, T e = 0) {if(b) {cout << e << '\n'; exit(0);}}
template<class T> T Roundup_div(T x, T y) {return (x+(y-1))/y;}
const ll INF = 1e18;

#define zero_pad(num) setfill('0') << std::right << setw(num)

template <typename T>
T pow(T a, long long n, T e = 1) {
    T ret = e;
    while (n) {
        if (n & 1) ret *= a;
        a *= a;
        n >>= 1;
    }
    return ret;
}

int main(){
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    ll n, m; cin >> n >> m;
    ll p[m], y[m];
    VV<> Data(n + 1);
    REP(i,m){
        cin >> p[i] >> y[i];
        Data[p[i]].pb(y[i]);
    }
    REP(i,n+1) sort(all(Data[i]));
    REP(i,m) cout << zero_pad(6) << p[i] << zero_pad(6) << 1 + lower_bound(all(Data[p[i]]),y[i]) - Data[p[i]].begin() <<endl;
}

Measured memory_bytes: 10276
#include <bits/stdc++.h>
using namespace std;
using lint = long long;
const lint mod = 998244353;
#define all(x) (x).begin(), (x).end()
#define bitcount(n) __builtin_popcountl((lint)(n))
#define fcout cout << fixed << setprecision(15)
#define highest(x) (63 - __builtin_clzl(x))
template<class T> inline void YES(T condition){ if(condition) cout << "YES" << endl; else cout << "NO" << endl; }
template<class T> inline void Yes(T condition){ if(condition) cout << "Yes" << endl; else cout << "No" << endl; }
template<class T = string, class U = char>int character_count(T text, U character){ int ans = 0; for(U i: text){ ans += (i == character); } return ans; }
lint power(lint base, lint exponent, lint module){ if(exponent % 2){ return power(base, exponent - 1, module) * base % module; }else if(exponent){ lint root_ans = power(base, exponent / 2, module); return root_ans * root_ans % module; }else{ return 1; }}
struct position{ int y, x; }; position mv[4] = {{0, -1}, {1, 0}, {0, 1}, {-1, 0}}; // double euclidean(position first, position second){ return sqrt((second.x - first.x) * (second.x - first.x) + (second.y - first.y) * (second.y - first.y)); }
template<class T, class U> string to_string(pair<T, U> x){ return to_string(x.first) + "," + to_string(x.second); } string to_string(string x){ return x; }
template<class itr> void array_output(itr start, itr goal){ string ans; for(auto i = start; i != goal; i++) ans += to_string(*i) + " "; if(!ans.empty()) ans.pop_back(); cout << ans << endl; }
template<class itr> void cins(itr first, itr last){ for(auto i = first; i != last; i++){ cin >> (*i); } }
template<class T> T gcd(T a, T b){ if(a && b){ return gcd(min(a, b), max(a, b) % min(a, b)); }else{ return a; }} template<class T> T lcm(T a, T b){ return a / gcd(a, b) * b; }
struct combination{ vector<lint> fact, inv; combination(int sz) : fact(sz + 1), inv(sz + 1){ fact[0] = 1; for(int i = 1; i <= sz; i++){ fact[i] = fact[i - 1] * i % mod; } inv[sz] = power(fact[sz], mod - 2, mod); for(int i = sz - 1; i >= 0; i--){ inv[i] = inv[i + 1] * (i + 1) % mod; } } lint C(int p, int q) const{ if(q < 0 || p < q) return 0; return (fact[p] * inv[q] % mod * inv[p - q] % mod); } };
template<class itr> bool next_sequence(itr first, itr last, int max_bound){ itr now = last; while(now != first){ now--; (*now)++; if((*now) == max_bound){ (*now) = 0; }else{ return true; } } return false; }

int main(){
    int K, X;
    cin >> K >> X;
    vector<int> ans;
    for(int i = -(K - 1); i <= K - 1; i++){
        ans.push_back(X + i);
    }
    array_output(all(ans));
}


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

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

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

    // inch-worm
    long long int count = 0;
    int right = 0;
    int sum = 0;
    for(int left=0; left<n; left++){
        while(right < n && (sum ^ a[right]) == (sum + a[right])){
            sum += a[right];
            right += 1;
        }
        count += right - left;

        if(left == right) right += 1;
        if(left <  right) sum -= a[left];
    }
    cout << count << endl;
    return 0;
}

Measured memory_bytes: 1024
#include<iostream>
#include<string>
#include<cstdio>
#include<vector>
#include<cmath>
#include<algorithm>
#include<functional>
#include<iomanip>
#include<queue>
#include<ciso646>
#include<random>
#include<map>
#include<set>
#include<complex>
#include<bitset>
using namespace std;
typedef long long ll;
typedef unsigned int ui;
const ll MOD = (1e+9)+7;
const ll INF = (ll)1000000007 * 1000000007;
typedef pair<int, int> P;
#define stop char nyaa;cin>>nyaa;
#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++)
typedef long double ld;
typedef complex<ld> Point;
const ld eps = 1e-11;
const ld pi = acos(-1.0);
typedef pair<ll, ll> LP;
typedef pair<ld, ld> LDP;
int cnt[200000];
int main() {
	int k, n; cin >> n >> k;
	rep(i, n) {
		int a; cin >> a; a--; cnt[a]++;
	}
	int c = 0;
	sort(cnt, cnt + n,greater<int>());
	int out = 0;
	rep(i, k) {
		out += cnt[i];
	}
	cout << n - out << endl;
	return 0;
}

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

class Main{
	public static void main(String[] args) {
		Scanner sc=new Scanner(System.in);
		int[] a=new int[3];

		for(int i=0; i<3; i++) {
			a[i]=sc.nextInt();
		}
		Arrays.sort(a);
		System.out.println(a[0]+a[1]);
	}
}

Measured memory_bytes: 21332
#include <iostream>
using namespace std;
int main(){
    int n;
    cin >> n;
    long h[n];
    for(int i = 0;i<n;i++){
        cin >> h[i];
    }
    for(int i = 1;i<n;i++){
        if(h[i]>h[i-1]) h[i]--;
        if(h[i-1]>h[i]){
            cout << "No" << endl;
            return 0;
        }
    }
    cout << "Yes" << endl;
}

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

int main() {
    priority_queue<long long> q;
    int n, m; cin >> n >> m;
    for (int i = 0; i < n; i++) {
        int a; cin >> a;
        q.push(a);
    }
    for (int i = 0; i < m; i++) {
        int a; a = q.top(); q.pop();
        q.push(a/2);
    }
    long long t = 0;
    for (int i = 0; i < n; i++) {
        int a; a = q.top(); q.pop();
        t += a;
    }
    cout << t << endl;
}

Measured memory_bytes: 1400
import java.util.LinkedList;
import java.util.Queue;
import java.util.Scanner;

public class Main {
	class Process {
		String name;
		int time;
		Process(String name, int time) {
			this.name = name;
			this.time = time;
		}
	}
	void run() {
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int q = scan.nextInt();
		Queue<Process> que = new LinkedList<Process>();
		for (int i = 0; i < n; i++) {
			String name = scan.next();
			int time = scan.nextInt();
			que.add(new Process(name, time));
		}
		for (int time = 0; !que.isEmpty();) {
			Process p = que.poll();
			if (p.time - q <= 0) {
				time += p.time;
				System.out.println(p.name + " " + time);
			} else {
				p.time -= q;
				que.add(p);
				time += q;
			}
		}
	}
	public static void main(String[] args) {
		new Main().run();
	}
}



Measured memory_bytes: 75316
#include <bits/stdc++.h>
#define rep(i,n) for(int i = 0; i < (int)(n); i++)
#define rrep(ri,n) for(int ri = (int)(n-1); ri >= 0; ri--)
#define rep2(i,x,n) for(int i = (int)(x); i < (int)(n); i++)
#define repit(itr,x) for(auto itr = x.begin(); itr != x.end(); itr++)
#define rrepit(ritr,x) for(auto ritr = x.rbegin(); ritr != x.rend(); ritr++)
#define ALL(n) begin(n), end(n)
using ll = long long;
using namespace std;

map<ll, ll> prime_factorization(ll n){
	map<ll, ll> ans;
	ll a = 2;
	while(n >= a*a){
		if(n % a == 0){
			ans[a]++;
			n /= a;
		}else{
			a++;
		}
	}
	ans[n]++;
	
	return ans;
}

const int mod = 1000000007;
struct mint {
  ll x; // typedef long long ll;
  mint(ll x=0):x((x%mod+mod)%mod){}
  mint operator-() const { return mint(-x);}
  mint& operator+=(const mint a) {
    if ((x += a.x) >= mod) x -= mod;
    return *this;
  }
  mint& operator-=(const mint a) {
    if ((x += mod-a.x) >= mod) x -= mod;
    return *this;
  }
  mint& operator*=(const mint a) {
    (x *= a.x) %= mod;
    return *this;
  }
  mint operator+(const mint a) const {
    mint res(*this);
    return res+=a;
  }
  mint operator-(const mint a) const {
    mint res(*this);
    return res-=a;
  }
  mint operator*(const mint a) const {
    mint res(*this);
    return res*=a;
  }
  mint pow(ll t) const {
    if (!t) return 1;
    mint a = pow(t>>1);
    a *= a;
    if (t&1) a *= *this;
    return a;
  }

  // for prime mod
  mint inv() const {
    return pow(mod-2);
  }
  mint& operator/=(const mint a) {
    return (*this) *= a.inv();
  }
  mint operator/(const mint a) const {
    mint res(*this);
    return res/=a;
  }
};

int main(){
	int n;
	cin >> n;
	vector<int> a(n);
	map<ll, ll> pr;
	rep(snip_i, n) cin >> a.at(snip_i);
	rep(i, n){
		int c = a.at(i);
		map<ll, ll> m = prime_factorization(c);
		for(auto p : m){
			if(pr[p.first] < p.second) pr[p.first] = p.second;
		}
	}

	mint lcm = 1, ans = 0;
	for(auto p : pr){
		mint pf = p.first, ps = p.second;
		lcm *= pf.pow(ps.x);
	}
	rep(i, n){
		mint aa = a.at(i);
		mint bb = lcm / aa;
		ans += bb;
	}
	cout << ans.x << endl;

	return 0;
}

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


int main()
{

	int i,n,count,num;
	deque<int> sosu;
	deque<int>::iterator it;
	bool flg;
	
	//テーブルを予め作成する
	bool prime[1000000] = {false};
	
	prime[2] = true;

	for( i = 3; i <= 1000000 ; i+=2 ) {
		flg = true;	
		for(it = sosu.begin(); it != sosu.end(); it++ ) {
			num = *it;
			if( i < num * num ){
				break;
			}
			if( (i % num ) == 0 ){
				flg = false;
				break;
			}				
		}
		if( flg == true ) {
			sosu.push_back( i );
			prime[i] = true;	
		}
	}
	
	while(cin >> n){
		count = 0;
		if( n == 2 )
			count = 1;
		else if( n < 2 )
			count = 0;
		else {
			for( i = 3; i <= n ; i+=2 ) {
				if( prime[i] == true )
					count++;
			}
			count ++;
		}
		cout << count << endl;
	}
			
	return 0;
}

Measured memory_bytes: 0
#include<bits/stdc++.h>
#define fastio 	ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define endl "\n"
#define int long long int
using namespace std;
int mod = 1e9 + 7;

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


	string s;
	cin >> s;
	int count = 0, max_count = 0;
	for (int i = 0; i < s.length(); i++) {
		if (s[i] == 'R')
			count++;
		else {
			count = 0;
		}
		max_count = max(count, max_count);
	}
	cout << max_count;
	return 0;
}

Measured memory_bytes: 3648
#include <climits>
#include <set>
#include <cstdio>
#include <cstdlib>
inline int getInt(){ int s; scanf("%d", &s); return s; }

using namespace std;

int bint(int base, int original){
  int ret = 0;
  int keta = 1;

  while(original){
    int tmp = original % base;
    if(tmp > 9) return -1;
    ret += keta * tmp;
    keta *= 10;
    original /= base;
  }

  return ret;
}

int main(){
  while(true){
    int a = getInt();
    int b = getInt();
    int c = getInt();
    if(a + b + c == -3) break;

    bool ok = false;
    for(int i = 2; i <= 16; i++)
      if(bint(i, a) == b){
	ok = true;
	break;
      }

    if(!ok){
      puts("-1");
      continue;
    }

    int now = b;

    for(int i = a + 1; i <= c; i++){
      int next = INT_MAX;
      for(int b = 2; b <= 16; b++){
	int tmp = bint(b, i);
	if(tmp != -1){
	  if(tmp >= now)
	    next = min(next, tmp);
	}
      }
      now = next;
    }

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

Measured memory_bytes: 0
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <utility>
#include <numeric>
#include <array>
#include <cmath>
#include <memory>
using namespace std;
//変数デバッグ
#define DEB(variable) cout << #variable << '=' << variable << endl

//for簡易表記(引数ミス防止)
#define FOR(LoopVariable,numberOFbegin,numberOFend) for (long long int LoopVariable = (numberOFbegin); (LoopVariable) < (numberOFend); (LoopVariable)++)
#define DEFOR(LoopVariable,numberOFbegin,numberOFend) for (long long int LoopVariable = (numberOFbegin)-1; (LoopVariable) >= (numberOFend); (LoopVariable)--)
#define REP(LoopVariable,numberOFend) for(long long int LoopVariable = 0;(LoopVariable)<(numberOFend);LoopVariable++)

constexpr long long int linf = numeric_limits<long long int>::max()-5;
constexpr int inf= numeric_limits<int>::max()-5;
constexpr long long int mod = 1000000007;
void dfs(int n,string s="",char maxc='a'){
    if(s.size()==n){
        cout << s << endl;
    }else{
        for (auto c = 'a'; c <= maxc;c++){
            dfs(n,s+c,(c==maxc?c+1:maxc));
        }
    }
}


int main(){
    int n;
    cin>>n;
    dfs(n);
    return 0;
}


Measured memory_bytes: 1536
n,k=map(int,input().split())
a=list(map(int,input().split()))
cnt=len(set(a))
from collections import Counter
data=Counter(a)
data=sorted(data.items(),key=lambda x:-x[1])
data_cnt=len(data)#ボールの種類数
ans=0
if cnt<=k:
    print(0)
    
else:
    for i in range(k,data_cnt):
        ans+=data[i][1]
    print(ans)


Measured memory_bytes: 48436
#include<bits/stdc++.h>
using namespace std;
int main() {
	string s;
	cin>>s;
	if(s=="SUN")
	{
		cout<<7;
	}
	else if(s=="MON")
	{
		cout<<6;
	}
	else if(s=="TUE")
	{
		cout<<5;
	}
	else if(s=="WED")
	{
		cout<<4;
	}
	else if(s=="THU")
	{
		cout<<3;
	}
	else if(s=="FRI")
	{
		cout<<2;
	}
	else
	{
		cout<<1;
	}
 
 
}

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

int main() {
  int n;
  cin >> n;
  vector<ll> a(n);
  rep(i,n) cin >> a.at(i);

  sort(a.begin(),a.end());
  if(a.at(0) == 0){
    cout << 0 << endl;
    return 0;
  }
  ll ans = 1;
  ll t = pow(10,18);
  rep(i,n){    
    if(a.at(i) >t/ans  ){
      cout << -1 << endl;
      return 0;
    }
    ans *= a.at(i);
  }
  cout << ans << endl;
}


Measured memory_bytes: 4052
#include <iostream> // cout, endl, cin
#include <string> // string, to_string, stoi
#include <vector> // vector
#include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound
#include <utility> // pair, make_pair
#include <tuple> // tuple, make_tuple
#include <cstdint> // int64_t, int*_t
#include <cstdio> // printf
#include <map> // map
#include <queue> // queue, priority_queue
#include <set> // set
#include <stack> // stack
#include <deque> // deque
#include <unordered_map> // unordered_map
#include <iomanip>
#include <unordered_set> // unordered_set
#include <bitset> // bitset
#include <cctype> // isupper, islower, isdigit, toupper, tolower
#include <math.h>
#include <cmath>
#include <stdlib.h>
#include <stdio.h>
using namespace std;
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
const int INF = 1001001000;
const int MOD = 1000000007;

long long gcd(long long a, long long b) {
    if (b == 0) return a;
    else return gcd(b, a % b);
}
long long lcm(long long a, long long b) {
    return a * b / gcd(a, b);
}

using Graph = vector<vector<int>>;
//再帰とかグラフを使うときは予めNの最大値のグローバル配列を取っておく
int N;
vector<int> E[200001];
vector<bool> seen;
typedef pair<int, int> P;
int D[101];
//頂点状態を表すcolor[]において、0は未訪問、1は訪問中、2は完了を表す。
int color[101];
int find_time = 0;

int main() {
    long long N; cin >> N;
    vector<long long> A(N), B(N), C(N);
    for (int i = 0; i < N; i++) cin >> A.at(i);
    for (int i = 0; i < N; i++) cin >> B.at(i);
    for (int i = 0; i < N; i++) cin >> C.at(i);
    sort(A.begin(), A.end());
    sort(B.begin(), B.end());
    sort(C.begin(), C.end());
    long long ans = 0;

    //中部について全探索
    for (int i = 0; i < N; i++) {
        long long numA = lower_bound(A.begin(), A.end(), B.at(i)) - A.begin();
        long long numC = N-(upper_bound(C.begin(), C.end(), B.at(i)) - C.begin());
        ans += numA * numC;
    }

    cout << ans << endl;
}


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

using namespace std;
vector<vector<int>> red(201, vector<int>(3,0));
vector<vector<int>> blue(201, vector<int>(3,0));

bool comp(const std::vector<int>& left, const std::vector<int>& right) {
        if( left[0] != right[0] ) return left[0] < right[0];
        else return left[1] < right[1];
}
int main(){
    int n;
    cin >> n;

    for(int i=0; i<n; i++){
        cin >> red[i][0] >> red[i][1];
    }
    for(int i=0; i<n; i++){
        cin >> blue[i][0] >> blue[i][1];        
    }
    std::sort(red.begin(), red.begin()+n, comp);
    std::sort(blue.begin(), blue.begin()+n, comp);  
    for(int i=0; i<n; i++){
        cerr << red[i][0] << ", " << red[i][1] << " | " ;
        cerr << blue[i][0] << ", " << blue[i][1] << endl;
    }
    int count=0;
    int index=0;
    for(int i=0; i<n; i++){
        long tmp=-1, index;
        bool found=false;
        for(int j=0; j<n; j++){
            if( red[j][0] >= blue[i][0] ) break;
            if( (red[j][1] < blue[i][1]) && (red[j][2]==0) ){
                found = true;
                if( tmp < red[j][1]){
                    index=j;
                    tmp = red[j][1];
                }
            }
        }
        if( found ) {
            count++;
            red[index][2]=1;
            cerr << red[index][0] << ", " << blue[i][0]<< " , " << index <<endl;    
        }
    }
    cout << count << endl;
    return 0;
}


Measured memory_bytes: 256
#[allow(unused_imports)]
use std::io;
use std::io::stdin;
use std::cmp;

fn read_line_as_vec() -> Vec<String> {
    let mut s = String::new();
    stdin().read_line(&mut s).expect("");
    s.split(' ').map(|x| x.to_string()).collect::<Vec<String>>()
}

fn digit(x: u64) -> u32 {
    let mut d: u32 = 1;
    while 10u64.pow(d) <= x {
        d += 1;
    }
    d
}

fn main() {
    let n: u64 = read_line_as_vec()[0].trim().parse().expect("");
    let mut a: u64 = 1;
    let mut min_d: u32 = u32::max_value();
    while a * a <= n {
        if n % a != 0 {
            a += 1;
            continue;
        }
        min_d = cmp::min(min_d, digit(n / a));
        a += 1;
    }
    println!("{}", min_d);
}


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

int n, m, q;
vector<int> a, b, c, d;
int ans;

void dfs(vector<int> A){
	if(A.size() == n+1){
		int now = 0;
		rep(i, q){
			if(A.at(b.at(i))- A.at(a.at(i)) == c.at(i))
				now += d.at(i);
		}
		ans = max(now, ans);
		return;
	}

	A.push_back(A.back());
	while(A.back() <= m){
		dfs(A);
		A.back()++;
	}
}


int main(){
	cin >> n >> m >> q;
	a = b = c = d = vector<int>(q);

	rep(i, q){
		cin >> a.at(i) >> b.at(i) >> c.at(i) >> d.at(i);
	}

	dfs(vector<int>(1, 1));
	cout << ans << endl;
}

Measured memory_bytes: 3600
#include <cstdio>
typedef long long ll;
#define MOD 1000000007
inline ll quick_pow(ll a, int n)
{
	ll res = 1; 
	while (n)
	{
		if (n & 1)
			res = res * a % MOD; 
		a = a * a % MOD; 
		n >>= 1; 
	}
	return res; 
}
ll fact[5005], inv[5005]; 
inline ll C(int n, int m)
{
	if (n < m)
		return 0; 
	return fact[n] * inv[m] % MOD * inv[n - m] % MOD; 
}
int main()
{
	// freopen("CF17-QB-E.in", "r", stdin); 
	fact[0] = inv[0] = 1; 
	for (int i = 1; i <= 5000; i++)
	{
		fact[i] = fact[i - 1] * i % MOD; 
		inv[i] = quick_pow(fact[i], MOD - 2); 
	}
	int n, m; 
	scanf("%d%d", &n, &m);
	ll ans = n + 1; 
	for (int i = 1; i < m; i++)
	{
		for (int j = 1; j <= m - i; j++)
			(ans += C(m - 1, i - 1) * C(m - i - 1, j - 1) % MOD * C(n - (m - i) - (m - i - j) + 2, 2)) %= MOD; 
	}
	printf("%lld\n", ans);
	return 0; 
}


Measured memory_bytes: 256
import sys

sys.setrecursionlimit(10**6)
int1 = lambda x: int(x)-1
p2D = lambda x: print(*x, sep="\n")
def II(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def LI(): return list(map(int, sys.stdin.readline().split()))
def LLI(rows_number): return [LI() for _ in range(rows_number)]
def SI(): return sys.stdin.readline()[:-1]

a,b,c,d=MI()
ans=-10**20
ans=max(ans,a*c)
ans=max(ans,a*d)
ans=max(ans,b*c)
ans=max(ans,b*d)
print(ans)


Measured memory_bytes: 9208
#include<bits/stdc++.h>
using namespace std;
const int N=30;
int n,x[N],ans;
int main()
{
	cin>>n;
	for(int i=0;i<n;i++)cin>>x[i];
	for(int i=1;i<n-1;i++)
	{
		if(x[i-1]<x[i]&&x[i+1]>x[i])ans++;
		if(x[i-1]>x[i]&&x[i+1]<x[i])ans++;
	}
	cout<<ans<<endl;
	return 0;
}

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

#define all(v) v.begin(), v.end()
#define V vector
#define P pair
typedef long long ll;

int main() {
    ll n; cin >> n;
    V<ll> x(n), y(n), h(n);
    for(ll i = 0; i < n; i++){
        cin >> x[i] >> y[i] >> h[i];
    }

    ll s;
    for(ll i = 0; i < n; i++){
        if(h[i]){
            s = i;
            break;
        }
    }

    for(ll i = 0; i <= 100; i++){
        for(ll j = 0; j <= 100; j++){
            bool flag = true;
            ll H = max(h[s] + abs(x[s] - i) + abs(y[s] - j), 0LL);
            for(ll k = 0; k < n; k++){
                ll tmp = max(H - abs(x[k] - i) - abs(y[k] - j), 0LL);
                if(h[k] != tmp){
                    flag = false;
                    break;
                }
            }
            if(flag){
                cout << i << " " << j << " " << H << endl;
            }
        }
    }
}


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

using str = string;
using ss = stringstream;

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

    str s;
    cin>>s;

    bool ans=s[0]=='A';

    int cnt=0;

    for(int i=1;i<s.size();i++)
    {
        if('a'<=s[i]&&s[i]<='z');
        else
        {
            if(2<=i&&i<=s.size()-2&&cnt==0&&s[i]=='C')
            {
                cnt++;
            }
            else
            {
                ans=false;
                break;
            }            
        }        
    }

    ans&=cnt==1;

    puts(ans?"AC":"WA");

    return 0;
}


Measured memory_bytes: 3596
#include<iostream>
using namespace std;
int main(){
	int n,m;
	cin >> n >> m;
	int id[n+1]={};
	for(int i=0;i<m;i++){
		int l,r;
		cin >> l >> r;
		l--;
		id[l]++;
		id[r]--;
	}
	for(int i=1;i<n;i++) id[i]+=id[i-1];
	int ans=0;
	for(int i=0;i<n;i++) if(id[i]==m) ans++;
	cout << ans << endl;
	return 0;
}


Measured memory_bytes: 640
#include <iostream>
#include <cstdio>
#include <string>
#include <algorithm>
#include <utility>
#include <cmath>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <numeric>
#include <functional>
using namespace std;
typedef long long ll;
typedef vector<ll> vl;
typedef vector<vector<ll>> vvl;
typedef pair<ll, ll> P;
typedef vector<vector<P>> vvP;
#define rep(i, n) for(ll i = 0; i < n; i++)
#define exrep(i, a, b) for(ll i = a; i <= b; i++)
#define out(x) cout << x << endl
#define exout(x) printf("%.10f\n", x)
#define chmax(x, y) x = max(x, y)
#define chmin(x, y) x = min(x, y)
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()
#define pb push_back
#define re0 return 0
const ll mod = 1000000007;
const ll INF = 1e16;
const ll MAX_N = 110;

struct Eratosthenes {
    ll n;
    vector<ll> f;  // f[i] : iを割りきる最小の素因数
    vector<ll> primes;  // primes[i] : i番目(iは0-index)の素数
    Eratosthenes(ll n = 1): n(n), f(n+1) {
        f[0] = f[1] = -1;
        for(ll i = 2; i <= n; ++i) {
            if(f[i]) {
                continue;
            } 
            primes.pb(i);
            f[i] = i;
            for(ll j = i*i; j <= n; j += i) {
                if(!f[j]) {
                    f[j] = i;
                } 
            }
        }
    }
    bool isPrime(ll x) {  // xが素数ならtrueを返す
         return f[x] == x;
    }
    vector<ll> factorList(ll x) {  // xの素因数を重複も許して昇順に列挙したvectorを返す(x = 720 = (2^4)*(3^2)*(5^1)なら{2,2,2,2,3,3,5}のように)
        vector<ll> res;
        while(x != 1) {
            res.pb(f[x]);
            x /= f[x];
        }
        return res;
    }
    vector<P> factor(ll x) {  // (xのi番目の素因数, その素因数の個数)のvectorを返す(x = 720 = (2^4)*(3^2)*(5^1)なら{(2, 4), (3, 2), (5, 1)}のように)
        vector<ll> fL = factorList(x);
        if(fL.size() == 0) {
            return {};
        } 
        vector<P> res(1, make_pair(fL[0], 0));
        for(auto p : fL) {
            if(res.back().first == p) {
                res.back().second++;
            } 
            else {
                res.emplace_back(p, 1);
            }
        }
        return res;
    }
};

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

    Eratosthenes era(MAX_N);
    map<ll, ll> mp;
    exrep(x, 2, n) {
        auto f = era.factor(x);
        for(auto p : f) {
            mp[p.first] += p.second;
        }
    }

    ll cnt74 = 0, cnt24 = 0, cnt14 = 0, cnt4 = 0, cnt2 = 0;
    for(auto p : mp) {
        if(p.second >= 74) {
            cnt74++;
        }
        if(p.second >= 24) {
            cnt24++;
        }
        if(p.second >= 14) {
            cnt14++;
        }
        if(p.second >= 4) {
            cnt4++;
        }
        if(p.second >= 2) {
            cnt2++;
        }
    }
    
    ll ans = cnt74 + cnt24*(cnt2-1) + cnt14*(cnt4-1) + cnt4*(cnt4-1)*(cnt2-2)/2;

    out(ans);
    re0;
}

Measured memory_bytes: 256
package main

import (
	"bufio"
	"fmt"
	"math"
	"os"
	"sort"
	"strconv"
)

const pi = math.Pi

var mod int = pow(10, 9) + 7
var Umod uint64 = 1000000007
var ans, cnt int

func main() {
	reader.Split(bufio.ScanWords)
	N, _ := strconv.Atoi(read())
	A := make(SortBy, N)
	for i := 0; i < N; i++ {
		A[i], _ = strconv.Atoi(read())
		if A[i] < 0 {
			cnt++
		}
	}

	if cnt%2 == 0 {
		var sum int
		for i := 0; i < N; i++ {
			sum += abs(A[i])
		}
		fmt.Println(sum)
	} else {
		sort.Sort(A)
		if 0 < A[0] {
			A[0] *= (-1)
		}
		var sum int = A[0]
		for i := 1; i < N; i++ {
			sum += abs(A[i])
		}
		fmt.Println(sum)
	}
}

/*  ----------------------------------------  */

var reader = bufio.NewScanner(os.Stdin)

func read() string {
	reader.Scan()
	return reader.Text()
}

func lcm(x, y int) int {
	return (x / gcd(x, y)) * y
}

func gcd(x, y int) int {
	if x%y == 0 {
		return y
	} else {
		r := x % y
		return gcd(y, r)
	}
}

var fac [1000000]int
var finv [1000000]int
var inv [1000000]int

func combination_init() {
	fac[0], fac[1] = 1, 1
	finv[0], finv[1] = 1, 1
	inv[1] = 1

	// invは a^(-1) mod p
	// pをaで割ることを考える

	// p/a*(a) + p%a = p
	// p/a*(a) + p%a = 0          (mod p)
	// -p%a = p/a*(a)             (mod p)
	// -p%a *a^(-1)= p/a          (mod p)
	// a^(-1)= p/a * (-p%a)^(-1)  (mod p)
	// a^(-1) =

	for i := 2; i < 1000000; i++ {
		fac[i] = fac[i-1] * i % mod
		inv[i] = mod - inv[mod%i]*(mod/i)%mod
		finv[i] = finv[i-1] * inv[i] % mod
	}
}

func combination(x, y int) int {
	if x < y {
		return 0
	}
	if fac[0] != 1 {
		combination_init()
	}
	return fac[x] * (finv[y] * finv[x-y] % mod) % mod
	//return fac[x] / (fac[y] * fac[x-y])
}

func permutation(x, y int) int {
	if x < y {
		return 0
	}
	if fac[0] != 1 {
		combination_init()
	}
	return fac[x] * (finv[x-y] % mod) % mod
	//return fac[x] / fac[x-y]
}

func max(x ...int) int {
	var res int = x[0]
	for i := 1; i < len(x); i++ {
		res = int(math.Max(float64(x[i]), float64(res)))
	}
	return res
}

func min(x ...int) int {
	var res int = x[0]
	for i := 1; i < len(x); i++ {
		res = int(math.Min(float64(x[i]), float64(res)))
	}
	return res
}
func pow(x, y int) int { return int(math.Pow(float64(x), float64(y))) }
func abs(x int) int    { return int(math.Abs(float64(x))) }
func floor(x int) int  { return int(math.Floor(float64(x))) }
func ceil(x int) int   { return int(math.Ceil(float64(x))) }

type SortBy []int

func (a SortBy) Len() int           { return len(a) }
func (a SortBy) Swap(i, j int)      { a[i], a[j] = a[j], a[i] }
func (a SortBy) Less(i, j int) bool { return abs(a[i]) < abs(a[j]) }

type PriorityQueue []int

func (h PriorityQueue) Len() int            { return len(h) }
func (h PriorityQueue) Less(i, j int) bool  { return h[i] < h[j] }
func (h PriorityQueue) Swap(i, j int)       { h[i], h[j] = h[j], h[i] }
func (h *PriorityQueue) Push(x interface{}) { *h = append(*h, x.(int)) }
func (h *PriorityQueue) Pop() interface{} {
	old := *h
	n := len(old)
	x := old[n-1]
	*h = old[0 : n-1]
	return x
}


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

if N % 4 == 0:
    print("Yes")
elif N > 6 and (N-7) % 4 ==0:
    print("Yes")
elif N > 13 and (N-14) % 4 ==0:
    print("Yes")
elif N > 20 and (N-21) % 4 ==0:
    print("Yes")
else:
    print("No")

Measured memory_bytes: 38384
import java.util.Scanner;

public class Main{
    public static void main(String args[]){
        Scanner sc = new Scanner(System.in);
       
        int a = sc.nextInt();
        int b = sc.nextInt();
        int x = a * b;
        
        if(x % 2==1){
            System.out.println("Odd");
        }else{
            System.out.println("Even");
        }
    }
}

Measured memory_bytes: 21844
#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define ALL(x) (x).begin(), (x).end()
typedef long long ll;
typedef pair<int, int> P;
typedef vector<vector<int>> Matrix;
static const int INF = 2000000000;


int main(){
  int n;
  cin >> n;
  vector<int> c(n-1), s(n-1), f(n-1);
  rep(i, n-1) cin >> c[i] >> s[i] >> f[i];
  rep(i, n-1){
    int j = i;
    int t = 0;
    t += s[i] + c[i];
    j++;
    while (j < n-1){
      if (s[j] <= t && t % f[j] == 0){
        t += c[j];
        j++;
      }else {
        t++;
      }
    }
    cout << t << endl;
  }
  cout << 0 << endl;
}

Measured memory_bytes: 256
#include<stdio.h>
#include<map>
#include<set>
#include<algorithm>
using namespace std;

int main(){
  while(true){
    int n, m, a, b;
    scanf("%d", &n);
    if(n == 0)return 0;
    set<int> times;
    map<int, int> people;
    for(int i = 0;i < n;i++){
      scanf("%d%d%d", &m, &a, &b);
      times.insert(a);
      times.insert(b);
      if(people.find(a) == people.end()){
	people[a] = 0;
      }
      if(people.find(b) == people.end()){
	people[b] = 0;
      }
      people[a] += m;
      people[b] -= m;
    }
    int weight = 0;
    bool res = true;
    set<int>::iterator it;
    for(it = times.begin();it != times.end();it++){
      weight += people[*it];
      if(weight > 150){
	res = false;
	break;
      }
    }
    if(res)puts("OK");
    else puts("NG");
  }
}

Measured memory_bytes: 1036
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**7)
from collections import Counter, deque
#from collections import defaultdict
from itertools import combinations, permutations, accumulate, groupby, product
from bisect import bisect_left,bisect_right
from heapq import heapify, heappop, heappush
#from math import floor, ceil
#from operator import itemgetter
def I(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))
def LI2(): return [int(input()) for i in range(n)]
def MXI(): return [[LI()]for i in range(n)]
#inf = 10**17
#mod = 10**9 + 7

n=I()
ans=n*(n-1)//2
print(ans)
    

Measured memory_bytes: 3436
import java.util.*
import kotlin.math.*

fun str() = readLine()!!
fun int() = str().toInt()
fun long() = str().toLong()

fun read(d:String = " ") = str().split(d)
fun <T> list(d:String = " ",f:String.()->T) = read(d).map {f(it)}
fun list() = list {toInt()}

fun <T> MutableList<T>.removeLast() = this.removeAt(this.lastIndex)

const val mod = 998244353L

fun main() {
	abc000X()
}

fun abc000X() {
	val (a,b,c) = read()
	println(when(b){
		"+"->a.toInt()+c.toInt()
		else-> a.toInt()-c.toInt()
	})
}


Measured memory_bytes: 35700
n=int(input())
Ans=[]
if n==2:
    l=input().split()
    a=int(l[0])
    b=int(l[1])
    if a>=b:
        for i in range(1,b+1):
            if b%i==0:
                if a%i==0:
                    Ans.append(i)
                else:
                    pass
            else:
                pass
    else:
        for i in range(1,a+1):
            if a%i==0:
                if b%i==0:
                    Ans.append(i)
                else:
                    pass
            else:
                pass
else:
    l=input().split()
    p=[]
    p.append(int(l[0]))
    p.append(int(l[1]))
    p.append(int(l[2]))
    c=max(p)
    p.remove(c)
    a=p[0]
    b=p[1]
    if a>=b:
        for i in range(1,b+1):
            if b%i==0:
                if a%i==0:
                    if c%i==0:
                        Ans.append(i)
                    else:
                        pass
                else:
                    pass
            else:
                pass
    else:
        for i in range(1,a+1):
            if a%i==0:
                if b%i==0:
                    if c%i==0:
                        Ans.append(i)
                    else:
                        pass
                else:
                    pass
            else:
                pass

for A in Ans:
    print(A)



Measured memory_bytes: 5608
using System;
using System.Collections.Generic;
             
public static class Program
{
    public static void Main()
    {
        long[] R = GetIntArray();
        long K = R[0];
        long A = R[1];
	long B = R[2];
        if (B <= A + 2)
        {
            Console.WriteLine((K + 1).ToString());
            return;
        }

        long n = 0;
        if ((A - 1) + 2 <= K)
        {
            K -= (A - 1) + 2;
            n = B + (K / 2) * (B - A);
            if ((K % 2) != 0)
            {
                 n += 1;
            }
        }
        else
        {
            n = 1 + K;
        }
	Console.WriteLine(n.ToString());
    }
    
    private static string ReadLine()
    {
    	return Console.In.ReadLine();
    }
    
    public static long[] GetIntArray()
    {
    	List<long> temp = new List<long>();
    	foreach (string c in ReadLine().Split(' '))
            temp.Add(long.Parse(c));
        return temp.ToArray();
    }
}

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

typedef long long ll;

ll gcd(ll a, ll b){
    ll r;
    if(b > a){
        swap(a, b);
    }
    while((r = a % b)){
        a = b;
        b = r;
    }
    return b;
}


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

    vector<ll> v;
    for(int i=0; i<n; i++){
        cin>>a;
        v.push_back(abs(a-x));
    }

    if(v.size() == 1){
        cout<<v[0]<<endl; 
        return 0;       
    }
    
    vector<ll> ans;
    for(int i=0; i<n-1; i++){
        ans.push_back(gcd(v[i], v[i+1]));
    }

    sort(ans.begin(), ans.end());
    cout<<ans[0]<<endl;

    return 0;
}

Measured memory_bytes: 5580
dhw = [(1,0),(0,-1),(0,1),(-1,0),
( 2,-2),( 2,-1),( 2, 0),( 2, 1),( 2, 2),
( 1,-2),( 1,-1),        ( 1, 1),( 1, 2),
( 0,-2),                        ( 0, 2),
(-1,-2),(-1,-1),        (-1, 1),(-1, 2),
(-2,-2),(-2,-1),(-2, 0),(-2, 1),(-2, 2)]

H, W = map(int, input().split())
sh, sw = map(lambda x:int(x)-1, input().split())
eh, ew = map(lambda x:int(x)-1, input().split())
S = [input() for _ in range(H)]

dst = [[-1]*W for _ in range(H)]

from collections import deque
dq = deque([(sh, sw, 0)])
while dq:
    h, w, d = dq.popleft()
    if 0 <= h < H and 0 <= w < W and dst[h][w] < 0 and S[h][w] != '#':
        dst[h][w] = d
        for dh, dw in dhw[:4]: dq.appendleft((h + dh, w + dw, d))
        for dh, dw in dhw[4:]: dq.append((h + dh, w + dw, d+1))

print(dst[eh][ew])


Measured memory_bytes: 273004
import java.io.*;
import java.math.*;
import java.security.*;
import java.text.*;
import java.util.*;
import java.util.concurrent.*;
import java.util.regex.*;
public class Main{
	static BufferedReader br;
	static int cin() throws Exception
	{
		return Integer.valueOf(br.readLine());
	}
	static int[] split() throws Exception
	{
		String[] cmd=br.readLine().split(" ");
		int[] ans=new int[cmd.length];
		for(int i=0;i<cmd.length;i++)
		{
			ans[i]=Integer.valueOf(cmd[i]);
		}                                              
		return ans;
	} 
    public static void main(String[] args) throws Exception {
        br = new BufferedReader(new InputStreamReader(System.in));
        int n=cin();
        String s=br.readLine();
        if(n%2!=0)
        	System.out.println("No");
        else
        {
        	int x=n/2;
        	String t=s.substring(0,x);
        	if((t+t).equals(s))
        		System.out.println("Yes");
        	else
        		System.out.println("No");
        }
    }
}

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

#define INF 1.1e9
#define LINF 1.1e18
#define FOR(i,a,b) for (int i=(a);i<(b);++i)
#define REP(i,n) FOR(i,0,n)
#define ALL(v) (v).begin(),(v).end()
#define pb push_back
#define pf push_front
#define fi first
#define se second
#define BIT(x,n) bitset<n>(x)
#define PI 3.14159265358979323846

typedef long long ll;
typedef pair<string,int> P;
typedef pair<int,P> PP;

//-----------------------------------------------------------------------------

bool f(const string& a,const string& b) {
	if(a.size()!=b.size()) return a.size()<b.size();
	REP(i,(int)a.size()) {
		if(a[i]==b[i]) continue;
		return a[i]<b[i];
	}
	return false;
}

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

	int n;
	cin>>n;
	map<string,int> mp;
	string s;int m;
	REP(i,n) {
		cin>>s>>m;
		mp[s]+=m;
	}
	vector<string> vec;
	for(auto x:mp) vec.pb(x.fi);
	sort(ALL(vec),f);
	for(auto x:vec) cout<<x<<' '<<mp[x]<<endl;

	return 0;
}




Measured memory_bytes: 3244
#include <iostream>
#include <string>
using namespace std;
int main(void){
 string s;
 while(true){
     cin >> s;
     if(s == "0") break;
     int sum = 0;
     for(int i=0; i<s.size(); i++){
         sum += s[i] - '0';
     }
     cout << sum << endl;
 }
}


Measured memory_bytes: 3176
/*		Author : Kaustubh Gangwar
		||S||A||M||R||A||T||
*/
#include <bits/stdc++.h>
using namespace std;
#define mod 1000000007
#define ld long double
#define pb push_back
#define gcd __gcd
#define vii vector<int>
#define vll vector<long long>
#define all(x) x.begin(),x.end()
#define f(i,a,b) for(int i=a;i<b;i++)
#define fe(i,a,b) for(int i=a;i<=b;i++)
#define nl '\n'
typedef long long  ll;
typedef pair<int,int> pii;

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

int32_t main()
{	ios_base::sync_with_stdio(false);
	cin.tie(0),cout.tie(0);
	ll test=1;
	//cin>>test;
	while(test--)
	{	ll l,r; cin>>l>>r;
		ll n; cin>>n;
		ll ans=0;
		f(i,l,r+1)
		{if(i%n==0)
		ans++;
		}
		
		cout<<ans;
		
	}
return 0;
}


Measured memory_bytes: 3580
#include<iostream>
#include<algorithm>
#include<cstdio>
#include<cstring>
#include<cmath>
#include<map>
#include<queue>
#include<set>
#include<stack>
#include<string>
#include<sstream>
#include<vector>
#define inf 2147483647
#define rep(i,a,b) for(int i=a;i<b;i++)
#define  rr read()
#define ll long long
#define repb(i,a,b) for(int i=a;i<=b;i++)
#define CloseIo   ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0)
using namespace std;
int read()
{
    char ch = getchar();
	int x = 0, f = 1;
    while(ch < '0' || ch > '9') {if(ch == '-') f = -1; ch = getchar();}
    while('0' <= ch && ch <= '9') {x = x * 10 + ch - '0'; ch = getchar();}
    return x * f;
}
int main()
{
 int n=rr,k=rr;
 double a=1.0/n,ans=0;
  for(int i=1;i<=n;i++)
  {
  	 int t=0,temp=i;
  	 while(temp<k)
  	 {
  	 	 temp=temp<<1;
  	 	 t++;
	   }
	   ans+=a*pow(1.0/2.0,t);
  }
  printf("%.12lf",ans);
}




Measured memory_bytes: 256