akhauriyash/Code-Regression huggingface dataset:
#include<bits/stdc++.h>
#define rep(i, n) for(int (i)=0 ;i <(n); ++(i))
#define REP(i,m,n) for(int (i) = (m); (i) <= (n); ++(i))
#define yorn(f) puts((f)?"Yes":"No")
#define YORN(f) puts((f)? "YES":"NO")
typedef long long ll;
using namespace std;

int f(int x,int k) {
  int res = min(x*2, x+k);
  return res;
}

int main() {
  int n, k;
  cin >> n >> k;
  int ans = 1;
  rep(i, n) {
    ans = f(ans, k);
  }
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define _GLIBCXX_DEBUG
using namespace std;
using ll = long long;
using vec = vector<ll>;
using vect = vector<double>;
using Graph = vector<vector<ll>>;
#define loop(i, n) for (ll i = 0; i < n; i++)
#define Loop(i, m, n) for (ll i = m; i < n; i++)
#define pool(i, n) for (ll i = n; i >= 0; i--)
#define Pool(i, m, n) for (ll i = n; i >= m; i--)
#define mod 1000000007ll
#define setbit bitset<8>
#define flagcount __builtin_popcount
#define flag(x) (1 << x)
#define flagadd(bit, x) bit |= flag(x)
#define flagpop(bit, x) bit &= ~flag(x)
#define flagon(bit, i) bit &flag(i)
#define flagoff(bit, i) !(bit & (1 << i))
#define all(v) v.begin(), v.end()
#define low2way(v, x) lower_bound(all(v), x)
#define high2way(v, x) upper_bound(all(v), x)
#define count2way(v, x) high2way(v, x) - low2way(v, x)
#define lower(v, x) low2way(v, x) - v.begin()       //1番左が0、もし見つから無いならｎを出力
#define higher(v, x) high2way(v, x) - v.begin() - 1 //1番左が0、もし見つからないならn-1を出力（注意）
#define putout(a) cout << a << endl
#define putout2(a, b) \
    putout(a);        \
    putout(b)
#define putout3(a, b, c) \
    putout(a);           \
    putout(b);           \
    putout(c)
#define putout4(a, b, c, d) \
    putout(a);              \
    putout(b);              \
    putout(c);              \
    putout(d)
#define putout5(a, b, c, d, e) \
    putout(a);                 \
    putout(b);                 \
    putout(c);                 \
    putout(d);                 \
    putout(e)
#define Gput(a, b) G[a].push_back(b)
#define cin1(a) cin >> a
#define cin2(a, b) cin >> a >> b
#define cin3(a, b, c) cin >> a >> b >> c
#define cin4(a, b, c, d) cin >> a >> b >> c >> d
#define cin5(a, b, c, d, e) cin >> a >> b >> c >> d >> e
#define Sum(v) accumulate(all(v), 0ll)
#define gcd(x, y) __gcd(x, y)
ll ctoi(char c)
{
    if (c >= '0' && c <= '9')
    {
        return c - '0';
    }
    return 0;
}
template <typename T>
T lcm(T x, T y)
{
    T z = gcd(x, y);
    return x * y / z;
}
template <typename T>
bool primejudge(T n)
{
    if (n < 2)
        return false;
    else if (n == 2)
        return true;
    else if (n % 2 == 0)
        return false;
    double sqrtn = sqrt(n);
    for (T i = 3; i < sqrtn + 1; i++)
    {
        if (n % i == 0)
        {
            return false;
        }
        i++;
    }
    return true;
}
template <typename T>
T modinv(T a, T m)
{
    T b = m, u = 1, v = 0;
    while (b)
    {
        T t = a / b;
        a -= t * b;
        swap(a, b);
        u -= t * v;
        swap(u, v);
    }
    u %= m;
    if (u < 0)
        u += m;
    return u;
}
//場合によって使い分ける
//const ll dx[4]={1,0,-1,0};
//const ll dy[4]={0,1,0,-1};
const ll dx[8] = {1, 1, 0, -1, -1, -1, 0, 1};
const ll dy[8] = {0, 1, 1, 1, 0, -1, -1, -1};
//多次元配列の宣言法
//vector<vector<ll>> field(h, vector<ll>(w));
template <class T>
inline void chmax(T &a, T b)
{
    if (a < b)
        a = b;
}
template <class T>
inline void chmin(T &a, T b)
{
    if (a > b)
        a = b;
}
/*
ライブラリをここに置いてコメントを削除
*/
static const double pi = 3.141592653589793;
int main()
{
    cout << fixed << setprecision(30);
    double r;
    cin>>r;
    r*=pi;
    putout(r*2);
    return 0;
}


Measured memory_bytes: 3812
import java.util.*;
public class Main {
	static Scanner sc = new Scanner(System.in);
	static int n;
	static boolean[] isPrime;
	static final int MAX_INDEX = 123456*2;
	public static void main(String[] args) {
		makePrime();
		while(read()){
			solve();
		}
	}
	static void makePrime(){
		isPrime = new boolean[MAX_INDEX + 1];
		//System.out.println(MAX_INDEX);
		//System.out.println(isPrime.length);
		isPrime[1] = false;
		for(int i = 2; i < isPrime.length; i++)isPrime[i] = true;
		for(int i = 2; i <= MAX_INDEX; i++){
			if(isPrime[i] == true){
				for(int j = 2; j*i <= MAX_INDEX; j++){
					isPrime[i*j] = false;
				}
			}
		}
	}
	static boolean read(){
		n = sc.nextInt();
		if(n == 0)return false;
		return true;
	}
	static void solve(){
		int count = 0;
		for(int i = n+1; i <= 2*n; i++){
			if(isPrime[i] == true)count++;
		}
		/*if(n == 13){
			for(int i = 13; i < 26; i++){
				if(isPrime[i] == true)System.out.println(i);
			}
		}*/
		System.out.println(count);
	}
}

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


signed main(){
    ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0);

    string s, t;
    cin>>s>>t;
    int ans = 100000;
    int n = s.size();
    int m = t.size();
    for (int i=0; i<=n-m; i++){
        int here = 0;
        for (int j=0; j<m; j++){
            here += (s[i+j]!=t[j]);
        }
        ans = min(ans, here);
    }

    cout<<ans<<endl;

    return 0;
}


Measured memory_bytes: 3656
using System;

class Program
{
    static void Main()
    {
        var ab = Array.ConvertAll(Console.ReadLine().Split(), int.Parse);
        int n = ab[1] - ab[0] - 1;
        int sum = 0;
        for (int i = 1; i <= n; i++) sum += i;
        Console.WriteLine(sum - ab[0]);
    }
}

Measured memory_bytes: 11092
#include<stdio.h>

int abs(int n){
  if(n<0){return n*(-1);}
  return n;
}

int main(){
  int N,ans=10000,u=0,a=0;
  scanf("%d",&N);
  int W[N];
  for(int i=0;i<N;i++){
    scanf("%d",&W[i]);
    u+=W[i];
  }
  for(int i=0;i<N;i++){
    a+=W[i];
    u-=W[i];
    if(ans>abs(u-a)){
      ans=abs(u-a);
       }
  }
  printf("%d",ans);
}

Measured memory_bytes: 128
#define _USE_MATH_DEFINES
#include <algorithm>
#include <cstdio>
#include <functional>
#include <iostream>
#include <cfloat>
#include <climits>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <time.h>
#include <vector>
#include <random>
#include <list>
#include <numeric>
using namespace std;
 
typedef long double ld;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> i_i;
typedef pair<ll, int> ll_i;
typedef pair<int, ll> i_ll;
typedef pair<double, int> d_i;
typedef pair<ll, ll> ll_ll;
typedef pair<double, double> d_d;
struct edge { int u, v; ll w; };
 
#define rep(i, N) for (int i = 0; i < (int)(N); i++)
#define pb push_back
 
int INF = INT_MAX / 10;
ll MOD = 1000000007;
ll _MOD = 1000000009;
double EPS = 1e-10;

int main() {
	int N; cin >> N;
	vector<int> a(N), b(N);
	rep(i, N) cin >> a[i];
	rep(i, N) cin >> b[i];
	vector<set<int> > st(N);
	st[0].insert(a[0]);
	st[N - 1].insert(b[N - 1]);
	for (int i = 0; i + 1 < N; i++) {
		if (a[i] < a[i + 1]) st[i + 1].insert(a[i + 1]);
		if (b[i] > b[i + 1]) st[i].insert(b[i]);
	}
	rep(i, N) if (st[i].size() >= 2) {
		cout << 0 << endl;
		return 0;
	}
	rep(i, N) if (st[i].size() == 1) {
		int x = *st[i].begin();
		if (x > a[i] || x > b[i]) {
			cout << 0 << endl;
			return 0;
		}
	}
	ll ans = 1;
	rep(i, N) if (st[i].empty()) ans = ans * min(a[i], b[i]) % MOD;
	cout << ans << endl;
}


Measured memory_bytes: 10368
#include <iostream>
#include <vector>
#include <stack>
#include <queue>
#include <algorithm>
#include <cstdlib>
#include <cmath>
#include <numeric>

using namespace std;

#define rep(i, n) for(int i = 0; i < n; i++)
#define repi(i, start, end) for(int i = start; i < end; i++)
#define all(x) (x).begin(), (x).end()
#define debug(x) cout << (x) << endl;
typedef long long ll;
const int MAX = 999999999;

int main(){
    int n;
    cin >> n;
    vector<string> blue_words(n);
    rep(i, n) cin >> blue_words[i];

    int m;
    cin >> m;
    vector<string> red_words(m);
    rep(i, m) cin >> red_words[i];

    vector<string> unique_words;
    unique_words.insert(unique_words.end(), all(blue_words));
    unique_words.insert(unique_words.end(), all(red_words));
    sort(all(unique_words));
    unique_words.erase(unique(all(unique_words)), unique_words.end());

    vector<int> scores(unique_words.size());
    rep(i, unique_words.size()){
        scores[i] = count(all(blue_words), unique_words[i]) - count(all(red_words), unique_words[i]);
    }

    cout << max(0, *max_element(all(scores))) << endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <fstream>
#include <set>
#include <map>
#include <string>
#include <vector>
#include <queue>
#include <deque>
#include <stack>
#include <functional>
#include <algorithm>
#include <climits>
#include <cmath>
#include <iomanip>
using namespace std;
#define ll long long int
#define rep(i,n) for( int i = 0; i < n; i++ )
#define rrep(i,n) for( int i = n; i >= 0; i-- )
#define REP(i,s,t) for( int i = s; i <= t; i++ )
#define RREP(i,s,t) for( int i = s; i >= t; i-- )
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define INF 2000000000
#define mod 1000000007
#define INF2 1000000000000000000


int main(void)
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    int N, K, R, S, P;
    string T;
    cin >> N >> K >> R >> S >> P >> T;
    int ans = 0;
    for(int i = 0; i < K; i++) {
        if(T[i] == 'r') ans += P;
        if(T[i] == 's') ans += R;
        if(T[i] == 'p') ans += S;
        bool free = false;
        for(int j = i + K; j < N; j += K) {
            if(!free && T[j - K] == T[j]) {
                free = true;
            } else {
                if(T[j] == 'r') ans += P;
                if(T[j] == 's') ans += R;
                if(T[j] == 'p') ans += S;
                free = false;
            }
        }
        //cout << "*" << ans << endl;
    }
    cout << ans << endl;

    return 0;
}


Measured memory_bytes: 3708
/* longest_decreasing_subsequence.cpp
    最長減少部分列の長さを動的計画法により求める
    （i<j かつ a_i > a_j (or a_i >= a_j) を満たす最長の部分列）

    dp[i] := 長さ i+1 の単調減少部分列の最終要素らにおける最大値
    （dp 自体も単調減少）

*/

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

/* lds(seq):
    入力: 数列 seq, 広義かどうかを表す weak
    出力: 最長減少部分列の長さ
    計算量: O(NlogN)
*/
int lds(const vector<long long> &seq, bool weak = false) {
    int N = seq.size();
    const long long INF = 1LL << 60;
    vector<long long> dp(N + 5, -INF);
    for (int i = 0; i < N; i++) {
        if (!weak) {
            *lower_bound(dp.begin(), dp.end(), seq[i], greater<long long>()) = seq[i];
        } else {
            *upper_bound(dp.begin(), dp.end(), seq[i], greater<long long>()) = seq[i];
        }
    }
    return (lower_bound(dp.begin(), dp.end(), -INF, greater<long long>()) - dp.begin());
}

int main() {
    int n;
    cin >> n;
    vector<long long> a(n);
    for (int i = 0; i < n; i++) cin >> a.at(i);
    cout << lds(a, true) << endl;
}


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

const ll MAXN = 200000;
const ll INF = 1001001001;
const ll MOD = 1000000007;

ll N, ans=0, tmp=0;
vector<ll> A;

signed main(){
    cin >> N;
    tmp = N+N*N+N*N*N;
    cout << tmp << endl;
    return 0;
}

Measured memory_bytes: 3620
#include<bits/stdc++.h>
using namespace std;
 
int main(){
    int a, b, c;
    cin >> a >> b >> c;
    
    if(a==b&&b==c) cout << 1 << endl;
    else if(a!=b&&b!=c&&c!=a) cout << 3 << endl;
    else cout << 2 << endl;
}


Measured memory_bytes: 256
#include<stdio.h>
#define N 100000
typedef struct{
  int  num;
  char mk; // mark
  int order; // original order
} card_t;

void swap(card_t *a_p, card_t *b_p){
  card_t k;
  k    = *a_p;
  *a_p = *b_p;
  *b_p = k;
}


int prt(card_t* a_p, int p, int r ){
  int j;
  int x = a_p[r].num;
  int i = p-1;

  for( j = p ; j <= (r-1) ; j++){
    if( a_p[j].num <= x){
      i++;
      swap((a_p+i) ,(a_p+j));
    }
  } 
  swap( (a_p+i+1) ,(a_p+r));
  
  return i+1;
}

void qsort(card_t* a_p, int p, int r){
  int q;
  if( p < r ){
    q = prt(a_p, p, r);
    qsort(a_p, p, q-1);
    qsort(a_p, q+1, r);
  }
}


int main(){
  int n, i, j, k;
  int q;
  int nsf = 0; // not stable flag
  card_t a[N] = {0};
  
  scanf("%d", &n);
  for ( i = 0; i < n; i++ ){
    scanf(" %c%d", &(a[i].mk) ,&(a[i].num) );
    a[i].order = i;
  }

  qsort(a,0,n-1);  

  /* for debug
  for( i=0 ; i<n ; i++){
    printf("a[%i].mk = %c .num = %d .order = %d \n"
	   ,i ,a[i].mk ,a[i].num ,a[i].order );
  }
  */

  for( i = 0 ; i < (n-1) ; i++){
    if( a[i].num == a[i+1].num && a[i].order > a[i+1].order){
      nsf = 1;
      printf("Not stable\n");
      break;
    } 
  }
  if( nsf == 0){
    printf("Stable\n");
  }

  for( i = 0; i < n ; i++){
    printf("%c %d\n" ,a[i].mk ,a[i].num );
  }

  return 0; // Don't forget return 0
}

Measured memory_bytes: 1788
#include <iostream>
#include <string>
#include <cmath>
#include<algorithm>
#include<stack>
#include<queue>
#include<map>
#include<set>
#include<iomanip>
#define _USE_MATH_DEFINES
#include <math.h>
#include <functional>
#include<complex>
using namespace std;

#define rep(i,x) for(ll i=0;i<x;i++)
#define repn(i,x) for(ll i=1;i<=x;i++)

typedef long long ll;
const ll INF = 1e17;
const ll MOD = 1000000007;
const ll MAX = 4000001;
const double eps = 1E-18;

ll max(ll a, ll b) {
	if (a > b) { return a; }
	return b;
}

ll min(ll a, ll b) {
	if (a > b) { return b; }
	return a;
}

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

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

struct edge {
	ll ind;
	ll fr;
	ll to;
	ll d;
};

class mint {
	long long x;
public:
	mint(long long 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 operator^(const ll& t)const {
		if (!t) return 1;
		mint a = pow(t >> 1);
		a *= a;
		if (t & 1) a *= *this;
		return 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;
	}

	friend ostream& operator<<(ostream& os, const mint& m) {
		os << m.x;
		return os;
	}
};

///////////////////////////


int main() {
	ll N, D, Q;
	cin >> N >> D;

	vector<ll> d(N + 1);
	repn(i, N) cin >> d[i];

	vector<ll> rest(N + 1);
	rest[0] = D;
	repn(i, N) rest[i] = min(rest[i - 1], abs(rest[i - 1] - d[i]));

	vector<ll> fault(N + 1);
	fault[N] = 1;

	for (ll i = N - 1; i >= 0; i--) {
		if (fault[i + 1]*2 <= d[i + 1]) { fault[i] = fault[i + 1]; }
		else { fault[i] = fault[i + 1] + d[i + 1]; }
	}

	//repn(i, N) cout << i << " " << rest[i] << " " << fault[i] << endl;

	cin >> Q;
	repn(i, Q) {
		ll q;
		cin >> q;

		if (rest[q - 1] >= fault[q]) { cout << "YES" << endl; }
		else { cout << "NO" << endl; }
	}

	system("PAUSE");

}

Measured memory_bytes: 13944
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i,n) for (int i = 0; i < (n); ++i)
int main(){
  int n;
  map<string,int> m;
  std::vector<string> s;

  std::cin >> n;
  string si;
  rep(i,n){
    std::cin >> si;
    m[si]++;
    s.push_back(si);
  }

  sort(s.begin(),s.end());
  s.erase(std::unique(s.begin(), s.end()), s.end());

  std::vector<string> ans;
  int max=0;
  for (int i = 0; i < s.size(); i++) {

    if(m[s[i]]>max){
      ans.assign(1,s[i]);
      max =m[s[i]];
    }else if(m[s[i]]==max){
      ans.push_back(s[i]);
    }
  }
  
  for (int i = 0; i < ans.size(); i++) {
    std::cout << ans[i] << '\n';
  }

  return 0;


}


Measured memory_bytes: 28400
import java.util.*;

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

        int a = sc.nextInt();
        int b = sc.nextInt();
        int c = sc.nextInt();
     
        if(a<b && b<c){
            System.out.println("Yes");
        }else{
            System.out.println("No");
        }
    }
}


Measured memory_bytes: 26276
import java.io.BufferedReader;
import java.io.Closeable;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.LinkedList;
import java.util.ListIterator;
import java.util.Map.Entry;

import java.util.PriorityQueue;
import java.util.Random;
import java.util.StringTokenizer;
import java.util.TreeMap;
import java.util.TreeSet;


public class Main {
	
	public static void main(String[] args) throws IOException {	
		try(final Scanner sc = new Scanner(System.in)){
			final int N = sc.nextInt();
			long[] as = new long[N];
			for(int i = 0; i < N; i++) {
				as[i] = sc.nextLong();
			}
			
			final long MOD = 1000000007;
			
			long answer = 0;
			long rest_sum = Arrays.stream(as).sum() % MOD;
			for(int i = 0; i < N; i++) {
				rest_sum = (rest_sum + MOD - as[i]) % MOD;
				answer = (answer + rest_sum * as[i]) % MOD;
			}
			
			System.out.println(answer);
		}
	}

	public static class Scanner implements Closeable {
		private BufferedReader br;
		private StringTokenizer tok;

		public Scanner(InputStream is) throws IOException {
			br = new BufferedReader(new InputStreamReader(is));
		}

		private void getLine() throws IOException {
			while(!hasNext()){
				tok = new StringTokenizer(br.readLine());
			}
		}

		private boolean hasNext() {
			return tok != null && tok.hasMoreTokens();
		}

		public String next() throws IOException {
			getLine();
			return tok.nextToken();
		}

		public int nextInt() throws IOException {
			return Integer.parseInt(next());
		}

		public long nextLong() throws IOException {
			return Long.parseLong(next());
		}
		

		public double nextDouble() throws IOException {
			return Double.parseDouble(next());
		}

		public int[] nextIntArray(int n) throws IOException {
			final int[] ret = new int[n];
			for(int i = 0; i < n; i++){
				ret[i] = this.nextInt();
			}
			return ret;
		}

		public long[] nextLongArray(int n) throws IOException {
			final long[] ret = new long[n];
			for(int i = 0; i < n; i++){
				ret[i] = this.nextLong();
			}
			return ret;
		}

		public void close() throws IOException {
			br.close();
		}
	}
}


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

int main()
{
    int N, K;
    int x[100] = {0};

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

    int ans = 0;
    for (int i = 0; i < N; i++)
    {
        ans += 2 * min(x[i], abs(x[i] - K));
    }
    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N = 105;
const int MOD = 1e9 + 7;

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

ll inv(ll x, ll p) {
    return powmod(x, p - 2);
}

ll C(ll n, ll m) {
    if(m > n) return 0;
    ll up = 1, down = 1; // 分子分母
    for(int i = n - m + 1; i <= n; ++i)
        up = up * i % MOD;
    for(int i = 1; i <= m; ++i)
        down = down * i % MOD;
    return up * inv(down, MOD) % MOD;
}

ll Lucas(ll n, ll m) {
    if(m == 0) return 1;
    return C(n % MOD, m % MOD) * Lucas(n / MOD, m / MOD) % MOD;
}

int main()
{
    int n, a, b;
    cin >> n >> a >> b;
    ll t1 = powmod(2, n) - 1;
    ll t2 = (Lucas(n, a) + Lucas(n, b)) % MOD;
    cout << (t1 - t2 + MOD) % MOD << endl;
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define all(v) v.begin(), v.end()
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
const double PI=3.14159265358979323846;
const int64_t waru = 1000000007;
using in = int64_t;

int main(){
  int n;
  cin>>n;
  int x;
  for(int i=0;i<=n;i++){
    x= i*1.08;
     if(x==n){
       cout<<i;
       break;
     }
    else if(i==n) cout<<":(";
  }
}

Measured memory_bytes: 256
n, m = map(int, input().split())
graph = [[] for _ in range(n)]
for _ in range(m):
    a, b = map(int, input().split())
    graph[a-1].append(b-1)
    graph[b-1].append(a-1)
def DFS(node, seen):
    if len(seen)==n-1:
        return 1
    tmp = 0
    for i in graph[node]:
        if i in seen:
            continue
        tmp += DFS(i, seen|{node})
    return tmp
print(DFS(0, set()))

Measured memory_bytes: 3064
import java.util.HashSet;
import java.util.Scanner;
public class Main {

	public static void main(String[] args) {

		 Scanner sc = new Scanner(System.in);
		HashSet<String> s = new HashSet<String>();
		 int n=sc.nextInt();
		 for(int i=0; i<n; i++){
			 String t=sc.next();
			 String r=sc.next();
			 if(t.equals("insert")){
				 s.add(r);
			 }else if(t.equals("find") && s.contains(r)){
				 System.out.println("yes");
			 }else if(t.equals("find") && !s.contains(r)){
				 System.out.println("no");
			 }
		 }

	}



}


Measured memory_bytes: 254512
#include<bits/stdc++.h>
using namespace std;
#define int long long
#define pii pair<int,int>
#define mp make_pair
int n,q;
struct edge{
	int v,c,w;
	edge(int vv,int cc,int ww){
		v=vv;
		c=cc;
		w=ww;
	}
};
vector<edge> G[123456];
int cnt[123456],in[123456],out[123456],tim=0;
int pa[18][123456];
bool anc(int x,int y){
	return in[x]<=in[y] && out[x]>=out[y];
}
void dfs(int cur,int pre){
	in[cur]=++tim;
	pa[0][cur]=pre;
	for(edge tmp:G[cur]){
		int nxt=tmp.v,col=tmp.c,w=tmp.w;
		if(nxt==pre) continue;
		dfs(nxt,cur);
	}
	out[cur]=++tim;
}
void build(){
	for(int i=1;i<18;i++)
		for(int j=1;j<=n;j++)
			pa[i][j]=pa[i-1][pa[i-1][j]];
}
int lca(int x,int y){
	if(anc(x,y)) return x;
	if(anc(y,x)) return y;
	for(int i=17;i>=0;i--)
		if(!anc(pa[i][x],y)) x=pa[i][x];
	return pa[0][x];
}
int ans[123456],q_col[123456],q_val[123456],dist[123456];
vector<int> query[123456];
void solve(int cur,int pre,int cur_dis){
	for(int id:query[cur]){
		int mul=1;
		if(id<0) mul=-2,id=-id;
		ans[id]+=mul*(cur_dis+cnt[q_col[id]]*q_val[id]-dist[q_col[id]]);
	}

	for(edge tmp:G[cur]){
		int nxt=tmp.v,col=tmp.c,w=tmp.w;
		if(nxt==pre) continue;
		cnt[col]++;
		dist[col]+=w;
		solve(nxt,cur,cur_dis+w);
		dist[col]-=w;
		cnt[col]--;
	}
}
int32_t main(){
	ios::sync_with_stdio();
	cin.tie(0);
	cin>>n>>q;
	for(int i=0;i<n-1;i++){
		int u,v,c,w;cin>>u>>v>>c>>w;
		G[u].push_back(edge(v,c,w));
		G[v].push_back(edge(u,c,w));
	}
	dfs(1,1);
	build();
	for(int i=1;i<=q;i++){
		int u,v;cin>>q_col[i]>>q_val[i]>>u>>v;
		query[u].push_back(i);
		query[v].push_back(i);
		query[lca(u,v)].push_back(-i);
	}
	solve(1,1,0);

	for(int i=1;i<=q;i++)
		cout<<ans[i]<<endl;
}

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

#define N 500000

void merge(int*,int,int,int);
void mergeSort(int*,int,int);

int count=0;

int main(){
  int i,j,a,A[N];

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

  mergeSort(A,0,a);

  printf("%d",A[0]);
  for(i=1;i<a;i++){
    printf(" %d",A[i]);
  }

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

  return 0;
}

void merge(int *A,int left,int mid,int right){
  int n1,n2,i=0,k,j=0;
  n1=mid-left;
  n2=right-mid;
  int L[n1],R[n2];

  for(i=0;i<n1;i++){
    L[i]=A[left+i];
  }
  for(i=0;i<n2;i++){
    R[i]=A[mid+i];
  }

  L[n1]=2147483647;
  R[n2]=2147483647;

  i=0;
  j=0;
  for(k=left;k<right;k++){
    if(L[i]<=R[j]){
      A[k]=L[i];
      i=i+1;
      count++;
    }
    else{
      A[k]=R[j];
      j=j+1;
      count++;
    }
  }

  return;
}
  
void mergeSort(int *A,int left,int right){
  int mid;
  
  if(left+1<right){
    mid=(left+right)/2;
    mergeSort(A,left,mid);
    mergeSort(A,mid,right);
    merge(A,left,mid,right);
  }

  return;
}



Measured memory_bytes: 5688
// D - Bouquet
#include <bits/stdc++.h>
using namespace std;
using ll = long long;

// a^n mod m を計算する(二分累乗法:O(logn))
ll modpow(ll a, ll n, ll m) {
	ll x = 1;
	while(n > 0){
		if(n & 1) x = x * a % m;
		a = a * a % m;
		n >>= 1;
	}
	return x;
}

// nCr mod m
ll nCr(ll n, ll r, ll m){
	ll a = 1, b = 1;
	for(ll i=0; i<r; ++i){
		a = a * (n-i) % m;
		b = b * (r-i) % m;
	}
	return a * modpow(b, m-2, m) % m;
}

int main(){
	ll MOD = 1000000007, N,A,B;
	cin>>N>>A>>B;
	ll ans = modpow(2, N, MOD) - 1;
	ans -= nCr(N, A, MOD);
	ans -= nCr(N, B, MOD);
	ans %= MOD;
	if(ans < 0L) ans += MOD;
	cout<< ans <<endl;
}

Measured memory_bytes: 256
#!/usr/bin/python3
# -*- coding:utf-8 -*-

def main():
  L, R, U, D = 0, 1, 2, 3
  h, w, n = map(int, input().split())
  sr, sc = map(int, input().split())
  sr, sc = sr-1, sc-1
  ls = input().strip()[::-1]
  lt = input().strip()[::-1]
  r = [0, w-1, 0, h-1]
  
  def f(d):
    if d=='L':
      r[L] = (min(max(-1, r[L]+1), w))
    if d=='R':
      r[R] = (min(max(-1, r[R]-1), w))
    if d=='U':
      r[U] = (min(max(-1, r[U]+1), h))
    if d=='D':
      r[D] = (min(max(-1, r[D]-1), h))
      
  def g(d):
    if d=='L':
      r[R] = (min(max(0, r[R]+1), w-1))
    if d=='R':
      r[L] = (min(max(0, r[L]-1), w-1))
    if d=='U':
      r[D] = (min(max(0, r[D]+1), h-1))
    if d=='D':
      r[U] = (min(max(0, r[U]-1), h-1))
      
  def check():
    if r[L] > r[R] or r[L] < 0 or r[R] > w-1:
      return True
    if r[U] > r[D] or r[U] < 0 or r[D] > h-1:
      return True
    return False
  
  for s, t in zip(ls, lt):
    g(t)
    f(s)
    if check():
      print('NO')
      return
  if r[L] <= sc <= r[R] and r[U] <= sr <= r[D]:
    print('YES')
  else:
    print('NO')
    
if __name__=='__main__':
  main()



Measured memory_bytes: 3888
def A_FiftyFifty():
    S = list(input())
    S.sort()
    output = "No"
    if (S[0] != S[2]) and (S[0] == S[1]) and (S[2] == S[3]):
        output = "Yes"
    print(output)

if __name__ == "__main__":
    A_FiftyFifty()

Measured memory_bytes: 3060
import java.util.*

fun main(args: Array<String>) {
    val sc = Scanner(System.`in`)
    val n = sc.nextInt()
    val k = sc.nextInt()
    val h = (0 until n).map { sc.next().toInt() }
    println(problem142b(n, k, h))
}

fun problem142b(n: Int, k: Int, h: List<Int>): Int {
    var count = 0
    for (i in 0 until n) {
        if (h[i] >= k) count++
    }
    return count
}

Measured memory_bytes: 44464
#include <bits/stdc++.h>
const int maxn=3001000;
const int mod=1e9+7;
const long long inf=1e15;
typedef long long ll;
using namespace std;

ll qpow(ll x,ll y)
{
    ll sum=1;
    while(y)
    {
        if(y&1)
            sum=(sum*x)%mod;
        x=x*x%mod;
        y/=2;
    }
    return sum;
}

int main()
{
    int x;
    cin>>x;
    bool flag=false;
    for(int i=1;i<=9;i++){
        for(int j=1;j<=9;j++){
            if(i*j==x){
                flag=true;
            }
        }
    }
    if(flag)
        cout<<"Yes"<<endl;
    else
        cout<<"No"<<endl;
}


Measured memory_bytes: 256
import numpy as np
H,W,K = (int(X) for X in input().split())
Tile = np.zeros((H,W),dtype=bool)
for T in range(0,H):
    Tile[T,:] = np.array([True if X=='#' else False for X in list(input())])

Count = 0
for R in range(0,pow(2,H)):
    DrawR = [int(X) for X in list(('{:0'+str(H)+'b}').format(R,'b'))]
    
    TileR = np.copy(Tile)
    for RB in range(0,H):
        if DrawR[RB]:
            TileR[RB] = False
            
    for C in range(0,pow(2,W)):
        TileC = np.copy(TileR)
        DrawC = [int(X) for X in list(('{:0'+str(W)+'b}').format(C,'b'))]
        for CB in range(0,W):
            if DrawC[CB]:
                TileC[:,CB] = False
        if np.sum(TileC)==K:
            Count += 1
print(Count)

Measured memory_bytes: 27116
/**
 * code generated by JHelper
 * More info: https://github.com/AlexeyDmitriev/JHelper
 * @author aryssoncf
 */



// Taken from: https://github.com/bqi343/USACO/blob/master/Implementations/content/contest/templateShort.cpp

#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<ull> vul;
typedef vector<ll> vl;
typedef vector<pii> vpii;

#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define F0R(i, a) FOR(i,0,a)
#define ROF(i, a, b) for (int i = (b)-1; i >= (a); --i)
#define R0F(i, a) ROF(i,0,a)
#define trav(a, x) for (auto& a: x)

#define sz(x) (int)x.size()
#define all(x) begin(x), end(x)
#define rsz resize

#define mp make_pair
#define pb push_back
#define f first
#define s second

const int MOD = 1e9 + 7; // 998244353; // = (119<<23)+1
const int MX = 2e5 + 5;

template<class T>
bool ckmin(T &a, const T &b) {
    return a > b ? a = b, 1 : 0;
}

template<class T>
bool ckmax(T &a, const T &b) {
    return a < b ? a = b, 1 : 0;
}

mt19937 rng((uint32_t) chrono::steady_clock::now().time_since_epoch().count());


//
// Created by aryssoncf on 28/10/2019.
//

#include <type_traits>


#include <iterator>
#include <utility>

template<typename T>
constexpr auto hasBegin(int) -> decltype(std::begin(std::declval<T>()), true) {
    return true;
}

constexpr bool hasBegin(...) {
    return false;
}

template<typename T>
using IsContainer = std::integral_constant<bool, hasBegin<T>(0)>;


#ifndef JHELPER_EXAMPLE_PROJECT_IO_HPP
#define JHELPER_EXAMPLE_PROJECT_IO_HPP

#endif //JHELPER_EXAMPLE_PROJECT_IO_HPP

template<typename T>
std::istream &operator>>(std::istream &is, std::vector<T> &vec) {
    for (T &element: vec) {
        is >> element;
    }
    return is;
}

template<typename T, typename U>
std::istream &operator>>(std::istream &is, std::pair<T, U> &p) {
    is >> p.first;
    is >> p.second;
    return is;
}

template<class X, class Y>
std::ostream &operator<<(std::ostream &os, std::pair<X, Y> const &p) {
    return os << p.first << " " << p.second;
}

template<class Ch, class Tr, class Container>
std::basic_ostream<Ch, Tr> &operator<<(std::basic_ostream<Ch, Tr> &os, Container const &x) {
    bool first = true;
    for (auto &y : x) {
        if (first) {
            first = false;
        } else {
            os << " ";
        }
        os << y;
    }
    return os;
}

using namespace std;

class BTwoAnagrams {
public:
    void solve(std::istream &in, std::ostream &out) {
        string S, T;
        in >> S >> T;
        sort(all(S));
        sort(T.rbegin(), T.rend());
        bool res = S < T;
        out << (res ? "Yes" : "No") << '\n';
    }

    void setup() {}
};


int main() {
    std::ios_base::sync_with_stdio(false);
    BTwoAnagrams solver;
    solver.setup();
    std::istream &in(std::cin);
    std::ostream &out(std::cout);
    in.tie(nullptr);
    out << std::fixed;
    out.precision(20);
    solver.solve(in, out);
    return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<algorithm>
#include<math.h>
#include<queue>
#include<vector>
#include<climits>
#include<map>
#include<string>

using namespace std;
typedef long long ll;

ll N = 0;

int main() {
	cin >> N;
	if (N <= 3) {
		cout << 1 << endl;
		return 0;
	}
	for (int i = 1;; i++) {
		if (N % 3 == 0) {
			N /= 3;
		}
		else {
			N = N / 3 + 1;
		}
		if (N <= 3) {
			cout << i + 1 << endl;
			return 0;
		}
	}
}


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

long long dp[205][205];
int R[8];
long long min_c(long long a, long long b)
{
    if(a<b)return a;
    return b;
}
int cov[8]={0};
long long min_cost=1e18;
vector<int> v;
void rec(int r,int p)
{
    
    if(p==r)
    {
        long long cost=0;
        for(int i=1;i<v.size();i++)
        {  //cout<<v[i]<<" ";
            cost+=dp[v[i]][v[i-1]];
        }
        min_cost= min_c(min_cost,cost);
        //cout<<endl<<cost<<endl;
        return;
    }
    for(int i=0;i<r;i++)
    { 
        if(cov[i]==0)
        {
            cov[i]=1;
            v.push_back(R[i]);
            rec(r,p+1);
            v.pop_back();
            cov[i]=0;
        }
    }
}
int main()
{
    
    int n,m,r;
    cin>>n>>m>>r;
    int i,j,k;
    for(i=0;i<r;i++)
    {
        cin>>R[i];
        R[i]-=1;
    }
    for(i=0;i<n;i++)
    {
        for(j=0;j<n;j++)dp[i][j]=1e18;
    }
    for(i=0;i<m;i++)
    {
        int a,b,c;
        cin>>a>>b>>c;
        dp[a-1][b-1]=c;
        dp[b-1][a-1]=c;
    }
    for(k=0;k<n;k++)
    {   
        for(i=0;i<n;i++)
        {
            for(j=0;j<n;j++)
            {
                if(dp[i][k]!=1e18 && dp[k][j]!=1e18 && dp[i][j]>dp[i][k]+dp[k][j] ) 
                    dp[i][j]=dp[i][k]+dp[k][j];
            }
        }
    }
    rec(r,0);
    cout<<min_cost<<endl;
    return 0;
}


Measured memory_bytes: 512
n = int(input())
k = int(input())
x = [int(i) for i in input().split()]
#print(n)
#print(k)
#print(x)
listy=[]

for i in range(n):
    if int(x[i]) < k-int(x[i]):
        listy.append(int(x[i]))
    else:
        listy.append(k-int(x[i]))
    
print(2*sum(listy))


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

#define sd(x) scanf("%d", &(x))
#define ll long long
#define pb push_back
#define F first
#define S second
#define pii pair<int, int>

#define TRACE

#ifdef TRACE
#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1>
void __f(const char* name, Arg1&& arg1){
	cerr << name << " : " << arg1 << std::endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args){
	const char* comma = strchr(names + 1, ',');cerr.write(names, comma - names) << " : " << arg1<<" | ";__f(comma+1, args...);
}
#else
#define trace(...)
#endif
#define int ll
const int N = 100005;
const ll MAXN = 2e15 + 10;
inline int f(int x, int y){
	return y * (x / y);
}

int mn[N], mx[N], A[N];
main(){
	int n;
	scanf("%lld", &n);
	for(int i = 1; i <= n; i++){
		scanf("%lld", A + i);
	}
	mn[n + 1] = mx[n + 1] = 2;
	for(int i = n; i >= 1; i--){
		int lo = 0, hi = MAXN, d = A[i];
		if(f(hi, d) < mn[i + 1]){
			printf("-1");
			return 0;
		}
		while(lo < hi){
			int x = (lo + hi) >> 1;
			if(f(x, d) >= mn[i + 1])
				hi = x;
			else lo = x + 1;
		}
		mn[i] = lo;
		lo = 0, hi = MAXN;
		while(lo < hi){
			int x = (lo + hi + 1) >> 1;
			if(f(x, d) <= mx[i + 1]) lo = x;
			else hi = x - 1;
		}
		mx[i] = lo;
		if(mn[i] > mx[i]){
			printf("-1\n");
			return 0;
		}
	}
	printf("%lld %lld\n", mn[1], mx[1]);
}

Measured memory_bytes: 2560
#include <iostream>
#include <utility>
#include <map>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <array>
#include <math.h>
#include <numeric>
#include <sstream>
#include <queue>
const int INF = 1e9;
const int MOD = 1e9+7;
const long long LINF = 1e18;
#define dump(x)  cout << 'x' << ' = ' << (x) << ` `;
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n) for(int i=0;i<(n);++i)
#define REPR(i,n) for(int i=n;i>=0;i--)
#define FOREACH(x,a) for(auto& (x) : (a) )
typedef long long ll;
using namespace std;
int main(int argc, char const *argv[]) {
    string s;
    cin >> s;
    int n = s.length();
    int best = n/2;
    int tdeer = 0;
    REP(i,n) if (s[i] == 'p') tdeer++;
    cout << best-tdeer << std::endl;
    return 0;
}

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

#define pb push_back
#define eb emplace_back
#define fi first
#define se second
#define endl '\n'
#define fcin ios::sync_with_stdio(false); cin.tie(nullptr);
#define INF 0x3f3f3f3f
#define all(x) x.begin(), x.end()
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

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

int main(){
    fcin;
    int n, m;
    cin >> n >> m;
    int v = 0;
    vector<int> a;
    for(int i = 0; i < n; i++){
        int x;  cin >> x;
        a.pb(x);
        v += x;
    }

    int ans = 0;
    for(int i = 0; i < n; i++){
        if(a[i] * 4 * m >= v) ans++;
    }

    cout << (ans >= m ? "Yes" : "No") << endl;
    return 0;
}



Measured memory_bytes: 256
#include<iostream>
using namespace std;
int wall[10][10];
int calc(int sx,int sy,int ex,int ey){
  int m_wall=1000,cnt=0;
  for(int i=sx;i<=ex;i++){
    m_wall=min(m_wall,min(wall[i][sy],wall[i][ey]));
  }
  for(int i=sy;i<=ey;i++){
    m_wall=min(m_wall,min(wall[sx][i],wall[ex][i]));
  }
  for(int x=sx+1;x<ex;x++){
    for(int y=sy+1;y<ey;y++){
      if(wall[x][y]>=m_wall)return 0;
      cnt+=m_wall-wall[x][y];
    }
  }
  return cnt;
}
int main(){
  int d,w;
  cin >> d >>w;
  while(d!=0){
    int ans=0;
    for(int i=0;i<d;i++){
      for(int j=0;j<w;j++){
        cin >> wall[i][j];
      }
    }
    for(int sx=0;sx<d;sx++){
      for(int sy=0;sy<w;sy++){
        for(int ex=sx+1;ex<d;ex++){
          for(int ey=sy+1;ey<w;ey++){
            ans=max(ans,calc(sx,sy,ex,ey));
          }
        }
      }
    }
    cout <<ans<<endl;
    cin >> d >>w;
  }
}



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

#define dbl double
#define pb push_back
#define SQ(x) (x)*(x)
#define ll long long
#define ull unsigned long long
#define vc vector
#define F first
#define S second
//#define in ll
#define pll pair<ll,ll>
#define pii pair<int,int>
#define all(x) x.begin(), x.end()
#define loop(xxx, yyy) for(int xxx = 0; xxx < yyy; xxx++)
//#define printf(fmt...) (0)
//#define puts(fmt...) (0)

using namespace std;

const int MAXN = 222222;

vc<int> g[MAXN];
int n,m;


int main() {
    scanf("%d%d",&n,&m);
    loop(mm,m){
        int u,v;
        scanf("%d%d",&u,&v);
        g[v].pb(u);
        g[u].pb(v);
    }

    for(int v : g[1])
        for(int u: g[v])
            if(u == n){
                return 0*printf("POSSIBLE\n");
            }

    return 0*printf("IMPOSSIBLE\n");
}


Measured memory_bytes: 12528
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define rep1(i,n) for(int i=1;i<=(int)(n);i++)
#define rrep(i,n) for(int i=((int)(n)-1);i>=0;(i)--)
#define rrep1(i,n) for(int i=((int)(n));i>0;(i)--)
#define sz(c) ((int)(c).size())
#define all(x) (x).begin(),(x).end()
#define mp make_pair
#define pb push_back

using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef pair<int, int> P;
typedef pair<int, pair<int, int> > PP;
const int MAX=1e5+10;
const int INF=1e9+7;

int N, K;
int h[MAX];
void input(){
	cin>>N>>K;
	rep(i,N)cin>>h[i];
}

int dp[MAX];
void solve(){
	rep1(i,N-1){
		int tmp=INF;
		rep1(j,K)if(i-j>=0)tmp=min(tmp, dp[i-j]+abs(h[i]-h[i-j]));
		dp[i]=tmp;
	}
}

void output(){
  cout<<dp[N-1];
}

int main(){
  input();
  solve();
  output();
}

Measured memory_bytes: 1024
N = int(input())
L_list = []
for L in map(int, input().split()):
	L_list.append(L)

L_list.sort()

count = 0
for i in range(N):
	a = L_list[i]
	for j in range(i + 1, N):
		b = L_list[j]
		if a == b:
			continue
		for k in range(j + 1, N):
			c = L_list[k]
			if a == c or b == c:
				continue
			x, y, z = sorted([a, b, c])
			if z < x + y:
				count += 1
print(count)


Measured memory_bytes: 9204
n,m = gets.split.map(&:to_i)

arr = Array.new(n)
b   = Array.new(m)

(0..(n - 1)).each {|i|
  arr[i] = gets.split.map(&:to_i)
}

(0..(m - 1)).each {|j|
  b[j] = gets.chomp.to_i
}

(0..(n - 1)).each {|i|
  sum = 0
  (0..(m - 1)).each {|j|
    sum += arr[i][j] * b[j]
  }
  puts sum
}





Measured memory_bytes: 6968
import java.io.BufferedReader;
import java.io.InputStreamReader;

import java.io.IOException;

class Main {

	public static void main(String[] args) {
		
		try {
			
			BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
			String s[] = br.readLine().split(" ", 2);
			int height = Integer.parseInt(s[0]);
			int width = Integer.parseInt(s[1]);	

			if(height < 1 || width> 100) {
				System.out.println("Err!");
				return;	
			}
			
			System.out.println(height*width + " " +  (height*2 + width*2));
			
		} catch (IOException e) {
			e.printStackTrace();			
		}
	}

}


Measured memory_bytes: 24244
import math
n, k = (int(i) for i in input().split())
x = 0
if n < k:
    for i in range(1, n+1):
        x = x + 1/2**math.ceil(math.log2(k/i))/n
    print(x)
else:
    for i in range(1, k):
        x = x + 1/2**math.ceil(math.log2(k/i))/n
    print(x + (n-k+1)/n)

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

#define FOR(i,a,b) for(ll i=a; i<b; i++)
#define IN(a) cin>>a
#define OUT(a) cout<<a<<endl

int main(){
  int x; IN(x);
  if(x>=30){
    OUT("Yes");
  }else{
    OUT("No");
  }
}

Measured memory_bytes: 3632
#include <iostream>
#include <vector>
#include <utility>
#include <cmath>
#include <algorithm>
using namespace std;
typedef long long ll;
const double pi = acos(-1);
#define FOR(i,a,b) for (ll i=(a);i<(b);i++)
#define RFOR(i,a,b) for (ll i=(b)-1;i>=(a);i--)
#define REP(i,n) FOR(i,0,n)
#define RREP(i,n) RFOR(i,0,n)
template<typename T> ostream& operator<<(ostream& os, const vector<T>& v) {
	REP(i, v.size()) { if (i)os << " "; os << v[i]; }return os;
}
template<typename T> ostream& operator<<(ostream& os, const vector<vector<T>>& v) {
	REP(i, v.size()) { if (i)os << endl; os << v[i]; }return os;
}

int main() {
	// ?????????????????°??????????????????
	vector<int> a(3);
	cin >> a[0] >> a[1] >> a[2];
	sort(a.begin(), a.end());
	cout << a[0] << " " << a[1] << " " << a[2] << endl;
	
}


Measured memory_bytes: 3060
//C
#ifndef _GLIBCXX_NO_ASSERT
#include <cassert>
#endif
#include <cctype>
#include <cerrno>
#include <cfloat>
#include <ciso646>
#include <climits>
#include <clocale>
#include <cmath>
#include <csetjmp>
#include <csignal>
#include <cstdarg>
#include <cstddef>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>

#if __cplusplus >= 201103L
#include <ccomplex>
#include <cfenv>
#include <cinttypes>
#include <cstdalign>
#include <cstdbool>
#include <cstdint>
#include <ctgmath>
#include <cwchar>
#include <cwctype>
#endif

// C++
#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <typeinfo>
#include <utility>
#include <valarray>
#include <vector>

#if __cplusplus >= 201103L
#include <array>
#include <atomic>
#include <chrono>
#include <condition_variable>
#include <forward_list>
#include <future>
#include <initializer_list>
#include <mutex>
#include <random>
#include <ratio>
#include <regex>
#include <scoped_allocator>
#include <system_error>
#include <thread>
#include <tuple>
#include <typeindex>
#include <type_traits>
#include <unordered_map>
#include <unordered_set>
#endif

//Hang in there!

using namespace std;


int main() {
	int A, B, X;
	cin >> A >> B >> X;
	if (A <= X && X <= A + B) {
		cout << "YES" << endl;
	}
	else {
		cout << "NO" << endl;
	}
}



Measured memory_bytes: 256
program prob1
    implicit none
    integer(8) :: n, i, ans
    integer(8), allocatable :: a(:), b(:)
    read(*,*) n
    allocate(a(n+1), b(n))
    read(*,*) a
    read(*,*) b
    ans = 0
    do i = 1, n
        if(a(i) >= b(i)) then
            ans = ans + b(i)
            a(i) = a(i) - b(i)
            b(i) = 0
        else
            ans = ans + a(i)
            b(i) = b(i) - a(i)
            a(i) = 0
        end if
        if(a(i+1) >= b(i)) then
            ans = ans + b(i)
            a(i+1) = a(i+1) - b(i)
            b(i) = 0
        else
            ans = ans + a(i+1)
            b(i) = b(i) - a(i+1)
            a(i+1) = 0
        end if
    end do
    write(*,*) ans
        
    stop
contains
end program prob1

Measured memory_bytes: 4660
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
# define mod 1000000007
# define INF (1 << 29)
# define MAX_N 1000010
/* ちゃんと考えてわかって実装 */

int main(void){
    int n, k;
    cin >> n >> k;
    vector<int> a;
    for(int i=0; i<n; i++){
        int tmp_a;
        cin >> tmp_a;
        a.push_back(tmp_a);
    }

    int dp[k+1];
    for(int i=0; i<=k; i++) dp[i] = 0;

    for(int i=1; i<=k; i++){
        for(int j=0; j<n; j++){
            if(i - a[j] >= 0){
                if(dp[i - a[j]] == 0) dp[i] = 1;
            }
        }
    }

    if(dp[k] == 1) cout << "First" << endl;
    else cout << "Second" << endl;
    return 0;
}

Measured memory_bytes: 768
#include <bits/stdc++.h>
#define ios ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define ll long long
using namespace std;

long long power(long long a, long long b) {
    //a %= m;
    long long res = 1;
    while (b > 0) {
        if (b & 1)
            res = res * a;
        a = a * a;
        b >>= 1;
    }
    return res;
    }
  ll int binomial(ll int n, ll int k) 
{ 
    ll int C[k+1]; 
    memset(C, 0, sizeof(C)); 
  
    C[0] = 1;  // nC0 is 1 
  
    for (ll int i = 1; i <= n; i++) 
    { 
        // Compute next row of pascal triangle using 
        // the previous row 
        for (int j = min(i, k); j > 0; j--) 
            C[j] = C[j] + C[j-1]; 
    } 
    return C[k]; 
} 
  vector<int> pr;
void Sieve(ll int n) 
{ 
    bool prime[10000000];
    memset(prime, true, sizeof(prime)); 
  
    for (int p=2; p*p<=n; p++) 
    { 
        if (prime[p] == true) 
        { 
            pr.push_back(p);
            for (int i=p*p; i<=n; i += p) 
                prime[i] = false; 
        } 
    } 
}
 

int gcd(int a, int b) 
{ 
    if (a == 0) 
        return b; 
    return gcd(b % a, a); 
} 
  
// Function to find gcd of array of 
// numbers 
int find(int arr[], int n) 
{ 
    int result = arr[0]; 
    for (int i = 1; i < n; i++) 
    { 
        result = gcd(arr[i], result); 
  
        if(result == 1) 
        { 
           return 1; 
        } 
    } 
    return result; 
} 


//It reurns Fn,Fn+1
pair<int, int> fib (int n) {
    if (n == 0)
        return {0, 1};

    auto p = fib(n >> 1);
    int c = p.first * (2 * p.second - p.first);
    int d = p.first * p.first + p.second * p.second;
    if (n & 1)
        return {d, c + d};
    else
        return {c, d};
}
ll int a[10000009];
void divisors(ll int n) 
{ 
  
    ll int div[n + 1]; 
    memset(div, 0, sizeof div); 
  
    for (int i = 1; i <= n; i++) { 
  
        for (int j = 1; j * i <= n; j++) 
            div[i * j]++; 
    } 
  
    // Print the divisors 
    for (int i = 1; i <= n; i++) 
        a[i]=div[i]; 
        
        
} 

  
int main() {
        ll int n;
        cin>>n;
        divisors(n);
        ll int k=0;
       for(int i=1;i<=n;i++)
       {
           k+=a[i]*i;
       }
       cout<<k<<endl;
}


Measured memory_bytes: 159876
#include <iostream>
#include <fstream>
#include <vector>
#include <algorithm>

#include <math.h>
using namespace std;

int main(int argc, const char * argv[]) {
    // fasten cin
    cin.tie(0);
    ios::sync_with_stdio(false);
    // implement
    int a,b;
    cin >> a >> b;
    if(a - 2*b >=0){
        cout << a-2*b << endl;
    } else {
        cout << 0 << endl;
    }
}



Measured memory_bytes: 256