akhauriyash/Code-Regression huggingface dataset:
#include<iostream>
#include<algorithm>
#include<string>
#include<cstring>
#include<sstream>
#include<iomanip>
#include<limits>
#include<deque>
#include<map>
#include<list>
#include<set>
#include <unordered_set>
#include<vector>
#include<cmath>
#include<cstdio>
#include<memory>
#include<bitset>
#include<stack>
#include<functional>
#include<queue>
#include<regex>
#include<time.h>

using namespace std;


#define YES cout<<"YES"<<endl
#define NO cout<<"NO"<<endl
#define Yes cout<<"Yes"<<endl
#define No cout<<"No"<<endl
#define yes cout<<"yes"<<endl
#define no cout<<"no"<<endl

#define Tof(x) (x) ? Yes : No
#define TOF(x) (x) ? YES : NO
#define tof(x) (x) ? yes : no

using ll = long long;

//constexpr ll MOD = 1000000007;
constexpr ll INF = 1050000000;


/*vectorの要素を全部確認するやつだよ。普通に拡張for文したほうがいいよ。

for (vector<int>::iterator itr = ans.begin(); itr != ans.end(); ++itr) {
	cout << *itr << " ";
}

*/


/*for文でx,yを上下左右確認するやつだよ。正直使いづらいよ。

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


for (int i = 0; i < 4; i++) {
	int ny = y + dy[i];
	int nx = x + dx[i];
}

*/


/*繰り返し二乗法だよ。modもとってくれるよ。n^kをmodで割った余りでやってくれるよ。

ll POW_MOD(ll n, ll k, ll mod) {
	ll r = 1;

	for (; k > 0; k >>= 1) {
		if (k & 1) {
			r = (r * n) % mod;
		}
		n = (n * n) % mod;
	}
	return r;
}

*/


/*実行開始からの経過時間を表すよ。

while (clock() < 1900000) {  }

*/


/*まだ使えないテクニックのメモだよ。

for (int bit = 0; bit < (1<<n); ++bit)//bit全探索用のfor文だよ

*/


/*2重for文書くのめんどくなった時用だよ。

for (int i = 0; i < h; ++i) {
	for (int j = 0; j < w; ++j) {

	}
}

*/


const int MAX = 510000;
const int MOD = 1000000007;

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

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

// 二項係数計算
long long COM(int n, int k) {
	if (n < k) return 0;
	if (n < 0 || k < 0) return 0;
	return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}


int main() {
	int n, k; cin >> n >> k;
	COMinit();



	for (int i = 1; i <= k; i++) {
			cout << ((COM(n - k + 1, i) * COM(k-1,i-1))) % MOD << endl;
	}

}



Measured memory_bytes: 12160
//include
//------------------------------------------
#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <queue>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <fstream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <string>
#include <cstring>
#include <ctime>
#include <climits>
#include <limits>
 
using namespace std;
 
//conversion
//------------------------------------------
inline int toInt(string s) { int v; istringstream sin(s); sin >> v; return v; }
template<class T> inline string toString(T x) { ostringstream sout; sout << x; return sout.str(); }
 
//math
//-------------------------------------------
template<class T> inline T sqr(T x) { return x * x; }
 
//typedef
//------------------------------------------
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef long long LL;
 
//container util
//------------------------------------------
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define EXISTch(s,c) ((((s).find_first_of(c)) != std::string::npos)? 1 : 0)//cがあれば1 if(1)
#define SORT(c) sort((c).begin(),(c).end())
 
#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)
 
//constant
//--------------------------------------------
const double EPS = 1e-10;
const double PI = acos(-1.0);
const int INF = (int)1000000007;
const LL MOD = (LL)1000000007;//10^9+7
const LL INF2 = (LL)100000000000000000;//10^18


int main() {
    VI n(11,0);
    REP(i,3){
        int a;
        cin>>a;
        n[a]+=1;
    }
    if(n[5]==2 && n[7]==1){
        cout<<"YES"<<endl;
    }else{
        cout<<"NO"<<endl;
    }
}


Measured memory_bytes: 256
#!/usr/bin/env python

letters = []
for i in range(26):
    letters.append(chr(i + 97) + " : ")

contents = []
while True:
    try:
        text = input()
    except EOFError:
        break
    contents.append(text)


#65-90 uppercase
#97-122lowercase
i = 0
for y in letters:
    value = 0
    for text in contents:
        for x in text:
            if x.isupper():
                x = x.lower()
                if x in y:
                    value += 1
            elif x.islower():
                if x in y:
                    value += 1
    letters[i] = letters[i] + str(value)
    i += 1

for x in letters:
    print(x)

Measured memory_bytes: 7404
#include<complex>
#include<cmath>
#include<iostream>
#include<iomanip>
using namespace std;
typedef complex<double> P;
#define F(I,J,N) for(int I=J;I<N;I++)

class Line{
public:
	P p[2];
	P v;
	Line(){}
	Line(P p0,P p1){
		p[0]=p0;
		p[1]=p1;
		v=p1-p0;
	}
	double cross(P a,P b){
		return (real(a)*imag(b)-imag(a)*real(b));
	}
	//直線交点
	P IntersectionPoint(Line l){
		return p[0] + v * cross(l.v,l.p[0]-p[0]) / cross(l.v,v);
	}
};

int main(){
	int n;
	double x,y;
	P p[3],c[2],ce;
	Line l[2];
	cout<<setprecision(3)<<setiosflags(ios::fixed);
	cin>>n;
	F(a,0,n){
		F(i,0,3){cin>>x>>y;p[i]=P(x,y);}
		c[0]=(p[0]+p[1])/2.0;
		c[1]=(p[1]+p[2])/2.0;
		l[0]=Line(c[0],c[0]+(p[1]-p[0])*P(0,1));
		l[1]=Line(c[1],c[1]+(p[2]-p[1])*P(0,1));
		ce=l[0].IntersectionPoint(l[1]);
		cout<<ce.real()<<" "<<ce.imag()<<" "<<abs(ce-p[0])<<endl;
	}
	return 0;
}

Measured memory_bytes: 0
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <map>
#include <cmath>
#include <queue>
#include <set>
#include <stack>


typedef long long ll;

#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define _GLIBCXX_DEBAC
/*map<Keyの型, Valueの型> 変数名;
queue<型> 変数名;
priority_queue<型> 変数名;
priority_queue<型, vector<型>, greater<型>> 変数名;*/
//copy(v1.begin(), v1.end(), back_inserter(v2));
using namespace std;

int gcd(int a, int b) {
	int c;
	if (a < b) {
		c = a; a = b; b = c;
	}
	while (b != 0) {
		c = a % b; a = b; b = c;
	}
	return a;
}

int sort_greater(int m,int n) {
	vector<int> a(m);
	for (int i = 0; i < m; i++) {
		cin >> a[i];
	}
	sort(a.begin(), a.end(),greater<int>());
	for (int i = 0; i < n; i++) {
		cout << a[i];
	}
		return 0;
}

int bubblesort(int a[], int n) {
	int sw = 0;
	bool flag = 1;
	for (int i = 0; flag; i++) {
		flag = 0;
		for (int j = n - 1; j >= i + 1; j--) {
			if (a[j] < a[j - 1]) {
				swap(a[j], a[j - 1]);
				flag = 1;
				sw += 1;
			}
		}
	}
	return sw;
}

int a_z()
{
	for (int i = 0; i <= ('Z' - 'A'); i++) {
		cout << (char)('A' + i);
	}
	return 0;
}

int selecttionsort(int a[], int n) {
	int t,sw = 0, minj;
	for (int i = 0; i < n - 1; i++) {
		minj = i;
		for (int j = 0; j < n - 1; j++) {
			if (a[j] < a[minj]) {
				minj = j;
			}
		}
		t = a[i]; a[i] = a[minj]; a[minj] = t;
		if (i != minj) sw += 1;

	}
	return sw;
}

bool is_prime(int x) {
	if (x <= 1) return false;
	for (int i = 2; i * i <= x; i++) {
		if (x % i == 0) return false;
	}
	return true;
}

map<string, int> memo;

using P=pair<int, int>;

struct Clock {
	int hour, minute, second;
	void set(int h, int m, int s) {
		hour = h; minute = m; second = s;
	}
	string to_str() {
		string h, m, s;
		h = to_string(hour);
		m= to_string(minute);
		s= to_string(second);
		if (h.size() < 2) h = "0" + h;
		if (m.size() < 2) m = "0" + m;
		if (s.size() < 2) s = "0" + s;
		return h + ":" + m + ":" + s;
	}
	void shift(int diff_second) {
		int h, m;
		h = diff_second / 3600;
		m = diff_second / 60;
		diff_second %= 60;
		second += diff_second;
		
	}
};


/*void dfs(int v, int p = -1) {
	for (int u : to[v]) {
		if (u == p) continue;
		ans[u] += ans[v];
		dfs(u, v);
	}
}*/
int main() {
	//sort(a.begin(),a.end());
	int n,d,a;
	cin >> n>>d;
	a = n / (2 * d + 1);
	if (n % (2 * d + 1) == 0) cout << a;
	else cout << a + 1;
	

	return 0; 
}









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

class Program
{
    void Calc()
    {
        var sc = new Scanner();
        int[] asano = new int[10];
        for (int i = 0; i < 10; i++)
        {
            int a = sc.NextInt();
            asano[i] =  a;
        }
        Array.Sort(asano);
        Console.WriteLine(asano[9]);
        Console.WriteLine(asano[8]);
        Console.WriteLine(asano[7]);
    }

    static void Main()
    {
        new Program().Calc();
    }

    class Scanner
    {
        string[] s = new string[0];
        int i = 0;
        char[] cs = new char[] { ' ' };

        public string Next()
        {
            if (i < s.Length) return s[i++];
            s = Console.ReadLine().Split(cs, StringSplitOptions.RemoveEmptyEntries);
            i = 0;
            return s[i++];
        }
        public int NextInt() { return int.Parse(Next()); }
        public long NextLong() { return long.Parse(Next()); }
        public double NextDouble() { return double.Parse(Next()); }
    }
}

Measured memory_bytes: 9372
import java.util.*;
class Main
{
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = Integer.parseInt(sc.next());
		
		String s = Integer.toString(n);
		
		if(s.charAt(0) == '7' || s.charAt(1) == '7'||s.charAt(2) == '7') {
		    System.out.println("Yes");
		}
		else System.out.println("No");
		
	}
}

Measured memory_bytes: 35620
# coding: utf-8
N = int(input())
A = []
ans = 'Yes'
for i in range(N):
    s = input()
    if s not in A:
        A.append(s)
        if A[i - 1][-1] != s[0] and i > 0:
            ans = 'No'
            break
    else:
        ans = 'No'
        break
print(ans)

Measured memory_bytes: 3060
import java.util.Scanner;

/** AOJ_No.1179 ICPC_2012_A */
public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		
		int n = sc.nextInt();
		for(int i = 0; i < n; i++) {
			int y = sc.nextInt();/* 誕生年 */
			int m = sc.nextInt();/* 誕生月 */
			int d = sc.nextInt();/* 誕生日 */
			
			/* 誕生年の最後の日までを計算 */
			int days;
			if(m % 2 == 0 && y % 3 != 0) {/* 小の月は偶数月&3の倍数じゃない年 */
				days = 19 - d;/* 小の月 */
			} else {
				days = 20 - d;/* 大の月 */
			}
			if(y % 3 == 0) {/* 誕生年の内、誕生月より後の日数 */
				days += (10 - m) * 20;
			} else {
				for(int j = m + 1; j < 11; j++) {
					if(j % 2 == 1) {
						days += 20;
					} else {
						days += 19;
					}
				}
			}
			/* 誕生年後の日を計算 */
			for(int j = y + 1; j < 1000; j++) {
				if(j % 3 == 0) {
					days += 200;
				}else {
					days += 195;
				}
			}
			System.out.println(days + 1);
		}
	}
}



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

#define Int long long int
#define REP(i,n) for(int i=0;i<(n);i++)
#define REAP(i,a,n) for(int i=(a);i<(n);i++)
#define YES cout<<"Yes"<<endl
#define NO cout<<"No"<<endl
#define fr first
#define sc second
#define pb push_back
#define All(v) v.begin(),v.end()

int main(){
    int n,m;
    while(cin >> n >> m,n){
        vector<pair<int,int> > qes(n);
        REP(i,n)cin >> qes[i].first >> qes[i].second;
        sort(All(qes));
        reverse(All(qes));
        int sum=0;
        vector<int> table(m,0);
        REP(i,n){
            if(table[qes[i].first-1]==0){
                sum+=qes[i].second;
                table[qes[i].first-1]=1;
            }
        }
        cout << sum << endl;
    }

}



Measured memory_bytes: 3120
#include<stdio.h>

int main()
{
    int n,tmp;
    scanf("%d", &n);
    int a[n];

    for(int i=0; i<n; ++i)
      scanf("%d", &a[i]);

    for(int i=0; i<n/2; ++i) {
          tmp    = a[i];
          a[i]   = a[n-i-1];
        a[n-i-1] = tmp;
    }

    printf("%d", a[0]);    

    for(int i=1; i<n; ++i)
      printf(" %d", a[i]);

    printf("\n");

    return 0;
}



Measured memory_bytes: 2108
#include <iostream>
#include <cmath>
#include <vector>
#include <map>
#include <iomanip>
#include <algorithm>
#include <sstream>
#include <string>
#include <math.h>
#include <set>
using namespace std;
typedef long long ll;
 
int main() {
	ios::sync_with_stdio(false);
	int a, b, c, d = 20000;
	cin >> a >> b >> c;
	if (a + b < d) d = a + b;
	if (a + c < d) d = a + c;
	if (b + c < d) d = b + c;
	cout << d; 
}

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

int main(){
	ios::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
	vector<int>v{1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51};
	int t;
	cin>>t;
	cout<<v.at(t-1)<<"\n";

	
	
	
	
	return 0;
}

Measured memory_bytes: 3532
function Main(input) {
  input = input.trim().split("\n");
  var C = 1000000007;
  var C2 = 100000;
  var K =  parseInt(input[0],10);
  var S =  input[1];
  var SL = S.length;
  var WL = S.length + K;
  var BK = K; //左から数えてSが全て出現した後に文字列が挿入された回数 BK + i = WL
  var combination;
  var n,r; //nCrの形
  n = SL - 1;
  r = 0;
  combination = nCr_amari(n, r, K + 1, C, C2)
  var productR;
  var vec_26RuijoR = ruijoR(26, BK, C);
  var vec_25RuijoR = ruijoR(25, BK, C);
  var ans = 0;
  productR = vec_26RuijoR[BK] * vec_25RuijoR[0] ;
  ans += productR;
  ans = ans % (C);
      n++;
      r++;
      BK--;
  for (var i = 1; i <= K; i++){
      productR = kakeruR(vec_26RuijoR[BK], vec_25RuijoR[i], C, C2);
      ans += kakeruR(productR, combination[i], C, C2);
      ans %= C;
      n++;
      r++;
      BK--;
  }
console.log(ans);
}   

function ruijoR(num, x, divider){
  var ans = [1];
  var tmp = 1;
  for (var i = 0; i <= x; i++){
      tmp *= num;
      tmp %= divider;
      ans.push(tmp);
  }
  return ans;
}
function nCr_amari(n, k, MAX, MOD, C2) {
// 前処理
var v_ans = [ ];
var fac, finv, inv;
fac = [1,1];
finv = [1,1];
inv = [0,1];
for (var i = 2; i < (n + MAX); i++){
    fac.push(fac[i - 1] * i % MOD);
    inv.push(MOD - kakeruR(inv[MOD%i], (MOD / i | 0), MOD, C2) % MOD);
    finv.push(kakeruR(finv[i - 1],inv[i] ,MOD,C2));
}
  //二項係数計算
if (n < k) return 0;
if (n < 0 || k < 0) return 0;
for (var i = 0; i < MAX; i++){
  v_ans.push(kakeruR(kakeruR(fac[n + i] , finv[k + i],MOD,C2), finv[n - k],MOD,C2));
}
return v_ans;
}
function kakeruR(a, b, C, C2){
var tmpQ, tmpR, ans;
  tmpQ =  (b / C2 | 0);
  tmpR =  b - (tmpQ * C2);
  ans = (a * tmpQ % C) * C2 % C + (a * tmpR);
  ans %= C;
return ans;
}

Main(require("fs").readFileSync("/dev/stdin", "utf8"));

Measured memory_bytes: 181444
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define all(v) v.begin(), v.end()
int main() {
  int H, N; cin >> H >> N;
  vector<int> A(N); rep(i, N) cin >> A.at(i);
  int sum = 0;
  rep(i, N) sum += A.at(i);
  if(sum >= H){
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
  return 0;
}


Measured memory_bytes: 640
void main() {
	auto m = ri;
	ulong a, b;
	foreach(_; 0..m) {
		auto ip = readAs!(string[]);
		if(ip[0] > ip[1]) a += 3;
		else if(ip[0] < ip[1]) b += 3;
		else { a++; b++; }
	}
	writefln("%d %d", a, b);
}

// ===================================

import std.stdio;
import std.string;
import std.functional;
import std.algorithm;
import std.range;
import std.traits;
import std.math;
import std.container;
import std.bigint;
import std.numeric;
import std.conv;
import std.typecons;
import std.uni;
import std.ascii;
import std.bitmanip;
import core.bitop;

T readAs(T)() if (isBasicType!T) {
	return readln.chomp.to!T;
}
T readAs(T)() if (isArray!T) {
	return readln.split.to!T;
}

T[][] readMatrix(T)(uint height, uint width) if (!isSomeChar!T) {
	auto res = new T[][](height, width);
	foreach(i; 0..height) {
		res[i] = readAs!(T[]);
	}
	return res;
}

T[][] readMatrix(T)(uint height, uint width) if (isSomeChar!T) {
	auto res = new T[][](height, width);
	foreach(i; 0..height) {
		auto s = rs;
		foreach(j; 0..width) res[i][j] = s[j].to!T;
	}
	return res;
}

int ri() {
	return readAs!int;
}

double rd() {
	return readAs!double;
}

string rs() {
	return readln.chomp;
}



Measured memory_bytes: 2448
#include "bits/stdc++.h"
using namespace std;

using VS = vector<string>;    using LL = long long;
using VI = vector<int>;       using VVI = vector<VI>;
using PII = pair<int, int>;   using PLL = pair<LL, LL>;
using VL = vector<LL>;        using VVL = vector<VL>;

#define ALL(a)  begin((a)),end((a))
#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(ALL((c)))
#define RSORT(c) sort(RALL((c)))
#define UNIQ(c) (c).erase(unique(ALL((c))), end((c)))
#define FOR(i, s, e) for (int(i) = (s); (i) < (e); (i)++)
#define FORR(i, s, e) for (int(i) = (s); (i) > (e); (i)--)
#define debug(x) cerr << #x << ": " << x << endl
const int INF = 1e9;                          const LL LINF = 1e16;
const LL MOD = 1000000007;                    const double PI = acos(-1.0);
int DX[8] = { 0, 0, 1, -1, 1, 1, -1, -1 };    int DY[8] = { 1, -1, 0, 0, 1, -1, 1, -1 };

/* -----  2017/10/22  Problem: codefestival2017_qual_b A  / Link:   ----- */
/* ------問題------



-----問題ここまで----- */
/* -----解説等-----



----解説ここまで---- */

LL N;

LL ans = 0LL;

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

	string s;
	cin >> s;
	FOR(i, 0, SZ(s) - 1) {
		if (s[i] == 'A'&&s[i + 1] == 'C')ans++;
	}
	if (ans>0)cout << "Yes" << "\n";
	else cout << "No" << "\n";

	return 0;
}

Measured memory_bytes: 764
#include<cstdio>
#include<iostream>
#include<map>
#include<cmath>
#include<algorithm>
#include<cstring>
#include<string>
#include<cstdlib>
using namespace std;
typedef long long LL;
const LL mod = 1e9+7;
int main(){
	string a,b;
	cin >> a >> b;
	if(a.size()>b.size()){
		puts("GREATER");
		return 0;
		}
	if(a.size()<b.size()){
		puts("LESS");
		return 0;
		}
	for(int i = 0;i < a.size();i++){
		if(a[i]<b[i]){
		puts("LESS");
		return 0;
			}
		if(a[i]>b[i]){
		puts("GREATER");
		return 0;
		}
		}
		puts("EQUAL");
		return 0;
	}


Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <cmath>
#include<iomanip>
#include<algorithm>
using namespace std;
  
class dice{
public:
    int d[6], tmp[6];
    dice(int n[6]){
        for (int i = 0; i < 6; i++){
            d[i] = n[i];
        }
    }
    void throwdice(char c){
        for (int i = 0; i < 6; i++){
            tmp[i] = d[i];
        }
        if (c == 'N'){
            d[0] = tmp[1];
            d[1] = tmp[5];
            d[2] = tmp[2];
            d[3] = tmp[3];
            d[4] = tmp[0];
            d[5] = tmp[4];
        }
        else if (c == 'E'){
            d[0] = tmp[3];
            d[1] = tmp[1];
            d[2] = tmp[0];
            d[3] = tmp[5];
            d[4] = tmp[4];
            d[5] = tmp[2];
        }
        else if (c == 'W'){
            d[0] = tmp[2];
            d[1] = tmp[1];
            d[2] = tmp[5];
            d[3] = tmp[0];
            d[4] = tmp[4];
            d[5] = tmp[3];
        }
        else{
            d[0] = tmp[4];
            d[1] = tmp[0];
            d[2] = tmp[2];
            d[3] = tmp[3];
            d[4] = tmp[5];
            d[5] = tmp[1];
        }
    }
};
int main()
{
    int n[6];
    for (int i = 0; i < 6; i++){
        cin >> n[i];
    }
    dice dice1(n);
    string dir;
    cin >> dir;
    for (int i = 0; i < dir.length(); i++){
        dice1.throwdice(dir[i]);
    }
    cout << dice1.d[0] << endl;
  
  
    return 0;
}


Measured memory_bytes: 3200
#include <algorithm>
#include <cmath>
#include <climits>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <fstream>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
#include <cassert>
#include <functional>

using namespace std;

#define LOG(...) printf(__VA_ARGS__)
//#define LOG(...)
#define FOR(i,a,b) for(int i=(int)(a);i<(int)(b);++i)
#define REP(i,n) for(int i=0;i<(int)(n);++i)
#define ALL(a) (a).begin(),(a).end()
#define RALL(a) (a).rbegin(),(a).rend()
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())
#define RSORT(c) sort((c).rbegin(),(c).rend())
#define CLR(a) memset((a), 0 ,sizeof(a))

typedef long long ll;
typedef unsigned long long ull;
typedef vector<bool> vb;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<vb> vvb;
typedef vector<vi> vvi;
typedef vector<vll> vvll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;

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

int main() {
	int n;
	while (cin >> n, n){
		vector<vector<int>> hyou(n + 1, vector<int>(n + 1, 0));
		REP(i, n){
			REP(j, n){
				int num;
				cin >> num;
				hyou[i][j] = num;
			}
		}
		REP(i, n){
			REP(j, n){
				hyou[i][n] += hyou[i][j];
			}
		}
		REP(j, n){
			REP(i, n){
				hyou[n][j] += hyou[i][j];
			}
		}
		REP(i, n){
			hyou[n][n] += hyou[i][n];
		}
		REP(i, n + 1){
			REP(j, n + 1){
				printf("%5d", hyou[i][j]);
			}
			printf("\n");
		}
	}
}

Measured memory_bytes: 3076
using static System.Console;
using System.Linq;
using System.Diagnostics;
using System;
using System.Collections.Generic;
using System.Runtime.Serialization.Formatters;

public static class Program
{
    public static void Main()
    {
        var stopwatch = new Stopwatch();
        var maxD = int.Parse(ReadLine());
        var cArray = ReadLine().Split(' ').Select(x => int.Parse(x)).ToArray();
        var sTable = new List<List<int>>();
        var lastList = Enumerable.Repeat(0, 26).ToList();
        var sequenceList = Enumerable.Repeat(0, maxD).ToList();
        int happiness = 0;
        var lastList1 = Enumerable.Repeat(0, 26).ToList();
        for (int i = 0; i < maxD; ++i)
        {
            sTable.Add(ReadLine().Split(' ').Select(x => int.Parse(x)).ToList());
        }

        stopwatch.Restart();
        Random random = new Random();
        for(int d = 0; d < maxD; ++d)
        {
            var currentContest = random.Next(26);
            lastList[currentContest] = d + 1;
            sequenceList[d] = currentContest;
            happiness += sTable[d][currentContest];
            happiness -= Enumerable.Range(0, 26).Select(i => cArray[i] * ((d + 1) - lastList[i])).Sum();
        }
        while(stopwatch.ElapsedMilliseconds < 1900)
        {
            var ranD = random.Next(maxD);
            var old = sequenceList[ranD];
            sequenceList[ranD] = random.Next(26);
            var newHappiness = calcHappiness();
            if (happiness > newHappiness) sequenceList[ranD] = old;
            else happiness = newHappiness;
        }
        for(int i = 0; i < maxD; ++i)
        {
            WriteLine(sequenceList[i] + 1);
        }
        
        int calcHappiness()
        {
            var res = 0;
            for(int i = 0; i < 26; ++i)
            {
                lastList1[i] = 0;
            }
            for (int d = 0; d < maxD; ++d)
            {
                lastList1[sequenceList[d]] = d + 1;
                res += sTable[d][sequenceList[d]];
                for(int i = 0; i < 26; ++i)
                {
                    res -= cArray[i] * ((d + 1) - lastList1[i]);
                }
            }
            return res;
        }
    }
}

Measured memory_bytes: 29156
#!/usr/bin/env python3
# sys.stdin.readline()
import math
import sys
from collections import defaultdict
input = sys.stdin.readline

a,b,h,m = map(int,input().split())
dig = (h * 60 + m )*5.5 %360
print((a**2+b**2-2*a*b*math.cos(math.radians(dig)))**(1/2))

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

int main(void){
    while(true){
        int n, m;
        cin >> n >> m;
        if(n+m==0) break;
        int INF=1<<29;
        int cost[110][110], t[110][110];
        
        for(int i=1; i<=m; i++){
            for(int j=1; j<=m; j++){
                if(i==j){
                    cost[i][j]=0;
                    t[i][j]=0;
                }else{
                    cost[i][j]=INF;
                    t[i][j]=INF;
                }
            }
        }
        for(int i=0; i<n; i++){
            int a, b;
            cin >> a >> b;
            cin >> cost[a][b] >> t[a][b];
            cost[b][a]=cost[a][b];
            t[b][a]=t[a][b];
        }
        for(int k=1; k<=m; k++){
            for(int i=1; i<=m; i++){
                for(int j=1; j<=m; j++){
                    cost[i][j]=min(cost[i][j], cost[i][k]+cost[k][j]);
                    t[i][j]=min(t[i][j], t[i][k]+t[k][j]);
                }
            }
        }
        int k;
        cin >> k;
        while(k--){
            int p, q, r;
            cin >> p >> q >> r;
            cout << (r==0? cost[p][q]:t[p][q]) << "\n";
            
        }
    
    
    }
}



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

using namespace std;

using lo = long long int;
#define pb emplace_back
#define st first
#define nd second
#define inf (int)1e9
#define N (int)1e5 * 5
#define mod (int)1e9 + 7
#define all(x) (x).begin(), (x).end()
#define watch(x) cout << #x << " = " << x << endl
int in(){
	int a;
	cin >> a;
	return a;
}

void solve(){
    lo a, v, b, w, t;
    cin >> a >> v >> b >> w >> t;
    lo d = abs(a - b);
    lo d2 = (v - w) * t;
    cout << (d <= d2 ? "YES\n" : "NO\n");
}

int main(){
    ios_base::sync_with_stdio(0); cin.tie(nullptr); cout.tie(0); cerr.tie(0);
    mt19937 rng(5);
    // freopen("gir.gir", "r", stdin);
    // freopen("cik.cik", "w", stdout);
    int t = 1;
    // cin >> t;
    while(t--){
        solve();
    }
    return 0;
}
/*

*/


Measured memory_bytes: 3604
import java.io.BufferedReader
import java.io.InputStream
import java.io.InputStreamReader
import java.util.*

fun main(args: Array<String>) {
    val n = readLine()!!.toInt()
    val a = readLine()!!.split(' ').map { it.toInt() }
    println(if (a.all { it % 2 == 1 || it % 3 == 0 || it % 5 == 0 }) "APPROVED" else "DENIED")
}

Measured memory_bytes: 38056
#include<bits/stdc++.h>
using namespace std; 
  
typedef long long ll; 
typedef pair<ll, ll> pll;
typedef vector<ll> vl; 
typedef vector<vl> vvl; 
 
#define MOD 1000000007  
#define ffor(a, b, c) for (ll(a) = (b); (a) < (c); ++(a)) 
#define fforsq(a, b, c) for (ll(a) = (b); (a) * (a) <= (c); ++(a)) 
 
#define rep(i, n) ffor(i, 0, n) 
#define ff first 
#define ss second  
#define pb push_back 
#define ALL(v) v.begin(), v.end() 
#define ALLA(arr, sz) arr, arr + sz 
#define SIZE(v) (int)v.size() 
#define SORT(v) sort(ALL(v)) 
#define REVERSE(v) reverse(ALL(v)) 
#define SORTA(arr, sz) sort(ALLA(arr, sz)) 
#define REVERSEA(arr, sz) reverse(ALLA(arr, sz)) 
#define TC(t) while (t--) 
#define N 200005
#define inf 1e18

int main(){
    ll i,j,k,m,n,a,b,c,q,t,r,sum,num,ans,ind;
    cin>>n;
    vvl v(n,vl(3));
    rep(i,n){
        cin>>v[i][0]>>v[i][1]>>v[i][2];
    }
    vvl dp(n,vl(3));
    dp[0][0]=v[0][0];dp[0][1]=v[0][1];dp[0][2]=v[0][2];
    ffor(i,1,n){
        rep(j,3){
            dp[i][j] = max(dp[i-1][(j+1)%3], dp[i-1][(j+2)%3]) + v[i][j];
        }
    }
    ans = 0;
    rep(i,3) ans = max(ans,dp[n-1][i]);
    cout<<ans;
}

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

#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define all(a)  (a).begin(),(a).end()
#define pb push_back
#define ppb pop_back
#define INF 1e18
typedef long long ll;

using namespace std;

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


    ll n,k;cin>>n>>k;
    string s;cin>>s;
    ll count = 0;
    ll ans = 0;
    rep(i,n-1)
    {
        if(s[i] != s[i+1])
        count++;
        else ans++;
    }

    while(count>0 && k>0)
    {
        k--;
        if(count!=1)
        {
            count-=2;
            ans+=2;
        }
        else 
        {
            count--;
            ans++;
        }
    }

    cout<<ans<<endl;

    return 0;
}

Measured memory_bytes: 512
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#define FOR(i,a,b) for(int i=a; i<b; i++)
#define rep(i,N) FOR(i,0,N)

using namespace std;

int main(){

    int N;
    cin >> N;
    vector<int> rc(N);

    rep(i,N){
        cin >> rc.at(i);
    }

    sort(rc.begin(), rc.end(), greater<int>());

    int radius=rc.at(0);
    int cnt=1;

    rep(i,N){
        if (radius>rc.at(i)){
            radius = rc.at(i);
            cnt++;
        }
    }

    cout << cnt;

    return 0;
}

Measured memory_bytes: 256
# coding: utf-8
import re
import math
import fractions
#import numpy as np

mod=int(10**9+7)

def lcm(a,b):
    return

def ac(N,A):
    l=A[0]
    for a in range(1,N):
        l=(l*A[a])//fractions.gcd(l,A[a])
    l%=mod
    ans=0
    for a in A:
        ans+=l*pow(a,mod-2,mod)
        ans%=mod
    return ans

def solve():
    return

#main
N=int(input())
A=list(map(int,input().split()))
print(ac(N,A))


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

const int MAX_N=1010101;
ll P[MAX_N];
ll inv[MAX_N+1], fact[MAX_N+1], ifact[MAX_N+1];

ll C(int n, int k){
  if(n<k) return 0LL;
  return fact[n]*ifact[k]%MOD*ifact[n-k]%MOD;
}

void prepare(){
  inv[1]=fact[0]=fact[1]=ifact[0]=ifact[1]=1LL;
  for(int i=2;i<=MAX_N;i++){
    inv[i]=inv[MOD%i]*(MOD-MOD/i)%MOD;
    fact[i]=fact[i-1]*i%MOD;
    ifact[i]=ifact[i-1]*inv[i]%MOD;
  }
}


int main(){
  prepare();
  int N; cin>>N;
  if(N==2){
    cout<<1<<endl;
    return 0;
  }
  ll ans=0,prev=0;
  for(ll i=2;i<=(N-1);i++){
    ll x=C(i-1,N-i-1)*fact[i]%MOD*fact[N-i-1]%MOD,y=(x-prev+MOD)%MOD;
    (ans+=y*i)%=MOD;
    prev=x;
  }
  cout<<ans<<endl;
  return 0;
}


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

int S;

int main(){
	cin >> S;
	int s, m, h;
	h = S / 3600;
	m = (S % 3600) / 60;
	s = S % 60;
	cout << h << ":" << m << ":" << s << endl;

	return 0;
}

Measured memory_bytes: 3100
/*author: hyperion_1724
  date: 
*/

//Optional FAST

//#pragma GCC optimize("Ofast")
//#pragma GCC optimize("unroll-loops")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,fma,abm,mmx,avx,avx2,tune=native")

//Required Libraries

#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/detail/standard_policies.hpp>

//Required namespaces

using namespace std;
using namespace __gnu_pbds;

//Required defines

#define endl '\n'

#define READ(X) cin>>X;
#define READV(X) long long X; cin>>X;
#define READAR(A,N) long long A[N]; for(long long i=0;i<N;i++) {cin>>A[i];}
#define rz(A,N) A.resize(N);
#define sz(X) (long long)(X.size())
#define pb push_back
#define pf push_front
#define fi first
#define se second
#define trav(x,A) for(auto &x:A)
#define FORI(a,b,c) for(long long a=b;a<c;a++)
#define FORD(a,b,c) for(long long a=b;a>c;a--)

//Required typedefs

typedef tree<long long,null_type,less<long long>,rb_tree_tag,tree_order_statistics_node_update> ordered_set;
typedef tree<long long,null_type,greater<long long>,rb_tree_tag,tree_order_statistics_node_update> ordered_set1;
typedef long long ll;
typedef long double ld;
typedef pair<int,int> pii;
typedef pair<long long,long long> pll;
typedef vector<int> veci;
typedef vector<long long> vecl;

//Required Constants

const long long inf=(long long)1e18;
const long long MOD=(long long)(1e9+7);
const long long INIT=(long long)(1e6+1);

//Required Functions

ll power(ll x,ll y) 
{ 
    if (y == 0) 
        return 1; 
    ll p = power(x, y/2) % MOD; 
    p = (p * p) % MOD; 
  
    return (y%2 == 0)? p : (x * p) % MOD; 
}
ll modInverse(ll a) 
{ 
   return power(a,MOD-2); 
   
}

//Work

ll fact[INIT];

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

    fact[0]=1;
    FORI(i,1,INIT)
    {
        fact[i]=(i*fact[i-1])%MOD;
    }
    READV(X);
    READV(Y);
    ll ans=0;
    FORI(i,0,X+1)
    {
        if((X-i)%2==0 && (i*2+(X-i)/2)==Y)
        {
            ans=(ans+(fact[i+(X-i)/2]*modInverse((fact[i]*fact[(X-i)/2])%MOD))%MOD)%MOD;
        }
    }
    cout<<ans<<endl;

    return 0;
}

Measured memory_bytes: 8064
//header{{{
#include<bits/stdc++.h>
  
using namespace std;
 
#define rep(i,n) for(int i=0;i<(n);++i)
#define reps(i,n) for(int i=1;i<=(n);++i)
#define all(x) (x).begin(),(x).end()
#define setout(n,x) setw(n+1) << setfill(x)
#define Fixed fixed << setprecision(10)
#define int int64_t
using pii = pair<int,int>;
constexpr int INF  = 0x3f3f3f3f;
constexpr long long LINF = 0x3f3f3f3f3f3f3f3fLL;
constexpr int mod = 1e9+7; 
constexpr int MOD = 998244353;

template <class A, class B> inline bool chmax(A &a, const B &b) { return b > a && (a = b, true); }
template <class A, class B> inline bool chmin(A &a, const B &b) { return b < a && (a = b, true); }

template <class T> using min_heap = priority_queue<T,vector<T>,greater<T> >;
template <class T> using max_heap = priority_queue<T>;
template <class A, class B> using umap = unordered_map<A,B>;
  
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;}

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

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

    int d,g;
    cin >> d >> g;
    vector<int> p(d),c(d);

    rep(i,d){
        cin >> p[i] >> c[i];
    }

    int res = INF;

    for(int bit = 0;bit < (1 << d);++bit){
        int sum = 0,cnt = 0;
        for(int i = d-1;i >= 0;--i){
            if(bit & (1 << i)){
                rep(j,p[i]){
                    sum += (i+1) * 100;
                    ++cnt;
                    if(sum >= g) goto end;
                }
                sum += c[i];
                if(sum >= g) goto end;
            }
        }
        end:;
        if(sum >= g) chmin(res,cnt);
    }

    cout << res << '\n';

    return 0;
}


Measured memory_bytes: 256
//BROWNIE TK

#include <bits/stdc++.h>
typedef long long int lli;
typedef unsigned long long int ulli;
typedef long double ldb;

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

#define pb push_back
#define popb pop_back()
#define pf push_front
#define popf pop_front()

#define si size()
#define be begin()
#define en end()
#define all(v) v.be, v.en

#define le length()
#define mp make_pair
#define mt make_tuple
#define acc(v) accumulate(all(v), 0)
#define F first
#define S second

#define pll pair<lli, lli>
#define pii pair<int, int>
#define pil pair<int, lli>

#define forz(i, n) for (int i = 0; i < n; i++)
#define fore(i, m, n) for (int i = m; i <= n; i++)
#define rforz(i, n) for (int i = n - 1; i >= 0; i--)
#define rfore(i, m, n) for (int i = n; i >= m; i--)

#define deci(n) fixed << setprecision(n)
#define high(n) __builtin_popcount(n)
#define highll(n) __builtin_popcountll(n)
#define parity(n) __builtin_parity(n)
#define ctz(n) __builtin_ctz(n)

#define bset(a, p) ((a) | (1ll << (p)))
#define bchk(a, p) ((a) & (1ll << (p)))
#define bxor(a, p) ((a) ^ (1ll << (p)));
#define brem(a, p) (bchk(a, p) ? (bxor(a, p)) : (a))
/*SOME BITMASK KNOWLEDGE
1)x & (x - 1):sets the last one bit of x to zero
power of two exactly when x & (x − 1) = 0.
2)x & -x:sets all the one bits to zero, except last one bit
3)x | (x - 1):inverts all the bits after the last one bit*/

#define lb lower_bound
#define ub upper_bound
#define er equal_range

#define findnot find_first_not_of

#define maxe *max_element
#define mine *min_element

#define mod 1000000007
#define mod2 998244353
#define gcd __gcd
#define kira ios::sync_with_stdio(0), cin.tie(0), cout.tie(0)

#define endl "\n"
#define p0(a) cout << a << " "
#define p1(a) cout << a << endl
#define p2(a, b) cout << a << " " << b << endl
#define p3(a, b, c) cout << a << " " << b << " " << c << endl
#define p4(a, b, c, d) cout << a << " " << b << " " << c << " " << d << endl

#define oset tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update>
#define osetlli tree<lli, null_type, less<lli>, rb_tree_tag, tree_order_statistics_node_update>
//member functions :
//1. order_of_key(k) : number of elements sbtriectly lesser than k
//2. find_by_order(k) : k-th element in the set
#define ofk order_of_key
#define fbo find_by_order
using namespace std;

/*STD funcions*/
lli power(lli x, lli y, lli p)
{
    lli res = 1;
    x = x % p;
    while (y > 0)
    {
        if (y & 1)
            res = (res * x) % p;
        y = y >> 1;
        x = (x * x) % p;
    }
    return res;
}
lli modi(lli a, lli m) { return power(a, m - 2, m); }
/*CODE BEGINS*/
int main()
{
    kira;
    lli n;
    string s,t;
    cin>>n>>s>>t;
    forz(i,n)cout<<s[i]<<t[i];
    return 0;
}

Measured memory_bytes: 256
#include <cstdio>
#include <iostream>
#include <algorithm>
#include <cstring>
#include <string>
#include <vector>
#include <set>
#include <map>
#include <utility>
#include <cstdlib>
#include <memory>
#include <queue>
#include <cassert>
#include <cmath>
#include <ctime>
#include <complex>
#include <bitset>
#include <fstream>
#include <unordered_map>
#include <unordered_set>
#include <numeric>

using namespace std;

#define ws ws_____________________
#define y1 y1_____________________
#define y0 y0_____________________
#define left left_________________
#define right right_______________
#define next next_________________
#define prev prev_________________
#define hash hash_________________

#define pb push_back
#define fst first
#define snd second
#define mp make_pair 
#define sz(C) ((int) (C).size())
#define forn(i, n) for (int i = 0; i < int(n); ++i)
#define ford(i, n) for (int i = int(n) - 1; i >= 0; --i)
#define all(C) begin(C), end(C)

typedef long long ll;
typedef unsigned long long ull;
typedef unsigned int uint;
typedef pair<int,int> pii;
typedef pair<ll, ll> pll;
typedef vector<ll> vll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<pii> vii;
typedef long double ld;
typedef complex<double> cd;

#ifdef LOCAL
#define eprintf(args...) fprintf(stderr, args), fflush(stderr)
#else
#define eprintf(...) ;
#endif

#define FILE_NAME "a"

const int MAXN = 300 + 10;

int n;
int d[MAXN][MAXN];

bool read() {
	if  (scanf("%d", &n) < 1) {
		return 0;
	}
	forn(i, n) {
		forn(j, n) {
			scanf("%d", &d[i][j]);
		}
	}
	return 1;
}

int nd[MAXN][MAXN];

bool solve() {
	forn(i, n) {
		forn(j, n) {
			nd[i][j] = d[i][j];
		}
	}

	forn(k, n) {
		forn(i, n) {
			forn(j, n) {
				if  (nd[i][j] > nd[i][k] + nd[k][j]) {
					nd[i][j] = nd[i][k] + nd[k][j];
				}
			}
		}
	}

	forn(i, n) {
		forn(j, n) {
			if  (d[i][j] != nd[i][j]) {
				return 0;
			}
		}
	}

	ll best = 0;
	forn(i, n) {
		forn(j, n) {
			bool was = 0;
			forn(k, n) {
				if  (k != i && k != j && d[i][j] == d[i][k] + d[k][j]) {
					was = 1;
					break;
				}
			}
			if  (!was) {
				best += d[i][j];
			}
		}
	}

	printf("%lld\n", best / 2);
	return 1;
}

int main() {
#ifdef LOCAL
	freopen(FILE_NAME ".in", "r", stdin);
	// freopen(FILE_NAME ".out", "w", stdout);
#endif

	while (read()) {
		if  (!solve()) {
			puts("-1");
		}
	}

#ifdef LOCAL
	cerr.precision(5);
	cerr << "Time: " << fixed << (double) clock() / CLOCKS_PER_SEC << endl;
#endif
	return 0;
}


Measured memory_bytes: 1024
#include<iostream>
#include<string>
#include<cstdio>
#include<vector>
#include<cmath>
#include<algorithm>
#include<functional>
#include<iomanip>
#include<queue>
#include<ciso646>
#include<random>
#include<map>
#include<set>
#include<complex>
#include<bitset>
#include<stack>
#include<unordered_map>
#include<utility>
using namespace std;
typedef long long ll;
typedef unsigned long long ul;
typedef unsigned int ui;
const ll mod = 1000000007;
typedef double ld;
typedef complex<ld> Point;
const ll INF = mod * mod;
typedef pair<int, int> P;
#define stop char nyaa;cin>>nyaa;
#define rep(i,n) for(int i=0;i<n;i++)
#define per(i,n) for(int i=n-1;i>=0;i--)
#define Rep(i,sta,n) for(int i=sta;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
#define per1(i,n) for(int i=n;i>=1;i--)
#define Rep1(i,sta,n) for(int i=sta;i<=n;i++)
const ld eps = 1e-6;
const ld pi = acos(-1.0);
typedef pair<ld, ld> LDP;
typedef pair<ll, ll> LP;

const int mn = 20000;
bool exi[50][101][50];
vector<int> G[50];

int num[3];
int n;
bool visit[mn][50];
int ans[mn][50];
int dfs(int x,int t) {
	if (x == n - 1)return 0;
	if (t >= mn)return mod;
	if (visit[t][x])return ans[t][x];
	visit[t][x] = true;
	int ret = 0;
	rep(i, 3) {
		int cret = mod;
		rep(j, n) {
			if (exi[x][num[i]][j]) {
				cret = min(cret, dfs(j, t + num[i]));
			}
		}
		ret = max(ret, cret);
	}
	return ans[t][x] = ret+1;
}


void solve(){
	int m; 
	cin >> n >> m;
	rep(i, 3)cin >> num[i];
	rep(i, m) {
		int a, b; cin >> a >> b; a--; b--;
		G[a].push_back(b);
	}
	rep(id, n) {
		exi[id][0][id] = true;
		rep(i, 100) {
			rep(j, n) {
				if (exi[id][i][j]) {
					rep(k, G[j].size()) {
						int to = G[j][k];
						exi[id][i + 1][to] = true;
					}
				}
			}
		}
	}
	int out = dfs(0,0);
	if (out >= mod) {
		cout << "IMPOSSIBLE" << endl;
	}
	else {
		cout << out << endl;
	}

}

int main() {
	ios::sync_with_stdio(false);
	cin.tie(0);
	solve();
	//stop
		return 0;
}


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

int N,M,R;
vector<int> r(8);
vector<int> a(40000),b(40000),c(40000);
vector<vector<P>> g(40000);
int dp[200][200];
int ans = INF;

void warshall_floyd() {
  REP(i,N) REP(j,N) {
    dp[i][j] = j==i ? 0 : INF; // 自分自身は0
  }

  REP(i,M) {
    dp[a[i]][b[i]] = c[i];
    dp[b[i]][a[i]] = c[i];
  }

  REP(k,N) { // 経由する頂点
    REP(i,N) { // 開始頂点
      REP(j,N) { // 終端
        dp[i][j] = min(dp[i][j], dp[i][k] + dp[k][j]);
      }
    }
  }
}

void dfs(vector<int> v) {
  if (v.size() == R) {
    int sum = 0;
    REP(i,R-1) {
      int from = r[v[i]], to = r[v[i+1]];
      sum += dp[from][to];
    }
    chmin(ans,sum);
    return;
  }

  REP(i,R) {
    if (find(ALL(v), i) != v.end()) continue;
    vector<int> nv = v;
    nv.push_back(i);
    dfs(nv);
  }
  return;
}

int main() {
  IOS;
  cin >> N >> M >> R;
  REP(i,R) {
    cin >> r[i];
    r[i]--;
  }
  REP(i,M) {
    cin >> a[i] >> b[i] >> c[i];
    a[i]--; b[i]--;
  }

  warshall_floyd();
  dfs(vector<int>()); // 順列

  COUT(ans);

  return 0;
}

Measured memory_bytes: 4728
import java.util.*;

class Main{

    public static void main(String args[]) throws Exception{
        Main main = new Main();
    }

    public Main(){
        Scanner scanner = new Scanner(System.in);
        int N = scanner.nextInt();
        int K = scanner.nextInt();
        int[] P = new int[N];

        for(int i=0;i<N;i++){
            P[i] = scanner.nextInt();
        }

        int M=0;
        for(int i=0;i<K;i++){
            M += P[i];
        }

        int S = M;
        for(int i=K;i<N;i++){
            S += P[i] - P[i-K];
            if(M < S){
                M = S;
            }
        }

        double R = ((double)(M + K)) / 2.0;
        System.out.println(R);
    }
}


Measured memory_bytes: 82428
n,k=list(map(int, input().split()))
answer=[0]*n
for i in range(k):
    d=int(input())
    a=(list(map(int, input().split())))
    for at in a:
        answer[at-1]+=1
answernum=0
for i in range(n):
    if (answer[i]==0):
        answernum+=1
print(answernum)

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

int main() {
  int a, b, c, d, k, s = 0;
  cin >> a >> b >> c >> k;
  s += a + b + c;
  d = max(a, max(b, c));
  s -= d;
  rep(i, k) d *= 2;
  cout << s + d << endl;
  return 0;
}

Measured memory_bytes: 256
import java.util.Scanner;

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

		int a = scan.nextInt();
		int b = scan.nextInt();
		int c = scan.nextInt();

		if (a < b && b < c) {
			System.out.println("Yes");
		} else {
			System.out.println("No");
		}

	}
}

Measured memory_bytes: 26140
#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>
#define all(v) (v).begin(),(v).end()
#define rep(i,n) for (int i = 0; i < (n); ++i)
using namespace std;
using ll = long long;
constexpr ll INF = 1e18;

int main(void) {
    char C;
    cin >> C;
    cout << (char)(C+1) << endl;
    return 0;
}



Measured memory_bytes: 888
#include<bits/stdc++.h>
//One implementation to rule them all?
#define db 				double
#define ll 				long long int
#define ld				long long double
//#define int 			long long int
#define ull 			unsigned long long
#define fi 				first
#define se 				second
#define rep(i,a,n)      for(int i=a;i<n;i++)
#define endl 			'\n'
#define mem(a,b) 		memset(a, b, sizeof a)
#define mkp 			make_pair
#define pb 				push_back
#define max3(a,b,c) 	max(a,max(b,c))
#define min3(a,b,c) 	min(a,min(b,c))
#define w(t)            int t; cin>>t; while(t--)
#define all(a)			a.begin(), a.end()
#define sz(a) int((a).size())
#define tr(container, it) \
for(auto it = container.begin(); it != container.end(); it++)
using namespace std;
typedef vector < int > vii;
typedef vector < ll > vll;
typedef vector < vii > vvi;
typedef pair < int,int > pii;
db pi		 =			2*acos(0.0);
db eps       =			0.000001;
ll mod       =			(1e9+7);   //998244353
const ll INF =			1000000000000000LL;
void print(vector <int> &arr){
    for(int i=0;i<arr.size();i++)
        cout<<arr[i]<<" ";
    
    cout<<endl;
}
void printll(vector <ll> &arr){
    for(int i=0;i<arr.size();i++)
        cout<<arr[i]<<" ";
    
    cout<<endl;
}

ll ncr(ll n, ll r)
{
    r=min(r,n-r);
    ll A[r],i,j,B[r];
    iota(A,A+r,n-r+1);  
    iota(B,B+r,1);     

    ll g;
    for(i=0;i<r;i++)
    for(j=0;j<r;j++)
    {
        if(B[i]==1)
            break;
        g=__gcd(B[i], A[j] );
        A[j]/=g;
        B[i]/=g;
    }
    ll ans=1;
    for(i=0;i<r;i++)
        ans=(ans*A[i]%mod);
    return ans;
}
const int SIZE=100001;
bool judgePermutation(int a[], int n){
    static int used[SIZE+1];
    for(int i = 1; i <= n; i++) used[i] = 0;
    for(int i = 0; i < n; i++) used[a[i]] = 1;
    for(int i = 1; i <= n; i++) {
        if(!used[i]) return 0;
    }
    return 1;
}
//DSU Implementation
void init(int idx[], int sz[], int n){
	rep(i,0,n) idx[i]=i, sz[i]=1;
}
int root(int index, int idx[]){
	while(index!=idx[index]){
		idx[index]=idx[idx[index]];
		index=idx[index];
	}
	return index;
}
bool qfind(int p, int q, int idx[]){
	return idx[p]==idx[q];
}
void qunion(int p, int q, int idx[], int sz[]){
	int rootp=root(p,idx), rootq=root(q,idx);
	if(rootp==rootq) return;
	if(sz[rootp]>=sz[rootq]){
		idx[rootq]=idx[rootp];
		sz[rootp]+=sz[rootq];
	}
	else{
		idx[rootp]=idx[rootq];
		sz[rootq]+=sz[rootp];
	}
}
int arr[3][3][2];

int main(){	
//CONDITION && cout << "YES" || cout << "NO"; cout << '\n';
//////////////////////////////////////////////////////////////////////
//  ios_base::sync_with_stdio(false);
//  cin.tie(NULL);
//  cout.tie(NULL);
//  cerr.tie(NULL);
//For fast IO
///////////////////////////////////////////////////////////////////// 
//  std::cout.unsetf ( std::ios::floatfield );  // floatfield not set
//  std::cout.precision(10);
//	freopen("input.txt","r",stdin);
//	freopen("output.txt","w",stdout);
	string s,t;
	cin>>s>>t;
	int l=s.size();
	rep(i,0,l){
		if(s[i]!=t[i]){
			cout<<"No"<<endl;
			exit(0);
		}
	}
	cout<<"Yes"<<endl;
	return 0;
    }

Measured memory_bytes: 3624