akhauriyash/Code-Regression huggingface dataset:
def main():
    N, M, X = map(int, input().split())

    A = [[] for _ in range(N)]
    C = [0] * N

    INF = 10 ** 9
    ans = INF

    for i in range(N):
        c_as = list(map(int, input().split()))
        C[i], A[i] = c_as[0], c_as[1:]

    for s in range(0, 1 << N):
        smart = [0] * M
        cost_sum = 0
        for i in range(N):
            if (s >> i) % 2 == 0:
                continue
            cost_sum += C[i]
            for j in range(M):
                smart[j] += A[i][j]

        ok = True
        if min(smart) < X:
            ok = False

        if ok:
            ans = min(ans, cost_sum)

    if ans == INF:
        print(-1)
    else:
        print(ans)


if __name__ == '__main__':
    main()


Measured memory_bytes: 9232
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); i++)
typedef long long ll;
using namespace std;
int main()
{
  ll N;
  cin >> N;
  ll ans = (N - 1) * N / 2;
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <math.h>
#define rep(i, n) for(int i = 0; i < (n); i++)
#define rrep(i, n) for(int i = 0; i <= (n); i++)
using namespace std;
typedef long long ll;
 
const ll INF = 1LL<<62;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
// 多次元 vector 生成
template<class T>
vector<T> make_vec(size_t a){
    return vector<T>(a);
}
template<class T, class... Ts>
auto make_vec(size_t a, Ts... ts){
  return vector<decltype(make_vec<T>(ts...))>(a, make_vec<T>(ts...));
}

const int MOD = 1000000007;



int main(){
    int N, K; cin >> N >> K;
    vector<int> A(N);
    rep(i,N) cin >> A[i];

    int ans = ((N-1) + (K-2)) / (K-1);
    cout << ans << endl;
}



Measured memory_bytes: 3712
def YY_or_MM(K):
    if 0<K<13:
        return "MM"
    else:
        return "YY"
S=str(input())
head=int(S[0:2])
tail=int(S[2:])
ans=YY_or_MM(head)+YY_or_MM(tail)
if ans=="YYYY":
    print("NA")
elif ans=="MMMM":
    print("AMBIGUOUS")
else:print(ans)


Measured memory_bytes: 3060
#include <bits/stdc++.h>
#define rep(i, a, b) for(int i = a; i < b; i++)
#define Rep(i, a, b) for(int i = a; i <= b; i++)
#define _GLIBCXX_DEBUG
#define Vl vector<ll>
#define Vs vector<string>
#define ll long long
#define ALL(v) (v).begin(),(v).end()
using namespace std;


void solve(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    
    ll n, m; cin >> n >> m;

    ll ans = (n*(n-1))/2 + (m*(m-1))/2;

    cout << ans << endl;
}


int main() {
    solve();
}


Measured memory_bytes: 384
# -*- coding: utf-8 -*-


# 入力を整数に変換して受け取る
def input_int():
    return int(input())


# マイナス1した値を返却
def int1(x):
    return int(x) - 1


# 半角スペース区切り入力をIntに変換してMapで受け取る
def input_to_int_map():
    return map(int, input().split())


# 半角スペース区切り入力をIntに変換して受け取る
def input_to_int_tuple():
    return tuple(map(int, input().split()))


# 半角スペース区切り入力をIntに変換してマイナス1した値を受け取る
def input_to_int_tuple_minus1():
    return tuple(map(int1, input().split()))


import itertools
def main():
    h, w, k = input_to_int_map()
    table = [input() for i in range(h)]

    ans = 0
    for row in itertools.product("01", repeat=h):
        row_target = []
        for ir, r in enumerate(row):
            if r == "0":
                row_target.append(ir)
        for column in itertools.product("01", repeat=w):
            col_target = []
            for ic, c in enumerate(column):
                if c == "0":
                    col_target.append(ic)

            cnt = 0
            for i in row_target:
                for j in col_target:
                    if table[i][j] == "#":
                        cnt += 1

            if cnt == k:
                ans += 1

    return ans


if __name__ == "__main__":
    print(main())


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

int main() {

	vector<int> prim(1000000+1);
	fill(prim.begin(),prim.end(),1);
	prim[0]=0;
	prim[1]=0;
	for(int i=2;i<prim.size();i++){
		if( prim[i]!=0 ){
			int x=i+i;
			while(x<prim.size()){
				prim[x]=0;
				x+=i;
			}
		}
	}

	while(true)
	{
		int N,X;
		cin >> N >> X;
		if(N==0 && X==0)break;
		
		vector<int> food;
		for(int i=0;i<N;i++){
			int m;
			cin >> m;
			food.push_back(m);
		}
		
		vector<int> num(X+1);
		fill(num.begin(),num.end(),0);
		for(int i=0;i<N;i++){
			if( food[i]<=X ){
				num[ food[i] ]=1;
			}
		}
		for(int i=0;i<=X;i++){
			if( num[i]!=0){
				for(int j=0;j<N;j++){
					if( i+food[j]<=X){
						num[i+food[j]]=1;
					}
				}
			}
		}
		int ans=-1;
		for(int x=X;x>=0;x--){
			if( prim[x]==1 && num[x]!=0){
				ans = x;
				break;
			}			
		}
		if(ans>0){
			cout << ans << endl;
		}else{
			cout << "NA" << endl;
		}
	}
	


	return 0;
}

Measured memory_bytes: 12080
#include <bits/stdc++.h>
using namespace std;
#define all(x) (x).begin(), (x).end()
typedef long long ll;

int main()
{
    int n,a,b;
    cin>>n>>a>>b;
    if((b-a)%2==1){
        cout<<"Borys"<<endl;
    }
    else{
        cout<<"Alice"<<endl;
    }
}


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

class Program
{
    public static void Main()
    {
        int N = int.Parse(Console.ReadLine());
        string[] d = Console.ReadLine().Split(' ');
        int[] a = new int[N];
        for (int i = 0; i < N; i++)
            a[i] = int.Parse(d[i]);

        int half = N / 2;
        Dictionary<int, int> EvenDic = new Dictionary<int, int>();
        Dictionary<int, int> OddDic = new Dictionary<int, int>();

        for (int i = 0; i < N; i += 2)
        {
            if (EvenDic.ContainsKey(a[i]))
                EvenDic[a[i]]++;
            else
                EvenDic.Add(a[i], 1);
        }
        for (int i = 1; i < N; i += 2)
        {
            if (OddDic.ContainsKey(a[i]))
                OddDic[a[i]]++;
            else
                OddDic.Add(a[i], 1);
        }

        List<KeyValuePair<int, int>> EvenList = new List<KeyValuePair<int, int>>() { Capacity = EvenDic.Count };
        List<KeyValuePair<int, int>> OddList = new List<KeyValuePair<int, int>>() { Capacity = OddDic.Count };

        foreach (var i in EvenDic)
            EvenList.Add(i);
        foreach (var i in OddDic)
            OddList.Add(i);

        EvenList.Sort((x, y) => x.Value - y.Value);
        OddList.Sort((x, y) => x.Value - y.Value);
        
        if (EvenList[EvenList.Count - 1].Key == OddList[OddList.Count - 1].Key)
        {
            int s1 = 0, s2 = 0;

            s1 += (half - EvenList[EvenList.Count - 1].Value);
            if (OddList.Count > 1)
                s1 += (half - OddList[OddList.Count - 2].Value);
            else
                s1 += half;

            s2 += (half - OddList[OddList.Count - 1].Value);
            if (EvenList.Count > 1)
                s2 += (half - EvenList[EvenList.Count - 2].Value);
            else
                s2 += half;

            Console.WriteLine(Math.Min(s1, s2));
        }
        else
        {
            int s = 0;
            s += (half - EvenList[EvenList.Count - 1].Value);
            s += (half - OddList[OddList.Count - 1].Value);
            Console.WriteLine(s);
        }
    }
}

Measured memory_bytes: 26336
#include <bits/stdc++.h>
using namespace std;
using ll=long long;
using vi=vector<int>;
using vvi=vector<vi>;
using vd=vector<double>;
using vvd=vector<vd>;
using vl=vector<ll>;
using vvl=vector<vl>;
using pii=pair<int,int>;
using vs=vector<string>;
#define rep(i,n) range(i,0,n)
#define range(i,a,n) for(int i=a;i<n;i++)
#define all(a) a.begin(),a.end()
#define LINF    	((ll)1ll<60)
#define INF     	((int)1<<30)
#define EPS     	(1e-9)
#define MOD     	(1000000007)
#define fcout(a)	cout<<setprecision(a)<<fixed
#define fs 			first
#define sc			second
#define PI			3.141592653589793

template<class S,class T>ostream& operator<<(ostream&os,pair<S,T>p){os<<"["<<p.first<<", "<<p.second<<"]";return os;};
template<class S>auto&operator<<(ostream&os,vector<S>t){bool a=1; for(auto s:t){os<<(a?"":" ")<<s; a=0;} return os;}

int main(){
	cin.tie(0);
   	ios::sync_with_stdio(false);
	
	int n;cin>>n;
	string s;
	char c=' ';
	set<string> d;
	rep(i,n){
	    cin>>s;
	    if(d.find(s)!=d.end() or (c!=s[0] and c!=' ')){
	        cout<<"No"<<endl;
	        return 0;
	    }
	    d.insert(s);
	    c=s.back();
	}
    cout<<"Yes"<<endl;
	return 0;
}


Measured memory_bytes: 256
#[allow(unused_imports)]
use std::cmp::{Ordering};

#[allow(unused_imports)]
use std::collections::{BTreeMap, BTreeSet, BinaryHeap, HashMap, HashSet, VecDeque};

#[allow(unused_imports)]
use std::io::{stdin, stdout, BufWriter, Write};

#[allow(unused_imports)]
use std::iter::FromIterator;

#[allow(unused_macros)]
macro_rules! min {
    ($x: expr) => ($x);
    ($x: expr, $($z: expr),+) => {{
        std::cmp::min($x, min!($($z),*))
    }}
}

#[allow(unused_macros)]
macro_rules! max {
    ($x: expr) => ($x);
    ($x: expr, $($z: expr),+) => {{
        std::cmp::max($x, max!($($z),*))
    }}
}

#[allow(unused_macros)]
macro_rules! get { 
    ([$t: ty]) => { 
        { 
            let mut line = String::new(); 
            stdin().read_line(&mut line).unwrap(); 
            line.split_whitespace().map(|t|t.parse::<$t>().unwrap()).collect::<Vec<_>>()
        }
    };
    ([$t: ty];$n: expr) => {
        (0..$n).map(|_|get!([$t])).collect::<Vec<_>>()
    };
    ($t: ty) => {
        {
            let mut line = String::new();
            stdin().read_line(&mut line).unwrap();
            line.trim().parse::<$t>().unwrap()
        }
    };
    ($($t: ty),*) => {
        { 
            let mut line = String::new();
            stdin().read_line(&mut line).unwrap();
            let mut iter = line.split_whitespace();
            ($(iter.next().unwrap().parse::<$t>().unwrap(),)*)
        }
    };
    ($t: ty; $n: expr) => {
        (0..$n).map(|_|get!($t)).collect::<Vec<_>>()
    };
    ($($t: ty),*; $n: expr) => {
        (0..$n).map(|_|get!($($t),*)).collect::<Vec<_>>()
    };
}

#[allow(unused_macros)]
macro_rules! debug {
    ($($a:expr),*) => {
        #[cfg(debug_assertions)]
        writeln!(&mut std::io::stderr(), concat!("[DEBUG] ", $(stringify!($a), "={:?} "),*), $($a),*).unwrap();
    }
}

const BIG_STACK_SIZE: bool = true;

#[allow(dead_code)]
fn main() {
    use std::thread;
    if BIG_STACK_SIZE {
        thread::Builder::new()
            .stack_size(32 * 1024 * 1024)
            .name("solve".into())
            .spawn(solve)
            .unwrap()
            .join()
            .unwrap();
    } else {
        solve();
    }
}

fn solve() {
    let (l,r) = get!(usize, usize);
    if l == 0 {
        println!("0");
        return;
    }
    let num3 = r/3 - (l-1)/3;
    let num673 = r/673 - (l-1)/673;

    if num3 > 0 && num673 > 0 {
        println!("0");
        return;
    }
    let mut mn = 2018;
    for i in l..(r+1) {
        for j in (i+1)..(r+1) {
            mn = min!(mn, i*j%2019);
        }
    }
    println!("{}", mn);
}


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

int main()
{
  long long a,b,c;
   cin>>a>>b>>c;

    long long d= c-(a+b);

   if(d<=0)
 {
    cout<<"No";
     return 0;
 }

 long long e= 4*(a*b);

   d= (d*d);

   if(d>e)
  cout<<"Yes";

  else
   cout<<"No";

  
   
  
 return 0;
}


Measured memory_bytes: 256
N = gets.to_i
r = Array.new(N, 0)
(N-1).times{|i|
    c,s,f = gets.split.map(&:to_i)
    (N-1).times{|j|
        if i==j then
            r[j] = s+c
        elsif i>j then
            r[j] = -(-[r[j],s].max/f)*f+c
        end
    }
}
puts r

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

sss = [[] for i in range(m)]

for i in range(m):
  ss = list(map(int, input().split()))
  ss = ss[1:]
  sss[i] = ss
#print(sss)

ps = list(map(int, input().split()))

ans = 0
for i in range(2**n):
  s = [0]*n
  for j in range(n):
    if ((i>>j) & 1):
      s[j] = 1
  for a in range(m):
    sum_ = 0
    for b in sss[a]:
      sum_ += s[b-1]
    if sum_%2 !=  ps[a]:
      break
  else:
    ans += 1
    #print(s)

print(ans)
      

Measured memory_bytes: 41072
inpl = lambda: list(map(int,input().split()))
def bisect_left_withkey(a, x, lo=0, hi=None, key=lambda x: x, keyvalue_x=False):
    left = lo
    right = len(a) if hi is None else hi
    kx = key(x) if keyvalue_x else x
    while left + 1 < right:
        new = (left + right)//2
        kn = key(a[new])
        if kx <= kn:
            right = new
        else:
            left = new
    if key(a[left]) == kx:
        return left
    else:
        return right

N, K = inpl()
A = inpl()
F = inpl()
A.sort()
F.sort(reverse=True)
score = [A[i]*F[i] for i in range(N)]

def achievable(m):
    k = 0
    for i in range(N):
        k += max(0, (score[i]-m-1)//F[i] + 1)
        if k > K:
            return False
    return True

M = max(score)
print(bisect_left_withkey(range(M+1), True, key=achievable))

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

int main() {
    int n;
    cin >> n;
    string ans = "";
    while (n) {
        if (n % 2 != 0) {
            n--;
            ans = "1" + ans;
        } else {
            ans = "0" + ans;
        }
        n /= -2;
    }
    if (ans == "") ans = "0";
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main(){
    int n,d;cin >> n >> d;
    vector<vector<int>> x(n,vector<int>(d));
    for(int i=0;i<n;i++){
        for(int j=0;j<d;j++){
            cin >> x[i][j];
        }
    }
    int ans,count=0;
    for(int i=0;i<n-1;i++){
        for(int j=i+1;j<n;j++){
            ans=0;
            for(int k=0;k<d;k++){
                ans+=(x[i][k]-x[j][k])*(x[i][k]-x[j][k]);
            }
            for(int k=0;k<=ans;k++){
                if(k*k == ans){
                    ++count;
                }
            }
        }
    }
    cout << count << endl;
    return 0;
}


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

#define ll long long
#define ull unsigned long long
#define FOR(i,a,b) for (int i=(a);i<(b);++i)
#define REP(i,n) for(int i=0;i<(n);++i)
#define debug(x) cerr<<#x<<": "<<x<<'\n'

using namespace std;
typedef pair<int, int> P;
typedef pair<ll, ll> LP;
typedef pair<int, P> PP;
typedef pair<ll, LP> LPP;

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

template<class T=int>
T in(){T x;cin>>x;return (x);}
template<class T>
void print(T& x){cout<<x<<'\n';}

const int MOD =(int)1e9+7;
const int MAX =510000;

ll fac[MAX],finv[MAX],inv[MAX];
void COMint(){
    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;
    }
}
ll 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;
}

ll gcd(ll a,ll b){
    if(b==0)return a;
    if(a>b){
        swap(a,b);
    }
    return gcd(a,b%a);
}
ll lcm(ll a,ll b){
    ll g;g=gcd(a,b);
    return a*b/g;
}

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    int N=in();
    int M=in();
    ll x[N];
    ll y[N];
    ll z[N];
    ll x_,y_,z_;

    REP(i,N){
        cin>>x_;
        cin>>y_;
        cin>>z_;
        x[i]=x_;
        y[i]=y_;
        z[i]=z_;
    }
    
    ll ans;ans=0;
    ll ans_temp;
    int symbol[3];
    REP(j,8){
        REP(i,3){
            if((1&j>>i)==1){
                symbol[i]=1;
            }else{
                symbol[i]=-1;
            }
        }
        vector<ll> val;
        ans_temp=0;
        REP(i,N){
            val.push_back(x[i]*symbol[0]+y[i]*symbol[1]+z[i]*symbol[2]);
        }
        sort(val.begin(),val.end(),greater<ll>());
        REP(i,M){
            ans_temp+=val[i];
        }
        ans=max(ans,ans_temp);
    }
    print(ans);
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <algorithm>
#include <tuple>
#include <cmath>
using namespace std;
 
 
int main() {
    int A, B;
    cin >> A >> B;

    string ans = "No";
    if (A%2 and B%2) ans = "Yes";

    cout << ans << endl;
}


Measured memory_bytes: 256
#include "bits/stdc++.h"
using namespace std;
#define sim template < class c
#define ris return * this
#define dor > debug & operator <<
#define eni(x) sim > typename \
  enable_if<sizeof dud<c>(0) x 1, debug&>::type operator<<(c i) {
sim > struct rge { c b, e; };
sim > rge<c> range(c i, c j) { return rge<c>{i, j}; }
sim > auto dud(c* x) -> decltype(cerr << *x, 0);
sim > char dud(...);
struct debug {
#ifdef LOCAL
~debug() { cerr << endl; }
eni(!=) cerr << boolalpha << i; ris; }
eni(==) ris << range(begin(i), end(i)); }
sim, class b dor(pair < b, c > d) {
  ris << "(" << d.first << ", " << d.second << ")";
}
sim dor(rge<c> d) {
  *this << "[";
  for (auto it = d.b; it != d.e; ++it)
    *this << ", " + 2 * (it == d.b) << *it;
  ris << "]";
}
#else
sim dor(const c&) { ris; }
#endif
};
#define imie(...) " [" << #__VA_ARGS__ ": " << (__VA_ARGS__) << "] "

using ll = long long;
using ii = pair<int,int>;
using vi = vector<int>;
using vii = vector<ii>;

const int mod = 1e9+7;
const int oo = 1e9+7;

int main() {

    int n;
    vi nums;
    scanf("%d",&n);

    for(int i = 0; i < n; ++i) {
        int x; scanf("%d",&x);
        nums.push_back(x-1);
    }
    
    bool invalid = false;
    vector<bool> taken(n,false);
    vi seq;
    
    for(int i = 0; i < n && !invalid; ++i) {
        
        int ans = -1;
        
        for(int j = 0, pos = 0; j < n; ++j) {
            if(taken[j]) continue;
            if(nums[j] == pos) {
                ans = j;
            }
            pos++;
        }
        
        if(ans == -1) { invalid = true; continue; }
        seq.push_back(nums[ans]+1);
        taken[ans] = true;
        
    }
    
    if(invalid) printf("-1\n");
    else {
        reverse(seq.begin(), seq.end());
        for(auto x: seq) {
            cout << x << endl;
        }
    }
    
    return 0;
}




Measured memory_bytes: 256
#include<stdio.h>
 
#define MAX 1000
#define MAXWEIGHTIJ 20000
 
struct MCS {
    int cost;
    int order;
};
 
void exchange( struct MCS *pa, struct MCS *pb )
{
    struct MCS t;
      
    t=*pa;
    *pa=*pb;
    *pb=t;
      
     return;
}
  
int Partition( struct MCS A[], int p, int r )
{
    struct MCS x;
    int i,j;
  
    x=A[r];
    i=p-1;
    for( j=p; j<r; j++ ) {
        if( A[j].cost < x.cost ) {
            i++;
            exchange( &A[i], &A[j] );
         }
    }
    exchange( &A[i+1], &A[r] );
 
    return i+1;
}
void QuickSort( struct MCS A[], int p, int r )
{
    int q;
      
    if( p < r ) {
        q=Partition( A, p, r );
        QuickSort( A, p, q-1 );
        QuickSort( A, q+1, r );
    }
    return;
}
 
int tryChange( int n, struct MCS W[] )
{
    int cnt;
    int fixedcost,profit;
    int from, to, togoal;
     
    int cost,lowestCost;
    int i,j;
    int lowW,lowestW;
    int low,high,lowest;
 
    lowestW=lowW=lowestCost=cost=MAXWEIGHTIJ;
    lowest=high=low=-1;
    for( i=0; i<n; i++ ) {
        if( i != W[i].order && W[i].cost < lowW ) {
            lowW=W[i].cost;
            low=i;
            for( j=0; j<n; j++ ) {
                if( low == W[j].order ) {
                    high=j;
                    break;
                }
            }
        }
        if( W[i].cost < lowestW ) {
            lowestW=W[i].cost;
            lowest=i;  
        }      
    }
 
    if( W[high].order == low && W[low].order == high ) {
        lowestCost = W[low].cost + W[high].cost;
    } else if( low != lowest ) {   
        fixedcost = W[low].cost + W[lowest].cost;
        profit = W[low].cost - W[lowest].cost;
        from=high;
        to=low;
        togoal = W[low].order;
        cnt=0;
        while( 1 ) {
            if( W[from].order == to ) {
                if( togoal == to ) { break; }
                to=from;
                cnt++;
            } else {
                break;
            }
            for( i=0; i<n; i++ ) {
                if( i != W[i].order ) {
                    if( to == W[i].order ) {
                        from=i;
                        break;
                    }
                }
            }
        }
        profit = ( profit * cnt ) - ( 2 * fixedcost );
        if( 0 < profit ) {
            high=low;
            low=lowest;
            lowestCost = fixedcost;
        }
    }
    if( W[high].order == low ) {
        lowestCost = W[low].cost + W[high].cost;
    }
 
    if( MAXWEIGHTIJ != lowestCost ) {
        exchange( &W[low], &W[high] );
    } else {
        lowestCost=0;
    }
    return lowestCost;
}
 
int main( void )
{  
    int n,i;
    struct MCS W[MAX+1];
    int cost;
         
    scanf( "%d", &n );
    for( i=0; i<n; i++ ) {
        scanf( "%d", &W[i].cost );
        W[i].order=i;
    }
 
    QuickSort( W, 0, n-1 );
    cost=i=0;
    while( (i = tryChange( n, W ) ) ) {
        cost+=i;
    }
    printf( "%d\n", cost );
 
    return 0;
}

Measured memory_bytes: 648
#include <stdio.h>

int main(void)
{
	int a, b;
		
	scanf("%d%d",&a, &b);
	if(a < b)
	puts("a < b");
	if(a > b)
	puts("a > b");
	if(a == b)
	puts("a == b");
		
	return 0;
}

Measured memory_bytes: 580
import java.util.Scanner;

public class Main {

	static Scanner scanner;
	public static void main(String[] args) {
	    scanner = new Scanner(System.in);

	    String s=gs();
	    

	    
	    //System.out.println(f);
	    if (s.replaceAll("hi", "").length()==0) {
	    	System.out.print("Yes");
	    }else {
	    	System.out.print("No");
	    }



	}

	public static long d(long n) {
		String a=String.valueOf(n);
		return (long)a.length();
	}

	// 文字列として入力を取得
	public static String gs() {
		return scanner.next();
	}

	// intとして入力を取得
	public static int gi() {
		return Integer.parseInt(scanner.next());
	}

	// longとして入力を取得
	public static long gl() {
		return Long.parseLong(scanner.next());
	}

	// doubleとして入力を取得
	public static double gd() {
		return Double.parseDouble(scanner.next());
	}
}

Measured memory_bytes: 35448
#include<bits/stdc++.h>
 
using namespace std;
 
#define lli long long
typedef long double ldb;
#define deci(n) fixed << setprecision(n)
 
lli M=1e9+7;
lli MOD=1e9+7;
 
#define MAXN 2000006 
 
// Template function //
lli powermod(lli x, lli y)  
{  
    lli res = 1;  
    x = x % MOD;
    if (x == 0) return 0;  
    while (y > 0)  
    {  
        if (y & 1)  
            res = (res*x) % MOD;  
        y = y>>1;   
        x = (x*x) % MOD;  
    }  
    return res;  
}
lli modinv(lli x)
{
    return powermod(x,MOD-2);
}
// Template functions end //
 
// Custom funtions //
lli findset(lli p[], lli x){
	if(x!=p[x]){
		p[x]=findset(p,p[x]);
	}
	return p[x];
}
 
void unionset(lli p[],lli r[],lli a,lli b){
	lli x=findset(p,a);
	lli y=findset(p,b);
	if(x!=y){
		if(r[x]<r[y]) swap(x,y);
		p[y]=x;
		if(r[x]==r[y]){
			r[x]++;
		}
	}
}

void dfs(vector<lli> v[], lli s[], lli x)
{
    lli S=1;
    for(lli i=0;i<v[x].size();i++)
    {
        dfs(v,s,v[x][i]);
        S+=s[v[x][i]];
    }
    s[x]=S;
}

lli f[100005];



void preprocess()
{
    f[0]=1;
    for(lli i=1;i<100005;i++)
    {
        f[i] = (f[i-1]*i)%MOD;
        if(i%2==0)
        f[i]/=2;
    }
}

lli tree[MAXN];


void buildTree(vector<lli> a, lli n)
{
    for(lli i=0;i<n;i++)
        tree[n+i] = a[i];
    for(lli i=n-1;i>0;i--)
    {
        tree[i] = tree[i<<1] + tree[i<<1|1];
    }
}

void updateTree(lli n, lli p, lli value)
{
    tree[p+n] = value;
    p+=n;
    for(lli i=p; i>1;i >>= 1)
        tree[i>>1] = tree[i] + tree[i^1];
}

lli queryTree(lli n, lli l, lli r)
{
    lli res = 0;
    for(l+=n,r+=n;l<r;l>>=1, r>>=1)
    {
        if(l&1)
            res += tree[l++];
        if(r&1)
            res += tree[--r];
    }
    return res;
}

bool sortbysec(const pair<pair<lli,lli>,lli> &a, 
              const pair<pair<lli,lli>,lli> &b) 
{ 
    if(a.first.second == b.first.second)
    return a.first.first>b.first.first;
    return (a.first.second < b.first.second); 
} 

void dfs(int x, int vi[], vector<int> v[], long double pr, long double &ans)
{
    vi[x] = 1;
    double d = 0;
    for(int i=0;i<v[x].size();i++) 
    {
        if(vi[v[x][i]]==0)
        d++;
    }
    if(d==0)
    return;
    ans+=pr;
    pr = pr/d;
    for(int i=0;i<v[x].size();i++) 
    {
        if(vi[v[x][i]]==0)
        {
            dfs(v[x][i],vi,v,pr,ans);
        }
    }
}

void solve()
{ 
    lli D,S,T;
    cin>>D>>T>>S;
    if(S*T>=D)
    cout<<"Yes"<<endl;
    else cout<<"No"<<endl; 
}
// Custom functions end //
 
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    lli q=1;
    //cin>>q;
    for(lli tc=1;tc<=q;tc++)
    {
        solve();
    }
    return 0;
}

Measured memory_bytes: 3664
N = int(input())

dic = {(i,j):set([]) for i in range(1,N+1) for j in range(2)}

for i in range(1,N+1):
  a = int(input())
  for _ in range(a):
    x,y = map(int, input().split())
    dic[(i,y)].add(x)
    
p = 2**N
rlt = 0

for b in range(p):
  s0 = set([])
  s1 = set([])
  for i in range(N):
    if b&(1<<i):
      s1.add(i+1)
    else:
      s0.add(i+1)
  f = 1
  for i in s1:
    for k in dic[(i,1)]:
      if k in s0:
        f = 0
        break
    for k in dic[(i,0)]:
      if k in s1:
        f = 0
        break
    if f == 0:
      break
  if f == 1:
    rlt = max(len(s1),rlt)
    
print(rlt)

Measured memory_bytes: 74788
#include <bits/stdc++.h>
using namespace std;
#define F first
#define S second
#define R cin>>
#define Z class
#define ll long long
#define ln cout<<'\n'
#define in(a) insert(a)
#define pb(a) push_back(a)
#define pd(a) printf("%.10f\n",a)
#define mem(a) memset(a,0,sizeof(a))
#define all(c) (c).begin(),(c).end()
#define iter(c) __typeof((c).begin())
#define rrep(i,n) for(int i=(int)(n)-1;i>=0;i--)
#define REP(i,m,n) for(int i=(int)(m);i<(int)(n);i++)
#define rep(i,n) REP(i,0,n)
#define tr(it,c) for(iter(c) it=(c).begin();it!=(c).end();it++)
template<Z A>void pr(A a){cout<<a;ln;}
template<Z A,Z B>void pr(A a,B b){cout<<a<<' ';pr(b);}
template<Z A,Z B,Z C>void pr(A a,B b,C c){cout<<a<<' ';pr(b,c);}
template<Z A,Z B,Z C,Z D>void pr(A a,B b,C c,D d){cout<<a<<' ';pr(b,c,d);}
template<Z A>void PR(A a,ll n){rep(i,n){if(i)cout<<' ';cout<<a[i];}ln;}
ll check(ll n,ll m,ll x,ll y){return x>=0&&x<n&&y>=0&&y<m;}
const ll MAX=1000000007,MAXL=1LL<<61,dx[4]={-1,0,1,0},dy[4]={0,1,0,-1};
typedef pair<int,int> P;

void Main() {
  ll n,m,d;
  cin >> n >> m >> d;
  string s="RYGB";
  char c[n][m];
  rep(i,n)rep(j,m) c[i][j]='*';
  if(d%2) {
    rep(i,n) {
      rep(j,m) c[i][j]=s[(i+j)%2];
    }
    rep(i,n) {rep(j,m) cout << c[i][j];ln;}
    return;
  }
  bool f=1;
  int k=0,kk=0,k2=0,xx=0,yy=0;
  for(int i=0; i<n; i++) {
    int l=k/2,ff=0,x=xx,y=yy;
    for(int j=0; j<m; j++) {
      rep(t,2) {
        if(!ff) {
          if(l>=k) {
            l=0;
            ff=1;
            x=(x+1)%2;
          }
        } else {
          if(l>=d-k) {
            l=0;
            ff=0;
            y=(y+1)%2;
          }
        }
      }
      if(ff) c[i][j]=s[x];
      else c[i][j]=s[y+2];
      l++;
    }
    if(f) k+=2;
    else k-=2;
    if(k<0) {
      k+=4;
      f=1;
      kk++;
      yy=(yy+1)%2;
    } else if(k>d) {
      k-=4;
      f=0;
      k2++;
      xx=(xx+1)%2;
    }
  }
  rep(i,n) {
    rep(j,m) cout << c[i][j];
    ln;
  }
}

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


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

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

#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define EB emplace_back
#define MP make_pair
#define SZ(a) int((a).size())
#define SORT(c) sort((c).begin(),(c).end())

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

#define FF first
#define SS second
template<class S, class T>
istream& operator>>(istream& is, pair<S,T>& p){
  return is >> p.FF >> p.SS;
}

const double EPS = 1e-10;
const double PI  = acos(-1.0);
const LL MOD = 1e9+7;

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

  int N; cin >> N;
  cout << N*(N+1)/2 <<endl;

  return 0;
}


Measured memory_bytes: 256
#include <cstdio>
#include <cstring>
#include <vector>
#include <queue>
#include <string>
#include <algorithm>
#include <iostream>
#include <string>
#include <map>
#include <set>
#include <functional>
#include <iostream>
#define MOD 1000000007LL
using namespace std;
typedef long long ll;
typedef pair<int,int> P;

int n,m;
ll dp[3005][3005][2];


int main(void){
	scanf("%d%d",&n,&m);
	memset(dp,0,sizeof(dp));
	for(int i=1;i<=n;i++){
		dp[0][i][0]=1;
	}
	dp[0][0][1]=1;
	for(int i=0;i<m;i++){
		for(int j=0;j<=n;j++){
			for(int k=0;k<2;k++){
				if(j==0){
					dp[i+1][j][1]+=dp[i][j][k];
					dp[i+1][j][1]%=MOD;
					dp[i+1][j+1][1]+=dp[i][j][k];
					dp[i+1][j+1][1]%=MOD;
				}else if(j<n){
					dp[i+1][j+1][k]+=dp[i][j][k];
					dp[i+1][j+1][k]%=MOD;
					int nk=k;
					if(j-1==0)nk=1;
					dp[i+1][j][k]+=dp[i][j][k];
					dp[i+1][j][k]%=MOD;
					dp[i+1][j][nk]+=dp[i][j][k];
					dp[i+1][j][nk]%=MOD;
					dp[i+1][j-1][nk]+=dp[i][j][k];
					dp[i+1][j-1][nk]%=MOD;
				}else if(j==n){
					int nk=k;
					if(j-1==0)nk=1;
					dp[i+1][j][nk]+=dp[i][j][k];
					dp[i+1][j][nk]%=MOD;
					dp[i+1][j-1][nk]+=dp[i][j][k];
					dp[i+1][j-1][nk]%=MOD;
				}
			}
		}
	}
	ll res=0;
	for(int i=0;i<=n;i++){
		res=(res+dp[m][i][1])%MOD;
	}
	printf("%lld\n",res);
	return 0;
}


Measured memory_bytes: 141312
n,k,q =  map(int,input().split())
scores = [0]*n
b = 0
while b < q:
    ans = int(input()) - 1 #0からにする
    scores[ans] += 1
    b += 1
for x in scores:
    if k-(q-x) > 0:
        print('Yes')
    else:
        print('No')

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

int main()
{

    int n,q,x,y,i,k;
    cin>>n>>q;
    k=q;
    map<int,int> m,m1;
    for(i=1; i<=n; i++)
        m[i]=-1;

    bool flag=1;
    while(q--)
        {
            cin>>x>>y;
            if(m[x]!=-1 && m[x]!=y)
                flag=0;
            m1[x]=y;
            m[x]=y;
        }

    if(!flag)
        {
            cout<<-1<<endl;
            return 0;
        }

    for(i=0; i<10000; i++)
        {
            int t=i,counter=0,t1=i,ans=i,cc=0;
            if(i==0)
               counter++;
            while(t)
                {
                    t/=10;
                    counter++;
                }

            if(counter==n)
                {
                    string s=to_string(t1);
                    for(auto i:m)
                        {
                            if(i.second==-1)
                                continue;
                            if(s[i.first-1]-48==i.second)
                                cc++;
                            else
                                break;
                        }
                    if(cc==m1.size())
                        {
                            cout<<ans<<endl;
                            return 0;
                        }

                }



        }

    cout<<-1<<endl;

    return 0;
}


Measured memory_bytes: 256
pub mod io {
    use std;
    use std::str::FromStr;

    pub struct Scanner<'a> {
        iter: std::str::SplitWhitespace<'a>,
    }

    impl<'a> Scanner<'a> {
        pub fn new(s: &'a str) -> Scanner<'a> {
            Scanner {
                iter: s.split_whitespace(),
            }
        }

        pub fn next<T: FromStr>(&mut self) -> T {
            let s = self.iter.next().unwrap();
            if let Ok(v) = s.parse::<T>() {
                v
            } else {
                panic!("Parse error")
            }
        }

        pub fn next_vec_len<T: FromStr>(&mut self) -> Vec<T> {
            let n: usize = self.next();
            self.next_vec(n)
        }

        pub fn next_vec<T: FromStr>(&mut self, n: usize) -> Vec<T> {
            (0..n).map(|_| self.next()).collect()
        }
    }

    pub fn read_string() -> String {
        use std::io::Read;

        let mut s = String::new();
        std::io::stdin().read_to_string(&mut s).unwrap();
        s
    }

    pub fn read_line() -> String {
        let mut s = String::new();
        std::io::stdin().read_line(&mut s).unwrap();
        s.trim_right().to_owned()
    }
}

macro_rules! input {
    ($($r:tt)*) => {
        let con = io::read_string();
        let mut sc = io::Scanner::new(&con);
        input_inner!{sc, $($r)*}
    };
}

macro_rules! input_inner {
    ($sc:expr) => {};
    ($sc:expr, ) => {};

    ($sc:expr, $var:ident : [ $t:tt ; $len:expr ], $($r:tt)*) => {
        let $var: Vec<_> = (0..$len).map(|_| read_value!($sc, $t)).collect();
        input_inner!{$sc, $($r)*}
    };

    ($sc:expr, $var:ident : $t:ty, $($r:tt)*) => {
        let $var: $t = read_value!($sc, $t);
        input_inner!{$sc, $($r)*}
    };
}

macro_rules! read_value {
    ($sc:expr, ( $($t:tt),* )) => {
        ( $(read_value!($sc, $t)),* )
    };

    ($sc:expr, u1) => {
        read_value!($sc, usize) - 1
    };

    ($sc:expr, $t:ty) => {
        $sc.next::<$t>()
    };
}

//-----

fn main() {
    input!{
        n: usize,
        m: usize,
        q: usize,
        ts: [(u1, u1); m],
        qs: [(u1, u1); q],
    }

    let mut tbl = vec![vec![0; n]; n];
    for (l, r) in ts {
        for r in tbl[l][r..n].iter_mut() {
            *r += 1;
        }
    }

    for (p, q) in qs {
        let ans: usize = tbl[p..n].iter().map(|r| r[q]).sum();
        println!("{}", ans);
    }
}


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

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

    if(a % 3 == 0 || b % 3 == 0 || (a+b) % 3 == 0) cout << "Possible" << endl;
    else cout << "Impossible" << endl;
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int main() {
	int a, b;
	cin >> a >> b;

	if((a % 3 == 0)||(b % 3 == 0)||((a + b) % 3 == 0)) {
		cout << "Possible" << endl;
	} else {
		cout << "Impossible" << endl;
	}

	return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
int n,ans,m;
struct P{
	int x,y;
};
P tab[10000];
int comp(const P &a,const P &b){
	return a.x<b.x;
}
void rec(int now,int sum){
	if(sum==n){
		ans++;
		return ;
	}
	if(now==m)
	return ;
	for(int i=0;i<=tab[now].y&&sum+tab[now].x*i<=n;i++){
		rec(now+1,sum+tab[now].x*i);
	}
}
void solve(){
	rec(0,0);
}
int main(){
	int g,s,t;
	while(cin>>m,m){
		for(int i=0;i<m;i++){
			cin>>s>>t;
			tab[i].x=s;
			tab[i].y=t;
		}
		sort(tab,tab+m,comp);
		cin>>g;
		while(g-->0){
			ans=0;
			cin>>n;
			solve();
			cout<<ans<<endl;
		}
	}
	return 0;
}

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

int main(){
    int n,m;cin >> n >> m;
    int S = pow(10,n-1);
    if(n==1) S = 0;
    string s = to_string(S);
    //cout << s << endl;

    vector<bool> yes(3,false);
    rep(i,m){
        int a,b;cin >> a >> b;
        if(a==1 && b==0 && n>=2){
            cout << -1 << endl;
            return 0;
        }
        a--;
        if(!yes[a]){
            s[a] = b + '0';
            yes[a] = true;
        }
        else if(yes[a] && s[a]==b + '0') continue;
        else{
            cout << -1 << endl;
            return 0;
        }
    }
    cout << s << endl;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define dbug printf("I am here\n");
#define Fast ios_base::sync_with_stdio(false); cin.tie(0);
#define vs              v.size()
#define ss               s.size()
#define sot(v)        sort(v.begin(),v.end())
#define rev(v)        reverse(v.begin(),v.end())
#define ii                pair<int,int>
#define ll                long long
#define ull              unsigned long long
#define pb              push_back
#define mpp          make_pair
#define Okay         0
#define pi               3.14159

using namespace std;
const int ll cont = 10e6;
static const ll inf = 1e11;

void solve(){
    ll n, m;
    cin>>n>>m;
    if(n*500 >= m)cout<<"Yes"<<endl;
    else cout<<"No"<<endl;
}

int main(){
    Fast;
    solve();

    return Okay;
}


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

#define SIZE_OF_ARRAY(array) (sizeof(array)/sizeof(array[0]))

int main() {
    std::string S;
    cin >> S;
    int modS[S.length()+1];
    int mod10[200000];
    long long Mnum = 0;
    modS[S.length()] = 0;
    mod10[0] = 1;
    for(int i = 1; i < 200000; i++){
        mod10[i] = (mod10[i-1]*10) % 2019;
    }
    for(int i = S.length()-1; i >= 0; i--){
        long long num = atoi(S.substr(i,1).c_str());
        Mnum += num*mod10[S.length()-1-i];
        modS[i] = Mnum % 2019;
    }
    std::sort(modS,modS + SIZE_OF_ARRAY(modS),std::greater<>());
    int count = 1;
    int ans = 0;
    for(int i = 1; i < S.length()+1; i++){
       // cout << modS[i];
        if(modS[i] == modS[i-1]){
            count++;
        } else {
            
            ans += count*(count-1)/2;
            count = 1;
        }
    }
    ans += count*(count-1)/2;
    cout << ans << endl;
}

Measured memory_bytes: 5284
#include<bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i=0; i<(n); i++)
double pi = acos(-1);
int main(){
    double x1, x2, y1;
    cin >> x1 >> x2 >> y1;
    y1 = (y1 * pi)/180;
    double s = (x1*x2*sin(y1))/2;
  	double g = cos(y1);
    double x3 = sqrt((x1*x1) + (x2*x2) - 2*(x1*x2*g));
    double l = x1 + x2 + x3;
    double h = (2*s)/x1;
    printf("%.6f\n%.6f\n%.6f", s, l, h);
}


Measured memory_bytes: 3432
#include <iostream>
#include <vector>
#include <string>
#include <cmath>

using namespace std;
using ll = long long;
using ull = unsigned long long;

constexpr ll LLINF {1001002003004005006};//ll = 9*LLINF

#define  rep(i,n)   for(int i = 0; i < (n); ++i)
#define rrep(i,n)   for(int i = 1; i <= (n); ++i)
#define drep(i,n)   for(int i = (n)-1; i >= 0; --i)
#define srep(i,s,t) for(int i = s; i < t;  ++i)

#define maxs(x,y) (x=std::max(x,y))
#define mins(x,y) (x=std::min(x,y))

int main() {
  ll N;
  cin >> N;
  vector<ll> H(N);
  rep(i,N) std::cin >> H[i];
  ll max_cnt {0};
  ll tmp_cnt {0};
  drep(i,N-1) {
    if (H[i] >= H[i+1]) {
      ++tmp_cnt;
    } else {
      maxs(max_cnt, tmp_cnt);
      tmp_cnt = 0;
    }
  }
  maxs(max_cnt, tmp_cnt);
  std::cout << max_cnt << '\n';
}


Measured memory_bytes: 1024
#include <iostream>
#include <algorithm>
#include <cmath>
#include <vector>
#include <bits/stdc++.h>

#define FOR(i, a, b) for (int i = (a); i < (b); i++)
#define REP(i, n) for (int i = 0; i < (n); i++)
#define EUC_DIS(x, y) sqrt(x*x + y*y)

typedef unsigned long long ll;

using namespace std;

int main(){

    cin.tie(0);
    ios::sync_with_stdio(false);

    int m, n;
    cin >> n;
    vector<int> a;

    for(int i = 0; i < n; i++){
        int tmp;
        cin >> tmp;
        a.push_back(tmp);
    }

    int sum = 0;
    for(size_t i = 0; i < a.size(); i++){
        sum += a[i]-1;
    }
    cout << sum << '\n';

    return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
using namespace std;
long long f[1000001],w[1000],v[1000];
int n;
long long W;
int main()
{
    cin>>n>>W;
    for (int i=0;i<n;++i) cin>>w[i]>>v[i];
    for (int i=1;i<=10e5;++i) f[i]=10e13;
    for (int i=0;i<n;++i){
        for (int j=10e5;j>0;--j){
            if (j-v[i]>=0&&f[j-v[i]]!=10e13) f[j]=min(f[j],f[j-v[i]]+w[i]);
        }
    }
    for(int i=10e5;i>=1;--i)
        if (f[i]<=W) {
            cout<<i;
            exit(0);
        }
}


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

using namespace std;

typedef long long int64;

int main()
{
  int64 N;
  cin >> N;
  vector< int64 > A(N);
  for(int i = 0; i < N; i++) {
    cin >> A[i];
  }

  auto check = [&](int64 v)
  {
    vector< int64 > B(A);
    for(int i = 0; i < N; i++) B[i] += v;
    int64 sub = 0;
    for(int i = 0; i < N; i++) {
      int64 beet = max(0LL, B[i] - (N - 1));
      if(beet == 0) continue;
      sub = min(v + 1, sub + (beet + N) / (N + 1));
    }
    return (sub <= v);
  };
  int64 low = 0, high = 1LL << 60;
  while(high - low > 0) {
    int64 mid = (low + high) / 2;
    if(check(mid)) high = mid;
    else low = mid + 1;
  }

  for(int64 i = max(0LL, low - 2000000); i <= low; i++) {
    if(check(i)) {
      cout << i << endl;
      return (0);
    }
  }
}


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


int main() {
	while(1){
		int a, b;
		char op;
		cin >> a >> op >> b;
		if(op == '+') cout << a+b <<endl;
		else if(op == '-') cout << a-b <<endl;
		else if(op == '*') cout << a*b <<endl;
		else if(op == '/') cout << a/b <<endl;
		else break;
	}
	return 0;
}

Measured memory_bytes: 1160
N,K = map(int,input().split())
XY = [tuple(map(int,input().split())) for i in range(N)]
xs = []
ys = []
for x,y in XY:
    xs.append(x)
    ys.append(y)
xs.sort()
ys.sort()

ans = float('inf')
for l in range(N-1):
    for r in range(l+1,N):
        w = xs[r] - xs[l]
        for d in range(N-1):
            for u in range(d+1,N):
                h = ys[u] - ys[d]
                if ans <= w*h: continue
                c = 0
                for x,y in XY:
                    if xs[l] <= x <= xs[r] and ys[d] <= y <= ys[u]:
                        c += 1
                        if c >= K:
                            ans = w*h
                            break
print(ans)

Measured memory_bytes: 74628
#include <iostream>
#include <unordered_map>
#include <vector>
#include <set>
#include <algorithm>
#define ll long long
#define pr pair<int,int>
#define all vec.begin(),vec.end()
#define REP(i,a,b) for (int i = a; i < b; i++)
#define fi first
#define se second
#define pushb push_back
#define makep make_pair

using namespace std;

int main(){
	int a,b,c;
	cin >> a >> b >> c;
	string out = (b-a == c - b) ? "YES" : "NO";
	cout << out;
	return 0;
}



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

#define int long long
#define pb push_back
#define ff first
#define ss second
 
bool util(vector<int> &a,vector<int> &b,int n,int m,int mid,int k)
{
    if(mid-1<n && a[mid-1]<=k)
        return 1;
    if(mid-1<m && b[mid-1]<=k)
        return 1;
    for(int i=0;i<mid;i++)
    {
        if(i-1>=0 && mid-1-1>=0 && i-1<n && mid-i-1<m && a[i-1]+b[mid-i-1]<=k)
            return 1;
    }
    return 0;
} 
int32_t main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    
    int n,m,k,ans=0;
    cin>>n>>m>>k;
    
    vector<int> a(n), b(m);
    
    for(int i=0;i<n;i++)
    {
        cin>>a[i];
        if(i != 0)
        {
            a[i] = a[i] + a[i-1];
        }
    }
    
    for(int i=0;i<m;i++)
    {
        cin>>b[i];
        if(i != 0)
        {
            b[i] = b[i] + b[i-1];
        }
    }
    
    int l=0, r=m+n+1;
    
    while(l<=r)
    {
        int mid = l + (r-l)/2;
        mid = l + (r-l)/2;
        
        if(util(a, b, n, m, mid, k))
        {
            ans = max(ans, mid);
            l = mid + 1;
        }
        else
        {
            r = mid - 1;
        }
    }
    
    cout<<ans;
}

Measured memory_bytes: 6368
#include <stdio.h>

int main(void) {
  int N;
  int M;
  scanf("%d", &N);
  scanf("%d", &M);
  int A[N];
  int sum = 0;
  for (int i = 0; i < N; i++) {
    scanf("%d", &A[i]);
    sum += A[i];
  }
  double d = sum / (4.0 * M);
  int cnt = 0;
  for (int i = 0; i < N; i++) {
    if (A[i] >= d) {
      cnt++;
    }
  }
  if (cnt >= M) {
    printf("Yes\n");
  } else {
    printf("No\n");
  }
  return 0;
}

Measured memory_bytes: 1664
#include <iostream>
#include<cstring>

#define MAXN 1000007
using namespace std;
bool vis[MAXN];

int main()
{
    int ans=-1;
    int now=7;
    int k;
    cin>>k;
    vis[now%k]=1;
    memset(vis,0,sizeof vis);
    if(now%k==0) {
        cout << "1\n";
    } else {
        int i=2;
        while(now) {
            now=(now*10+7)%k;
            if(vis[now]) break;
            else if(now==0) {ans=i; break;}
            i++;
            vis[now]=1;
        }
        cout << ans << '\n';
    }
}


Measured memory_bytes: 4476
#include <iostream>
#include <string>
#include <vector>
#include <math.h>
#include <stdio.h>
#include <algorithm>
#include <utility>
#include <functional>
#define rep(i,n) for(int i=0;i<(n);i++)
#define SORT(x) (sort(x.begin(),x.end()))
#define psortsecond(A,N) sort(A,A+N,[](const pii &a, const pii &b){return a.second<b.second;});
#define psortfirst(A,N) sort(A,A+N,[](const pii &a, const pii &b){return a.first<b.first;});
#define All(x) (x).begin(),(x).end()
using namespace std;
using pii  = pair<int,int>;
long long gcd(long long a, long long b){return (b == 0 ? a : gcd(b, a%b));}
long long lcm(long long a, long long b){return a*b/gcd(a,b);}
typedef long long ll;
#define MOD 1000000007
#define EPS 10e-8

int main() {
    char S[19];
    cin >> S;
    int y,x;
    y=x=0;
    rep(i,strlen(S)){
        if(S[i]=='A' || S[i]=='G' || S[i]=='C' || S[i]=='T'){
            x++;
        }
        else{
            if(x>y){
                y=x;
                x=0;
            }
        }
        if(i==strlen(S)-1){
            if(x>y){
                y=x;
                x=0;
            }
        }
    }
    cout << y << endl;
}

Measured memory_bytes: 256
import java.util.*;
import static java.lang.Math.*;
import static java.util.Arrays.*;

public class Main {

	int INF = 1 << 28;
	int[][] dig_num = {{0,1,1,1,1,1,1},
					   {0,0,0,0,1,1,0},
					   {1,0,1,1,0,1,1},
					   {1,0,0,1,1,1,1},
					   {1,1,0,0,1,1,0},
					   {1,1,0,1,1,0,1},
					   {1,1,1,1,1,0,1},
					   {0,1,0,0,1,1,1},
					   {1,1,1,1,1,1,1},
					   {1,1,0,1,1,1,1},
					   {0,0,0,0,0,0,0}};
	
	void run() {
		Scanner sc = new Scanner(System.in);
		for(;;) {
			int n = sc.nextInt();
			if(n == -1) break;
			int[] num = new int[7];
			int p = 10;
			for(int i=0;i<n;i++) {
				int dig = sc.nextInt();
				for(int j=0;j<7;j++) {
					num[j] = (dig_num[p][j]+dig_num[dig][j]) % 2;
					System.out.print(num[j]);
				}
				System.out.println();
				p = dig;
			}
		}
	}

	public static void main(String[] args) {
		new Main().run();
	}
}

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

#define int long long
using namespace std;
#define rep(i, n) for(int i=0;i<(n);++i)
typedef pair<int, int> pii;
const int INF = 1l << 60;
#define u_b upper_bound
#define l_b lower_bound

int N;
int P[22];

signed main() {
    cin >> N;
    rep(i, N) {
        cin >> P[i];
    }
    int ans = 0;
    for (int i = 1; i <= N - 2; ++i) {
        if (max({P[i - 1], P[i], P[i + 1]}) == P[i])continue;
        if (min({P[i - 1], P[i], P[i + 1]}) == P[i])continue;
        ans++;
    }
    cout << ans << endl;
    return 0;
}


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

class Program
{
    static void Main(string[] args)
    {
        // 宮殿の設置候補の数を表します 問題文 N.
        int placeCount = int.Parse(Console.ReadLine());

        // 気温を取得します 問題文 T, A.
        var parameters = Console.ReadLine().Split(' ').Select(x => int.Parse(x)).ToArray();
        
        // 標高を表します 問題文 Hi.
        var elevations = Console.ReadLine().Split(' ').Select(x => int.Parse(x)).ToList();

        // 問題文 T.
        var T = parameters[0];
        // 問題文 A.
        var fetchTemperature = parameters[1] * 1000;
        
        // 何番目に宮殿を建てるかを表します.
        var result = 0;
        // もっとも近い平均気温を求めるために使用します.
        var score = int.MaxValue;

        foreach(var elememt in elevations.Select((e, index) => new { Value = e, Index = index } ))
        {
            // xメートル時の平均気温 T - x * 0.006.
            var temperature = (int)(T * 1000 - elememt.Value * 1000 * 0.006);
            
            // 前回計算したものより差分が小さいかを計算し、前回の評価より良い評価であれば記憶します.
            var _ = Math.Abs(fetchTemperature - temperature);
            if( _ > score ) continue;

            score = _;
            result = elememt.Index + 1;
        }

        Console.WriteLine(result);
    }
}


Measured memory_bytes: 13340