akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <cstdio>
#include <vector>
#include <algorithm>
#include <complex>
#include <cstring>
#include <cstdlib>
#include <string>
#include <cmath>
#include <map>
using namespace std;

#define REP(i,n) for(int i=0;i<(int)n;++i)
#define FOR(i,c) for(__typeof((c).begin())i=(c).begin();i!=(c).end();++i)
#define ALL(c) (c).begin(), (c).end()
const int INF = 1<<29;

int n;
vector<int> v[1000];
map<string, int> id;
string s[1000], t[1000];
int d1[1000], d2[1000];

bool visited[1000];
int rec(int now) {
  if (visited[now]) return 0;
  visited[now] = 1;
  int res = 0;
  FOR(it, v[now]) {
    if (visited[*it]) continue;
    res += d1[*it]-d2[*it];
    res += rec(*it);
  }
  return res;
}

int dfs(int now) {
  if (visited[now]) return 0;
  visited[now] = 1;
  int res = 0;
  FOR(it, v[now]) {
    if (visited[*it]) continue;
    res += d2[*it];
    res += dfs(*it);
  }
  return res;
  
}

int main() {
  while(cin >> n, n) {
    id.clear();
    REP(i,n) {
      cin >> s[i] >> d1[i] >> t[i] >> d2[i];
      id[s[i]] = i;
    }
    REP(i,1000)
      v[i].clear();
    REP(i, n) {
      v[id[t[i]]].push_back(i);
    }
    typedef pair<int,int> pii;
    vector<pii> vv;
    REP(i,n) {
      memset(visited,0,sizeof(visited));
      int tmp = rec(i);
      vv.push_back(pii(tmp, i));
    }
    sort(ALL(vv), greater<pii>());
    memset(visited,0,sizeof(visited));
    int res = 0;
    REP(i,n) {
      int c = vv[i].second;
      if (!visited[c]) {
        res += d1[c] + dfs(c);
      }
    }
    cout << res << endl;
  }       
}

Measured memory_bytes: 1112
#include <bits/stdc++.h>
using namespace std;
#define ALL(x) (x).begin(),(x).end()
#define COUT(x) cout<<(x)<<"\n"
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define REP(i, n) for(int i=0;i<n;i++)
#define YES(x) cout<<(x?"YES":"NO")<<"\n"
#define Yes(x) cout<<(x?"Yes":"No")<<"\n"
#define dump(x) cout<<#x<<" = "<<(x)<<"\n"
#define endl "\n"
using G = vector<vector<int>>;
using M = map<int,int>;
using P = pair<int,int>;
using PQ = priority_queue<int>;
using PQG = priority_queue<int,vector<int>,greater<int>>;
using V = vector<int>;
using ll = long long;
using edge = struct { int to; int cost; };
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
const int INF = 1e9;
const ll LINF = 1e18;
const int mod = 1e9+7;

vector<int> dp(2000);

int main() {
  IOS;
  int s; cin >> s;

  dp[0] = 1;
  for (int i = 3; i <= s; i++) {
    for (int j = 3; j <= s; j++) {
      if (i < j) break;

      dp[i] += dp[i-j];
      dp[i] %= mod;
    }
  }

  COUT(dp[s]);
  return 0;
}

Measured memory_bytes: 3620
#include <iostream>
#include <vector>
#include <unordered_map>
#include <unordered_set>
#include <algorithm>
#include <queue>
#include <deque>
#include <cmath>
#include <iomanip>
#include <cstdio>

using namespace std;

int main(){
    int x; cin >> x;
    cout << (x==3 || x==5 || x==7 ? "YES" : "NO") << endl;
    return 0;
}


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

using namespace std;
typedef long long int ll;
typedef pair<ll,ll> P;

#define repi(i,a,b) for(ll i=a;i<b;i++)
#define rep(i,a) repi(i,0,a)
#define rrep(i,a) for(ll i=a-1;i>=0;i--)
#define MOD 1000000007

//debug
#define debug(arr) cerr<<#arr<<"(l"<<__LINE__<<") : ";for(auto x:arr)cerr<<x<<" ";cerr<<endl;

int main(){
  ll X;
  ll money = 100, ans = 0;
  cin >> X;

  while(money < X){
    money += money / 100;
    ans++;
  }
  cout << ans << endl;
  return 0;
}



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

int main(){
    int n = 0;
    int xtemp = 0;
    std::vector<int> x;
    int maxx = 0;
    int minx = 100;
    int power = 0;
    int powermin = 0;

    std::cin >> n;
    for(int i = 0; i < n; i++){
        std::cin >> xtemp;
        x.push_back(xtemp);
        if(x[i] > maxx){
            maxx = x[i];
        }
        if(x[i] < minx){
            minx = x[i];
        }
    }

    for (int j = minx; j <= maxx; j++){
        for(int i = 0; i < n; i++){
            power = power + (x[i] - j)*(x[i] - j);
        }
        if(j == minx){
            powermin = power;
        }
        else if(power < powermin){
            powermin = power;
        }
        power = 0;
    }
    std::cout << powermin << std::endl;

    return 0;
}



Measured memory_bytes: 256
#include <stdio.h>
int main(void){
	int n, a[100000] = {0}, dp_2 = 0, dp_1;
	scanf("%d", &n);getchar();
	for(int i = 0; i < n; i++){
		scanf("%d", &a[i]);getchar();
	}
	
	dp_1 = a[1] - a[0] > 0 ? a[1] - a[0] : a[0] - a[1];
	
	for(int i = 2; i < n; i++){
		int newDp, div1, div2;
		div1 = a[i] - a[i - 1] > 0 ? a[i] - a[i - 1] : a[i - 1] - a[i];
		div2 = a[i] - a[i - 2] > 0 ? a[i] - a[i - 2] : a[i - 2] - a[i];
		if(div1 + dp_1 > div2 + dp_2){
			newDp = div2 + dp_2;
		}else{
			newDp = div1 + dp_1;
		}
		dp_2 = dp_1;
		dp_1 = newDp;
	}
	printf("%d\n", dp_1);
	return 0;
}

Measured memory_bytes: 512
d = {'r': 0, 's': 1, 'p': 2}
win = {0: 2, 1: 0, 2: 1}

N, K = map(int, input().split())
point = list(map(int, input().split()))
T = input()

dp = [[0]*3 for _ in range(K)]  # K周期で最後に出した手別の最大得点

for i in range(N):
    k = i%K
    w = win[d[T[i]]]
    mx, mxw = 0, 0
    for j in range(3):
        mx = max(mx, dp[k][j])
        if j != w:
            mxw = max(mxw, dp[k][j])
    for j in range(3):
        if j != w:
            dp[k][j] = mx   # 今回は負けるので前回のmax
        else:
            dp[k][j] = mxw + point[j]   # 今回勝つので、前回別の手のmax + point[j]

ans = 0
for i in range(K):
    mx = 0
    for j in range(3):
        mx = max(mx, dp[i][j])
    ans += mx

# print(dp)
print(ans)


Measured memory_bytes: 15220
N = int(input())
X = list(map(int, input().split()))

MX = max(X)

TP = []

for i in range(1, MX+1):
  P = 0
  for j in range(N):
    P += (i - X[j])**2
  TP.append(P)
  
print(min(TP))

Measured memory_bytes: 3060
/* ex 5_4
   Tarara */

#include <stdio.h>

// 文字列長は10よりも大きくする
#define MAX_LEN 15

// a, bの内大きい値を返す
int max(int a, int b)
{
    return a > b ? a : b;
}

int main(void)
{
    //ptr: strの各要素へのポインタ
    char str[MAX_LEN], *ptr;
    int max_len, tmp_len;
    
    max_len = 0;
    tmp_len = 0;

    // 入力
    scanf("%s", str);

    // 文字列先頭から1文字づつ見る
    ptr = str;
    while (*ptr)
    {
        if (*ptr == 'A' || *ptr == 'C' || *ptr == 'G' || *ptr == 'T')
            tmp_len++;

        // 文字列にACGT以外が現れたらACGT文字列でなくなるため，文字列長のカウントを中断する
        // 過去のACGT文字列とその長さを比較し，ACGT文字列の最大長を更新する
        else
        {
            max_len = max(max_len, tmp_len);
            tmp_len = 0;
        }
        ptr++;
    }
    // 最後の文字がACGT文字列に含まれる場合，ループの外でACGT文字列の最大長を更新する必要がある
    max_len = max(max_len, tmp_len);

    // 出力
    printf("%d\n", max_len);
    return 0;
}

Measured memory_bytes: 1720
#include <iostream>
#include <cstdio>
#include <set>

using namespace std;

const int maxn=200005;
typedef long long ll;

ll s;
ll a[maxn];
ll n,k;

bool pd(ll x)
{
	ll s=0;
	for(int i=1;i<=n;i++)
	{
		if(a[i]%x==0) s+=(a[i]/x-1);
		else s+=(a[i]/x);
	}
//	cout<<x<<' '<<s<<endl;
	if(s>k) return false;
	return true;
}

int main()
{
	cin>>n>>k;
	for(int i=1;i<=n;i++)
		cin>>a[i];
	ll l=1,r=1e9+5,mid;
	while(l<r)
	{
		mid=(l+r)/2;
		if(pd(mid)) r=mid;
		else l=mid+1;
	}
	cout<<l<<endl;
	return 0;
}

Measured memory_bytes: 5184
#include<bits/stdc++.h>
using namespace std;
int main(){
  int n;
  cin>>n;
  int i=0;
  while(1000*i<n){
    i+=1;
  }
  int ans=1000*i-n;
  if(ans==1000){
    cout<<0<<endl;
  }
  else{
    cout<<ans<<endl;
  }
  return 0;
}

Measured memory_bytes: 3476
#include <stdio.h>
#define SIZE 105
#define MAX  200005
  int a[SIZE],dp[MAX];
 
  int main(void) {
        int n,k;
        scanf("%d %d",&n,&k);
        for(int i=0; i<n; i++) scanf("%d",&a[i]);
 
        for(int i=0; i<=k; i++) {
                if(dp[i]) continue;
 
                for(int j=0; j<n; j++) if(i+a[j] <= k) dp[i+a[j]] = 1;
        }
 
        if(dp[k] == 1) printf("First");
        else printf("Second");
        return 0;
  }

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

#define ll long long
#define ar array

#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;

template <typename T> using oset = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;

#define all(c) (c).begin(), (c).end()
#define sz(x) (int)(x).size()

#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, 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 FOR(...) F_ORC(__VA_ARGS__)(__VA_ARGS__)

#define E_ACH2(x, a) for (auto& x: a)
#define E_ACH3(x, y, a) for (auto& [x, y]: a)
#define E_ACH4(x, y, z, a) for (auto& [x, y, z]: a)
#define E_ACHC(...) GET5(__VA_ARGS__, E_ACH4, E_ACH3, E_ACH2)
#define EACH(...) E_ACHC(__VA_ARGS__)(__VA_ARGS__)

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

	map<string, int> mp{{"AC", 0}, {"WA", 1}, {"TLE", 2}, {"RE", 3}};
	int n, c[4]={};
	cin >> n;
	FOR(n) {
		string s;
		cin >> s;
		++c[mp[s]];
	}
	//cout << c[0] << " " << c[1] << " " << c[2] << " " << c[3];
	FOR(4) {
		EACH(a, mp)
			if(a.second==i)
				cout << a.first;
		cout << " x " << c[i] << "\n";
	}
}

Measured memory_bytes: 3680
#include <iostream>
#include <algorithm>
#include <vector>
#include <set>
#include <map>
#include <cmath>
#include <queue>
#include <numeric>

using namespace std;
#define repp(i,a,b) for(int i = (int)(a) ; i < (int)(b) ; ++i)
#define reppe(i,a,b) for(int i = (int)(a) ; i <= (int)(b) ; ++i)
#define repm(i,a,b) for(int i = (int)(a) ; i > (int)(b) ; --i)
#define repme(i,a,b) for(int i = (int)(a) ; i >= (int)(b) ; --i)

typedef long long ll;

long long GCD(long long a, long long b){if(b==0)return a;return GCD(b,a%b);}

int main() {
    string S, T; cin >> S >> T;
    int A, B; cin >> A >> B;
    string U; cin >> U;
    if (S == U) cout << A - 1 << " " << B << endl;
    else cout << A << " " << B  -1 << endl;
}


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

using namespace std;

int main (int argc, char *argv[]) 
{
    int K, X;
    const int lower = 1000000 * -1;
    const int upper = 1000000;

    cin >> K >> X;

    int l = max(lower, X - K + 1);
    int u = min(upper, X + K - 1);

    bool first = true;
    for (int i = l; i <= u; ++i) 
    {
        if (!first)
        {
            cout << " ";
        }
        cout << i;
        first = false;
    }
    cout << endl;

    return 0;
}

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

int main() {
  int a,b;
  cin>>a>>b;
  int ans;
  if (a<=5) ans=0;
  else if (a<=12) ans=b/2;
  else ans=b;
  
  cout<<ans<<endl;
  return 0;
}



Measured memory_bytes: 256
#include<iostream>
#include<vector>
#include<algorithm>
#include<cctype>
#include<utility>
#include<string>
#include<cmath>
#include<cstring>
#include<queue>
#include<map>
#include<set>
#include<climits>

#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 FORR(i, m, n) for(int i = m;i >= n;i--)
#define SORT(v, n) sort(v, v+n);
#define VSORT(v) sort(v.begin(), v.end());
#define llong long long
#define pb(a) push_back(a)

using namespace std;

typedef long long int ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;


template<typename T>
vector<T> make_v(size_t a) { return vector<T>(a); }
template<typename T, typename... Ts>
auto make_v(size_t a, Ts... ts) {
	return vector<decltype(make_v<T>(ts...))>(a, make_v<T>(ts...));
}
template<typename T, typename V>
typename enable_if<is_class<T>::value == 0>::type
fill_v(T& t, const V& v) { t = v; }
template<typename T, typename V>
typename enable_if<is_class<T>::value != 0>::type
fill_v(T& t, const V& v) {
	for (auto& e : t) fill_v(e, v);
}


#define ARRAY_MAX 100005
const int INF = INT32_MAX / 3;
const ll MOD = 1e9 + 7;

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


/******************************************************************************************/



//ユークリッド互除法
template<typename T>
T gcd(T x, T y) {

	if (y == 0) {
		return x;
	}
	else {
		return gcd(y, x % y);
	}
}

/*最小公倍数*/
template<typename T>
T lcm(T x, T y) {
	T tmp = gcd(x, y);
	return x * y / tmp;
}


vector<int> G[100005];
map<pii, int> mp;
bool check[100005];
int a[100005];
int b[100005];

int main() {

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

	
	queue<int> que;
	que.push(1);
	vector<int> cl(100005, 0);//今まで塗った中で最大の色
	int K = 0;

	check[1] = 1;
	while (!que.empty()) {

		int now = que.front();
		que.pop();
		
		if (K < (int)G[now].size()) {
			K = G[now].size();
		}

		int color = 1;
		for (int nxt : G[now]) {
			if (check[nxt])continue;

			que.push(nxt);
			if (color == cl[now])color++;
			mp[pii(min(now, nxt), max(now, nxt))] = color;
			cl[nxt] = color;
			color++;
			check[nxt] = 1;
		}
	}

	cout << K << endl;
	for (int i = 0; i < n - 1; i++)
	{
		cout << mp[pii(a[i],b[i])] << '\n';
	}


	return 0;
}


Measured memory_bytes: 13568
#n=int(input())
a,b,n=map(int,input().split())
#l=list(map(int,input().split()))
#l=[list(map(int,input().split())) for i in range(n)]
import math
if n <b:
    x=n
    v=a*x
    v=v//b
    #ans=math.floor((x/b)*a)
    ans=v
else:
    ansl=[]
    x=b-1
    v=a*x
    v=v//b-a*(x//b)
    #ans=math.floor((x/b)*a)
    ans=max(v,0)
    v=a*n
    v=v//b-a*(n//b)
    ans=max(ans,v)
    #ansl.append(ans)
print(ans)


Measured memory_bytes: 9028
PROGRAM product
      IMPLICIT NONE
      INTEGER :: a,b,pro
      
      read*,a,b
      
      pro = a*b
      
      IF(mod(pro,2) == 0)THEN
        print'(A)', 'Even'
      ELSE
        print'(A)', 'Odd'
      END IF
      END PROGRAM
      
      
      
      
      

Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <cmath>
#include <vector>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <queue>
#include <ctime>
#include <cassert>
#include <complex>
#include <string>
#include <cstring>
#include <chrono>
#include <random>
#include <queue>
#include <bitset>
#include <stack>
#include <functional>

#ifdef LOCAL
    #define eprintf(...) fprintf(stderr, __VA_ARGS__)
#else
    #define eprintf(...) 42
#endif

#define rep_(i, a_, b_, a, b, ...) for (int i = (a), i##_len = (b); i < i##_len; ++i)
#define rep(i, ...) rep_(i, __VA_ARGS__, __VA_ARGS__, 0, __VA_ARGS__)
#define reprev_(i, a_, b_, a, b, ...) for (int i = (b-1), i##_min = (a); i >= i##_min; --i)
#define reprev(i, ...) reprev_(i, __VA_ARGS__, __VA_ARGS__, 0, __VA_ARGS__)
#define all(x) (x).begin(), (x).end()
template <class T> bool chmax(T &a, const T &b) { if (a < b) { a = b; return 1; } return 0; }
template <class T> bool chmin(T &a, const T &b) { if (b < a) { a = b; return 1; } return 0; }
// template <class T> T gcd(T a, T b) { return b ? gcd(b, a % b) : a; }
using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef pair <int,int> P;
typedef long double ld;

int main (void)
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n; cin >> n;
    vector<ll> a(n); rep (i, n) cin >> a[i];
    ll base = 0;
    priority_queue<ll> que; rep (i, n) que.push(a[i]);
    while (true) {
        ll t = que.top(); que.pop();
        if (t + base < n) break;
        ll k = (t + base - n) / (n + 1) + 1;
        eprintf("%lld %lld %lld\n", t, base, k);
        que.push(t - k * (n + 1));
        base += k;
    }
    cout << base << "\n";
    return 0;
}

Measured memory_bytes: 256
N = input()
l = len(N)
N_i = int(N)
ans = 0

p = int(l/2)
for i in range(p):
    q = i*2
    ans += 9 * (10**q)

if l%2 != 0:
    bottom = 10**(l-1)
    ans += N_i - bottom + 1

print(ans)

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

int main() {
  int n; cin >> n;
  int sum = 0;
  int tmp = n;
  while (tmp) {
    sum += tmp % 10;
    tmp /= 10;
  }
  cout << (n % sum == 0 ? "Yes" : "No") << endl;
  return 0;
}


Measured memory_bytes: 256
#define _USE_MATH_DEFINES
#include<iostream>
#include<vector>
#include<algorithm>
#include<cmath>
#include<cstdlib>
#include<string>
#include<iomanip>
#include<cassert>
#include<functional>
typedef long long ll;

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

	int a;
	int b;

	std::cin >> a >> b;

	std::cout << (a - 1) * (b - 1) << '\n';

	return 0;
}

Measured memory_bytes: 256
N = int(input())
d = list(map(int, input().split()))

under = 0
uper = 0
ans = 0
d.sort()
n = int(N/2)
min = d[n-1]
mid = d[n]

low = [i for i in d if i < d[n-1]]
hi = [i for i in d if i >= d[n-1]]
if len(low) == len(hi):
    under = 1

low = [i for i in d if i < d[n]]
hi = [i for i in d if i >= d[n]]
if len(low) == len(hi):
    uper = 1

ans = d[n] - d[n-1] - 1 + under + uper
if ans < 0:
    ans = 0
print(ans)


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

using namespace std;
using llong = long long;
using P = pair<llong, llong>;

#define BE(x) x.begin(), x.end()

const llong inf = llong(1e18)+7;
const llong mod = 1e9+7;

int main(){
	int N;
	vector<int> a;

	cin >> N;
	a.resize(N);
	for(int i= 0; i < N; i++)
		cin >> a[i];

	sort(BE(a), greater<int>());
	int ans = 0;
	for(int i = 0; i < N; i++)
		if(i&1^1)
			ans += a[i];
		else
			ans -= a[i];

	cout << ans << endl;

	return 0;
}

Measured memory_bytes: 256
using System;
class Program
{

    static void Main()
    {
        string s = Console.ReadLine();
        string t = Console.ReadLine();
        bool flag = true;
        for(int i=0; i < s.Length; i++)
        {
            if (s[i] != t[i]) flag = false;
        }
        if (flag) Console.WriteLine("Yes");
        else Console.WriteLine("No");
    }
}

Measured memory_bytes: 25880
import bisect
import copy
import heapq
import sys
import itertools
import math
import queue
input = sys.stdin.readline
sys.setrecursionlimit(1000000)
mod = 10 ** 9 + 7

def read_values(): return map(int, input().split())
def read_index(): return map(lambda x: int(x) - 1, input().split())
def read_list(): return list(read_values())
def read_lists(N): return [read_list() for n in range(N)]
def init_dp1(init, N): return [init for _ in range(N)]
def init_dp2(init, N, M): return [[init for _ in range(M)] for _ in range(N)]


class V:
    def __init__(self, f, v=None):
        self.f = f
        self.v = v
 
    def __str__(self):
        return str(self.v)
 
    def ud(self, n):
        if n is None:
            return

        if self.v is None:
            self.v = n
            return
        self.v = self.f(self.v, n) 


def main():
    X = int(input())

    A = 100
    T = 0
    while A < X:
        A = int(A * 1.01)
        T += 1

    print(T)


if __name__ == "__main__":
    main()


Measured memory_bytes: 9872
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for( int i = 0 ; i < n ; i++ )
typedef long long ll ;
 
int main() {
  ll N , M ;
  cin >> N ;
  vector<ll> A(N) ;
  priority_queue<ll> count_D ;
  rep(i,N){
    ll A ;
    cin >> A ;
    count_D.push(A) ;
  }
  cin >> M ;
  priority_queue<ll> count_T ;
  rep(i,M){
    ll B ;
    cin >> B ;
    count_T.push(B) ;
  }
  rep(i,200005){
    if( count_T.top() == count_D.top() ){
      count_D.pop() ;
      count_T.pop() ;
    }
    else{
      count_D.pop() ;
    }
    if( count_T.empty() ){
      cout << "YES" << endl;
      return 0 ;
    }
    if( count_D.empty() ){
      cout << "NO" << endl;
    }
  }
}

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

int main() {
	long n, ans;
	std::cin >> n;
	ans = n;
	for (int i = 1; i <= sqrt(n); i++){
	    if(n%i==0) ans = min(ans, i + (n / i) - 2);
	}
	
	std::cout << ans << std::endl;
	
	return 0;
}

Measured memory_bytes: 256
N = int(input())
z = [list(map(int, input().split())) for _ in range(N)]
# z[i][0]がt_i,z[i][1]がx_i,z[i][2]がy_iにそれぞれ対応している
for i in range(N):
	tmp = abs(z[i][1] + z[i][2])
	if z[i][0] % 2 == 0:
		if tmp % 2 == 0 and tmp <= z[i][0]:
			pass  # passとかかっこつけて使わなくていいなこれ
		else:
			print("No")
			exit()
	else:
		if tmp % 2 != 0 and tmp <= z[i][0]:
			pass
		else:
			print("No")
			exit()
print("Yes")


Measured memory_bytes: 27300
#include <bits/stdc++.h>
using namespace std;
int main(){
	int n, m;
	cin>>n>>m;
	vector<int> vec(n, 0);
	for(int i = 0; i < n; ++i){
		cin>>vec[i];
	}
	sort(vec.begin(), vec.end());
	for(auto x : vec){
		m -= x;
	}
	int cnt = n;
	cnt += m / vec[0];
	cout<<cnt<<endl;
	return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
 
using namespace std;
 
#define mp make_pair
#define fi first
#define se second
#define pb push_back
#define sz(x) ((int)(x).size())
#define whole(x) (x).begin(), (x).end()
 
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef pair < int, int > pii;
typedef pair < ll, ll > pll;
 
const int N = int(2e5) + 2;
const int LG = 20;
const ll mod = (int)1e9 + 7;
const int INF = (int)1e9 + 7;
const ll linf = 1e18; 
const ld pi = acos(-1);
const int base = 10;
const ld EPS = 1e-9;

int n, k;
int main (){
    scanf ("%d %d", &n, &k);
    int cur = (k + k + 1);
    int ans = n / cur + ((n % cur) > 0);
    return !printf ("%d\n", ans);
}

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

#define mod 1000000007

int main() {
    int H, W;
    cin >> H >> W;
    vector<vector<char>> a(H, vector<char>(W));
    for (int i = 0; i < H; ++i) {
        for (int j = 0; j < W; ++j) {
            cin >> a[i][j];
        }
    }
    vector<vector<ll>> dp(H, vector<ll>(W, 0));
    dp[0][0] = 1;
    for (int i = 0; i < H; ++i) {
        for (int j = 0; j < W; ++j) {
            if(a[i][j] == '.'){
                if(i != 0) dp[i][j] += dp[i-1][j];
                if(j != 0) dp[i][j] += dp[i][j-1];
                dp[i][j] %= mod;
            }
        }
    }
    cout << dp[H-1][W-1];
    return 0;
}

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

using namespace std;

int main(void)
{
    int N, L;
    cin >> N >> L;
    string S[N];
    for (int i = 0; i < N; i++) {
        cin >> S[i];
    }
    sort(S, S+N);
    
    for (int i = 0; i < N; i++) {
        cout << S[i];
    }
    cout << endl;
}


Measured memory_bytes: 3612
#include<iostream>
#include<cstdio>
#include<cstring>
#include<algorithm>
#include<cmath>
#include<vector>
#include<queue>
#define mp make_pair

using namespace std;
typedef long long ll;
typedef pair <int,int> P;
typedef pair <int,P> PP;//to,cst;
int h,w;
int bl;
bool black[55][55];
vector <P> adj[55][55];
const int dx[4] = {0,-1,0,1};
const int dy[4] = {-1,0,1,0};
int dis[55][55];
inline void dijkstra(){
	memset(dis,127,sizeof(dis));
	int inf = dis[51][51];
	dis[1][1] = 0;
	priority_queue <PP, vector<PP>, greater<PP> > que;
	que.push(mp(0,mp(1,1)));
	while(!que.empty()){
		PP pp = que.top();
		que.pop();
		P p = pp.second; int d = pp.first;
		if(dis[p.first][p.second] < d) continue;
		for(int i=0;i<adj[p.first][p.second].size();i++){
			P e = adj[p.first][p.second][i];
			if(dis[e.first][e.second] > d + 1){
				dis[e.first][e.second] = d + 1;
				que.push(mp(d+1,mp(e.first,e.second)));
			}
		}
	}
	if(dis[h][w] == inf) puts("-1");
	else{
		printf("%d\n",h * w - bl - (dis[h][w]+1));
	}
}
int main(){
	ios::sync_with_stdio(false);
	cin.tie(0);
	cin >> h >> w;
	for(int i=1;i<=h;i++){
		for(int j=1;j<=w;j++){
			char c;
			cin >> c;
			if(c == '#'){
				black[i][j] = true;
				bl++;
			}
		}
	}
	for(int i=1;i<=h;i++){
		for(int j=1;j<=w;j++){
			for(int k=0;k<4;k++){
				int x = i + dx[k], y = j + dy[k];
				if(x >= 1 && x <= h && y >= 1 && y <= w && !black[x][y]){
					adj[i][j].push_back(mp(x,y));
				}
			}
		}
	}
	dijkstra();
	return 0;
}


Measured memory_bytes: 512
#include <iostream>
#include <cstdio>
#include <string>
#include <vector>
#include <set>
#include <algorithm>
#define _USE_MATH_DEFINENS
#include <cmath>
using namespace std;

#define p(x) cout << x << endl;
#define el cout << endl;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)

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

    int x, y;
    cin >> x >> y;

    y = y / 2;
    cout << x + y << endl;
}


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

typedef long long int LL;
typedef long long int LLint;

//Faster Program
#define endl "\n"

//Faster Coding
#define ED return
#define GET(a) int a;cin >> a
#define DGET(a) double a;cin >> a
#define SGET(a) string a;cin >> a
#define CGET(a) char a;cin >> a
#define PRINT(a) cout << a << "\n"
#define ANS(a,b) int a;cin >> a;cout << b << "\n"
#define FOR(n) for(int i = 0;i < n;i++)
#define SORT(vec) sort(vec.begin(),vec.end())
#define REV(vec) reverse(vec.begin(),vec.end())

//As Function
#define UP(a,b) ((a+(b-1))/b)
#define ipow(x,y) LL(pow(x,y))

//Debug
#define TEST cout << "OK\n"

const double PI = M_PI;
const long long INF = int(999999999);
const long long MOD = int(1000000007);

//Settings
const bool DO_BENCHMARK = false;
const int DOUBLE_ACCURACY = 15;

int main(){
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(DOUBLE_ACCURACY);
    void solve();
    if(DO_BENCHMARK){
        clock_t clock_start = clock();
        solve();
        clock_t clock_end = clock();
        const double time = static_cast<double>(clock_end-clock_start)/CLOCKS_PER_SEC*1000.0;
        cout << "\n" << time << "[ms]\n";
    }
    else solve();
}

void solve(){
    LL T1, T2, A1, A2, B1, B2;
    cin >> T1 >> T2 >> A1 >> A2 >> B1 >> B2;
    if(T1*A1+T2*A2 == T1*B1+T2*B2){
        cout << "infinity" << endl;
        ED;
    }
    if(T1*A1 < T1*B1 && T1*A1+T2*A2 < T1*B1+T2*B2){
        cout << 0 << endl;
        ED;
    }
    if(T1*A1 > T1*B1 && T1*A1+T2*A2 > T1*B1+T2*B2){
        cout << 0 << endl;
        ED;
    }
    else{
        LL deltaX1 = abs((T1*A1+T2*A2) - (T1*B1+T2*B2));
        LL deltaX2 = abs(T1*A1 - T1*B1);
        LL ans = (deltaX2/deltaX1)*2+1;
        if(UP(deltaX2,deltaX1) == deltaX2/deltaX1){
            ans--;
        }
        PRINT(ans);
        ED;
    }
}


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

int main() {
    int a,b,k;
    cin >> a >> b >> k;
    if((b-a+1) % 2 == 0 && (b-a+1)/2 <= k){
        for(int i=a;i<=b;i++)cout << i << endl;
    }
    else if((b-a+1) % 2 == 1 && (b-a+1+1)/2 <= k){
        for(int i=a;i<=b;i++)cout << i << endl;
    }
    else{
        for(int i=a;i<a+k;i++)cout << i << endl;
        for(int i=b-k+1;i<=b;i++)cout << i << endl;
    }
    return 0;
}


Measured memory_bytes: 256
#define _USE_MATH_DEFINES 
#include <cmath>
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <unordered_map>
#include <math.h>
#include <unordered_set>
#include <iomanip>
#include <cmath>
#include <set>
#include <locale>
using namespace std;
typedef long long ll;
#define rep(i,n) for(int i = 0; i < (n); i++)
#define INF 2 << 29
#define MOD 1000000007
#define Yes(f) puts((f)? "Yes" : "No")
#define YES(f) puts((f)? "YES" : "NO")
int gcd(int a, int b) {
	if (b != 0)return gcd(b, a % b);
	return a;
}
ll Lgcd(ll a, ll b) {
	if (b != 0)return gcd(b, a % b);
	return a;
}
int lcm(int a, int b) {
	return a / gcd(a, b) * b;
}
ll Llcm(ll a, ll b) {
	return a / gcd(a, b) * b;
}
using Graph = vector<vector<int>>;
//cout << fixed << setprecision(6);
//cout << setfill('0') << right << setw(2);

int main() {
	ll a, b, c, d;
	cin >> a >> b >> c >> d;
	a--;
	ll i = a / c, j = a / d, k = b / c, l = b / d, x = a / Llcm(c, d), y = b / Llcm(c, d);
	cout << b - a - (k + l - i - j + x - y) << endl;
}

Measured memory_bytes: 256
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.Scanner;

public final class Main {

    public static void main(String[] args) {
        final Scanner in = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
        final int a = Integer.parseInt(in.nextLine());
        System.out.println(a + a * a + a * a * a);
    }
}


Measured memory_bytes: 35844
import java.util.*; import java.io.*; import java.math.*;
public class Main{
	//Don't have to see. start------------------------------------------
	static class InputIterator{
		ArrayList<String> inputLine = new ArrayList<String>(1024);
		int index = 0; int max; String read;
		InputIterator(){
			BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
			try{
				while((read = br.readLine()) != null){
					inputLine.add(read);
				}
			}catch(IOException e){}
			max = inputLine.size();
		}
		boolean hasNext(){return (index < max);}
		String next(){
			if(hasNext()){
				return inputLine.get(index++);
			}else{
				throw new IndexOutOfBoundsException("There is no more input");
			}
		}
	}
	static HashMap<Integer, String> CONVSTR = new HashMap<Integer, String>();
	static InputIterator ii = new InputIterator();//This class cannot be used in reactive problem.
	static PrintWriter out = new PrintWriter(System.out);
	static void flush(){out.flush();}
	static void myout(Object t){out.println(t);}
	static void myerr(Object t){System.err.print("debug:");System.err.println(t);}
	static String next(){return ii.next();}
	static boolean hasNext(){return ii.hasNext();}
	static int nextInt(){return Integer.parseInt(next());}
	static long nextLong(){return Long.parseLong(next());}
	static double nextDouble(){return Double.parseDouble(next());}
	static ArrayList<String> nextStrArray(){return myconv(next(), 8);}
	static ArrayList<String> nextCharArray(){return myconv(next(), 0);}
	static ArrayList<Integer> nextIntArray(){
		ArrayList<String> input = nextStrArray(); ArrayList<Integer> ret = new ArrayList<Integer>(input.size());
		for(int i = 0; i < input.size(); i++){
			ret.add(Integer.parseInt(input.get(i)));
		}
		return ret;
	}
	static ArrayList<Long> nextLongArray(){
		ArrayList<String> input = nextStrArray(); ArrayList<Long> ret = new ArrayList<Long>(input.size());
		for(int i = 0; i < input.size(); i++){
			ret.add(Long.parseLong(input.get(i)));
		}
		return ret;
	}
	static String myconv(Object list, int no){//only join
		String joinString = CONVSTR.get(no);
		if(list instanceof String[]){
			return String.join(joinString, (String[])list);
		}else if(list instanceof ArrayList){
			return String.join(joinString, (ArrayList)list);
		}else{
			throw new ClassCastException("Don't join");
		}
	}
	static ArrayList<String> myconv(String str, int no){//only split
		String splitString = CONVSTR.get(no);
		return new ArrayList<String>(Arrays.asList(str.split(splitString)));
	}
	public static void main(String[] args){
		CONVSTR.put(8, " "); CONVSTR.put(9, "\n"); CONVSTR.put(0, "");
		solve();flush();
	}
	//Don't have to see. end------------------------------------------
	static void solve(){//Here is the main function
      int N = nextInt();
      while(true){
        String[] tmp = String.valueOf(N).split("");
        if(tmp[0].equals(tmp[1]) && tmp[1].equals(tmp[2])){
          myout(N);
          return;
        }
        N++;
      }
	}
	//Method addition frame start



	//Method addition frame end
}


Measured memory_bytes: 33300
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <climits>
#include <cfloat>
#include <map>
#include <utility>
#include <set>
#include <iostream>
#include <memory>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <sstream>
#include <complex>
#include <stack>
#include <queue>
using namespace std;
static const double EPS = 1e-12;
typedef long long ll;
#define rep(i,n) for(int i=0;i<n;i++)
#define rev(i,n) for(int i=n-1;i>=0;i--)
#define sz(a) a.size()
#define all(a) a.begin(),a.end()
#define mp(a,b) make_pair(a,b)
#define pb(a) push_back(a)
#define SS stringstream
#define DBG1(a) rep(_X,sz(a)){printf("%d ",a[_X]);}puts("");
#define DBG2(a) rep(_X,sz(a)){rep(_Y,sz(a[_X]))printf("%d ",a[_X][_Y]);puts("");}
#define bitcount(b) __builtin_popcount(b)
#define REP(i, s, e) for ( int i = s; i <= e; i++ )  

int main(){
	int n,m,s,t;
	while(cin >> n >> m ,n ){
		int ret = 0;
		vector<int> a(1,0),b(1,0);
		
		vector<int> tate,yoko;
		
		s = 0;
		rep(i,n){
			cin >> t;
			s += t;
			a.push_back(s);
		}
		s = 0;
		rep(i,m){
			cin >> t;
			s += t;
			b.push_back(s);
		}
		rep(i,a.size()){
			for(int j=i+1;j<a.size();j++){
				tate.push_back(a[j]-a[i]);
			}
		}
		rep(i,b.size()){
			for(int j=i+1;j<b.size();j++){
				yoko.push_back(b[j]-b[i]);
			}
		}
		sort(all(tate));
		sort(all(yoko));
		rep(i,tate.size()){
			ret += upper_bound(all(yoko),tate[i])-lower_bound(all(yoko),tate[i]);
		}
		cout << ret << endl;
	}
}

Measured memory_bytes: 9864
#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<iomanip>
#include<math.h>
#include<complex>
#include<queue>
#include<deque>
#include<stack>
#include<map>
#include<set>
#include<bitset>
#include<functional>
#include<assert.h>
#include<numeric>
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=100010;
const ll mod=1e9+7;

int main(){
  int n;
  cin >> n;
  vector<vector<int>> d(n, vector<int>(n,0));
  vector<int> cnt(n*n,0);
  vector<int> v[n*n];
  rep(i,n)rep(j,n-1){
    cin >> d[i][j];
    d[i][j]--;
    if(j!=0){
      int a = i, b = d[i][j-1];
      if(a>b) swap(a,b);
      int c = i, e = d[i][j];
      if(c>e) swap(c,e);
      v[a*n+b].emplace_back(c*n+e);
      cnt[c*n+e]++;
    }
  }

  int ans = 0;
  int vs = 0;
  int pre = -1;
  queue<int> q;
  rep(i,n)rep(j,i){
    if(cnt[j*n+i]==0){
      q.push(j*n+i);
    }
  }
  while(pre!=vs){
    ans++;
    pre = vs;
    queue<int> nq;
    while(!q.empty()){
      int p = q.front(); q.pop();
      for(auto it:v[p]){
        cnt[it]--;
        if(cnt[it]==0){
          nq.push(it);
          vs++;
        }
      }
    }
    swap(q,nq);
  }
  rep(i,n*n)if(cnt[i]!=0){cout << -1 << endl; return 0;}
  cout << ans << endl;
  return 0;
}

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

int nlist[110];
int dp[110][110];

int main(){
  int n;
  cin>>n;
  for(int i=0;i<n;i++){
    cin>>nlist[i]>>nlist[i+1];
  }
  for(int i=1;i<n;i++){
    for(int j=0;j<n-i;j++){
      dp[j][j+i]=1<<30;
      for(int k=0;k<i;k++){
	dp[j][j+i]=min(dp[j][j+i],dp[j][j+k]+dp[j+k+1][j+i]+nlist[j]*nlist[j+k+1]*nlist[j+i+1]);
      }
    }
  }
  cout<<dp[0][n-1]<<endl;
  return 0;
}


Measured memory_bytes: 3128
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define REP(i,m,n) for(int i=(int)(m); i<(int)(n); i++)
#define rep(i,n) REP(i,0,n)
#define RREP(i,m,n) for(int i=(int)(m); i>=(int)(n); i--)
#define rrep(i,n) RREP(i,n-1,0)
#define REPL(i,m,n) for(ll i=(ll)(m); i<(ll)(n); i++)
#define repl(i,n) REPL(i,0,n)
#define all(v) v.begin(), v.end()
const int inf = 1e9+7;
const ll longinf = 1LL<<60;
const ll mod = 1e9+7;

#define MAX_N 200005

class UnionFind
{
public:
  int par[MAX_N];
  int depth[MAX_N];
  int nGroup[MAX_N];

  UnionFind(int n) {
    init(n);
  }

  void init(int n) {
    for(int i=0; i<n; i++) {
      par[i] = i;
      depth[i] = 0;
      nGroup[i] = 1;
    }
  }

  int root(int x) {
    if(par[x] == x) {
      return x;
    } else {
      return par[x] = root(par[x]);
    }
  }

  bool same(int x, int y) {
    return root(x) == root(y);
  }

  void unite(int x, int y) {
    x = root(x);
    y = root(y);
    if(x == y) return;

    if(depth[x] < depth[y]) {
      par[x] = y;
      nGroup[y] += nGroup[x];
      nGroup[x] = 0;
    } else {
      par[y] = x;
      nGroup[x] += nGroup[y];
      nGroup[y] = 0;
      if(depth[x] == depth[y])
        depth[x]++;
    }
  }
};
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int N, M;
  cin >> N >> M;
  UnionFind uf(N);
  vector<ll> A(N);
  rep(i, N) cin >> A[i];
  rep(i, M) {
    int x, y;
    cin >> x >> y;
    uf.unite(x, y);
  }
  int need = 2*(N-1-M);
  if(N < need) {
    cout << "Impossible" << endl;
    return 0;
  }
  vector<priority_queue<ll>> ve(N);
  rep(i, N) ve[uf.root(i)].push(A[i]);
  bool allSame = true;
  rep(i, N) if(!uf.same(i, 0)) allSame = false;
  if(allSame) {
    cout << 0 << endl;
    return 0;
  }
  ll ans = 0;
  priority_queue<ll> q;
  rep(i, N) {
    if(ve[i].empty()) continue;
    while(ve[i].size() > 1) {
      q.push(ve[i].top());
      ve[i].pop();
    }
    ans += ve[i].top();
    ve[i].pop();
  }
  rep(i, N-need) q.pop();
  while(!q.empty()) {
    ans += q.top();
    q.pop();
  }
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 9084
n, m = map(int, input().split())
ps = [input().split() for i in range(m)]
b = [False] * n
wa = [0] * n
for i in ps:
  if b[int(i[0])-1] == False and i[1] == "AC":
    b[int(i[0])-1] = True
  elif b[int(i[0])-1] == False and i[1] == "WA":
    wa[int(i[0])-1] += 1
print(b.count(True),end=" ")
ans = 0
for i in range(n):
    if b[i]:
        ans += wa[i]
print(ans)        

Measured memory_bytes: 39800
#include<iostream>
using namespace std;
int main()
{
 
int n,y; //have 10000 5000 1000
cin>>n>>y; //9 45000
 
for(int i=0;i<=n;i++)
for(int j=0;j<=n-i;j++)
    if(10000*i+5000*j+1000*(n-i-j)==y) {cout<<i<<" "<<j<<" "<<(n-i-j);
    system("pause");
                                                 return 0;}
cout<<"-1 -1 -1";
 
system("pause");
return 0;
}

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

#define ll long long
#define endl "\n"

int n;
vector <int> numbers;

ll cost(int to){
	ll ans = 0;
	
	for (auto& i:numbers){
		ans += (i - to)*(i - to);
	}
	
	return ans;
}

int main ()
{

	ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    #define int ll
    //freopen("input.txt", "r", stdin); 
    //freopen("output.txt", "w", stdout);

	cin >> n;
	numbers.resize(n);
	
	for (auto& i:numbers) cin >> i;
	int minimum = *min_element(numbers.begin(), numbers.end());
	int maximum = *max_element(numbers.begin(), numbers.end());
	
	int ans = INT_MAX;
	
	for (int i=minimum; i<=maximum; i++){
		ans = min(ans, cost(i));
	}
	
	cout << ans << endl;
	
    return 0;

}

Measured memory_bytes: 3592
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define pb push_back
#define se second
const int N = 2e5+5;
void solve(){
    ll a,b,k;
    cin>>a>>b>>k;
    ll d = min(a,k);
    cout<<a-d<<" "<<max(0ll,b-(k-d))<<endl;
}
int main(){
    ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
    int t=1;
   // cin>>t;
    while(t--){
        solve();
    }
    return 0;
}


Measured memory_bytes: 3640
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef pair<int,int> pii;
#define ff first
#define ss second
#define pb push_back
#define all(x) x.begin(),x.end()
#define sz(x) (int)x.size()
#define rep(i,a,b) for(int i=a;i<=b;++i)
#define rrep(i,a,b) for(int i=a;i>=b;--i)
#define fastio() ios::sync_with_stdio(0);cin.tie(0);
#define nl "\n"
#define print(x) for(auto it:x) cout << it << " "; cout << "\n";
#define wi(x) cerr << #x << " is " << x << nl
const double eps = 1e-6;
const int mod = 1e9 + 7;

void solve(){
	int d,t,s; 
	cin >> d >> t >> s;
	if(s*t >= d) cout << "Yes";
	else cout << "No";
}
int main(){
	fastio()
	
	int T=1;
	//int T; cin>>T;
	while(T--) solve();
	
	return 0;
}


Measured memory_bytes: 3632
import sys
input = sys.stdin.readline
n = int(input())
l = []
for i in range(n):
    a,b = map(int,input().split())
    l.append((b,a))
l.sort()
t = 0
for i in range(n):
    t += l[i][1]
    if t > l[i][0]:
        print('No')
        exit()
print('Yes')

Measured memory_bytes: 88712
#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[i];
	}
	int dp[n];
	for(int i(0);i<n;++i){
		dp[i]=-1;
	}
	dp[0]=1;
	for(int i(1);i<n;++i){
		if(v[i]<=v[i-1]) dp[i]=dp[i-1]+1;
		else dp[i]=1;
	}
	int mx=-321311221;
	for(int i(0);i<n;++i){
		mx=max(dp[i],mx);
	}
	cout << mx-1;
}

Measured memory_bytes: 1024
h,w = map(int,input().split())
lis = []
for i in range(h):
  lis.append(list(map(int,input().split())))
cou = 0
ans = []
for i in range(h):
  for j in range(w):
    if lis[i][j] % 2 == 1:
      if j != w-1:
        ans.append([str(i+1),str(j+1),str(i+1),str(j+2)])
        lis[i][j]-=1
        lis[i][j+1]+= 1
        cou += 1
      else:
        if i != h-1:
          ans.append([str(i+1),str(j+1),str(i+2),str(j+1)])
          lis[i][j]-=1
          lis[i+1][j]+= 1
          cou += 1
print(cou)
for i in range(len(ans)):
  print(" ".join(ans[i]))

Measured memory_bytes: 50024
#include <iostream>
#include <cstring>
#include <cstdlib>
#include <set>
#include <vector>
#include <map>
#include <cstdio>
#include <utility>
#include <algorithm>
#include <cmath>
#include <queue>
#include <stack>
#include <cassert>
#include <climits>
using namespace std;
typedef long long ll;
#define DEBUG
#ifdef DEBUG
	#define debug printf
#else
	#define debug(...)
#endif
const ll maxn = 55;
ll a[maxn],p[maxn];
ll fon(ll n,ll x)
{
	if(n == 0)
	{
		return x > 0;
	}
	else if(x <= 1 + a[n - 1])
	{
		return fon(n - 1,x - 1);
	}
	else
	{
		return p[n - 1] + 1 + fon(n - 1,x - 2 - a[n - 1]);
	}
}
void init()
{
	for(ll i = 1;i < maxn; ++i)
	{
		a[i] = a[i - 1] * 2 + 3;
		p[i] = p[i - 1] * 2 + 1;
	}
}
int main(int argc, char const *argv[])
{
	ll n,x;
	a[0] = p[0] = 1;
	init();
	cin>>n>>x;
	printf("%lld\n",fon(n,x));
	return 0;
}


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

using ll = long long;

const ll inf = 1e18;
const int MX = 100005;

ll dn[MX * 4], sum[MX * 4];
ll a[MX];

void add(int u, int st, int en, ll c) {
	sum[u] = c;
	dn[u] = c;
}

void down(int u, int st, int en) {
	if (!dn[u]) return;
	int md = st + en >> 1;
	add(u * 2, st, md, dn[u]);
	add(u * 2 + 1, md + 1, en, dn[u]);
	dn[u] = 0;
}
void update(int u) {
	sum[u] = min(sum[u * 2], sum[u * 2 + 1]);
}
void add(int u, int st, int en, int l, int r, ll c) {
	if (l <= st && en <= r) {
		add(u, st, en, c);
		return;
	}
	down(u, st, en);
	int md = st + en >> 1;
	if (l <= md) add(u * 2, st, md, l, r, c);
	if (r > md) add(u * 2 + 1, md + 1, en, l, r, c);
	update(u);
}
ll get(int u, int st, int en, int l, int r) {
	if (l <= st && en <= r) {
		return sum[u];
	}
	down(u, st, en);
	int md = st + en >> 1;
	ll rlt = inf;
	if (l <= md) rlt = min(rlt,  get(u * 2, st, md, l, r));
	if (r > md) rlt = min(rlt, get(u * 2 + 1, md + 1, en, l, r));
	update(u);
	return rlt;
}
void build(int u, int st, int en) {
	dn[u] = 0;
	if (st == en) {
		sum[u] = a[st];
		return;
	}
	int md = st + en >> 1;
	build(u * 2, st, md);
	build(u * 2 + 1, md + 1, en);
	update(u);
}

struct p{
	int l, r, c;
	bool operator < (p rhs){
		if(rhs.r == r) return l < rhs.l;
		return r < rhs.r;
	}
};
p q[100005];

int main() {
	ios::sync_with_stdio(0);
	int n, m;
	cin >> n >> m;
	for(int i = 1; i <= n; i ++) a[i] = inf;
	a[1] = 0;
	build(1, 1, n);
	for(int i = 0; i < m; i ++) cin >> q[i].l >> q[i].r >> q[i].c;
	sort(q, q + m);
	for(int i = 0; i < m; i ++){
		a[q[i].r] = min(a[q[i].r], get(1, 1, n, q[i].l, q[i].r - 1) + q[i].c);
		add(1, 1, n, q[i].r, q[i].r, a[q[i].r]);
	}
	if(a[n] == inf) cout << -1 << '\n';
	else cout << a[n] << '\n';
}

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

int main(){
	int N, d, p, a = 0;
	
	cin>>N>>d;
	
	for(int i = 1; i <= N; i++){
		cin>>p;
		if(p-d > 0)a += p-d;
	}
	
	if(a >= 1) cout<<a<<endl;
	else cout<<"kusoge"<<endl;
	
	return 0;
}
//9:24


Measured memory_bytes: 3092
#include <bits/stdc++.h>
using namespace std;
 
int main(){
  int a,b;
  string A,B,C;
  cin>>A>>B>>C; 
  a=A.size();
  b=B.size();
  if(A.at(a-1)==B.at(0) && B.at(b-1)==C.at(0))cout<<"YES";
  else cout<<"NO";
}

Measured memory_bytes: 256
import java.io.FileInputStream
import java.util.*


var sc: Scanner = Scanner(System.`in`)
fun main(args: Array<String>) {
    if (args.size > 0) {
        System.setIn(FileInputStream(args[0]))
    }
    sc = Scanner(System.`in`)

    problem()

}

fun problem() {

    val N = sc.nextInt()
    val D = sc.nextInt()
    val X = sc.nextInt()
    var count = 0
    for (i in 1..N) {
        val Ai = sc.nextInt()
        for (day in 1..D step Ai) {
            count++
        }
    }


    //println(brues)
    println(count + X)

}



Measured memory_bytes: 31380
#include <bits/stdc++.h>
using namespace std;
int main(){
  int n,m,x,y;
  cin >> n >> m >> x >> y;
  int xx=x;
  int yy=y;
  for(int i=0;i<n;i++){
    int X;
    cin >> X;
    xx = max(X,xx);
  }
  for(int i=0;i<m;i++){
    int Y;
    cin >> Y;
    yy = min(Y,yy);
  }
  if(xx<yy){
    cout << "No War" << endl;
  } else {
    cout << "War" << endl;
  }
}


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

typedef long long int ll;

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

    if(k <= a){
        cout << a-k << " " << b << endl;
    }
    else if(k<=(a+b)){
        cout << "0 " << a + b - k << endl;
    }
    else 
        cout << "0 0" << endl;
    return 0;
}

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

int n;
int niz[100002][3];
long long DP[100002][3];

int main() {
    cin >> n;
    for (int i=0; i<n; i++) {
        cin >> niz[i][0];
        cin >> niz[i][1];
        cin >> niz[i][2];
    }

    DP[0][0] = niz[0][0];
    DP[0][1] = niz[0][1];
    DP[0][2] = niz[0][2];

    for (int i=1; i<n; i++) {
        DP[i][0] = max(DP[i-1][1], DP[i-1][2]) + niz[i][0];
        DP[i][1] = max(DP[i-1][0], DP[i-1][2]) + niz[i][1];
        DP[i][2] = max(DP[i-1][0], DP[i-1][1]) + niz[i][2];
    }

    cout << max(DP[n-1][0], max(DP[n-1][1], DP[n-1][2]));

return 0;
}



Measured memory_bytes: 3712
#include <iostream>

using namespace std;

int main()
{
    int x,y;
    cin>>x>>y;
    if(y%2!=0){
        cout<<"No";
    }else{
        if(y>=2*x&&y<=4*x){
            cout<<"Yes";
        }else{
            cout<<"No";
        }
    }
    return 0;
}


Measured memory_bytes: 3580
#include<bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define all(v) v.begin(), v.end()
using namespace std;

 int main(){
   int n;
   double sum;
   cin >> n;
   vector<double> v(n);
   rep(i,n) cin >> v[i];
   sort(all(v));
   double ans = v[0];
   rep(i,n-1) ans = (ans + v[i+1])/2;
   
   cout << fixed << setprecision(5);

   cout << ans ;
 }

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


int main() {
	bool flag = true;
	long long n, x, total = 0;
	vector<long long> v;
	cin >> n;
	for (int i = 0; i < n; i++) {
		cin >> x;
		v.push_back(x);
	} 
	while (flag) {
		for (int i = 0; i < n; i++) {
			if (v[i] % 2 == 0) v[i] /= 2;
			else {
				flag = false;
				break;
			}
		}
		if (flag == true) total++;
	}
	cout << total << endl;
	return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<algorithm>
#include<functional>
#include<cmath>
#include<string>
#include<vector>
#include<stack>
#include<queue>
#include<map>
#include<set>
#include<deque>
using namespace std;
#define ll long long
const int mod = 1000000007;
const ll INF = 1000000000000000000;

ll V[60];
int main()
{
	int N, K;
	cin >> N >> K;
	for (int i = 0; i < N; i++) cin >> V[i];
	ll ans = 0;
	for (int l = 0; l <= min(N, K); l++) {
		ll sum = 0;
		priority_queue<ll> que;
		priority_queue<ll> t;
		for (int i = 0; i < l; i++) {
			sum += V[i];
			if (V[i] < 0) que.push(-V[i]);
		}
		t = que;
		ll tmp = sum;
		for (int r = 0; r <= min(N - l, K - l); r++) {
			sum = tmp;
			que = t;
			for (int j = 0; j < r; j++) {
				sum += V[N - 1 - j];
				if (V[N - 1 - j] < 0) que.push(-V[N - 1 - j]);
			}
			int cnt = K - l - r;
			for (int c = 0; c < cnt && !que.empty(); c++) {
				int num = que.top();
				que.pop();
				num *= -1;
				sum -= num;
			}
			//if (l == 2 && r == 1) cout << sum << endl;
			ans = max(ans, sum);
		}
	}
	cout << ans << endl;
}


Measured memory_bytes: 256