akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;
struct fast_ios { fast_ios(){ cin.tie(0); ios::sync_with_stdio(false); cout << fixed << setprecision(20); }; } fast_ios_;
#define FOR(i, begin, end) for(int i=(begin);i<(end);i++)
#define REP(i, n) FOR(i,0,n)
#define IFOR(i, begin, end) for(int i=(end)-1;i>=(begin);i--)
#define IREP(i, n) IFOR(i,0,n)
#define Sort(v) sort(v.begin(), v.end())
#define Reverse(v) reverse(v.begin(), v.end())
#define all(v) v.begin(),v.end()
#define SZ(v) ((int)v.size())
#define Lower_bound(v, x) distance(v.begin(), lower_bound(v.begin(), v.end(), x))
#define Upper_bound(v, x) distance(v.begin(), upper_bound(v.begin(), v.end(), x))
#define Max(a, b) a = max(a, b)
#define Min(a, b) a = min(a, b)
#define bit(n) (1LL<<(n))
#define bit_exist(x, n) ((x >> n) & 1)
#define debug(x) cout << #x << "=" << x << endl;
#define vdebug(v) cout << #v << "=" << endl; REP(i_debug, v.size()){ cout << v[i_debug] << ","; } cout << endl;
#define mdebug(m) cout << #m << "=" << endl; REP(i_debug, m.size()){ REP(j_debug, m[i_debug].size()){ cout << m[i_debug][j_debug] << ","; } cout << endl;}
#define pb push_back
#define f first
#define s second
#define int long long
#define INF 1000000000000000000
template<typename T> istream &operator>>(istream &is, vector<T> &v){ for (auto &x : v) is >> x; return is; }
template<typename T> ostream &operator<<(ostream &os, vector<T> &v){ for(int i = 0; i < v.size(); i++) { cout << v[i]; if(i != v.size() - 1) cout << endl; }; return os; }
template<typename T> void Out(T x) { cout << x << endl; }
template<typename T1, typename T2> void Ans(bool f, T1 y, T2 n) { if(f) Out(y); else Out(n); }

using vec = vector<int>;
using mat = vector<vec>;
using Pii = pair<int, int>;
using PiP = pair<int, Pii>;
using PPi = pair<Pii, int>;
using bools = vector<bool>;
using pairs = vector<Pii>;

//int dx[4] = {1,0,-1,0};
//int dy[4] = {0,1,0,-1};
//char d[4] = {'D','R','U','L'};

const int mod = 1000000007;
//const int mod = 998244353;
#define Add(x, y) x = (x + (y)) % mod
#define Mult(x, y) x = (x * (y)) % mod



signed main(){

    int S; cin >> S;
    int M = 1000000000;
    int X1 = 0, Y1 = 0;
    int X3 = 1;
    int Y2 = (M - S % M) % M;
    int X2 = M, Y3 = (S + X3 * Y2) / X2;

    //Out(X2 * Y3 - X3 * Y2);

    cout << X1 << " " << Y1 << " " <<  X2 << " " << Y2 << " " <<  X3 << " " << Y3 << endl;

    return 0;
}


Measured memory_bytes: 256
#include <iostream> // cout, endl, cin
#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 <map> // map
#include <queue> // queue, priority_queue
#include <set> // set
#include <stack> // stack
#include <deque> // deque
#define ll long long
#define ALL(x) (x).begin(),(x).end()
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define vi vector<int>
#define vvi vector<vector<int>>
using namespace std;

int main() {
    string s;
    cin >> s;
    priority_queue<int> pq;
    while (s != "end") {
        if (s == "insert") {
            int x; cin >> x;
            pq.push(x);
        }
        if (s == "extract") {
            cout << pq.top() << endl;
            pq.pop();
        }
        cin >> s;
    }
}


Measured memory_bytes: 7012
n, m = map(int, input().split())

ret = 0
dList = [-1, -1, -1]    # 1,10,100でいく
for i in range(m):
    d, a = map(int, input().split())

    # 最上位が0はダメ
    if d <= 1 and a == 0 and n >= 2:
        ret = -1
        break
    # 何も入ってなければOK
    elif dList[n-d] == -1:
        dList[n-d] = a
        ret = ret + a * 10**(n-d)
    # なにか入っていて値が違ってたらダメ
    elif dList[n-d] != a:
        ret = -1
        break

# 最上位が未設定だったら1を加える
if ret >= 0 and dList[n-1] == -1:
    # 1桁の場合は0
    if n == 1:
        ret = 0
    else:
        ret = ret + 10**(n-1)

print("{}".format(ret))

Measured memory_bytes: 3064
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define prin(a) cout<<(a)<<endl
using ll=int64_t;
using namespace std;

//define gcd and lcm (using 64bit)
ll gcd(ll a,ll b){
    if (a < b) {
        //^はxor(bitwise operator)。以下三行でswap(a,b)を行っている。
        a ^= b;
        b ^= a;
        a ^= b;
    }
    //only when b==0,this program finds that b means false and returns a.
    return b ? gcd(b, a % b) : a;
}

ll lcm(ll a,ll b){
    return a * b / gcd(a, b);
}


int main(){
    ll n,a,ans1,ans2;
    cin>>n;
    a=sqrt(n);
    rep(i,a){
        if(n%(a-i)==0){
            ans1=a-i;
            ans2=n/ans1;
            break;
        }
    }
    cout<<(ans1+ans2-2)<<endl;
    return 0;
}

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

int main(){
  int n, k, q;
  cin >> n >> k >> q;
  
  vector <int> score(n);
  for(int i = 0; i < n; i++){
    score.at(i) = k - q;
  }
  
  vector<int> ans(q);
  for(int i = 0; i < q; i++){
    cin >> ans.at(i);
  }
  
  for(int i = 0; i < q; i++){
    score.at(ans.at(i) - 1)++;
  }

  for(int i = 0; i < n; i++){
    if(score.at(i) > 0)
      cout << "Yes" << endl;
  
    else
      cout << "No" << endl;
  }
}

Measured memory_bytes: 1408
from collections import Counter, deque
n = int(input())
a = list(map(int, input().split()))
b = Counter(a)
c = deque([])
for k in b.keys():
    if b[k]>=4:
        c.append(k)
        c.append(k)
    elif b[k]>=2:
        c.append(k)
c = sorted(c, reverse = True)
print(c[0]*c[1] if c else 0)

Measured memory_bytes: 18600
#include<iostream>
#include<algorithm>
#include<cstdio>
#include<cstdlib>
#include<cmath>
#include<cstring>
using namespace std;
int n,m,num,a[1010];
double b[1010];
int main()
{
    while(scanf("%d",&n)!=EOF)
    {
        scanf("%d%d",&m,&num);
        for(int i=1;i<=n;i++)
            scanf("%d",&a[i]);
        for(int i=1;i<=n;i++)
        {
            b[i]=m-a[i]*0.006;
        }
        double minn=fabs(b[1]-num);
        int flag=1;
        for(int i=1;i<=n;i++)
        {
            if(fabs(b[i]-num)<minn)
            {
                minn=fabs(b[i]-num);
                flag=i;
            }
        }
        printf("%d\n",flag);
    }
    return 0;
}


Measured memory_bytes: 256
n = int(input())
a = input().split()
for i in range(n):
    a[i] = int(a[i])
def gcm(a,b):
    if a >= b:
        if a % b == 0:
            return b 
        else:
            return gcm(b,a%b)
    else: return gcm(b,a)
for i in range(1,len(a)):
    a[0] = gcm(a[0],a[i])
print(a[0]) 

Measured memory_bytes: 11096
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <numeric>
#include <utility>
#include <sys/time.h>
#include <cmath>
#include <tuple>
#include <queue>

using namespace std;

int main() {
    struct timeval start,end;
    long long span;
    int x, a, b;

    gettimeofday(&start,NULL);

    std::cin >> x >> a >> b;
    if (abs(x-a) > abs(x-b)) {
        std::cout << "B" << std::endl;
    } else {
        std::cout << "A" << std::endl;
    }

    gettimeofday(&end,NULL);
    span = (end.tv_sec -start.tv_sec)*1000000LL + (end.tv_usec - start.tv_usec);
    std::cerr << "--Total Time: " << span/1000 << "ms" << endl;
    return 0;
}


Measured memory_bytes: 256
/*==============================================*\
ID:          shahidul_brur
 
Name:     Md. Shahidul Islam
Study:      CSE, BRUR
Address:  Rangpur, Bangladesh
 
 mail: shahidul.cse.brur@gmail.com
 FB  : fb.com/shahidul.brur
 Blog: shahidul-brur.blogspot.com(in Bengali),
       shahidul-brur-en.blogspot.com(in English)
\*===============================================*/
#include<bits/stdc++.h>
//#include <ext/pb_ds/assoc_container.hpp> // Common file
//#include <ext/pb_ds/tree_policy.hpp> // Including tree_order_statistics_node_update
//using namespace __gnu_pbds;
using namespace std;
//typedef tree<int,null_type,less<int>,rb_tree_tag,tree_order_statistics_node_update> ordered_set;

//#pragma GCC optimize("O3")
//#pragma GCC optimize("unroll-loops")
//#pragma GCC target("avx,avx2,fma")

typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef pair<int, int> ii;
typedef pair<ll, int> li;
typedef pair<int, ll> il;
typedef vector<ii> vii;
typedef vector<il> vil;
typedef vector<li> vli;
 
#define ff first
#define ss second
#define pb push_back
#define mp make_pair
#define sz size()
#define all(a)  a.begin(), a.end()
#define mem(a, b)     memset(a, b, sizeof(a))
#define f0(i,b) for(int i=0;i<(b);i++)
#define f1(i,b) for(int i=1;i<=(b);i++)
#define f2(i,a,b) for(int i=(a);i<=(b);i++)
#define fr(i,b,a) for(int i=(b);i>=(a);i--)
#define rep(i,a,b,c) for(int i=(a);i!=(b);i+=(c))
 
int dx8[] = {0, 0, 1, 1, 1, -1, -1, -1};
int dy8[] = {1,-1, 1, -1, 0, 0, -1, 1};
int dx4[] = {0, 0, 1, -1};
int dy4[] = {1, -1, 0, 0};

const double pi = acos(-1.0);
const double eps = 1e-6;
const int mod = (int)1e9+7;
const int maxn = (int)2e5+5;
const int logn = 20;
int arr[maxn];
int main()
{
    ios_base::sync_with_stdio(0); cin.tie(NULL); cout.tie(NULL);
    //freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);
    int n, c=0;
    cin>>n;
    f0(i,n) cin>>arr[i];
    sort(arr,arr+n);
    ll s = 0;
    for (int i = 0; i < n - 2; ++i)  
    { 
        int k = i + 2;
        for (int j = i + 1; j < n; ++j)  
        {
            while (k < n && arr[i] + arr[j] > arr[k])  
            ++k; 
            if(k > j)  
                s += k - j - 1;  
        }  
    }
    cout << s;
    return 0;
}


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

int main()
{
    string A,B;
    cin >> A >> B;

    if(A.size() < B.size()) cout << "LESS";
    else if(B.size() < A.size()) cout << "GREATER";
    else
    {
        if(A < B) cout << "LESS";
        else if(B < A) cout << "GREATER";
        else cout << "EQUAL";   
    }
    
    cout << endl;
    return 0;
}

Measured memory_bytes: 3604
#include <iostream>
#include <cstdio>
#include <cstring>
using namespace std;
int main() {
  char input[10];
  int field[10][10];
  
  while(scanf("%s", input) != EOF) {
    memset(field, 0, sizeof(field));

    for(int i = 0 ; i < 9 ; i++) {
      field[0][i] = (input[i]-'0' + input[i+1]-'0') % 10;
    }
    
    for(int i = 1 ; i < 9 ; i++) {
      for(int j = 0 ; j <= 8-i ; j++) {
	//if(j < 0) break;
	field[i][j] = (field[i-1][j] + field[i-1][j+1]) % 10;
      }
    }
    /*for(int i = 0 ; i < 9 ; i++) {
      for(int j = 0 ; j <= 8-i ; j++) {
      cout << field[i][j] << ' ';
	}
      cout << endl;
      }
    cout << endl;*/
    cout << field[8][0] << endl;
  }
  return 0;
}

Measured memory_bytes: 0
#include <iostream>

using namespace std;
int a, b;
int main()
{
	cin >> a >> b;
	if (a == 1) a = 14;
	if (b == 1) b = 14;
	if (a == b){
		cout << "Draw";
	}else if(a > b){
		cout << "Alice";
	}else {
		cout << "Bob";
	}
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int n,m,A[15],B[101];

int mem[101][1<<15],used[101][1<<15];
int dfs(int idx,int sta,int sum){
  if(idx==m) return 0;
  if(used[idx][sta]++)return mem[idx][sta];
  int &res=mem[idx][sta]=abs(sum-B[idx])+dfs(idx+1,sta,sum);
  for(int i=0;i<n;i++)
    if((sta>>i)&1)res=min(res,dfs(idx,~((~sta)|(1<<i)),sum-A[i]));
  return res;
}

int main(){
  while(1){
  cin>>n>>m;
  if(!n&&!m)break;
  int sum=0;
  for(int i=0;i<n;i++) cin>>A[i],sum+=A[i];
  for(int i=0;i<m;i++) cin>>B[i];
  sort(A,A+n);
  sort(B,B+m,greater<int>());
  memset(used,0,sizeof(used));
  cout<<dfs(0,(1<<n)-1,sum)<<endl;
  }
  return 0;
}

Measured memory_bytes: 28868
#include <iostream>
#include <utility>
#include <cassert>
#include <vector>
#include <algorithm>

template <template <class> class Container> class union_find {
protected:
    class node_type;

public:
    using container_type = Container<node_type>;
    using size_type = typename container_type::size_type;

protected:
    class node_type {
    public:
        typename union_find::size_type parent;
        typename union_find::size_type size;
    };

    container_type tree;

public:
    union_find() : tree() {}
    explicit union_find(const size_type size) : tree(size, { 0, 1 }) {
        for (size_type i = 0; i < size; ++i)
            tree[i].parent = i;
    }

    bool empty() const { return tree.empty(); }
    size_type size() const { return tree.size(); }

    size_type find(size_type x) {
        assert(x < size());
        while (tree[x].parent != x)
            x = tree[x].parent = tree[tree[x].parent].parent;
        return x;
    }
    bool same(const size_type x, const size_type y) {
        assert(x < size());
        assert(y < size());
        return find(x) == find(y);
    }
    size_type size(const size_type x) {
        assert(x < size());
        return tree[find(x)].size;
    }

    ::std::pair<size_type, size_type> unite(size_type x, size_type y) {
        assert(x < size());
        assert(y < size());
        x = find(x);
        y = find(y);
        if (x != y) {
            if (tree[x].size < tree[y].size)
                ::std::swap(x, y);
            tree[x].size += tree[y].size;
            tree[y].parent = x;
        }
        return { x, y };
    }
};

int main() {
	int n, m;
	std::cin >> n >> m;

    union_find<std::vector> uf(n);

    for (int i = 0; i < m; ++i) {
        int a, b;
        std::cin >> a >> b;

        uf.unite(a - 1, b - 1);
    }

    int ans = 0;
    for (int i = 0; i < n; ++i)
        ans = std::max<int>(ans, uf.size(i));

    std::cout << ans << std::endl;
}

Measured memory_bytes: 6424
#include <iostream>
using namespace std;
 
int main()
{
  long long a, b, c, d;
  cin >> a >> b >> c >> d;
  
  if(c > d) swap(c,d);
  
  long long dd = d;
  long long cc = c;
  // gcd
  while(dd % cc != 0){
    dd = dd % cc;
    swap(dd, cc);
  }
  long long gcd = cc;
  long long lcm = c * d / gcd;
 
  long long n = b - a + 1;
  
  long long ans = n - b/d + (a-1)/d - b/c + (a-1)/c + b/lcm - (a-1)/lcm;
  
  cout << ans;
  return 0;
  
}

Measured memory_bytes: 256
x = gets.chomp.to_i

if x >= 400 && x <= 599
  puts "8"
elsif x >= 600 && x <= 799
  puts "7"
elsif x >= 800 && x <= 999
  puts "6"
elsif x >= 1000 && x <= 1199
  puts "5"
elsif x >= 1200 && x <= 1399
  puts "4"
elsif x >= 1400 && x <= 1599
  puts "3"
elsif x >= 1600 && x <= 1799
  puts "2"
elsif x >= 1800 && x <= 1999
  puts "1"
end


Measured memory_bytes: 14372
#include <iostream>

int main(int argc, const char * argv[]) {
    long long int a,b,n,c;
    c=0;
    std::cin>>a>>b>>n;
    if(b>n){
        std::cout<<a*n/b-a*(n/b)<<std::endl;
    }else {
        c=(n/b)*b-1;
        std::cout<<a*c/b-a*(c/b)<<std::endl;
    }
    return 0;
}


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

ll f(bool head, vector<ll>& a) {
  int n = a.size();
  vector<ll> x;
  ll m = head ? 1 : -1;
  for (int i = 0; i < n; ++i) {
    x.push_back(m * (i == 0 || i == n - 1 ? 1 : 2));
    m *= -1;
  }
  sort(x.rbegin(), x.rend());
  ll ans = 0;
  for (int i = 0; i < n; ++i) {
    ans += a[i] * x[i];
  }
  return ans;
}

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

  vector<ll> a(n);
  for (int i = 0; i < n; ++i)
    cin >> a[i];
  sort(a.rbegin(), a.rend());
  ll ans = max(f(true, a), f(false, a));

  cout << ans << endl;
}


Measured memory_bytes: 2788
#include <iostream>
using namespace std;
int main(){
	int a,b,i,x;
	i=0;
	for(i;;i++){
	cin >> a >> b;
		if(a==0 && b==0){
			break;
		}
		else if(a>b){
				x=a;
				a=b;
				b=x;
			}
			
			cout << a << " " << b << endl;
		}
	return 0;
	}
		

Measured memory_bytes: 1160
N, K, Q = map(int, input().split())
A = [int(input()) for _ in range(Q)]
correct = [0] * N

for a in A:
    correct[a-1] += 1

hp = Q - K
for i in range(N):
    if correct[i] > hp:
        print("Yes")
    else:
        print("No")

Measured memory_bytes: 80856
#include <bits/stdc++.h>
#define rep(i, l, r) for(int i = (l); i <= (r); i++)
#define per(i, r, l) for(int i = (r); i >= (l); i--)
#define mem(a, b) memset(a, b, sizeof a)
#define mid ((l + r) >> 1)
#define lch l, mid, o << 1
#define rch mid + 1, r, o << 1 | 1

using namespace std;
const int V = 3e5, N = V + 5;
int n, k, x, c[N*4];
void upd(int p, int v, int l, int r, int o) {
	if(l == r) return c[o] = v, void();
	if(p <= mid) upd(p, v, lch); else upd(p, v, rch);
	c[o] = max(c[o<<1], c[o<<1|1]);
}
int qry(int L, int R, int l, int r, int o) {
	if(L <= l && r <= R) return c[o];
	int ret = 0;
	if(L <= mid) ret = max(ret, qry(L, R, lch));
	if(R > mid) ret = max(ret, qry(L, R, rch));
	return ret;
}

int main() {
	cin >> n >> k;
	rep(i, 1, n) {
		scanf("%d", &x);
		upd(x, qry(max(0, x - k), min(V - 1, x + k), 0, V - 1, 1) + 1, 0, V - 1, 1);
	}
	return !(cout << c[1]);
}

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

int main() {
  int W, H, x, y, r;
  cin >> W >> H >> x >> y >> r;

  if (x < 0 || y < 0 || x + r > W || y + r > H) {
    cout << "No\n";
  }
  else {
    cout << "Yes\n";
  }
  return 0;
}


Measured memory_bytes: 3104
#include <cassert>
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <set>
#include <limits>
#include <numeric>
#include <iterator>

using namespace std;



int main(){
  ios::sync_with_stdio(false);
  const int ub_a = 10000;
  int n;
  vector<int> a; // 1 .. 10000
  cin >> n;
  for(int i = 0; i<n; ++i){int a_i; cin >> a_i; a.push_back(a_i);}


  //compute
  vector<int> c(ub_a+1, 0);
  vector<int> b(n);

  for(int a_i : a){
    c[a_i] += 1;
  }
  for(auto itr = c.begin()+1; itr!=c.end(); ++itr){
    *itr += *(itr-1);
  }

  for(auto a_i : a){
    b[--(c[a_i])] = a_i;
  }

  //output
  for(int i=0; i<n; ++i){
    cout << (i==0?"":" ") << b[i];
  }
  cout << endl;
  return 0;
}

Measured memory_bytes: 16840
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
#define FOR(i, a, b) for(int i = (int)a; i <= (int)b; i++)
#define DEC(i, a, b) for(int i = (int)a; i >= (int)b; i--)
typedef pair<int, int> pi;
#define f first
#define s second
#define pb push_back
#define all(v) v.begin(), v.end()
#define fastio ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)

int n;
string s;
set<string> se;

int main() {
	fastio; cin >> n;
	FOR(i, 1, n) {
      cin >> s;
      se.insert(s);
    }
  cout << se.size();
}


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

const int INF = 1001001001;

int main(){
  int N;
  cin>>N;
  int d[110];
  for(int i=0;i<N;i++){
      cin>>d[i];
  }
  set<int>X;
  for(int i=0;i<N;i++){
   X.insert(d[i]);
  }
  cout<<X.size()<<endl;
  return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define gc getchar_unlocked
#define fo(i,n) for(i=0;i<n;i++)
#define Fo(i,k,n) for(i=k;k<n?i<n:i>n;k<n?i+=1:i-=1)
#define ll unsigned long long
#define si(x)	scanf("%d",&x)
#define sl(x)	scanf("%lld",&x)
#define ss(s)	scanf("%s",s)
#define pi(x)	printf("%d\n",x)
#define pl(x)	printf("%lld\n",x)
#define ps(s)	printf("%s\n",s)
#define deb(x) cout << #x << "=" << x << endl
#define deb2(x, y) cout << #x << "=" << x << "," << #y << "=" << y << endl
#define pb push_back
#define mp make_pair
#define F first
#define S second
#define all(x) x.begin(), x.end()
#define clr(x) memset(x, 0, sizeof(x))
#define sortall(x) sort(all(x))
#define tr(it, a) for(auto it = a.begin(); it != a.end(); it++)
#define PI 3.1415926535897932384626
typedef pair<int, int>	pii;
typedef pair<ll, ll>	pl;
typedef vector<int>		vi;
typedef vector<ll>		vl;
typedef vector<pii>		vpii;
typedef vector<pl>		vpl;
typedef vector<vi>		vvi;
typedef vector<vl>		vvl;
int mpow(int base, int exp);
void ipgraph(int m);
void dfs(int u, int par);
const int mod = 1000000007;
const int N = 3e5, M = N;
const int INF=1e5+5;

ll int factr(ll int n) 
{ 
    int res = 1, i; 
    for (i = 2; i <= n; i++) 
        res = res%mod*i%mod; 
    return res%mod; 
} 
  

int main(){
ios_base::sync_with_stdio(0);
ll int t,i,j,n,k,m,x,y,flag=0,sum=0,ans=0;
//cin>>t;
t=1;
while(t--){

    ll int sp,ti,di;
    cin>>di>>ti>>sp;
    double x=di/(sp*1.0);
    ll int y=ceil(x);
    if(y<=ti){
        cout<<"Yes"<<endl;

    }

    else{
        cout<<"No"<<endl;
    }



}
return 0;
}
int mpow(int base, int exp) {
    base %= mod;
    int result = 1;
    while (exp > 0) {
    if (exp & 1) result = ((ll)result * base) % mod;
    base = ((ll)base * base) % mod;
    exp >>= 1;
    }
    return result;
}


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

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

#define FOR(i, n, m) for (ll(i) = (m); (i) < (n); ++(i))
#define REP(i, n) FOR(i, n, 0)
#define OF64 std::setprecision(10)

const ll MOD = 1000000007;
const ll INF = (ll)1e15;

struct Combination
{
    void init(ll n)
    {
        mNumTbl.resize(n + 1);
        mInverseNumTbl.resize(n + 1);
        mNumTbl[0] = 1;
        mInverseNumTbl[0] = 1;
        FOR(i, n + 1, 1)
        {
            mNumTbl[i] = (mNumTbl[i - 1] * i) % MOD;
        }
        FOR(i, n + 1, 1)
        {
            mInverseNumTbl[i] = modpow(mNumTbl[i]);
        }
    }

    ll get(ll n, ll r)
    {
        if (n < r || n < 0)
            return 0;
        return (((mNumTbl[n] * mInverseNumTbl[r]) % MOD) * mInverseNumTbl[n - r]) % MOD;
    }

    //! バイナリ方で累乗を計算
    ll modpow(ll n)
    {
        ll s = 1, p = n;
        for (ll i = 0; (1 << i) <= MOD - 2; ++i, p = (p * p) % MOD)
        {
            if (((MOD - 2) & (1 << i)) == 0)
                continue;
            s *= p;
            s %= MOD;
        }
        return s;
    }

    vector<ll> mInverseNumTbl;
    vector<ll> mNumTbl;
};

ll A[100005];
bool E[100005];

int main()
{
    int N;
    cin >> N;
    int d = 0;
    REP(i, N + 1)
    {
        cin >> A[i];
        if (E[A[i]])
            d = A[i];
        E[A[i]] = true;
    }

    ll k = 0;
    ;
    REP(i, N)
    {
        if (A[i] == d)
            break;
        k++;
    }

    for (int i = N; i >= 0; --i)
    {
        if (A[i] == d)
            break;
        k++;
    }

    Combination C;
    C.init(N + 1);
    REP(i, N + 1)
    {
        cout << (MOD + C.get(N + 1, i + 1) - C.get(k, i)) % MOD << endl;
    }

    return 0;
}

Measured memory_bytes: 3712
#include <bits/stdc++.h>
#include <boost/multiprecision/cpp_int.hpp>
using namespace std;

//定数
const int MOD1=1000000007;
const int MOD2=998244353;
const long double PI=3.1415926535897932;
const long long MAXLL=9223372036854775807;
const long long INF=2305843009213693951;
const int dx[]={0,1,0,-1,1,-1,1,-1};
const int dy[]={1,0,-1,0,1,1,-1,-1};

//省略
#define lint boost::multiprecision::cpp_int;
#define ll long long
#define ull unsigned long long
#define ld long double
#define pll pair<long long,long long>
#define vl vector<long long>
#define vvl vector<vector<long long>>
#define vvvl vector<vector<vector<long long>>>
#define vc vector<char>
#define vvc vector<vector<char>>
#define vs vector<string>
#define vb vector<bool>
#define vvb vector<vector<bool>>
#define vp vector<pair<long long,long long>>
#define umap unordered_map
#define uset unordered_set
#define Lqueue priority_queue<long long>
#define Squeue priority_queue<long long,vector<long long>,greater<long long>>
#define fi first
#define se second
#define mp make_pair
#define mt make_tuple
#define eb emplace_back

//マクロ
#define all(x) (x).begin(),(x).end()
#define rall(x) (x).rbegin(),(x).rend()
#define rbf(a,x) for(auto& a:x)
#define rep(i,n) for(long long i=0;i<(long long)(n);i++)
#define rep2(i,s,n) for(long long i=(s);i<(long long)(n);i++)
#define bitrep(i,s,n) for(long long i=(s);i<(1LL<<(n));i++)
#define bitcheck(bit,i) (bit)&(1LL<<(i))
#define Maxe(x) *max_element((x).begin(),(x).end())
#define Mine(x) *min_element((x).begin(),(x).end())
#define Size(x) ((long long)(x).size())
#define Lin(s) getline(cin,(s))

//Yes,No
void Yes(bool a){cout<<(a?"Yes":"No")<<endl;}
void YES(bool a){cout<<(a?"YES":"NO")<<endl;}

//MAX,MIN
template<class T,class U> auto max(T a,U b){return a>b?a:b;}
template<class T,class U> auto min(T a,U b){return a<b?a:b;}

//最大公約数,最小公倍数
long long gcd(long long a,long long b){return b?gcd(b,a%b):a;}
long long lcm(long long a,long long b){return a/gcd(a,b)*b;}

//切り上げ除算
long long cutup(long long a,long long b){return (a+b-1)/b;}

//累乗
template<typename t>
constexpr t my_pow(t a,long long b){
    if(b==0)return 1;
    if(a==0)return 0;
    t x=1;
    while(b>0){
        if(b&1LL)x*=a;
        a*=a;
        b>>=1LL;
    }
    return x;
}
#define pow my_pow

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

//組み合わせ O(r)
template<typename t>
constexpr t nCr(t n,long long r){
    if(r==0)return 1;
    if(n==0)return 0;
    if(n<r)return 0;
    t x=1;
    for(long long i=1;i<=r;i++){
        x*=n-i+1;
        x/=i;
    }
    return x;
}

void vin(auto &a){
    rep(i,Size(a)){
        cin>>a[i];
    }
    return;
}

signed main(){
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    ll n;
    cin>>n;
    vl A(n);
    vin(A);
    vl S(n,0);
    S[0]=A[0];
    rep(i,n-1){
        S[i+1]=S[i]+A[i+1];
        S[i+1]%=MOD1;
    }
    ll res=0;
    rep(i,n){
        ll a=(S[n-1]-S[i]+MOD1)%MOD1;
        res+=a*A[i];
        res%=MOD1;
    }
    cout<<res<<endl;
}

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


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


	int N;
	cin >> N;

	int X[50], Y[50];
	map<pair<int, int>, int> MP;
	rep(i, N) {
		int x, y;
		cin >> x >> y;
		MP[mp(x, y)] = 1;
		X[i] = x;
		Y[i] = y;
	}

	int kotae = N;
	rep(i, N) {
		for (int j = i + 1; j < N; j++) {
			int x = X[i] - X[j];
			int y = Y[i] - Y[j];


			int tmp = 0;
			map<pair<int, int>, int> kari = MP;
			for (auto itr : MP) {
				if (kari[itr.first] == 1) {
					tmp++;
					int x2 = x;
					int y2 = y;
					while (kari[mp(itr.first.first + x2, itr.first.second + y2)] == 1) {
						kari[mp(itr.first.first + x2, itr.first.second + y2)] = 0;
						x2 += x;
						y2 += y;
					}
					x2 = x;
					y2 = y;
					while (kari[mp(itr.first.first - x2, itr.first.second - y2)] == 1) {
						kari[mp(itr.first.first - x2, itr.first.second - y2)] = 0;
						x2 += x;
						y2 += y;
					}
				}
			}
			kotae = min(kotae, tmp);
		}
	}

	co(kotae);


	Would you please return 0;
}

Measured memory_bytes: 256
#include<stdio.h>

int N;

int main(){
    scanf("%d", &N);
    long long unsigned int L0, L1, L;

    L0 = 2; L1 = 1;
    L = 1;
    for(int i = 2; i <= N; i++){
        L = L0 + L1;
        L0 = L1;
        L1 = L;

    }
    printf("%lld", L);

    return 0;
}

Measured memory_bytes: 128
#include <iostream>
#include <vector>
typedef long long ll;
using namespace std;

int main(void) {
    ll N; cin >> N;
    
    ll t,x,y;
    ll now_x = 0;
    ll now_y = 0;
    ll now_t = 0;
    ll cost = 0;
    ll point = 0;
    string ans = "No";
    for (int i = 0; i < N; i++) {
        cin >> t >> x >> y;
        cost = abs(now_x - x) + abs(now_y - y);
        point = t - now_t;
        if ((point - cost) >= 0 && (point - cost)%2 == 0) {
            ans = "Yes";
        }else{
            ans = "No";
            break;
        }
        now_x = x;
        now_y = y;
        now_t = t;
        
    }
    cout << ans << endl;
    
    return 0;
}

Measured memory_bytes: 3564
import sys
i=1
t=True
nums=[]
for line in sys.stdin:
    if i%2==0:
        nums=line.split()
        index=0
        for number in nums:
        	nums[index]=int(nums[index])
        	index=index+1
        i=i+1
    else:
        i=i+1
        continue
    nums.sort()
    leng=len(nums)-1
    maxi=max(nums)
    maxnum=nums.count(maxi)
    if maxnum>=2:
        print(0)
    else:
        if leng>0:
            second=nums[0:leng]
            sum=0
            for number in second:
                sum=sum+int(number)
            diff=maxi-sum
            if diff<=1:
                print(0)
            else:
                print(diff-1)
        else:
            print(maxi-1)

Measured memory_bytes: 3192
#include<iostream>
#include<string>
using namespace std;
int main(){
    int a,b;
    cin >> a >> b;
    if(a==b){
        cout << "Draw" << endl;
    }else if (a==1 || (b!=1&&a>b)){
        cout << "Alice" << endl;
    }else if (b==1 || (a!=1&&a<b)){
        cout << "Bob" << endl;
    }
        
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define pb push_back
#define pf push_front
#define pii pair <int, int>
#define all(vv) (vv).begin(), (vv).end()
#define time cerr << '\n' << (double)clock()/CLOCKS_PER_SEC << '\n'; return 0

int n, m, dist[200100];
vector <int> G[200100];
int32_t main() {
	cin >> n >> m;
	for(int i = 0; i < m; ++i) {
		int a, b; cin >> a >> b;
		G[a].pb(b);
		G[b].pb(a);
	}
	// bfs
	for(int i = 1; i <= n; ++i) {
		dist[i] = -1;
	}
	int source = 1;
	queue <int> q;
	q.push(source);
	dist[source] = 0;
	while (q.size()) {
		int u = q.front();
		q.pop();
		for(int i = 0; i < G[u].size(); ++i) {
			int v = G[u][i];
			if (dist[v] == -1) {
				q.push(v);
				dist[v] = dist[u] + 1;
			}
		}
	}
	if (dist[n] <= 2 && dist[n] != -1) cout << "POSSIBLE";
	else cout << "IMPOSSIBLE";
}

Measured memory_bytes: 18116
import sys
sys.setrecursionlimit(10**7) #再帰関数の上限,10**5以上の場合python
import math
from copy import copy, deepcopy
from copy import deepcopy as dcp
from operator import itemgetter
from bisect import bisect_left, bisect, bisect_right#2分探索
#bisect_left(l,x), bisect(l,x)#aはソート済みである必要あり。aの中からx未満の要素数を返す。rightだと以下
from collections import deque, defaultdict
#deque(l), pop(), append(x), popleft(), appendleft(x)
#q.rotate(n)で → にn回ローテート
from collections import Counter#文字列を個数カウント辞書に、
#S=Counter(l),S.most_common(x),S.keys(),S.values(),S.items()
from itertools import accumulate,combinations,permutations#累積和
#list(accumulate(l))
from heapq import heapify,heappop,heappush
#heapify(q),heappush(q,a),heappop(q) #q=heapify(q)としないこと、返り値はNone
#import fractions#古いatcoderコンテストの場合GCDなどはここからimportする
from functools import reduce,lru_cache#pypyでもうごく
#@lru_cache(maxsize = None)#maxsizeは保存するデータ数の最大値、2**nが最も高効率
from decimal import Decimal

def input(): 
    x=sys.stdin.readline()
    return x[:-1] if x[-1]=="\n" else x
def printe(*x):print("## ",*x,file=sys.stderr)
def printl(li): _=print(*li, sep="\n") if li else None
def argsort(s, return_sorted=False): 
    inds=sorted(range(len(s)), key=lambda k: s[k])
    if return_sorted: return inds, [s[i] for i in inds]
    return inds
def alp2num(c,cap=False): return ord(c)-97 if not cap else ord(c)-65
def num2alp(i,cap=False): return chr(i+97) if not cap else chr(i+65)
def matmat(A,B):
    K,N,M=len(B),len(A),len(B[0])
    return [[sum([(A[i][k]*B[k][j]) for k in range(K)]) for j in range(M)] for i in range(N)]
def matvec(M,v):
    N,size=len(v),len(M)
    return [sum([M[i][j]*v[j] for j in range(N)]) for i in range(size)]
def T(M):
    n,m=len(M),len(M[0])
    return [[M[j][i] for j in range(n)] for i in range(m)]
def main():
    mod = 1000000007
    #w.sort(key=itemgetter(1),reversed=True)  #二個目の要素で降順並び替え

    #N = int(input())
    N, M = map(int, input().split())
    A = list(map(int, input().split())) #1行ベクトル
    #L = tuple(int(input()) for i in range(N)) #改行ベクトル
    S = list(tuple(map(int, input().split())) for i in range(M)) #改行行列
    A.sort()

    S.sort(key=itemgetter(1),reverse=True)
    i=0
    ans=0
    for b,c in S:
        ni=bisect_left(A,c)
        ni=max(0,ni-i)
        ni=min(ni,b)
        ans+=c*ni
        i+=ni
        if i==N:
            break
    if i<N:
        ans+=sum(A[i:])
    print(ans)


if __name__ == "__main__":
    main()

Measured memory_bytes: 96440
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (int)(n); i ++)
#define irep(i,n) for (int i = (int)(n) - 1;i >= 0;--i)
using namespace std;
using ll = long long;
using PL = pair<ll,ll>;
using P = pair<int,int>;
constexpr int INF = 1000000000;
constexpr long long HINF = 1000000000000000;
constexpr long long MOD = 1000000007;// = 998244353;
constexpr double EPS = 1e-4;
constexpr double PI = 3.14159265358979;

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

    string s;cin >> s;
    int ans = 0;
    rep(i,s.size()) {
        ans += s[i] - '0';
        ans %= 9;
    }
    if (ans == 0) cout << "Yes" << '\n';
    else cout << "No" << '\n';
    return 0;
}

Measured memory_bytes: 3780
// Undone
#include <bits/stdc++.h>
#define int long long
#define double long double
#define INF 1e18
#define MOD 1000000007
#define FAST_IO {ios::sync_with_stdio(0);cin.tie(0);}
using namespace std;
signed main() {
  int N; cin >> N;
  string S; cin >> S;
  int ans = 0;
  char last = '_';
  for (int i = 0; i < N; i++) {
    if (S[i] != last) {
      last = S[i];
      ans++;
    }
  }    
  cout << ans << endl;
}



Measured memory_bytes: 512
import numpy as np

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

cnt = 1
direct = 0
temp = a[0]
for i in range(1,n):
    dif = a[i] - temp
    if dif != 0:
        if direct == 0:
            direct = np.sign(dif)
            
        elif np.sign(a[i] - temp) != direct:
            cnt+=1
            direct = 0
    temp = a[i]
print(cnt)

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

using namespace std;

int a[3];

int main(void)
{
	cin >> a[0] >> a[1] >> a[2];
	sort(a, a+3);
	
	if(a[0] + a[1] == a[2]){
		 cout << "Yes" << endl;
	}
	else{
		cout << "No" << endl;
	}
	
	return 0;
}

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

using namespace std;

struct team{
  int id;
  int correct;
  int penalty;
  int wrong[10];
  bool accept[10];
  bool operator < (const team &right) const {
    if(correct != right.correct) return correct > right.correct;
    if(penalty != right.penalty) return penalty < right.penalty;
    return id < right.id;
  }
};

int main()
{
  int T, P, R;
  while(cin >> T >> P >> R, T || P || R){
    team t[50];
    for(int i = 0; i < T; i++){
      t[i].id = i + 1;
      t[i].correct = 0;
      t[i].penalty = 0;
      memset(t[i].wrong, 0, sizeof(t[i].wrong));
      memset(t[i].accept, false, sizeof(t[i].accept));
    }
    for(int i = 0; i < R; i++){
      int tid, pid, tim;
      string message;
      cin >> tid >> pid >> tim >> message;
      tid--, pid--;
      if(message == "CORRECT"){
	if(!t[tid].accept[pid]){
	  t[tid].correct++;
	  t[tid].accept[pid] = true;
	  t[tid].penalty += t[tid].wrong[pid]*1200 + tim;
	}
      } else if(message == "WRONG"){
	if(!t[tid].accept[pid]){
	  t[tid].wrong[pid]++;
	}
      }
    }
    sort(t, t + T);
    for(int i = 0; i < T; i++){
      cout << t[i].id << " " << t[i].correct << " " << t[i].penalty << endl;
    }
  }
  return 0;
}

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

int main(){
  int N;
  cin>>N;
  vector<int> x(N+1);
  for(int &i:x)
    cin>>i;
  sort(x.begin(),x.end());
  int j=0;
  for(int i=0;i<N;i++)
    j=__gcd(j,x[i+1]-x[i]);
  cout<<j<<endl;
}

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

using namespace std;

const int ANS = 91654010;
const string SANS = "91654010";

string toString(const long long& x) {
  long long temp = x;
  string ret = "";
  while (temp) {
    ret = (char)('0' + temp % 10) + ret;
    temp /= 10;
  }
  return ret;
}

void check(const long long& x, char& ret) {
  string s = toString(x);
  cout << x << " " << s << endl;
  if (x <= ANS && s <= SANS)
    ret = 'Y';
  else if (x > ANS && s > SANS)
    ret = 'Y';
  else
    ret = 'N';
}

bool checkTenPow() {
  char ans;
  cout << "? " << (int)1e9 << endl;
//  check((int)1e9, ans);
  cin >> ans;
  if (ans == 'N')
    return false;
  long long x = 2;
  while (true) {
    cout << "? " << x << endl;
//    check(x, ans);
    cin >> ans;
    if (ans == 'Y') {
      cout << "! " << x / 2 << endl;
      break;
    }
    x *= 10;
  }
  return true;
}

long long getDig() {
  char ans;
  long long ret = 10;
  while (true) {
    cout << "? " << ret << endl;
//    check(ret, ans);
    cin >> ans;
    if (ans == 'N')
      break;
    ret *= 10;
  }
  return ret;
}

int main()
{
  ios::sync_with_stdio(false);
  if (checkTenPow())
    return 0;
  long long dig = getDig();
  long long l = dig / 10, r = dig - 1;
  char ans;
  while (l <= r) {
    long long mid = (l + r) >> 1;
    cout << "? " << mid << 0 << endl;
//    check(10 * mid, ans);
    cin >> ans;
    if (ans == 'Y')
      r = mid - 1;
    else
      l = mid + 1;
  }
  cout << "! " << r + 1 << endl;
  return 0;
}

Measured memory_bytes: 596
#include <iostream>
#include<string>
#include<cmath>
#include<algorithm>
#include<cctype>
#include<queue>
#include<stack>
#include<stdio.h>
#include<vector>
#include<set>
#include<map>
#include<iomanip>
using namespace std;
#define rep(i,n) for(int i=0;i<n;i++)

#define inf  1000001
#define ind  -1000001
typedef int long long ll;


int main(){
    vector<ll> v;
    int n;
    cin>>n;
    ll mx=ind;
    ll mxp=0;
    ll mip=0;
    ll mi=inf;
    
    rep(i,n){
        ll x;
        cin>>x;
        if(x<mi){mi=x;mip=i;}
        if(x>mx){mx=x;mxp=i;}
        v.push_back(x);
    }
    if(mip==mxp){
        cout<<0<<endl;
        return 0;
    }
    cout<<2*n-1<<endl;
    int flag=0;
    
    if(abs(mi)<abs(mx)){
        for(int i=0;i<v.size();i++){
            cout<<mxp+1<<" "<<i+1<<endl;
            flag=1;
        }
            for(int i=1;i<n;i++){
                cout<<i<<" "<<i+1<<endl;
            }        
    }else{
        for(int i=0;i<v.size();i++){
            cout<<mip+1<<" "<<i+1<<endl;
            flag=2;
        }
        for(int i=n-1;i>0;i--){
            cout<<i+1<<" "<<i<<endl;
        }
        
    }
    
  /*  if(flag==1){
        for(int i=1;i<n;i++){
            cout<<i<<" "<<i+1<<endl;
        }
        
    }else{
        for(int i=n-1;i>0;i--){
            cout<<i+1<<" "<<i<<endl;
        }
    }
    */
    
    
   
    
    
    
return 0;
}


Measured memory_bytes: 256
#include <cstdio>
#include <iostream>
#include <algorithm>
#include <string>
#include <cstring>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <cmath>
#include <iomanip>
#include <cassert>
#include <bitset>
using namespace std;

typedef pair<int, int> P;
#define rep(i, n) for (int i=0; i<(n); i++)
#define all(c) (c).begin(), (c).end()
#define uniq(c) c.erase(unique(all(c)), (c).end())
#define _1 first
#define _2 second
#define pb push_back
#define INF 1145141919
#define MOD 1000000007

int W, H;
int C[20][20];
long long dp[20][20];

signed main() {
  ios::sync_with_stdio(false); cin.tie(0);
  while (cin >> W >> H) {
    if (W == 0 && H == 0) break;
    rep(x, 20) rep(y, 20) C[x][y] = dp[x][y] = 0;
    rep(i, H) rep(j, W) cin >> C[j][i];

    rep(x, W) {
      if (C[x][0] == 1) continue;
      dp[x][0] = 1;
    }
    long long s = 0;
    rep(y, H) {
      rep(x, W) {
        for (int d=-1; d<=1; d++) {
          int nx = x+d, ny = y+1;
          if (C[x][y] == 2) {
            if (d != 0) continue;
            ny = y+2;
          }
          if (nx < 0 || nx >= W || C[nx][ny] == 1) continue;
          if (C[nx][ny] == 2 && d != 0) continue;

          if (ny >= H) {
            if (d == 0) s += dp[x][y];
          }
          else dp[nx][ny] += dp[x][y];
        }
      }
    }
    cout << s << "\n";
  }
  return 0;
}

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

using namespace std;

#define ll long long
#define F first
#define S second
#define ii pair < int , int >

const int N=400000;
int row[N];
int col[N];
map<ii , int> mp;
int main()
{
    int h,w,m;
    scanf("%d%d%d",&h,&w,&m);
    for(int i=1;i<=m;i++){
        int x,y;
        scanf("%d%d",&x,&y);
        row[x]++;
        col[y]++;
        mp[{x,y}]=1;
    }
    ii mxr={-1,-1};
    for(int i=1;i<=h;i++){
        if(row[i] >=mxr.F){
            mxr.F=row[i];
            mxr.S=i;
        }
    }
    for(int i=1;i<=w;i++){
        if(mp[{mxr.S,i}]){
            col[i]--;
        }
    }
    ii mxc={-1,-1};
    for(int i=1;i<=w;i++){
        if(col[i] >mxc.F){
            mxc.F=col[i];
            mxc.S=i;
        }
    }
       for(int i=1;i<=w;i++){
        if(mp[{mxr.S,i}]){
            col[i]++;
        }
    }
    ll ans=mxc.F*1LL+mxr.F*1LL;
    mxc={-1,-1};
    for(int i=1;i<=w;i++){
        if(col[i] >mxc.F){
            mxc.F=col[i];
            mxc.S=i;
        }
    }
     mxr={-1,-1};
     for(int i=1;i<=h;i++){
        if(mp[{i,mxc.S}]){
            row[i]--;
        }
    }
    for(int i=1;i<=h;i++){
        if(row[i] >=mxr.F){
            mxr.F=row[i];
            mxr.S=i;
        }
    }
    ll ans2=mxc.F*1LL+mxr.F*1LL;
    ans=max(ans,ans2);
    printf("%lld",ans);

}


Measured memory_bytes: 62432
S = input()
N = len(S)
K = int(input())
ans = set()
for c in "abcdefghijklmnopqrstuvwxyz":
    for i in range(N):
        if S[i] == c:
            for j in range(i + 1, i + K + 1):
                ans.add(S[i:j])
    if len(ans) >= K:
        break
print(sorted(list(ans))[K - 1])


Measured memory_bytes: 9092
#include<stdio.h>
    int main(){
      int N,A,B;
      if(1<=N<=20,1<=A<=50,1<=B<=50){
      scanf("%d %d %d",&N,&A,&B);
      int X = N*A;
      if(X<B){
        printf("%d",X);
      }else{
        printf("%d",B);
      }
      return 0;
      }
    }

Measured memory_bytes: 128
//include
#include <set>
#include <map>
#include <list>
#include <queue>
#include <stack>
#include <cmath>
#include <ctime>
#include <cstdio>
#include <vector>
#include <string>
#include <bitset>
#include <cctype>
#include <cstdlib>
#include <cstring>
#include <utility>
#include <numeric>
#include <complex>
#include <sstream>
#include <fstream>
#include <iomanip>
#include <cassert>
#include <iostream>
#include <iterator>
#include <algorithm>

using namespace std;

// conversion
inline int
toInt(string s)
{
    int v;
    istringstream sin(s);
    sin >> v;
    return v;
}
template <class T>
inline string toString(T x)
{
    ostringstream sout;
    sout << x;
    return sout.str();
}

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

//math
template <class T>
inline T sqr(T x) { return x * x; }

template <class T>
inline T nCr(T n, T r)
{
    T num = 1;
    for (int i = 1; i <= r; ++i)
    {
        num *= (n - i + 1) / i;
    }
    return num;
}
template <class T>
inline T nPr(T n, T r)
{
    r = n - r;
    T sum = 1;
    int i;
    for (i = n; i >= r + 1; --i)
        sum *= i;
    return sum;
}

template <class T>
inline T facctorial(T k)
{
    T sum = 1;
    for (int i = 1; i <= k; ++i)
    {
        sum *= i;
    }
    return sum;
}

//numeric
template <class T>
inline T gcd(T a, T b)
{
    if (a < b)
    {
        a ^= b;
        b ^= a;
        a ^= b;
    }

    return b ? gcd(b, a % b) : a;
}

template <class T>
inline T lcm(T a, T b)
{
    return a * b / gcd(a, b);
}

//typedef
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef long long LL;

//container util
#define ALL(a) (a).begin(), (a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define SZ(a) int((a).size())
#define EACH(i, c) for (typeof((c).begin()) i = (c).begin(); i != (c).end(); ++i)
#define EXIST(s, e) ((s).find(e) != (s).end())

//repetition
#define FOR(i, a, b) for (int i = (a); i <= (int)(b); ++i)
#define REP(i, n) FOR(i, 0, n)

//constant
constexpr double EPS = 1e-10;
const double PI = acos(-1.0);
constexpr LL INF = 1e10;

//clear memory
#define CLR(a) memset((a), 0, sizeof(a))

//debug
#define dump(x) cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" \
                      << " " << __FILE__ << endl;

int main()
{
    int n;
    cin >> n;
    int max1 = 0, max2 = 0;
    vector<int> a(n);
    for (int i = 0; i < n; ++i)
    {
        cin >> a[i];
        if (a[i] > max1)
        {
            max2 = max1;
            max1 = a[i];
        }
        else if (a[i] > max2)
        {
            max2 = a[i];
        }
    }
    //dump(max1);
    //dump(max2);
    for (int i = 0; i < n; ++i)
    {
        if (a[i] == max1)
        {
            cout << max2 << endl;
        }
        else
        {
            cout << max1 << endl;
        }
    }
}

Measured memory_bytes: 2432
#include <iostream>
#include <string>
#include <algorithm>
#include <cmath>
#include <map>
#include <vector>
#include <stack>
#include <queue>
#include <tuple>
#include <cassert>
#include <functional>
#include <set>

using namespace std;
typedef long long ll;
int dx[4] = {0,0,1,-1};
int dy[4] = {1,-1,0,0};
const int INF = 1<<29;
const ll MOD = 1000000007;
const int MAX = 100000;

long long fac[MAX], finv[MAX], inv[MAX];

// テーブルを作る前処理
void COMinit() {
    fac[0] = fac[1] = 1;
    finv[0] = finv[1] = 1;
    inv[1] = 1;
    for (int i = 2; i < MAX; i++){
        fac[i] = fac[i - 1] * i % MOD;
        inv[i] = MOD - inv[MOD%i] * (MOD / i) % MOD;
        finv[i] = finv[i - 1] * inv[i] % MOD;
    }
}

// 二項係数計算
long long COM(int n, int k){
    if (n < k) return 0;
    if (n < 0 || k < 0) return 0;
    return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}
// 法mでのaの逆元を計算
long long modinv(long long a, long long m) {
    long long b = m, u = 1, v = 0;
    while (b) {
        long long t = a / b;
        a -= t * b; swap(a, b);
        u -= t * v; swap(u, v);
    }
    u %= m;
    if (u < 0) u += m;
    return u;
}
//最大公約数
int gcd(int x, int y) { return (x % y)? gcd(y, x % y): y; }
//最小公倍数
int lcm(int x, int y) { return x / gcd(x, y) * y; }


int main(){
    int N; cin>>N;
    map<string,int> m;

    int max=-1;
    for(int i=0;i<N;i++){
        string tmp;
        cin >> tmp;
        int c=m[tmp];
        //cerr << tmp << " " << m[tmp]  << endl;
        m[tmp] = c+1;
        if(max<c+1) max = c+1;

    }
    //cerr << max << "\n";
    for(auto i=m.begin();i!=m.end();i++){
        //cerr << i->first << "\t" << i->second << endl;
        if(i->second == max) cout << i->first << "\n";
    }

    return 0;
}


Measured memory_bytes: 17664
#include<algorithm>
#include<bitset>
#include<cmath>
#include<complex>
#include<deque>
#include<functional>
#include<iomanip>
#include<iostream>
#include<iterator>
#include<map>
#include<numeric>
#include<queue>
#include<set>
#include<stack>
#include<string>
#include<unordered_map>
#include<unordered_set>
#include<utility>
#include<vector>

using namespace std;
typedef long long ll;

#define REP(i,n) for(ll i=0;i<(ll)(n);i++)
#define REPD(i,n) for(ll i=n-1;i>=0;i--)
#define FOR(i,a,b) for(ll i=a;i<=(ll)(b);i++)
#define FORD(i,a,b) for(ll i=a;i>=(ll)(b);i--)
#define ALL(x) (x).begin(),(x).end()
#define SIZE(x) ((ll)(x).size())
#define MAX(x) *max_element(ALL(x))
#define MIN(x) *min_element(ALL(x))
#define D()
#define INF 1000000000000
#define MOD 10000007
#define MAXR 100000
#define PB push_back
#define MP make_pair
#define F first
#define S second
#define INITA(a,i,j,v) for(ll k=i;k<=j;k++){a[k]=v;}

int main() {
    string s; cin >> s;
    FOR(i, 0, s.size()-1) {
        FOR(j, i, s.size()-1) {
            string tmp = s.substr(0, i) + s.substr(j, s.size()-j);
            if (tmp == "keyence") {
                cout << "YES" << endl;
                return 0;
            }
        }
    }
    cout << "NO" << endl;
    return 0;
}

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

typedef pair<int, int> pii;

int main(void) {
  int n1, n2;
  vector<pii> sales;
  while (scanf("%d,%d", &n1, &n2) == 2) {
    sales.push_back(make_pair(n1, n2));
  }

  int ave_sales, sum = 0;
  double cmp_num, num = 0.0;
  for (int i = 0; i < sales.size(); i++) {
    sum += sales[i].first * sales[i].second;
    num += sales[i].second;
  }

  num /= sales.size();
  cmp_num = (double)(int)num;

  if (num > cmp_num) {
    ave_sales = (int)num + 1;
  } else {
    ave_sales = (int)num;
  }

  cout << sum << endl;
  cout << ave_sales << endl;

  return 0;
}

Measured memory_bytes: 1208