akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
#ifdef __LOCAL
    #define DBG(X) cout << #X << " = " << (X) << endl;
    #define SAY(X) cout << (X) << endl;
    #include <filesystem>
    namespace fs = std::filesystem;
#else
    #define DBG(X)
    #define SAY(X)
#endif

using namespace std;

using ll = long long int;
using ull = unsigned long long int;
using ld = long double;
using pii = pair<int, int>;
using pll = pair<ll, ll>;

int dx[]={1, 0, -1, 0, 1,-1, 1,-1};
int dy[]={0, 1, 0, -1, 1, 1,-1,-1};
const int INT_INF = (int)(2e9);
const ll  LL_INF = (ll)(2e18);
static mt19937 _g(time(nullptr));
 
inline ll randint(ll a, ll b) { ll w = (_g() << 31LL) ^ _g(); return a + w % (b - a + 1); }
inline void fast_io() { ios_base::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr); };
template<typename T, typename S> inline ostream& operator<<(ostream& os, const pair<T, S> p) { cout << "[" << p.first << ";" << p.second << "]"; return os; }
template<typename T, typename S> inline ostream& operator<<(ostream& os, const map<T, S> p) { for (auto el : p) cout << "[" << el.first << ";" << el.second << "]"; return os; }
template<typename T> inline ostream& operator<<(ostream& os, const vector<T>& v) { for (auto el : v) cout << el << " "; return os; }
template<typename T> inline vector<T> fetch_vec(int sz) { vector<T> ret(sz); for (auto& elem : ret) cin >> elem; return ret; }

int H,W,D;
vector<vector<int>> A;
unordered_map<int,pii> Locate;
int Q;
vector<int> L,R;

void input(){
    fast_io();
    #ifdef __LOCAL
        fs::path __p = __FILE__;
        fs::path __input, __output;
        __input = __output = __p.parent_path();
        __input += string("/input/") + string(__p.stem()) + string(".txt");
        __output += string("/output/") + string(__p.stem()) + string(".txt");
        freopen(__input.c_str(), "r", stdin);
        freopen(__output.c_str(), "w", stdout);
    #endif
    cin >> H >> W >> D;
    A.assign(H,vector<int>(W,0));
    for (int i = 0; i < H; i++)
    {
        for (int j = 0; j < W; j++)
        {
            cin >> A[i][j];
            Locate[A[i][j]] = make_pair(i,j);
        }
    }
    cin >> Q;
    for (int i = 0; i < Q; i++)
    {
        int l,r; cin >> l >> r;
        L.push_back(l);
        R.push_back(r);
    }
    
}

int consume_magic(pii a, pii b){
    return abs(a.first-b.first)+abs(a.second-b.second);
}

int solve(){
    vector<int> ASUM(H*W+10,0);
    for (int d = 1; d <= D; d++)
    {
        ASUM[d] = 0;
        for (int j = d; (j+D) <= H*W; j+=D)
        {
            ASUM[j+D] = ASUM[j] + consume_magic(Locate[j],Locate[j+D]);
        }
    }

    for (int i = 0; i < Q; i++)
    {
        int ans = ASUM[R[i]] - ASUM[L[i]];
        cout << ans << "\n"; 
    }
    
     
    return 0;
}   

int main()
{
    input();
    solve();
    return 0;
}


Measured memory_bytes: 6564
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  string N;
  cin >> N;
 
  if (N[0] == N[1] && N[1] == N[2]){
    cout << "Yes" << endl;
  }
  else if(N[1] == N[2] && N[2] == N[3]) {
    cout << "Yes" << endl;
  }
  else{
    cout << "No" << endl;
}
 }

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

using namespace std;
using ll = long long;

int main() {
	string n, s, ans = "No";
	cin >> n >> s;
	if(n == s.substr(0,n.size()))ans = "Yes";
	cout << ans << endl;
	return 0;
}


Measured memory_bytes: 3628
#include<bits/stdc++.h>
using namespace std;
#define LL long long
#define mp make_pair
#define pb push_back
#define pii pair<int,int>
#define pll pair<LL,LL>
#define x first
#define y second
#define pi acos(-1)
#define sqr(x) ((x)*(x))
#define pdd pair<double,double>
#define MEMS(x) memset(x,-1,sizeof(x))
#define MEM(x) memset(x,0,sizeof(x))
#define N 200005
#define rank Rank
#define index Index
int main(){
    int n,k;
    scanf("%d %d",&n,&k);
    if(k==1){
        printf("0\n");
    }
    else
    printf("%d\n",n-k);
    return 0;
}

Measured memory_bytes: 764
#pragma once
#include <sstream>
#include <string>
#include <vector>
#include <map>
#include <algorithm>
#include <iostream>
#include <utility>
#include <set>
#include <cctype>
#include <queue>
#include <stack>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <deque>
#include <numeric>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
const int INF = 1000000007;
const int MAX_V = 201;
int now = 0;
int deco[1000];

void Sequence() {
	int a,b,h;
	cin >> a >> b >> h;
	cout << ((b + a) * h / 2) << endl;
	
}
int main() {
	Sequence();
	return 0;
}



Measured memory_bytes: 256
K = gets.to_i
DP_L = Array.new(11){ Array.new(11, 0) }
DP_S = Array.new(11){ Array.new(10, 0) }

(0 .. 9).each{|i| DP_L[1][i] = 1; DP_S[1][i] = i }

(2 .. 10).each do |n|
  (0 .. 9).each do |i|
    DP_L[n][i] = DP_L[n - 1][i - 1] + DP_L[n - 1][i] + DP_L[n - 1][i + 1]
  end
  DP_S[n][0] = DP_S[n - 1][9]
  (1 .. 9).each do |i| 
    DP_S[n][i] = DP_S[n][i - 1] + DP_L[n][i]
  end
  break if DP_S[n][9] >= K
end

def lunlun(n,i,k,a)
  return a if n == 1

  if DP_L[n - 1][i - 1] >= k
    lunlun(n - 1, i - 1, k, a * 10 + i - 1)
  elsif DP_L[n - 1][i - 1] +  DP_L[n - 1][i] >= k
    lunlun(n - 1, i, k - DP_L[n - 1][i - 1], a * 10 + i)
  elsif DP_L[n - 1][i - 1] + DP_L[n - 1][i] + DP_L[n - 1][i + 1] >= k
    lunlun(n - 1, i + 1, k - DP_L[n - 1][i - 1] - DP_L[n - 1][i], a * 10 + i + 1)
  else
    raise "illegal state"
  end
end

def answer(k)
  n = DP_S.index{|sum| sum[9] >= K }
  i = DP_S[n].index{|sum| sum >= K }
  lunlun(n, i, k - DP_S[n][i - 1], i)
end

puts answer(K)

Measured memory_bytes: 1788
#include<iostream>
#include<iomanip>
//#include<cstdio>
#include<vector>
#include<map>
#include<queue>
#include<algorithm>
#include<cmath>
#include<cassert>
using namespace std;
typedef long long ll;
ll W, H, X, Y;

int main(){
	cin >> W >> H >> X >> Y;

	cout << W*H/2.0 << ' ' << (2*X==W && 2*Y==H ?1:0) << endl;

	return 0;
}


Measured memory_bytes: 256
#include <stdlib.h>
#include <stdio.h>
 
int main(){
int a,m,n,q,i,S[100000],T[50000],r,l;

m=0;

scanf("%d",&n);
for(i=0;i<n;i++){
    scanf("%d",&S[i]);
   }
 
scanf("%d",&q);
for(i=0;i<q;i++){
    scanf("%d",&T[i]);
    }

for(i=0;i<q;i++){
l=0;
r=n;

 while(l<r){
 a=(l+r)/2;
   if(S[a]==T[i]){
      m++;
      break;
  }else if(S[a]<T[i]){
      l=a+1;
  }else{
      r=a;
   }
  }
 }
printf("%d\n",m);
return 0;
}

Measured memory_bytes: 3328
# coding: utf-8
# Your code here!

def gcd(x, y):
   if x < y:
      x, y = y, x
   if x % y == 0:
      return y
   else:
      return gcd(y, x % y)

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

l = A[0]
for i in range(1, n):
   l = l * A[i] / gcd(l, A[i])
print(int(l))


Measured memory_bytes: 5612
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define repl(i,n) for(int64_t i=0;i<(int64_t)(n);i++)
#define MAX_N 10000000 //10^7
#define ll int64_t
#define all(v) (v).begin(),(v).end()
using namespace std;

int main() {
    string s; cin>>s;
    int count=0,n=s.size();
    rep(i,n) {
        if(s[i]=='o') count++;
    }
    if(count+15-n>=8) cout<<"YES"<<endl;
    else cout<<"NO"<<endl;
    return 0;
}

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

int main() {
    vector<int> a(3);
    cin >> a.at(0) >> a.at(1) >> a.at(2);
    sort(a.begin(), a.end());
    if (a.at(0) == a.at(1) && a.at(1) == a.at(2)) {
        cout << "No" << endl;
    }
    else if (a.at(0) == a.at(1) || a.at(1) == a.at(2)) {
        cout << "Yes" << endl;
    }
    else {
        cout << "No" << endl;
    }
}

Measured memory_bytes: 256
import sys
H,W = map(int,input().split())
temp =[0 for i in range(H)]
for i in range(H):
    temp[i] = input()
dx = [-1,1,0,0]
dy = [0,0,1,-1]
ans = True
for j in range(H):
    for k in range(W):
        if(temp[j][k]=="#"):
            judge =False
            for i in range(4):
                j2 = j+dx[i]
                k2 = k+dy[i]
                if 0 <= j2 < H and 0<= k2 < W and temp[j2][k2] =="#":
                    judge = True
            if not judge:
                ans =False
if ans:
    print("Yes")
else:
    print("No")

Measured memory_bytes: 3064
#include<bits/stdc++.h>
using namespace std;
#define rg register
#define rep(i,a,b) for (rg int i=a;i<=b;i++)
#define per(i,a,b) for (rg int i=b;i>=a;i--)
#define pb push_back
#define lowbit(x) (x&(-x))
#define mk make_pair
#define VI vector<int>
#define pii pair<int,int>
#define pLL pair<long long,long long>
#define fi first
#define se second
#define il inline
#define ll long long
#define db double
#define ld long double
#define inf 0x3f3f3f3f
#define getc() (p1==p2&&(p2=(p1=buf)+fread(buf,1,1<<15,stdin),p1==p2)?EOF:*p1++)
char buf[1<<15],*p1 = buf,*p2 = buf;
inline ll read(){
    #define num ch-'0'
    char ch;bool flag=0;ll res;
    while(!isdigit(ch=getc()))
    (ch=='-')&&(flag=true);
    for(res=num;isdigit(ch=getc());res=res*10ll+num);
    (flag)&&(res=-res);
    #undef num
    return res;
}
inline void write(ll x){
	if (x < 0) x = ~x + 1ll, putchar('-');
	if (x > 9) write(x / 10ll);
	putchar(x % 10ll + '0');
}
#define mid ((l + r)>>1)
#define ls (x<<1)
#define rs ((x<<1)|1)
#undef mid
#undef ls
#undef rs
#define maxn 101000
int a[maxn];
int b[maxn];
int n;
int check(int v)
{
	b[1] = v;
	rep(i,1,n-1)
	{
		b[i+1] = a[i] - b[i];
		if(b[i]<0)
		{
			if(i%2 == 1) return 1;
			else return -1;
		}
	}
	if(b[n]+b[1] < a[n]) return 1;
	else if(b[n]+b[1]>a[n]) return  -1;
	return 0;
}
void solve()
{
	n = read();
	rep(i,1,n) a[i] = read();
	int l = 0,r = a[1];
	int ans = 0;
	while(l<=r)
	{
		int mid = (l+r)>>1;
		int t = check(mid);
		if(t == 0) break;
		if(t == 1) l = mid+1;
		else r = mid - 1;
	}
	rep(i,1,n) cout<<b[i]*2<<" ";
}
int main()
{
	#ifndef ONLINE_JUDGE
	freopen("data.txt","r",stdin);
	#endif
//	int T = read();
//	while(T--)
	solve();
}

Measured memory_bytes: 4448
using System;

class Program {
    static void Main() {
        var l = Console.ReadLine().Split(' ');
        var c1 = int.Parse(l[0]);
        var c5 = int.Parse(l[1]);
        var c10 = int.Parse(l[2]);
        var c50 = int.Parse(l[3]);
        var c100 = int.Parse(l[4]);
        var c500 = int.Parse(l[5]);

        var sum = c1 + c5 * 5 + c10 * 10 + c50 * 50 + c100 * 100 + c500 * 500;

        Console.WriteLine(sum >= 1000 ? '1' : '0');
    }
}

Measured memory_bytes: 8932
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<n;i++)
using namespace std;
const int INF=INT_MAX,MOD=1e9+7;

int main(){
	int n; cin>>n;
	string s,ans="YES";
	int cntA=0,cntUn=0;
	rep(i,n){
		cin>>s;
		if(s=="A") cntA++;
		else cntUn++;
		if(cntA<cntUn) ans="NO";
	}
	if(cntA!=cntUn) ans="NO";
	cout<<ans<<endl;
	return 0;
}



Measured memory_bytes: 3212
#include <bits/stdc++.h>
using namespace std;
 
int main(){
  int a,b,c;
  cin >> a;
  cin >> b;
  c = a*b;
  if (c%2 == 0){
    cout << "Even" << endl;
  }
  if (c%2 != 0){
    cout << "Odd" << endl;
  }
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main() {
	string s;
	int k;
	cin >> s >> k;
	for(int i(0); i < (int)s.size(); i++) {
		if(k > 0 && i == (int)s.size() - 1) {
			s[i] = (s[i] - 'a' + k) % 26 + 'a';
		}else {
			if(s[i] != 'a' && 'z' - s[i] + 1 <= k) {
				k -= ('z' - s[i] + 1);
				s[i] = 'a';
			}
		}
		
	}
	cout << s << endl;
}


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

using namespace std;

#define S scanf
#define P printf
#define G getline
#define SZ size()
#define C clear()
#define B begin()
#define F front()
#define T top()
#define E end()
#define EM empty()
#define V vector
#define Q queue
#define DQ deque
#define PQ priority_queue
#define ST stack
#define FI first
#define SE second
#define PI acos(-1)
#define PS push
#define PP pop()
#define PSF push_front
#define PSB push_back
#define PPF pop_front()
#define PPB pop_back()
#define MP make_pair
#define LL long long int
#define ULL unsigned long long int
#define PII pair<int,int>
#define PSI pair<string,int>
#define PIS pair<int,string>
#define PLI pair<long long int,int>
#define PLL pair<long long int,long long int>
#define MII map<int,int>
#define MSI map<string,int>
#define MIS map<int,string>
#define MLI map<long long int,int>
#define FAST() ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)





//int dx[]={-1,1,0,0};
//int dy[]={0,0,-1,1};
//int dx[]= {-1,0,1,-1,1,-1,0,1};
//int dy[]= {1,1,1,0,0,-1,-1,-1};






int main()
{
    FAST();

//    freopen("input.txt","r",stdin);
//    freopen("output.txt","w",stdout);

    int i,j,n,ans=INT_MAX,cnt,a[105];
    cin >> n;
    for(i=0;i<n;i++)cin >> a[i];
    for(i=1;i<=100;i++)
    {
        cnt=0;
        for(j=0;j<n;j++)cnt+=(a[j]-i)*(a[j]-i);
        ans=min(ans,cnt);
    }
    cout << ans;
    return 0;
}


Measured memory_bytes: 256
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

import static java.lang.Integer.parseInt;

/**
 * Calling Extraterrestrial Intelligence Again
 */
public class Main {

	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String line;
		String[] words;

		boolean[] _primes = primes(50_000);
		List<Integer> primes = new ArrayList<>();

		for (int i = 0; i < _primes.length; i++) {
			if (_primes[i]) primes.add(i);
		}

		int[][] multis = new int[100_001][2];

		for (int p1 : primes) {
			for (int p2 : primes) {
				if (p1 <= p2) {
					long multi = p1 * p2;
					if (0 <= multi && multi < 100_001) {
						multis[(int) multi][0] = p1;
						multis[(int) multi][1] = p2;
					}
				}
			}
		}

		while ((line = br.readLine()) != null && !line.isEmpty()) {

			words = line.split(" ");

			int m, a, b;
			m = parseInt(words[0]);
			a = parseInt(words[1]);
			b = parseInt(words[2]);
			if ((m | a | b) == 0) break;

			for (int i = m; i >= 4; i--) {
				if (multis[i][0] != 0) {
					int p = multis[i][0];
					int q = multis[i][1];
					if (a * q <= p * b) {
						System.out.println(p + " " + q);
						break;
					}
				}
			}

		} //end while
	} //end main

	static boolean[] primes(int limit) {

		boolean[] ps = new boolean[limit + 1];
		int _limit = (int) Math.sqrt(ps.length) + 1;

		//2..
		Arrays.fill(ps, 2, ps.length, true);

		for (int i = 2; i <= _limit; i++) {
			if (ps[i]) {
				for (int j = i * 2; j < ps.length; j += i) {
					if (ps[j]) ps[j] = false;
				}
			}
		}
		return ps;
	}
}

Measured memory_bytes: 34140
#include <iostream>
#include <algorithm>
using namespace std;
int main() {
	long long num[10], N;
	cin >> N;
	for(int i = 1;i < 6;i++){
        cin >> num[i];
	}
	long long time = 0;
	for(int i = 1;i < 6;i++){
        if((N - 1) / num[i] > time){
            time = (N - 1) / num[i];
        }
	}
	time += 5;
	cout << time << endl;
	return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0; i<(n); i++)
using namespace std;
using ll = long long;
using P  = pair<int,int>;
using vi = vector<ll>;
using vv = vector<vi>;
//const int MOD = 1000000007;
//const int MOD = 998244353;
const ll INF = 1001001001001;

int main(){
    int n;
    cin>>n;
    
    vi l(n);
    
    rep(i,n)cin>>l[i];
    
    sort(l.begin(), l.end());
    
    int ans = 0;
    
    for(int i=0; i<n; i++){
        for(int j=i+1; j<n; j++){
            for(int k=j+1; k<n; k++){
                if(l[i]!=l[j] && l[j]!=l[k] && l[i]+l[j]>l[k])ans++;
            }
        }
    }
    cout << ans << endl;
    
    return 0;
}

Measured memory_bytes: 3632
import java.io.IOException;
import java.io.InputStream;
import java.util.NoSuchElementException;
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());}
}
public class Main {
	static FastScanner stdIn=new FastScanner();
	public static void main(String[] args) {
		String X=stdIn.next();
		int N=X.length();
		int s=0,t=0,ans=N;
		for(int i=0;i<N;i++){
			char a=X.charAt(i);
			if(a=='S')
				s++;
			else{
				if(s!=0){
					ans-=2;
					s--;
				}
			}
		}
		System.out.println(ans);
	}
}


Measured memory_bytes: 22868
#include <iostream>
#include <vector>

using namespace std;

const int MOD = 1000000007;

int main(){
	long long K;
	while(cin >> K){
		cout << 50 << endl;
		long long l = (K+49)/50;
		vector<long long> v(50, 49+l);
		int dec = 50 * l - K;
		for(int i=0;i<dec;i++){
			v[i] -= 50;
			for(int j=0;j<50;j++) if(i != j) ++v[j];
		}
		cout << v[0];
		for(int i=1;i<50;i++) cout << " " << v[i];
		cout << endl;
	}
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define rep(i,j,n) for(int i=j;i<(int)(n);i++)
int main(){
  int N;
  cin >> N;
  vector<int> d(N);
  rep(i,0,N) cin >> d[i];
  sort(d.begin(),d.end());
  cout<< d[d.size()/2]-d[d.size()/2-1] << endl;
}



Measured memory_bytes: 640
#include <iostream>
using namespace std;
int main() {
    int n;
    cin >> n;
    int prev = -1, ans = 0;
    for (int i = 0; i < n; ++i) {
        int a;
        cin >> a;
        if (prev == a) {
            ++ans;
            prev = -1;
        } else
            prev = a;
    }
    cout << ans << '\n';
}

Measured memory_bytes: 256
#include"bits/stdc++.h"
using namespace std;
int main()
{
	int a,b;
	int i,j;
	char c;
	scanf("%d %d\n",&a,&b);
	for(i=0;i<a;i++)
	{
		c=getchar();
		if(c>'9'||c<'0')
		{
			printf("No");
			return 0;
		}
	}
	c=getchar();
	if(c!='-')
	{
		printf("No");
		return 0;
	}
	for(i=0;i<b;i++)
	{
		c=getchar();
		if(c>'9'||c<'0')
		{
			printf("No");
			return 0;
		}
	}
	printf("Yes");
	return 0;
} 

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

using namespace std;

int main() {
	int N;
	cin >> N;
	vector<vector<int>> g(N);
	for (int i = 0; i < N - 1; ++i) {
		int a, b;
		cin >> a >> b;
		--a; --b;
		g[a].emplace_back(b);
		g[b].emplace_back(a);
	}

	vector<int> c(N, -1);
	c[0] = 0;
	int n = 0;
	deque<int> que;
	que.emplace_back(0);
	while (!que.empty()) {
		int u = que.front(); que.pop_front();
		for (auto v : g[u]) {
			if (c[v] >= 0) { continue; }
			c[v] = 1 - c[u];
			n += c[v];
			que.emplace_back(v);
		}
	}
	if (n > N / 2) {
		for (int i = 0; i < N; ++i) { c[i] = 1 - c[i]; }
		n = N - n;
	}

	vector<deque<int>> p(3);
	for (int i = 1; i <= N; ++i) {
		p[i % 3].emplace_back(i);
	}
	
	vector<int> ans(N, -1);
	if (n <= p[0].size()) {
		for (int i = 0; i < N; ++i) {
			if (c[i] == 0) { continue; }
			ans[i] = p[0].front(); p[0].pop_front();
		}
		for (int i = 0; i < N; ++i) {
			if (c[i] == 1) { continue; }
			for (int j = 0; j < 3; ++j) {
				if (p[j].empty()) { continue; }
				ans[i] = p[j].front(); p[j].pop_front();
				break;
			}
		}
	} else {
		for (int i = 0; i < N; ++i) {
			if (c[i] == 0) { continue; }
			for (int j = 1; j >= 0; --j) {
				if (p[j].empty()) { continue; }
				ans[i] = p[j].front(); p[j].pop_front();
				break;
			}
		}
		for (int i = 0; i < N; ++i) {
			if (c[i] == 1) { continue; }
			for (int j = 2; j >= 0; --j) {
				if (p[j].empty()) { continue; }
				ans[i] = p[j].front(); p[j].pop_front();
				break;
			}
		}
	}

	for (int i = 0; i < N; ++i) {
		cout << ans[i] << (i < N - 1 ? " " : "\n");
	}

	return 0;
}


Measured memory_bytes: 15476
#include<iostream>
#include<cmath>
#include<cstdlib>
#include<string>
#include<cstring>
#include<algorithm>
#include<vector>
#include<map>
#include<iomanip>

using namespace std;

typedef long long ll;

typedef std::pair<int, int> ipair;
bool lessPair(const ipair& l, const ipair& r){return l.second < r.second;}
bool morePair(const ipair& l, const ipair& r){return l.second > r.second;}

template<class T> inline bool chmin(T& a, T b) {
    if (a > b) {
        a = b;
        return true;
    }
    return false;
}
template<class T> inline bool chmax(T& a, T b) {
    if (a < b) {
        a = b;
        return true;
    }
    return false;
}

const ll MOD = 1e9 + 7;
// const long long INF = 1LL<<60;
void add(long long &a, long long b) { a += b; if (a >= MOD) a -= MOD; }
void sub(long long &a, long long b) { a -= b; if (a < 0) a += MOD; }
void mul(long long &a, long long b) { a *= b; a %= MOD; }
ll llmin(ll a, ll b) { if (a < b) return a; else return b; }
ll llmax(ll a, ll b) { if (a < b) return b; else return a; }
ll llabs(ll a) { if (a >= 0) return a; else return - a; }
ll llmodpow(ll a, ll n) {
   if (n == 0) return 1;
   ll tmp = llmodpow(a, n / 2);
   mul(tmp, tmp);
   if (n & 1) mul(tmp, a);
   return tmp;
}

int main() {
   string s;
   cin >> s;
   int n = (int)s.size();
   cout << s[0] << n - 2 << s[n - 1] << endl;
   return 0;
}


Measured memory_bytes: 256
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy,copy
from string import ascii_lowercase, ascii_uppercase, digits
from fractions import gcd

def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

def main():
    s, t = input().split()
    a, b =   MAP()
    u = input()
    if u == s:
        print(a-1, b)
    else:
        print(a, b-1)


if __name__=='__main__':
    main()


Measured memory_bytes: 5784
#include<iostream>

using namespace std;

int judge(int a, int b, int c){
    if((a < b && b < c) || (a > b && b > c)) return 1;
    else return 0;
}

int main(){
    int n, p[20], count = 0;
    cin >> n;
    for(int i = 0; i < n; i++){
        cin >> p[i];
    }
    for(int i = 0; i < n - 2; i++){
        count += judge(p[i], p[i + 1], p[i + 2]);
    }
    cout << count << endl;
    return 0;
}

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

#include <algorithm>
#include <cassert>
#include <cfloat>
#include <complex>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <regex>
#include <set>
#include <stack>
#include <string>
#include <unordered_map>
#include <vector>

using namespace std;

#define chmax(x, y) x = max(x, y)
#define chmin(x, y) x = min(x, y)
#define rep(i, n) for (ll i = 0; i < (n); ++i)
#define repLRE(i, l, r) for (ll i = (l); i <= (r); ++i)
#define rrepLRE(i, l, r) for (ll i = (l); i >= (r); --i)
#define Sort(v) sort(v.begin(), v.end())
#define rSort(v) sort(v.rbegin(), v.rend())
#define Reverse(v) reverse(v.begin(), v.end())
#define Lower_bound(v, x) \
  distance(v.begin(), lower_bound(v.begin(), v.end(), x))
#define Upper_bound(v, x) \
  distance(v.begin(), upper_bound(v.begin(), v.end(), x))

using ll = long long;
using ull = unsigned long long;
using P = pair<ll, ll>;
using T = tuple<ll, ll, ll>;
using vll = vector<ll>;
using vP = vector<P>;
using vT = vector<T>;
using vvll = vector<vector<ll>>;
using vvP = vector<vector<P>>;
using dqll = deque<ll>;

ll dx[9] = {-1, 1, 0, 0, -1, -1, 1, 1, 0};
ll dy[9] = {0, 0, -1, 1, -1, 1, -1, 1, 0};

/* Macros reg. ends here */

const ll INF = 1LL << 50;

static const long long mod = 1000000007;

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

  double a, b, h, m;
  cin >> a >> b >> h >> m;

  auto deg = [](auto x) -> double { return x * M_PI / 180.0; };

  complex<double> zh = polar<double>(a, deg((60 * h + m) / 2.0));
  complex<double> zm = polar<double>(b, deg(m * 6.0));

  double ans = abs(zh - zm);
  cout << ans << endl;

  return 0;
}


Measured memory_bytes: 4068
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <algorithm>
#include <array>
#include <vector>
#include <utility>
#include <bitset>
#include <queue>

using namespace std;

typedef long long ll;

int main(void) {
    ll N;
    cin >> N;
    vector<ll> a(N), b(N);

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

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

    ll S = 0, T = 0;

    for (ll i = 0; i < N; i++) {
        if (b[i] > a[i] + 1) {
            ll d = b[i] - a[i];
            d -= (d % 2);
            T += d;
        } else if (a[i] > b[i]) {
            S += a[i] - b[i];
        }
    }

    if (T >= S * 2LL) {
        cout << "Yes" << endl;
    } else {
        cout << "No" << endl;
    }

    return 0;
}



Measured memory_bytes: 384
import java.util.*;
public class Main{
	public static void main(String[] args){
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int t = scan.nextInt();
		int[] jikan = new int[n];
		for(int i=0; i<n; i++){
			jikan[i] = scan.nextInt();
		}
		int ans = 0;
		for(int i=1; i<n; i++){
			if(jikan[i]-jikan[i-1]<=t){
				ans += jikan[i]-jikan[i-1];
			}
			else{
				ans += t;
			}
		}
		System.out.println(ans+t);
	}
}

Measured memory_bytes: 66572
#include <iostream>
#include <string>
#include <cstdlib>

using namespace std;

int main()
{
    int N,A,B;
    int ans = 0;
    cin >> N >> A >> B;
    for(int a = 1;a < N+1;a++){
        string str = to_string(a);
        int ins = 0;
        for(char b : str){
            ins += b-'0';
        }
        if(ins >= A&&ins <= B){
            ans += a;
        }
        //cout << ans <<" "<<ins<<endl;
    }
    cout << ans << endl;
    return 0;
}


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

#define SIZE 200001

using namespace std;

int main() {
    long long int A,B,C,D,i,j,k,M,K,Q;
    long long int X,N,Y,Z;
  //  long long int A[100][100];

    cin >> A;

    B = A*A;
    C = B*A;
    D=A+B+C;
    cout << D << endl;

  return 0;

}


Measured memory_bytes: 3584
#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4")

#define nm "A" 
#define stdi freopen(nm".in","r",stdin);
#define stdo freopen(nm".out","w",stdout);
#define IO stdi stdo                   
#define ll long long                   
#define ld long double                                                                                                           
#define f first 
#define s second 
#define pb push_back               
#define mp make_pair 
#define o cout<<"BUG"<<endl;
#define	IOS ios_base::sync_with_stdio(0);
using namespace std;                    
const ll maxn=1e6+123,MX=1e9,inf=1e9,block=2;
ll n,ans,a[maxn],pre[maxn];
map<ll,ll>cnt;
int main(){
	cin>>n;
	for(int i=1;i<=n;i++){
		cin>>a[i];
		pre[i]=pre[i-1]+a[i];
		cnt[pre[i]]++;
	}
	ans=cnt[0];
	for(int i=1;i<=n;i++){
		cnt[pre[i]]--;
		ans+=cnt[pre[i]];
    }
    cout<<ans;
}


Measured memory_bytes: 18432
#include <bits/stdc++.h>
using namespace std;
#define rep(i,a,b) for(int i=a;i<b;i++)

map< pair<int, int>, string> memo;

bool match(char c, string s)
{
	rep(i, 0, s.length()) if (s[i] == c) return true;
	return false;
}

string comp(string a, string b)
{
	if (a.length() < b.length())
	{
		return b;
	}
	else if (a.length() > b.length())
	{
		return a;
	}
	else
	{
		if (a < b)
			return b;
		else
			return a;
	}
}

string dfs(string s, int left, int right)
{
	auto p = make_pair(left, right);
	if (memo.find(p) != memo.end()) return memo[p];

	if(match(s[left], "(),")) return (memo[p] = "");
	if (s[left] == '0')
	{
		if (left == right)
			return (memo[p] = "0");
		else
			return (memo[p] = "");
	}

	bool ok = true;
	rep(i, left, right + 1)
	{
		if(!match(s[i], "0123456789?")) ok = false;
	}

	if (ok)
	{
		string ret = "";
		rep(i, left, right + 1)
		{
			if (s[i] == '?')
				ret += '9';
			else
				ret += s[i];
		}
		return (memo[p] = ret);
	}

	if (right - left + 1 < 6) return (memo[p] = "");

	if (!match(s[left], "?RL")) return (memo[p] = "");
	if (!match(s[left + 1], "?(")) return (memo[p] = "");
	if (!match(s[right], "?)")) return (memo[p] = "");

	string ret = "";
	rep(i, left + 3, right - 1) if (match(s[i], "?,"))
	{
		string l = dfs(s, left + 2, i - 1);
		string r = dfs(s, i + 1, right - 1);
		if (l.length() == 0 || r.length() == 0) continue;

		string cor;
		if (s[left] == 'R')
			cor = r;
		else if (s[left] == 'L')
			cor = l;
		else
			cor = comp(l, r);

		ret = comp(ret, cor);
	}

	return (memo[p] = ret);
}

int main()
{
	string s; cin >> s;
	string ans = dfs(s, 0, s.length() - 1);
	if (ans.length() == 0)
		cout << "invalid" << endl;
	else
		cout << ans << endl;
}

Measured memory_bytes: 3264
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;
public class Main {

	public static void main(String[] args) throws IOException{
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String f = br.readLine();
		int[] a = new int[3];
		for(int i = 0 ; i < Integer.parseInt(f) ; i++){
			String str = br.readLine();
			String[] stra = str.split(" ");
			for(int j = 0 ; j < 3 ; j++){
				a[j] = Integer.parseInt(stra[j]);
			}
			Arrays.sort(a);
			if(Math.pow(a[0],2) + Math.pow(a[1],2) == Math.pow(a[2],2)){
				System.out.println("YES");
			}else {
				System.out.println("NO");
			}
		}
	}

}

Measured memory_bytes: 20504
#include <bits/stdc++.h>
using namespace std;
 
#define oo 1e9
#define fi first
#define se second
#define sp(iiii) setprecision(iiii)
#define IO ios_base::sync_with_stdio(false); cin.tie(0)
#define ms(aaaa,xxxx) memset(aaaa,xxxx,sizeof(aaaa))
#define cntbit(xxxx) __builtin_popcount(xxxx)
#define getbit(xxxx,aaaa) ((xxxx>>(aaaa-1))&1)
#define _cos(xxxx) cos(xxxx*acos(-1)/180)
#define _sin(xxxx) sin(xxxx*acos(-1)/180)
#define _tan(xxxx) tan(xxxx*acos(-1)/180)
#define PE cout<<fixed
 
typedef long double ld;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> pii;
typedef pair<pair<int,int>,int> piii;
typedef pair<long long,long long> pll;
typedef pair<pair<long long,long long>,long long> plll;
 
const ld pi=acos(-1);

map<string,int> a;
string s;

int main() {
    IO;
    a["SUN"]=7;
    a["MON"]=6;
    a["TUE"]=5;
    a["WED"]=4;
    a["THU"]=3;
    a["FRI"]=2;
    a["SAT"]=1;
    cin>>s;
    cout<<a[s];
}
    

Measured memory_bytes: 3588
#include<stdio.h>
#include<algorithm>
using namespace std;
int key[]={0,2,3,5,7,8,10};
char in[5];
int p[110000];
int q[110000];
int n;
int solve(int a,int b){
	if(a<0&&b==-1)return 1;
	if(a<0)return 0;
	if(b<0)return 0;
	if(b>=n)return 0;
	if(p[b]==q[a])return solve(a-1,b-1);
	if((p[b]+1)%12==q[a])return solve(a-1,b-2);
	if((p[b]+11)%12==q[a])return solve(a-1,b+1);
	return 0;
}
int main(){
	int T;
	scanf("%d",&T);
	while(T--){
		int a,b;scanf("%d%d",&a,&b);
		n=a;
		for(int i=0;i<a;i++){
			scanf("%s",in);
			p[i]=key[in[0]-'A'];
			if(in[1]=='#')p[i]++;
		}
		for(int i=0;i<b;i++){
			scanf("%s",in);
			q[i]=key[in[0]-'A'];
			if(in[1]=='#')q[i]++;
		}
		if(solve(b-1,a-1))printf("Yes\n");
		else if(solve(b-1,a-2))printf("Yes\n");
		else printf("No\n");
	}
}

Measured memory_bytes: 1412
#include "bits/stdc++.h"
using namespace std;

using ll = long long;
using ld = long double;
using P = pair<int, int>;
using vi = vector<int>;
using vl = vector<ll>;
ld EPS = 1e-12;
int INF = numeric_limits<int>::max() / 2;
ll LINF = numeric_limits<ll>::max() / 2;
int MOD = 1e9 + 7;
#define rep(i,n) for(int i = 0; i < n; i++)
#define all(obj) (obj).begin(), (obj).end()
#define debug(x) cerr << #x << ": " << x << '\n'

int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    
    int n;
    cin >> n;
    vector<int> a(n);
    rep(i,n) cin >> a[i];
    sort(a.begin(), a.end());
    vi b(n);
    rep(i,n) b[i] = a[i] * 2;
    int index = lower_bound(b.begin(), b.end(), a[n-1]) - b.begin();
    if(abs(a[n-1] - 2 * a[index]) < abs(a[n-1] - 2 * a[index-1]) && index != n - 1){
        cout << a[n-1] << " " << a[index] << endl;
    }else{
        cout << a[n-1] << " " << a[index-1] << endl;
    }
    return 0;
}

Measured memory_bytes: 1024
#include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
#include <queue>
#include <string>
#define REP(i,n) for(int i = 0; i < (int)n; i++)
using namespace std;

long maximum(long a, long b){
  if(a>b){
    return a;
  }else{
    return b;
  }
}

int main(){
  long n,k;
  cin >> n >> k;
  long long ans = 0;
  if(k==0){
    cout << n*n << endl;
    return 0;
  }
  for(int b = k+1; b <= n; b++){
    ans += n/b*(b-k)+ maximum(n-(n/b)*b-k+1,0);
  }
  cout << ans << endl;
}


Measured memory_bytes: 256
from sys import stdin
inp = lambda : stdin.readline().strip()

t = int(inp())
counter = 0
f = False
for _ in range(t):
    a = [int(x) for x in inp().split()]
    if a[0] == a[1]:
        counter += 1
        if counter == 3:
            f = True
    else:
        counter = 0
if f:
    print('Yes')
else:
    print('No')

Measured memory_bytes: 61968
#include <stdio.h>

int main(void)
{
	int t,i,j;
	
	scanf("%d" ,&t);         //??\???
	
	for(i=0;t>=3600;i++)     //????????????
	{
		t = t-3600;
	}
	for(j=0;t>=60;j++)      //???????¨????
	{
		t = t-60;
	}
	
	printf("%d:%d:%d\n",i,j,t);      //??¨???
	
	return 0;    //?????????
}

Measured memory_bytes: 592
#include<cstdio>
#include<cstring>
const int N=1005;
int n,b[N];char c[N];
int main()
{
	scanf("%s",c+1),n=strlen(c+1);
	for(int i=1;i<=n;++i)b[c[i]]=1;
	if(b['N']^b['S']||b['W']^b['E'])
		return printf("No"),0;
	return printf("Yes"),0;
}

Measured memory_bytes: 1724
#include "bits/stdc++.h"
using namespace std;
#define int long long
#define double long double
// #define endl '\n'
#define vi vector<int>
#define vvi vector<vi>
#define vpii vector<pii>
#define vpipii vector<pipii>
#define vpiipi vector<piipi>
#define pb push_back
#define pob pop_back
#define pii pair<int,int>
#define pipii pair<int,pii>
#define piipi pair<pii,int>
#define pld pair<long double,long double>
// #define mod 1000000007
// #define mod 1000000009
// #define mod 163577857 
#define mod 998244353
#define rep(i,n) for (int i = 0; i < n; i++)
#define repp(i,a,b) for(int i = a ; i<b ; i++)
#define reppr(i,a,b) for(int i = a-1 ; i>=b ; i--)
#define repr(i,n) for (int i = n - 1; i >= 0; i--)
#define ff first
#define ss second
#define pc putchar_unlocked
#define gc getchar_unlocked
#define inf 9223372036854775807
#define infn -9223372036854775807
#define pi 3.14159265358979323846
#define eps 0.0000000001
#define sp << " " <<
#define setprec(x) cout << fixed << setprecision(x);
#define REVERSE(a) reverse(all(a));
#define SORT(a) sort(all(a));
#define all(n) n.begin(),n.end()
 
//GCD and LCM
    int gcd (int a, int b) { return b ? gcd (b, a % b) : a; }
    int lcm (int a, int b) { return a / gcd(a, b) * b; }
 
//Modular Exponentiation
    int powmod(int x,int y) 
    { 
        if (y == 0) return 1; 
        int p = powmod(x, y/2) % mod; 
        p = (p * p) % mod;   
        return (y%2 == 0)? p : (x * p) % mod; 
    }
 
//Modular Inverse
    int inverse(int a) 
    { 
       return powmod(a,mod-2); 
    }

//Binomial Coefficients
    int fact[500010], factinv[500010] , coefficientflag = 0;
    void Util_nCr()
    {
        fact[0] = 1 , factinv[0] = 1;
        repp(i,1,500010)
        {
            fact[i] = (fact[i-1] * i)%mod;
            factinv[i] = (factinv[i-1] * inverse(i))%mod;
        }
    }
    int nCr(int n , int r)
    {
        if(!coefficientflag) coefficientflag = 1 , Util_nCr();             
        return ((fact[n] * inverse(fact[n-r]) % mod * inverse(fact[r]))%mod) ;
    }

void solve();
signed main()
{
    ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
    int t = 1;
    // cin >> t; 
    rep(i,t)
    {
        // cout << "Case #" << i+1 << ": ";
        solve();
    }
}


void solve() 
{   
    int n , k ;
    cin >> n >> k;
    int p[n];
    rep(i,n)
        cin >> p[i];
    int ans = 0 ;
    sort(p,p+n);
    rep(i,k)
        ans += p[i];
    cout << ans << endl;
}     

Measured memory_bytes: 3644
N, M = [int(i) for i in input().split()]
shops = []

for i in range(0, N):
    A, B = [int(i) for i in input().split()]
    shops.append((A, B))

shops.sort()

result = 0
rest_count = M
for shop in shops:
    if rest_count > shop[1]:
        result += shop[0] * shop[1]
        rest_count -= shop[1]
    else:
        result += shop[0] * rest_count
        break

print(result)

Measured memory_bytes: 16956
def f(exp):
    from operator import add, mul
    ops = {"+": add, "-": lambda a, b:b - a, "*": mul}
    stack = []
    def g(s):
        if s in ops:
            stack.append(ops[s](stack.pop(), stack.pop()))
        else:
            stack.append(int(s))
    map(g, exp.split())
    return stack[-1]
print f(raw_input())

Measured memory_bytes: 4356
#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <string.h>
#include <stdbool.h>
typedef long long LL;
typedef long double Lf;
#define in (void)scanf
#define Rep(i,a,n)for(int i=(int)(a);i<(int)(n);i++)
//#define Rep(i,a,n)for(LL i=(LL)(a);i<(LL)(n);i++)
#define rep(i,n)Rep(i,0,n)
#define Repp(i,l,r,k)for(int i=(int)(l);i<(int)(r);i+=(int)(k))
//#define Repp(i,l,r,k)for(LL i=(LL)(l);i<(LL)(r);i+=(LL)(k))
#define Ma(x,y) ((x)>(y)?(x):(y))
#define mi(x,y) ((x)<(y)?(x):(y))
#define MOD 1000000007//998244353,1000000007,1000000009,4999999999999997
int upi(const void* a, const void* b) { return*(int*)a<*(int*)b ? -1 : *(int*)a> * (int*)b ? 1 : 0; }
int downi(const void* a, const void* b) { return*(int*)a<*(int*)b ? 1 : *(int*)a> * (int*)b ? -1 : 0; }
void sortupi(int* a, int n) { qsort(a, n, sizeof(int), upi); } //1,2,3,4,...
void sortdowni(int* a, int n) { qsort(a, n, sizeof(int), downi); }
int upLL(const void* a, const void* b) { return*(LL*)a<*(LL*)b ? -1 : *(LL*)a> * (LL*)b ? 1 : 0; }
int downLL(const void* a, const void* b) { return*(LL*)a<*(LL*)b ? 1 : *(LL*)a> * (LL*)b ? -1 : 0; }
void sortupLL(LL* a, int n) { qsort(a, n, sizeof(LL), upLL); }
void sortdownLL(LL* a, int n) { qsort(a, n, sizeof(LL), downLL); }
int cmp_char(const void* a, const void* b) { return *(char*)a - *(char*)b; } // a,b,c,d
int cmp_str(const void* a, const void* b) { return strcmp(*(const char**)a, *(const char**)b); } // aaa,aab
LL gcd(LL p, LL q) { while (q) { LL t = p % q; p = q; q = t; }return p; }
LL modpow(LL a,LL n,int m){LL x=1;for(a%=m;n;n/=2)n&1?x=x*a%m:0,a=a*a%m;return x;}
#define invmodpow(b,p)modpow(b,p-2,p)// a/b≡a*b^{-1}(mod p)...return b^{-1}(mod p)
//typedef struct fac { LL n, exp; }F;
//LL fact(LL n,F*a){LL x=n,i,j,c=0;for(i=2;i*i<=x;i++){for(j=1;x%i==0;j++)x/=i;if(j>1){a[c].n=i;a[c++].exp=j-1;}}if(x-1){a[c].n=x;a[c++].exp=1;}return c;}
LL nibtan(LL* a,LL n,LL x){LL p=0,q=n/2,r=n-1;while(r-p>1){if(x>=a[q])p=q;if(x<=a[q])r=q;q=(p+r)/2;}return a[p]==x?p:r;}
//snippet

#define N 300009

void run(void) {
	int d, t, s;
	in("%d%d%d", &d, &t, &s);
	printf(d <= t * s ? "Yes" : "No");
}

int main(void) {
	int test = 1;
//	in("%d", &test);
	while (test--) {
		run();
		fflush(stdout);
	}
	return 0;
}

Measured memory_bytes: 1736
#include <iostream>
#include <queue>
#include <algorithm>
#include <vector>
using namespace std;

#define INF 1010001000

typedef pair<int, int> i_i;


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

    vector<vector<int> > G(n);

    for (int i = 0; i < n-1; i++) {
        cin >> a >> b;
        G[--a].push_back(--b);
        G[b].push_back(a);
    }

    vector<int> data(n, INF);
    priority_queue<i_i > pq;

    int k;
    cin >> k;
    for (int i = 0; i < k; i++) {
        cin >> a >> b;
        data[--a] = b;
        pq.push(i_i(b, a));
    }

    while (!pq.empty()) {
        i_i p = pq.top(); pq.pop();
        int u = p.second;
        for (int v: G[u]) {
            if (data[v] == INF) {
                data[v] = data[u] - 1;
                pq.push( i_i(data[v], v));
            }
        }
    }

    for (int i = 0; i < n; i++) {
        for (int j: G[i]) {
            if (abs(data[i] - data[j]) != 1) {
                cout << "No" << endl;
                return 0;
            }
        }
    }
    cout << "Yes" << endl;
    for (int i = 0; i < n; i++) {
        cout << data[i] << endl;
    }
    return 0;
}



Measured memory_bytes: 7924
import sys
sys.setrecursionlimit(10**6)
readline = sys.stdin.readline
write = sys.stdout.write

N, M = map(int, readline().split())

G = [[] for i in range(N)]
for i in range(M):
    u, v = map(int, readline().split())
    G[u].append(v)
    G[v].append(u)

# a chain decomposition
def construct(G, N):
    P = [0]*N
    G0 = [[] for i in range(N)]
    V = []
    lb = [0]*N
    def dfs(v, p):
        P[v] = p
        V.append(v)
        lb[v] = len(V)
        for w in G[v]:
            if w == p:
                continue
            if lb[w]:
                if lb[v] < lb[w]:
                    # a backedge
                    G0[v].append(w)
                continue
            # a tree edge
            dfs(w, v)
    dfs(0, -1)

    used = [0]*N
    first = 1
    B = []
    used[0] = 1
    ap = [0]*N
    for u in V:
        if not used[u]:
            # (u, p) is a bridge
            p = P[u]
            B.append((u, p) if u < p else (p, u))
            if len(G[u]) > 1:
                ap[u] = 1
            if len(G[p]) > 1:
                ap[p] = 1
        cycle = 0
        for v in G0[u]:
            w = v
            while w != u and not used[w]:
                used[w] = 1
                w = P[w]
            if w == u:
                cycle = 1
        if cycle:
            if not first:
                ap[u] = 1
            first = 0
    # v is a cut vertex
    A = [v for v in range(N) if ap[v]]

    return B, A

B, A = construct(G, N)

for v in A:
    write("%d\n" % v)


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


#define li          long long int
#define rep(i,to)   for(li i=0;i<((li)(to));i++)
#define repp(i,start,to)    for(li i=(li)(start);i<((li)(to));i++)
#define pb          push_back
#define sz(v)       ((li)(v).size())
#define bgn(v)      ((v).begin())
#define eend(v)     ((v).end())
#define allof(v)    (v).begin(), (v).end()
#define dodp(v,n)       memset(v,(li)n,sizeof(v))
#define bit(n)      (1ll<<(li)(n))
#define mp(a,b)     make_pair(a,b)
#define rin rep(i,n)
#define EPS 1e-12
#define ETOL 1e-8
#define MOD 1000000007
typedef pair<li, li> PI;

#define INF bit(60)

#define DBGP 1


#define idp if(DBGP)
#define F first
#define S second
#define p2(a,b)     idp cout<<a<<"\t"<<b<<endl
#define p3(a,b,c)       idp cout<<a<<"\t"<<b<<"\t"<<c<<endl
#define p4(a,b,c,d)     idp cout<<a<<"\t"<<b<<"\t"<<c<<"\t"<<d<<endl
#define p5(a,b,c,d,e)       idp cout<<a<<"\t"<<b<<"\t"<<c<<"\t"<<d<<"\t"<<e<<endl
#define p6(a,b,c,d,e,f)     idp cout<<a<<"\t"<<b<<"\t"<<c<<"\t"<<d<<"\t"<<e<<"\t"<<f<<endl
#define p7(a,b,c,d,e,f,g)       idp cout<<a<<"\t"<<b<<"\t"<<c<<"\t"<<d<<"\t"<<e<<"\t"<<f<<"\t"<<g<<endl
#define p8(a,b,c,d,e,f,g,h)     idp cout<<a<<"\t"<<b<<"\t"<<c<<"\t"<<d<<"\t"<<e<<"\t"<<f<<"\t"<<g<<"\t"<<h<<endl
#define p9(a,b,c,d,e,f,g,h,i)       idp cout<<a<<"\t"<<b<<"\t"<<c<<"\t"<<d<<"\t"<<e<<"\t"<<f<<"\t"<<g<<"\t"<<h<<"\t"<<i<<endl
#define p10(a,b,c,d,e,f,g,h,i,j)        idp cout<<a<<"\t"<<b<<"\t"<<c<<"\t"<<d<<"\t"<<e<<"\t"<<f<<"\t"<<g<<"\t"<<h<<"\t"<<i<<"\t"<<j<<endl
#define foreach(it,v)   for(__typeof((v).begin()) it=(v).begin(); it!=(v).end(); ++it)
#define p2p(x)      idp p2((x).F, (x).S)
#define dump(x,n)   idp{rep(i,n){cout<<x[i]<<" ";}puts("");}
#define dump2(x,n)  idp{rep(i,n){cout<<"["<<x[i].F<<" , "<<x[i].S<<"] ";}puts("");}
#define dumpi(x)    idp{foreach(it, x){cout<<(*it)<<" ";}puts("");}
#define dumpi2(x)   idp{foreach(it, x){cout<<"["<<(it)->F<<" , "<<(it)->S<<"] ";}puts("");}

#define read2d(a,w,h)   rep(i,h)rep(j,w)cin>>a[i][j]
#define dump2d(a,w,h)   rep(i,h){rep(j,w)cout<<a[i][j]<<" ";puts("");}



int main() {
    li n, k;
    cin >> n >> k;
    li res = 0;
    rin{
        li h;
        cin >> h;
        if (h >= k)res++;
    }
    cout << res << endl;

    return 0;
}

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

int main(){
    int n;
    cin >> n;
    vector<int> times(n+1);
    
    for(int i = 1; i <= n; i++){
        cin >> times.at(i);
    }

    int tsum = 0;

    for(int i=1;i<=n;i++){
        tsum += times.at(i);
    }


    int m = 0;
    cin >> m;
    vector<int> p(m+1);
    vector<int> x(m+1);

    for (int i=1;i<=m;i++){
        cin >> p.at(i) >> x.at(i);
    }

    for(int i=1;i<=m;i++){
        cout << tsum - (times.at(p.at(i))-x.at(i)) << endl;
    }

}

Measured memory_bytes: 256
<?php
    fscanf(STDIN, "%d %d %d", $a, $b, $t);
    $answer = 0;
    for($i = 1; $i <= 20; $i++){
        if(($i * $a) <= ($t + 0.5)){
            $answer += $b;
        }
    }
    echo $answer;
?>

Measured memory_bytes: 4728
#include <algorithm>
#include <iostream>
#include <iomanip>
#include <cassert>
#include <cstring>
#include <string>
#include <vector>
#include <random>
#include <bitset>
#include <queue>
#include <cmath>
#include <unordered_map>
#include <set>
#include <map>
#define rep(i,n) for (int i=0; i<n;++i)
#define ALL(a)  (a).begin(),(a).end()
#define PI 3.14159265358979
typedef long long ll;
using namespace std;
const ll MOD = 1e9+7LL;
const int INF = 2e9;
ll N, K;

ll dfs(ll a, ll b) { // a<=b
  if (a%b==0) return 0;
  if (a>b) return dfs(a%b, b);
  if (abs(a-b)>a) return a;
  return dfs(abs(a-b), b);
}

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

  cin >> N >> K;
  cout << dfs(N, K) << "\n";
  return 0;
}

Measured memory_bytes: 256
using System;

class Atcoder65
{
    public static void Main()
    {
        string top = Console.ReadLine();
        string bot = Console.ReadLine();

        char top0 = top[0];
        char top1 = top[1];
        char top2 = top[2];

        char bot0 = bot[0];
        char bot1 = bot[1];
        char bot2 = bot[2];

        if (top0 == bot2 && top1 == bot1 && top2 == bot0)
            Console.WriteLine("YES");
        else
            Console.WriteLine("NO");
    }
}

Measured memory_bytes: 11092
#include <iostream>
#include <vector>
#include <chrono>
#include <random>
#include <cassert>

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

int main() {
	std::ios_base::sync_with_stdio(false); std::cin.tie(NULL);
	char ch;
	std::cin >> ch;
	std::cout << ('a' <= ch && ch <= 'z' ? 'a' : 'A') << '\n';
}

Measured memory_bytes: 3640
import java.io.*;
import java.util.*;


public class Main {

	private static Scanner sc;
	private static Printer pr;

	private static void solve() {
		char[] s = sc.next().toCharArray();

		s[5] = ' ';
		s[13] = ' ';

		pr.println(s);
	}

	// ---------------------------------------------------
	public static void main(String[] args) {
		sc = new Scanner(System.in);
		pr = new Printer(System.out);

		solve();

		pr.close();
		sc.close();
	}

	private static class Printer extends PrintWriter {
		Printer(PrintStream out) {
			super(out);
		}
	}
}


Measured memory_bytes: 9684