akhauriyash/Code-Regression huggingface dataset:
/* imports all std modules {{{*/
import
  std.algorithm,
  std.array,
  std.ascii,
  std.base64,
  std.bigint,
  std.bitmanip,
  std.compiler,
  std.complex,
  std.concurrency,
  std.container,
  std.conv,
  std.csv,
  std.datetime,
  std.demangle,
  std.encoding,
  std.exception,
  std.file,
  std.format,
  std.functional,
  std.getopt,
  std.json,
  std.math,
  std.mathspecial,
  std.meta,
  std.mmfile,
  std.net.curl,
  std.net.isemail,
  std.numeric,
  std.parallelism,
  std.path,
  std.process,
  std.random,
  std.range,
  std.regex,
  std.signals,
  std.socket,
  std.stdint,
  std.stdio,
  std.string,
  std.system,
  std.traits,
  std.typecons,
  std.uni,
  std.uri,
  std.utf,
  std.uuid,
  std.variant,
  std.zip,
  std.zlib;
/*}}}*/

/+---test
10 4
---+/

void main(string[] args) {
  long H, A;
  readf(" %d %d ", &H, &A);

  (H*1./A).ceil.to!long.writeln;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef pair<double,int> pdi;
typedef pair<double,double> pdd;
typedef pair<double,ll> pdl;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<pii> vii;
typedef vector<pll> vll;
typedef vector<vl> vvl;
typedef vector<vi> vvi;
typedef vector<bool> vb;
typedef vector<vb> vvb;
typedef vector<double> vd;
typedef vector<vd> vvd;
typedef vector<pdd> vdd;
typedef vector<pdi> vdi;
typedef vector<pdl> vdl;
#define fi first
#define se second
const ll INFLL=LLONG_MAX;
const int INF=INT_MAX;
const ll MAXLL=0x3f3f3f3f3f3f3f3f;
const int MAX=0x3f3f3f3f;
#define eb emplace_back
#define emp emplace
#define mp(a,b) make_pair(a,b)
template<class T> using min_heap=priority_queue<T,vector<T>,greater<T> >;
template<class T>
void sort(vector<T>& v){
	sort(v.begin(),v.end());
}
template <class T, class U>
void sort(vector<T>& v,U func){
	sort(v.begin(),v.end(),func);
}
template<class T>
void rsort(vector<T>& v){
	sort(v.rbegin(),v.rend());
}
template <class T>
int lb_index(vector<T>& v,T k){
	return lower_bound(v.begin(),v.end(),k)-v.begin();
}
template <class T>
int ub_index(vector<T>& v,T k){
	return upper_bound(v.begin(),v.end(),k)-v.begin();
}
template<class T>
bool is_sorted(vector<T>& v){
	return is_sorted(v.begin(),v.end());
}
template<class T>
bool sorted(vector<T>& v){
	return is_sorted(v);
}

void solve(){
	int n;
	cin>>n;
	map<string,int>m;
	for(int i=0;i<n;i++){
		string s;
		cin>>s;
		m[s]++;
	}
	cout<<"AC x "<<m["AC"]<<endl;
	cout<<"WA x "<<m["WA"]<<endl;
	cout<<"TLE x "<<m["TLE"]<<endl;
	cout<<"RE x "<<m["RE"]<<endl;
}

int main(){
	ios::sync_with_stdio(0);
	int numberofsubtestcases=1;
//	cin>>numberofsubtestcases;
	while(numberofsubtestcases--){
		solve();
	}
}




Measured memory_bytes: 3656
while True:
    n=int(input())
    if n==0:
        break
    s=0
    y=[]
    for i in range(1,n+1):
        a=int(input())
        y.append(a)
    ymax=max(y)
    ymin=min(y)
    y.remove(ymax)
    y.remove(ymin)
    ysum=sum(y)
    print(int(ysum/(n-2)))


Measured memory_bytes: 5592
N = int(input())
Nprime = [x for x in range(2,N+1) if (x%2 !=0 and x%3!=0 and x%5!=0 and x%7!=0)]
Nprime = [2,3,5,7] + Nprime
F = []
for i,j in enumerate(Nprime):
    number = N
    while number != 0:
        F.append(0)
        F[i] += number//j
        number = number//j

more_two = 0
more_four = 0
ans1 = 0
ans = 0

for i in F:
    if i >= 2:
        more_two += 1
    if i >= 4:
        more_four += 1

for i in F:
    if i >= 4:
        ans1 += (more_four-1)*(more_two-2)
    else:
        continue
    if i >= 14:
        ans += more_four - 1
    if i >= 24:
        ans += more_two - 1
    if i >= 74:
        ans += 1

ans += ans1//2

print(ans)

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

int main() {
  int N;
  cin >> N;
  vector<int> vec(N);
  int a;
  
  for (int i = 0; i < N; i++) {
    cin >> a;
    vec.at(i) = a;
  }
  
  int counter = 0;
  int b, B;
  b = vec.at(0);
  
  for (int i = 0; i < N + 1; i++) {
    if (b == 2) {
      counter++;
      cout << counter << endl;
      break;
    }
    else if (b == 1)
      break;
    else if (b != 2 && b != 1) {
      counter++;
      B = b-1;
      b = vec.at(B);
      continue;
    }
  }
  if (b != 2)
  cout << -1 << endl;
}

Measured memory_bytes: 3796
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <set>
#include <unordered_map>
#include <unordered_set>
#include <numeric>
#include <cmath>
#include <tuple>
#include <bitset>
#include <utility>
#include <climits>
#include <iomanip>

#define push emplace_back
#define each(i, x) for (auto i=0; i < x; i++)
using ull = unsigned long long;
constexpr auto mod = 1000000007;
constexpr auto INF = ULLONG_MAX;

using namespace std;
template <typename T> inline void dump(const T& x) { cout << "[" << x << "]" << endl; }
template <typename T> inline void dump(const vector<T>& x) { for (const auto v : x) { cout << v << " "; } cout << endl; }
template <typename T> inline void sort_asc(vector<T>& x) { std::sort(x.begin(), x.end()); }
template <typename T> inline void sort_desc(vector<T>& x) { std::sort(x.begin(), x.end(), greater<T>()); }
template <typename T> inline T max_value(vector<T>& x) { return *max_element(x.begin(), x.end()); }
template <typename T> inline T min_value(vector<T>& x) { return *min_element(x.begin(), x.end()); }
template <typename T> inline T sum_value(vector<T>& x) { return accumulate(x.begin(), x.end(), 0ULL); }

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

  vector<int> a = {};
  each(i, n) {
    int tmp;
    cin >> tmp;
    a.push(tmp);
  }

  int s = sum_value(a);
  int remain = h - s;

  if (remain > 0) {
    cout << "No" << endl;
  } else {
    cout << "Yes" << endl;
  }

  return 0;
}


Measured memory_bytes: 892
package main

import (
	"bufio"
	"fmt"
	"io"
	"math"
	"os"
	"strconv"
	"strings"

)


func main() {
	solve(os.Stdin, os.Stdout)
}

type ReaderEx struct {
	baseScanner *bufio.Scanner
	words       []string
	nextWordIdx func() int
	initWordIdx func(int)
}

func NewScannerEx(stdin io.Reader) *ReaderEx {
	var this ReaderEx
	var idx int
	var wordsCnt int
	this.baseScanner = bufio.NewScanner(stdin)
	this.baseScanner.Buffer(make([]byte, 0), 1E+11)
	this.nextWordIdx = func() int {
		cur := idx
		idx = (idx + 1) % wordsCnt
		return cur
	}
	this.initWordIdx = func(wc int) {
		idx = 0
		wordsCnt = wc
	}
	return &this
}

func (me *ReaderEx) Scan(doSplit bool) (isScanned bool) {
	isScanned = me.baseScanner.Scan()
	if doSplit {
		me.words = strings.Fields(me.baseScanner.Text())
	} else {
		me.words = []string{me.baseScanner.Text()}
	}
	me.initWordIdx(len(me.words))
	return
}

func (me *ReaderEx) nextBytes() []byte {
	return []byte(me.words[me.nextWordIdx()])
}
func (me *ReaderEx) nextString() string {
	return me.words[me.nextWordIdx()]
}

type StringArray []string

func (me *ReaderEx) nextStringArray() StringArray {
	return me.words[me.nextWordIdx():]
}

func (me StringArray) toStrings() []string {
	return me
}

func (me StringArray) toInts() []int {
	strValues := me.toStrings()
	values := make([]int, len(strValues))
	for i, v := range strValues {
		n, err := strconv.Atoi(v)
		if err != nil {
			panic(err)
		}
		values[i] = n
	}
	return values
}
func (me *ReaderEx) nextInt() int {
	n, err := strconv.Atoi(me.words[me.nextWordIdx()])

	defer func() {
		if err != nil {
			panic(fmt.Sprintf("getInt(%d)", n))
		}
	}()
	return n
}

func pow(x, y, mod int) (ans int) {

	ans = 1
	for bit := 1 << uint(math.Floor(math.Log2(float64(y)))); ; bit >>= 1 {
		if y&bit != 0 {
			ans *= x
			if mod > 0 {
				ans %= mod
			}
		}
		if bit <= 1 {
			return
		}
		ans *= ans
		if mod > 0 {
			ans %= mod
		}
	}
}

type factType struct {
	prime int
	count int
}

func fact(n int) (facts []*factType) {

	for i := 2; i*i <= n; i++ {
		if n%i == 0 {
			fa := factType{prime: i}
			for n%fa.prime == 0 {
				n /= fa.prime
				fa.count++
			}
			facts = append(facts, &fa)
		}
	}
	if n > 1 {
		facts = append(facts, &factType{prime: n, count: 1})
	}
	return facts
}
func dec2bin(n int) (ret []bool) {
	for bit := 1 << uint(math.Floor(math.Log2(float64(n)))); ; bit >>= 1 {
		ret = append(ret, n&bit != 0)

		if bit <= 1 {
			return
		}
	}

}

func abs(v int) int {
	if v < 0 {
		v = -v
	}
	return v
}

func b2i(b bool) (i int) {
	if b {
		i = 1
	} else {
		i = 0
	}
	return
}

func solve(stdin io.Reader, stdout io.Writer) {

	r := NewScannerEx(stdin)
	r.Scan(true)
	a, b := r.nextInt(), r.nextInt()

	minInt := func(a int, vs ...int) int {
		for i := range vs {
			v := &vs[i]
			if a > *v {
				a = *v
			}
		}
		return a
	}

	fmt.Fprintln(stdout, a-minInt(a, 2*b))
}


Measured memory_bytes: 640
#include <iostream>
#include <queue>
#include <vector>
#include <algorithm>

#define INF 0x7fffffff

using namespace std;

typedef pair<int, pair<int,int> > PP;

struct edge{
	int to, D, E;
	edge(int t, int d, int e): to(t), D(d), E(e) {}
};


int main(){
	int N, M, L, A, B, D, E;

	ios::sync_with_stdio(false);
	cin.tie(0);
		
	while( cin>>N>>M>>L, N|M|L ){
		priority_queue<PP,vector<PP>,greater<PP> > que;
		vector<edge> v[105];
		int dh[105][105];
		for(int i=0; i<M; i++){
			cin >> A >> B >> D >> E;
			v[A].push_back( edge(B, D, E) );
			v[B].push_back( edge(A, D, E) );
		}
		fill(dh[0], dh[0]+105*105, INF);
		
		que.push( make_pair(0, make_pair(1,L)) );
		while( !que.empty() ){
			PP p = que.top(); que.pop();
			int psf = p.second.first, pss = p.second.second;
			if( pss >= 0 && p.first < dh[psf][pss] ){
				dh[psf][pss] = p.first;
				for(int i=0; i<v[psf].size(); i++){
					edge e = v[psf][i];
					que.push( make_pair(p.first + e.E, make_pair(e.to, pss)) );
					que.push( make_pair(p.first, make_pair(e.to, pss-e.D)) );
				}
			}
		}

		int ans = INF;
		for(int i=0; i<=L; i++)
			ans = min(ans, dh[N][i] );

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

Measured memory_bytes: 11840
// copied by Nurstan Duisengaliev
// skatal
#include <bits/stdc++.h>
//#include <ext/pb_ds/assoc_container.hpp>
//#include <ext/pb_ds/tree_policy.hpp> 
 
#define ll long long
#define all(x) x.begin(), x.end()
#define in insert
#define mp make_pair
#define F first
#define S second
#define ppf pop_front
#define pb push_back
#define ppb pop_back
#define pf push_front
#define pii pair <int, int>
#define boost() ios_base::sync_with_stdio(0), cin.tie(0)
#define sz(x) (int)x.size()
 
using namespace std;
//using namespace __gnu_pbds;

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

const int N = (int)2e5 + 123;
const int mod = (int)1e9 + 7;
const ll INF = (ll)1e18 + 7;
int a[N];
void solve () {
	int n, k;
	cin >> n >> k;
	for (int i = 1; i <= n; i ++) {
		cin >> a[i];
	}
	sort (a + 1, a + n + 1);
	ll sum = 0;
	for (int i = 1; i <= k; i ++) {
		sum += a[i];
	}
	cout << sum;
}   	
 
main () {
//	freopen (".in", "r", stdin);
//	freopen (".out", "w", stdout);
	boost ();
	int TT = 1;
//    cin >> TT;
	while (TT --) {
		solve ();
	}
	return 0;	
}

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

int main(int argc, char *argv[]) {
  std::string a, b;
  std::cin >> a >> b;

  if (a.size() < b.size()) {
    std::cout << "LESS" << std::endl;
    return 0;
  } 
  if (a.size() > b.size()) {
    std::cout << "GREATER" << std::endl;
    return 0;
  } 

  if (a > b)
    std::cout << "GREATER" << std::endl;
  if (a < b)
    std::cout << "LESS" << std::endl;
  if (a == b)
    std::cout << "EQUAL" << std::endl;
}


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

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

using namespace std;

int n, m, q;
vector<int> a, b, c, d;

long long score(vector<int> A){
    long long ans = 0;
    REP(i,q){
        if(A[b[i]] - A[a[i]] == c[i]) ans += d[i];
    }
    return ans;
}

long long dfs(vector<int> &A){
    if(A.size() == n){
        return score(A);
    }

    int prev = (A.empty()? 1 : A.back());
    long long res = 0;

    for(int i = prev; i <= m; i++){
        A.push_back(i);
        res = max(res, dfs(A));
        A.pop_back();
    }
    return res;
}



int main(void){
    cin >> n >> m >> q;
    a.resize(q); b.resize(q); c.resize(q); d.resize(q);
    REP(i,q){
        cin >> a[i] >> b[i] >> c[i] >> d[i];
        a[i]--;
        b[i]--;
    }

    vector<int> A;
    cout << dfs(A) << endl;
}

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

int main(){
    int N; cin >> N;
    int temp=0;
    int maxi=0;
    vector<int> H(N);

    rep(i,N){
        cin >> H[i];
    }

    rep(i,N-1){

        if(H[i] >= H[i+1]){
            temp++;
        }

        else{
            maxi =  max(maxi,temp);
            temp =0;
        }

    }

    cout << max(maxi,temp) << endl;
}

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

using namespace std;

#define INF 1000007
#define MOD 1000000007
#define maxn 1e9
#define int long long int
#define FOR(i, a, b) for (int i = (a); i < (b); i++)
#define rep(i, n) FOR(i, 0, n)

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

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

int mpow(int N, int P, int M) //繰り返し自乗法
{
    if (P == 0)
        return 1;
    if (P % 2 == 0) {
        int t = mpow(N, P / 2, M);
        return t * t % M;
    }
    return N * mpow(N, P - 1, M) % M;
}

signed main() {
    int M1,M2,D1,D2;
    cin >> M1 >> D1 >> M2 >> D2;
    if((M1+1 == M2 )&&(D2 == 1)){
        cout << "1" << endl;
    }else{
        cout << "0" << endl;
    }

}


Measured memory_bytes: 256
#include<cstdio>
#include<cstdlib>
#include<string>
#include<cmath>
#include<cstdlib>
#include<climits>
#include<iostream>
#include<sstream>
#include<utility>
#include<map>
#include<vector>
#include<queue>
#include<algorithm>
#include<set>
#include<stack>
#include<functional>
#include<ios>
#include<iomanip>

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


int main()
{
	string S;
	cin>>S;
	stack<char>A;
	for(int i=0;i<S.length();i++)
	{
		if(S[i]=='S')
		{
			A.push('S');
		}
		else
		{
			if(A.empty()||A.top()=='T')A.push('T');
			else A.pop();
		}
	}
	cout<<A.size()<<endl;
}

Measured memory_bytes: 644
#include <vector>
#include <map>
#include <set>
#include <stack>
#include <queue>
#include <algorithm>
#include <numeric>
#include <sstream>
#include <iostream>
#include <iomanip>
#define _USE_MATH_DEFINES
#include <cmath>
#include <climits>
#include <cstdlib>
#include <cstring>
#include <cfloat>
#include <cmath>
#include <ctime>
#include <cstdio>
#include <cassert>
using namespace std;

#define EPS 1e-12
#define ull unsigned long long
#define ll long long
#define VI vector<ll>
#define PII pair<ll, ll> 
#define VVI vector<vector<ll> >
#define REP(i,n) for(int i=0,_n=(n);(i)<(int)_n;++i)
#define RANGE(i,a,b) for(int i=(int)a,_b=(int)(b);(i)<_b;++i)
#define FOR(i,c) for(__typeof((c).begin())i=(c).begin();i!=(c).end();++i)
#define ALL(c) (c).begin(), (c).end()
#define ALLR(c) (c).rbegin(), (c).rend()
#define PB push_back
#define MP(a, b) make_pair(a, b)
#define POPCOUNT __builtin_popcount
#define POPCOUNTLL __builtin_popcountll
#define CLEAR(table, v) memset(table, v, sizeof(table));
#define PRINT1(table, D0) REP(d0, D0) cout<<table[d0]<<" "; cout<<"\n";
#define PRINT2(table, D0, D1) REP(d0, D0) { REP(d1, D1) cout<<table[d0][d1]<<" "; cout<<"\n"; }
#define PRINT3(table, D0, D1, D2) REP(d0, D0) { REP(d1, D1) { REP(d2, D2) cout<<table[d0][d1][d2]<<" "; cout<<"\n"; } cout<<"\n"; }
#define UNIFORM_DOUBLE(a, b) (((b-a)*(double)rand()/RAND_MAX)+a) // [a, b) 
#define UNIFORM_LL(a, b) (ll)UNIFORM_DOUBLE(a, b) // [a, b) 
#define IN(v, lo, hi) ((lo)<=(v) && (v)<(hi))
#define DD(v) cout<<#v<<": "<<v<<endl
template <typename T0, typename T1> std::ostream& operator<<(std::ostream& os, const map<T0, T1>& v) { for( typename map<T0, T1>::const_iterator p = v.begin(); p!=v.end(); p++ ){os << p->first << ": " << p->second << " ";} return os; }
template <typename T0, typename T1> std::ostream& operator<<(std::ostream& os, const pair<T0, T1>& v) { os << v.first << ": " << v.second << " "; return os; }
template <typename T> std::ostream& operator<<(std::ostream& os, const vector<T>& v) { for( int i = 0; i < (int)v.size(); i++ ) { os << v[i] << " "; } return os; }
template <typename T> std::ostream& operator<<(std::ostream& os, const vector<vector<T> >& v) { for( int i = 0; i < (int)v.size(); i++ ) { os << v[i] << endl; } return os; }
template <typename T> std::ostream& operator<<(std::ostream& os, const set<T>& v) { vector<T> tmp(v.begin(), v.end()); os << tmp; return os; }
template <typename T> std::ostream& operator<<(std::ostream& os, const deque<T>& v) { vector<T> tmp(v.begin(), v.end()); os << tmp; return os; }

#define MOD 1000000007LL
#define INF (1LL<<60)

int main() {
	//ios::sync_with_stdio(false);
	ll a,b,c;
	while(cin>>a>>b>>c) {
		stringstream ss;
		ss<<a<<b<<c;
		ll v;
		ss>>v;
		
		cout<<(v%4==0 ? "YES":"NO")<<endl;
	}
	
	return 0;
}


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

#define REP(i,n) for(int i=0;i<(int)(n);++i)
#define FOR(i,c) for(__typeof((c).begin())i=(c).begin();i!=(c).end();++i)
#define ALL(c) (c).begin(), (c).end()
#define chmax(a,b) (a<b?(a=b,1):0)
#define chmin(a,b) (a>b?(a=b,1):0)
#define valid(y,x,h,w) (0<=y&&y<h&&0<=x&&x<w)
const int INF = 1<<29;
const double EPS = 1e-8;
const double PI = acos(-1);
typedef long long ll;
typedef pair<int,int> pii;

int main() {
  string s;
  while(cin >> s) {
    map<char, int> mp;
    string fuga = "AIDUNYAN";
    FOR(it, fuga) mp[*it]++;
    string hoge = "AIZUNYAN";
    for (int i=0; i<=(int)s.size()-8; ++i) {
      map<char, int> mp2;
      REP(j,8) {
        mp2[s[i+j]]++;
      }
      if (mp == mp2) {
        REP(j,8) s[i+j] = hoge[j];
        i += 7;
      }
    }
    cout << s << endl;
  }
}

Measured memory_bytes: 1196
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<ll, ll>;
using vi = vector<ll>;
using vvi = vector<vi>;
using vb = vector<bool>;
using vs = vector<string>;
using vp = vector<pii>;
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define sz(x) (ll)((x).size())
#define all(x) (x).begin(), (x).end()
#define each(a, x) for (auto&& a : (x))
#define _overload4(_1, _2, _3, _4, name, ...) name
#define rep1(n) rep2(_, n)
#define rep2(i, n) rep3(i, 0, n)
#define rep3(i, a, n) rep4(i, a, n, 1)
#define rep4(i, a, n, s) for (ll i = (a); i < (n); i += (s))
#define rep(...) _overload4(__VA_ARGS__, rep4, rep3, rep2, rep1)(__VA_ARGS__)
const int INF = 1e9;
const int MOD = 1e9 + 7;
const double EPS = 1e-9;
const double PI = acos(-1.0);
const int dx[] = {1, 0, -1, 0, 1, 1, -1, -1};
const int dy[] = {0, 1, 0, -1, 1, -1, 1, -1};
template<typename T> inline void chmax(T& a, const T& b) {if (a < b) a = b;}
template<typename T> inline void chmin(T& a, const T& b) {if (a > b) a = b;}
template<typename T> inline void print(const T& x) {cout << x << "\n";}
struct Init {Init() {cin.tie(0); ios::sync_with_stdio(0); cout << fixed << setprecision(10);}} init;

int main() {
    ll n;
    cin >> n;
    vi a(n), b(n), c(n);
    rep(i, n) cin >> a[i];
    rep(i, n) cin >> b[i];
    rep(i, n) cin >> c[i];
    sort(all(a));
    sort(all(c));
    ll res = 0;
    rep(j, n) {
        ll ai = lower_bound(all(a), b[j]) - a.begin();
        ll ck = n - (upper_bound(all(c), b[j]) - c.begin());
        res += ai * ck;
    }
    print(res);
}

Measured memory_bytes: 2560
#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
#define PI 3.141592653589793238
int main()
{
    // #ifndef ONLINE_JUDGE
    // freopen("F:/cpp/input.txt", "r", stdin);
    // freopen("F:/cpp/output.txt", "w", stdout);
    // #endif
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    ll h1, m1, h2, m2, k, t1, t2;
    cin >> h1 >> m1 >> h2 >> m2 >> k;
    t1 = h1*60 + m1;
    t2 = h2*60 + m2;
    if (k <= t2-t1)
    cout << t2 - t1 - k;
    else
    cout << "0\n";
    return 0;
}

Measured memory_bytes: 3640
/*
                                             ::                     ::
                                             ':                     :
                                              :.                    :
                                           ;' ::                   ::  '
                                          .'  ';                   ;'  '.
                                         ::    :;                 ;:    ::
                                         ;      :;.             ,;:     ::
                                         :;      :;:           ,;"      ::
                                         ::.      ':;  ..,.;  ;:'     ,.;:
                                          "'"...   '::,::::: ;:   .;.;""'
                                              '"""....;:::::;,;.;"""
                                          .:::.....'"':::::::'",...;::::;.
                                         ;:' '""'"";.,;:::::;.'""""""  ':;
                                        ::'         ;::;:::;::..         :;
                                       ::         ,;:::::::::::;:..       ::
                                       ;'     ,;;:;::::::::::::::;";..    ':.
                                      ::     ;:"  ::::::"""'::::::  ":     ::
                                       :.    ::   ::::::;  :::::::   :     ;
                                        ;    ::   :::::::  :::::::   :    ;
                                         '   ::   ::::::....:::::'  ,:   '
                                          '  ::    :::::::::::::"   ::
                                             ::     ':::::::::"'    ::
                                             ':       """""""'      ::
                                              ::                   ;:
                                              ':;                 ;:"


                                                     P_r_A_d_Y
*/
#include<bits/stdc++.h>
using namespace std;
#define int long long int
#define endl "\n"
#define mod 1000000007
#define inf 1e18
const int N = 300005;
#define fastIO ios_base::sync_with_stdio(false); cin.tie(NULL);
void cs(int &x)
{
    cout << "Case #" << x << ": ";
}
bool cmp(string a, string b)
{
    return a + b < b + a;
}

int32_t main()
{
    fastIO;
    // int t; cin >> t;
    // int x = 1;
    // while (t--)
    // {

        int k,a,b;cin>>k>>a>>b;
        int r=a%k;
        if(r==0 || b%k==0)
            cout<<"OK"<<endl;
        else
        {
            if(a/k<b/k)
                cout<<"OK"<<endl;
            else
                cout<<"NG"<<endl;
        }
    //}
    return 0;
}

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

#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define all(x) (x).begin(), (x).end()
typedef long long ll;
template <class T>
bool chmax(T &a, const T &b)
{
    if (a < b)
    {
        a = b;
        return 1;
    }
    return 0;
}
template <class T>
bool chmin(T &a, const T &b)
{
    if (b < a)
    {
        a = b;
        return 1;
    }
    return 0;
}

int N, C;
int imos[30][101010];

int main() {
    cin >> N >> C;
    rep(i, N) {
        int s, t, c; cin >> s >> t >> c;
        s--; c--;
        imos[c][s]++;
        imos[c][t]--;
    }
    rep(c, C) rep(i, 101009) imos[c][i+1] += imos[c][i];
    rep(c, C) rep(i, 101010) if (imos[c][i]) imos[c][i] = 1;

    int ans = 0;
    rep(i, 101010) {
        int cnt = 0;
        rep(c, C) cnt += imos[c][i];
        ans = max(ans, cnt);
    }
    cout << ans << endl;
}

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

using ll = long long int;

int main() {
	
	ll n, capacity;
	cin>>n>>capacity;

	vector<ll> wt(n), price(n);
	for (ll i = 0; i < n; i++) {
		cin>>wt[i]>>price[i];
	}

	ll DP[n+1][capacity+1];
	memset(DP, 0, sizeof(DP));

	for (ll i = 1; i <= n; i++) {
		for (ll cur_cap = 1; cur_cap <= capacity; cur_cap++) {

			if(wt[i-1] > cur_cap) DP[i][cur_cap] = DP[i-1][cur_cap];
			else DP[i][cur_cap] = max(price[i-1] + DP[i-1][cur_cap-wt[i-1]], DP[i-1][cur_cap]);
		}
	}

	// for (ll i = 0; i <= n; i++) {
	// 	for (ll j = 0; j < capacity; j++) 
	// 		cout<<DP[i][j]<<" ";
	// 	cout<<"\n";
	// }

	cout<<DP[n][capacity];
	return 0;
}

Measured memory_bytes: 79104
#include<cstdio>
#include<string>

using namespace std;

int main(){
    long int N;
    scanf("%ld", &N);
    char s[N][11];
    long int a[5] = {0,0,0,0,0};
    for(int i = 0; i < N; i++){
        scanf("%s", s[i]);
    }
    for(int i = 0; i < N; i++){
        if (s[i][0]=='M') a[0]++;
        else if (s[i][0]=='A') a[1]++;
        else if (s[i][0]=='R') a[2]++;
        else if (s[i][0]=='C') a[3]++;
        else if (s[i][0]=='H') a[4]++;
    }
    // for(int i = 0; i < 5; i++){
    //     printf("%ld ", a[i]);
    // }
    // puts("");
    long int ans = 0;
    for(int i = 0; i < 3; i++){
        for(int j = i+1; j < 4; j++){
            for(int k = j+1; k < 5; k++){
                ans += a[i] * a[j] * a[k];
                // printf("%ld\n", ans);
                // printf("%d %d %d\n", i,j,k);
            }
            
        }
        
    }
    // puts("");
    printf("%ld\n", ans);
}

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

int main()
{
	int p_taro = 0;
	int p_hanako = 0;
	string taro;
	string hanako;
	int n = 0;

	cin >> n;
	
	for (int i = 0; i < n; i++) {
		cin >> taro;
		cin >> hanako;

		if (taro > hanako) {
			p_taro += 3;
		} else if (taro < hanako) {
			p_hanako += 3;
		} else if (taro == hanako) {
			p_taro++;
			p_hanako++;
		}

	}

	cout << p_taro << ' ' << p_hanako << '\n';
	return 0;
}


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

namespace Algorithm
{
    class Program
    {
        static void Main(string[] args)
        {
            var s = Console.ReadLine();
            var odd = new char[] { 'R', 'U', 'D' };
            var eve = new char[] { 'L', 'U', 'D' };

            for (var i = 0; i < s.Length; i++)
            {
                if (!(i % 2 == 0 && odd.Contains(s[i]))
                    && !(i % 2 == 1 && eve.Contains(s[i])))
                {
                    Console.WriteLine("No");
                    return;
                }
            }

            Console.WriteLine("Yes");
        }
    }
}


Measured memory_bytes: 13268
#define _CRT_SECURE_NO_WARNINGS
#pragma GCC target("avx")
#pragma GCC optimize("O3")
#include <algorithm>
#include <bitset>
#include <cassert>
#include <cfloat>
#include <climits>
#include <cmath>
#include <complex>
#include <ctime>
#include <deque>
#include <fstream>
#include <functional>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <list>
#include <map>
#include <memory>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <string>
#include <string.h>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>
#define rep(i,n) for(int i=0;i<(lint)(n);i++)
#define REP(i,n) for(int i=1;i<=(lint)(n);i++)
#define all(V) V.begin(),V.end()
#define stackReplaceBegin(size)\
	void* p=malloc(size);\
	esp_new=(lint)p+size-1;\
	void * stack_extend_memory_ = malloc(size);\
	void * stack_extend_origin_memory_;\
	char * stack_extend_dummy_memory_ = (char*)alloca((1+(int)(((long long)stack_extend_memory_)&127))*16);\
	*stack_extend_dummy_memory_ = 0;\
	asm volatile("mov %%rsp, %%rbx\nmov %%rax, %%rsp":"=b"(stack_extend_origin_memory_):"a"((char*)stack_extend_memory_+(size)-1024));
typedef long long lint;
typedef unsigned long long ulint;
typedef std::pair<int, int> P;
constexpr int INF = INT_MAX/2;
constexpr lint LINF = LLONG_MAX/2;
constexpr double eps = DBL_EPSILON;
constexpr double PI = 3.141592653589793238462643383279;
lint esp_new;
template<class T>
class prique :public std::priority_queue<T, std::vector<T>, std::greater<T>> {};
template <class T, class U>
inline bool chmax(T& lhs, const U& rhs) {
	if (lhs < rhs) {
		lhs = rhs;
		return 1;
	}
	return 0;
}
template <class T, class U>
inline bool chmin(T& lhs, const U& rhs) {
	if (lhs > rhs) {
		lhs = rhs;
		return 1;
	}
	return 0;
}
inline lint gcd(lint a, lint b) {
	while (b) {
		lint c = a;
		a = b; b = c % b;
	}
	return a;
}
inline lint lcm(lint a, lint b) {
	return a / gcd(a, b) * b;
}
bool isprime(lint n) {
	if (n == 1)return false;
	for (int i = 2; i * i <= n; i++) {
		if (n % i == 0)return false;
	}
	return true;
}
template<typename T>
T mypow(T a, unsigned int b) {
	T res(1),now(a);
	while(b){
		if(b&1)res*=now;
		b>>=1;
		now*=a;
	}
	return res;
}
lint modpow(lint a,unsigned int b,unsigned int mod){
	lint res(1),now(a%mod);
	while(b){
		if(b&1){
			res*=now;
			res%=mod;
		}
		b>>=1;
		now*=now;
		now%=mod;
	}
	return res;
}
template<typename T>
void printArray(std::vector<T>& vec) {
	rep(i, (int)vec.size() - 1)std::cout << vec[i] << " ";
	if(!vec.empty())std::cout << vec.back() << std::endl;
}
template<typename T>
void printArray(T l, T r) {
	T rprev = r;
	rprev--;
	for (T i = l; i != rprev; i++) {
		std::cout << *i << " ";
	}
	std::cout << *rprev << std::endl;
}
int dp[100010];
int a[]={1,6,36,216,1296,1296*6,1296*36,9,81,729,729*9,729*81};
int main(){
	int n;
	std::cin>>n;
	REP(i,n){
		dp[i]=INF;
		rep(j,12){
			if(0<=i-a[j])chmin(dp[i],dp[i-a[j]]+1);
		}
	}
	std::cout<<dp[n]<<std::endl;
	return 0;
}

Measured memory_bytes: 3996
using System;
using System.Linq;
using System.Diagnostics;
using System.Collections.Generic;
using static System.Math;

class P
{
    static void Main()
    {
        char[] s = Console.ReadLine().ToArray();
        string t = Console.ReadLine();
        bool flag = false;
        for (int i = s.Length - t.Length; i >= 0; i--)
        {
            if (flag) goto end;
            for (int j = 0; j < t.Length; j++)
            {
                if (s[i + j] != '?' && s[i + j] != t[j]) goto end;
            }
            for (int j = 0; j < t.Length; j++)
            {
                s[i + j] = t[j];
            }
            flag = true;
            end:;
        }
        if (flag) Console.WriteLine(string.Join("", s).Replace('?', 'a'));
        else Console.WriteLine("UNRESTORABLE");
    }
}

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

int n, k;

int main() {
  cin >> n >> k;
  vector<int> p(n);
  rep (i, n) {
    cin >> p[i];
  }
  sort(p.begin(), p.end());
  int ans = 0;
  rep (i, k) {
    ans += p[i];
  }
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 3628
// C++ includes used for precompiling -*- C++ -*-

// Copyright (C) 2003-2013 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library.  This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.

// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.

// Under Section 7 of GPL version 3, you are granted additional
// permissions described in the GCC Runtime Library Exception, version
// 3.1, as published by the Free Software Foundation.

// You should have received a copy of the GNU General Public License and
// a copy of the GCC Runtime Library Exception along with this program;
// see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
// <http://www.gnu.org/licenses/>.

/** @file stdc++.h
 *  This is an implementation file for a precompiled header.
 */

// 17.4.1.2 Headers

// C
#ifndef _GLIBCXX_NO_ASSERT
#include <cassert>
#endif
#include <cctype>
#include <cerrno>
#include <cfloat>
#include <ciso646>
#include <climits>
#include <clocale>
#include <cmath>
#include <csetjmp>
#include <csignal>
#include <cstdarg>
#include <cstddef>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>

#if __cplusplus >= 201103L
#include <ccomplex>
#include <cfenv>
#include <cinttypes>
// #include <cstdalign>
#include <cstdbool>
#include <cstdint>
#include <ctgmath>
#include <cwchar>
#include <cwctype>
#endif

// C++
#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <typeinfo>
#include <utility>
#include <valarray>
#include <vector>

#if __cplusplus >= 201103L
#include <array>
#include <atomic>
#include <chrono>
#include <condition_variable>
#include <forward_list>
#include <future>
#include <initializer_list>
#include <mutex>
#include <random>
#include <ratio>
#include <regex>
#include <scoped_allocator>
#include <system_error>
#include <thread>
#include <tuple>
#include <typeindex>
#include <type_traits>
#include <unordered_map>
#include <unordered_set>
#endif

using namespace std;
typedef long long ll;

ll a, b, c, n, k, x;
string s;

int main()
{
  int n, a, b;
  cin >> n >> a >> b;
  int r = 0;
  for (int i = 1; i <= n; i++)
  {
    int c = 0, t = i;
    for (int j = 0; j < 5; j++)
    {
      c += t % 10;
      t /= 10;
    }
    if (a <= c && c <= b)
      r += i;
  }
  cout << r << endl;
}


Measured memory_bytes: 256
#include <map>
#include <set>
#include <list>
#include <cmath>
#include <deque>
#include <stack>
#include <queue>
#include <bitset>
#include <cstdio>
#include <string>
#include <vector>
#include <random>
#include <chrono>
#include <utility>
#include <numeric>
#include <cstdlib>
#include <cstring>
#include <climits>
#include <sstream>
#include <assert.h>
#include <iostream>
#include <iomanip>
#include <algorithm>
#include <unordered_map>
using namespace std;

void __print(int x) {cerr << x;}
void __print(long x) {cerr << x;}
void __print(float x) {cerr << x;}
void __print(double x) {cerr << x;}
void __print(unsigned x) {cerr << x;}
void __print(long long x) {cerr << x;}
void __print(long double x) {cerr << x;}
void __print(unsigned long x) {cerr << x;}
void __print(unsigned long long x) {cerr << x;}
void __print(char x) {cerr << '\'' << x << '\'';}
void __print(bool x) {cerr << (x ? "true" : "false");}
void __print(const char *x) {cerr << '\"' << x << '\"';}
void __print(const string &x) {cerr << '\"' << x << '\"';}

template<typename T, typename V> void __print(const pair<T, V> &x) {cerr << '{'; __print(x.first); cerr << ','; __print(x.second); cerr << '}';}
template<typename T>void __print(const T &x) {int f = 0; cerr << '{'; for (auto &i : x) cerr << (f++ ? "," : ""), __print(i); cerr << "}";} void _print() {cerr << "]\n";}
template <typename T, typename... V>void _print(T t, V... v) {__print(t); if (sizeof...(v)) cerr << ", "; _print(v...);}
#ifdef HOME
#warning CHECK int:ll::INT_MAX:LLONG_MAX
#define maxn 20
#define debug(x...) cerr << "[" << #x << "] = ["; _print(x)
#else
#define maxn 2000006
#define gcd __gcd
#define debug(x...)
#endif

#define ff first
#define endl '\n'
#define ss second
#define inf 0x3f3f3f3f
#define MOD 1000000007
#define PI 3.14159265358979323846264338327950L
#define f(i,x,n) for(int i=x;i<=n;i++)
#define fr(i,x,n) for(int i=x;i>=n;i--)
struct _ { ios_base::Init i; _() { ios_base::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL); } } _;

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


int main() {

	int k, x; cin >> k >> x;
	cout << ((500 * k >= x) ? "Yes" : "No");

	return 0;
}

Measured memory_bytes: 3008
#include <bits/stdc++.h>
using namespace std;
#define REP(i, n) for(int i = 0; i < (int)(n); i++)

int main() {
    int n;
    cin >> n;
    map<string, int> rating;
    int ans_min = 0, ans_add = 0;
    REP(i, n) {
        int a;
        cin >> a;
        if(a < 400)
            rating["Gray"]++;
        else if(a < 800)
            rating["Brown"]++;
        else if(a < 1200)
            rating["Green"]++;
        else if(a < 1600)
            rating["Cyan"]++;
        else if(a < 2000)
            rating["Blue"]++;
        else if(a < 2400)
            rating["Yellow"]++;
        else if(a < 2800)
            rating["Orange"]++;
        else if(a < 3200)
            rating["Red"]++;
        else
            ans_add++;
    }
    for(auto x : rating) {
        if(x.second > 0) ans_min++;
    }
    cout << (ans_min ? ans_min : 1) << ' ' << ans_min + ans_add << endl;
}


Measured memory_bytes: 256
def binp( n ):
    global N
    data = []
    for i in range(N):
        data.append( n % 2)
        n //= 2
    return data

def honest(pat):
    c = 0
    for p in pat:
        if p == 1:
            c+=1
    return c

N = int(input())
Data = [[] for _ in range(N)]
for i in range(N):
    An = int(input())
    for _ in range(An):
        Data[i].append(list(map(int,input().split())))

ans = 0
for p in range(2**N):
    pat = binp(p)
    #print(pat)
    f = True
    for i in range(N):
        if pat[i] == 1:
            for x,y in Data[i]:
                #print('---',i,x,y)
                if (y == 0 and pat[x-1] == 0) or (y == 1 and pat[x-1] == 1):
                    pass
                    #print('OK')
                else:
                    f = False
                    break
            if f == True:
                pass
            else:
                break
    if f :
        ans = max(ans,honest(pat))
print(ans)


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

namespace AtCoder
{
    class Program
    {
        private static string Read() { return Console.ReadLine(); }
        private static int ReadInt() { return int.Parse(Read()); }
        private static long ReadLong() { return long.Parse(Read()); }
        private static int[] ReadInts() { return Array.ConvertAll(Read().Split(), int.Parse); }
        private static long[] ReadLongs() { return Array.ConvertAll(Read().Split(), long.Parse); }

        static int Partner(int n)
        {
            long N = 2;
            while (N <= n) { N <<= 1; }
            return (int)(N - n);
        }

        static int Solve(int N, int[] A)
        {
            var counts = new Dictionary<int, int>();
            foreach (int a in A)
            {
                if (!counts.ContainsKey(a)) { counts[a] = 0; }
                ++counts[a];
            }
            int ans = 0;
            foreach (int i in counts.Keys.OrderByDescending(i => i).ToArray())
            {
                int j = Partner(i);
                while (counts[i] > 0)
                {
                    --counts[i];
                    if (counts.ContainsKey(j) && counts[j] > 0)
                    {
                        --counts[j];
                        ++ans;
                    }
                }
            }
            return ans;
        }

        static void Main(string[] args)
        {
            int N = ReadInt();
            int[] A = ReadInts();
            Console.WriteLine(Solve(N, A));
        }
    }
}


Measured memory_bytes: 42816
ii = lambda : int(input())
mi = lambda : map(int,input().split())
li = lambda : list(map(int,input().split()))

n,m = mi()
A = [[] for _ in range(n)]

for i in range(m):
    a,b = mi()
    A[a-1].append(b-1)
    A[b-1].append(a-1)

inf = 10**9
dp = [inf]*n
dp[0] = 1

from collections import deque

q = deque()
q.append((0,0))
ans = [0]*n
ans[0] = "Yes"
while q:
    kazu,iti = q.popleft()
    kazu += 1
    for l in A[iti]:
        if dp[l] > kazu:
            dp[l] = kazu
            ans[l] = iti + 1
            q.append((kazu,l))

for i in range(n):
    if dp[i] == inf:
        print("No")
        exit()
for i in range(n):
    print(ans[i])





Measured memory_bytes: 39776
import Data.List
import qualified Data.ByteString.Char8 as B
import Data.Maybe (fromJust)

main :: IO ()
main = do
    _ <- B.getLine
    as <- map (fst . fromJust . B.readInt) . B.words <$> B.getLine
    let (bs, cs) = partition (< 3200) as
        c = length $ nub $ map (`div` 400) bs
    putStrLn $ show (max c 1) ++ " " ++ show (c + length cs)


Measured memory_bytes: 508
#include <iostream>
#include <bits/stdc++.h>
#define int long long
#define sc(x) scanf("%lld",&(x));
#define sci(x) scanf("%d",&(x));
#define si signed
#define P pair<int,int>
#define fi first
#define se second

using namespace std;
int n,m;
int A[299995];
int B[200005];
si main() {
    sc(n)
    int x;
    for(int i=0;i<n;i++){
        sc(B[i])
        A[B[i]]++;
    }
    int ans =0;
    for(int i=0;i<=200000;i++){
        if(A[i]>=2){
            ans+=A[i]*(A[i]-1)/2;
        }
    }
    int t=0;
    for(int i=0;i<n;i++){
        t=ans;
        if(A[B[i]]==2){
            t = ans - 1;
        }else if(A[B[i]]>2){
            x = A[B[i]];
            t = ans - x*(x-1)/2 + (x-1)*(x-2)/2;
        }
        cout<<t<<'\n';
    }

    return 0;
}


Measured memory_bytes: 4736
N, M = map( int, input().split())
A = [ list( map( int, input().split())) for _ in range(N)]
A.sort()
ans = 0
now = 0
for i in range(N):
    if now + A[i][1] <= M:
        ans += A[i][0]*A[i][1]
        now += A[i][1]
    else:
        ans += A[i][0]*(M - now)
        break
print( ans)

Measured memory_bytes: 27760
#include <bits/stdc++.h>
using namespace std;
#define mp make_pair
#define pb push_back
#define scanVec(vec , n) for(int i = 0; i < n ; i++){ cin>>vec[i];} 
#define printVec(vec , n) for(int i = 0; i < n ; i++){ cout<<vec[i]<<" ";} cout<<endl;
#define S second
#define F first
#define SZ(x) (int)x.size()
typedef long long ll;
const int  MOD = 1e9 + 7;
const int  N = 1e5 + 7;

int main(){
    ios::sync_with_stdio(0);  cin.tie(0); cout.tie(0);
    int m , n;
    cin>>m>>n;
    cout<<(m ==n ? "Yes" :"No")<<endl;
    
    return 0;
}


Measured memory_bytes: 256
/* ****AWARE**** */
#include<bits/stdc++.h>
#include <limits.h> 
#define cut ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0)
#define ll          long long
#define pb          push_back
#define endl        '\n'
#define pii         pair< ll, ll>
#define vi          vector< ll>
#define all(a)      (a).begin(),(a).end()
#define F           first
#define S           second
#define sz(x)       (ll)x.size()
#define hell        1000000007
#define rep(i,a,b)  for(  ll i=a;i<b;i++)
#define lbnd        lower_bound
#define ubnd        upper_bound
#define bs          binary_search
#define mp13       make_pair
using namespace std; 
#define MAX  3000000000
#define MODULO 2
using namespace std;   
#define hell 1000000007 
#define hell1 30000000000000000
#define time        cerr << "\nTime elapsed: " << 1000 * clock() / CLOCKS_PER_SEC << "ms\n";
#define mysizeof(i) (char*)(&i+1)-(char *)(&i);
ll T;

void solve()
{ long long int a=-1,b=-1,c=-1,n,w,i,j,ans=0,ans1,ans2;
  cin>>n>>w;
  vector<pair<ll,ll>>v;
for(i=0;i<n;i++)
{
   cin>>a>>b;
   v.push_back(make_pair(a,b));

}
 vector<ll>dp(w+1,0);
for(i=0;i<n;i++)
{
   for(j=w;j>=v[i].first;j--)
   {
   	dp[j]=max(dp[j],dp[j-v[i].first]+v[i].second);
   }
}
ll mx=0;
for(i=0;i<=w;i++)
{
	mx=max(dp[i],mx);
}
  cout<<mx<<"\n";
 
  
}
           
int main(){ 
cut; 
ll t; 
//cin>>t;
//T=t;
 t=1;
while(t--)
solve();
return 0;
}
     


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

int main() {
    int n;
    while(cin >> n, n) {
        vector<vector<bool>> v(n, vector<bool>(n));
        int m; cin >> m;
        vector<int> win(n), lose(n);
        for(int i = 0; i < m; ++i) {
            int x, y; cin >> x >> y;
            v[x - 1][y - 1] = v[y - 1][x - 1] = true;
            win[x - 1] += 1;
            lose[y - 1] += 1;
        }

        function<int(int, int)> dfs = [&] (int y, int x) {
            for(int i = 0; i < n; ++i) {
                if(win[i] > (n - 1) / 2 || lose[i] > (n - 1) / 2) {
                    return 0;
                }
            }
            if(y == n) {
                return 1;
            }
            if(y == x || v[y][x]) {
                if(x == n - 1) return dfs(y + 1, 0);
                else           return dfs(y, x + 1);
            } else {
                int res = 0;

                win[y] += 1, lose[x] += 1;
                v[y][x] = v[x][y] = true;
                if(x == n - 1) res = dfs(y + 1, 0);
                else           res = dfs(y, x + 1);
                v[y][x] = v[x][y] = false;
                win[y] -= 1, lose[x] -= 1;

                lose[y] += 1, win[x] += 1;
                v[y][x] = v[x][y] = true;
                if(x == n - 1) res += dfs(y + 1, 0);
                else           res += dfs(y, x + 1);
                v[y][x] = v[x][y] = false;
                lose[y] -= 1, win[x] -= 1;

                return res;
            }
        };

        cout << dfs(0, 0) << endl;
    }
}



Measured memory_bytes: 3100
#include <bits/stdc++.h>
using namespace std;
#define Rep(i,n) for(int i=0;i<(int)(n);i++)
#define For(i,n1,n2) for(int i=(int)(n1);i<(int)(n2);i++)
#define REP(i,n) for(ll i=0;i<(ll)(n);i++)
#define RREP(i,n) for(ll i=((ll)(n)-1);i>=0;i--)
#define FOR(i,n1,n2) for(ll i=(ll)(n1);i<(ll)(n2);i++)
#define RFOR(i,n1,n2) for(ll i=((ll)(n1)-1);i>=(ll)(n2);i--)
#define all(a)  (a).begin(),(a).end()
#define SORT(a) sort((a).begin(),(a).end())
#define oorret 0
#define oor(x) [&](){try{x;} catch(const out_of_range& oor){return oorret;} return x;}()
#define IOS cin.tie(0),ios::sync_with_stdio(false)
typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll, ll> P;
template<typename T1, typename T2> inline bool chmin(T1& a, T2 b) { if (a > b) { a = b; return 1; }return 0; }
template<typename T1, typename T2> inline bool chmax(T1& a, T2 b) { if (a <= b) { a = b; return 1; }return 0; }
template<class Type>struct is_vector : std::false_type {};
template<class ValueType, class Alloc>struct is_vector<std::vector<ValueType, Alloc>> : std::true_type {};
template <typename T> inline ostream& operator << (ostream& out, const vector<T>& v) {
	if (v.empty())return out;
	constexpr bool is_vector_v = is_vector<T>::value;
	if (is_vector_v)for (auto itr = v.begin(); itr != v.end();)out << (*itr), out << ((++itr != v.end()) ? "\n" : "");
	else for (auto itr = v.begin(); itr != v.end();)out << (*itr), out << ((++itr != v.end()) ? " " : "");
	return out;
}
inline void put() {}
template<class T> inline void put(const T& first) { std::cout << first; printf("\n"); }
template<class T, class... N> inline void put(const T& first, const N& ... rest) { std::cout << first; printf(" "); put(rest...); }
inline void putn() {}
template<class T, class... N> inline void putn(const T& first, const N& ... rest) { std::cout << first; printf("\n"); putn(rest...); }

//int cnt = 1;

void rec(vector<vector<int>>& path, int l,int r,int cnt) {//[l,r)
	if (r-l <= 1)return;
	int t = r - l;
	int m = (r + l + 1) / 2;
	FOR(i, l, m) {
		FOR(j, m, r) {
			path[i][j] = cnt;
			path[j][i] = cnt;
		}
	}
	//cnt++;
	rec(path, l, m, cnt+1);
	rec(path, m, r,cnt+1);
}

int main() {
	int n;
	cin >> n;
	vector<vector<int>> path(n, vector<int>(n, 0));
	rec(path, 0, n,1);
	REP(i, n-1) {
		FOR(j,i+1,n) {
			cout << path[i][j] << " ";
		}
		put("");
	}
	return 0;
}

Measured memory_bytes: 1536
#include <bits/stdc++.h>
typedef long long LL;
#define FOR(i,a,b) for(LL i=(a);i<(b);++i)
#define REP(i,n) FOR(i,0,n)

using namespace std;
LL p = 1000000007ll;

int main(void)
{
  LL s;
  cin >> s;
  LL e9 = 1000000000;
  if(s <= e9) {
    cout << "0 0 1 0 0 " << s << endl;
    return 0;
  }
  LL x = (s+e9-1)/e9;
  LL y = x*e9 - s;
  cout << "0 0 1 " << e9 << " " << x << " " << y << endl;
}


Measured memory_bytes: 256
while 1:
    n,x = map(int,input().split())
    count = 0
    if n == 0 and x == 0:
        break

    for i in range(1,n+1):
        for j in range(i+1,n+1):
            for k in range(j+1,n+1):
                if i + j + k == x:
                    count += 1
    print(count)

Measured memory_bytes: 7624