akhauriyash/Code-Regression huggingface dataset:
#include <stdio.h>
#include <string.h>
#include <stdbool.h>
#include <math.h>

int main(void) {
    int N;
    int a = 0, w = 0, t = 0, r = 0;
    char S[4];

    scanf("%d", &N);

    for(int i = 0; i < N; i++) {
        scanf("%s", S);

        switch(S[0]) {
            case 'A':
                a++;
                break;
            case 'W':
                w++;
                break;
            case 'T':
                t++;
                break;
            case 'R':
                r++;
                break;
            default:
                break;
        }
    }

    printf("AC x %d\n", a);
    printf("WA x %d\n", w);
    printf("TLE x %d\n", t);
    printf("RE x %d\n", r);
    
    return 0;
}


Measured memory_bytes: 1732
#include<bits/stdc++.h>
using namespace std;
const int MAXN = 2e5 + 5;
typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;
template <typename T> void chkmax(T &x, T y) {x = max(x, y); }
template <typename T> void chkmin(T &x, T y) {x = min(x, y); } 
template <typename T> void read(T &x) {
	x = 0; int f = 1;
	char c = getchar();
	for (; !isdigit(c); c = getchar()) if (c == '-') f = -f;
	for (; isdigit(c); c = getchar()) x = x * 10 + c - '0';
	x *= f;
}
template <typename T> void write(T x) {
	if (x < 0) x = -x, putchar('-');
	if (x > 9) write(x / 10);
	putchar(x % 10 + '0');
}
template <typename T> void writeln(T x) {
	write(x);
	puts("");
}
int n, a[MAXN];
int main() {
	read(n);
	int now = 0, cnt = 0, ans = 0;
	for (int i = 1; i <= n; i++) {
		read(a[i]);
		if (a[i] == now) cnt++;
		else {
			now = a[i];
			ans += cnt / 2;
			cnt = 1;
		}
	}
	ans += cnt / 2;
	writeln(ans);
	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <cmath>
#include <vector>
#include <map>

using ll = long long;
using namespace std;

#define MOD ((int)pow(10, 9) + 7)

inline ll ans(ll X) {
  // x0 = not 6 -> x1 = 6 -> x2 = not in (7 - x1, x1) -> x3 = not in (7 - x2, x2)
  // 6 -> 5 -> 6
  ll ret = floor(X / 11) * 2;
  ll rem = X % 11;
  if (rem == 0) {
    return ret;
  }

  if (rem >= 7) {
    return ret + 2;
  }

  return ret + 1;
}

int main (void) {
  ll X;
  cin >> X;
  ll _ans = ans(X);
  cout << _ans << endl;
  return 0;
}


Measured memory_bytes: 256
# Problem A - 01 Matrix

# input
H, W, A, B = map(int, input().split())

for i in range(1, H+1):
    for j in range(1, W+1):
        if i<=B and j<=A:
            print('0', end="")
        elif i<=B and j>A:
            print('1', end="")
        elif i>B and j<=A:
            print('1', end="")
        elif i>B and j>A:
            print('0', end="")
    print()


Measured memory_bytes: 121048
#include <bits/stdc++.h>
using namespace std;
int n, z;
pair<int, int> a[100020];
int main() {
	scanf("%d", &n);
	for (int i = 0; i < n; i++) {
		scanf("%d", &a[i].first);
		a[i].second = i;
	}
	sort(a, a + n);
	for (int i = 0; i < n; i++) {
		if ((a[i].second + i) % 2 == 1) {
			z++;
		}
	}
	printf("%d\n", z / 2);
	return 0;
}

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

int main(){
    ll S;  cin >> S;
    if(S == 0) {
        cout << "0" << endl;
        return 0;
    }

    string ans = "";
    ll base = 1;
    while(S != 0){
        if(S%(base*2)==0){
            ans = "0" + ans;
        } else {
            ans = "1" + ans;
            S -= base;
        }
        base *= -2;
    }
    cout << ans << endl;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define INF 2000000000
#define MOD 1000000007
#define EPS (1e-10)

using namespace std;



int main(int argc, char *argv[]) {

	string s; cin >> s;

	int cnt = 0;
	for (int i = 0; i < s.size(); i++) {
		int n = s[i] - '0';	
		cnt += n;
	}
	
	if (cnt % 9 == 0) {
		cout << "Yes" << endl;
	}else {
		cout << "No" << endl;
	}
	return 0;
}


Measured memory_bytes: 3692
#include <numeric>
#include <bits/stdc++.h>
#include <utility>
#include <iostream>
#include <algorithm>
#include <vector>
#include <cmath>
#include <math.h>
#include <string>
#define ll long long
#define ull unsigned long long
#define make(type,x) type x; cin>>x
#define make2(type,x,y) type x,y; cin>>x>>y
#define fr(x,y) for(long long x=0;x<y;x++)
#define makevec(x,y,n) vector <x> y(n); for(ll i=0;i<n;i++) cin>>y[i]
#define M (ll)1000000007
#define MM (ll) 1e8
#define INF (ll) 1e18

# define IOS ios_base::sync_with_stdio(false); cin.tie(NULL)


using namespace std;


template <typename T>
T modpow(T base, T exp, T modulus) {
  base %= modulus;
  T result = 1;
  while (exp > 0) {
    if (exp & 1) result = (result * base) % modulus;
    base = (base * base) % modulus;
    exp >>= 1;
  }
  return result;
}
bool sortbysec(const ll &a, const ll &b){
    return abs(a)>abs(b);
}

struct cmp {
	bool operator() (const pair<int, int> &a, const pair<int, int> &b) const {
		int lena = a.second - a.first + 1;
		int lenb = b.second - b.first + 1;
		if (lena == lenb) return a.first < b.first;
		return lena > lenb;
	}
};


struct c_h {
    size_t operator()(uint64_t x) const {
        static const uint64_t FIXED_RANDOM = chrono::steady_clock::now().time_since_epoch().count();
        x ^= FIXED_RANDOM;
        return x ^ (x >> 16);
    }
};

ll calcpow(ll x, ll y)
{
    ll temp;
    if(y == 0)
        return 1;
    temp = calcpow(x, y / 2);
    if (y % 2 == 0)
        return temp * temp;
    else
    {
        if(y > 0)
            return x * temp * temp;
        else
            return (temp * temp) / x;
    }
}
ll gcd(ll a, ll b){
    if(b==0) return a;
    return gcd(b,a%b);

}
ll egcd(ll a, ll b, ll &x,ll &y){
    if(b==0){
        x=1;
        y=0;
        return a;
    }
    ll x1;
    ll y1;
    ll g=egcd(b,a%b,x1,y1);
    x=y1;
    y=x1-y1*(a/b);
    return g;
}


bool isprime(ll a){
bool flag=1;
for(ll i=2;i*i<=a;i++){
    if(a%i==0) {flag=0; break;}
}
return flag;
}

ll dx8[8]={1,0,-1,0,1,-1,1,-1};
ll dy8[8]={0,1,0,-1,1,-1,-1,1};
ll dx4[4]={0,0,1,-1};
ll dy4[4]={1,-1,0,0};


int main(){
    IOS;
    make2(ll,a,b); make2(ll,c,d);
    ll ans=max(a*c,a*d); ans=max(ans,b*c); ans=max(ans,b*d);
    cout<<ans<<endl;


    return 0;
}


Measured memory_bytes: 3652
using System;
using System.Collections.Generic;
using System.Linq;

namespace ConsoleApp1
{
    public static class MyExtensions
    {
        public static string Slice(this string str, int start = 0, int stop = 0)
        {
            if (start > str.Length || stop > str.Length || start < 0 || stop < 0)
                return "";

            if (stop == 0) stop = str.Length;
            return str.Substring(start, stop - start);
        }
    }

    class Program
    {
        static void Main(string[] args)
        {
            B();
        }

        static void B()
        {
            var Wab = ReadSplitInt();
            var ans = Math.Abs(Wab[1] - Wab[2]) - Wab[0];
            Console.WriteLine(ans <= 0 ? 0 : ans);
        }

        static IEnumerable<int> Range(int start, int stop)
        {
            if (start < 0 || stop < 0 || start > stop || (start <= 0 && stop <= 0))
                return new List<int>();

            return Enumerable.Range(start, stop - start);
        }

        static bool IsDigit(string str)
        {
            var i = 0;
            return int.TryParse(str, out i);
        }

        static int DigitsSum(long num)
        {
            return num.ToString().Select(x => x.ToString()).Sum(int.Parse);
        }

        static int[] ToIntArray(string str)
        {
            return str.Select(x => x.ToString()).Select(int.Parse).ToArray();
        }

        static string Read() => Console.ReadLine();
        static int ReadInt() => int.Parse(Read());
        static long ReadLong() => long.Parse(Read());

        static IList<string> ReadSplit() => Read().Split().ToList();
        static IList<int> ReadSplitInt() => Read().Split().Select(int.Parse).ToList();

        static void Print(string str = null) => Console.Write(str);
        static void Println(string str = null) => Console.WriteLine(str);
    }
}


Measured memory_bytes: 11220
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <stack>
#include <queue>
#include <functional>
#include <math.h>
#include <stdlib.h>
#include <map>
#include <sys/timeb.h>
#include <fstream>

using namespace std;

#define repr(i,a,b) for(int i=(int)(a);i<(int)(b);i++)
#define rep(i,n) repr(i,0,n)
#define reprrev(i,a,b) for(int i=(int)(b)-1;i>=(int)(a);i--)
#define reprev(i,n) reprrev(i,0,n)
#define repi(itr,ds) for(auto itr=ds.begin();itr!=ds.end();itr++)
#define all(a) (a).begin(),(a).end()
#define rall(a) (a).rbegin(),(a).rend()
#define mp make_pair
#define mt make_tuple
#define INF 1050000000
#define INFL 1100000000000000000LL
#define EPS (1e-10)
#define MOD 1000000007
#define PI 3.1415926536
#define RMAX 4294967295

typedef long long ll;
typedef pair<int, int> Pi;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<bool> vb;
typedef vector<char> vc;
typedef vector<string> vs;
typedef vector<double> vd;
typedef vector<Pi> vPi;
typedef vector<vector<int> > vvi;
typedef vector<vector<bool> > vvb;
typedef vector<vector<ll> > vvll;
typedef vector<vector<char> > vvc;
typedef vector<vector<string> > vvs;
typedef vector<vector<double> > vvd;
typedef vector<vector<Pi> > vvPi;
typedef priority_queue<int, vector<int>, greater<int> > pqli;
typedef priority_queue<ll, vector<ll>, greater<ll> > pqlll;
typedef priority_queue<Pi, vector<Pi>, greater<Pi> > pqlP;
struct Edge {
	int from, to, cost;
	bool operator<(Edge e) {
		return cost < e.cost;
	}
};
typedef vector<Edge> Edges;
typedef vector<Edges> Graph;
template <class T>
using vec = vector<T>;
template<class T>
using pql = priority_queue<T, vector<T>, greater<T>>;
string debug_show(Pi a) {
	return "(" + to_string(a.first) + "," + to_string(a.second) + ")";
}

template<class T>
struct augEdge {
	T from, to;
	int cost;
	bool operator<(augEdge e) { return cost < e.cost; }
	bool operator>(augEdge e) { return cost > e.cost; }
};
template<class T>
using augGraph = vector<augEdge<T>>;


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

	string s;
	cin >> s;

	rep(i, 26) {
		if (s.find('a' + i) == -1) {
			cout << (char)('a' + i) << endl;
			return 0;
		}
	}

	cout << "None" << endl;
	

	return 0;
}


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

using namespace std;
using LL = long long;
using P = pair<int,int>;

int main(){
	int N;
	cin >> N;
	int ans=0;
	for(int A=1; A<N; A++) ans+=(N-1)/A;
	cout << ans << endl;

	return 0;
}

Measured memory_bytes: 3632
use proconio::{input, fastout};
use proconio::marker::Chars;

#[fastout]
fn main() {
    input! {
        h: usize,
        w: usize,
        k: usize,
        c: [Chars; h]
    }

    let mut ans = 0;

    for i in 0..1<<h {
        for j in 0..1<<w {
            let mut count = 0;
            for a in 0..h {
                for b in 0..w {
                    if i & 1<<a == 1<<a {
                        continue;
                    }
                    if j & 1<<b == 1<<b {
                        continue;
                    }
                    if c[a][b] == '#' {
                        count += 1;
                    }
                }
            }
            if count == k {
                ans += 1;
            }
        }
    }

    println!("{}", ans);
}


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

import array
import collections

M = 10 ** 6


# Eratosthenes????????????????????´??°limit??????????´???°???????????????
# ???????????????????????´??§?????????????????¢?????´???????????????????¬???§???pp.410-412
def sieve_of_eratosthenes(limit, typecode="L"):
    # ??´??°i????´???°??§????????????table[i]?????????
    # ??????????????????True??§?????????????????????
    table = array.array("B", (True for i in range(limit)))
    # 0, 1????????????????´???°??§?????????
    table[0] = False
    table[1] = False
    # ?´???°???????´?????????????
    # primes = array.array(typecode)
    for i in range(2, limit):
        if table[i]:  # i????´???°??§????????¨???
            # primes.append(i)  # ?´???°?????????????????????
            for j in range(i * 2, limit, i):  # i????¶???????i????????°????????????
                table[j] = False  # ?´???°??§???????????????????????????
    # return primes
    return table


def solve(table, a, d, n):
    primes = collections.deque()
    for i in range(a, M, d):
        if table[i]:
            primes.append(i)
            if len(primes) >= n:
                break
    return primes[-1]


if __name__ == "__main__":
    table = sieve_of_eratosthenes(M)
    while True:
        a, d, n = map(int, input().split())
        if a == d == n == 0:
            break
        else:
            print(solve(table, a, d, n))

Measured memory_bytes: 8616
use std::io;

macro_rules! read {
    ($t: ty) => {
        {
            let mut input = String::new();
            io::stdin().read_line(&mut input).expect("could not read input");
            input.trim().parse::<$t>().unwrap()
        };
    };
    ($($t: ty),*) => {
        {
            let mut input = String::new();
            io::stdin().read_line(&mut input).expect("could not read input");
            let mut iter = input.trim().split_whitespace();
            ($(iter.next().unwrap().parse::<$t>().unwrap()), *)
        };
    }
}
macro_rules! read_vec {
    ($t: ty) => {
        {
            let mut input = String::new();
            io::stdin().read_line(&mut input).expect("could not read input");
            let iter = input.trim().split_whitespace();
            iter.map(|x| x.parse::<$t>().unwrap()).collect::<Vec<$t>>()
        };
    }
}
fn main() {

    let s = read!(String);
    let ns= s.chars().map(|c| c.to_digit(10).unwrap() as i32).collect::<Vec<i32>>();

    for op1 in ['+', '-'].iter() {

        for op2 in ['+', '-'].iter() {

            for op3 in ['+', '-'].iter() {
                let mut out: i32 = 0;
                match op1 {
                    &'+' => out = ns[0] + ns[1],
                    _ => out = ns[0] - ns[1],
                };
                match op2 {
                    &'+' => out = out + ns[2],
                    _ => out = out - ns[2]
                };
                match op3 {
                    &'+' => out = out + ns[3],
                    _ => out = out - ns[3]
                };
                if out == 7 {
                    println!("{}{}{}{}{}{}{}=7", ns[0], op1, ns[1], op2, ns[2], op3, ns[3]);
                    return;
                }
            }
        }
    }



}

Measured memory_bytes: 4352
// A - Disjoint Set Union
#include <atcoder/dsu>
#include <bits/stdc++.h>
using namespace std;
using namespace atcoder;

int main(){
	int N, Q; cin>>N>>Q;
	dsu uf(N);
	for(int i=0; i<Q; ++i){
		int t, u, v; cin>>t>>u>>v;
		if(t) cout<< uf.same(u, v) <<endl;
		else uf.merge(u, v);
	}
}


Measured memory_bytes: 4048
#include <bits/stdc++.h>
using namespace std;
typedef long long lli;
typedef vector<lli> vll;
typedef vector<bool> vbl;
typedef vector<vector<lli> > mat;
typedef vector<vector<bool> > matb;
typedef vector<string> vst;
typedef pair<lli,lli> pll;
typedef pair<double,double> pdd;
typedef vector<map<lli,lli>> graph;

vll a;
lli n;
lli sum = 0;
lli sum2 = 0;
lli ans = 1ll << 61;

int main(){
	cin >> n;
	a = vll(n);
	for(lli i = 0;i < n;i++){
		cin >> a[i];
	}
	for(lli i = 0;i < n;i++){
		sum += a[i];
	}
	sum -= a[0];
	sum2 += a[0];
	ans = abs(sum-sum2);
	for(lli i = 1;i < n-1;i++){
		sum -= a[i];
		sum2 += a[i];
		ans = min(ans,abs(sum-sum2));
	}
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 1792
#include<stdio.h>
int main(){
  long long int a,b=0;
  char s[101];
  scanf("%s",s);
  scanf("%lld",&a);
  while(s[b]!='\0'){
    if(s[b]!='1'||b+1==a){
      printf("%c",s[b]);
      break;
    }
    b++;
  }
  return 0;}

Measured memory_bytes: 128
import sys
sys.setrecursionlimit(10 ** 9)
input = sys.stdin.readline
from itertools import permutations,  combinations, accumulate
from functools import *
from collections import deque, defaultdict, Counter
from heapq import heapify, heappop, heappush, heappushpop

INF = float('inf')
NIL = - 1

""" Input
S = input().rstrip()
N, A, B = map(int, input().split())
A = list(map(int, input().split()))
A = np.array(input().split(), dtype=np.float64)
D = [int(input()) for _ in range(N)]
AB = [[int(x) for x in input().split()] for _ in range(N)]
PX = [[int(x) for x in input().split()] for _ in range(Q)]
"""
import numpy as np


N = int(input())
print(2 * np.pi * N)



# def main():

# if __name__ == '__main__':
#     main()


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

typedef long long int ll;
typedef unsigned long long int ull;
#define rep(i,n) for(auto i=0;i<(n);i++)
#define rep1(i,n) for(auto i=1;i<=(n);i++)
#define all(x) (x).begin(),(x).end()

using namespace std;


struct init{ init(){ cin.tie(0); ios::sync_with_stdio(0); cout<<fixed<<setprecision(20); }; }aaaaaaa;


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


  cout << max(0ll, c - (a-b)) << endl;


  return 0;
}



Measured memory_bytes: 256
#include <stdio.h>
#include <set>
#include <map>
#include <unordered_map>
#include <unordered_set>
#include <list>
#include <queue>
#include <stack>
#include <cmath>
#include <ctime>
#include <cstdio>
#include <vector>
#include <string>
#include <bitset>
#include <cctype>
#include <cstdlib>
#include <cstring>
#include <utility>
#include <numeric>
#include <complex>
#include <sstream>
#include <fstream>
#include <iomanip>
#include <cassert>
#include <iostream>
#include <iterator>
#include <algorithm>
#include <functional>
using namespace std;
typedef long long ll;
const double EPS = 1e-9;
typedef vector<int> vint;
typedef vector<vector<int>> v2int;
typedef vector<ll> vll;
typedef vector<vector<ll>> v2ll;
typedef list<int> liint;
typedef pair<int, int> pint;
const int INF = int(2e9);
const ll LINF = ll(2e9) * ll(2e9);
#define rep(i, n) REP(i, 0, n)
#define ALL(v) v.begin(), v.end()
#define MSG(a) cout << #a << " " << a << endl;
#define REP(i, x, n) for(int i = x; i < n; i++)
template<class T, class C> void chmax(T& a, C b) { a > b ? : a = b; }
template<class T, class C> void chmin(T& a, C b) { a < b ? : a = b; }



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

    map<string, int> nums;
    rep(i, N) {
        sort(S[i].begin(), S[i].end());
        nums[S[i]]++;
    }

    ll ans = 0;
    for (auto &s : nums) {
        ans += ll(nums[s.first]) * ll((nums[s.first] - 1))/2;
    }
    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 18944
from collections import Counter
n = int(input())
a = list(map(int, input().split()))

c = Counter(a)
sorted_count = sorted(c.items(), key=lambda x: x[0], reverse=True)
h = 0
w = 0
for k, v in sorted_count:
    if h != 0 and w != 0:
        break
    if v < 2:
        continue
    if v > 3:
        if h == 0:
            h = k
        if w == 0:
            w = k
        break
    if h == 0:
        h = k
    elif w == 0:
        w = k

if h == 0 or w == 0:
    print(0)
else:
    print(h * w)


Measured memory_bytes: 22436
#include <iostream>
#include <cstring>
#include <algorithm>
#include <vector>
#include <string>
#include <math.h>
#include <iomanip>
#include <limits>
#include <list>
#include <queue>
#include <tuple>
#include <map>
using namespace std;
#define MOD (long long int)(1e9+7)
#define ll long long int
#define rep(i,n) for(int i=0; i<(int)(n); i++)
#define reps(i,n) for(int i=1; i<=(int)(n); i++)
#define REP(i,n) for(int i=n-1; i>=0; i--)
#define REPS(i,n) for(int i=n; i>0; i--)
#define INF (int)(1123456789)
#define LINF (long long int)(112345678901234567)
vector<string> A;
/*bool search(s,t){
	if(used[s][t] || A[s][t] == '#'){
		return false;
	}
	used[s][t]=true;
	search(s+1,t);
	search(s-1,t);
	search(s,t-1);
	search(s,t+1);
}*/
bool used[805][805];

int main(void){
	int h,w,k;
	cin>>h>>w>>k;
	int memok = k;
	string s;
	rep(i,h){
		cin>>s;
		A.push_back(s);
	}
	rep(i,h){
		rep(j,w){
			used[i][j] = false;
		}
	}
	bool me = true;
	int mi,mj;
	rep(i,h){
		rep(j,w){
			if(A[i][j] == 'S'){
				me = false;
				mi=i;
				mj=j;
			}
			if(!me){
				break;
			}
		}
		if(!me){
			break;
		}
	}
	queue<pair<int, int> > Q;
	pair<int,int> p2;
	p2.first = mi;
	p2.second = mj;
	Q.push(p2);

	while(Q.size() > 0 && k>0){
		queue<pair <int, int> > Q2;
		while(Q.size() > 0){
			pair<int, int> p = Q.front(); Q.pop();
			for(int i=-1;i<=1;i++){
				for(int j=-1;j<=1;j++){
					if(abs(i)+abs(j) != 1) continue;
					if(p.first+i < 0 || p.first+i >= h || p.second+j < 0 || p.second + j >= w) continue;
					if(!used[p.first+i][p.second+j] && A[p.first+i][p.second+j] != '#'){
						pair<int, int> next;
						next.first = p.first+i;
						next.second = p.second+j;
						Q2.push(next);
						used[p.first+i][p.second+j] = true;
					}
				}
			}
			
		}
		Q = Q2;
		k--;
	}
	int ans = min(INF,min(mi,min(h-mi-1,min(mj,w-mj-1))));
	rep(i,h){
		rep(j,w){
			if(used[i][j]){
				ans = min(ans,min(i,min(h-i-1,min(j,w-j-1))));
			}
		}
	}
	cout<<1+(ans/memok) + (ans%memok == 0 ? 0 : 1)<<endl;
	return 0;
}


Measured memory_bytes: 1792
// #define _GLIBCXX_DEBUG // for STL debug (optional)
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <string>
#include <cstring>
#include <deque>
#include <list>
#include <queue>
#include <stack>
#include <vector>
#include <utility>
#include <algorithm>
#include <map>
#include <set>
#include <complex>
#include <cmath>
#include <limits>
#include <cfloat>
#include <climits>
#include <ctime>
#include <cassert>
#include <numeric>
#include <fstream>
#include <functional>
#include <bitset>
using namespace std;
using ll = long long int;
using int64 = long long int;
 
template<typename T> void chmax(T &a, T b) {a = max(a, b);}
template<typename T> void chmin(T &a, T b) {a = min(a, b);}
template<typename T> void chadd(T &a, T b) {a = a + b;}
 
int dx[] = {0, 0, 1, -1};
int dy[] = {1, -1, 0, 0};
const int INF = 1LL << 29;
const ll LONGINF = 1LL << 60;
const ll MOD = 1000000007LL;
 
int main() {
    int N; cin >> N;
    for(int i=0; i<=50000; i++) {
        if(int(i * 1.08) == N) {
            cout << i << endl;
            return 0;
        }
    }
    cout << ":(" << endl;
    return 0;
}


Measured memory_bytes: 384
import java.util.Scanner;

public class Main {


	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);
		int r = sc.nextInt();
		int g = sc.nextInt();
		int b = sc.nextInt();

		int N = r*100 + g*10 + b;

		if(N%4 == 0) {
			System.out.println("YES");
		} else {
			System.out.println("NO");
		}
	}
}


Measured memory_bytes: 23124
import collections

N = input()
score = input()

score = list(map(int,score.split(" ")))
sorted_num = sorted(score)

mid = int(len(sorted_num)/2)
mid_flont,mid_back = sorted_num[mid-1], sorted_num[mid]

mid_c = (mid_back - mid_flont)
if not mid_c > 0:
    print(0)
else:
    print(mid_c)


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

int main()
{
  int H, W;

  while(1)
  {
    cin >> H >> W;

    if(H == 0 && W == 0) break;

    for(int i = 0; i < H; i++)
    {
      for(int j = 0; j < W; j++)
      {
        if(i == 0 || i == H -1 || j == 0 || j == W - 1)
        {
          cout << "#";
        }
        else
        {
          cout << ".";
        }
      }
      cout << endl;
    }
  cout << endl;
  }

  return 0;
}


Measured memory_bytes: 3088
import sys

input = sys.stdin.readline

N, K, Q = map(int, input().split())
A = [int(input()) for _ in range(Q)]

ary = [0]*N
for i in A:
    ary[i-1] += 1

for n in ary:
    if n+K-Q > 0:
        print("Yes")
    else:
        print("No")



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

int bubble(vector<int>&a) {
	int cnt = 0;
	for (int i = 0; i<int(a.size()); i++) {
		for (int j = int(a.size()) - 1; j > i; j--) {
			if (a[j] < a[j - 1]) {
				swap(a[j], a[j - 1]);
				cnt++;
			}
		}
	}
	return cnt;
}
int main() {
	int n;
	cin >> n;
	vector<int>a(n);
	rep(i, n)cin >> a[i];
	int cnt = bubble(a);
	rep(i, n)cout << a[i] << (i == n - 1 ? '\n' : ' ');
	cout << cnt << endl;
	return 0;
}

Measured memory_bytes: 1196
#include <iostream>
#include <string>
#include <vector>
#include <math.h>
#include <algorithm>
#include <stdint.h>
#include <queue>
#include <bitset>
#include <iomanip>
#include <set>
#include <map>

using namespace std;

#define PI (3.14159265358979323846)
#define INF (2147483647)
#define INF_LL (9223372036854775807)
#define DIV_NUM (1000000007)
typedef long long ll;

// 配列初期化テンプレ
template<typename A, size_t N, typename T>
void Fill(A(&array)[N], const T& val) {
	std::fill((T*)array, (T*)(array + N), val);
}


int main() {

	char A;
	cin >> A;

	bool big_char = false;
	if (A == 'A') big_char = true;
	if (A == 'B') big_char = true;
	if (A == 'C') big_char = true;
	if (A == 'D') big_char = true;
	if (A == 'E') big_char = true;
	if (A == 'F') big_char = true;
	if (A == 'G') big_char = true;
	if (A == 'H') big_char = true;
	if (A == 'I') big_char = true;
	if (A == 'J') big_char = true;
	if (A == 'K') big_char = true;
	if (A == 'L') big_char = true;
	if (A == 'M') big_char = true;
	if (A == 'N') big_char = true;
	if (A == 'O') big_char = true;
	if (A == 'P') big_char = true;
	if (A == 'Q') big_char = true;
	if (A == 'R') big_char = true;
	if (A == 'S') big_char = true;
	if (A == 'T') big_char = true;
	if (A == 'U') big_char = true;
	if (A == 'V') big_char = true;
	if (A == 'W') big_char = true;
	if (A == 'X') big_char = true;
	if (A == 'Y') big_char = true;
	if (A == 'Z') big_char = true;

	if (big_char) cout << "A" << endl;
	else cout << "a" << endl;

	return 0;

}


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

int n;
long long C;
int h[200055];

// hi^2 - 2hihj + hj^2 + c
// -2hihj + hj^2 + hi^2 + c

int deq[200055];
long long dp[200055];

inline long long f(int i, int j) {
	return 1ll * (h[i] - h[j]) * (h[i] - h[j]) + dp[j] + C;
}
inline bool check(int i, int j, int k) {
	long long a1 = -2ll * h[i], b1 = dp[i] + 1ll * h[i] * h[i];
	long long a2 = -2ll * h[j], b2 = dp[j] + 1ll * h[j] * h[j];
	long long a3 = -2ll * h[k], b3 = dp[k] + 1ll * h[k] * h[k];
	
	return 1. * (a2 - a1) * (b3 - b2) >= 1. * (b2 - b1) * (a3 - a2);
}
int main() {
	cin >> n >> C;
	
	for (int i = 1; i <= n; i++) {
		scanf("%d", &h[i]);
	}
	
	int s = 0, t = 1;
	deq[s] = 1;
	
	for (int i = 2; i <= n; i++) {
		while (s + 1 < t && f(i, deq[s]) >= f(i, deq[s + 1])) {
			s++;
		}
		
		dp[i] = f(i, deq[s]);
		
		while (s + 1 < t && check(deq[t - 2], deq[t - 1], i)) {
			t--;
		}
		
		deq[t++] = i;
	}
	
	printf("%lld\n", dp[n]);
}


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

#define rep(i,n) for(int i=0;i<n;i++)
#define repn(i,n) for(int i=1;i<=n;i++)
#define LL long long
#define pii pair <int,int>
#define fi first
#define se second
#define pb push_back
#define mpr make_pair

using namespace std;

LL n,a[500010],dp[500010],sum0,sumx[1200010],valx[1200010],MOD=1e9+7,ans=0,
pre0[500010],lst[1200010];

int main()
{
	ios::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
	cin>>n;
	LL p=0,num=0;
	rep(i,n)
	{
		cin>>a[i];
		p^=a[i];
		if(p==0) num++;
		pre0[i+1]=pre0[i]+(p==0);
	}
	if(p!=0)
	{
		sum0=1;
		LL cur=0;
		memset(dp,0,sizeof(dp));
		rep(j,n)
		{
			cur^=a[j];
			if(cur==0) 
			{
				dp[j]=sumx[0];
				sum0=(sum0+dp[j])%MOD;
			}
			else if(cur==p) dp[j]=sum0,sumx[0]=(sumx[0]+dp[j])%MOD;
		}
		ans=(ans+dp[n-1])%MOD;
		cout<<ans<<endl;
		return 0; 
	}
	rep(i,1100000) valx[i]=1;
	p=0;
	rep(i,n)
	{
		p^=a[i];
		if(p==0) continue;
		valx[p]=(valx[p]+sumx[p]*(pre0[i+1]-pre0[lst[p]]))%MOD;
		lst[p]=i;
		dp[i]=valx[p];
		sumx[p]=(sumx[p]+dp[i])%MOD;
		ans=(ans+dp[i])%MOD;
		//cout<<dp[i]<<' '<<i<<endl;
	}
	LL res=1;
	rep(i,num-1) res=res*2%MOD;
	ans=(ans+res)%MOD;
	cout<<ans<<endl;
	return 0;
}

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


#define rep2(x,fr,to) for(int (x)=(fr);(x)<(to);(x)++)
#define rep(x,to) for(int (x)=0;(x)<(to);(x)++)
#define repr(x,fr,to) for(int (x)=(fr);(x)>=(to);(x)--)
#define all(c) (c).begin(),(c).end()
#define sz(v) (int)(v).size()

using namespace std;
typedef long long ll; typedef vector<int> VI; typedef pair<int,int> pii;
const int MD = (int)1e9 + 7; typedef vector<ll> VL;
void dbg(){ cerr << "\n"; }  template <class T, class ...T2>
void dbg(const T& fst, const T2&...rst){ cerr << fst << ": "; dbg(rst...); }
template <class T, class T2> void amax(T& a,T2 b){ if(a < b) a = b;}


int main()
{
	cin.tie(0); ios_base::sync_with_stdio(false);
	int n, m, rs;
	cin >>n >>m >>rs;
	VI r(rs);
	rep(i, rs){ cin >>r[i]; r[i]--;}
	vector<VI> g(n, VI(n, MD));
	rep(i, n) g[i][i] = 0;
	rep(i, m){
		int a, b, c;
		cin >>a >>b >>c;
		g[a-1][b-1] = g[b-1][a-1] = c;
	}
	
	rep(k,n) rep(i,n) rep(j,n) g[i][j] = min(g[i][j], g[i][k]+g[k][j]);
	ll ans = 1LL<<50;
	sort(all(r));
	do {
		ll sm = 0;
		rep(i,rs-1) sm += g[r[i]][r[i+1]];
		ans = min(ans, sm);
	} while ( next_permutation(all(r)) );
	cout << ans <<"\n";
	
	
	return 0;
}


Measured memory_bytes: 384
#![allow(non_snake_case)]

#[allow(unused_macros)]
macro_rules! input { (source = $s:expr, $($r:tt)*) => { let mut iter = $s.split_whitespace(); let mut next = || { iter.next().unwrap() }; input_inner!{next, $($r)*} }; ($($r:tt)*) => { let stdin = std::io::stdin(); let mut bytes = std::io::Read::bytes(std::io::BufReader::new(stdin.lock())); let mut next = move || -> String{ bytes.by_ref().map(|r|r.unwrap() as char).skip_while(|c|c.is_whitespace()).take_while(|c|!c.is_whitespace()).collect() }; input_inner!{next, $($r)*} }; }
macro_rules! input_inner { ($next:expr) => {}; ($next:expr, ) => {}; ($next:expr, $var:ident : $t:tt $($r:tt)*) => { let $var = read_value!($next, $t); input_inner!{$next $($r)*} };}
macro_rules! read_value { ($next:expr, ( $($t:tt),* )) => { ( $(read_value!($next, $t)),* ) }; ($next:expr, [ $t:tt ; $len:expr ]) => { (0..$len).map(|_| read_value!($next, $t)).collect::<Vec<_>>() }; ($next:expr, chars) => { read_value!($next, String).chars().collect::<Vec<char>>() }; ($next:expr, bytes) => { read_value!($next, String).into_bytes() }; ($next:expr, usize1) => { read_value!($next, usize) - 1 }; ($next:expr, $t:ty) => { $next().parse::<$t>().expect("Parse error") }; }

fn main() {
    input!{
        n: [usize; 2],
    }
    println!("{}", if n[0] * n[1] % 2 == 1 { "Yes" } else { "No" });
}


Measured memory_bytes: 4352
// clang-format off

#include <bits/stdc++.h>

#define int long long int
#define main signed main()
#define bye return 0
#define loop(i, a, n) for (int i = (a); i < (n); i++)
#define rep(i, n) loop(i, 0, n)
#define each(p, v) for (auto p = (v).begin(); p != (v).end(); p++)
#define all(v) (v).begin(), (v).end()
#define prec(n) fixed << setprecision(n)
#define dump(x) cerr << "(L" << __LINE__ << ") " << #x << " = " << (x) << endl
#define clr(x, a) memset(x, a, sizeof(x))

#define sum(v) accumulate(all(v), 0)
#define stlice(from, to) substr(from, (to) - (from) + 1)
#define odd(n) ((n) % 2)
#define even(n) (!odd(n))

#define INF 1000000000
#define MOD 1000000007

#define pb push_back
#define mp make_pair
#define mt make_tuple
#define fi first
#define se second
#define vi vector<int>
#define vb vector<bool>
#define vc vector<char>

using namespace std;

// clang-format on

main {
  int a, b, c;
  cin >> a >> b >> c;
  map<tuple<int, int, int>, bool> m;
  int s = 0;
  while (even(a) && even(b) && even(c)) {
    if (m.count(mt(a, b, c))) {
      cout << "-1" << endl;
      bye;
    }
    m[mt(a, b, c)] = true;
    int x = a / 2, y = b / 2, z = c / 2;
    a = y + z;
    b = x + z;
    c = x + y;
    s++;
  }
  cout << s << endl;
  bye;
}


Measured memory_bytes: 256
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <cmath>
#include <ctime>
#include <vector>
#include <cstdio>
#include <string>
#include <cstring>
#include <iostream>
#include <algorithm>

using namespace std;

#define LL long long
#define pii pair<int,int>
#define sd(x) scanf("%d",&x)
#define slld(x) scanf("%lld",&x)
#define pd(x) printf("%d\n",x)
#define plld(x) printf("%lld\n",x)
#define rep(i,a,b) for(int i = (a) ; i <= (b) ; i++)
#define per(i,a,b) for(int i = (a) ; i >= (b) ; i--)
#define mem(a) memset(a,0,sizeof(a))
#define lson l , m , rt << 1
#define rson m + 1 , r , rt << 1 | 1
#define fast_io ios::sync_with_stdio(false)

const int INF = 1e9;
const LL mod = 1e9 + 7;
const int maxn = 2e5 + 7;

LL dp[maxn];
LL a[maxn];
LL sum[maxn];

int main() {
    int n;
    while(~sd(n)) {
        rep(i,1,n) slld(a[i]);
        sum[1] = a[1];
        rep(i,1,n) {
            if(i & 1) sum[i] = sum[i-1] + a[i];
            else sum[i] = sum[i-1];
        }
        mem(dp);
        rep(i,2,n) {
            if(i & 1) dp[i] = max(dp[i-2] + a[i] , dp[i-1]);
            else dp[i] = max(dp[i-2] + a[i] , sum[i-1]);
        }
        plld(dp[n]);
    }
    return 0;
}


Measured memory_bytes: 7920
#pragma GCC optimize("Ofast,no-stack-protector")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#pragma GCC optimize("unroll-loops")
#pragma GCC optimize("fast-math")

#include <bits/stdc++.h>
using namespace std;
 
#define len(x) (int)((x).size())
#define endl '\n'
#define int long long
#define x first 
#define y second
#define dbg(x) cout << #x << " = " << x << endl;

void solve(); signed main() {
#ifdef LOCAL
    freopen("input.txt", "r", stdin);
#endif
    srand(time(0));
    ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
    cout.setf(ios::fixed); cout.precision(10);
    solve();
    return 0;
}
 
const int MOD = 998244353, MAXN = 1e6 + 10, INF = 1e18 + 10, BASE = 37;

void solve() {
    int n;
    cin >> n;

    set<int> se;
    int d = 1;
    while (d * d <= n - 1) {
        if ((n - 1) % d == 0) {
            se.insert(d);
            se.insert((n - 1) / d);
        }
        d++;
    }

    se.erase(1);

    // dbg(len(se))

    d = 1;
    while (d * d <= n) {
        if (n % d == 0) {
            int d1 = n / d;
            int d2 = d;

            // dbg(d1 << " " << d2)

            int x = n;
            if (d1 != 1) {
                while (x % d1 == 0) x /= d1;
            }
            
            if (x % d1 == 1) {
                se.insert(d1);
            }
            x = n;
            if (d2 != 1) {
                while (x % d2 == 0) x /= d2;
            }
            if (x % d2 == 1) {
                se.insert(d2);
            }
        }
        d++;
    }

    se.erase(1);

    cout << len(se) << endl;
}

Measured memory_bytes: 256
#include<stdio.h>

static const int N = 1000;

void trace(int A[], int n){
  int i;
  for ( i = 1; i <= n; i++ ){
    if ( i > 1 ) printf(" ");
    printf("%d", A[i]);
  }
  printf("\n");
}

int main(){
  int n, i, j;
  int A[N+1],key;
  scanf("%d", &n);

  for ( i = 1; i <= n; i++ )scanf("%d", &A[i]);
  
 
   for(i=1 ; i < n+1 ; i++){

     key = A[i];
    
     j = i - 1;
     while(j >= 0 && A[j] > key){
     A[j+1] = A[j];
	  j--;
	  A[j+1] = key;

   }
 trace(A, n);
   }
  
  return 0;
}

Measured memory_bytes: 604
#include "bits/stdc++.h"
using namespace std;
typedef long long li;

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

    li n;
    bool ok = false;
    li last = 0;
    cin >> n;
    for (int i = 0; i < n; ++i) {
        li d1, d2;
        cin >> d1 >> d2;
        if (d1 == d2) {
            last++;
        } else {
            last = 0;
        }
        if (last >= 3) {
            ok = true;
        }
    }
    cout << (ok ? "Yes" : "No") << endl;

    return 0;
}

Measured memory_bytes: 3636
#include<bits/stdc++.h>
using namespace std;
const int N=100005;
int n,a[N];
long long ans;
int main(){
	scanf("%d",&n);
	for (int i=1;i<=n;i++)scanf("%d",&a[i]);
	for (int i=1;i<=n;i++){
		ans+=a[i]/2;
		a[i]%=2;
		if (a[i]&&a[i+1])ans++,a[i]--,a[i+1]--;
	}
	printf("%lld",ans);
}

Measured memory_bytes: 640
//Dragon_warrior7(IITK)
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back
#define nl cout << '\n'
#define sor(x) sort(x.begin(), x.end())
#define rev(v) reverse(v.begin(), v.end())
#define maxin(v) *max_element(v.begin(), v.end())
#define minin(v) *min_element(v.begin(), v.end())
#define sumall(vect) accumulate(vect.begin(), vect.end(), 0)
#define count(x,vect) count(vect.begin(), vect.end(), x)
#define lb(v, temp) lower_bound(v.begin(), v.end(), temp)
#define ub(v, temp) upper_bound(v.begin(), v.end(), temp)
#define fi first
#define se second
#define llmax 100000000000000000
#define deb(x) cout <<#x<<" "<< x << "\n"
#define pll pair<ll, ll> 
#define vll vector<ll> 
#define rub cout << "------------------------------------\n"
#define min(a,b,c) min(a,min(b,c))
#define max(a,b,c) max(a,max(b,c))
int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	set<int> s;
	for(int i=0;i<=9;i++)
	s.insert(i);
	ll n;
	cin>>n;
	ll k;
	cin>>k;
	while(k--)
	{
	    ll t;
	    cin>>t;
	    s.erase(t);
	}
	vector<ll> v;
	while(n)
	{
	    v.pb(n%10);
	    n/=10;
	}
	rev(v);
	int flag=0;
	vector<ll> ans;
	for(int i=0;i<v.size();i++)
	{
	    if(flag==1)
	    {ans.pb(*s.begin());continue;}
	    if(lb(s,v[i])==s.end())
	    {
	        ans.clear();
	        ans.pb(*ub(s,0));
	        for(int i=0;i<v.size();i++)
	        ans.pb(*lb(s,0));
	        break;
	    }
	    int x=*lb(s,v[i]);
	    if(x>v[i])
	    {ans.pb(x);flag=1;}
	    if(x==v[i])
	    ans.pb(x);
	}
	for(int i=0;i<ans.size();i++)
	cout<<ans[i];
	
}
	

Measured memory_bytes: 256
N, K = map(int, input().split())
S = str(input())

for i in range(len(S)):
    if i == K - 1:
        if S[i] == "A":
            print("a", end="")
        elif S[i] == "B":
            print("b", end="")
        else:
            print("c", end="")
    else:
        print(S[i],end="")

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

using namespace std;

int main() {
  int n = 0;
  cin >> n;
  vector<vector<int>> pro(n, vector<int>(n, -1));
  for (int i=0; i<n; i++) {
    int a = 0;
    cin >> a;
    for (int j=0; j<a; j++) {
      int x = 0, y = 0;
      cin >> x >> y;
      x--;
      pro.at(i).at(x) = y;
    }
  }
  
  int ans = 0;
  for (long long con=0; con<(1LL<<n); con++) {
    bool ok = true;
    for (int i=0; i<n; i++) {
      if ((con & (1LL<<i)) != 0) {
        for (int j=0; j<n; j++) {
          if ((pro.at(i).at(j) == 1 && (con & (1LL<<j)) == 0) || (pro.at(i).at(j) == 0 && (con & (1LL<<j)) != 0)) {
            ok = false;
            break;
          }
        }
        if (!ok) break;
      }
    }
    
    if (ok) {
      int tmp = 0;
      for (int i=0; i<n; i++) {
        if ((con & (1LL<<i)) != 0) {
          tmp++;
        }
      }
      ans = max(ans, tmp);
    }
  }
  cout << ans << endl;
  return 0;
}


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

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

    int N; cin >> N;
    vector<int> v(N);
    rep(i,N) cin >> v[i];

    sort(v.begin(), v.end());
    double ans = 0.0;
    ans = (v[0] + v[1]) / 2.0;
    for (int i = 2; i < N; i++) {
        ans = (ans + v[i]) / 2.0;
    }

    cout << fixed << setprecision(10) << ans << endl;

    return 0;
}


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

int main() {
  int n,m,ans=0,total=0;
  cin >> n >> m;
  int a[n];
  for(int i=0;i<n;i++){
    cin >> a[i]; total += a[i];
  }
  for(int i=0;i<n;i++){
    if(a[i] >= (total+4*m-1)/(4*m)) ans++;
  }
  cout << (ans >= m?"Yes":"No") << endl;
}


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

typedef long long LL;
const int maxn=int(1e5)+100;

int n;
LL a[maxn];
LL ansL, ansR;

void read()
{
	scanf("%d", &n);
	for (int i=1; i<=n; ++i) scanf("%lld", &a[i]);
}
void solve()
{
	if (a[n]!=2)
	{
		printf("-1\n");
		return;
	}
	ansL=ansR=2;
	for (int i=n; i; --i)
	{
		if (((ansL-1)/a[i]+1)*a[i]>ansR)
		{
			printf("-1\n");
			return;
		}
		ansL=((ansL-1)/a[i]+1)*a[i];
		ansR=(ansR/a[i])*a[i]+a[i]-1;
	}
	printf("%lld %lld\n", ansL, ansR);
}
int main()
{
	read();
	solve();
	return 0;
}

Measured memory_bytes: 1024
s = list(input())
t = list(input())

s.sort()
t.sort(reverse=True)

if ord(s[0]) < ord(t[0]):
    print('Yes')
elif ord(s[0]) == ord(t[0]):
    for i in range(min(len(s),len(t))):
        if ord(s[i]) > ord(t[i]):
            print('No')
            exit()
    if len(s) < len(t):
        print('Yes')
    else:
        print('No')
else:
    print('No')

Measured memory_bytes: 3064
#!/usr/bin/env python3
#%% for atcoder uniittest use
import sys
input= lambda: sys.stdin.readline().rstrip()
def pin(type=int):return map(type,input().split())
def tupin(t=int):return tuple(pin(t))
def lispin(t=int):return list(pin(t))
#%%code
def resolve():
    A,B,C=pin()
    K,=pin()

    for i in range(K):
        if A>=B:
            B*=2
            continue
        elif B>=C:
            C*=2
            continue
        else:
            continue

    print(["No","Yes"][C>B and B>A])
            

    
#%%submit!
resolve()

Measured memory_bytes: 9192
#include <bits/stdc++.h>
using namespace std;
#define F first
#define S second
#define R cin>>
#define ll long long
#define ln cout<<'\n'
#define in(a) insert(a)
#define pb(a) push_back(a)
#define pd(a) printf("%.10f\n",a)
#define mem(a) memset(a,0,sizeof(a))
#define all(c) (c).begin(),(c).end()
#define iter(c) __typeof((c).begin())
#define rrep(i,n) for(ll i=(ll)(n)-1;i>=0;i--)
#define REP(i,m,n) for(ll i=(ll)(m);i<(ll)(n);i++)
#define rep(i,n) REP(i,0,n)
#define tr(it,c) for(iter(c) it=(c).begin();it!=(c).end();it++)
ll check(ll n,ll m,ll x,ll y){return x>=0&&x<n&&y>=0&&y<m;}void pr(){ln;}
template<class A,class...B>void pr(const A &a,const B&...b){cout<<a<<(sizeof...(b)?" ":"");pr(b...);}
template<class A>void PR(A a,ll n){rep(i,n)cout<<(i?" ":"")<<a[i];ln;}
const ll MAX=1e9+7,MAXL=1LL<<61,dx[8]={-1,0,1,0,-1,-1,1,1},dy[8]={0,1,0,-1,-1,1,1,-1};
typedef pair<ll,ll> P;

void Main() {
  ll n;
  R n;
  ll m;
  R m;
  ll a[n];
  rep(i,n) R a[i];
  sort(a,a+n);
  ll ans=0;
  rep(i,m) ans+=a[i];
  pr(ans);
}

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


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

int main() {
  string S, T; cin >> S >> T;
  map<char, char> s, t;
  bool can = true;
  for (int i = 0; i < S.size(); i++) {
    char cs = S.at(i);
    char ct = T.at(i);
    if (s.count(cs) && s[cs] != ct) can = false;
    if (t.count(ct) && t[ct] != cs) can = false;
    if (!s.count(cs)) s[cs] = ct;
    if (!t.count(ct)) t[ct] = cs;
  }
  if (can) cout << "Yes" << endl;
  else cout << "No" << endl;
}

Measured memory_bytes: 776
fun main(args: Array<String>) {
    class Permutation<T> private constructor(private val baseIndex: Int, private var index: Int, val target: Array<T>?) {
        private var subPermutation: Permutation<T>? = null

        constructor(objs: Array<T>) : this(0, 0, objs.clone())

        init {
            if (target == null || target.isEmpty()) {
                throw IllegalArgumentException()
            }

            if (this.index < this.target.size - 1) {
                this.subPermutation = Permutation(this.baseIndex + 1, this.index + 1, this.target)
            }
        }

        operator fun next(): Boolean {
            if (this.subPermutation == null) {
                return false
            }
            val result = this.subPermutation!!.next()
            if (result) {
                return true
            }
            this.swap(this.baseIndex, this.index)
            ++this.index
            if (this.target!!.size <= this.index) {
                this.index = this.baseIndex
                return false
            }
            this.swap(this.index, this.baseIndex)
            return true
        }

        private fun swap(index1: Int, index2: Int) {
            val tmp = this.target!![index1]
            this.target[index1] = this.target[index2]
            this.target[index2] = tmp
        }
    }
    val (n, m, r) = readLine()!!.split(' ').map(String::toInt)
    val rList = readLine()!!.split(' ').map(String::toInt)
    val costMap = Array(n + 1) { LongArray(n + 1) { Long.MAX_VALUE / 3 } }
    (1..m).forEach {
        val (a, b, c) = readLine()!!.split(' ').map(String::toInt)
        costMap[a][b] = c.toLong()
        costMap[b][a] = c.toLong()
    }
    for (i in 1..n) {
        for (j in 1..n) {
            for (k in 1..n) {
                costMap[j][k] = Math.min(costMap[j][k], costMap[j][i] + costMap[i][k])
            }
        }
    }
    val permutation = Permutation(rList.toTypedArray())
    var minDist = Long.MAX_VALUE / 2
    do {
        val target = permutation.target!!
        var tempDist = 0L
        for (i in 0..(r - 2)) {
            tempDist += costMap[target[i]][target[i + 1]]
        }
        minDist = Math.min(minDist, tempDist)

    } while (permutation.next())
    println(minDist)
}

Measured memory_bytes: 43620
N, A, B = map(int, input().split())
S = input()

passed_japanese = 0
passed_foreigner = 0
ans = []

for i, c in enumerate(S):
    if A+B > passed_japanese+passed_foreigner:
        if c == 'a':
            passed_japanese += 1
            ans.append('Yes')
        elif c == 'b':
            if passed_foreigner+1 <= B:
                passed_foreigner += 1
                ans.append('Yes')
            else:
                ans.append('No')
        else:
            ans.append('No')
    else:
        ans.append('No')

print(*ans, sep="\n")


Measured memory_bytes: 6344
#include <stdio.h>

int main(void)
{
	int d=0,m,i,N,A[200000],count=1,a[200000],place=0;
	long long K;
	scanf("%d",&N);
	scanf("%lld",&K);
	for(i=0;i<N;i++){
		a[i]=0;
		scanf("%d",&A[i]);
	}
	for(i=0;i<K;i++){
		m=place;
		place=A[m]-1;
		if(a[place]==0){
			a[place]=count;
		}else if(d==0){
			m=count-a[place];
			K=(long long)(K-i-1)%m+i+1;
			d++;
		}
		count++;
	}
	printf("%d",place+1);
	return 0;
}

Measured memory_bytes: 3292
#include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
#define per(i,n) for(int i=n-1;i>=0;i--)
#define per1(i,n) for(int i=n;i>0;i--)
#define all(v) v.begin(), v.end()
typedef long long ll;
typedef pair<ll,ll> P;
typedef vector<ll> vec;
typedef vector<vec> mat;
int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    int n;
    cin>>n;
    vec A(n),ans(n,0);
    rep(i,n) cin>>A[i];
    map<int,int> B,num;
    set<int> C,D;
    rep(i,n){
        C.insert(-A[i]);
        num[A[i]]++;
        if(B[A[i]]==0) B[A[i]]=i+1;
        else B[A[i]]=min(B[A[i]],i+1);
    }
    ll c=0;
    for(auto itr=C.begin();itr!=C.end();itr++){
        c+=num[-*itr];
        D.insert(B[-*itr]-1);
        ll a=-*itr,b=0;
        itr++;
        if(itr!=C.end()) b=-*itr;
        itr--;
        ans[*D.begin()]+=(a-b)*c;
    }
    for(auto i:ans) cout<<i<<"\n";
}

Measured memory_bytes: 23512
import java.util.Scanner;
public class Main {
	static Scanner scan=new Scanner(System.in);
	static int gcd (int a, int b) {return b>0?gcd(b,a%b):a;}
	static long lcm (int a, int b) {return a*b/gcd(a,b);}
	static int max(int a,int b) {return a>b?a:b;}
	static int min(int a,int b) {return a<b?a:b;}
	static long factorial(int i) {return i==1?1:i*factorial(i-1);}
	static int lower_bound(int a[],int key) {
		int low=0,high=a.length;
		while(low<high) {
			int mid=((high-low)/2)+low;
			if(a[mid]<=key)low=mid+1;
			else high=mid;
		}
		return high;
		}
	static int upper_bound(int a[],int key) {
		int low=0,high=a.length;
		while(low<high) {
			int mid=((high-low)/2)+low;
			if(a[mid]<key)low=mid+1;
			else high=mid;
		}
		return high;
		}
	static boolean isPrime (int n) {
		if (n==2) return true;
		if (n<2 || n%2==0) return false;
		double d = Math.sqrt(n);
		for (int i=3; i<=d; i+=2)if(n%i==0){return false;}
		return true;
	}
	static int upper_division(int a,int b) {
		if(a%b==0) {
			return a/b;
		}
		else {
			return a/b+1;
		}
	}
	static long lupper_division(long a,long b) {
		if(a%b==0) {
			return a/b;
		}
		else {
			return a/b+1;
		}
	}
	static long lmax(long a,long b) {return Math.max(a, b);}
	static long lmin(long a,long b) {return Math.min(a, b);}
	
		public static void main(String[] args) {
			int a=scan.nextInt()*100+scan.nextInt()*10+scan.nextInt();
			System.out.println(a%4==0?"YES":"NO");
		}
}


Measured memory_bytes: 21972
#include <iostream>
#include <vector>
using namespace std;
int main() {
    int N, ans = 0;
    cin >> N;
    vector<int> a(N);
    for (auto& i : a) cin >> i;
    for (int i = 0; i < N; i++) if (i + 1 == a[a[i] - 1]) ans++;
    cout << ans / 2 << endl;
}


Measured memory_bytes: 640