akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;

#define ll long long
#define INF INT_MAX
#define mod 1000000007ll
#define forn(i,n) for(int i=0;i<n;i++)
#define forab(i,a,b) for(int i=a;i<=b;i++)
#define forba(i,b,a) for(int i=b;i>=a;i--)
#define debx(x) cout << #x << ": " << x << endl
#define debxy(x,y) cout << #x << ": " << x << ' ' << #y << ": " << y << endl
#define YESp cout << "YES" << endl
#define NOp cout << "NO" << endl
#define Yesp cout << "Yes" << endl
#define Nop cout << "No" << endl
#define write(a) cout << a << endl
#define ff first
#define ss second
#define pii pair<int, int>
#define pll pair<ll, ll>
#define pb push_back
#define mp make_pair
#define vi vector<int>
#define vll vector<ll>
#define vvi vector<vector<int>>
#define vpi vector<pair<int, int>>
#define pq priority_queue

ll fast_exp(ll base, ll power){ll ans=1;while(power){if(power&1)ans=(ans*base)%mod;base=(base*base)%mod;power=power>>1;}return ans%mod;}
ll modInv(ll a,ll p){return fast_exp(a,p-2)%p;}
bool is_prime(int n){if(n==1){return false;}int i=2;while(i*i<=n){if(n%i==0){return false;}i+=1;}return true;}
ll gcd(ll a,ll b){if(a==0)return b;return gcd(b,b%a);}

pii moves[] = {{-1, 0}, {1, 0}, {0 ,-1}, {0, 1}};

/****** S ****** X ****** T ****** Y ****** A ****** M ******/

int calc(int x, int y, int z) {
    return x*x + y*y + z*z + x*y + y*z + z*x;
}

int main() {
    int n, count = 0;
    cin >> n;
    int a[n+1] = {0};
    int x = 1, y = 1, z = 1;
    while(calc(x, y, z) <= n) {
        while(calc(x, y, z) <= n) {
            while(calc(x, y, z) <= n) {
                int ans = calc(x, y, z), num;
                if(x == y && x == z) num = 1;
                else if(x == y || x == z || y == z) num = 3;
                else num = 6;
                a[ans] += num;
                z++;
            }
            y++;
            z = y;
        }
        x++;
        y = x;
        z = x;
    }
    forab(i, 1, n) cout << a[i] << endl;
}

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

int main() {
  int n, m; cin >> n >> m;
  vector<pair<int, int>> students(n);
  vector<pair<int, int>> checkpoints(m);
  vector<int> ans(n);

  int x, y;
  for (auto& e: students) cin >> x >> y, e = make_pair(x, y);
  for (auto& e: checkpoints) cin >> x >> y, e = make_pair(x, y);
  for (int i = 0; i < n; i++) {
    int min_idx = 0;
    int min_dst = abs(students[i].first - checkpoints[0].first)
                  + abs(students[i].second - checkpoints[0].second);
    for (int j = 0; j < m; j++) {
      int dst = abs(students[i].first - checkpoints[j].first)
                + abs(students[i].second - checkpoints[j].second);
      if (dst < min_dst) {
        min_dst = dst;
        min_idx = j;
      }
    }
    ans[i] = ++min_idx;
  }
  for (auto e: ans) cout << e << endl;
}

Measured memory_bytes: 256
import sys

abcd=input()

for i in range(8):
	tempsum=int(abcd[0])
	tempmoji=abcd[0]
	
	for j in range(3):
		if(i>>j) & 1:
			tempsum += int(abcd[j+1])
			tempmoji = tempmoji + "+" + abcd[j+1]
		else:
			tempsum -= int(abcd[j+1])
			tempmoji = tempmoji + "-" + abcd[j+1]
	if tempsum == 7:
		print(tempmoji + "=7")
		sys.exit()



Measured memory_bytes: 3060
#include<bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
using LL = long long;
using p = pair<int,int>;
const LL MX = 2000000;

int main(){
	int N;cin >> N;
	vector<LL> A(N);
	vector<LL> cnt(MX);
	rep(i,N){
		int tmp;cin>>tmp;
		A[i] = tmp;
		++cnt[tmp];
	}
	
	LL res = 0;
	rep(j,MX){
		if(cnt[j]>=2) res += cnt[j]*(cnt[j]-1)/2;
	}


	rep(i,N){
		LL ans = res;
		if(cnt[A[i]]>=2){
			ans -= cnt[A[i]]*(cnt[A[i]]-1)/2;
			ans += (cnt[A[i]]-1)*(cnt[A[i]]-2)/2;
		}
		cout << ans << endl;
	}

}



Measured memory_bytes: 20396
#include <iostream>
#include <vector>
 
using namespace std;
 
int main() {
  int N;
  cin >> N;
  vector<int> A(N + 1), B(N);
  for (auto &a : A) cin >> a;
  for (auto &b : B) cin >> b;
  long long ans{};
  for (int i = 0; i != N; ++i) {
    auto d = min(B[i], A[i] + A[i + 1]);
    ans += d;
    A[i + 1] -= max(d - A[i], 0);
  }
  cout << ans << endl;
}

Measured memory_bytes: 1024
#include<iostream>
#include<stdio.h>
#include<algorithm>
using namespace std;

int main() {
    int n;
    cin >> n;
    int card[4][14] = {{0},};
    char suits[4] = {'S', 'H', 'C', 'D'};
    char suit;
    int num;
    for(int i = 0; i < n; ++i) {
        cin >> suit >> num;
        if(suit == 'S') {
            card[0][num] = 1;
        }
        else if(suit == 'H') {
            card[1][num] = 1;
        }
        else if(suit == 'C') {
            card[2][num] = 1;
        }
        else if(suit == 'D') {
            card[3][num] = 1;
        }
    }
    for(int i = 0; i < 4; ++i) {
        for(int j = 1; j < 14; ++j) {
            if(card[i][j] == 0) {
                printf("%c %d\n", suits[i], j);
            }
        }
    }

    return 0;

}


Measured memory_bytes: 3220
#include <algorithm>
#include <bitset>
#include <cassert>
#include <cmath>
#include <cstdlib>
#include <cstring>
#include <deque>
#include <fstream>
#include <iomanip>
#include <iostream>
#include <limits>
#include <map>
#include <numeric>
#include <queue>
#include <random>
#include <set>
#include <sstream>
#include <stack>
#include <unordered_map>
#include <unordered_set>
#include <vector>

#define len(X) ((int)(X).size())

#ifdef __LOCAL
#define DBG(X) cout << #X << "=" << (X) << '\n';
#define SAY(X) cout << (X) << '\n';
#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>;

const int INT_INF = (int)(2e9);
const ll  LL_INF = (ll)(2e18);

const int NIL = -1;
static mt19937 _g(time(nullptr));

std::string pad(int num)
{
    char buffer[4];
    std::snprintf(buffer, sizeof(buffer), "%03d", num);
    return buffer;
}

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> inline T sign(T x) { return T(x > 0) - T(x < 0); }
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> inline ostream& operator<<(ostream& os, const vector<T>& v) { for (auto el : v) cout << el << " "; return os; }
template<typename T> inline T fetch() { T ret; cin >> ret; return ret; }
template<typename T> inline vector<T> fetch_vec(int sz) { vector<T> ret(sz); for (auto& elem : ret) cin >> elem; return ret; }

#ifdef _MSC_VER
#  include <intrin.h>
#  define __builtin_popcount __popcnt
#endif

int solve()
{
    int N;

    std::cin >> N;

    vector<int> sub(N, 0);

    for (int i = 0; i < N - 1; ++i) {
        int boss;
        cin >> boss;
        sub[boss-1]++;
    }

    for (int i : sub)
        cout << i << '\n';

    return 0;
}

int main()
{
//    std::cout << solve() << std::endl;
    solve();

    return 0;
}

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

using namespace std;
typedef long long ll;

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

    string ans = "No";
    for(int i=1; i<10; i++){
        if(n/i < 10 && n%i ==0){
            ans =  "Yes";
            break;
        }
    }

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

Measured memory_bytes: 256
def rot_n(c, n):
	if "A" <= c and c <= "Z":
		return chr((ord(c) - ord("A") + int(n)) % 26 + ord("A"))

def rot(s, n):
	c = (rot_n(c, n) for c in s)
	print("".join(c))


n = int(input())
s = input()
rot(s, n)

Measured memory_bytes: 3060
require 'prime'

P = 1_000_000_007

def modPow(x, n, m)
  ans = 1
  while n > 0
    ans = ans * x % m if n & 1 == 1
    x = x * x % m
    n /= 2
  end
  ans
end

def inv(a)
  modPow(a, P - 2, P)
end

def nCr(n, r)
  Frac[n] * inv(Frac[n - r] * Frac[r] % P) % P
end

def nHr(n, r)
  nCr(n + r - 1, r)
end

N, M = gets.split.map(&:to_i)

xs = M.prime_division.map{|n, i| i}
Frac = [1]
for i in 1..(N + 100)
  Frac << Frac.last * i % P
end

ans = 1
xs.each do |x|
  ans = ans * nHr(N, x) % P
end

puts ans


Measured memory_bytes: 2872
#include<bits/stdc++.h>
using namespace std;
int main()
{
	int w,h,n;cin>>w>>h>>n;
	int xi=0,yi=0;
	for(int i=0;i<n;i++)
	{
		int x1,y1,a;cin>>x1>>y1>>a;
		if(a==1)
		{
			xi=max(xi,x1);
		}
		else if(a==2)
		{
			w=min(w,x1);
		}
		else if(a==3)
		{
			yi=max(yi,y1);
		}
		else if(a==4)
		{
			h=min(h,y1);
		}
	}
	if(xi<=w&&yi<=h)
	{
		cout<<(w-xi)*(h-yi);
	}
	else cout<<0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
  #include <ext/pb_ds/assoc_container.hpp> 
#include <ext/pb_ds/tree_policy.hpp>
#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("O3")
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
  using namespace std;
using namespace __gnu_pbds;
  #define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update>
  #define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
  #define endl "\n"
  #define int long long
  #define double long double
  #define all(v) v.begin(),v.end()
  #define rep(i,a,b) for(int i = a; i <=b; i++)
  #define rep2(i,a,b) for(int i = a; i>=b; i--)
  #define f first
  #define s second
  #define PB push_back
  #define MP make_pair
  #define db long double
  #define trace1(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 trace5(a, b, c, d, e)    cerr<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<" | "<<#e<< ": "<<e<<endl
  #define trace6(a, b, c, d, e, f) cerr<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<" | "<<#e<< ": "<<e<<" | "<<#f<<": "<<f<<endl
  #define cases int testcases;cin>>testcases; while(testcases--)
  const double PI = acos(-1);
  const int N = 200005;
  int mod = 1e9 + 7;
     

    
int32_t main()
{
       




      int n;
      cin >> n;
      int arr[n+1];

      int a = 1;
      int ans = 0;

      rep(i,1,n)
      {
        cin >> arr[i];
        if(arr[i] == a)
        {
          ans++;
          a++;
        }
        
      }




      ans = n - ans;

      if(ans >= n) 
      {
        ans = -1;
      }

      cout << ans ;
   return 0;
}       

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

#define ll long long
#define linf (1ll << 60)
#define all(x) (x).begin(), (x).end()

// -------- Main Code -------- //
void runcase() {
    ll row, col, M;
    cin >> row >> col >> M;
    
    vector<ll> cnt_row(row, 0);
    vector<ll> cnt_col(col, 0);
    unordered_map<ll, ll> map;


    for (int i=0; i<M; i++) {
        int r, c;
        cin >> r >> c;
        cnt_row[r-1] ++;
        cnt_col[c-1] ++;
        ll idx = col * (r-1) + (c-1);
        map[idx] = 1;
    }

    ll res = 0;

    ll a, b;
    a = *max_element(all(cnt_row));
    b = *max_element(all(cnt_col));
    
    res = a + b - 1;

    vector<ll> va, vb;
    for (int i=0; i<row; i++) if (cnt_row[i] == a) va.emplace_back(i);
    for (int i=0; i<col; i++) if (cnt_col[i] == b) vb.emplace_back(i);

    for (int i=0; i<va.size(); i++) for (int j=0; j<vb.size(); j++) {
        if (map[col * va[i] + vb[j]] == 0) {
            cout << res + 1 << "\n";
            return;
        } 
    }

    cout << res << "\n";
}

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    // int t;
    // cin >> t;
    // while (t-- > 0)
        runcase();
    return 0;
}


Measured memory_bytes: 29784
#include<iostream>
#include<string>
#include<algorithm>
#include<cmath>
#include<iomanip>
#include<cstring>
#include<map>
#include<vector>
#include<queue>
#include<stack>
#include<climits>
#include<set>
#include<utility>
#include<typeinfo>
using namespace std;
typedef long long int ll;
typedef pair<int, int> P;
#define rep(i, n) for(int i=0; i<n; i++)
const ll MOD=1e9+7;

int cnt_digits(ll n){
	int digits=0;
	while(n>0){
		n/=10;
		digits++;
	}
	return digits;
}

int main(){

	ll n;
	cin >> n;
	int ans=cnt_digits(n);
	for(ll i=1; i*i<=n; i++){
		if(n%i!=0){
			continue;
		}
		const ll a=n/i;
		const int b=max(cnt_digits(a), cnt_digits(i));
		ans=min(ans, b);
	}
	cout << ans << endl;

	return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using lint = long long;
using pint = pair<int, int>;
using vec = vector<int>;
using mat = vector<vector<int>>;
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define all(v) v.begin(), v.end()
#define endl "\n"

constexpr int MOD = 1000000007;
const int INF = 1 << 30;

int main() {
    int n;
    cin >> n;
    vec h(n);
    rep(i, n) cin >> h[i];

    int res = 0;
    int acv = 0;

    rep(i, n) {
        if (acv >= h[i]) {
            acv = h[i];
        }
        else {
            res += h[i] - acv;
            acv = h[i];
        }
    }

    cout << res << endl;
    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define int long long
#define all(c) c.begin(), c.end()
#define FAST ios_base::sync_with_stdio(false) , cin.tie(NULL);
#define pii pair<int,int>
#define pb push_back
#define F first
#define S second
#define endl "\n"
#define bitcnt(n) __builtin_popcountll(n)
#define setpre(n) cout << fixed << setprecision(n)
#define tr(c) for(const auto& x : c )cout << x << " "; cout << "\n";
#define PI acos(-1LL)


#ifdef LOCAL
string to_string(const string& s){
    return '"' + s + '"';
}
string to_string(const char* s) {
    return to_string((string) s);
}
string to_string(bool b) {
    return (b ? "true" : "false");
}
template <typename A, typename B>
string to_string(pair<A, B> p) {
    return "(" + to_string(p.first) + ", " + to_string(p.second) + ")";
}
template <typename T>
string to_string(T v){
    bool first = true;
    string res = "{";
    for(const auto& x: v){
        if(!first) res+=", ";
        first = false;
        res+=to_string(x);
    }
    res+="}";
    return res;
}
void bug() { cerr << endl; }
template<typename Head, typename... Tail>
void bug(Head H, Tail... T) {
    cerr << " " << to_string(H);
    bug(T...);
}
#define debug(...) cerr << "[" << #__VA_ARGS__ << "]:", bug(__VA_ARGS__);
#else
#define debug(...) 11;
#endif

const int M = 1000000007;
const int N = 2e6 + 5;
const long long INF = 2e18 + 12;
int powmod(int x,int n , int mod = M)
{
    int result=1;
    while(n>0)
    {
        if(n % 2 ==1)
            result=(result%mod* x%mod)%mod;
        x=(x%mod*x%mod)%mod;
        n=n/2;
    }
    return result;
}
void solve(){
    int n;
    cin >> n;
    vector<pii> v(n);
    for(int i=0; i<n; i++){
        cin >> v[i].F >> v[i].S;
    }
    int ans = 0, P[] = {-1,1};
    for (int p : P) {
        for (int q : P) {
            int s = p * v[0].F + q * v[0].S;
            for (int i = 1; i < n; ++i) {
                int cur = p * v[i].F + q * v[i].S;
                ans = max(ans, cur - s);
                s = min(s, cur);
            }
        }
    }
    cout << ans << endl;

}
signed main(){
    FAST
#ifdef TIMER
    clock_t start;
    double duration;
    start = clock();
#endif
    int tc = 1;
//    TODO: check for tc
//    cin >> tc;
    for (int tt = 1; tt <= tc; tt++) {
        solve();
    }
#ifdef TIMER
    duration = (clock() - start) / (double) CLOCKS_PER_SEC;
    cerr <<"\n\nTotal time elapsed: "<< duration <<"sec\n";
#endif
}


Measured memory_bytes: 6344
#include<iostream>
using namespace std;
main(){
  int n,k,l;
  cin>>n>>k;
  l=n-1+(n-2)*(n-1)/2-k;
  if(l+1<n){cout<<-1;return 0;}
  cout<<l<<"\n";
  for(int i=1;i<n&&l;++i)for(int j=i+1;j<=n&&l;++j)cout<<i<<" "<<j<<"\n",l--;
}

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

using namespace std;
using ll = long long;

int main() {
	const ll MOD = 1e9 + 7;
	int N;
	cin >> N;
	vector<int> C(N + 1);
	for (int i = 1; i <= N; ++i) { cin >> C[i]; }

	vector<int> c(N + 1, -1);
	vector<int> d(2e5 + 1, -1);
	for (int i = 1; i <= N; ++i) {
		if (d[C[i]] > 0) {
			c[i] = d[C[i]];
		}
		d[C[i]] = i;
	}

	vector<ll> dp(N + 1, 0);
	dp[1] = 1;
	for (int i = 2; i <= N; ++i) {
		dp[i] = dp[i - 1];
		if ((c[i] > 0) && (i - c[i] > 1)) {
			(dp[i] += dp[c[i]]) %= MOD;
		}
	}

	cout << dp[N] % MOD << endl;

	return 0;
}


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

// def
#define debug(x) cout << #x << ": " << x << endl
#define out(x) cout << x << endl
#define repeat(i, a, b) for (int i = (a); i < (b); i++)
#define revrepeat(i, a, b) for (int i = (b)-1; i >= (a); i--)
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define revrep(i, n) for (int i = (n)-1; i >= 0; i--)
#define for_each(e, v) for (auto &e : v)
#define all(x) (x).begin(), (x).end()
#define CYES cout << "Yes" << endl
#define CNO cout << "No" << endl
#define SPC(x) cout << fixed << setprecision(x)
#define ZERO(a) memset(a, 0, sizeof(a))
#define MINUS(a) memset(a, 0xff, sizeof(a))

typedef long long ll;
typedef long double ld;
typedef vector<int> vi;
typedef vector<vector<int>> vii;
typedef vector<ll> vl;
typedef vector<vector<ll>> vll;
typedef pair<int, int> P;
const int MOD = 1e9 + 7;
const int INF = __INT_MAX__;               // 2^31 - 1
const long long INFLL = __LONG_LONG_MAX__; // 2^61 - 1
const int MAX_N = 1e5 + 5;
const double PI = acos(-1);

ll dp[3005][3005];
ll a[3005];
bool judge_bin;
ll solve(int l, int r) {
    if (dp[l][r])
        return dp[l][r];

    bool plus = (r + l) % 2 == judge_bin;
    if (l == r) {
        if (plus)
            return a[l];
        else
            return -a[l];
    }

    // debug(l);
    // debug(r);
    if (plus) {
        dp[l][r] = max(solve(l + 1, r) + a[l], solve(l, r - 1) + a[r]);
    } else {
        dp[l][r] = min(solve(l + 1, r) - a[l], solve(l, r - 1) - a[r]);
    }
    return dp[l][r];
};

int main() {
    ll n;
    cin >> n;
    rep(i, n) cin >> a[i + 1];
    judge_bin = (n + 1) % 2;
    out(solve(1, n));
    return 0;
}


Measured memory_bytes: 70144
#include <iostream>

using namespace std;
using ll = long long;
using ld = long double;

#define ALL(x) begin(x), end(x)
#define REP(i, n) for (size_t i = 0, i##_len = (n); i < i##_len; ++i)

int main() {
  char c;
  cin >> c;
  cout << (c - 'A' < 26 ? 'A' : 'a') << endl;
}


Measured memory_bytes: 3556
n = int(input())
L = [[int(i) for i in input().split()] for j in range(n)]
L = sorted(L, key=lambda x:x[1])
num = 0
for l in L:
  num += l[0]
  if num <= l[1]:
    continue
  else:
    print("No")
    exit()
print("Yes")

Measured memory_bytes: 42716
import numpy as np
from collections import defaultdict

n = int(input())
a = np.array(list(map(int, input().split())))
memo = defaultdict(int)

a = a[np.where(a%2==0)]

for i in range(len(a)):
    if a[i] % 3 == 0:
        memo[i] += 1
    elif a[i] % 5 == 0:
        memo[i] += 1

print("APPROVED") if sum(memo.values()) == len(a) else print("DENIED")

Measured memory_bytes: 12484
#include <bits/stdc++.h>
using namespace std;
typedef pair<int,int> P;
typedef long long ll;
typedef long double ld;
const int inf=1e9+7;
const ll longinf=1LL<<60;
#define REP(i,m,n) for(int i=(int)(m) ; i < (int) (n) ; ++i )
#define rep(i,n) REP(i,0,n)
#define F first
#define S second

const int mx=1010;
const ll mod=1e9+7;

char data[310][310];
vector<vector<int>> outdata(310,vector<int>(310));
//int outdata[310][310];

int h,w,k;
int cstraw[310];



int main() {
  cin >> h >> w >> k;
  for(int i=0; i<h; i++){
    cstraw[i]=0;
    for(int j=0; j<w; j++){
      cin >> data[i][j];
      if(data[i][j]=='#'){cstraw[i]++;}
    }
  } //map road

  int sn=1;
  int fs=350;
  for (int i=0; i<h; i++) { 
    int sc=0;
    if(cstraw[i]!=0){
      for (int j=0; j<w; j++) {
        outdata[i][j] = sn;
        if(data[i][j]=='#'){
          sc++;
          if(sc!=cstraw[i]){sn++;}
        }
      }
      sn++;
      fs = min(fs,i);
    }
  }

  int ls=-1;
  for(int i=0; i<h; i++){
    if(i<fs){
      for(int j=0; j<w; j++){ cout << outdata[fs][j] << " "; }
    } else if(cstraw[i]!=0){
      for(int j=0; j<w; j++){ cout << outdata[i][j] << " "; }
      ls = i;
    } else {
      for(int j=0; j<w; j++){ cout << outdata[ls][j] << " "; }
    }
    cout << endl;
  }
  return 0;
}  


Measured memory_bytes: 1280
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef long int li;
#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
typedef pair<ll, ll>P;
typedef tuple<ll, int, int>T;
#define PI 3.14159265358979

vector<ll> divisor(int64_t n) {
  vector<ll> ret;
  for(int64_t i = 1; i * i <= n; i++) {
    if(n % i == 0) {
      ret.push_back(i);
      if(i * i != n) ret.push_back(n / i);
    }
  }
  sort(begin(ret), end(ret));
  return (ret);
}
int main(){
  int N;
  cin>>N;
  vector<int>A(N);
  map<int,int>mp;
  rep(i,N){
    cin>>A[i];
    mp[A[i]]++;
  }
  sort(A.begin(),A.end());
  int cnt=0;
  set<int>se;
 rep(j,N){
    int n=A[j];
   int flag=0;
  for(int i = 2; i * i <= n; i++) {
    if(n % i == 0) {
      if(mp.count(i)){flag=1;break;}
      if(mp.count(n/i)){flag=1;break;}
    }
  }
  if(flag==0){cnt++;se.insert(n);} 
 }
  if(!mp.count(1)){
  for(auto k:se){
    int g=mp[k];
    if(g>1){cnt-=g;}
  }
  cout<<cnt;
  }
  else{
    if(mp[1]==1){cout<<1;}
    else{cout<<0;}
  }
}

Measured memory_bytes: 22732
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define In_The_Name_Of_Allah_The_Merciful ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define Alhamdulillah return 0;
#define debug(n) cerr << "[" << #n << " = " << n << "]" << endl
#define all(v) v.begin(),v.end()
#define rall(v) v.rbegin(),v.rend()
#define F_OR(i, a, b, s) for (int i = (a); ((s) > 0 ? i < (b) : i > (b)); i += (s))
#define F_OR1(e) F_OR(i, 0, e, 1)
#define F_OR2(i, e) F_OR(i, 0, e, 1)
#define F_OR3(i, b, e) F_OR(i, b, e, (b)<(e)?1:-1)
#define F_OR4(i, b, e, s) F_OR(i, b, e, s)
#define GET5(a, b, c, d, e, ...) e
#define F_ORC(...) GET5(__VA_ARGS__, F_OR4, F_OR3, F_OR2, F_OR1)
#define lp(...) F_ORC(__VA_ARGS__)(__VA_ARGS__)
#define each(x, a) for (auto &x: a)
#define pb push_back
template<class A> void read(vector <A>& v);
template<class A, size_t S> void read(array <A, S>& a);
template<class T> void read(T& x) {
    cin >> x;
}
void read(double& d) {
    string t;
    read(t);
    d=stod(t);
}
void read(long double& d) {
    string t;
    read(t);
    d=stold(t);
}
template<class H, class... T> void read(H& h, T&... t) {
    read(h);
    read(t...);
}
template<class A> void read(vector<A>& x) {
    each(a, x)
        read(a);
}
template<class A, size_t S> void read(array<A, S>& x) {
    each(a, x)
        read(a);
}

const int di[8] = {0 , 0 , 1 , -1 , 1 , 1 , -1 , -1};
const int dj[8] = {1 , -1 , 0 , 0 , 1 , -1 , 1 , -1};


void Suhaib_Sawalha (){

    int n , k;
    read(n,k);
    int d , a;
    int ex[n] = {};
    while (k--){
        read(d);
        while (d--){
            read(a);
            ex[a-1] = 1;
        }
    }

    cout << n - accumulate(ex,ex+n,0);

}

int main(){
                                In_The_Name_Of_Allah_The_Merciful   /* بسم الله الرحمن الرحيم  */
#ifndef ONLINE_JUDGE
    freopen("SuhaibSawalha1.txt","r",stdin);
#endif
// int _;cin>>_;for(int i=1;i<=_;++i,cout<<'\n')
        Suhaib_Sawalha();
                                         Alhamdulillah                    /* الحمد لله */
}


Measured memory_bytes: 3544
#include<iostream>
#include<algorithm>
#include<string>
#include<vector>
#include<cmath>
#include<stack>
#include<queue>
#include<cstdlib>
#include<cstdio>
#include<utility>
#include<list>
using namespace std;
int Sum(int n){
	int sum=0;
	while(n>0){
		sum += n%10;
		n /= 10;
	}
	return sum;
}

int main(){
	int n,num=0;
	int res=0;
	cin>>n;
	res = Sum(n);

	if(n%res == 0)cout<< "Yes" <<endl;
	else cout<< "No" <<endl;
	
	return 0;
}


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

const int MAX = 1510000;
const ll MOD = 1000000007;
long long fac[MAX], finv[MAX], inv[MAX];
bool initialized = false;

/**
 * @fn
 * This function must be called at first.
 */
void combination_init() {
    initialized = true;
    fac[0] = fac[1] = 1;
    finv[0] = finv[1] = 1;
    inv[1] = 1;
    for (int i = 2; i < MAX; i++) {
        fac[i] = fac[i - 1] * i % MOD;
        inv[i] = MOD - inv[MOD % i] * (MOD / i) % MOD;
        finv[i] = finv[i - 1] * inv[i] % MOD;
    }
}

void prime_factorize(long long N, map<ll, ll> &ma) {
    for (long long a = 2; a * a <= N; ++a) {
        if (N % a != 0)
            continue;
        long long ex = 0; // 指数

        // 割れる限り割り続ける
        while (N % a == 0) {
            ++ex;
            N /= a;
        }

        // その結果を push
        ma[a] = max(ma[a], ex);
    }

    // 最後に残った数について
    if (N != 1)
        ma[N] = max(ma[N], (ll)1);
}

long long modpow(long long a, long long n, long long mod) {
    long long res = 1;
    while (n > 0) {
        if (n & 1)
            res = res * a % mod;
        a = a * a % mod;
        n >>= 1;
    }
    return res;
}

int main() {
    int N;
    cin >> N;
    vector<int> A(N);
    combination_init();
    ll lcm = 1;
    map<ll, ll> ma;
    rep(i, N) {
        cin >> A[i];
        prime_factorize(A[i], ma);
    }

    for (auto m : ma) {
        lcm *= modpow(m.first, m.second, MOD);
        lcm %= MOD;
    }

    ll ans = 0;
    rep(i, N) {
        ans += (lcm * inv[A[i]] % MOD);
        ans %= MOD;
    }

    cout << ans << endl;
}

Measured memory_bytes: 36352
#include<bits/stdc++.h>
using namespace std;
int main()
{
    long long a;
    cin>>a;
    long long s=a/11*2;
    a%=11;
    if(a>=1&&a<=6)s++;
    if(a>=7&&a<=10)s+=2;
    cout<<s<<endl;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define pb push_back
#define mp make_pair
#define se second
#define fi first
#define ll long long
#define INF INT_MAX
#define mod 1000000007
#define chutiyaap ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
using namespace std;
ll pw(ll a, ll b) {
    if (b == 0) return 1;
    ll t = pw(a, b / 2);
    if (b % 2 == 0) return (t * t)%mod;
    else return ((t * t)%mod * a)%mod;
}
int main()
{
	int l,r,d;cin>>l>>r>>d;
	int res=0;
	for(int i=l;i<=r;i++)if(i%d==0)res++;
	cout<<res;
}


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

#define ll long long
#define eb emplace_back
#define nl '\n'
#define deb(x) cerr << #x" = " << x << nl
#define in() ( { int a ; scanf("%d", &a); a; } )

const int N = 3e5 + 9;
const int mod = 1e9 + 7;

ll f(ll n)
{
    return n * (n - 1) / 2;
}
int a[N], cnt[N];
int32_t main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);

    int n; cin >> n;
    for(int i = 1; i <= n; i++){
        int k; cin >> k; cnt[k]++;
        a[i] = k;
    }
    ll ans = 0;
    for(int i = 1; i <= n; i++) ans += f(cnt[i]);
    for(int i = 1; i <= n; i++){
        int k = a[i];
        ll p = ans;
        ans -= f(cnt[k]);
        cnt[k] --;
        ans += f(cnt[k]);
        cout << ans << nl;
        cnt[k]++;
        ans = p;
    }
    return 0;
}


Measured memory_bytes: 3712
#include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
typedef long long ll;
int main() {
	while (true) {
		long long d, n, m;
		cin >> d;
		if (d == 0) return 0;
		cin >> n >> m;
		vector<ll>s(n + 1);
		vector<ll>k(m);
		s[0] = 0;
		for (int i = 1; i < n; i++) cin >> s[i];
		s[n] = d;
		for (int i = 0; i < m; i++) cin >> k[i];
		sort(s.begin(), s.end());
		ll res = 0;
		for (int i = 0; i < m; i++) {
			if (k[i] == 0) continue;
			int up = lower_bound(s.begin(), s.end(), k[i]) - s.begin();
			res += min(s[up] - k[i], k[i] - s[up - 1]);
		}
		cout << res << endl;
	}
	return 0;
}


Measured memory_bytes: 3600
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll, ll> l_l;
typedef pair<int, int> i_i;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))

const ll mod = 1000000007;

int main() {
    int A,B;
    cin >> A >> B;
    cout << A * B <<  endl;
    
    return 0;
}


Measured memory_bytes: 3624
#include<bits/stdc++.h>
using namespace std;
int main(){
    unsigned long long n;
    unsigned long long cnt=0;
    cin>>n;
    /*if(n==2) {
        cout<<0<<endl;
        return 0;
    }*/
    for(long long i = 1 ; i<sqrt(n);i++){
        if(n%i==0){
           // cout<<" =i "<<endl;
           long long dd = n/i;
           if(i<dd-1){
                cnt += (n/i)-1;
           }
        }
    }
    cout<<cnt<<endl;
    return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
const int mod=998244353;
const int mex=200002;
#define ll long long 
#define test int t;cin>>t;while(t--)
#define fast  ios_base::sync_with_stdio(false);cin.tie(NULL);
#define fo(i,a,n) for(int i=a;i<n;i++)
#define rfo(i,a,b) for(int i=a;i>=b;i--)
#define bg begin()
#define en end()
#define fi first
#define se second
#define ub upper_bound
#define lb lower_bound
#define pb push_back
#define veci vector<int>
#define veclli vector<long long int> 
#define all(x) x.begin(),x.end()
#define sci(x) scanf("%d",&x);
#define scc(x) scanf("%c",&x);
#define scs(x) scanf("%s",x);
#define debug(arr,n) for(int i=0;i<n;i++) printf("%d ",arr[i]);
#define sz(x) x.size()
#define loop(x) for(auto it=x.begin();it!= x.end();it++) 
 
 
ll int power(ll int a,ll int b)
{
	ll int ans=1,f=a;
	while(b)
	{
		 if(b&1)
		 ans=(ans*f)%mod;
		 b=b>>1;
		 f=(f*f)%mod;
	}
	return ans%mod;
}
ll int dp[3001][3001];
int main()
{
   int n,s;
   cin>>n>>s;
   int a[n];
   fo(i,0,n)
   cin>>a[i];
   dp[0][0]=2;
   dp[a[0]][0]=1;
   fo(i,1,n)
   fo(j,0,s+1)
   {
       dp[j][i]=2*dp[j][i-1];
       if((j-a[i])>=0) dp[j][i]+=dp[j-a[i]][i-1];
       dp[j][i]%=mod;
   }
   cout<<dp[s][n-1]<<endl;


}

Measured memory_bytes: 74004
#include<iostream>
#include<vector>
#include<algorithm>
#include<stdlib.h>
#include<utility>
#include<functional>
#include<cfenv>
#include<cmath>
#include<string>
#include<queue>
#include<stack>
#include<map>
#include<set>

#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define vint vector<int>
#define vvint vector<vint>
#define P pair<int,int>
#define INT_MAX 2147483647
#define MOD 1000000007
using namespace std;
typedef long long ll;


int main(void) {
	ll h, w; cin >> h >> w;
	if (h == 1 || w == 1) {
		cout << 1 << endl;
		return 0;
	}

	cout << ((h*w) + 1) / 2 << endl;
	return 0;
}



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

namespace ConsoleApplication2
{ 
    class Program
    {
    static void Main(string[] args)
        {
            var ab = Console.ReadLine().Split().Select(int.Parse).ToArray();
            var a = ab[0];
            var b = ab[1];
            Console.WriteLine("{0} {1}",a * b,(a + b) * 2);
        }
    }
}

Measured memory_bytes: 9396
#include <iostream>
#include <map>
#include <vector>
#include <set>
#include <string>
#include <algorithm>


int main(void)
{
	int n, t;
	int sum = 0;
	std::cin >> n >> t;
	std::vector<int> arr(n);
	for (auto&a : arr) {
		std::cin >> a;
		sum += a;
	}
	sum /= t;
	int max = *std::max_element(arr.begin(), arr.end());
	if (sum > max) max = sum;
	while (true)
	{
		int sum = 0;
		int c = 1;
		for (auto a : arr) {
			sum += a;
			if (sum > max) {
				c++;
				if (c > t) break;
				sum = a;
			}
		}
		if (c > t) {
			max++;
			continue;
		}
		else break;

	}

	std::cout << max << std::endl;

	return 0;
}

Measured memory_bytes: 3092
def TS(G,v,e):
    INF = 16000
    DP = [[INF for _ in range(v)] for _ in range(2**v)]
    #DP[i][j]:訪問済みエリアのリストがiでjにいるような最短距離
    DP[0][0] = 0
    #   どれも訪問してない状態は00...0(長さv)として訪問済みを表現
    for i in range(2**v):
        for j in range(v):
            for k in range(v):
                if i ^ 2**k < i and j != k \
                and DP[i ^ 2**k][k] + G[k][j] < DP[i][j]:
                    DP[i][j] = DP[i ^ 2**k][k] + G[k][j]

    if DP[2**v-1][0] != INF:
        return DP[2**v-1][0]
    else:
        return -1

def main():
    v,e = map(int,input().split())
    INF = 16000
    G = [[INF for _ in range(v)] for _ in range(v)]
    for i in range(e):
        s,t,d = map(int,input().split())
        G[s][t] = d

    print(TS(G,v,e))

if __name__ == "__main__":
    main()



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

int main() {
  int n;
  cin >> n;
  vector<int> v(n);
  for (int i = 0; i < n; i++)
  cin >> v.at(i);

  auto itr = unique(v.begin(), v.end());
  v.erase(itr, v.end());

  for (int i = 0; i < v.size(); i++) {
    if (i == v.size() - 1) {
      cout << v.at(i) << endl;
    } else {
      cout << v.at(i) << " ";
    }
  }
}


Measured memory_bytes: 3100
#include<bits/stdc++.h>
using namespace std;
/*#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
/*template <typename T>
using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
*/typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef pair<ll,ll> pl;
typedef pair<int,int> pii;

#define int ll
#define LOCAL 0
#define dbg(x) cout << #x << " is " << x << "\n"
#define gll(x) scanf("%d",&x)
#define gll2(x,y) scanf("%d%d",&x,&y)
#define gll3(x,y,z) scanf("%d%d%d",&x,&y,&z)
#define gllarr(arr,n) f(i,n) gll(arr[i]);
#define sz(x) ((int)x.size())
#define s(x) sort(x.begin(),x.end())
#define all(v) v.begin(),v.end()
#define rs(v) { s(v) ; r(v) ; }
#define r(v) {reverse(all(v));}
#define pb push_back
#define f(i,n) for(int i=0;i<n;i++)
#define fr(i,n) for(int i=n-1;i>=0;i--)
#define rep(i,a,b) for(int i=a;i<=b;i++)
#define repr(i,a,b) for(int i=a;i>=b;i--)

const ll mod = 998244353;
const ll inf = (ll)1e16;
const ld eps = 1e-12;
const ll N = (int)1e5 + 5;
const ll LOGN = 19;
const ld PI = 3.14159265358979323846;
inline ll mul(ll a, ll b, ll m = mod) { return (ll)(a * b) % m;}
inline ll add(ll a, ll b, ll m = mod) { a += b; if(a >= m) a -= m; if(a < 0) a += m; return a;}
inline ll power(ll a, ll b, ll m = mod) { if(b == 0) return 1; if(b == 1) return (a % m); ll x = power(a, b / 2, m); x = mul(x, x, m); if(b % 2) x = mul(x, a, m); return x;}

int n, m, dist[N];
bool vis[N], done[N];
vector< pair<int, pair<int, int> > > a;
vector< pair<int, int> > start[N];
priority_queue< pair<int, int>, vector<pair<int,int> >, greater<> > Q;

void solve() {
    int last = 0;
    f(i, n + 4) dist[i] = inf, vis[i] = done[i] = false;
    dist[0] = 0;
    vis[0] = true;
    done[0] = true;
    for(auto &it: start[0]) {
        Q.push(it);
        dist[it.second] = it.first;
    }
    while(!Q.empty()) {
        auto it = Q.top();
        Q.pop();
        int u = it.second;
       // dbg(u);
        if(vis[u]) continue;
        vis[u] = true;
        if(u == n - 1) break;
        for(int tt = last + 1; tt <= u; tt++) {
            if(done[tt]) continue;
            done[tt] = true;
            for(auto &qt: start[tt]) {
                int v = qt.second;
                int w = qt.first;
                if(dist[u] + w < dist[v]) {
                    dist[v] = dist[u] + w;
                    Q.push({dist[v], v});
                }
            }
        }  
        last = u;
    }
    // f(i, n) cout<<dist[i]<<' ';
    // cout<<endl;
    if(dist[n - 1] == inf) cout<<"-1";
    else cout<<dist[n - 1];
}

int32_t main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    if (LOCAL) {
        freopen("C:\\Users\\Dishant\\Desktop\\Collection-DEV c++\\input.txt", "r", stdin);
        freopen("C:\\Users\\Dishant\\Desktop\\Collection-DEV c++\\output.txt", "w", stdout);
    }
    cin>>n>>m;
    f(i, m) {
        int u, v, w;
        cin>>u>>v>>w;
        u--, v--;
        a.pb({u, {v, w}});
        start[u].pb({w, v});
    }
    solve();
    return 0;
}


Measured memory_bytes: 11952
#include<cstdio>
#include<cstring>
#include<cmath>
#include<cstdlib>
#include<ctime>
#include<algorithm>
#include<queue>
#include<vector>
#define ll long long
#define max(a,b) (a>b?a:b)
#define min(a,b) (a<b?a:b)
#define inf (1ll<<60)
#define mod 1000000007
#define eps 1e-18
inline ll read()
{
    ll tmp=0; char c=getchar(),f=1;
    for(;c<'0'||'9'<c;c=getchar())if(c=='-')f=-1;
    for(;'0'<=c&&c<='9';c=getchar())tmp=(tmp<<3)+(tmp<<1)+c-'0';
    return tmp*f;
}
using namespace std;
int x[100010],y[100010];
ll f[100010];
int n,m,d;
int main()
{
	int i,j;
	n=read(); m=read(); d=read();
	for(i=1;i<=n;i++)
		for(j=1;j<=m;j++){
			int k=read();
			x[k]=i; y[k]=j;
		}
	for(i=1;i<=n*m;i++)
		if(i>d)f[i]=f[i-d]+abs(x[i]-x[i-d])+abs(y[i]-y[i-d]);
	int q=read();
	for(i=1;i<=q;i++){
		int x=read(),y=read();
		printf("%lld\n",f[y]-f[x]);
	}
	return 0;
}

Measured memory_bytes: 2432
#include <iostream>
#include <vector>
#define For(i,x,y) for(register int i=(x); i<=(y); i++)
using namespace std;
typedef long long ll;
const int maxx=1e6+10;
ll a[maxx];
int main()
{
    ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
    int n,x;
    cin>>n;
    For(i,1,n)cin>>x,a[x]++;
    vector<bool>dv(maxx,true);
    int ans=0;
    For(i,1,maxx)
    {
        if(!a[i])continue;
        if(a[i]==1&&dv[i])ans++;
        for(int j=2; j*i<maxx; j++)dv[i*j]=false;
    }
    cout<<ans<<endl;
    return 0;
}


Measured memory_bytes: 11556
#include <bits/stdc++.h>
#define REP(i, n) for (int i = 0; i < n; i++)
#define REPR(i, n) for (int i = n; i >= 0; i--)
#define FOR(i, m, n) for (int i = m; i < n; i++)
#define ALL(v) v.begin(), v.end()
using namespace std;
typedef long long ll;
typedef long double ld;
int main()
{
  int n,t,cost,time;
  cin >> n >> t;
  int ans = 1e9;
  REP(i,n){
    cin >> cost >> time;
    if(time <= t){
      ans = min(ans,cost);
    }
  }
  if(ans==1e9){
    cout << "TLE" << endl;
  }else{
  	cout << ans << endl;
  }
  return 0;
}


Measured memory_bytes: 256
import collections

N = int(input())
S = [input() for _ in range(N)]

c = collections.Counter(S)

max_num = max(c.values())

l = []
for item in c.items():
    k = item[0]
    v = item[1]
    if v == max_num:
        l.append(k)

l.sort()

for li in l:
    print(li)


Measured memory_bytes: 38760
#include <iostream>
#include <vector>
#include <cstring>
#include <algorithm> // sort

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

using namespace std;


ll euclidean_gcd(ll a, ll b) {
  if(a < b) return euclidean_gcd(b, a);
  ll r;
  while ((r=a%b)) {
    a = b;
    b = r;
  }
  return b; //あまりが0ならそれが、最大公約数
}

ll lcm(ll a,ll b)
{
    ll g = euclidean_gcd(a,b);
    return a / g * b;//オーバーフロー避けで割り算から始める
}

int main(){
    ll N,res;
    cin >> N;
    vector <ll> T(N);

    ll igcd,igcd_tmp,tmp;
    //1個目
    cin >> tmp;
    igcd = tmp;
    ll ilcm = tmp;

    if(N == 1)
    {
        cout << tmp << endl;
        return 0;
    }

    REP(i,N-1)
    {
        cin >> tmp;
        ilcm = lcm(ilcm,tmp);
    }

    //LCM(T1,T2)の連続

    res = ilcm;


    cout << res << endl;

    return 0;

}

Measured memory_bytes: 256
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner sc = new Scanner(System.in);


		int a = sc.nextInt();
		int b = sc.nextInt();
		int c = sc.nextInt();
		int d = sc.nextInt();

		int turn = 0;
		while(a > 0 && c > 0){
			if(turn % 2 == 0){
				c -= b;
			}
			else {
				a -= d;
			}

			turn++;
		}

		System.out.println(turn % 2 == 1 ? "Yes" : "No");

	}

}


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

int main() {
    string s; cin >> s;
    string t; cin >> t;
    sort(s.begin(), s.end(), less<char>());
    sort(t.begin(), t.end(), greater<char>());
    if (s >= t) {
        cout << "No" << endl;
    } else {
        cout << "Yes" << endl;
    }
}


Measured memory_bytes: 256
import java.util.Scanner;

public class Main {
    
    private static boolean isValidMonth (int elem) {
        if (elem >= 1 && elem <= 12) {
            return true;        
        }        
        return false;
    }    

    private static boolean isValidYear (int elem) {
        if (elem >= 0) {
            return true;        
        }        
        return false;
    }    
    
    public static void main (String[] args) {
        try (Scanner sc = new Scanner(System.in)) {
            String s = sc.next();
            int first = Integer.parseInt(s.substring(0,2));
            int second = Integer.parseInt(s.substring(2));
            if ((isValidMonth(first) && isValidYear(second)) && (isValidMonth(second) && isValidYear(first))) {
                System.out.println("AMBIGUOUS");            
            }
            else if ((isValidMonth(first) && isValidYear(second)) && !(isValidMonth(second) && isValidYear(first))) {
                System.out.println("MMYY");            
            }
            else if (!(isValidMonth(first) && isValidYear(second)) && (isValidMonth(second) && isValidYear(first))) {
                System.out.println("YYMM");            
            }
            else {
                System.out.println("NA");    
            }
        }    
    }
}

Measured memory_bytes: 21716
#include <iostream>

int main(){
    //I/O section
    int n;
    std::cin >> n;

    int *arr = new int[n];
    int i = 0;
    for(; i < n; ++i){
        std::cin >> arr[i];
    }
    //std::cout << "\n";

    int k;
    for(k = 0; k < n; ++k){
        std::cout << arr[k] << ( (k < n - 1)? " " : "");
    }
    std::cout << std::endl;

    //insertionSort section
    for(i = 1; i < n; ++i){
        int key = arr[i];
        int j = i - 1;
        while(j >= 0 && arr[j] > key){
            arr[j + 1] = arr[j];
            --j;
        }
        arr[j + 1] = key;

        //process output
        for(k = 0; k < n; ++k){
            std::cout << arr[k] << ( (k < n - 1)? " " : "");
        }
        std::cout << "\n";
    }
}


Measured memory_bytes: 3116
from bisect import bisect_left

n = int(input())
a = list(map(int, input().split()))
a.sort()
ma = a[-1]
mid = ma / 2 # ma/2に最も近いものをとってくればよい

idx = bisect_left(a, mid)

if abs(a[idx] - mid) < abs(a[idx-1] - mid):
	ans_idx = idx
else:
	ans_idx = idx - 1

print(ma, a[ans_idx])


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

void Main() {
    // input
    u_int64_t D, T, S;
    cin >> D >> T >> S;


    // process


    // output
    if (T * S >= D) {
        cout << "Yes" << endl;
    } else {
        cout << "No" << endl;
    }

}

int main() {
    std::cout << std::fixed << std::setprecision(15);
    Main();
    return 0;
}


Measured memory_bytes: 3628
import java.util.*;

public class Main {

  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    char[][] s = new char[N][N];

    int ans = 0;
    String line;
    for (int i=0; i<N; i++) {
      line = sc.next();
      for (int j=0; j<N; j++) {
        s[i][j] = line.charAt(j);
      }
    }

    // B=0;
    boolean good;
    for (int A=0; A<N; A++) {
      good = true;
      for (int i=0; i<N; i++) {
        for (int j=0; j<N; j++) {
          int tmpI = (i + A)% N;
          int tmpJ = (j + A)% N;
          if (s[tmpI][j] != s[tmpJ][i]) {
            good = false;
          }
        }
      }
      if (good) {
        ans++;
      }
    }
    System.out.println(ans*N);
  }
}


Measured memory_bytes: 28504
//#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
#define FOR(i,a,b) for(int i=a;i<b;i++)
#define rep(i,n) FOR(i,0,n)
#define ROF(i,a,b) for(int i=a;i>=b;i--)
#define per(i,a) ROF(i,a,0)
#define pb push_back
using namespace std;
using ll=long long;
using ld=long double;
typedef pair<ll,ll> P;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef vector<P> vP;
typedef vector<char> vc;
typedef vector<vc> vvc;
const ll MOD=1000000007;
const ll MOD2=998244353;
const ld PI=acos(-1);
const ll INF=1e18;
struct edge{ll to,cost;};
struct edge2{ll from,to,cost;};

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

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

vector<string> A;
int H,W,K;

void dfs(string s){
    if(s.size()==W-1){
        A.pb(s);
        return;
    }
    dfs(s+'0');
    if(s.size()==0||s[s.size()-1]=='0'){
        dfs(s+'1');
    }
    return;
}
int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    cin >> H >> W >> K;
    dfs("");
    map<ll,ll> mp;
    rep(i,A.size()){
        //cout << A[i] << endl;
        rep(j,W-1){
            if(A[i][j]=='1') mp[j]++;
        }
    }
    vvl dp(H+1,vl(W,0));
    dp[0][0]=1;
    rep(i,H){
        rep(j,W){
            dp[i+1][j]+=(A.size()-mp[j-1]-mp[j])*dp[i][j];
            if(j!=0)dp[i+1][j]+=dp[i][j-1]*mp[j-1];
            if(j!=W-1)dp[i+1][j]+=dp[i][j+1]*mp[j];
            dp[i+1][j]%=MOD;
        }
    }
    cout << dp[H][K-1] << endl;
}
/*
overflow checked?
corner case checked?
boundary checked?
not TLE in worst case checked?
*/

Measured memory_bytes: 3656
let swap a i j =
    let temp = a.(i) in
    a.(i) <- a.(j);
    a.(j) <- temp
;;

let i = ref 0;;

let extract (a:int array) =
    Printf.printf "%d\n" a.(0);
    a.(0) <- a.(!i);
    let rec downheap h j =
      let largest = ref j in
      if j*2 <= h then
        begin
          if a.(j*2-1) > a.(j-1) then largest := j*2;
          if j*2+1 <= h && a.(j*2) > a.(!largest-1) then largest := j*2+1;
          if !largest != j then
            begin
              swap a (!largest-1) (j-1);
              downheap h (!largest)
            end
        end
    in downheap !i 1;i := !i-1
;;

let insert (a:int array) n =
    a.(!i+1) <- n;
    let rec upheap j =
        if j = 1 then ()
        else
          begin
            if a.(j/2-1) < a.(j-1) then swap a (j/2-1) (j-1)
            ;upheap (j/2)
          end
    in upheap (!i+2);
    i := !i+1

let () =
  let l = Array.make 2000000 0 in
  let rec read () =
      let op = Scanf.scanf "%s " (fun x -> x) in
      if op = "insert" then
        begin
              let n = Scanf.scanf "%d " (fun x -> x) in
              insert l n;read ()
        end
      else if op = "extract" then begin extract l;read () end
  in read ()
;;

Measured memory_bytes: 20488
#include<bits/stdc++.h>
using namespace std;
const double pi=acos(-1);
const int dx[]={0,1,0,-1};
const int dy[]={1,0,-1,0};
#define ll long long
#define inf int(1e9+7)
#define pb push_back
#define mp make_pair
int n,k;
vector<int>g[2005];
int sz[2005],dp[2005][2005],ndp[2005][2005];
void dfs(int u,int p)
{
	sz[u]=1;
	dp[u][0]=1;
	ndp[u][0]=1;
	for(int V=0;V<g[u].size();V++)
	{
		int v=g[u][V];
		if(v!=p)
		{
			dfs(v,u);
			for(int i=0;i<sz[u];i++)
				for(int j=0;j<sz[v]&&i+j+1<=k;j++)
					ndp[u][max(i,j+1)]=max(ndp[u][max(i,j+1)],dp[u][i]+dp[v][j]);
				sz[u]+=sz[v];
				for(int i=0;i<n;i++)
					dp[u][i]=ndp[u][i];
		}
	}
}
int main()
{
	cin>>n>>k;
	for(int i=0;i<n-1;i++)
	{
		int a,b;
		cin>>a>>b;
		g[a].pb(b);
		g[b].pb(a);
	}
	dfs(1,1);
	int ans=0;
	for(int i=1;i<n;i++)
		for(int j=0;j<=k;j++)
			ans=max(ans,dp[i][j]);
	cout<<n-ans;
	return 0;
}

Measured memory_bytes: 31488
#include<bits/stdc++.h>
using namespace std;
int main()
{
int n,k;
cin>>n>>k;
vector<long long>input(n);
for(int i=0;i<n;i++)
cin>>input[i];
sort(input.begin(),input.end());
long long sum=0;
if(n>k)
{
for(int i=0;i<input.size()-k;i++)
sum+=input[i];
cout<<sum<<endl;
}
else
cout<<0<<endl;
return 0;
}

Measured memory_bytes: 1792
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <algorithm>
using namespace std;

int a[200005];

int main()
{
	int n;
	while (scanf("%d", &n) != EOF) {
		int i, j;
		int p = 0;
		for (i = 0; i < n; i ++) {
			scanf("%d", &a[i]);
			p = p ^ a[i];
		}
		
		for (i = 0; i < n; i ++) {
			printf("%d%c", p ^ a[i], i == n - 1 ? '\n' : ' ');
		}
	}
	return (0);
}


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

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

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

    long long n,d,t,c=0;
    cin>>n>>d;
    t = n;
    while(t--){
        long long x,y;
        double p;
        cin>>x>>y;
        p = sqrt(x*x+y*y);
        if(p<=d)c++;
    }
    cout<<c<<endl;
    return 0;
}





Measured memory_bytes: 3612