akhauriyash/Code-Regression huggingface dataset:
#include <algorithm>
#include <cmath>
#include <functional>
#include <iomanip>
#include <iostream>
#include <limits>
#include <map>
#include <queue>
#include <set>
#include <tuple>
#include <vector>

using namespace std;

#define rep(i, n) for (int64_t i = 0; i < (n); i++)
#define irep(i, n) for (int64_t i = 0; i <= (n); i++)
#define rrep(i, n) for (int64_t i = (n)-1; i >= 0; i--)
#define rirep(i, n) for (int64_t i = n; i >= 0; i--)

int main()
{
    int64_t a, b;
    cin >> a >> b;

    if (a > 0)
    {
        cout << "Positive" << endl;
    }
    else if (b < 0)
    {
        if ((b - a) % 2 == 0)
        {
            cout << "Negative" << endl;
        }
        else
        {
            cout << "Positive" << endl;
        }
    }
    else
    {
        cout << "Zero" << endl;
    }

    return 0;
}

Measured memory_bytes: 256
n=int(input())
time=list(map(int,input().split()))
m=int(input())
for i in range(m):
  short=list(map(int,input().split()))
  time2=time.copy()
  time2[short[0]-1]=short[1]
  sum=0
  for t in time2:
    sum+=t
  print(sum)

Measured memory_bytes: 3064
#include <iostream>
using namespace std;
int main(){
    string s;
    cin>>s;
    int ans=0;
    
    for(int i=97;i<123;i++){
        bool flag=false;
        for(int j=0;j<s.length();j++){
            if(i==(int)s[j]){
                flag=true;
                break;
            }
        }
        if(!flag){
            ans=i;
            break;
        }   
    }
    if(ans==0){
        cout<<"None"<<endl;
    }else{
        cout<<(char)ans<<endl;
    }
}

Measured memory_bytes: 512
import sys
sys.setrecursionlimit(10 ** 7)
input = sys.stdin.readline

n = int(input())

a = list( map(int, input().split()))
b=[]
c = [0]*n
ans = 0

for i in reversed(range(n)):
    if a[i] > 1:
        print(-1)
        exit()
    cnt = n // (i+1)
    tmp = 0
    for j in range(2,cnt+1):
        tmp += c[(i+1) * j-1]
    tmp2 = (tmp%2+a[i])%2
    c[i] = tmp2
    ans += tmp2
    if tmp2 == 1:
        b.append(i+1)
b.sort()
print(ans)
print(*b, sep=' ')

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

using namespace std;

int N, mod = 1e9 + 7, v[100009], a[100009], pf[100009];
long long ans[100009];
multiset < pair < int, int > > S;

int add (int x, int y) {int ans = x + y; if (ans >= mod) ans -= mod; return ans;}
int substract (int x, int y) {if (x >= y) return x - y; return x - y + mod;}
int mul (int x, int y) {return 1LL * x * y % mod;}

int pow (int a, int b)
{
    int p = 1;
    for (int i=0; (1<<i) <= b; i++)
    {
        if (b & (1 << i)) p = mul (p, a);
        a = mul (a, a);
    }
    return p;
}

/*void Prec (int lim){fac[0] = inv[0] = 1;for (int i=1; i<=lim; i++)fac[i] = mul (fac[i - 1], i);
inv[lim] = pow (fac[lim], mod - 2);for (int i=lim - 1; i>=1; i--)inv[i] = mul (inv[i + 1], i + 1);}
int comb (int N, int K){int ans = mul (fac[N], inv[N - K]);ans = mul (ans, inv[K]);return ans;}*/

int main ()
{
//freopen ("input", "r", stdin);
//freopen ("output", "w", stdout);

scanf ("%d", &N);
for (int i=1; i<=N; i++)
{
    scanf ("%d", &a[i]);
    if (i == 1) pf[i] = 1;
    else
    if (a[i] > a[pf[i - 1]]) pf[i] = i;
    else pf[i] = pf[i - 1];
}
int pos = pf[N];
for (int i=pos; i<=N; i++)
    S.insert (make_pair (-a[i], 1));
while (pos)
{
/*    for (auto it = S.begin (); it != S.end (); it ++)
        printf ("(%d %d) ", -it->first, it->second);
    printf ("\n");*/
    int p2 = pf[pos - 1];
    int cnt = 0;
    while (!S.empty ())
    {
        auto it = S.begin ();
        if (- (it->first) > a[p2])
        {
            cnt += it->second, ans[pos] += 1LL * it->second * ((-it->first) - a[p2]);
            S.erase (it);
        }
        else break;
    }
    S.insert (make_pair (-a[p2], cnt));
    for (int i=p2; i<pos; i++)
        S.insert (make_pair (-a[i], 1));
    pos = p2;
}
for (int i=1; i<=N; i++)
    printf ("%lld\n", ans[i]);
return 0;
}


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

using namespace std;
#define vi vector<int>
#define ll long long int

int main(){
    long long int d,n;
    cin >> d >> n;
    if(n==100)n++;
    long long int ans=1;
    for(int i=0;i<d;i++)ans*=100;
    cout << n*ans;
}

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

int main(){
  while(1){

  int n,m;
  int mn[1001],cnt[101]={},ans[1001]={},ansm=0;
  string str[101],str2[1001];
  cin>>n>>m;
  if(n+m==0) break;
  for(int i=0;i<n;i++)cin>>str[i]>>mn[i];

  for(int i=0;i<n;i++)
    for(int j=0;j<8;j++)if(str[i][j]>='0' && str[i][j]<='9') cnt[i]++;

  for(int i=0;i<m;i++) cin>>str2[i];

  for(int i=0;i<n;i++){
      for(int k=0;k<m;k++){
	ans[k]=0;
	for(int j=7;j>=0;j--)if(str2[k][j]==str[i][j])ans[k]++;
	if(ans[k]==cnt[i])  ansm+=mn[i];
	}
  }

        cout<<ansm<<endl;
  }
    return 0;

}

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

#define ll long long
#define REP(i,n) for(int i = 0; i < n; i++)
#define PI 3.141592653589
#define MOD 1000000007

using namespace std;

template<typename T> T gcd(T a, T b){return (a % b)? gcd(b, a % b) : b;}
template<typename T> T lcm(T a, T b){return a * b / gcd(a, b);}

void solve_A(){
    int n;
    cin >> n;
    int i = 1;
    while(1){
        if(i * 1000 >= n){
            break;
        }
        i ++;
    }

    cout << i *1000 - n<< endl;
}

void solve_B(){
    int n;
    cin >> n;
    string s[n];
    map<string, int> mp;
    REP(i,n){
        cin >> s[i];
        mp[s[i]]++;
    }

    cout << "AC x " << mp["AC"] << endl;
    cout << "WA x " << mp["WA"] << endl;
    cout << "TLE x " << mp["TLE"] << endl;
    cout << "RE x " << mp["RE"] << endl;

}

int main(void){
    solve_B();
    
    return 0;
}

Measured memory_bytes: 6756
#include<bits/stdc++.h>
using namespace std;
#define MOD 1000000007
#define INF 1000000010
#define EPS 1e-9
#define fst first
#define scd second

#define debug(x) cout<<x<<endl;
#define repi(i,x,n) for(int i=x;i<n;i++)
#define rep(i,n) repi(i,0,n)
#define lp(i,n) repi(i,0,n)
#define repn(i,n) for(int i=n;i>=0;i--)
#define int long long
#define endl "\n"


signed main(){
  cin.tie(0);	
  ios::sync_with_stdio(false);
  int n,a,b;
  cin>>n>>a>>b;
  string s;
  cin>>s;
  int now=0;
  int nowb=0;
  rep(i,s.size() ){
    if(s[i]=='c') cout<<"No"<<endl;
    else if(s[i]=='a'){
      if(now<(a+b)){
        cout<<"Yes"<<endl;
        now++;
      }else{
        cout<<"No"<<endl;
      }
    }else if(s[i]=='b'){
      if(now<a+b && nowb<b){
        cout<<"Yes"<<endl;
        now++;
        nowb++;
      }else{
        cout<<"No"<<endl;
      }
    }
  }
  

  return 0;
}

Measured memory_bytes: 848
import itertools
n=int(input())
p=list(map(int,input().split()))
q=list(map(int,input().split()))
a=[i for i in range(1,n+1)]
ans1=0
k=0
ans2=0
for i in itertools.permutations(a):
    if list(i)==p:
        ans1=k
    if list(i)==q:
        ans2=k
    k+=1
print(abs(ans1-ans2))

Measured memory_bytes: 3064
S="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"
N=list(map(int,S.split(", ")))
K=int(input())
print(N[K-1])

Measured memory_bytes: 3316
import math
import itertools
import collections
import bisect
import heapq

def IN(): return int(input())
def sIN(): return input()
def MAP(): return map(int,input().split())
def LMAP(): return list(map(int,input().split()))
def TATE(n): return [input() for i in range(n)]
MOD = 10**9 + 7

a,v = MAP()
b,w = MAP()
t = IN()

if b > a:
  if a+v*t >= b+w*t:
    print('YES')
  else:
    print('NO')
else:
  if a-v*t <= b-w*t:
    print('YES')
  else:
    print('NO')


Measured memory_bytes: 9512
import java.text.DecimalFormat;
import java.util.stream.LongStream;
import java.util.stream.IntStream;
import java.io.*;
import java.util.*;

public class Main {
    
    public static void main(String[] args) {
        FastScanner sc = new FastScanner();
        PrintWriter out = new PrintWriter(System.out);
        
        AtCoder problem = new AtCoder(sc);
        problem.solve(out);
        
        out.flush();
    }
    
}

class AtCoder {
    
    int N, A, B;
    
    AtCoder(FastScanner sc) {
        N = sc.nextInt();
        A = sc.nextInt();
        B = sc.nextInt();
    }
    
    void solve(PrintWriter out) {
        out.println(Math.min(A * N, B));
    }
    
}

class FastScanner {
    
    private final InputStream in = System.in;
    private final byte[] buffer = new byte[1024];
    private int ptr = 0;
    private int buflen = 0;
    
    private boolean hasNextByte() {
        if (ptr < buflen) {
            return true;
        } else {
            ptr = 0;
            try {
                buflen = in.read(buffer);
            } catch (IOException e) {
                e.printStackTrace();
            }
            if (buflen <= 0) {
                return false;
            }
        }
        return true;
    }
    
    private int readByte() {
        if (hasNextByte()) {
            return buffer[ptr++];
        } else {
            return -1;
        }
    }
    
    private static boolean isPrintableChar(int c) {
        return 33 <= c && c <= 126;
    }
    
    public boolean hasNext() {
        while (hasNextByte() && !isPrintableChar(buffer[ptr])) {
            ptr++;
        }
        return hasNextByte();
    }
    
    public String next() {
        if (!hasNext()) {
            throw new NoSuchElementException();
        }
        StringBuilder sb = new StringBuilder();
        int b = readByte();
        while (isPrintableChar(b)) {
            sb.appendCodePoint(b);
            b = readByte();
        }
        return sb.toString();
    }
    
    public long nextLong() {
        if (!hasNext()) {
            throw new NoSuchElementException();
        }
        long n = 0;
        boolean minus = false;
        int b = readByte();
        if (b == '-') {
            minus = true;
            b = readByte();
        }
        if (b < '0' || '9' < b) {
            throw new NumberFormatException();
        }
        while (true) {
            if ('0' <= b && b <= '9') {
                n *= 10;
                n += b - '0';
            } else if (b == -1 || !isPrintableChar(b)) {
                return minus ? -n : n;
            } else {
                throw new NumberFormatException();
            }
            b = readByte();
        }
    }
    
    public int nextInt() {
        long nl = nextLong();
        if (nl < Integer.MIN_VALUE || nl > Integer.MAX_VALUE) {
            throw new NumberFormatException();
        }
        return (int) nl;
    }
    
    public double nextDouble() {
        return Double.parseDouble(next());
    }
}


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




public class Main {

    public static void main(String[] args) {

    	Main main=new Main();

    	main.run();

    }

    void run() {
    	Scanner sc=new Scanner(System.in);

    	int N=sc.nextInt();

    	int[] L=new int[2*N];

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

    	Arrays.sort(L);

    	int sum=0;
    	for(int i=0;i<L.length;i++) {
    		if(i%2==0) {
    			sum+=L[i];
    		}
    	}

    	System.out.println(sum);
    }


}



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

#define MAX(a,b) ((a)>(b)?(a):(b))

typedef struct directedGraph{
  int *vertex;
  int *next;
  int *start;
  int v,e;
  int pointer;
} graph;

graph* newGraph(const int v,const int e){
  graph *g=(graph *)malloc(sizeof(graph));
  g->vertex=(int *)calloc(e,sizeof(int));
  g->next=(int *)calloc(e,sizeof(int));
  g->start=(int *)calloc(v,sizeof(int));
  for(int i=0;i<v;i++) g->start[i]=-1;
  g->v=v;
  g->e=e;
  g->pointer=0;
  return g;
}

void freeGraph(graph *g){
  free(g->vertex);
  free(g->next);
  free(g->start);
  free(g);
  return;
}

void addEdge(graph *g,const int from,const int to){
  const int p=g->pointer;
  g->vertex[p]=to;
  g->next[p]=g->start[from];
  g->start[from]=p;
  g->pointer++;
  return;
}

void run(void){
  int n,m;
  scanf("%d%d",&n,&m);
  graph *g=newGraph(n,m);
  while(m--){
    int x,y;
    scanf("%d%d",&x,&y);
    x--;y--;
    addEdge(g,x,y);
  }
  int *dp=(int *)calloc(n,sizeof(int));
  int *stack=(int *)calloc(2*n,sizeof(int));
  int ans=0;
  for(int i=0;i<n;i++){
    int top=0;
    stack[top++]=i;
    while(top>0){
      int v=stack[--top];
      if(v<n && dp[v]) continue;
      if(v>=n){
	v-=n;
	int local=1;
	for(int p=g->start[v];p!=-1;p=g->next[p]){
	  int u=g->vertex[p];
	  local=MAX(local,dp[u]+1);
	}
	dp[v]=local;
      } else {
	stack[top++]=v+n;
	for(int p=g->start[v];p!=-1;p=g->next[p]){
	  int u=g->vertex[p];
	  stack[top++]=u;
	}
      }
    }
    ans=MAX(ans,dp[i]-1);
  }
  printf("%d\n",ans);
}

int main(void){
  run();
  return 0;
}


Measured memory_bytes: 1920
// 我是憨憨
#include <bits/stdc++.h>

const int MOD = 1e9 + 7, MAXN = 1e6 + 10;
inline int add(int x, int y) { return x + y >= MOD ? x + y - MOD : x + y; }
inline int sub(int x, int y) { return x < y ? x - y + MOD : x - y; }
inline int mul(int x, int y) { return 1LL * x * y - 1LL * x * y / MOD * MOD; }
inline int Qpow(int a, int b) { int ans = 1; for (; b; a = mul(a, a), b >>= 1) if (b & 1) ans = mul(ans, a); return ans; }
inline int inv(int a) { return Qpow(a, MOD - 2); }

int n, m, K;
int fac[MAXN], ifac[MAXN], pow3[MAXN];

inline void init() {
	fac[0] = 1;
	for (int i = 1; i < MAXN; ++i) fac[i] = mul(fac[i - 1], i);
	ifac[MAXN - 1] = inv(fac[MAXN - 1]);
	for (int i = MAXN - 2; ~i; --i) ifac[i] = mul(ifac[i + 1], i + 1);
	pow3[0] = 1;
	for (int i = 1; i < MAXN; ++i) pow3[i] = mul(pow3[i - 1], 3);
}
inline int binom(int n, int m) {
	if (n < m) return 0;
	return mul(fac[n], mul(ifac[m], ifac[n - m]));
}

int main() {
	scanf("%d%d%d", &n, &m, &K), init();
	if (m < K) std::swap(m, K);
	int ans = 0;
	for (int i = 0, sum = 1; i <= m + K; ++i) {
		ans = add(ans, mul(binom(i + n - 1, i), mul(pow3[m + K - i], sum)));
		if (i < K) sum = add(sum, sum);
		else if (i < m) sum = sub(add(sum, sum), binom(i, K));
		else sum = sub(add(sum, sum), add(binom(i, K), binom(i, m)));
	}
	printf("%d\n", ans);
	return 0;
}

Measured memory_bytes: 15528
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int[] num = new int[n];
        int k = Integer.MIN_VALUE;
        for (int i = 0; i < n; i++) {
            num[i] = in.nextInt();
            k = Math.max(k, num[i]);
        }
        int[] result = countingSort(num, k, n);
        StringBuilder builder = new StringBuilder();
        for (int i = 0; i < n; i++) {
            builder.append(result[i]);
            if (i < n - 1) builder.append(" ");
        }
        System.out.println(builder);
    }

    public static int[] countingSort(int[] num, int k, int n) {
        int[] c = new int[k + 1];
        int[] b = new int[n];
        for (int i = 0; i <= k; i++) {
            c[i] = 0;
        }
        for (int i = 0; i < n; i++) {
            c[num[i]]++;  // 统计每个num[i]的个数
        }
        for (int i = 1; i <= k; i++) {
            c[i] += c[i - 1];  // 统计num[i]在有序数组中的位置
        }
        for (int i = 0; i < n; i++) {
            b[c[num[i]] - 1] = num[i];  // 恢复num[i]在有序数组中的位置
            c[num[i]]--;  // 从c中移除该数
        }
        return b;
    }
}



Measured memory_bytes: 509128
#include <iostream>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <algorithm>
using namespace std;

int n;
long long a[200005];
long long sum[200005];
long long p[5];

int main(){
	scanf("%d", &n);
	sum[0] = 0;
	for(int i= 1; i <= n; i++){
		scanf("%lld", &a[i]);
		sum[i] = sum[i-1] + a[i]; 
	}
	long long l = 1, r = 3;
	long long Min = 0x7fffffff;
	memset(p ,0, sizeof(p));
	for(int i = 2; i < n-1 ; i++){
		while(l < i && abs( (sum[l]-sum[0]) - (sum[i]-sum[l]) ) >= abs( (sum[l+1]-sum[0]) - (sum[i]-sum[l+1]) ) ){
			l++;
		}
		while(r < n && abs( (sum[r]-sum[i]) - (sum[n]-sum[r]) ) >= abs( (sum[r+1]-sum[i]) - (sum[n]-sum[r+1]))){
			r++;
		}
		p[1] = sum[l]-sum[0];
		p[2] = sum[i]-sum[l];
		p[3] = sum[r]-sum[i];
		p[4] = sum[n]-sum[r];
		Min = min(Min, max(p[1], max(p[2], max(p[3], p[4])))-min(p[1], min(p[2], min(p[3], p[4]))));
	}	
	printf("%lld\n", Min);
return 0;
}

Measured memory_bytes: 3328
#include<stdio.h>

int main(void) {
  int a,b,c,d;
  scanf("%d %d %d %d",&a,&b,&c,&d);

  int A,B;
  A = a*b;
  B = c*d;
  if(A>B){
    printf("%d\n",A);
  } else {
    printf("%d\n",B);
  }

  return 0;
}

Measured memory_bytes: 128
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<ll,ll> P;
typedef pair<int,int> Pi;
#define rep(i, n) for (ll i = 0; i < n; i++)
#define FOR(i, a, b) for (ll i = a; i < b; i++)
#define fi first
#define se second
#define PI (acos(-1))

template<class T>
inline bool chmax(T &a, T b) {
    if(a < b) {
        a = b;
        return true;
    }
    return false;
}
template<class T>
inline bool chmin(T &a, T b) {
    if(a > b) {
        a = b;
        return true;
    }
    return false;
}
template<typename T> ostream& operator<<(ostream& s,const complex<T>& d) {return s<<"("<<d.real()<<", "<<d.imag()<< ")";}
template<typename T1, typename T2> ostream& operator<<(ostream& s,const pair<T1,T2>& d) {return s<<"("<<d.first<<", "<<d.second<<")";}
template<typename T> ostream& operator<<(ostream& s, const vector<T>& d){
	int len=d.size();
	rep(i,len){
		s<<d[i];if(i<len-1) s<<" ";
	}
	return s;
}
template<typename T> ostream& operator<<(ostream& s,const vector<vector<T>>& d){
	int len=d.size();
	rep(i,len){
		s<<d[i]<<endl;
	}
	return s;
}
template<typename T> ostream& operator<<(ostream& s,const set<T>& v){
	s<<"{ ";
	for(auto itr=v.begin();itr!=v.end();++itr) {
		if (itr!=v.begin()) {s<< ", ";}
		s<<(*itr);
	}
	s<<" }";
	return s;
}
template<typename T1, typename T2> ostream& operator<<(ostream& s,const map<T1,T2>& m){
	s<<"{"<<endl;
	for(auto itr=m.begin();itr!=m.end();++itr){
		s<<" "<<(*itr).first<<" : "<<(*itr).second<<endl;
	}
	s<<"}"<<endl;
	return s;
}

const ll mod=1e9+7;
const ll inf=1e15;

int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  ll n,t;
  cin>>n>>t;
  vector<P> g(n);
  vector<ll> a(n),b(n);
  rep(i,n) cin>>g[i].fi>>g[i].se;
  sort(begin(g),end(g));
  //cout<<g<<endl;
  rep(i,n){
	  a[i]=g[i].fi;
	  b[i]=g[i].se;
  }
  vector<vector<ll>> dp(n+1,vector<ll>(t+5000,-1));
  rep(i,n+1) dp[i][0]=0;
  rep(i,n){
	  rep(j,t+5000){
		  chmax(dp[i+1][j],dp[i][j]);
		if(dp[i][j]==-1) continue;
		if(j<t) chmax(dp[i+1][j+a[i]],dp[i][j]+b[i]);
	  }
  }
	//cout<<dp<<endl;
	ll ans=0;
	rep(j,t+5000) chmax(ans,dp[n][j]);
	cout<<ans<<endl;
}

Measured memory_bytes: 188160
#include <bits/stdc++.h>
#define FOR(i,a,b) for(ll i=(a);i<(b);++i)
#define rep(i,n) FOR(i,0,n)
#define all(x) (x).begin(),(x).end()
#define PRINT(V) cout << V << "\n"
#define SORT(V) sort((V).begin(),(V).end())
#define RSORT(V) sort((V).rbegin(), (V).rend())
using namespace std;
using ll = long long;
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
const ll mod = 1e9+7;
int brick[200005];
int main(){
    int n;
    cin >> n;
    rep(i,n) cin >> brick[i];
    int a = 1;
    rep(i,n){
        if (a == brick[i]){
            a++;
        }
    }
    if (a == 1) PRINT(-1);
    else{
        PRINT(n-a+1);
    }
}


Measured memory_bytes: 1024
#include <bits/stdc++.h>
using namespace std;
//#define cerr if (false) cerr
#define db(x) cerr << #x << "=" << x << endl
#define db2(x, y) cerr << #x << "=" << x << "," << #y << "=" << y << endl
#define db3(x, y, z) cerr << #x << "=" << x << "," << #y << "=" << y << "," << #z << "=" << z << endl
#define dbv(v) cerr << #v << "="; for (auto _x : v) cerr << _x << ", "; cerr << endl
#define dba(a, n) cerr << #a << "="; for (int _i = 0; _i < (n); ++_i) cerr << a[_i] << ", "; cerr << endl
template <typename A, typename B>
ostream& operator<<(ostream& os, const pair<A, B>& x) {
	return os << "(" << x.first << "," << x.second << ")";
}
typedef long long ll;
typedef long double ld;
int main() {
	int a, b, c, k, need = 0;
	scanf("%d%d%d%d", &a, &b, &c, &k);
	while (b <= a) {
		b *= 2;
		++need;
	}
	while (c <= b) {
		c *= 2;
		++need;
	}
	printf(need <= k ? "Yes\n" : "No\n");
}


Measured memory_bytes: 3768
#![allow(non_snake_case)]
#![allow(unused_imports)]
 
use proconio::{input, fastout};
use proconio::marker::*;
use whiteread::parse_line;
use std::collections::*;

#[fastout]
fn main() {
    input!{
        S: String,
        T: String,
    }

    if S == T[0..S.len()] {
        println!("Yes")
    } else {
        println!("No")
    }
}


Measured memory_bytes: 2180
#define _USE_MATH_DEFINES
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <deque>
#include <queue>
#include <set>
#include <functional>
#include <cmath>
#include <set>
#include <map>


//マクロ
#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 RREP(i,n) for(int i=(int)(n)-1; i>=0; --i)
#define RREPS(i,n) for(int i=(int)(n); i>0; --i)
#define FOR(i,s,e) for(int i=(int)(s); i<(int)(e); ++i)
#define RFOR(i,s,e) for(int i=(int)(e)-1; i>=(int)(s); --i)
#define All(a) (a).begin(),(a).end()
#define RAll(a) (a).rbegin(),(a).rend()
#define dump(x)  cerr << #x << " = " << (x) << endl;

//定数
#define INF 1e9
#define INFL 1e18
#define MOD (int)(1e9+7)

typedef long long ll;
typedef unsigned long long ull;
using namespace std;
using vi = vector<int>;
using vii = vector<vi>;
using vs = vector<string>;
using pii = pair<int, int>;
using Graph = vector<vector<int>>;

//とりあえず書いておく変数
int dx[4] = { 1,0,-1,0 };
int dy[4] = { 0,1,0,-1 };

//今回の変数

//使用する関数
template<class T>bool chmax(T &a, const T &b) {
	if (a < b) { a = b; return 1; }
	return 0;
}
template<class T>bool chmin(T &a, const T &b) {
	if (a > b) { a = b; return 1; }
	return 0;
}

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

	int h, w, k;
	cin >>h >> w >> k;

	vii c = vii(h);
	REP(i, h) {
		c[i] = vi(w,0);
	}
	REP(i, h) {
		string s;
		cin >> s;
		REP(j, w) {
			if (s[j] == '#')c[i][j] = 1;
		}
	}

	int ans = 0;
	int sh = 0, sw = 0;
	while (sh < (1 << h)) {
		sw = 0;
		while (sw < (1 << w)) {
			int cnt = 0;
			REP(i, h) {
				REP(j, w) {
					if (c[i][j] == 1) {
						//cout << ((1 << i)) << " " << ((1 << j)) << endl;
						//cout << ((1 << i)&sh) << " " << ((1 << j)&sw) << endl;
						if (((1 << i)&sh) == 0 && ((1 << j)&sw) == 0)cnt++;
					}
				}
				//cout << endl;
			}
			//cout << "cnt=" << cnt << endl;
			if (cnt == k) {
				ans++;
			}
			sw++;
		}
		sh++;
	}
	cout << ans << endl;
}

Measured memory_bytes: 3592
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
//cout << fixed << setprecision(17) << res << endl;
 
int main() {
    ll s, w;
    cin >> s >> w;
    if (s > w) {
        cout << "safe" << endl;
    } else {
        cout << "unsafe" << endl;
    }
}


Measured memory_bytes: 3592
s = int(input())

def f(n):
    if n%2 == 0:
        return n/2
    else:
        return 3*n + 1

a = [s]
i = 0
while True:
    sex = f(a[i])
    i = i+1
    if sex in a:
        break
    a.append(sex)

print(i + 1)


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

int main(){
    int a, ans = 0;
    cin >> a;
    
    vector<int> V(a);
    vector<int> C(a);

    for(int i = 0; i < a; i++){
        cin >> V.at(i);
    }
    
    for(int i = 0; i < a; i++){
        cin >> C.at(i);
    }

    for(int i = 0; i < a; i++){
        if(V.at(i) > C.at(i)){
            ans += ( V.at(i) - C.at(i));
        }
    }
    cout << ans;
}

Measured memory_bytes: 256
#include<iostream>
using namespace std;
int main(){
	int n, D[100][6] = {}, count=0,dice[6][7] = { {1,2,4,3,1,2,4},{0,3,5,2,0,3,5},{0,1,5,4,0,1,5},{0,4,5,1,0,4,5},{0,2,5,3,0,2,5},{1,3,4,2,1,3,4} };
	cin >> n;
	for (int i = 0; i < n; i++) {
		cin >> D[i][0] >> D[i][1] >> D[i][2] >> D[i][3] >> D[i][4] >> D[i][5];
	}
	for (int i = 0; i < n; i++) {
		for (int j = i + 1; j < n; j++) {
			int a = 0;
			while (true) {
				if (D[j][0] == D[i][a]) break;
				a += 1;
				if (a == 6) break;
			}
			if (a == 6) {
				break;
				count += 1;
			}
			
			int b = 0;
			while (true) {
				if (D[j][1] == D[i][b]) break;
				b += 1;
				if (b == 6) break;
			}
			if (b == 6) {
				break;
				count += 1;
			}
			int d = 0;
			while (true) {
				if (D[j][2] == D[i][d]) break;
				d += 1;
				if (d == 6) break;
			}
			if (d == 6) {
				break;
				count += 1;
			}
			int e = 0;
			while (true) {
				if (D[j][3] == D[i][e]) break;
				e += 1;
				if (e == 6) break;
			}
			if (e == 6) {
				break;
				count += 1;
			}
			int f = 0;
			while (true) {
				if (D[j][4] == D[i][f]) break;
				f += 1;
				if (f == 6) break;
			}
			if (f== 6) {
				break;
				count += 1;
			}
			int g = 0;
			while (true) {
				if (D[j][5] == D[i][g]) break;
				g += 1;
				if (g == 6) break;
			}
			if (g == 6) {
				break;
				count += 1;
			}
			int c = 0;
			while (true) {
				if (dice[a][c] == b) break;
				c += 1;
			}
			
			if (D[i][dice[a][c + 1]] == D[j][2] && D[i][dice[a][c + 3]] == D[j][3] && D[i][dice[a][c + 2]] == D[j][4] ) {
				count += 1;
			}
		}
	}
	if (count > 0) cout << "No" << endl;
	else {
		cout << "Yes" << endl;
	}
	return 0;

}





Measured memory_bytes: 3096
#include <iostream>
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <cassert>
#include <climits>
#include <algorithm>
#include <string>
#include <sstream>
#include <complex>
#include <vector>
#include <list>
#include <queue>
#include <deque>
#include <stack>
#include <map>
#include <set>
#include <fstream>

using namespace std;
#define SZ(x) (int)(x).size()
#define REP(i,n) for(int i=0;i<(n);i++)
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define REPR(i,n) for(int i=(n)-1;i>=0;i--)
#define ALL(s) (s).begin(), (s).end()
#define so(V) sort(ALL(V))
#define rev(V) reverse(ALL(V))
#define uni(v) v.erase( unique(ALL(v)) , v.end());

typedef long long unsigned int llu;
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<bool> vb;
const double EPS = 1e-9;
const int MOD = 1e9 + 7;
const int INF = (1 << 29);
const ll LINF = 1e18;
const double PI = acos(-1);

template<typename T>vector<T> make_v(size_t a) { return vector<T>(a); }
template<typename T, typename... Ts>auto make_v(size_t a, Ts... ts) { return vector<decltype(make_v<T>(ts...))>(a, make_v<T>(ts...)); }
template<typename T, typename U, typename... V>
typename enable_if<is_same<T, U>::value != 0>::type
fill_v(U& u, const V... v) { u = U(v...); }
template<typename T, typename U, typename... V>
typename enable_if<is_same<T, U>::value == 0>::type
fill_v(U& u, const V... v) { for (auto& e : u) fill_v<T>(e, v...); }
template<class T> bool chmax(T & a, const T & b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> bool chmin(T & a, const T & b) { if (a > b) { a = b; return 1; } return 0; }

int main() {
	cin.tie(0);
	ios::sync_with_stdio(false);
	int N, K;
	string S;
	cin >> N >> S >> K;
	K--;
	char c = S[K];
	REP(i, N) {
		if (S[i] != c)S[i] = '*';
	}
	cout << S << endl;
	return 0;
}


Measured memory_bytes: 256
#include <algorithm>
#include <bitset>
#include <cmath>
#include <functional>
#include <iomanip>
#include <iostream>
#include <limits>
#include <map>
#include <queue>
#include <set>
#include <tuple>
#include <vector>

using namespace std;

#define rep(i, n) for (int64_t i = 0; i < (int64_t)(n); i++)
#define irep(i, n) for (int64_t i = 0; i <= (int64_t)(n); i++)
#define rrep(i, n) for (int64_t i = (n)-1; i >= 0; i--)
#define rirep(i, n) for (int64_t i = n; i >= 0; i--)

int main() {
  int64_t A, V;
  int64_t B, W;
  int64_t T;
  cin >> A >> V >> B >> W >> T;

  B -= A;
  B = abs(B);

  if (B + T * W <= T * V) {
    cout << "YES\n";
  } else {
    cout << "NO\n";
  }
  return 0;
}

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

using namespace std;
int dy[] = {1,0,-1,0};
int dx[] = {0,-1,0,1};
struct A{
  int n;
  vector<vector<bool> > a;
  A(int _n){
    n = _n;
    a.resize(n);
    for(auto &e : a)e.resize(n);
  }

  void rotate(){
    int r,c,s,angle;
    cin >> r >> c >> s >> angle;
    r--;c--;
    auto temp = a;
    switch(angle){
      case 0:
      case 360:
        return;
      case 90:
        for(int i = 0 ;i < s; i++){
          for(int j = 0; j < s; j++){
            temp[i+r][j+c] = a[r+s-j-1][i+c];
          }
        }
        break;
      case 180:
        for(int i = 0 ;i < s; i++){
          for(int j = 0; j < s; j++){
            temp[i+r][j+c] = a[r+s-i-1][c+s-j-1];
          }
        }
        break;
      case 270:
        for(int i = 0 ;i < s; i++){
          for(int j = 0; j < s; j++){
            temp[i+r][j+c] = a[r+j][c+s-i-1];
          }
        }
        break;
    }
    swap(temp,a);
  }
  void invert(){
    int r,c,s; cin >> r >> c >> s;
    r--;c--;
    for(int i = r; i < r+s; i++)for(int j = c; j < c+s; j++)
      a[i][j] = !a[i][j];
  }
  void left(){
    int r; cin >> r;
    r--;
    auto temp = a;
    for(int i = 0; i < n; i++){
      temp[r][i] = a[r][(i+1)%n];
    }
    swap(temp,a);
  }
  void right(){
    int r; cin >> r;
    r--;
    auto temp = a;
    for(int i = 0; i < n; i++){
      temp[r][i] = a[r][(i+n-1)%n];
    }
    swap(temp,a);
  }
  void Irev(){
    int r,c; cin >> r >> c;
    r--;c--;
    bool t = a[r][c];
    irev(r,c,t);
  }
  void irev(int r, int c, bool t){
    for(int i = 0; i < 4; i++){
      int nr = r+dy[i], nc = c+dx[i];
      //if(nr < 0 || nr >= n || nc < 0 || nc >= n)continue;
      if(nr >= 0 && nr < n && nc >= 0 && nc < n){
        if(a[nr][nc] != t) continue; 
        a[nr][nc] = !t;
        irev(nr, nc, t);
      }
    }
  }
};




int main(){
  int n,m; cin >> n >> m;
  A a(n);
  for(int i = 0; i < n; i++)for(int j = 0; j < n; j++){
    int t;
    cin >> t;
    a.a[i][j] = (t == 1);
  }
  for(int i = 0; i < m; i++){
    int ope; cin >> ope;
    switch(ope){
      case 0:
        a.rotate();
        break;
      case 1:
        a.invert();
        break;
      case 2:
        a.left();
        break;
      case 3:
        a.right();
        break;
      case 4:
        a.Irev();
        break;
    }
  }
  for(int i = 0; i < n; i++){
    for(int j = 0; j < n; j++){
      if(j != 0)cout << " ";
      cout << a.a[i][j];
    }
    cout << endl;
  }
  return 0;
} 


Measured memory_bytes: 3116
#include<bits/stdc++.h>
#define int long long
#define mod 1000000007
#define trace(x) cerr<<#x<<": "<<x<<" "<<endl
#define tarce(x) cerr<<#x<<": "<<x<<" "<<endl
#define trace2(x, y) cerr<<#x<<": "<<x<<" | "<<#y<<": "<<y<<endl
#define trace3(x, y, z) cerr<<#x<<":" <<x<<" | "<<#y<<": "<<y<<" | "<<#z<<": "<<z<<endl
#define trace4(a, b, c, d) cerr<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<endl
#define sa(a,n) for(int i =0 ; i<n ; i++) cin>>a[i]
#define max3(a,b,c) max(a,max(b,c))
#define min3(a,b,c) min(a,min(b,c))
#define pb push_back
#define inf 2e18
#define scan() int n; cin>>n ; int a[n]; for(int i = 0 ; i<n ; i++) cin>>a[i]
#define print(a,n) for(int i = 0 ; i < n ; i++) cout<<a[i]<<' '
#define mem(a,v) memset(a,v,sizeof(a))
#define pii pair<int,int>
#define mkp make_pair
using namespace std;
#define N 200005


int32_t main(){
        ios_base::sync_with_stdio(false);
        cin.tie(NULL);
        cout.tie(NULL);
  
  int n;
  cin >> n;
  for(int i=1; i<=9; i++){
    if(n%i==0 && n/i <=9){
    cout << "Yes";
      return 0;
    }
  }
     cout << "No";     

}


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

using namespace std;



int main(){


	int n, k, q; cin >> n >> k >> q;

	vector <int> count(n);


	int a;
	for(int i = 0; i < q; i++){
		cin >> a;
		count[a - 1]++;
	}



	for(int i = 0; i < n; i++){
		cout << (k - q + count[i] > 0 ? "Yes" : "No") << endl;
	}






	return 0;
}

Measured memory_bytes: 1024
# -*- coding: utf-8 -*-

from collections import Counter

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

c = Counter(a)

st = set()
for key in c.keys():
    for i in (-1, 0, 1):
        st.add(key + i)

ans = 0
for x in st:
    cnt = c[x-1] + c[x] + c[x+1]
    ans = max(ans, cnt)

print(ans)


Measured memory_bytes: 20944
#include <stdio.h>

int K, N;
int A[271828];

int main(void) {
	int i;
	int nakazimamegumi;
	if (scanf("%d%d", &K, &N) != 2) return 1;
	for (i = 0; i < N; i++) {
		if (scanf("%d", &A[i]) != 1) return 1;
	}
	nakazimamegumi = (K - A[N - 1]) + A[0];
	for (i = 1; i < N; i++) {
		int hayamisyou = A[i] - A[i - 1];
		if (hayamisyou > nakazimamegumi) nakazimamegumi = hayamisyou;
	}
	printf("%d\n", K - nakazimamegumi);
	return 0;
}


Measured memory_bytes: 896
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>

using namespace std;

int dp[105][105];

int main() {
	int n, m;
	cin >> n >> m;
	vector<string> mat(n);
	for (int i = 0; i < n; i++) {
		cin >> mat[i];
	}
	if (mat[0][0] == '.')
		dp[0][0] = 0;
	else
		dp[0][0] = 1;
	for (int i = 0; i < n; i++) {
		for (int j = 0; j < m; j++) {
			if (i == 0 && j == 0)
				continue;
			int res1 = 305, res2 = 305;
			if (i > 0) {
				res1 = dp[i - 1][j];
				if (mat[i][j] == '#' && mat[i][j] != mat[i - 1][j])
					res1++;
			}
			if (j > 0) {
				res2 = dp[i][j - 1];
				if (mat[i][j] == '#' && mat[i][j - 1] != mat[i][j])
					res2++;
			}
			dp[i][j] = min(res1, res2);
		}
	}
	cout << dp[n - 1][m - 1] << endl;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for(int i = 0; i < (n); i++)
#define rep1(i, n) for(int i = 1; i <= (n); i++)
#define co(x) cout << (x) << "\n"
#define cosp(x) cout << (x) << " "
#define ce(x) cerr << (x) << "\n"
#define cesp(x) cerr << (x) << " "
#define pb push_back
#define mp make_pair
#define Would
#define you
#define please


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


	int N;
	cin >> N;
	int RR = -1e9;
	int RL = -1e9;
	int RUD = -1e9;
	int LR = 1e9;
	int LL = 1e9;
	int LUD = 1e9;
	int UU = -1e9;
	int UD = -1e9;
	int URL = -1e9;
	int DU = 1e9;
	int DD = 1e9;
	int DRL = 1e9;
	bool R = false;
	bool L = false;
	bool U = false;
	bool D = false;

	rep(i, N) {
		int x, y;
		char d;
		cin >> x >> y >> d;

		if (d == 'R') {
			R = true;
			RR = max(RR, x);
			LR = min(LR, x);
			URL = max(URL, y);
			DRL = min(DRL, y);
		}
		else if (d == 'L') {
			L = true;
			RL = max(RL, x);
			LL = min(LL, x);
			URL = max(URL, y);
			DRL = min(DRL, y);
		}
		else if (d == 'U') {
			U = true;
			RUD = max(RUD, x);
			LUD = min(LUD, x);
			UU = max(UU, y);
			DU = min(DU, y);
		}
		else {
			D = true;
			RUD = max(RUD, x);
			LUD = min(LUD, x);
			UD = max(UD, y);
			DD = min(DD, y);
		}
	}

	vector<double> kouho;
	kouho.pb(0);

	if (R && L) {
		kouho.pb(0.5 * (RL - RR));
		kouho.pb(0.5 * (LL - LR));
	}
	if (R && (U || D)) {
		kouho.pb(RUD - RR);
		kouho.pb(LUD - LR);
	}
	if (L && (U || D)) {
		kouho.pb(RL - RUD);
		kouho.pb(LL - LUD);
	}
	if (U && D) {
		kouho.pb(0.5 * (UD - UU));
		kouho.pb(0.5 * (DD - DU));
	}
	if (U && (R || L)) {
		kouho.pb(URL - UU);
		kouho.pb(DRL - DU);
	}
	if (D && (R || L)) {
		kouho.pb(UD - URL);
		kouho.pb(DD - DRL);
	}

	double saishou = 1e20;
	for (double D : kouho) {
		if (D >= 0) {
			double Xmax = max({ RR + D, RL - D, (double)RUD });
			double Xmin = min({ LR + D, LL - D, (double)LUD });

			double Ymax = max({ UU + D, UD - D, (double)URL });
			double Ymin = min({ DU + D, DD - D, (double)DRL });

			saishou = min(saishou, (Xmax - Xmin) * (Ymax - Ymin));
		}
	}
	
	cout << fixed << setprecision(12) << saishou << endl;

	Would you please return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef vector< int > vi;
typedef vector< vi > vvi;
typedef vector< long long > vll;
typedef pair< int,int > ii;
typedef long long ll;
#define fast_cin() ios_base::sync_with_stdio(0); cin.tie(0);
#define F first
#define S second
#define mp make_pair
#define rep(i,n) for (int i = 0; i < int(n); i++)
#define rrep(i, n) for (int i = n-1; i>=0 ; i--)
#define mem(a) memset(a,0,sizeof(a))
#define sz(a) int(a.size())
#define pb push_back
#define all(c) c.begin(),c.end()
#define tr(container,it) for(auto it=container.begin();it!=container.end();it++)
#define present(container, element) (container.find(element) != container.end())
#define vpresent(container, element) (find(all(container),element) != container.end()) //for vectors
 
int main()
{
    /*#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout); 
    #endif*/
    fast_cin();
    int n;cin>>n;
    int o=(n%2)?ceil((double)n/2):floor((double)n/2);
    double p=(double)o/n;
    cout<<fixed<<setprecision(10)<<p;
    return 0;
}

Measured memory_bytes: 256
#include <algorithm>
#include <bitset>
#include <cassert>
#include <cctype>
#include <chrono>
#define _USE_MATH_DEFINES
#include <cmath>
#include <cstdio>
#include <cstring>
#include <ctime>
#include <deque>
#include <functional>
#include <iostream>
#include <iterator>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <string>
#include <tuple>
#include <utility>
#include <vector>
using namespace std;

#define FOR(i,m,n) for(int i=(m);i<(n);++i)
#define REP(i,n) FOR(i,0,n)
#define ALL(v) (v).begin(),(v).end()

const int INF = 0x3f3f3f3f;
const long long LINF = 0x3f3f3f3f3f3f3f3fLL;
const double EPS = 1e-8;
const int MOD = 1000000007; // 998244353;
const int dy[] = {1, 0, -1, 0}, dx[] = {0, -1, 0, 1};
/*-------------------------------------------------*/
int main() {
  cin.tie(0); ios::sync_with_stdio(false);
  // freopen("input.txt", "r", stdin);

  int n; long long k; cin >> n >> k;
  vector<int> a(n); REP(i, n) cin >> a[i];
  vector<int> cnt(2001, 0);
  REP(i, n) ++cnt[a[i]];
  long long ans = 0;
  REP(i, n) {
    long long l = 0, r = 0;
    REP(j, i) {
      if (a[j] > a[i]) ++l;
    }
    FOR(j, i + 1, n) {
      if (a[j] > a[i]) ++r;
    }
    long long tmp = (k * (k + 1) / 2) % MOD;
    (ans += l * tmp % MOD) %= MOD;
    (tmp = (k * (k - 1) / 2)) %= MOD;
    (ans += r * tmp % MOD) %= MOD;
  }
  cout << ans << '\n';
  return 0;
}


Measured memory_bytes: 256
import kotlin.math.max
import kotlin.math.min

fun main(args: Array<String>) = tokiomarine2020c()

fun tokiomarine2020c() {
    val (n, k) = readLine()!!.split(' ').map { it.toInt() }
    val aList = readLine()!!.split(' ').map { it.toInt() }

    var curr = aList.toIntArray()

    repeat(min(k, 50)) {
        val imos = IntArray(n + 1)

        curr.withIndex().forEach { (index, value) ->
            imos[max(index - value, 0)]++
            imos[min(index + value + 1, n)]--
        }

        for (i in 0 until n - 1) imos[i + 1] += imos[i]

        curr = imos.dropLast(1).toIntArray()
    }

    val answer = curr.joinToString(" ")

    println(answer)
}


Measured memory_bytes: 90012
n,m,q=map(int,input().split())
abcd=[list(map(int,input().split())) for _ in range(q)]
# dfsで数列を生成
def dfs():
  todo=[[]]
  ret=[]
  while len(todo)>0:
    t=todo.pop()
    if len(t)==n:
      ret.append(t)
    else:
      l=t[-1] if len(t)>0 else 1
      for i in range(l,m+1):
        tc=t.copy()
        tc.append(i)
        todo.append(tc)
  return ret
def point(s):# 数列sに対する特典
  ret=0
  for a,b,c,d in abcd:
    if s[b-1]-s[a-1]==c:
      ret+=d
  return ret
a=dfs()
ans=0
for ai in a:
  ans=max(ans,point(ai))
print(ans)


Measured memory_bytes: 28596
import java.io.*;

class Main {
	public static void main(String args[]) {
		try {
			BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
			String t[], s;
			double a[] = new double[6];
			while((s = reader.readLine())  != null) {
				t = s.split(" ");
				for(int i = 0;i < a.length;i++) {
					a[i] = Double.parseDouble(t[i]);
				}
				double z = a[0]*a[4]-a[1]*a[3];
				double x = (a[4]*a[2]-a[1]*a[5])/z;
				double y = (-a[3]*a[2]+a[0]*a[5])/z;

				if(x == -0.0)
					x = 0.0;
				if(y == -0.0)
					y = 0.0;
				System.out.printf("%4.3f %4.3f\n", x, y);

			}

		}
		catch(IOException e) {
			System.out.println(e);
		}
	}
}

Measured memory_bytes: 16976
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <string>
#include <sstream>
#include <complex>
#include <vector>
#include <list>
#include <queue>
#include <deque>
#include <stack>
#include <map>
#include <set>
using namespace std;
int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);    
    int n;
    cin>>n;
    int a;
    bool flag=true;
    for(int i=0;i<n;i++){
        cin>>a;
        if(a%2==0&&(a%3!=0&&a%5!=0)){
            flag=0;
            break;
        }
    }
    if(flag){
        cout<<"APPROVED";
    }else{
        cout<<"DENIED";
    }

}

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <cmath>
#include <iomanip>
#include <stack>
#include <queue>
#include <numeric>
#include <map>
#include <unordered_map>
#include <set>
#include <fstream>
#include <chrono>
#include <random>
#include <bitset>
#define rep(i,n) for(int i=0;i<(n);i++)
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
#define sz(x) ((int)(x).size())
#define pb push_back
using ll = long long;
using namespace std;
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
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;}

int main(){
  int N; cin >> N;
  vector<ll> A(N); rep(i,N) cin >> A[i];
  vector<ll> B(N+1,0);
  rep(i,N) B[i+1] = gcd(B[i],A[i]);
  vector<ll> C(N+1,0);
  rep(i,N) C[N-i-1] = gcd(C[N-i],A[N-i-1]);

  ll ans = 0;
  rep(i,N) {
    //cout << B[i] << " " << C[i+1] << endl;
    chmax(ans, gcd(B[i],C[i+1]));
  }
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 5632
#include <stdio.h>

int main(){
  int n, u, k, v, g[101][101] = {}, i, j;

  scanf("%d", &n);
  for(i = 0; i < n; ++i){
    scanf("%d%d", &u, &k);
    for(j = 0; j < k; ++j){
      scanf("%d", &v);
      g[u-1][v-1] = 1;
    }
  }
  for(i = 0; i < n; ++i){
    for(j = 0; j < n; ++j) printf(j != 0 ? " %d" : "%d", g[i][j]);
    puts("");
  }

  return 0;
}

Measured memory_bytes: 660
using System;

namespace bla2
{
    class Program
    {
        static void Main()
        {
            string[] s = Console.ReadLine().Split();
            int a = int.Parse(s[0]);
            int b = int.Parse(s[1]);
            if(a <= 8 && b <= 8)
            {
                Console.WriteLine("Yay!");
            }
            else
            {
                Console.WriteLine(":(");
            }
        }
    }
}


Measured memory_bytes: 11092
#include <cstdio>
#include <iostream>
#include <iomanip>
#include <string>
#include <cmath>
#include <algorithm>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <tuple>

using namespace std;
typedef long long ll;

#define MAX_N 100000
int A[MAX_N];

int gain[MAX_N];


int main() {

  cin.tie(nullptr);
  ios::sync_with_stdio(false);

  // input
  int N, T;
  cin >> N >> T;

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

  int count = 0;
  int max_gain = 0;
  int min_val = 1000000000;
    
  for (int i = 0; i < N; i++) {

    int gain = A[i] - min_val;
    
    if (gain > 0) {

      if (gain > max_gain) {
	count = 1;
	max_gain = gain;
      }
      else if (gain == max_gain) {
	count++;
      }
    }

    // update min
    min_val = min(A[i], min_val);
    
  }

  cout << count << endl;
  
  return 0;
  
}





Measured memory_bytes: 640
#include <iostream>
#define MAX_n 10000
#define MAX_q 500

int main(){
    int x;
    int n, q;
    int S[MAX_n], T[MAX_q];

    std::cin >> n;
    for(int i=0; i<n; i++){
        std::cin >> x;
        S[i] = x;
    }
    
    std::cin >> q;
    for(int i=0; i<q; i++){
        std::cin >> x;
        T[i] = x;
    }

    int cnt = 0;
    for(int i=0; i<q; i++){
        for(int j=0; j<n; j++){
            if(S[j] == T[i]){
                cnt += 1;
                break;
            }
        }
    }

    std::cout << cnt << '\n';

    return 0;
}


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

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

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

  int previous = -1;
  for (int i = 0; i < N; i++) {
    if (previous <= H[i] - 1) {
      previous = H[i] - 1;
    } else if (previous <= H[i]) {
      previous = H[i];
    } else {
      puts("No");
      return 0;
    }
  }

  puts("Yes");
}

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

signed main(){

    int n; cin >> n;
    set<int> s;
    vector<int> b(n);
    int ans = 0;
    for(int i = 0; i < n; i++){
        int a; cin >> a;
        a--;
        b[a] = i;
    }

    s.insert(-1);
    s.insert(n);

    for(int i = 0; i < n; i++){
        
        auto nx = s.upper_bound(b[i]);
        auto pr = nx;
        pr--;
        ans += (i + 1) * (*nx - b[i]) * (b[i] - *pr);
        s.insert(b[i]);
    }

    cout << ans << endl;

    return 0;
    
}

Measured memory_bytes: 11136
package main
import (
  "fmt"
  "bufio"
  "os"
  "strconv"
  "math"
)
 
func main(){
  var n,h,m_i int
  var t,a,s,m_s float64
  m_s = 99999
  fmt.Scanf("%d",&n)
  fmt.Scanf("%f%f",&t,&a)

  var sc = bufio.NewScanner(os.Stdin)
  sc.Split(bufio.ScanWords)

  for i:=0;i<n;i++ {
    sc.Scan()
    h,_ = strconv.Atoi(sc.Text())
    s =  t - float64 (h) * 0.006
    s = math.Abs(a - s)
    if m_s > s{
      m_i = i
      m_s = s
    }
  }
    fmt.Println(m_i+1)
}



Measured memory_bytes: 640
n = int(input())
l = [[0,0] for i in range(n)]
for i in range(n):
    a,b = map(int,input().split())
    l[i][0],l[i][1] = b,a
l.sort()
c = 0
for i in range(n):
    c += l[i][1]
    if c <= l[i][0]:
        continue
    else:
        break
if i == n-1 and c <=l[i][0]:
    print('Yes')
else:
    print('No')

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

int main() {

    long long int N, K; cin >> N >> K;
    long long int ans;
    ans =  (long long int) K * pow((K-1),(N-1));
    printf("%lld\n",ans);
    return 0;
}

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

int main(){   
    char x[255];
    char y[26];
    scanf("%s",x);
    int a= strlen(x);  
    for(int i=0;i<26;i++){
        y[i] = 0;
    }   
    for(int i=0;i<a;i++){
        if(x[i] >= 'a' && x[i] <= 'z'){
       printf("a");
        }
        if(x[i] >= 'A' && x[i] <= 'Z')
        printf("A");
    }   
    return 0;
}

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

typedef long long ll;

#define REP(i,n) for(long long i=0;i<(n); i++)
#define REP1(i,n) for(long long i=1;i<=(n);i++)



int main(){
	char a;
	cin>>a;
	map<char,char> mp;
	mp['A']='T';
	mp['C']='G';
	mp['G']='C';
	mp['T']='A';
	cout<<mp[a];
	 
    return 0;

}


Measured memory_bytes: 764
#include <iostream>
using namespace std;
int main(void){
    int n,m,i,j,sum;
    int A[200][200]={{0}};
    int B[200]={0};
    cin >> n >> m;
    for(i=0;i<n;i++){
        for(j=0;j<m;j++){
            cin >> A[i][j];
        }
    }
    for(j=0;j<m;j++){
        cin >> B[j];
    }
    for(i=0;i<n;i++){
        sum=0;
        for(j=0;j<m;j++){
            sum=sum+A[i][j]*B[j];
        }cout << sum;
        cout << endl;
    }
}


Measured memory_bytes: 3264
#include <bits/stdc++.h>
using namespace std;
//typedef
typedef long long ll;
typedef vector<int> vi;
typedef vector<string> vs;
//define
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)
////////////////////////////////////////////////////////////////////
using namespace std ;

int main(){
  ll x,a = 100,b;
  cin >> x;

  REP(i,pow(10,18)){
    a= a + (a/100);
    if(x <= a){
      b=i+1;
      cout << b << endl;
      break;
    }
  }
  return 0;
}

Measured memory_bytes: 3592
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        StringBuilder sb = new StringBuilder(sc.next());
        int count = sc.nextInt();

        for(int i = 0; i < count; i++) {
        	String order = sc.next();
        	int a = sc.nextInt();
    		int b = sc.nextInt();

        	switch(order) {
        	case "print":
        		 System.out.println(sb.substring(a, b+1));;
        		break;
        	case "reverse":
        		String rev = new StringBuilder(sb.substring(a, b+1)).reverse().toString();
        		sb.replace(a, b+1, rev);
        		break;
        	case "replace":
        		String rep = sc.next();
        		sb.replace(a, b+1, rep);
        		break;
        	}
        }
    }
}


Measured memory_bytes: 29456