akhauriyash/Code-Regression huggingface dataset:
import sys
import collections


def solve():
    readline = sys.stdin.buffer.readline
    mod = 10 ** 9 + 7
    n = int(readline())
    csf = []
    for i in range(n-1):
        c, s, f = list(map(int, readline().split()))
        csf.append([c, s, f])
    ql = []
    for i in range(n):
        ql.append([0, i, i])
    ql = collections.deque(ql)
    ans = []
    while True:
        if len(ql) != 0:
            time, pos, start = ql.popleft()
            if pos == n - 1:
                ans.append([time, pos, start])
            else:
                c, s, f = csf[pos]
                if s >= time:
                    ql.append([s + c, pos + 1, start])
                else:
                    if time% f == 0:
                        ql.append([time + c, pos + 1, start])
                    else:
                        ql.append([time + (f - time % f) + c, pos + 1, start])
        else:
            break
    ans.sort(key=lambda x: x[2])
    for i in range(len(ans)):
        print(ans[i][0])


if __name__ == '__main__':
    solve()


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

int main() {
  int h,w,d;
  cin>>h>>w>>d;
  int x[90005],y[90005];
  rep(i,h) rep(j,w) {
    int a;
    cin>>a;
    x[a]=i,y[a]=j;
  }
  ll sum[90005];
  for (int i=1; i<=d; i++) {
    sum[i]=0;
    int j=i+d;
    while (j<=h*w) {
      sum[j]=(ll)abs(x[j]-x[j-d])+abs(y[j]-y[j-d])+sum[j-d];
      j++;
    }
  }
  int q; cin>>q;
  rep(i,q) {
    int l,r;
    cin>>l>>r;
    cout<<sum[r]-sum[l]<<endl;
  }
  return 0;
}



Measured memory_bytes: 2560
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define FOR(i,n) for(int i=0;i<n;i++)
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int t;
    ll x,k,d;
    cin>>x>>k>>d;
    if(x+k+d>=22)cout<<"bust";
    else cout<<"win";

}


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

int main() {
	ll N;
	cin >> N;
	vector<ll> L(N);
	ll an = 0;
	rep(i, N) {
		cin >> L.at(i);
	}
	sort(L.begin(), L.end());
	for (ll i = 0; i < N; i++) {
		for (ll j = i+1; j < N; j++) {
			for (ll k = j + 1; k < N; k++) {
				if (L.at(i) + L.at(j) > L.at(k)&&L.at(i)!=L.at(j)&& L.at(i) != L.at(k)&& L.at(k) != L.at(j))an++;
			}
		}
	}
	


	cout << an << endl;
}

Measured memory_bytes: 3628
N=int(input())
# print(N)

card_list = list(map(int, input().split()))
# print(card_list)

A=0
B=0

for i in range(N):
    if i%2==0:
        A+=max(card_list)
        card_list.remove(max(card_list))
        # print(card_list)
    else:
        B+=max(card_list)
        card_list.remove(max(card_list))
        # print(card_list)

# print(A)
# print(B)

print(A-B)

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

int main(){
    int n,s[1001];
    double m,b;
    while(1){
        cin >> n;
        if(n == 0)break;
        int W =0;
        for(int i =0;i<n ;i++){
            cin >> s[i];
            W += s[i];
        }
        m = 1.0*W/n;
        double T = 0.0;
        for (int j = 0;j<n;j++){
           b=pow(s[j]-m,2);
           T += b;
        }
    
    double U = 1.0*T/n;
    double a = sqrt(U);
    printf("%lf\n",a);
    }
    return 0;
}


Measured memory_bytes: 3236
#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 = (ll)1e9 + 7;
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;}

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);
    }
    int a, b;
    cin>>a>>b;
    string s, t;
    f(i, a) s += (char)(b + '0');
    f(i, b) t += (char)(a + '0');
    cout<<min(s, t);
    return 0;
}


Measured memory_bytes: 256
#include <iostream>
 //this is a comment
using namespace std;
 
int value[3][101];
int sum[3][101];
 
int main()   //main body
{
	int n;
	cin >> n;     //input member
	for (int i = 1; i <= n; i++) cin >> value[1][i];          //loop and input
	for (int i = 1; i <= n; i++) cin >> value[2][i];
	for (int i = 0; i <= 2; i++) sum[i][0] = 0;
	for (int i = 0; i <= n; i++) sum[0][i] = 0;
	for (int i = 1; i <= 2; i++)
		for (int j = 1; j <= n; j++)
			sum[i][j] = max(sum[i][j - 1], sum[i - 1][j]) + value[i][j];    //formula
	cout << sum[2][n] << endl;      //main output
}

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

using namespace std;

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

  int p, q, n, m, k;
  cin >> p >> q >> n >> m >> k;
  vector<int> a(n), b(m), c(k);
  for (int& x : a) {
    cin >> x;
  }
  for (int& x : b) {
    cin >> x;
  }
  for (int& x : c) {
    cin >> x;
  }
  sort(a.rbegin(), a.rend());
  sort(b.rbegin(), b.rend());
  sort(c.rbegin(), c.rend());
  long long ans = 0;
  vector<int> kek;
  for (int i = 0; i < p; ++i) {
    kek.push_back(a[i]);
    ans += a[i];
  }
  for (int i = 0; i < q; ++i) {
    kek.push_back(b[i]);
    ans += b[i];
  }
  sort(kek.begin(), kek.end());
  int l = -1, r = min(kek.size(), c.size());
  while (l + 1 < r) {
    int md = l + r >> 1;
    bool ok = true;
    for (int i = 0; i <= md; ++i) {
      ok &= c[i] >= kek[i];
    }
    if (ok) {
      l = md;
    } else {
      r = md;
    }
  }
  for (int i = 0; i <= l; ++i) {
    ans -= kek[i];
    ans += c[i];
  }
  cout << ans;

  return 0;
}


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

const int maxn = 100005;

int k;
int a[maxn];

signed main () {
    scanf("%d", &k);
    for (int i = 0; i < k; ++i)
        scanf("%d", &a[i]);
    long long ans_min = 2, ans_max = 2;
    bool fucked = 0;
    for (int i = k - 1; i >= 0; --i) {
        if (ans_max / a[i] - (ans_min - 1) / a[i] == 0)
            fucked = 1;
        ans_min = ((ans_min + (a[i] - 1)) / a[i]) * a[i];
        ans_max = (ans_max / a[i]) * a[i] + (a[i] - 1);
    }
    if (fucked)
        printf("-1\n");
    else
        printf("%lld %lld\n", ans_min, ans_max);
}


Measured memory_bytes: 640
#include<bits/stdc++.h>
using namespace std;
int main(){
  int N,M;
  cin >> N >> M;
  vector<int> L(M);
  vector<int> R(M);
  for(int i = 0; i < M; i++){
    cin >> L[i] >> R[i];
    }
    sort(L.begin(),L.end());
    sort(R.begin(),R.end());
    reverse(R.begin(),R.end());
    if(R[M-1]-L[M-1] >=0){
      cout << R[M-1]-L[M-1] +1 << endl;
    }
    else{
      cout << 0 << endl;
    }
    
}



Measured memory_bytes: 1024
#include<iostream>
#include<iomanip>
#include<vector>
#include<map>
#include<stack>
#include<queue>
#include<string>
#include<utility>
#include<numeric>
#include<algorithm>
#include<cmath>
#include<climits>
using namespace std;

using ll = long long;

class Stream{
public:
    Stream(){

    }
    //配列以外の入力を受け取る
    void read(){

    }
    template<typename First, typename... Rest>
    void read(First& first, Rest&... rest){
        cin >> first;
        read(rest...);
    }
    //配列を区切って出力する
    template<typename T>
    void write_vec(vector<T>& v, char divider){
        for(size_t i = 0; i < v.size(); i++){
            cout << v[i] << divider;
        }
    }
};

struct UF{
    const int node_num;
    vector<int> parent;
    vector<int> size;

    UF(int N) : node_num(N), parent(N), size(N, 1) {
        for(int i = 0; i < N; ++i) parent[i] = i;
    }

    //xの根を得る
    int root(int x){
        if(parent[x] == x) return x;
        return parent[x] = root(parent[x]);
    }

    //xが属する木とyが属する木を一つに合わせる
    void unite(int x, int y){
        int root_x = root(x);
        int root_y = root(y);
        if(root_x == root_y) return;
        parent[root_y] = root_x;
        size[root_x] += size[root_y];
    }

    //xとyが属する木が同じならtrueを返す
    bool same(int x, int y){
        int root_x = root(x);
        int root_y = root(y);
        return root_x == root_y;
    }

    //xと同じ木に属する要素の数を返す
    int same_size(int x){
        int root_x = root(x);
        return size[root_x];
    }
};

int main(){
    Stream io;
    
    int x;
    io.read(x);
    string ans = "ARC";
    if(x < 1200){
        ans = "ABC";
    }
    cout << ans;
    return 0;
}

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

#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define copy(from, to) copy(from.begin(), from.end(), back_inserter(to))
#define sort(a) sort(a.begin(), a.end())
#define p(s) cout << (s) << endl

typedef long long ll;
using namespace std;

template<class T>
void load(vector<T> &v, int n) {
  for (int i = 0; i < n; ++i) {
    T t;
    cin >> t;
    v.push_back(t);
  }
}


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

  cout << s.substr(0, s.length() - 8) << endl;
}

Measured memory_bytes: 256
import sys

stdin = sys.stdin

ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline().rstrip()  # ignore trailing spaces

n, m = na()
ab = []
for i in range(n):
    ab.append(na())
ab.sort(key=lambda x: x[0])

rem = m
ans = 0
for v in ab:
    buy = min(rem, v[1])
    ans += buy * v[0]
    rem -= buy
print(ans)


Measured memory_bytes: 28956
n=int(input())
s,h,c,d=[],[],[],[]

for i in range(n):
    m,r=input().split()
    if m == 'S':
        s.append(int(r))
    elif m == 'H':
        h.append(int(r))
    elif m == 'C':
        c.append(int(r))
    elif m == 'D':
        d.append(int(r))

for i in range(1,14):
    if i not in s:
        print('S', str(i))
for i in range(1,14):
    if i not in h:
        print('H', str(i))
for i in range(1,14):
    if i not in c:
        print('C', str(i))
for i in range(1,14):
    if i not in d:
        print('D', str(i))

Measured memory_bytes: 7760
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Linq.Expressions;
using System.Text;
class Simple {
    string N;
    void Solve() {
        //input
        N = io.String;
        //cal
        var ans = N.Contains('9');
        //ret
        Console.WriteLine(ans?"Yes":"No");
    }
    SimpleIO io = new SimpleIO();
    public static void Main(string[] args) { new Simple().Stream(); }
    void Stream() {
        Solve();
        io.writeFlush();
    }
}
class SimpleIO {
    SimpleIO(bool isAutoFlush = false) { this.isAutoFlush = isAutoFlush; }
    string[] nextBuffer;
    int BufferCnt;
    char[] cs = new char[] { ' ' };
    public bool isAutoFlush;
    StreamWriter sw = new StreamWriter(Console.OpenStandardOutput()) { AutoFlush = false };
    public SimpleIO() {
        nextBuffer = new string[0];
        BufferCnt = 0;
        if(!isAutoFlush)
            Console.SetOut(sw);
    }
    public string Next() {
        if (BufferCnt < nextBuffer.Length)
            return nextBuffer[BufferCnt++];

        string st = Console.ReadLine();
        while (st == "")
            st = Console.ReadLine();
        nextBuffer = st.Split(cs, StringSplitOptions.RemoveEmptyEntries);
        BufferCnt = 0;
        return nextBuffer[BufferCnt++];
    }
    public string String => Next();
    public char Char => char.Parse(String);
    public int Int => int.Parse(String);
    public long Long => long.Parse(String);
    public double Double => double.Parse(String);
    public void writeFlush() { Console.Out.Flush(); }
}


Measured memory_bytes: 13268
#include <bits/stdc++.h>
#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 all(x) (x).begin(), (x).end()
using namespace std;
using ll = long long;
using P = pair<int, int>;
template <class T>
inline bool chmin(T& a, T b) {
   if (a > b) {
      a = b;
      return true;
   }
   return false;
}
template <class T>
inline bool chmax(T& a, T b) {
   if (a < b) {
      a = b;
      return true;
   }
   return false;
}
void hr() {
   cerr << "--------------" << endl;
}
const int INF = 1001001001;
const int MOD = 1000000007;

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

   int n;
   cin >> n;
   vector<int> a(n);
   rep(i, 0, n) cin >> a[i];

   ll kb = 0, money = 1000;
   rep(i, 0, n - 1) {
      // buy
      if (a[i] < a[i + 1]) {
         kb += money / a[i];
         money -= money / a[i] * a[i];
      }
      // sale
      if (a[i] > a[i + 1]) {
         money += kb*a[i];
         kb = 0;
      }
   }
   money += kb*a[n-1];
   cout << money << endl;
   return 0;
}

Measured memory_bytes: 3656
s = input()
a = int(s[:2])
b = int(s[2:])
if 0 < a <= 12 and 0 < b <= 12:
    print("AMBIGUOUS")
elif 0 < a <= 12:
    print("MMYY")
elif 0 < b <= 12:
    print("YYMM")
else:
    print("NA")

Measured memory_bytes: 2940
#include <bits/stdc++.h>                 // [PRIMES]               1777 ~2^10.80
using namespace std;                     //                       10333 ~2^13.33
using ll=long long;                      // seq 1 128 | factor   100333 ~2^16.61
using vl=vector<ll>;                     //   | grep -v ' .* '  1300111 ~2^20.31
using vvl=vector<vl>;                    //                    10300777 ~2^23.30
using vb=vector<bool>;                   //                   100400999 ~2^26.58
using vs=vector<string>;                 //                  1300400999 ~2^30.28
using pll=pair<ll,ll>;                   //                 10200500333 ~2^33.25
const ll oo =0x3f3f3f3f3f3f3f3fLL;       //                100200400777 ~2^36.54
const double eps=1e-9;                   //               1200300700111 ~2^40.13
#define sz(c) ll((c).size())             //              10200300500777 ~2^43.21
#define all(c) begin(c),end(c)           //             100200300400777 ~2^46.51
#define mp make_pair                     //            1200300400600999 ~2^50.09
#define mt make_tuple                    //           10200300400600111 ~2^53.18
#define pb push_back                     //          100200300400600333 ~2^56.48
#define eb emplace_back                  //         1200300400500800999 ~2^60.06
#define xx first
#define yy second
#define FOR(i,a,b) for(ll i=(a); i<(b); i++)
#define FORD(i,a,b) for(ll i=ll(b)-1;i>=(a);i--)
#define TR(X) ({if(1) cerr << "TR: " << (#X) << " = " << (X) << endl; })

int main(){
	cin.sync_with_stdio(0);

	ll n, q;
	cin >> n >> q;

	vector<pair<vl, ll>> vs(n);
	ll a, b, p, x;

	FOR(i,0,n-1) {
		cin >> a >> b;
		vs[a-1].xx.pb(b-1);
		vs[b-1].xx.pb(a-1);
	}
	FOR(i,0,q) {
		cin >> p >> x;
		vs[p-1].yy += x;
	}

	queue<ll> fifo;
	fifo.push(0);
	vb visited(n);

#if 0
	FOR(i,0,n) {
		cerr << i<< ": [";
		for (auto l : vs[i].xx) {
			cerr << l << ",";
		}
		cerr << "] " << vs[i].yy << "\n";
	}
#endif

	while (!fifo.empty()) {
		visited[fifo.front()] = true;
		auto v = vs[fifo.front()];
		fifo.pop();
		for (auto d : v.xx) {
			if (visited[d]) {
				continue;
			}

			fifo.push(d);
			vs[d].yy += v.yy;
		}
	}

	cout << vs[0].yy;
	FOR(i,1,n) {
		cout << " " << vs[i].yy;
	}
	cout << "\n";
}


Measured memory_bytes: 18004
#include<bits/stdc++.h>
using namespace std;
int main()
{
   long long int i,j,m,n,l,sum=0,a;
   cin>>n;
   a=n;
   while(a!=0)
   {
       l=a%10;
       sum=sum+l;
       a=a/10;
   }
   if(n%sum==0)
   {
       cout<<"Yes"<<endl;
   }
   else
    cout<<"No"<<endl;

}


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

namespace ALDS1_1C{
    public class Program{
        public static void Main(string[] args){
            var sr = new StreamReader();
            //---------------------------------
            var N = sr.Next<int>();
            var A = sr.Next<int>(N);

            Console.WriteLine(A.Count(Prime.Is));
            //---------------------------------
        }
    }

    public class Prime{
        public static bool Is(int n){
            for(var i = 2; i * i <= n; i++) if(n % i == 0) return false;
            return n > 1;
        }

        public static IEnumerable<int> Sieve(int n){
            var sieve = new bool[n + 1];
            for(var i = 2; i <= n; i++){
                if(!sieve[i]){
                    yield return i;
                    for(var j = i << 1; j <= n; j += i) sieve[j] = true;
                }
            }
        }
    }

    public class StreamReader{
        private readonly char[] _c = {' '};
        private int _index = -1;
        private string[] _input = new string[0];

        public T Next<T>(){
            if(_index == _input.Length - 1){
                _index = -1;
                while(true){
                    string rl = Console.ReadLine();
                    if(rl == null){
                        if(typeof(T).IsClass) return default(T);
                        return (T)typeof(T).GetField("MinValue").GetValue(null);
                    }
                    if(rl != ""){
                        _input = rl.Split(_c, StringSplitOptions.RemoveEmptyEntries);
                        break;
                    }
                }
            }
            return (T)Convert.ChangeType(_input[++_index], typeof(T), System.Globalization.CultureInfo.InvariantCulture);
        }

        public T[] Next<T>(int x){
            var ret = new T[x];
            for(var i = 0; i < x; ++i) ret[i] = Next<T>();
            return ret;
        }

        public T[][] Next<T>(int y, int x){
            var ret = new T[y][];
            for(var i = 0; i < y; ++i) ret[i] = Next<T>(x);
            return ret;
        }
    }
}

Measured memory_bytes: 10392
#include <iostream>
#include <fstream>
#include <cstdio>
#include <cassert>
#include <complex>
#include <cmath>
#include <algorithm>
#include <vector>
#include <string>
#include <cstdlib>
#include <cstring>
#include <iomanip>
#include <numeric>
#include <sstream>
#include <ctime>
#include <cctype>
#include <set>
#include <map>
#include <queue>
#include <bitset>
#include <deque>
#include <stack>
#include <memory.h>
using namespace std;
#define ll long long 
string s;
int main()
{
	cin>>s;
	for(int i=0;i<s.size()-1;i++){
		if(s[i]=='A'&&s[i+1]=='C'){
			cout<<"Yes";
			return 0;
		}
	}
	cout<<"No";
    return 0;
}

Measured memory_bytes: 256
#include<iostream>
using namespace std;
main(){
	char s;int a=0,b=0,c=0,d=0;
	for(;cin>>s;s-'N'?s-'S'?s-'E'?a++:b++:c++:d++);
	cout<<(a&&b&&c&&d?"Yes":a&&b&&!c&&!d?"Yes":!a&&!b&&c&&d?"Yes":"No")<<endl;
}

Measured memory_bytes: 256
x,y = map(int,input().split())
p = x * 2
if p == y:
    print('Yes')
elif p > y:
    print('No')
else:
    for i in range(x+1)[1:]:
        p += 2
        if p == y:
            print('Yes')
            break
        elif p > y:
            print('No')
            break

if y > p:
    print('No')

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

// 2D-vector
// vector<vector<int>> vec_2D(h, vector<int>(w, 0));

typedef long lint;
typedef long long llint;

// static const int MAX = 1e6;
// static const int NIL = -1;
// static const ll INF = 1<<21;
// static const ll MOD = 1e9 + 7;

bool compPair(const pair<int, int>& arg1, const pair<int, int>& arg2) { return arg1.first > arg2.first; }
template<class T> void chmax(T& a, T b) { if (a < b) { a = b; } }
template<class T> void chmin(T& a, T b) { if (a > b) { a = b; } }


int main(void) {
    int n, m, q;
    cin >> n >> m >> q;

    vector<vector<int>> lr(n+1, vector<int>(n+1, 0));
    int ltmp, rtmp;
    for(int im=0;im<m;im++) {
        cin >> ltmp >> rtmp;
        lr.at(ltmp).at(rtmp)++;
    }
    for(int il=1;il<=n;il++) {
        for(int ir=1;ir<=n;ir++) {
            lr.at(il).at(ir) += lr.at(il).at(ir-1);
        }
    }
    for(int il=1;il<=n;il++) {
        for(int ir=1;ir<=n;ir++) {
            lr.at(il).at(ir) += lr.at(il-1).at(ir);
        }
    }

    int ans, ptmp, qtmp;
    for(int iq=0;iq<q;iq++) {
        cin >> ptmp >> qtmp;
        ans = lr.at(qtmp).at(qtmp)+lr.at(ptmp-1).at(ptmp-1);
        ans -= lr.at(qtmp).at(ptmp-1)+lr.at(ptmp-1).at(qtmp);
        cout << ans << endl;
    }
    return 0;
}


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

int N, K;
vector<int> d;
vector<vector<int>> A;

void input(){
	cin >> N >> K;
	d.resize(K);
	A.resize(K, vector<int>());
	for(int i = 0; i < K; i++){
		cin >> d.at(i);
		A.at(i).resize(d.at(i));
		for(int j = 0; j < d.at(i); j++){
			cin >> A.at(i).at(j);
		}
	}
}

void solve(){
	int ans = 0;
	for(int i = 1; i <= N; i++){
		bool have = false;
		for(auto v : A){
			for(auto p : v){
				if(p == i) have = true;
			}
		}
		if(!have) ans++;
	}
	cout << ans << endl;
}

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


Measured memory_bytes: 3648
#include<stdio.h>
#include<string.h>
#define rep(i,N) for(int i=0;i<(int)N;i++)
int main(void)
{
  char S[1001],T[1001];int change=1000;
  if(!scanf("%s %s",S,T))return -1;
  rep(i,(int)strlen(S)-(int)strlen(T)+1)
  {
    int diff=0;
    rep(j,(int)strlen(T)){if(S[i+j]!=T[j]){diff++;}}
    change=diff<change?diff:change;
  }
  return printf("%d\n",change),0;
}

Measured memory_bytes: 1728
import java.util.*; 

class Main{
public static void main(String[] args){
	Scanner sc=new Scanner(System.in);
        long h=sc.nextLong();
        long w=sc.nextLong();
		long ans=0;
  
  	if(w==1||h==1){
    	ans=1;
    }else if(h%2==1){
    		if(w%2==0){
            	ans=h*(w/2);
            }else{
            	ans=h*(w/2)+h/2+1;
            }
    	}else{
			ans=h/2*w;
   	 }

    	System.out.println(ans);
    }
}

Measured memory_bytes: 21716
#include <bits/stdc++.h>
#define endl "\n"
using namespace std;
typedef long long ll;
typedef pair<ll, ll> l_l;
typedef pair<int, int> i_i;
template<class T>
inline bool chmax(T &a, T b) {
    if(a < b) {
        a = b;
        return true;
    }
    return false;
}

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

const long long INF = 1e18;
//const ll mod = 1000000007;

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    ll N;
    cin >> N;
    N--;
    ll nownum = 1;
    for(ll len = 1; ; len++) {
        nownum *= 26;
        if(N >= nownum) {
            N -= nownum;
            continue;
        }
        string ans;
        for(int i = 0; i < len; i++) {
            ans.push_back('a');
            nownum /= 26;
            while(N >= nownum) {
                ans[i]++;
                N -= nownum;
            }
        }
        cout << ans << endl;
        return 0;
    }
    return 0;
}


Measured memory_bytes: 3628
#include<stdio.h>
#include<iostream>
#include<cmath>

using namespace std;

int main(void){
  int a, b, x;
  scanf("%d%d%d", &a, &b, &x);
  if(a * a * b >= 2 * x){
    double deg = atan((double) x * 2 / (a * b * b));
    printf("%lf\n", 90 - deg * 180 / 3.14159265358979);
  }
  else{
    double deg = atan((double) 2 * (a * a * b - x) / (a * a * a));
    printf("%lf\n", deg * 180 / 3.14159265358979);
  }
  return 0;
}


Measured memory_bytes: 256
import sys
from collections import Counter
from collections import defaultdict

N=input()

C=defaultdict(lambda: 0) 
for i in range(N):
	s=sys.stdin.readline().strip()
	s=list(s)
	s.sort()
	s="".join(s)
	C[s]+=1
ans=0

for i in C.values():
	ans+=i*(i-1)/2

print ans


Measured memory_bytes: 49180
import sys
import math
import collections
import bisect
import itertools

import numpy as np

sys.setrecursionlimit(10 ** 7)
INF = 10 ** 20
MOD = 10 ** 9 + 7
# MOD = 998244353

ni = lambda: int(sys.stdin.readline().rstrip())
ns = lambda: map(int, sys.stdin.readline().rstrip().split())
na = lambda: list(map(int, sys.stdin.readline().rstrip().split()))
na1 = lambda: list(map(lambda x: int(x) - 1, sys.stdin.readline().rstrip().split()))


# ===CODE===

def main():
    h, w = ns()

    ans = INF
    for i in range(1, h):
        area1 = w * i
        remain_h = h - i
        area2a = [area1]
        odd = w % 2
        area2a.append(remain_h * (w // 2))
        area2a.append(remain_h * ((w + odd) // 2))
        ans = min(ans, max(area2a) - min(area2a))

        if remain_h >= 2:
            area2b = [area1]
            odd = remain_h % 2
            area2b.append((remain_h // 2) * w)
            area2b.append(((remain_h + odd) // 2 )* w)
            ans = min(ans, max(area2b) - min(area2b))

    w, h = h, w
    for i in range(1, h):
        area1 = w * i
        remain_h = h - i
        area2a = [area1]
        odd = w % 2
        area2a.append(remain_h * (w // 2))
        area2a.append(remain_h * ((w + odd) // 2))
        ans = min(ans, max(area2a) - min(area2a))

        if remain_h >= 2:
            area2b = [area1]
            odd = remain_h % 2
            area2b.append((remain_h // 2) * w)
            area2b.append(((remain_h + odd) // 2 )* w)
            ans = min(ans, max(area2b) - min(area2b))

    print(ans)


if __name__ == '__main__':
    main()


Measured memory_bytes: 27080
#include <iostream>
#include <stdio.h>

using namespace std;

int main(){
	int a,b,c;
	int ans1 = 0 , ans2 = 0;

	while(scanf("%d,%d,%d", &a , &b , &c) != EOF){

		//if(a == 0 && b == 0 && c == 0) break;
		if(a != b && a != c){
			ans2++;
		}
		if(a == b && a != c && b != c){
			ans1++;
		}
	}

	cout << ans1 << endl;
	cout << ans2 << endl;

	return 0;
}

Measured memory_bytes: 1208
N=int(input())
A=list(map(int,input().split()))
B=list(map(int,input().split()))
ans=0

for i in range(N):
    if i%2==0:
        if A[int(i/2)]>=B[int(i/2)]:
            A[int(i/2)]-=B[int(i/2)]
            ans+=B[int(i/2)]
            B[int(i/2)]=0
        else:
            B[int(i/2)]-=A[int(i/2)]
            ans+=A[int(i/2)]
            A[int(i/2)]=0
        if A[int(i/2)+1]>=B[int(i/2)]:
            A[int(i/2)+1]-=B[int(i/2)]
            ans+=B[int(i/2)]
            B[int(i/2)]=0
        else:
            B[int(i/2)]-=A[int(i/2)+1]
            ans+=A[int(i/2)+1]
            A[int(i/2)+1]=0
    else:
        if A[N-int(i/2)]>=B[N-int(i/2)-1]:
            A[N-int(i/2)]-=B[N-int(i/2)-1]
            ans+=B[N-int(i/2)-1]
            B[N-int(i/2)-1]=0
        else:
            B[N-int(i/2)-1]-=A[N-int(i/2)]
            ans+=A[N-int(i/2)]
            A[N-int(i/2)]=0
        if A[N-int(i/2)-1]>=B[N-int(i/2)-1]:
            A[N-int(i/2)-1]-=B[N-int(i/2)-1]
            ans+=B[N-int(i/2)-1]
            B[N-int(i/2)-1]=0
        else:
            B[N-int(i/2)-1]-=A[N-int(i/2)-1]
            ans+=A[N-int(i/2)-1]
            A[N-int(i/2)-1]=0

print(ans)


Measured memory_bytes: 24832
import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        int b = sc.nextInt();
        int r = a - b * 2;
        if (r < 0) { r = 0; }
        System.out.println(r);
    }
}


Measured memory_bytes: 21844
#include <bits/stdc++.h>
using namespace std;
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define endl "\n"
#define mod 998244353
#define int long long
#define ll long long
#define EPS 0.00000000000001
#define ld long double
#define inf 1e14
#define N 500001
#define K 4
#define ALPHA 1.0
#define BETA 1.0



int32_t main()
{
    IOS;
    #ifndef ONLINE_JUDGE
    freopen("int.txt","r",stdin);
    freopen("out.txt","w",stdout);
    #endif
    int d;
    cin >> d;
    vector<int> c(26);
    double average = 0.0;

    for(int i = 0;i < 26;i++)
        cin >> c[i];
    vector<vector<int>> v(d,vector<int>(26,0));
    for(int i = 0;i < d;i++)
    {
        for(int j = 0;j < 26;j++)
        {
            cin >> v[i][j];
            average += v[i][j];
        }
    }
    average /= (d * 26);
    vector<int> last(26,-1);
    for(int i = 0;i < d;i++)
    {
        int mxgain = -inf;
        int ind = -1;
        for(int j = 0;j < 26;j++)
        {
            int gain = v[i][j] + (i - d) * c[j];
            // cerr << j << " " << gain << endl;
            if(gain > mxgain)
            {
                mxgain = gain;
                ind = j;
            }
        }
        cout << ind + 1 << endl;
    }


    


    

    
    return 0;    
} 



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

// GCD, LCM
ll gcd(ll a, ll b) { return b?gcd(b,a%b):a;}
ll lcm(ll a, ll b) { return a/gcd(a,b)*b;}

int main()
{
    int N,ans[200010]={},A[200010]={};

    cin >> N;

    for(int i=1;i<=N;i++){
        ans[i]=0;
    }

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

    for(int i=1;i<=N;i++){
    cout<<ans[i]<<endl;
    }



    return 0;
}

Measured memory_bytes: 5184
def calc(pp,x,y):
    p = 0
    for i in range(1,1000):
        if i*(100+x)/100 == pp:
            p = i
            break
    return p*(100+y)/100

while True:
    max = 0
    x,y,s = map(int,raw_input().split())
    if x == 0 and y == 0 and s == 0:
        break
    for i in range(1,s):
        j = s-i
        res = calc(i,x,y) + calc(j,x,y)
        if max < res:
            max = res
    print max

Measured memory_bytes: 4260
/********************************************************************
 * Ejercicio: Frog 1                                                *
 * Url: https://atcoder.jp/contests/dp/tasks/dp_a                   *
 * Lenguaje: c++                                                    *
 * Autor: Sebastian Vega                                            *
 * Fecha: 27-08-2020                                                *
 *******************************************************************/

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
#define forn(i, a, b) for (int i = a; i < b; ++i)
#define SZ(x) int(x.size())
#define pb push_back
#define F first
#define S second
void dbg_out() { cerr << endl; }
template <typename Head, typename... Tail>
void dbg_out(Head H, Tail... T) {
  cerr << ' ' << H;
  dbg_out(T...);
}

const int N = 1e5 + 1;
int n, h[N], dp[N];

int main() {
#ifdef LOCAL
  freopen("in.txt", "r", stdin);
// freopen("main.txt", "w", stdout);
#define dbg(...) cerr << "(" << #__VA_ARGS__ << "):", dbg_out(__VA_ARGS__)
#else
  ios::sync_with_stdio(0);
  cin.tie(0);
#define endl '\n'
#define dbg(...) 18
#endif
  cin >> n;
  for (int i = 0; i < n; i++) cin >> h[i];
  for (int i = 0; i < n; i++) {
    if (i == 0)
      dp[i] = 0;
    else if (i == 1)
      dp[i] = abs(h[i] - h[i - 1]) + dp[i - 1];
    else
      dp[i] = min(abs(h[i] - h[i - 1]) + dp[i - 1],
                  abs(h[i] - h[i - 2]) + dp[i - 2]);
    dbg(i, dp[i]);
  }
  cout << dp[n - 1] << endl;
  return 0;
}

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

using namespace std;

int main() {
  int a, b, c, k;
  cin >> a >> b >> c >> k;
  int _max = max({ a, b, c });
  int p = pow( 2, k );
  cout << a + b + c + _max * ( p - 1 ) << endl;

  return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
# define ll long long
# define int long long
#define gok ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);

signed main(){
    gok
    int n;
    cin>>n;
    int a[n];
    bool ch=true;
    for(int i=0;i<n;i++){
        cin>>a[i];
     if(a[i]%2==0)
     {
         if(a[i]%3!=0 &&a[i]%5!=0)
         {
             ch=false;
         }
     }
    }
    if(ch)
        cout<<"APPROVED";
    else
        cout<<"DENIED";

    return 0;
}


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

int ri() {
	int n;
	scanf("%d", &n);
	return n;
}

int main() {
	int64_t n;
	std::cin >> n;
	int a = ri(), b = ri();
	n %= 12;
	for (int i = 0; i < n; i++) {
		if (i & 1) {
			b += a;
		} else {
			a -= b;
		}
	}
	std::cout << a << " " << b << std::endl;
	return 0;
}




Measured memory_bytes: 3240
#!/usr/bin/env python
# -*- coding: utf-8 -*-

import sys  # {{{
import os
import time
import re
from pydoc import help
import string
import math
from operator import itemgetter
from collections import Counter
from collections import deque
from collections import defaultdict as dd
import fractions
from heapq import heappop, heappush, heapify
import array
from bisect import bisect_left, bisect_right, insort_left, insort_right
from copy import deepcopy as dcopy
import itertools
# }}}

# pre-defined{{{
sys.setrecursionlimit(10**7)
INF = 10**20
GOSA = 1.0 / 10**10
MOD = 10**9+7
ALPHABETS = [chr(i) for i in range(ord('a'), ord('z')+1)]  # can also use string module
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def DP(N, M, first): return [[first] * M for n in range(N)]
def DP3(N, M, L, first): return [[[first] * L for n in range(M)] for _ in range(N)]
from inspect import currentframe
# }}}

def solve():
    s = input()
    if s == "ABC":
        print("ARC")
    else:
        print("ABC")

    return 0

if __name__ == "__main__":# {{{
    solve()

# vim: set foldmethod=marker: }}}


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

int main(void){
	char c;
	string str="aiueo";

	cin >> c;
	
	for(int i=0;i<5;i++){
		if(str[i]==c){
			cout << "vowel" << endl;
			return 0;
		}
	}

	cout << "consonant" << endl;
	
	return 0;
}


Measured memory_bytes: 256
/*" بِسْمِ اللهِ الرَّحْمٰنِ الرَّحِيْمِ -In the name of Allah."
   Never stop chasing!-MD.SOURAV.

   ░░░░░░░░( •̪●)░░░░░░░░░░░░░░░░░░░░░░░░
   ░░░░░░███████ ]▄▄▄▄▄▄▄▄▃░░░▃░░░░ ▃░
   ▂▄▅█████████▅▄▃▂░░░░░░░░░░░░░░░░░
   [███████████████████].░░░░░░░░░░░░░░
   ◥⊙▲⊙▲⊙▲⊙▲⊙▲⊙▲⊙◤...░░░░░░░░░░░░
*/


#include <bits/stdc++.h>


#define yes            cout<<"YES"<<endl
#define no             cout<<"NO"<<endl
#define sz(x)          x.size()
#define ll             long long int
#define li              ong int
#define start          ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define test           int t;cin>>t;while(t--)
#define f(i, a, n)     for(int i=a; i<n;i++)
#define gcd(a,b)       __gcd(a,b)
#define lcd(a,b)       (a*b)/gcd(a,b)
#define pb             push_back
#define mp(x,y)        make_pair(x,y)
#define rsrt(v)        sort(v.begin(),v.end(),greater<int>())
#define srt(v)         sort(v.begin(),v.end())
#define basrt(a,n)     sort(a,a+n,greater<int>())
#define asrt(a,n)      sort(a,a+n)
#define F              first
#define S              second
#define deb(x)         cout << #x << ": " << x << endl;
#define enter(v,n)     for(ll i=0;i<n;i++){ll x;cin>>x;v.pb(x);}
#define MOD 	       1000000007
#define unique(v)      v.erase(unique(v.begin(),v.end()),v.end())
#define ignore         cin.ignore (std::numeric_limits<std::streamsize>::max(),'\n');
#define MAX 32000
#define endl "\n"

using namespace std;

double pi=3.14159265358979323846264338327950288419716939937510582097494459230781640628620899862803482534211706798214808651328230664 ;
typedef vector<ll> vll ;
typedef vector<int> vii ;
typedef vector<pair<ll,ll>> vpllll;
typedef vector<pair<int,int>> vpiiii;
typedef map<ll,ll> mllll;
typedef map<char,ll> mchll;
typedef map<string,ll>msll;

template<typename T>
ostream& operator<<(ostream &os, const vector<T> &v)
{
    os << '{';
    for (const auto &x : v) os << " " << x;
        return os << '}';
}

void solve()
{

        string s;
        cin>>s;
        ll sum=0;
        for(int i=0;i<s.size();i++)
		{
			ll x=s[i]-'0';
			sum+=x;
		}
		if(sum%9==0)
		{
			cout << "Yes" << endl;
		}
		else
		{
			cout << "No" << endl;
		}

}

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    ll test_case=1;
    //cin>>test_case;
    while(test_case--)
	{
		 solve();
	}

	return 0;
}

Measured memory_bytes: 3772
A, B = map(int, input().split())

ans1 = 0
ans2 = 0

for i in range(10000):
  ans1 = int(i * 0.08)
  ans2 = int(i * 0.10)
  
  if (ans1) == A and int(ans2) == B:
    print(i)
    exit()
    
print(-1)


Measured memory_bytes: 8948
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define REP(i,n) for(int i = 0; i<(int)(n); i++)
#define REPS(i,n) for (int i = 1; i<=(int)(n); i++)
#define REPD(i,n) for(int i=(int)(n)-1;i>=0;i--)
#define FOR(i,a,b) for(int i=(a);i<=(b);i++)
#define FORD(i,a,b) for(int i=(a);i>=(b);i--)
#define pb push_back
#define MOD 1000000007
#define MOD2 998244353

vector<bool> ab(100000, true);
vector<bool> bc(100000, true);
vector<bool> ac(100000, true);

bool judge(char c1, char c2){
	return (c1 == '?' || c2 == '?' || c1 == c2);
}

int main(){
	string a, b, c;
	cin >> a >> b >> c;
	int A = a.length();
	int B = b.length();
	int C = c.length();

	int i, j;

	REP(i,A) REP(j,B) if (!judge(a[i], b[j])) ab.at(i-j+50000) = false;
	REP(i,A) REP(j,C) if (!judge(a[i], c[j])) ac.at(i-j+50000) = false;
	REP(i,B) REP(j,C) if (!judge(b[i], c[j])) bc.at(i-j+50000) = false;

	int ans = 6000;
	FOR(i,-4000,4000){
		FOR(j,-4000,4000){
			if (ab.at(i+50000) && ac.at(j+50000) && bc.at(j-i+50000)){
				int L = min(0, min(i,j));
				int R = max(A, max(B+i,C+j));
				ans = min(ans, R-L);
			}
		}
	}
	cout << ans << endl;
}

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

constexpr int MAXN = 2048;
constexpr int MOD = 1e9 + 7;

int S[MAXN], T[MAXN];
int cache[MAXN][MAXN];
char cached[MAXN][MAXN];

int solve(int ss, int tt)
{
  if (ss < 0 || tt < 0) return 0;
  int& res = cache[ss][tt];
  if (cached[ss][tt]) return res;
  cached[ss][tt] = 1;
  res = (solve(ss-1, tt) + solve(ss, tt-1)) % MOD;
  if (S[ss] == T[tt])
  {
    res += 1;
    res %= MOD;
  }
  else
  {
    res -= solve(ss-1, tt-1);
    res %= MOD; res += MOD; res %= MOD;
  }
  return res;
}

int main(int argc, char* argv[])
{
  using std::cin;
  using std::cout;
  std::ios::sync_with_stdio(false);
  cin.tie(nullptr);

  int N, M;
  cin >> N >> M;
  for (int i = 0; i < N; ++i) cin >> S[i];
  for (int i = 0; i < M; ++i) cin >> T[i];
  cout << (solve(N-1, M-1)+1)%MOD << "\n";

  return 0;
}


Measured memory_bytes: 21120
#![allow(unused_imports)]
#![allow(unused_macros)]
use itertools::Itertools;
use std::cmp::{max, min};
use std::collections::*;
use std::io::{stdin, Read};

trait ChMinMax {
    fn chmin(&mut self, other: Self);
    fn chmax(&mut self, other: Self);
}
impl<T> ChMinMax for T
where
    T: PartialOrd,
{
    fn chmin(&mut self, other: Self) {
        if *self > other {
            *self = other
        }
    }
    fn chmax(&mut self, other: Self) {
        if *self < other {
            *self = other
        }
    }
}

#[allow(unused_macros)]
macro_rules! parse {
    ($it: ident ) => {};
    ($it: ident, ) => {};
    ($it: ident, $var:ident : $t:tt $($r:tt)*) => {
        let $var = parse_val!($it, $t);
        parse!($it $($r)*);
    };
    ($it: ident, mut $var:ident : $t:tt $($r:tt)*) => {
        let mut $var = parse_val!($it, $t);
        parse!($it $($r)*);
    };
    ($it: ident, $var:ident $($r:tt)*) => {
        let $var = parse_val!($it, usize);
        parse!($it $($r)*);
    };
}

#[allow(unused_macros)]
macro_rules! parse_val {
    ($it: ident, [$t:tt; $len:expr]) => {
        (0..$len).map(|_| parse_val!($it, $t)).collect::<Vec<_>>();
    };
    ($it: ident, ($($t: tt),*)) => {
        ($(parse_val!($it, $t)),*)
    };
    ($it: ident, u1) => {
        $it.next().unwrap().parse::<usize>().unwrap() -1
    };
    ($it: ident, $t: ty) => {
        $it.next().unwrap().parse::<$t>().unwrap()
    };
}

#[cfg(debug_assertions)]
macro_rules! debug {
    ($( $args:expr ),*) => { eprintln!( $( $args ),* ); }
}

#[cfg(not(debug_assertions))]
macro_rules! debug {
    ($( $args:expr ),*) => {
        ()
    };
}

fn solve(s: &str) {
    let mut it = s.split_whitespace();
    parse!(it, d: usize, t: usize, s: usize);
    if d <= t * s {
        println!("{}", "Yes");
    } else {
        println!("{}", "No");
    }
}

fn main() {
    let mut s = String::new();
    stdin().read_to_string(&mut s).unwrap();
    solve(&s);
}

#[cfg(test)]
mod tests {
    use super::*;
    #[test]
    fn test_input() {
        let s = "
        ";
        solve(s);
    }
}


Measured memory_bytes: 2100
#include <cstdio>
#include <cmath>
#include <algorithm>
using namespace std;

/*int pow(int t,int k){
	if(k == 0) return 1;
	if(k % 2 == 1) return pow(t,k/2) * t;
	else return pow(t,k/2) * pow(t,k/2);
}*/ 
int main(){
	int a,b,c,k;
	scanf("%d%d%d%d",&a,&b,&c,&k);
	int t = max(a,b);
	t = max(t,c);
	int ans = a + b + c + t * pow(2,k) - t;
	printf("%d",ans);
	
	return 0;
} 

Measured memory_bytes: 128
#include <bits/stdc++.h>
//#include <ext/pb_ds/assoc_container.hpp>
//using namespace __gnu_pbds;
using namespace std;
typedef long long int ll;
typedef unsigned long long int ull;
typedef long double ld;
//typedef tree <int,null_type,less <int>, rb_tree_tag, tree_order_statistics_node_update> indexed_set;
#define rep(g, i, n) for (ll g = i; g < n; g++)
#define rev(g, n, i) for (ll g = n - 1; g >= i; g--)
#define FAST ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define all(v) v.begin(), v.end()
#define pb push_back
#define pf push_front
#define ppb pop_back
#define ppf pop_front
#define um unordered_multiset
#define us unordered_set
#define mxe(v) *max_element(v.begin(),v.end())
#define mne(v) *min_element(v.begin(),v.end())
#define bs binary_search
#define lb lower_bound
#define ub upper_bound
#define ve vector
#define cc continue
#define bb break
#define rem 1000000007
#define debug(n1) cout<<"debug... "<<n1<<"\n"
#define PI 3.141592653589793238462643383279502
//fflush(stdin);
// do {
// // process permutation
// } while (next_permutation(permutation.begin(),permutation.end()));
class abc
{
    public:
    ll x,y;
};
int main()
{
    FAST
    // freopen("input1.txt", "r", stdin);
    // freopen("output.txt", "w", stdout);
    /*ll tests;
    cin>>tests;
    rep (gg,0,tests)
    {}*/
    string s,t;
    cin>>s>>t;
    cout<<t<<s<<"\n";
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  long n,k,ans;
  k=0;
  ans=1;
  cin>>n;
  vector<long> vec(n);
  for(int i=0; i<n; i++){
    cin>>vec.at(i);
  }
  for(int i=0; i<n-1; i++){
    if(vec.at(i)==vec.at(i+1)){
    }
    else if(vec.at(i)<vec.at(i+1) && k>=0){
      k=1;
    }
    else if(vec.at(i)>vec.at(i+1) && k<=0){
      k=-1;
    }
    else{
      k=0;
      ans++;
    }
  }
  cout<<ans;
}

Measured memory_bytes: 1024
#include <iostream>
#include <vector>
#include <string>
#include <array>
#include <queue>
#include <deque>
#include <set>
#include <list>
#include <map>
#include <stack>
#include <utility>
#include <algorithm>
#include <numeric>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <cctype>
#include <cstring>
#include <climits>
#include <bitset>
#include <random>
#include <functional>
#include <sstream>
#include <iomanip>
 
using namespace std;
 
#define _CRT_SECURE_NO_WARNINGS
#define REP(i, n) for(LL i=0; i<(n); i++)
#define FOR(i, m, n) for(LL i=(m);i<(n);i++)
#define SZ(x) ((int)(x).size())
#define SORT(x) sort((x).begin(),(x).end())
#define REVE(x) reverse((x).begin(),(x).end())
#define MP make_pair
#define PB push_back
#define INF INT_MAX
 
typedef vector<int> VI;
typedef vector<string> VS;
typedef vector<vector<int>> VVI;
typedef pair<int, int> PII;
typedef long long LL;
 
int main() {
	LL n;
	cin >> n;
	VS s(n);
	vector<LL> m(6);
	REP(i, n) {
		cin >> s[i];
		if (s[i][0] == 'M')m[0]++;
		if (s[i][0] == 'A')m[1]++;
		if (s[i][0] == 'R')m[2]++;
		if (s[i][0] == 'C')m[3]++;
		if (s[i][0] == 'H')m[4]++;
	}
	vector<LL> a1 = { 0,0,0,0,0,0,1,1,1,2 },
		a2 = { 1,1,1,2,2,3,2,2,3,3 },
		a3 = { 2,3,4,3,4,4,3,4,4,4 };
	LL ans = 0;
	REP(i, 10)ans += m[a1[i]] * m[a2[i]] * m[a3[i]];
	cout << ans << endl;
}

Measured memory_bytes: 6144
#include <iostream>
#include <fstream>
#include <cassert>
#include <typeinfo>
#include <vector>
#include <stack>
#include <cmath>
#include <set>
#include <map>
#include <string>
#include <algorithm>
#include <cstdio>
#include <queue>
#include <iomanip>
#include <cctype>
#include <random>
#include <complex>
#define syosu(x) fixed<<setprecision(x)
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> P;
typedef pair<double,double> pdd;
typedef pair<ll,ll> pll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<double> vd;
typedef vector<vd> vvd;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef vector<char> vc;
typedef vector<vc> vvc;
typedef vector<string> vs;
typedef vector<bool> vb;
typedef vector<vb> vvb;
typedef vector<P> vp;
typedef vector<vp> vvp;
typedef vector<pll> vpll;
typedef pair<P,int> pip;
typedef vector<pip> vip;
const int inf=1<<29;
const ll INF=1ll<<58;
const double pi=acos(-1);
const double eps=1e-7;
const ll mod=1e9+7;
const int dx[4]={0,1,0,-1},dy[4]={1,0,-1,0};

int h,w;

int main(){
	cin>>h>>w;
	vi a(26);
	for(int i=0;i<h;i++) for(int j=0;j<w;j++){
		char c;
		cin>>c;
		a[c-'a']++;
	}
	int tmp=0;
	for(int i=0;i<26;i++) tmp+=a[i]%2;
	if(tmp>1||(tmp==1&&(h%2==0||w%2==0))){
		cout<<"No"<<endl;
		return 0;
	}
	tmp=0;
	for(int i=0;i<26;i++) tmp+=a[i]/4;
	if(tmp>=h/2*(w/2)) cout<<"Yes"<<endl;
	else cout<<"No"<<endl;
}

Measured memory_bytes: 256
n,k=map(int,input().split())
*a,=map(int,input().split())
res=[False]*(k+1)

for i in range(1,k+1):
    v=False
    for j in a:
        if j>i:break
        if not res[i-j]:
            v=True
            break
    if v:
        res[i]=True

print("First" if res[k] else "Second")


Measured memory_bytes: 3828