akhauriyash/Code-Regression huggingface dataset:
N = int(input().strip())

l = [chr(i) for i in range(97, 97+26)]

ans = ""
if N <= 26:
    ans = l[N-1]
else:
    for i in range(1,11):
        st = 0
        for k in range(i):
            st = st + 26**(k+1)
        nd = st + 26**(i+1)
        if st < N <= nd:
            N = N - st
            for j in range(i+1):
                r = N % 26
                N = N // 26
                if r != 0:
                    N += 1
                    ans = l[r-1] + ans
                if r == 0:
                    ans = "z" + ans
            break

print(ans)

Measured memory_bytes: 9220
#include<bits/stdc++.h>
#define sc1(a) scanf("%d",&a)
#define sc2(a,b) scanf("%d%d",&a,&b)
#define sc3(a,b,c) scanf("%d%d%d",&a,&b,&c)
#define scl1(a) scanf("%lld",&a)
#define scl2(a,b) scanf("%lld%lld",&a,&b)
#define scl3(a,b,c) scanf("%lld%lld%lld",&a,&b,&c)
#define pf1(a) printf("%d ",a)
#define pfl1(a) printf("%lld ",a)
#define pfn printf("\n")
#define ll long long
#define ii pair<int,int>
#define vi vector<int>
#define vl vector<long long>
#define si set<int>
#define sl set<long long>
#define msi multi_set<int>
#define msl multi_set<long long>
#define usi unordered_set<int>
#define usl unordered_set<long long>
#define mii map<int,int>
#define mli map<long long,int>
#define mll map<long long,long long>
#define umii unordered_map<int,int>
#define umli unordered_map<long long,int>
#define umll unordered_map<long long,long long>
#define lp(i,a,b) for(int i=a;i<b;i++)
#define rlp(i,a,b) for(int i=a;i>b;i--)
#define dslp(it,c) for(typeof(c.begin()) it=c.begin();it!=c.end();it++)
#define pb push_back
#define pf push_front
#define ft first
#define sd second
#define N 100001
#define mod 1000000007
#define mod1 100000000
using namespace std;
typedef vector<vector<ll> > matrix;

int main(){
    string s,t;
    cin>>s>>t;
    int n=s.length(),m=t.length(),x=m;
    lp(i,0,n-m+1){
        int p=i,q=0,y=0;
        while(q<m){
            if(s[p]!=t[q])
                y++;
            p++;
            q++;
        }
        x=min(x,y);
    }
    cout<<x<<endl;
}

Measured memory_bytes: 3628
import std.stdio, std.string, std.conv, std.algorithm, std.numeric;
import std.range, std.array, std.math, std.typecons, std.container, core.bitop;

alias Query = Tuple!(int, "x", int, "y");

void main() {
    int n;
    scan(n);
    auto a = readln.split.to!(int[]);

    int amax = -10^^7, amin = 10^^7;
    int maxi, mini;

    foreach (int i, ai; a) {
        if (ai > amax) {
            amax = ai;
            maxi = i;
        }
        if (ai < amin) {
            amin = ai;
            mini = i;
        }
    }

    if (amax == amin && amax == 0) {
        writeln(0);
        return;
    }

    auto ans = new Query[](0);

    if (abs(amax) > abs(amin)) {
        if (maxi != 1) {
            ans ~= Query(maxi + 1, 2);
            ans ~= Query(maxi + 1, 2);
        }

        foreach (i ; 2 .. n) {
            ans ~= Query(i, i + 1);
            ans ~= Query(i, i + 1);
        }
    }
    else {
        if (mini != n - 2) {
            ans ~= Query(mini + 1, n - 1);
            ans ~= Query(mini + 1, n - 1);
        }

        foreach_reverse (i ; 1 .. n - 1) {
            ans ~= Query(i + 1, i);
            ans ~= Query(i + 1, i);
        }
    }

    writeln(ans.length);
    foreach (qi ; ans) {
        writefln("%d %d", qi.x, qi.y);
    }
}



void scan(T...)(ref T args) {
    string[] line = readln.split;
    foreach (ref arg; args) {
        arg = line.front.to!(typeof(arg));
        line.popFront();
    }
    assert(line.empty);
}



void fillAll(R, T)(ref R arr, T value) {
    static if (is(typeof(arr[] = value))) {
        arr[] = value;
    }
    else {
        foreach (ref e; arr) {
            fillAll(e, value);
        }
    }
}

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

class Progaram
{
    static void Main(string[] args)
    {
        var l = Console.ReadLine().Split(' ').Select(x => int.Parse(x)).ToArray();
        var n = l[0]; var t = l[1];
        var root = new List<int[]>();
        for (var i = 0; n > i; i++)
        {
            var li = Console.ReadLine().Split(' ').Select(x => int.Parse(x)).ToArray();
            root.Add(li);
        }

        root = root.Where(x => x[1] <= t).ToList();
        if (root.Count == 0)
        {
            Console.WriteLine("TLE");
            return;
        }
        Console.WriteLine(root.OrderBy(x => x[0]).ToList()[0][0]);
    }
}


Measured memory_bytes: 13652
package main
 
import (
	"bufio"
	"fmt"
	"os"
	"strconv"
)
 
const MAX_N = 100010
 
type key struct {
	a, b int
}
 
var edges [MAX_N][]int
var cost map[key]int
var N, Q, K int
var result map[key]int64
 
func dfs(pos, pre int, sum int64) {
	result[key{K, pos}] = sum
	result[key{pos, K}] = sum
	for _, next := range edges[pos] {
		if next == pre {
			continue
		}
		dfs(next, pos, sum+int64(cost[key{pos, next}]))
	}
 
}
func main() {
	fsc := NewFastScanner()
	N = fsc.NextInt()
	cost = make(map[key]int)
	result = make(map[key]int64)
	for i := 0; i < N-1; i++ {
		a, b, c := fsc.NextInt(), fsc.NextInt(), fsc.NextInt()
		a--
		b--
		edges[a] = append(edges[a], b)
		edges[b] = append(edges[b], a)
		cost[key{a, b}] = c
		cost[key{b, a}] = c
	}
	Q, K = fsc.NextInt(), fsc.NextInt()
	K--
	dfs(K, -1, 0)
	for i := 0; i < Q; i++ {
		a, b := fsc.NextInt(), fsc.NextInt()
		a--
		b--
		fmt.Println(result[key{a, K}] + result[key{K, b}])
	}
}
 
//template
type FastScanner struct {
	r   *bufio.Reader
	buf []byte
	p   int
}
 
func NewFastScanner() *FastScanner {
	rdr := bufio.NewReaderSize(os.Stdin, 1024)
	return &FastScanner{r: rdr}
}
func (s *FastScanner) Next() string {
	s.pre()
	start := s.p
	for ; s.p < len(s.buf); s.p++ {
		if s.buf[s.p] == ' ' {
			break
		}
	}
	result := string(s.buf[start:s.p])
	s.p++
	return result
}
func (s *FastScanner) NextLine() string {
	s.pre()
	start := s.p
	s.p = len(s.buf)
	return string(s.buf[start:])
}
func (s *FastScanner) NextInt() int {
	v, _ := strconv.Atoi(s.Next())
	return v
}
func (s *FastScanner) NextInt64() int64 {
	v, _ := strconv.ParseInt(s.Next(), 10, 64)
	return v
}
 
func (s *FastScanner) pre() {
	if s.p >= len(s.buf) {
		s.readLine()
		s.p = 0
	}
}
func (s *FastScanner) readLine() {
	s.buf = make([]byte, 0)
	for {
		l, p, e := s.r.ReadLine()
		if e != nil {
			panic(e)
		}
		s.buf = append(s.buf, l...)
		if !p {
			break
		}
	}
}
 
//Max,Min
func IntMax(a, b int) int {
	if a < b {
		return b
	}
	return a
}
 
func Int64Max(a, b int64) int64 {
	if a < b {
		return b
	}
	return a
}
func Float64Max(a, b float64) float64 {
	if a < b {
		return b
	}
	return a
}
 
func IntMin(a, b int) int {
	if a > b {
		return b
	}
	return a
}
 
func Int64Min(a, b int64) int64 {
	if a > b {
		return b
	}
	return a
}
func Float64Min(a, b float64) float64 {
	if a > b {
		return b
	}
	return a
}
 
//Gcd
func IntGcd(a, b int) int {
	if a < b {
		b, a = a, b
	}
	if b == 0 {
		return a
	}
	return IntGcd(b, a%b)
}
func Int64Gcd(a, b int64) int64 {
	if a < b {
		b, a = a, b
	}
	if b == 0 {
		return a
	}
	return Int64Gcd(b, a%b)
}
 
func IntAbs(a int) int {
	if a < 0 {
		a *= -1
	}
	return a
}
 
func Int64Abs(a int64) int64 {
	if a < 0 {
		a *= -1
	}
	return a
}

Measured memory_bytes: 61696
#include <algorithm>
#include <cmath>
#include <deque>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <tuple>
#include <vector>
using namespace std;
typedef long long ll;
ll const INF = 1LL << 60;

int main() {
  ll X, Y;
  cin >> X >> Y;
  ll x = X, cnt = 1;
  vector<ll> A;
  while (x <= Y) {
    A.push_back(x);
    x *= 2;
  }
  cout << A.size() << endl;
  return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
 
int main(){
  int a,b,c;
  string S;
  int d=0;
  int e=0;
  int i=0;
  cin>>a>>b>>c>>S;
  
  for(int i = 0; i <a; i++){
        switch(S[i]){
            case 'a' :
                if(d<b+c){
                    cout << "Yes" << endl;
                    d++;
                }
                else cout << "No" << endl;
                break;
            case 'b' :
                if(d<b+c&&e<c){
                    cout << "Yes" << endl;
                    d++;
                    e++;
                }
                else cout << "No" << endl;
                break;
            case 'c' :
                cout << "No" << endl;
                break;
 
        }
    }
 
 
  }

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

#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define int long long int
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define all(a)      (a).begin(),(a).end()
#define rall(a)     (a).rbegin(),(a).rend()

typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<pii> vpii;
typedef vector<vector<int>> vvi;
typedef unordered_map<int,int> uoii;
typedef unordered_map<string,int> uosi;

const int MOD = 1e9+7;

const int INF = 1e10;




int32_t main()
{
    
    IOS
    int x,y;
    cin>>x>>y;
    if(x==1||y==1){
        cout<<1;
    }else
    cout<<fixed<<setprecision(0)<<ceil((x*y)/2.0);


    return 0;
}


Measured memory_bytes: 256
import sys
input = sys.stdin.readline

def main():
    N, Q = map(int, input().split())
    S = input().rstrip()
    ac_freq = [0]
    for i in range(0, N-1):
        if S[i:i+2] == 'AC':
            ac_freq.append(ac_freq[-1] + 1)
        else:
            ac_freq.append(ac_freq[-1])
    ac_freq.append(ac_freq[-1])
    for _ in range(Q):
        l, r = map(int, input().split())
        print(ac_freq[r-1] - ac_freq[l-1])


if __name__ == '__main__':
    main()


Measured memory_bytes: 79872
#include <bits/stdc++.h>
#define INF 1e18
#define int long long
#define Rep(i, a, n) for (int i = (a); i < (n); i++)
#define rep(i, n) Rep(i, 0, n)
#define all(a) (a).begin(), (a).end()
using namespace std;
typedef pair<int, int> P;
typedef pair<int, P> PP;
const int mod = 1000000007;

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

    int n;
    cin >> n;
    vector<int> b(n - 1);
    rep(i, n - 1) cin >> b[i];
    int sum = 0;
    rep(i, n)
    {
        if (i == 0)
            sum += b[i];
        else if (i == n - 1)
            sum += b[n - 2];
        else
            sum += min(b[i - 1], b[i]);
    }
    cout << sum << endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <stdio.h>
#include <string.h>
#include <functional>
#include <algorithm>
#include <string>
#include <vector>
#include <algorithm>
#include <time.h>
#include <stdlib.h>

using namespace std;

int main (void)
{
  int K,a,b,c,d,x,y;
  cin >> a >> b >> c >> d;

  K = a + b + c + d;

  x = K / 60;
  y = K % 60;
  cout << x << endl << y << endl;
}

Measured memory_bytes: 3080
import sys
readline = sys.stdin.readline
readlines = sys.stdin.readlines

# 遅延評価で加えてあげるだけ

N,Q = map(int,readline().split())
AB = [tuple(int(x) for x in readline().split()) for _ in range(N-1)]
PX = [tuple(int(x) for x in readline().split()) for _ in range(Q)]

graph = [[] for _ in range(N+1)]
for a,b in AB:
    graph[a].append(b)
    graph[b].append(a)

value = [0] * (N+1)
for p,x in PX:
    value[p] += x

par = [None] * (N+1)
q = [1]
while q:
    x = q.pop()
    for y in graph[x]:
        if y == par[x]:
            continue
        value[y] += value[x]
        q.append(y)
        par[y] = x

answer = ' '.join(map(str,value[1:]))
print(answer)


Measured memory_bytes: 106928
#include<bits/stdc++.h>
using namespace std;
int main()
{
    int fly[]={4,1,4,1,2,1,2,1},peo[8],remainder,point=0;
    while(cin>>peo[0]){
        for(int i=1;i<8;i++)cin>>peo[i];
        for(int i=0;i<8;i++){
            int num=0;
            for(int j=0;j<8;j++)if(fly[(i+j)%8]<peo[j])num+=peo[j]-fly[(i+j)%8];
            if(remainder>num||i==0){
                remainder=num;
                point=i;
            }
            else if(remainder==num){
                for(int j=0;j<8;j++){
                    if(fly[(i+j)%8]>fly[(point+j)%8])break;
                    else if(fly[(i+j)%8]<fly[(point+j)%8]){
                        point=i;
                        break;
                        }
                    }
                }
        }
        for(int i=0;i<7;i++)cout<<fly[(point+i)%8]<<" ";
            cout<<fly[(point+7)%8]<<endl;
    }
}

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

using namespace std;

int main()
{
	int h, w, d;
	cin >> h >> w >> d;
	map<int, pair<int, int>> m;
	for (int i = 0; i < h; i++)
		for (int j = 0; j < w; j++)
		{
			int a;
			cin >> a;
			m[a] = pair<int, int>(i, j);
		}
	int cost[90001] = {};
	for (int i = 1; i <= d; i++)
		for (int now = i + d; now <= h * w; now += d)
			cost[now] = cost[now - d] + abs(m[now].first - m[now - d].first) + abs(m[now].second - m[now - d].second);
	int q;
	cin >> q;
	for (int i = 0; i < q; i++)
	{
		int l, r;
		cin >> l >> r;
		cout << cost[r] - cost[l] << endl;
	}

	return 0;
}


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

int main()
{
	int p, q;
	while (std::cin >> p >> q) {
		
		int digits_count = 0;
		std::vector<int> remainders;
		int recurring_pos = -1;
		while (true) {
			if (p==0) break;
			
			std::vector<int>::iterator it = std::find(remainders.begin(), remainders.end(), p);
			if ( it != remainders.end() ) {
				recurring_pos = std::distance(remainders.begin(), it);
				break;
			}
			
			remainders.push_back(p);
			p *= 10;
			std::cout << p/q;
			p = p % q;
			digits_count++;
		}
		std::cout << std::endl;
		
		if (recurring_pos >= 0) {
			for (int d=0; d<recurring_pos; d++) std::cout << " ";
			for (int d=recurring_pos; d<digits_count; d++) std::cout << "^";
			std::cout << std::endl;
		}
		
	}
	
	return 0;
}




Measured memory_bytes: 3092
#include <iostream>
#include <numeric>
#include <stdio.h>
#include <iomanip>
#include <string> // string, to_string, stoi
#include <vector> // vector
#include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound
#include <utility> // pair, make_pair
#include <tuple> // tuple, make_tuple
#include <cstdint> // int64_t, int*_t
#include <cstdio> // printf
#include <map> // map
#include <queue> // queue, priority_queue
#include <set> // set
#include <stack> // stack
#include <deque> // deque
#include <unordered_map> // unordered_map
#include <unordered_set> // unordered_set
#include <bitset> // bitset
#include <cctype> // isupper, islower, isdigit, toupper, tolower
using namespace std;
using ll = long long;
#define rep(i, n) for (long long i = 0; i < (long long)(n); i++)
int Max(int(a), int(b), int(c)) {
	return max(max(a, b), c);
}
int Min(int(a), int(b), int(c)) {
	return min(min(a, b), c);
}





int main() {

	string S;
		cin >> S;
		if (S.size() == 2) {
			cout << S << endl;
	}
		else {
			cout << S.at(2) << S.at(1) << S.at(0) << endl;
		}

}

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

const int NIL = -1;
const int NODE_MAX = 100000;

class Node {
public:
    Node() : parent(NIL), left(NIL), right(NIL) {}
    int parent;
    int left;
    int right;
    int depth;
};

vector<Node> T(NODE_MAX);

void depth(int node, int d)
{
    T[node].depth = d;
    if (T[node].right != NIL) {
        depth(T[node].right, d);
    }
    if (T[node].left != NIL) {
        depth(T[node].left, d + 1);
    }
}

void print(int id)
{
    cout << "node " << id << ": parent = " << T[id].parent << ", depth = " << T[id].depth;
    if (T[id].parent == NIL) {
        cout << ", root, ";
    } else if (T[id].left == NIL) {
        cout << ", leaf, ";
    } else {
        cout << ", internal node, ";
    }
    cout << "[";
    int c = T[id].left;
    while (c != NIL) {
        cout << c;
        c = T[c].right;
        if (c != NIL) {
            cout << ", ";
        }
    }
    cout << "]" << endl;
}

int main()
{
    int n;
    cin >> n;
    for (int i = 0; i < n; ++i) {
        int id, k;
        cin >> id >> k;
        int l;
        for (int j = 0; j < k; ++j) {
            int c;
            cin >> c;
            if (j == 0) {
                T[id].left = c;
            } else {
                T[l].right = c;
            }
            l = c;
            T[c].parent = id;
        }
    }
    // search for the root
    int root;
    for (int i = 0; i < n; ++i) {
        if (T[i].parent == NIL) {
            root = i;
            break;
        }
    }
    depth(root, 0);
    for (int i = 0; i < n; ++i) {
        print(i);
    }
    return 0;
}


Measured memory_bytes: 7496
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int maxn = 250;
char a[maxn];
int judge(int f,int r)
{
    while(f<=r)
        if(a[f]!=a[r-f+1])
            return 0;
            else
                f++;
        return 1;
}
int main()
{
    scanf("%s",a+1);
    int len=0,i=1;
    while(a[i]!='\0')
    {
        len++;i++;
    }
    if(judge(1,(len-1)/2)&&judge((len+3)/2,len))
        printf("Yes");
    else printf("No");
    return 0;
}

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

string a;
long long unsigned int s[30];
int main(){
	cin >> a;
	long long unsigned int ans = 0;
	for(int i=0;i<26;i++){
    s[i]=0;
    }

	for (long unsigned int i = 0; i < a.size() ; i++) {
		for(int j=0;j<26;j++){
        if (a[i] == 'a' + j )s[j]++;
        } 
	}
	ans = (a.size() *(a.size()-1))/2;
	for (int i = 0; i < 26; i++) {
		ans -= (s[i] * (s[i] - 1) )/ 2;
	}
	cout << ans+1 << endl;
return 0;
}


Measured memory_bytes: 640
#include <bits/stdc++.h>
#define rep(i, a, n) for (int i = a; i < n; i++)
#define repr(i, a, n) for (int i = n - 1; i >= a; i--)
using namespace std;
using ll = long long;
using P = pair<int, int>;
template <typename T> void chmin(T &a, T b) { a = min(a, b); }
template <typename T> void chmax(T &a, T b) { a = max(a, b); }

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

  int x;
  cin >> x;
  int use = x / 100;
  if (x % 100 <= use * 5)
    cout << 1 << endl;
  else
    cout << 0 << endl;
}


Measured memory_bytes: 256
#include<cstdio>
#define fr(N,i,x) for (int i=N.lnk[x];i;i=N.nxt[i])
using namespace std;
const int maxn=200005,maxe=maxn<<1;
int n,X,Y,dst[maxn],fa[maxn],Dst[maxn],Q[maxn],ans;bool vis[maxn];
struct ljb{
	int e,lnk[maxn],nxt[maxe],son[maxe];
	inline void add_e(int x,int y){son[++e]=y;nxt[e]=lnk[x];lnk[x]=e;}
}A,B;
inline char nc(){
	static char buf[100000],*p1=buf,*p2=buf;
	return p1==p2&&(p2=(p1=buf)+fread(buf,1,100000,stdin),p1==p2)?EOF:*p1++;
}
inline int read(){
	int ret=0;bool f=0;char ch=nc();
	while(ch>'9'||ch<'0') f^=ch=='-',ch=nc();
	while(ch<='9'&&ch>='0') ret=ret*10+ch-'0',ch=nc();
	return f?-ret:ret;
}
void DFS(int x){fr(B,i,x) if(B.son[i]^fa[x]) dst[B.son[i]]=dst[x]+1,fa[B.son[i]]=x,DFS(B.son[i]);}
inline void BFS(){
	int hed=0,til=1;Q[vis[X]=1]=X;
	while(hed++<til) if(Dst[Q[hed]]<dst[Q[hed]]) fr(A,i,Q[hed])
	if(!vis[A.son[i]]) vis[A.son[i]]=1,Dst[A.son[i]]=Dst[Q[hed]]+1,Q[++til]=A.son[i];
}
inline bool check(int x,int y){
	if(dst[x]>dst[y]){int t=x;x=y;y=t;}
	if(dst[y]-dst[x]==2) return fa[fa[y]]==x;
	if(dst[y]-dst[x]==1) return fa[y]==x;
	if(dst[y]-dst[x]==0) return fa[x]==fa[y];
	return 0;
}
int main(){
	n=read(),X=read(),Y=read();
	for (int i=1,x,y;i<n;i++) x=read(),y=read(),A.add_e(x,y),A.add_e(y,x);
	for (int i=1,x,y;i<n;i++) x=read(),y=read(),B.add_e(x,y),B.add_e(y,x);
	dst[Y]=0;DFS(Y);BFS();
	for (int i=1;i<=n;i++) if(vis[i]){
		if(Dst[i]<=dst[i]&&dst[i]>ans) ans=dst[i];
		if(Dst[i]<dst[i]) fr(A,j,i) if(!check(A.son[j],i)) ans=1e9;
	}
	printf("%d\n",ans==1e9?-1:ans<<1);
	return 0;
}

Measured memory_bytes: 17024
#include<bits/stdc++.h>
using namespace std;
#define arep(i,x,n) for(int i=int(x);i<(int)(n);i++)
#define rep(i,n) for(long long i = 0;i < n;++i)
#define rrep(i,n) for(int i=int(n-1);i>=0;i--)
#define fs first
#define sc second
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).begin(), (x).end()
#define pi 3.141592653589793
#define eps 0.00000001
#define INF 1e9+7
#define LINF 1e18+10  
using ll = long long; 

using P=pair<int,int>;
using lP=pair<ll,ll>;
using fP=pair<double,double>;
using PPI=pair<P,int>;
using Ps=pair<int,string>;

using vi=vector<int>;
using vl=vector<ll>;
using vc=vector<char>;
using vd=vector<double>;
using vs=vector<string>;
using vp=vector<P>;
using vb=vector<bool>;
using vvi =vector<vector<int>>;
using vvl =vector<vector<ll>>;
using vvd=vector<vector<double>>;
using vvc=vector<vector<char>>;
using vvp =vector<vector<P>>;
using vvb=vector<vector<bool>>;
template <typename T>
bool chmax(T &a, const T b){if(a < b){a = b; return true;} return false;}
template <typename T>
bool chmin(T &a, const T b){if(a > b){a = b; return true;} return false;}

//const ll mod=998244353;
const ll mod=1e9+7;
const ll MAX=300000;

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


int main(){
    int a,b,c;
    cin>>a>>b>>c;
    int k;
    cin>>k;
    bool ok=true;
    while(a>=b){
        b*=2;
        k--;
    }
    while(b>=c){
        c*=2;
        k--;
    }
    if(k>=0)cout<<"Yes"<<endl;
    else cout<<"No"<<endl;

    return 0;
}

Measured memory_bytes: 3632
from collections import Counter

n = int(input())
a = list(map(int, input().split()))

max_a = max(a)
ok = [False] * (max_a + 1)
sorted_a = sorted(a)

ans = 0
for i in range(n):
    if ok[sorted_a[i]]:
        continue
    else:
        if not(i < n - 1 and sorted_a[i] == sorted_a[i + 1]):
            ans += 1
        for j in range(1, max_a // sorted_a[i] + 1):
            ok[sorted_a[i] * j] = True
        
print(ans)


Measured memory_bytes: 96796
#include <bits/stdc++.h> // imports every library in c++
using namespace std; // ; is essential | says that you are USING the libraries

//  COMMAND TO USE WHEN RUNNING CODE: g++ homework.cpp -o homework -std=c++11 -O2  | to run: ./(name of file)  //

int N;
int c = 0;

int main() {
    cin >> N;
    int a[N];
    int b[N];
    for ( int i=0; i<N; i++ ) {
        cin >> a[i];
    }
    for ( int i=0; i<N; i++ ) {
        c = a[i]-1;
        b[c] = i+1;
    }
    for ( int i=0; i<N; i++ ) {
        cout << b[i] << " ";
    }
    return 0;
}

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

int main()
{
  int n;
  cin >> n;
  map<int, int> m;

  int a;
  for (int i = 0; i < n; i++)
  {
    cin >> a;
    if (m.find(a) != m.end())
    {
      m[a]++;
    }
    else
    {
      m[a] = 1;
    }
  }

  int res = 0;
  for (auto it = m.begin(); it != m.end(); it++)
  {
    if (it->second % 2 == 1)
    {
      res++;
    }
  }

  cout << res << endl;
}

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

int main()
{
	int i, N, A[20], B[20];
	scanf("%d", &N);
	for (i = 1; i <= N; i++) scanf("%d", &(A[i]));
	for (i = 1; i <= N; i++) scanf("%d", &(B[i]));
	
	const int sup = 10000, bit[19] = {1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096, 8192, 16384, 32768, 65536, 131072, 262144};
	int j, k, l, dp[262144][51] = {}, X[20][20], tmp, count, min;
	for (i = 1; i <= N; i++) {
		for (j = 1; j <= N; j++) X[i][j] = ((i + j) % 2 == 0)? A[i]: B[i];
	}
	for (k = 1; k < bit[N]; k++) {
		for (j = 0; j <= 50; j++) dp[k][j] = sup;
	}
	for (k = 1; k < bit[N]; k++) {
		for (i = 0, count = 0; bit[i] <= k; i++) if ((k | bit[i]) == k) count++;
		for (i = 0, l = 0; bit[i] <= k; i++) {
			if ((k | bit[i]) != k) continue;
			tmp = k ^ bit[i];
			if (dp[tmp][X[i+1][N-count+1]] < sup) {
				min = dp[tmp][X[i+1][N-count+1]] + abs(i - l - (N - count));
				for (j = 0; j <= X[i+1][N-count+1]; j++) if (dp[k][j] > min) dp[k][j] = min;
			}
			l++;
		}
	}
	
	if (dp[bit[N]-1][0] < sup) printf("%d\n", dp[bit[N]-1][0]);
	else printf("-1\n");
	fflush(stdout);
	return 0;
}

Measured memory_bytes: 53956
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp> 
#include <ext/pb_ds/tree_policy.hpp> 
#define ll          long long
#define pb          push_back
#define INF         9223372036854775807
#define    endl        '\n'
#define pii         pair<ll int,ll int>
#define vi          vector<ll int>
#define all(a)      (a).begin(),(a).end()
#define F           first
#define S           second
#define sz(x)       (ll int)x.size()
#define hell        1000000007
#define rep(i,a,b)    for(ll int i=a;i<b;i++)
#define lbnd        lower_bound
#define ubnd        upper_bound
#define bs          binary_search
#define mp          make_pair
#define lower(u)    transform(u.begin(), u.end(), u.begin(), ::tolower);//convert string u to lowercase;
#define upper(u)    transform(u.begin(), u.end(), u.begin(), ::toupper);
using namespace std;

using namespace __gnu_pbds; 
  
#define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update> 
#define N  100005

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    //freopen("input.txt","r",stdin);
    //freopen("output.txt","w",stdout);
    int TESTS=1;
//    cin>>TESTS;
    while(TESTS--)
    {
        string s;
        cin>>s;
        reverse(all(s));
        ll arr[s.size()+1];
        arr[0]=0;
        ll mod10=1;
        rep(i,1,s.size()+1)
        {
            arr[i]=(arr[i-1]+(mod10*(s[i-1]-'0'))%2019)%2019;
            mod10*=10;
            mod10%=2019;
        }        
        map<ll,ll>lol;
        rep(i,0,s.size()+1)
        lol[arr[i]]++;
        ll ans=0;
        for(auto u:lol)
        {
            ans+=(u.S*(u.S-1))/2;
        }
        cout<<ans<<endl;
    }
    return 0;
}

Measured memory_bytes: 5300
#include <stdio.h>

int main(){
    long long n,num,mn,nm,mon;
    while(scanf("%lld",&n)&&n){
        int cc=0,i,j,m=0,flag=0;
        long long sc[4001]={0};
        int map[4001]={0};
        for(i=0;i<n;i++){
            scanf("%lld %lld %lld",&num,&mn,&nm);
            mon = mn*nm;
            sc[num] += mon;
            for(j=0;j<m;j++)if(map[j]==num)flag=1;
            if(flag!=1)map[m++]=num;
        }
        for(i=0;i<m;i++){
            if(sc[map[i]]>=1000000){
                printf("%d\n",map[i]);
                cc++;
            }
        }
        if(cc==0) printf("NA\n");
    }
    return 0;
}

Measured memory_bytes: 0
X = int(input())
A = 0
B = 0
flag = 1
while flag:
  B = A * (-1)
  while B < A:
    #print(A, B)
    if A*A*A*A*A - B*B*B*B*B == X:
      print(A, B)
      flag = 0
      break
    B = B + 1
  A = A + 1

Measured memory_bytes: 9188
#include<bits/stdc++.h>
using namespace std;
int main(){
  int a,b,c,d,e,k;
  cin>>a>>b>>c>>d>>e>>k;
  if(e-a>k){
    cout<<":("<<endl;
  }
  else{
    cout<<"Yay!"<<endl;
  }
}


Measured memory_bytes: 3548
n = int(input())
a = []
ans = 0
for _ in range(n):
    a.append(int(input()))
if a[0] != 0:
    ans = -1
else:
    for i in range(n - 1):
        if (a[i+1] - a[i]) > 1:
            ans = -1
            break
        else:
            if a[i+1] == a[i]:
                if a[i+1] > 0:
                    ans += a[i+1] - 1
            if a[i+1] > 0:
                ans += 1
            if a[i+1] < a[i]:
                if a[i+1] > 1:
                    ans += a[i+1] - 1
            
print(ans)

Measured memory_bytes: 11056
n,k= list(map(int, input().split()))
li= list(map(int, input().split()))
d = [0 for i in range(n)]
c=[1]
nex=1
first=0
flag=0
for i in range(k):
    nex=li[nex-1]
    if d[nex-1]:
        first=c.index(nex)
        flag=1
        break
    d[nex-1]=1
    c.append(nex)
if flag:
    k-=first
    k%=len(c)-first
    print(c[first+k])
else:
    print(c[-1])

Measured memory_bytes: 32220
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main(void){
    
    string s[3];
    cin>>s[0]>>s[1]>>s[2];
    cout<<s[0][0]<<s[1][1]<<s[2][2]<<endl;
    
    
    return 0;
}

Measured memory_bytes: 256
#!/usr/bin/env python3
# Generated by https://github.com/kyuridenamida/atcoder-tools
from typing import *
import collections
import itertools
import math
import sys

INF = float('inf')
YES = "Yes"  # type: str
NO = "No"  # type: str


def solve(N: int):
    return [NO, YES]['7' in str(N)]


def main():

    sys.setrecursionlimit(10 ** 6)

    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    print(f'{solve(N)}')


if __name__ == '__main__':
    main()


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

using namespace std;

int main(){
    int N;
    cin >> N;
    int T,A;
    cin >> T >> A;

    int H[N];
    for(int i = 0; i < N; i++) cin >> H[i];

    double W[N];
    for(int i = 0; i < N; i++) W[i] = T - H[i] * 0.006;

    double min = 1000000;
    int ans;

    for(int i = 0; i < N; i++){
        if(abs(A - W[i]) < min){
            min = abs(A - W[i]);
            ans = i + 1;
        }
    }

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

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

namespace AtCoder.Abc
{
    public class QuestionA
    {
        public static void Main(string[] args)
        {
			// 文字列の入力
			string s = Console.ReadLine();

			int count = 0;
			for(int i=0; i< 3; ++i) {
				if(s[i] == '1') {
					++count;
				}
			}
			Console.WriteLine(count);
		}
	}
}

Measured memory_bytes: 13140
#include <iostream>
#include <algorithm>

using namespace std;

int main(void){
	int place = 0;
	char mv1, mv2;
	
	while(cin >> mv1){
		cin.ignore();
		cin >> mv2;
		if(mv1 > mv2) swap(mv1, mv2);
		if(place == 0 && mv1 == 'A'){
			if(mv2 == 'B') place = 1;
			if(mv2 == 'C') place = 2;
		}else if(place == 1){
			if(mv1 == 'A' && mv2 == 'B'){
				place = 0;
			}else if(mv1 == 'B' && mv2 == 'C'){
				place = 2;
			}
		}else if(place == 2 && mv2 =='C'){
			if(mv1 == 'A'){
				place = 0;
			}else{
				place = 1;	
			}
		}
	}
	if(place == 0){
		cout << "A" << endl;
	}else if(place == 1){
		cout << "B" << endl;
	}else{
		cout << "C" << endl;
	}
}

Measured memory_bytes: 0
#include <bits/stdc++.h>
#define sz(c)       int(c.size())
#define rep(i,a,b)  for (int i=a; i<(b); ++i)
#define per(i,a,b)  for (int i=(b)-1; i>=(a); --i)
#define fore(c,...) for (auto __VA_ARGS__:(c))
using namespace std;
typedef long long ll;



int main() {
	cin.tie(0);
	ios_base::sync_with_stdio(0);
	cout<<fixed<<setprecision(10);

	int N,M;
	cin>>N>>M;
	vector<int> A(N);
	rep(i,0,N) cin>>A[i];
	sort(A.rbegin(),A.rend());
	int total=accumulate(A.begin(),A.end(),0);
	if (total>4ll*M*A[M-1]) {
		cout<<"No\n";
	} else {
		cout<<"Yes\n";
	}
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define ll long long
ll arr[200009];
int main()
{
    ll n,t,m,x,i,j,k,maxi = INT_MIN,mini = INT_MAX,flag =0,sum=0;
    vector<int>vi;
    cin>>n;
    for(i = 0 ;i<n ;i++)
    {
        cin>>x;
        arr[x]++;
    }
    for(i = 0 ;i+2<=100000 ;i++)
    {
        sum=arr[i]+arr[i+1]+ arr[i+2];
        maxi=max(maxi,sum);

    }
    cout<<maxi<<endl;
    return 0;
}




Measured memory_bytes: 1024
pub fn read<T: std::str::FromStr>() -> T {
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).ok();
    s.trim().parse().ok().unwrap()
}

pub fn read_vec<T: std::str::FromStr>() -> Vec<T> {
    read::<String>()
        .split_whitespace()
        .map(|e| e.parse().ok().unwrap())
        .collect()
}

pub fn read_vec2<T: std::str::FromStr>(n: usize) -> Vec<Vec<T>> {
    (0..n).map(|_| read_vec()).collect()
}

pub fn read_col<T: std::str::FromStr>(n: usize) -> Vec<T> {
    (0..n).map(|_| read()).collect()
}

fn main() {
    let n: usize = read();
    let mut avec: Vec<u32> = read_vec();
    let mut bvec: Vec<u32> = read_vec();
    let mut cvec: Vec<u32> = read_vec();

    avec.sort();
    bvec.sort();
    cvec.sort();

    let mut ans: u64 = 0;

    let mut tmp1: usize = 0;
    let mut tmp2: usize = 0;
    for i in 0..n {
        while tmp1 < n && avec[tmp1] < bvec[i] {
            tmp1 += 1;
        }
        while tmp2 < n && cvec[tmp2] <= bvec[i] {
            tmp2 += 1;
        }
        ans += (tmp1 as u64) * ((n - tmp2) as u64);
    }

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


Measured memory_bytes: 8932
s = gets.chomp
n = s.length

dp = Array.new(n) { Array.new(2 + 1, 0) }
dp[0][1] = dp[1][2] = 1

1.upto(n - 1) do |i|
  if s[i - 1] != s[i]
    # 1 -> 1
    dp[i][1] = [dp[i - 1][1], dp[i - 1][2]].max + 1
  else
    # 1 -> 2
    dp[i][1] = dp[i - 1][2] + 1
  end

  if s[i - 3..i - 2] != s[i - 1..i]
    # 2 -> 2
    dp[i][2] = [dp[i - 2][1], dp[i - 2][2]].max + 1
  else
    # 2 -> 1
    dp[i][2] = dp[i - 2][1] + 1
  end
end

puts [dp[n - 1][1], dp[n - 1][2]].max


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

using namespace std;
using ll = long long;


int main()
{
    int n, k; cin >> n >> k;
    int G = 0;
    vector<int> a(n);
    for(int i = 0; i < n; i++) {
        cin >> a[i];
        G = gcd(a[i], G);
    }

    bool res = false;
    for(int i = 0; i < n; i++) {
        if(a[i] - k >= 0 && (a[i] - k) % G == 0)res = true;
    }
    cout << (res ? "POSSIBLE" : "IMPOSSIBLE" ) << endl;

}

Measured memory_bytes: 3724
#include <bits/stdc++.h>
#define ll long long 
using namespace std;
const int mod = 1e9 + 7;

ll binpw(ll a, ll b){
  ll ans = 1;
  while(b){
    if(b%2) ans = ans*a % mod;
    a = a*a % mod;
    b >>= 1;
  }
  return ans%mod;
}

ll ncr(ll a, ll b){
  if(b > a - b) return ncr(a, a - b);
  ll num = 1, den = 1;
  for(int i = 0; i < b; ++i) num = (a - i)*num % mod;
  for(int i = 1; i <= b; ++i)den = (i)*den % mod;
  return (num * binpw(den,(ll)(mod - 2))) % mod;
}

int main(){
  int n, m; cin >> n >> m;
  int count = 0;
  ll ans = 1;
  int x = m;
  while(m%2 == 0){
   m >>= 1;
   count++; 
  }
  ans = ans*ncr((ll)(count + n - 1),(ll)(n - 1)) % mod;
  for(int i = 3; i <= (int)sqrt(x); i += 2){
    count = 0;
    while(m%i == 0){
      m /= i;
      count++;
    }
    ans = ans*ncr((ll)(count + n - 1), (ll)(n - 1)) % mod;
  }
  count = 0;
  if(m > 2){
    ans = ans*ncr((ll)(n),(ll)(n - 1)) % mod;
  }
  cout << ans << '\n'; 
}


Measured memory_bytes: 3652
#include <iostream>
#include <string>
#include <math.h>
#include <algorithm>
#include <vector>
#include <set>
#include <map>
using namespace std;

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

int main(){
    int H, W; 
    cin >> H >> W;
    char s[H + 2][W + 2];
    for(int i = 1; i < H + 1; i++){
        for(int j = 1; j < W + 1; j++) cin >> s[i][j];
    }
    int cnt = 0; //条件を満たさない(i, j)の個数を保存していく
    for(int i = 1; i < H + 1; i++){
        for(int j = 1; j < W + 1; j++){
            if(s[i][j] == '#' && s[i-1][j] != '#' && s[i+1][j] != '#' &&
            s[i][j - 1] != '#' && s[i][j + 1] != '#'){
                cnt++; //条件を満たさなかったら、cnt++を行う。
            }
        }
    }
    if(cnt == 0) cout << "Yes" << endl;
    else cout << "No" << endl;
    return 0;
}

Measured memory_bytes: 256
/*
*          Name : chaitanya
*
*     Institute : ANITS,Visakhapatnam
*
*/
#include<cstdio>
#include <iostream>
#include<sstream>
#include<fstream>
#include<iomanip>
#include<algorithm>
#include<cmath>
#include<complex>
#include <cstring>
#include<vector>
#include<list>
#include<queue>
#include<stack>
#include<set>
#include<map>
#include<bitset>
#include<numeric>
#include<limits>
#include<climits>
#include<cfloat>
#include<functional>
#include<iterator>
#include <random>
#define inf  1000000000
const long long int N = 6999999;
#define all(x) begin(x),end(x)
#define ll long long int
const ll mod = 1000000007;
#pragma GCC optimization ("O3")
using namespace std;

int main()
{
 
  // freopen("input.txt","r",stdin);
  // freopen("output.txt","w",stdout);
  //ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
  int n;
  cin >> n;
  vector <pair<string,int>>v(n);
  map <int ,int>m;
  for (int i = 0; i < n; ++i)
  {
    int a;
    string s1;
    cin >> s1 >> a;
    v[i].first = s1;
    v[i].second = a;
    m[v[i].second] = i+1;
  }
  sort(v.begin(),v.end());
  for (int i = 0; i < v.size(); ++i)
  {
    //string s1 = v[i].first;
    vector < int > sr;
    for (int j = 0; j < v.size() ; ++j)
    {
      if(v[j].first == v[i].first)
        sr.push_back(v[j].second);
    }
    sort(sr.begin(),sr.end());
    reverse(sr.begin(),sr.end());
    for (int k = 0; k < sr.size(); ++k)
    {
      cout << m[sr[k]] << "\n";
    }
    i += sr.size()-1;
  }
  return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <cmath>
#include <vector>
#include <algorithm>
#include <functional>

using namespace std;

int main(void){
    int n;
    int cal=0,a,b,k;
    int par_1=0;
    vector<int> b_cal;
    
    cin>>k;
    cin>>a>>b;
    cin>>cal;
    
    for(int i=0;i<k;i++){
        cin>>n;
        b_cal.push_back(n);
    }
    sort(b_cal.begin(),b_cal.end(),greater<int>());

    for(int i=0;i<k;i++){
        cal+=b_cal[i];
        par_1=max(par_1,(int)floor(cal/(a+b*(i+1))));
    }
    
    cout<<par_1<<endl;
    return(0);
}

Measured memory_bytes: 1220
#include <iostream>
#include <algorithm>

using namespace std;

#define INF 2000000000
#define MOD 1000000007
typedef long long ll;
typedef pair<int, int> P;


int main()
{
	int x, y;
	cin >> x >> y;

	int ans = INF;
	if (y > x) {
		ans = min(ans, y - x);
	}
	if (y >= -x) {
		ans = min(ans, y + x + 1);
	}
	if (-y >= x) {
		ans = min(ans, -y -x + 1);
	}
	if (y < x) {
		ans = min(ans, x - y + 2);
	}

	cout << ans << "\n";
}


Measured memory_bytes: 256
N, x = map(int, input().split())
A = list(map(int, input().split()))
B = A[::-1]

ansA = 0
ansB = 0

for i in range(N-1):
  if A[i] > x:
    ansA += A[i] - x
    A[i] -= A[i] - x
  
  s = A[i] + A[i+1]
  if s > x:
    ansA += s - x
    A[i+1] -= s - x

print(ansA)

Measured memory_bytes: 14252
#include <iostream>
#include <string>
#include <algorithm>
#include <map>
using namespace std;

int main()
{
	int a, b, c;
	cin >> a >> b >> c;
	int temp = 0;
	temp = (a < b) ? ((b < c)? c : b) : ((a < c)? c : a);
	if (temp == a) {
		cout << b + c << endl;
	}
	else if (temp == b) {
		cout << a + c << endl;
	}
	else if (temp == c) {
		cout << a + b << endl;
	}
	return 0;
}


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

int main(){
  string s ;
    cin >>s;
  if(s.at(2)==s.at(3) && s.at(4)==s.at(5)){
    cout << "Yes" <<endl;
  }
  else cout << "No" <<endl;
}

Measured memory_bytes: 256
//
//  main.cpp
//  AC
//
//  Created by makinofuya on 2019/07/08.
//  Copyright © 2019 makinofuya. All rights reserved.
//
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <stack>
typedef long long ll;
using namespace std;
#define mod 1000000007
#define rep(i,n) for(ll i=0;i<n;i++)
#define out(s) cout << s << endl

int main(){
    ll x,y,z,K;cin >> x >> y >> z >> K;
    vector<ll>a(x),b(y),c(z);
    rep(i,x)cin >> a[i];
    rep(i,y)cin >> b[i];
    rep(i,z)cin >> c[i];
    sort(a.begin(),a.end(),greater<ll>());
    sort(b.begin(),b.end(),greater<ll>());
    sort(c.begin(),c.end(),greater<ll>());
    vector<ll> ans;
    rep(i,x){
        rep(j,y){
            rep(k,z){
                if((i+1)*(j+1)*(k+1)<=K){
                    ans.push_back(a[i]+b[j]+c[k]);
                }
                else break;
            }
        }
    }
    sort(ans.begin(),ans.end(),greater<ll>());
    rep(i,K){
        out(ans[i]);
    }
    
    return 0;
}



Measured memory_bytes: 1404
package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
	"strings"
)

func main() {
	io := NewIo()
	defer io.Flush()
	s := io.NextLine()
	s1, s2, s3 := s[0], s[1], s[2]
	if s1 == s2 && s2 == s3 && s1 == s3 {
		fmt.Println("No")
	} else {
		fmt.Println("Yes")
	}
}

type Io struct {
	reader    *bufio.Reader
	writer    *bufio.Writer
	tokens    []string
	nextToken int
}

func NewIo() *Io {
	return &Io{
		reader: bufio.NewReader(os.Stdin),
		writer: bufio.NewWriter(os.Stdout),
	}
}

func (io *Io) Flush() {
	err := io.writer.Flush()
	if err != nil {
		panic(err)
	}
}

func (io *Io) NextLine() string {
	var buffer []byte
	for {
		line, isPrefix, err := io.reader.ReadLine()
		if err != nil {
			panic(err)
		}
		buffer = append(buffer, line...)
		if !isPrefix {
			break
		}
	}
	return string(buffer)
}

func (io *Io) Next() string {
	for io.nextToken >= len(io.tokens) {
		line := io.NextLine()
		io.tokens = strings.Fields(line)
		io.nextToken = 0
	}
	r := io.tokens[io.nextToken]
	io.nextToken++
	return r
}

func (io *Io) NextInt64() int64 {
	i, err := strconv.ParseInt(io.Next(), 10, 64)
	if err != nil {
		panic(err)
	}
	return i
}

func (io *Io) NextFloat() float64 {
	i, err := strconv.ParseFloat(io.Next(), 64)
	if err != nil {
		panic(err)
	}
	return i
}

func (io *Io) PrintLn(a ...interface{}) {
	fmt.Fprintln(io.writer, a...)
}

func (io *Io) Printf(format string, a ...interface{}) {
	fmt.Fprintf(io.writer, format, a...)
}

func (io *Io) PrintInt64(a []int64) {
	b := []interface{}{}
	for _, x := range a {
		b = append(b, x)
	}
	io.PrintLn(b...)
}

func (io *Io) PrintFloat64(a []float64) {
	b := []interface{}{}
	for _, x := range a {
		b = append(b, x)
	}
	io.PrintLn(b...)
}

func (io *Io) PrintStringLn(a []string) {
	b := []interface{}{}
	for _, x := range a {
		b = append(b, x)
	}
	io.PrintLn(b...)
}

func getInt64Sice(arrStr string) []int64 {
	cols := strings.Split(arrStr, " ")
	a := make([]int64, len(cols))
	for i := 0; i < len(cols); i++ {
		v, err := strconv.ParseInt(cols[i], 10, 64)
		if err != nil {
			panic(err)
		}
		a[i] = v
	}
	return a
}

func getStrSice(arrStr string) []string {
	cols := strings.Split(arrStr, " ")
	a := make([]string, len(cols))
	for i := 0; i < len(cols); i++ {
		a[i] = cols[i]
	}
	return a
}

func getFloatSice(arrStr string) []float64 {
	cols := strings.Split(arrStr, " ")
	a := make([]float64, len(cols))
	for i := 0; i < len(cols); i++ {
		f, err := strconv.ParseFloat(cols[i], 64)
		if err != nil {
			panic(err)
		}
		a[i] = f
	}
	return a
}


Measured memory_bytes: 640
#include <bits/stdc++.h>
#define x first
#define y second
using namespace std;
typedef long long ll;
const int MAXN = 100500;



int main()
{                                                     
	ios_base::sync_with_stdio(0);
	string s;
	cin >> s;
	
	if (s.size() >= 4 && s.substr(0, 4) == "YAKI") {
		cout << "Yes\n";
	}	
	else {
		cout << "No\n";
	}

		
	return 0;
}


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

vector<string> ans;
int n;

void f(string s, int i, int k)
{
  if (i == n) {
    ans.push_back(s);
    return;
  }
  int num = s[i-1] - 'a';
  k = max(k, num+1);
  for (int j=0; j<k+1; j++) {
    f(s, i+1, k);
    s[i]++;
  }
}

int main()
{
  cin >> n;
  string s = "";
  rep(i, n) s.push_back('a');
  f(s, 1, 1);
  sort(ans.begin(),ans.end());
  for (auto v:ans) {
    cout << v << endl;
  }

  return 0;
}


Measured memory_bytes: 7796
#include<bits/stdc++.h>
using namespace std;
int l,flag;
char a[110];
int main()
{
	cin>>a;
	l=strlen(a);
	for(int i=0;i<l;++i)
	{
		if(a[i]=='C')
		flag=1;
		if(flag==1&&a[i]=='F')
		flag=2;
	}
	if(flag==2)
	cout<<"Yes";
	else
	cout<<"No";
	return 0;
}

Measured memory_bytes: 256
s = input()
t = input()
dp = [[0] * (len(t)+1) for _ in range(len(s) + 1) ]
for i in range(len(s)):
    for j in range(len(t)):
        if s[i] == t[j]:
            dp[i+1][j+1] = max(dp[i+1][j+1] , dp[i][j]+1)
        dp[i+1][j+1] = max(dp[i+1][j+1] , dp[i+1][j])
        dp[i+1][j+1] = max(dp[i+1][j+1] , dp[i][j+1])
ans = ""
i = len(s)
j = len(t)
while i > 0 and j > 0:
    if dp[i][j] == dp[i-1][j]:
        i -= 1
    elif dp[i][j] == dp[i][j-1]:
        j -= 1
    else:
        ans = s[i-1] + ans
        i -= 1
        j -= 1

print(ans)

Measured memory_bytes: 113628
import sys

input = sys.stdin.readline
MOD = 1000000007

N  = input()[:-1]

if len(N)== 1:
    print(int(N))
elif len(N)  == 2:
    if N[-1] == '9':
        print(int(int(N)/10) + 9)
    else:
        print(int(int(N)/10)-1 + 9)

else:
    res = 0
    if N[0] == '9':
        check = True
        for i in range(0,len(N)):
            if N[i] != '9':
                check = False
        if check:
            res = 9*(len(N))
        else:
            res = 9*(len(N)-1)+8
    else:
        check = True
        for i in range(1,len(N)):
            if N[i] != '9':
                check = False
            if check:
                res = 9*(len(N)-1)+int(N[0])
            else:
                res = 9*(len(N)-1)+int(N[0])-1
    print(res)

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

int main(){
    int ans = 0, cnt = 0;
    string s;
    cin >> s;
    for(char c : s){
        if(c == '(')    cnt++;
        else if(c == ')')   cnt--;
        else ans = cnt;
    }
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 3148
#include <bits/stdc++.h>
#include <stdlib.h>
#define rep(i,l,r) for((i)=(l);(i)<(r);(i)++)
#define ll long long
using namespace std;
int main(){
    ll n,i;
    cin>>n;
    
    ll buf,h,ma=0,ans=0;
    rep(i,0,n){
        cin>>h;
        if(i!=0){
            if(buf>=h)ans++;
            else {
                ma=max(ma,ans);
                ans=0;
            }
        }
        buf=h;
    }
    ma=max(ma,ans);
    cout<<ma<<endl;
}

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

typedef long long ll;
typedef long double ld;

#define pb push_back
#define sort(s) sort(s.begin(),s.end())
#define reverse(s) reverse(s.begin(),s.end())
#define rep(i,n) for(ll (i)=0;(i)<(n);(i)++)

const ll mod = 1e9+7;

//最大公約数
ll gcd(ll a, ll b) {
    return b ? gcd(b, a%b) : a;
}

//最小公倍数
ll lcm(ll a, ll b) {
    return a / gcd(a, b) * b;
}

//素数判定
bool isPrime(ll x){
    ll i;
    if(x < 2)return 0;
    else if(x == 2) return 1;
    if(x%2 == 0) return 0;
    for(i = 3; i*i <= x; i += 2) if(x%i == 0) return 0;
    return 1;
}

//桁和
int digsum(ll n) {
    int res = 0;
    while(n > 0) {
        res += n%10;
        n /= 10;
    }
    return res;
}

//桁数
int dignum(ll n) {
    int res = 0;
    while(n > 0) {
        res++;
        n /= 10;
    }
    return res;
}

//文字列中の特定の文字カウント
ll stringcount(string s,char c){
    return count(s.cbegin(),s.cend(),c);
}

//階乗
ll ka(ll i){
    ll res=1;
    while(i>0){
        res=res*i;
        i--;
    }
    return res;
}
 
//ncr
ll ncr(ll x,ll y){
    ll a = x;
    ll b = 1;
    if(y>(x/2)){
        y=x-y;
    }
    for(ll i=1;i<y;i++){
        a*=x-i;
        b*=i+1;
    }
    return a/b;
}

//フィボナッチ数列 -92
ll f(ll x){
    ll dp[x+1];
    dp[1]=1;
    dp[2]=1;
    for(ll i=3;i<=x;i++){
        dp[i]=dp[i-1]+dp[i-2];
    }
    return dp[x];
}



int main(){
    int k[32] = {1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51};
    int n;
    cin >> n;
    cout << k[n-1] << endl;
    
}

Measured memory_bytes: 256
n,m = map(int,input().split())
x = []
money = 0
for i in range(m):
    a,b = map(int,input().split())
    if a < n:
        x += [a]

x.sort()

if len(x) > 1:
    for j in reversed(range(1,len(x))):
        money += n - x[j]

print(money)




Measured memory_bytes: 5608
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
using vi = vector<int>;
using vvi = vector<vi>;
using vl = vector<ll>;
using vvl = vector<vl>;

void PANA2020C()
{
	ull a, b, c;
	cin >> a >> b >> c;
	if (c < a + b)
	{
		cout << "No" << endl;
		return;
	}
	ull y = c - (a + b);
	ull x = a * b;
	if (4 * x < (y * y))
	{
		cout << "Yes" << endl;
	}
	else
	{
		cout << "No" << endl;
	}
}
int main()
{
	PANA2020C();
	return 0;
}

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

namespace ConsoleApp15
{
    class Class50
    {
        static void Main()
        {
            int N = int.Parse(Console.ReadLine());
            int nx = 0, ny = 0, nt = 0;

            bool ans = true;
            for(int i = 0; i < N; i++)
            {
                var r = Console.ReadLine().Split().Select(int.Parse).ToArray();
                int t = r[0], x = r[1], y = r[2];
                int leng = Math.Abs(x - nx) + Math.Abs(y - ny);
                int time = t - nt;
                if (leng <= time)
                {
                    if ((time - leng) % 2 == 0)
                    {
                        nx = x;
                        ny = y;
                        nt = t;
                    }
                    else ans = false;
                }
                else ans = false;
            }
            Console.WriteLine(ans ? "Yes" : "No");
        }
    }
}


Measured memory_bytes: 15440