akhauriyash/Code-Regression huggingface dataset:
#include <float.h>
#include <limits.h>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>

// 内部定数
#define D_PRM_MAX		100000									// 最大素数数

// 内部構造体 - 素数情報
typedef struct Prm {
	long long mlVal;											// 値
	int miCnt;													// 個数
} Prm;

// 内部変数
static FILE *szpFpI;											// 入力
static Prm sz1Prm[D_PRM_MAX];									// 素数
static int siPCnt;												// 素数数

// 内部変数 - テスト用
#ifdef D_TEST
	static int siRes;
	static FILE *szpFpA;
	static int siTNo;
#endif

// １行出力
int
fOutLine(
	char *pcpLine				// <I> １行
)
{
	char lc1Buf[1024];

#ifdef D_TEST
	fgets(lc1Buf, sizeof(lc1Buf), szpFpA);
	if (strcmp(lc1Buf, pcpLine)) {
		siRes = -1;
	}
#else
	printf("%s", pcpLine);
#endif

	return 0;
}

// 最大公約数 - 取得
long long
fGetGcd(
	long long plVal1			// <I> 値１
	, long long plVal2			// <I> 値２
)
{
	long long llWork;

	// ユークリッドの互除法
	if (plVal1 < plVal2) {
		llWork = plVal1;
		plVal1 = plVal2;
		plVal2 = llWork;
	}
	while (plVal2 > 0) {
		llWork = plVal1 % plVal2;
		plVal1 = plVal2;
		plVal2 = llWork;
	}

	return plVal1;
}

// 素因数分解
int
fDivPrm(
	long long plVal				// <I> 値
)
{
	int i;

	// 初期化
	memset(sz1Prm, 0, sizeof(sz1Prm));
	siPCnt = 0;

	// 上限
	int liLimit = (int)sqrt((double)plVal);

	// 素因数分解
	for (i = 2; i <= liLimit; i++) {

		// 分解終了
		if (plVal == 1) {
			break;
		}

		// 分解
		while (plVal % (long long)i == 0) {
			plVal /= i;
			sz1Prm[siPCnt].miCnt++;
		}

		// 分解あり
		if (sz1Prm[siPCnt].miCnt > 0) {
			sz1Prm[siPCnt].mlVal = i;
			siPCnt++;
		}
	}

	// 上限を超える素数
	if (plVal != 1) {
		sz1Prm[siPCnt].miCnt = 1;
		sz1Prm[siPCnt].mlVal = plVal;
		siPCnt++;
	}

	return 0;
}

// 実行メイン
int
fMain(
)
{
	char lc1Buf[1024];

	// A, B - 取得
	long long llA, llB;
	fgets(lc1Buf, sizeof(lc1Buf), szpFpI);
	sscanf(lc1Buf, "%lld%lld", &llA, &llB);

	// 最大公約数 - 取得
	long long llGcd = fGetGcd(llA, llB);

	// 素因数分解
	fDivPrm(llGcd);

	return siPCnt + 1;
}

// １回実行
int
fOne(
)
{
	int liRet;
	char lc1Buf[1024];

	// 入力 - セット
#ifdef D_TEST
	sprintf(lc1Buf, ".\\Test\\T%d.txt", siTNo);
	szpFpI = fopen(lc1Buf, "r");
	sprintf(lc1Buf, ".\\Test\\A%d.txt", siTNo);
	szpFpA = fopen(lc1Buf, "r");
	siRes = 0;
#else
	szpFpI = stdin;
#endif

	// 実行メイン
	liRet = fMain();

	// 出力
	sprintf(lc1Buf, "%d\n", liRet);
	fOutLine(lc1Buf);

	// 残データ有無
#ifdef D_TEST
	lc1Buf[0] = '\0';
	fgets(lc1Buf, sizeof(lc1Buf), szpFpA);
	if (strcmp(lc1Buf, "")) {
		siRes = -1;
	}
#endif

	// テストファイルクローズ
#ifdef D_TEST
	fclose(szpFpI);
	fclose(szpFpA);
#endif

	// テスト結果
#ifdef D_TEST
	if (siRes == 0) {
		printf("OK %d\n", siTNo);
	}
	else {
		printf("NG %d\n", siTNo);
	}
#endif

	return 0;
}

// プログラム開始
int
main()
{

#ifdef D_TEST
	int i;
	for (i = D_TEST_SNO; i <= D_TEST_ENO; i++) {
		siTNo = i;
		fOne();
	}
#else
	fOne();
#endif

	return 0;
}



Measured memory_bytes: 1792
X,N=map(int,input().split())
P=list(map(int,input().split()))
P.sort()
#print(P)
def abs(a,b):
    if(a>b):
        ans=a-b
    else:
        ans=b-a

    return ans
h=100
for i in range(102):
    if(i not in P):
        if(h>abs(X,i)):
            h=abs(X,i)
            ans=i
            #print(i)
            #print(h)
print(ans)


Measured memory_bytes: 9196
#include<bits/stdc++.h>
#include<stdio.h>
#include<string>
#include<numeric>
using namespace std;
#define pb push_back
#define pf push_front

typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
template<typename T1,typename T2> inline void chmin(T1 &a,T2 b){if(a>b) a=b;}
template<typename T1,typename T2> inline void chmax(T1 &a,T2 b){if(a<b) a=b;}
#define mp make_pair
#define fi first
#define se second
typedef pair<int,int> pint;
#define All(s) s.begin(),s.end()
#define rAll(s) s.rbegin(),s.rend()
#define REP(i,a,b) for(int i=a;i<b;i++)
#define rep(i,n) REP(i,0,n)
#define sz(x) int(x.size())
#define INF 1e5
#define MODE 1000007
int main(){
	int n;
	cin>>n;
	vi v(n); 
	rep(i,n) cin>>v[i];
	vi c(n);
	rep(i,n) cin>>c[i];
	int ans=0;
	rep(i,n){
		ans+=max(0,v[i]-c[i]);
	}
	cout<<ans<<endl;

}


Measured memory_bytes: 256
import java.util.*;

class Main {
  public static void main (String[] args) throws java.lang.Exception {
    Scanner scanner = new Scanner(System.in);
    int L = scanner.nextInt();
    double result = ATCoder_abc159_c.largestVolume(L);
    System.out.printf("%f\n", result);
  }
}

class ATCoder_abc159_c {
    // Per Euclidean math, largest possible volume is a cube.
	public static double largestVolume(int L) {
		double lOver3 = (double) L / 3.0;
		double volume = lOver3 * lOver3 * lOver3;
      	return volume;
	}
}


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

int main() {
  int h1,m1,h2,m2,k;
    cin >> h1 >> m1 >> h2 >> m2 >> k;
    cout << (h2 * 60 + m2) - (h1 * 60 + m1) - k << endl;
 
  return 0;
}

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

const int MOD = 1000000007;
const int INF = 1e9;

//long long
using ll = long long;

//出力系
#define print(x) cout << x << endl
#define yes cout << "Yes" << endl
#define YES cout << "YES" << endl
#define no cout << "No" << endl
#define NO cout << "NO" << endl
 
// begin() end()
#define all(x) (x).begin(),(x).end()

//for
#define REP(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)
#define REPR(i,n) for(int i=n, i##_len=(n); i>=0; i--)
#define FOR(i,a,b) for(int i=(a), i##_len=(b); i<i##_len; ++i)

//最大公約数 
 ll gcd(ll a,ll b){
 if(b == 0) return a;
 return gcd(b,a%b);
 }

//最小公倍数
 ll lcm(ll a,ll b){
 ll g = gcd(a,b);
 return a / g * b; // Be careful not to overflow  if(a < b) return gcd(b, a);
  unsigned r;
  while ((r=a%b)) {
    a = b;
    b = r;
  }
  return b;
} 





int main(){
  ll N, H;
  cin >> N >> H;
  vector<int> a(N), b(N);
  REP(i, N) cin >> a.at(i) >> b.at(i);

  ll a_max = *max_element(all(a));
  sort(all(b));
  reverse(all(b));
  ll ans = 0;
  REP(i, N){
    if(a_max < b.at(i)){
      H -= b.at(i);
      ans++;
    }
    if(H <= 0) break;
  }
if(H > 0) ans += (H + (a_max - 1)) / a_max;
print(ans);
}

Measured memory_bytes: 1024
#include <iostream>
#include <sstream>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <cctype>
#include <cstring>
#include <climits>
#include <iomanip>
#include <bitset>
#include <algorithm>
#include <vector>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <list>
#include <map>

using namespace std;

bool valid(string a) {
  stack <char> s;
  for (int i = 0; i < a.size(); i++) {
    if (a[i] == '(') {
      s.push(a[i]);
    } else {
      if (s.empty()) return 0;
      char c = s.top();
      if (c != '(') return 0;
      s.pop();
    }
  }
  return (s.empty());
}

bool operator < (const string &a, const string &b) {
  if (a.size() != b.size()) {
    return a.size() < b.size();
  }
  for (int i = 0; i < a.size(); i++) {
    if (a[i] != b[i]) {
      return (a[i] < b[i]);
    }
  }
}

int main() {
  int n;
  string a, here;
  cin >> n >> a;
  string ans = string(400, '.');
  for (int i = 0; i <= 100; i++) {
    for (int j = 0; j <= 100; j++) {
      string add = string(i, '(');
      here = add + a;
      here += string(j, ')');
      if (!valid(here)) continue;
      if (here < ans) {
        ans = here;
      }
    }
  }
  cout << ans << endl;
  return 0;
}



Measured memory_bytes: 256
using System;
using static System.Console;
using static System.Math;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace AtCoder
{
    public class IO
    {
        public static string ReadStr() => Console.ReadLine();
        public static string[] ReadStrArr() => ReadStr().Split(' ');
        public static int ReadInt() => int.Parse(ReadStr());
        public static int[] ReadIntArr() => Array.ConvertAll(Console.ReadLine().Split(' '), int.Parse);
        public static double ReadDouble() => double.Parse(ReadStr());
        public static double[] ReadDoubleArr() => Array.ConvertAll(Console.ReadLine().Split(' '), double.Parse);
        public static long ReadLong() => long.Parse(ReadStr());
        public static long[] ReadLongArr() => Array.ConvertAll(Console.ReadLine().Split(' '), long.Parse);
    }

    class Template
    {
        static void Main(string[] args)
        {
            int a = IO.ReadInt();
            int b = IO.ReadInt();
            int h = IO.ReadInt();
            WriteLine((a + b) * h / 2);
        }
    }
}


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

signed main() {
  int n, m, x; cin >> n >> m >> x;
  vector<int> cell(n+1, 0);
  int sumL = 0, sumR = 0;
  for(int i = 0; i < m; i++) {
    int gate; cin >> gate;
    // 0-origin なので cell[gate-1]ではない
    cell[gate]++;
  }
  for(int i = 0; i < n+1; i++) {
    // x に料金所が無い事が保証されているため、x について調べる必要は無い
    if(i < x) sumL += cell[i];
    else sumR += cell[i];
  }
  cout << min(sumL, sumR) << endl;
  return 0;
}


Measured memory_bytes: 256
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner scan = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
        int N = scan.nextInt();
        int M = scan.nextInt();
        int[] c = new int[N];
        for (int i = 0; i < M; i++) {
            int a = scan.nextInt();
            int b = scan.nextInt();
            c[a-1] += 1;
            c[b-1] += 1;
        }
        for (int i : c) {
            System.out.println(i);
        }
    }
}


Measured memory_bytes: 21972
// E - Divisible Substring
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i,n) for(int i=0;i<(n);++i)
#define modadd(x,y,m) x=(x+(y))%(m)
#define modmul(x,y,m) x=(x*(y))%(m)
#define c2d(c) ((c)-'0') // char to digit

int main(){
	ll N,P; string S; cin>>N>>P>>S;
	ll ans = 0;
	if(P==2 || P==5){
		rep(i, N) if(c2d(S[N-1-i]) % P == 0) ans += N - i;
	}
	else{
		ll ten = 1;
		vector<ll> cnt(P, 0);
		ll r = 0;
		cnt[r]++;
		for(int left=N-1; left>=0; --left){
			modadd(r, c2d(S[left])*ten, P);
			modmul(ten, 10, P);
			cnt[r]++;
		}
		rep(r, P) ans += cnt[r] * (cnt[r]-1) / 2;
	}
	cout<< ans <<endl;
}

Measured memory_bytes: 640
#include <bits/stdc++.h>
using namespace std;
#define END '\n'
#define int long long
#define pb push_back
#define pii pair<int, int>
#define ff first
#define ss second
#define trace(x) cerr<<x<<END;
#define loop(i, a, b) for(int i = (a); i < (b); i++)
#define loopb(i, b, a) for(int i = (b); i > (a); --i) 
const int mod = 1e9+7;
const int mod1 = 998244353;
const int inf = 92233720ll;

void solve()
{
 int a,b;
 cin>>a>>b;
 cout<<max(0ll,a-b-b);
} 
signed main()
 {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0); 
     solve();
  //cerr<<END<<1.0*clock();
  return 0;
} 

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

int main() {
  string S; cin >> S;
  for (int i = 1; i < S.size(); i++) {
    if (S.at(i-1) == 'A' && S.at(i) == 'C') {
      cout << "Yes" << endl;
      return 0;
    }
  }
  cout << "No" << endl;
}

Measured memory_bytes: 256
#include<iostream>
#include<algorithm>
#include<string>
#include<vector>
#include<math.h>
#include<map>
using namespace std;
int main() {
    int x;
    cin >> x;
    int c500 = x / 500;
    int r500 = x % 500;
    int c5 = r500 / 5;
    cout << c500*1000+c5*5 << endl;
    return 0;
}

Measured memory_bytes: 256
/*
 * b.cc: 
 */

#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<iostream>
#include<string>
#include<vector>
#include<map>
#include<set>
#include<stack>
#include<list>
#include<queue>
#include<deque>
#include<algorithm>
#include<numeric>
#include<utility>
#include<complex>
#include<functional>

using namespace std;

/* constant */

/* typedef */

typedef pair<string,int> psi;
typedef queue<psi> qpsi;

/* global variables */

/* subroutines */

/* main */

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

  qpsi q;
  
  for (int i = 0; i < n; i++) {
    string nmi;
    int ti;
    cin >> nmi >> ti;
    q.push(psi(nmi, ti));
  }

  int t = 0;
  
  while (! q.empty()) {
    psi u = q.front(); q.pop();
    string &un = u.first;
    int &ut = u.second;

    if (ut <= qt) {
      t += ut;
      cout << un << ' ' << t << endl;
    }
    else {
      t += qt;
      ut -= qt;
      q.push(u);
    }
  }

  return 0;
}

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

using namespace std;

typedef long long ll;
typedef unsigned long long ull;

#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define RFOR(i,a,b) for(int i=(b)-1;i>=(a);i--)
#define REP(i,n) for(int i=0;i<(n);i++)
#define RREP(i,n) for(int i=(n)-1;i>=0;i--)
#define VSORT(v) sort(v.begin(), v.end())
#define DVSORT(v) sort(v.begin(), v.end(),greater<int>())
#define SORT(v, n) sort(v, v+n)
#define DSORT(v,n) sort(v, v+n,greater<int>())
#define vi vector<int>
#define pb push_back
#define P pair<int,int>


template <class T> void chmin(T&a, const T&b) { a = min(a,b); }
template <class T> void chmax(T&a, const T&b) { a = max(a,b); }

const double EPS =1e-9;
const long INF =999999999;
const long MOD =1000000007; //10^9+7
#define PI 3.14159265258979

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

int main(void){
	int A,B,C;
	cin>>A>>B>>C;
	
	
	FOR(i,1,B+2){
		if((A*i)%B==C){
			puts("YES");
			break;
		}else if(i==B+1){
			puts("NO");
		}
	}

	return 0;
}



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

const long long mod = 1e9+7;
int a[200050];

int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
	int n;
	cin>>n;
	long long sum = 0;
	for(int i = 1;i<=n;++i){
		cin>>a[i];
		sum += a[i];
	}
	
	long long ans = 0;
	for(int i = 1;i<=n-1;++i){
		sum -= a[i];
		ans += sum%mod*a[i]%mod;
		ans %= mod;
	}
	cout<<ans<<endl;
	return 0;
}

Measured memory_bytes: 4408
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <functional>
#include <cstring>
#include <cstdlib>
#include <cmath>
using namespace std;
using ll = long long;

template <class T, class F>
T UpperBound(T i0, T i1, F f) {
    while (i0 < i1) {
        T i = (i0 + i1) / 2;
        if (f(i)) i0 = i + 1; else i1 = i;
    }
    return i0;
}

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

    int n;
    cin >> n;

    ll k;
    cin >> k;

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

    vector<int> f(n);
    for (int i = 0; i < n; i++) {
        cin >> f[i];
    }
    sort(f.begin(), f.end());

    ll m = 0;
    for (int i = 0; i < n; i++) {
        m = max(m, (ll)a[i] * f[i]);
    }

    auto t = UpperBound<ll>(0, m, [&](auto t) {
        ll s = 0;
        for (int i = 0; i < n; i++) {
            if ((ll)a[i] * f[i] > t) {
                s += a[i] - t / f[i];
                if (s > k) return true;
            }
        }
        return false;
    });

    cout << t << endl;

    return 0;
}

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

#define hell                         1000000007
#define lcm(a,b)                     (a*b)/__gcd(a,b)
#define ll                           long long
#define vll                          vector<ll>
#define vi                           vector<int>
#define pll                          vector< pair<ll,ll> >
#define pb                           push_back
#define mp                           make_pair
#define all(v)                       v.begin(),v.end()
#define lbnd                         lower_bound
#define ubnd                         upper_bound
#define bs                           binary_search
#define F                            first
#define S                            second
#define rep(i,a,b)                   for(i=a;i<b;i++)
#define parr(a,n)                    for(i=0;i<n;i++) cout<<a[i]<<" ";cout<<endl;
#define pcont(a)                     for(auto i:a) cout<<i<<" ";cout<<endl;
#define ret(x)                       return cout<<x,0;
#define dbg(x)                       cout << #x << " is " << x << endl;
#define endl                           '\n'

using namespace std;

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);cout.tie(NULL);
    
    ll i,j,n,m,k,cnt=0,ans=0,t=1;
    cin>>n>>m;
    string a[n];
    rep(i,0,n) cin>>a[i];
    ll dp[n][m];
    rep(i,0,n) rep(j,0,m) dp[i][j]=0;
    if(a[0][0]=='#') ret(0)
    rep(j,0,m) 
    {
        if(a[0][j]=='#') break;
        dp[0][j]=1;
    }    
    rep(i,0,n)
    {
        if(a[i][0]=='#') break;
        dp[i][0]=1;
    }
    rep(i,1,n)
    {
        rep(j,1,m)
        {
            if(a[i][j]=='.'){
                ll val=0;
                if(a[i-1][j]!='#') val=(val%hell+dp[i-1][j]%hell)%hell;
                if(a[i][j-1]!='#') val=(val%hell+dp[i][j-1]%hell)%hell;
                dp[i][j]=val;
            }
        }
    }
    if(a[n-1][m-1]=='#') ret(0)
    ret(dp[n-1][m-1]%hell)
    return 0;
}

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

int main() {
	ios_base::sync_with_stdio(false);
	int n;
	cin >> n;
	vector<int> arr(n);
	vector<int> cnt[2];
	cnt[0].resize(1e5 + 100);
	cnt[1].resize(1e5 + 100);
	for(int i = 0; i < n; i++) {
		cin >> arr[i];
		cnt[i % 2][arr[i]]++;
	}
	vector<pair<int, int> > pos[2];
	for(int i = 0; i < 2; i++) {
		for(int j = 0; j < cnt[0].size(); j++) {
			if(cnt[i][j] > 0) {
				pos[i].push_back({cnt[i][j], j});
			}
		}
	}
	pos[0].push_back({0, -1});
	pos[1].push_back({0, -2});
	for(int x = 0; x < 2; x++)
		sort(pos[x].begin(), pos[x].end(), greater<pair<int, int> >());
	int res = 0;
	if(pos[0].front().second == pos[1].front().second) {
		res = max(pos[0][1].first + pos[1][0].first,
				pos[0][0].first + pos[1][1].first);
	} else {
		res = pos[0][0].first + pos[1][0].first;
	}
	res = n - res;
	cout << res << endl;
	return 0;
}


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

#define rep(i,n) for(int i=0; i<(n); i++)
#define reps(i,x,n) for(int i=x; i<(n); i++)
#define rrep(i,n) for(int i=(n)-1; i>=0; i--)
#define all(X) (X).begin(),(X).end()
#define X first
#define Y second
#define pb push_back
#define eb emplace_back

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

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 (a>b) { a=b; return 1; } return 0; }

template<class A, size_t N, class T> void Fill(A (&a)[N], const T &v){ fill( (T*)a, (T*)(a+N), v ); }



int main(){
	//ios_base::sync_with_stdio(false);
	ll N, ans=0;
	ll x[200005], s[200005];

	cin >> N;
	rep(i,N) cin >> x[i] >> s[i];

	ll sum = 0, mn = 0;
	rep(i,N){
		sum += s[i];
		chmax(ans, sum - mn);
		sum -= x[i+1] - x[i];
		chmin(mn, sum);
	}

	cout << ans << endl;

	return 0;
}


Measured memory_bytes: 3328
#include <iostream>;
#include <queue>;
#include <string>;
#include <vector>;
using namespace std;



int main() {
	string c;
	cin >> c;
	c += '1';
	int count = 0;
	int ans = 0;
	for (int i = 0; i < c.size(); i++)
	{
		if (c[i] == 'A' || c[i] == 'T' || c[i] == 'G' || c[i] == 'C') {
			count++;
		}
		else {
			if (count > ans) ans = count;
			count = 0;
		}
	}
	cout << ans << endl;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define db double
const int maxn=105;
const db pi=acos(-1.0);
struct point{
	db x,y;
	int id;
	point(db _x=0,db _y=0,db _id=0){x=_x,y=_y,id=_id;}
	friend point operator +(point a,point b){return point(a.x+b.x,a.y+b.y);}
	friend point operator -(point a,point b){return point(a.x-b.x,a.y-b.y);}
	friend point operator *(point a,db b){return point(a.x*b,a.y*b);}
	friend point operator /(point a,db b){return point(a.x/b,a.y/b);}
	friend db operator *(point a,point b){return a.x*b.x+a.y*b.y;}	
	friend db operator ^(point a,point b){return a.x*b.y-a.y*b.x;}
	friend bool operator <(point a,point b){return (a.x<b.x)||(a.x==b.x&&a.y<b.y);}
}p[maxn];
point st[maxn];
db ans[maxn];
int n,top;
inline db cross(point a,point b,point p){return (p-a)^(b-a);}
inline db sqr(db x){return x*x;}
inline db dist(point a,point b){return sqrt(sqr(a.x-b.x)+sqr(a.y-b.y));}
void convex(){
	sort(p+1,p+n+1);
	st[++top]=p[1],st[++top]=p[2];
	for(int i=3;i<=n;i++){
		while(top>=2&&cross(st[top-1],st[top],p[i])<=0) top--;
		st[++top]=p[i];
	}
	st[++top]=p[n-1];
	int tmp=top;
	for(int i=n-2;i>=1;i--){
		while(top>=tmp&&cross(st[top-1],st[top],p[i])<=0) top--;
		st[++top]=p[i];
	}
}
int main(){
	scanf("%d",&n);
	if(n==1){
		puts("1.0");
		return 0;
	}
	if(n==2){
		printf("0.5\n0.5\n");
		return 0;
	} 
	for(int i=1,x,y;i<=n;i++){
		scanf("%d%d",&x,&y);
		p[i]=point(x,y,i);
	} 
	convex();
	st[0]=st[top-1];
	if(top==3){
		ans[st[1].id]=0.5;
		ans[st[2].id]=0.5;
	}
	else{
		for(int i=1;i<top;i++){
			db len1=dist(st[i],st[i+1]);
			db len2=dist(st[i],st[i-1]);
			db ang=acos(((st[i+1]-st[i])*(st[i-1]-st[i]))/(len1*len2));
			ans[st[i].id]=(pi-ang)/(2*pi);	
		}
	}
	for(int i=1;i<=n;i++) printf("%.12lf\n",ans[i]);
	return 0;
}

Measured memory_bytes: 256
/*input
15 22
8 13 33418
14 15 55849
7 10 15207
4 6 64328
6 9 86902
15 7 46978
8 14 53526
1 2 8720
14 12 37748
8 3 61543
6 5 32425
4 11 20932
3 12 55123
8 2 45333
9 12 77796
3 9 71922
12 15 70793
2 4 25485
11 6 1436
2 7 81563
7 11 97843
3 1 40491
*/
#include <bits/stdc++.h>
#pragma GCC optimize("unroll-loops,no-stack-protector")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef pair<double,double> pdd;
#define IOS ios_base::sync_with_stdio(0); cin.tie(0)
#define ALL(a) a.begin(),a.end()
#define SZ(a) ((int)a.size())
#define F first
#define S second
#define REP(i,n) for(int i=0;i<((int)n);i++)
#define pb push_back
#define MP(a,b) make_pair(a,b)
#define SORT_UNIQUE(c) (sort(c.begin(),c.end()), c.resize(distance(c.begin(),unique(c.begin(),c.end()))))
#define GET_POS(c,x) (lower_bound(c.begin(),c.end(),x)-c.begin())
template<typename T1,typename T2>
ostream& operator<<(ostream& out,pair<T1,T2> P){
	out<<'('<<P.F<<','<<P.S<<')';
	return out;
}

//}}}
const ll maxn=15;
const ll maxlg=__lg(maxn)+2;
const ll INF64=8000000000000000000LL;
const int INF=0x3f3f3f3f;
const ll MOD=ll(1e9+7);
const double PI=acos(-1);
//const ll p=880301;
//const ll P=31;

ll mypow(ll a,ll b){
	ll res=1LL;
	while(b){
		if(b&1) res=res*a%MOD;
		a=a*a%MOD;
		
		b>>=1;
	}
	return res;
}

int es[1<<maxn];
int adj[maxn][maxn];
int dp[maxn][1<<maxn];
int main(){
	IOS;
	int n,m;
	cin>>n>>m;
	ll tt=0;
	REP(i,m){
		int u,v,d;
		cin>>u>>v>>d;
		u--;v--;
		adj[u][v]=adj[v][u]=d;
		tt+=d;
	}
	for(int i=1;i<(1<<n);i++){
		int tmp=__lg(i&-i);
		es[i]=es[i^(1<<tmp)];
		for(int j=tmp+1;j<n;j++) if(i&(1<<j)){
			es[i]+=adj[tmp][j];
		}
	}
	REP(i,n) REP(j,1<<n) dp[i][j]=-INF;
	REP(mask,1<<n) for(int i=0;i<n;i++) if(mask&(1<<i)){
		if(i==0) dp[i][mask]=es[mask];
		else{
			int pre=mask^(1<<i);
			for(int sub=pre;sub>0;sub=(sub-1)&pre){
				REP(j,n) if(sub&(1<<j)){
					if(adj[j][i]) dp[i][mask]=max(dp[i][mask],dp[j][sub]+es[sub^mask]+adj[j][i]);
				}
			}
		}
	}
	cout<<tt-dp[n-1][(1<<n)-1]<<'\n';
	return 0;
}


Measured memory_bytes: 2304
#include<cstdio>
long long n,x;
long long gcd(long long x,long long y)
{
	if (!y)return x;
	return gcd(y,x%y);
}
int main()
{
	scanf("%lld%lld",&n,&x);
	printf("%lld",3*(n-gcd(n,x)));
}

Measured memory_bytes: 128
#include <iostream>
#include <sstream>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <ctime>
#include <cstring>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <deque>
#include <map>
#include <set>
#include <bitset>
#include <numeric>
#include <utility>
#include <iomanip>
#include <algorithm>
#include <functional>
#include <unordered_map>
using namespace std;

#define REP(i, s) for (int i = 0; i < s; ++i)
#define ALL(v) (v.begin(), v.end())
#define COUT(x) cout << #x << " = " << (x) << " (L" << __LINE__ << ")" << endl
#define EACH(i, s) for (__typeof__((s).begin()) i = (s).begin(); i != (s).end(); ++i)

template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
template<class T1, class T2> ostream& operator << (ostream &s, pair<T1,T2> P)
{ return s << '<' << P.first << ", " << P.second << '>'; }
template<class T> ostream& operator << (ostream &s, vector<T> P)
{ for (int i = 0; i < P.size(); ++i) { if (i > 0) { s << " "; } s << P[i]; } return s; }
template<class T> ostream& operator << (ostream &s, vector<vector<T> > P)
{ for (int i = 0; i < P.size(); ++i) { s << endl << P[i]; } return s << endl; }
template<class T> ostream& operator << (ostream &s, set<T> P)
{ EACH(it, P) { s << "<" << *it << "> "; } return s << endl; }
template<class T1, class T2> ostream& operator << (ostream &s, map<T1,T2> P)
{ EACH(it, P) { s << "<" << it->first << "->" << it->second << "> "; } return s << endl; }


vector<int> A;
int main() {
    A.resize(3);
    for (int i = 0; i < 3; ++i) cin >> A[i];
    sort(A.begin(), A.end(), greater<int>());
    int sum = A[0] - A[1] + A[0] - A[2];
    
    if (sum & 1) {
        cout << (sum + 3) / 2 << endl;
    }
    else {
        cout << sum / 2 << endl;
    }
}

























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

int main(){
  int w,h,n;
  cin >> w >> h >> n;
  int x1=0;
  int x2=w;
  int y1=0;
  int y2=h;
  vector<int> x(n);
  vector<int> y(n);
  vector<int> a(n);
  for(int i=0;i<n;i++){
    cin >> x[i] >> y[i] >> a[i];
  }
  for(int i=0;i<n;i++){
    if(a[i]==1){
      x1=max(x[i],x1);
    }else if(a[i]==2){
      x2=min(x[i],x2);
    }else if(a[i]==3){
      y1=max(y[i],y1);
    }else if(a[i]==4){
      y2=min(y[i],y2);
    }
  }
  w -= (w-x2)+x1;
  h -= (h-y2)+y1;
  
  if(x1>x2){
    cout << 0 << endl;
  }else if(y1>y2){
    cout << 0 << endl;
  }else{
    cout << w*h << endl;
  }
}

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

int gcd(int n, int m){
    if(n % m == 0)return m;
    return gcd(m,n%m);
}

int main(void){
    int K;
    cin >> K;
    int sum =0;
    for(int a = 1; a <= K; a++){
        for(int b = 1; b<=K; b++){
            for(int c=1; c<=K; c++){
                sum += gcd(c,gcd(a,b));
            }
        }
    }
    cout << sum;
    return 0;
}

Measured memory_bytes: 3584
#include<bits/stdc++.h>
#define rep(i,N) for(int i=0;i<(N);i++)
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
using namespace std;
const long long MOD = 1e9 + 7;
const long long INF = 1e12;
const int inf = 1e9;
typedef long long ll;
typedef pair<ll,int> P;
typedef set<int> S;
int main(){
    int n;
    cin>>n;
    vector<ll> v(n,0);
    rep(i,n){
        cin>>v[i];
    }
    ll cnt=0;
    ll min=inf;
    while(1){
        min=inf;
        cnt=0;
        rep(i,n){
            if(v[i]==0){
                cnt++;
                continue;
            }
            else{
                if(min>v[i]){
                    min=v[i];
                }
            }
        }
        if(cnt==n-1){
            cout<<min<<endl;
            return 0;
        }
        //rep(i,n) cout<<v[i]<<" ";
        //cout<<endl;
        sort(v.begin(),v.end());
        int min2=inf;
        int z=0;
        rep(i,n){
            if(v[i]!=0){
                min2=v[i];
                z=i;
                break;
            }
        }
        //cout<<v[z]<<endl;
        //rep(i,n) cout<<v[i]<<" ";
        //cout<<endl;
        for(int i=1;i<n;i++){
            if(z==i) {

            }
            else{
                v[i]=v[i]%min2;
            }
        }
    }
    return 0;
}

Measured memory_bytes: 1024
import java.util.*;

public class Main {
	public static void main (String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int c = sc.nextInt();
		PriorityQueue<Program> queue = new PriorityQueue<>();
		for (int i = 0; i < n; i++) {
		    queue.add(new Program(sc.nextInt(), sc.nextInt(), sc.nextInt()));
		}
		int[] imos = new int[100001];
		while (queue.size() > 0) {
		    Program p = queue.poll();
		    while (queue.size() > 0 && queue.peek().channel == p.channel && queue.peek().start == p.end) {
		        p.end = queue.poll().end;
		    }
		    imos[p.start - 1]++;
		    imos[p.end]--;
		}
		int max = 0;
		for (int i = 1; i < imos.length; i++) {
		    imos[i] += imos[i - 1];
		    max = Math.max(max, imos[i]);
		}
		System.out.println(max);
    }
    
    static class Program implements Comparable<Program> {
        int start;
        int end;
        int channel;
        
        public Program(int start, int end, int channel) {
            this.start = start;
            this.end = end;
            this.channel = channel;
        }
        
        public int compareTo(Program another) {
            if (channel == another.channel) {
                return start - another.start;
            } else {
                return channel - another.channel;
            }
        }
    }
}



Measured memory_bytes: 93924
#include <bits/stdc++.h>
using namespace std;
int a[4];
int main() {
	//freopen("1.txt","r",stdin);
	scanf("%d %d %d",&a[1],&a[2],&a[3]);
	int t1=abs(a[2]-a[1])+abs(a[3]-a[2]);
	int t2=abs(a[3]-a[1])+abs(a[2]-a[3]);
	int t3=abs(a[1]-a[2])+abs(a[3]-a[1]);
	int t4=abs(a[3]-a[2])+abs(a[1]-a[3]);
	int t5=abs(a[1]-a[3])+abs(a[2]-a[1]);
	int t6=abs(a[2]-a[3])+abs(a[1]-a[2]);
	printf("%d\n",min(t1,min(t2,min(t3,min(t4,min(t5,t6))))));
	return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main(){
  int n;
  cin >> n;
  int a[n];
  int i;
  for(i=0;i<n;i++){
    cin >> a[i];
  }
  long moneySum[n];
  moneySum[0] = abs(a[0]);
  for(i=1;i<n;i++){
    moneySum[i] = moneySum[i-1] + abs(a[i]-a[i-1]);
  }
  long tmp;


  tmp = moneySum[n-1] - moneySum[1] + abs(a[1]) + abs(a[n-1]);
  cout << tmp << endl;
  
  for(i=1;i<n-1;i++){
    tmp = moneySum[n-1] - moneySum[i+1] + abs(a[i+1]-a[i-1]) + abs(a[n-1]) + moneySum[i-1];
    cout << tmp << endl;
  }

  tmp = moneySum[n-2]+abs(a[n-2]);
  cout << tmp << endl;
  
}

Measured memory_bytes: 2432
#include<stdio.h>
#include<string.h>
int main(void){
  int i,j;
  char c;
  char A[101]={'\0'};
  char S[101]={'\0'};
  scanf("%s",A);
  scanf("%s",S);
  for(i=0;i<strlen(S)-1;i++){
    for(j=i+1;j<strlen(S);j++){
      if(S[i]<S[j]){
        c=S[i];
        S[i]=S[j];
        S[j]=c;
      }
    }
  }
  for(i=0;i<strlen(A)-1;i++){
    for(j=i+1;j<strlen(A);j++){
      if(A[i]>A[j]){
        c=A[i];
        A[i]=A[j];
        A[j]=c;
      }
    }
  }
  if(strcmp(A,S)<0){
    printf("Yes\n");
  }else{
    printf("No\n");
  }
  return 0;
}

Measured memory_bytes: 128
#include<iostream>
#include<cmath>
#include<algorithm>
typedef long long ll;
using namespace std;
void solve()
{
	int n;
	cin>>n;
	if (n%10==2||n%10==4||n%10==5||n%10==7||n%10==9)
		cout<<"hon";
	else if (n%10==3)
		cout<<"bon";
	else
		cout<<"pon";
}
int main() 
{
	ios::sync_with_stdio(false);
	solve();
	return 0;
}

Measured memory_bytes: 3652
#include <bits/stdc++.h>
#define rep(i,n)for(long long i=0;i<(long long)(n);i++)
#define all(a) a.begin(), a.end()
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll, ll> P;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
 
const ll MOD=1e9+7;
const ll INF=1e18;
const int MAX=510000;
const double pi=acos(-1);
int dx[8] = {1,0,-1,0,1,1,-1,-1};
int dy[8] = {0,1,0,-1,-1,1,1,-1};
// int d[13]={0,31,28,31,30,31,30,31,31,30,31,30,31};

int main(){
  cin.tie(0);
  ios::sync_with_stdio(false); 
  
  int n,k;
  cin >> n >> k;
  vector<ll>p(n);
  rep(i,n)cin>>p[i];
  sort(p.begin(),p.end());
  if(p[n-1]<=0 && k&1){
    ll ans = 1;
    rep(i,k){
      ans*=p[n-1-i];
      ans%=MOD;
    }
    while(ans<0)ans+=MOD;
    cout << ans << endl;
    return 0;
  }
  ll ans = 1;
  ll nowp=n-1,nowm=0;
  ll cnt = 0;
  while(cnt<k){
    if(nowp-nowm>=1 && cnt+2<=k){
      ll resp=p[nowp]*p[nowp-1];
      ll resm=p[nowm]*p[nowm+1];
      if(resp>resm){
        cnt++;
        p[nowp]%=MOD;
        ans*=p[nowp];
        ans%=MOD;
        nowp--;
      }
      else{
        cnt+=2;
        nowm+=2;
        resm%=MOD;
        ans*=resm;
        ans%=MOD;
      }
    }
    else{
      cnt++;
      p[nowp]%=MOD;
      ans*=p[nowp];
      ans%=MOD;
      nowp--;
    }
  }
  while(ans<0)ans+=MOD;
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 4780
#include<iostream>

using namespace std;

int main(){
int A,B,C;

    cin>>A>>B>>C;
    for(int i=1;i<=B;++i){
        if((i*A)%B==C){
            cout<<"YES"<<endl;
            return 0;
        }
    }

    cout<<"NO"<<endl;


}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define re register
#define For(i, j, k) for(re int i = j; i <= k; i++)
#define foR(i, j, k) for(re int i = j; i >= k; i--)
#define Cross(i, j, k) for(re int i = j; i; i = k)
#define debug(x) (cout << "#x = " << x << endl)
using namespace std;
typedef long long ll;
const ll N = 200011;
const ll p = 1e9 + 7;
const ll inf = 0x3f3f3f3f3f3f;

ll n, A, B, c[N], w[N];

namespace IO {

	#define dd (ch = getchar())
	inline ll read() {
		ll x = 0; bool f = 0; char ch = getchar();
		for (; !isdigit (ch); dd) f ^= (ch == '-');
		for (; isdigit (ch); dd)  x = (x << 1) + (x << 3) + (ch ^ 48);
		return f? -x: x;
	}
	#undef dd
	
	inline void write ( ll x ) {
		if ( x < 0 ) x = -x, putchar ('-');
		if ( x > 9 ) write ( x / 10 );
		putchar ( x % 10 | 48 );
	}
	
	inline void wrn ( ll x ) { write (x); putchar (' '); }
	
	inline void wln ( ll x ) { write (x); putchar ('\n'); }
	
	inline void wlnn ( ll x, ll y ) { wrn (x); wln (y); }

}

using namespace IO;

namespace Subtask1 {
	
	ll ans = 0;
	
	inline void dfs ( ll now, ll pos ) {
		if ( now == n + 1 || pos == n + 1 ) return ;
		if ( c[now] != c[pos] && w[now] + w[pos] <= B ) ans++;
		if ( ans == p ) ans = 0;
		dfs ( now, pos + 1 ); 
		if ( now != pos ) dfs ( now + 1, pos + 1 );
	}
	
	inline void main () {
		dfs ( 1, 1 );
		wln (ans + 3); exit (0);
	}
	
}

namespace Subtask2 {
	
	inline void main () {
		puts("1"); exit (0);
	}
	
}

namespace Subtask3 {
	
	ll m, mn[N], fac[N], inv[N], cnt[N];
	
	inline ll power ( ll a, ll b ) {
		ll res = 1;
		for (; b; b >>= 1, a = a * a % p) res = (b & 1)? res * a % p: res;
		return res;
	}
	
	inline ll C ( ll n, ll m ) {
		if ( n < m || m < 0 ) return 0;
		return fac[n] * inv[m] % p * inv[n - m] % p;
	}
	
	inline void Init() {
		For ( i, 1, n ) mn[i] = inf;
		fac[0] = 1;
		For ( i, 1, n ) fac[i] = fac[i - 1] * i % p;
		inv[n] = power ( fac[n], p - 2 );
		foR ( i, n - 1, 0 ) inv[i] = inv[i + 1] * (i + 1) % p;
		For ( i, 1, n )
			cnt[c[i]]++, mn[c[i]] = min ( w[i], mn[c[i]] );
	}
	
	inline void main () {
		Init();
		For ( i, 1, n ) if ( mn[i] != inf ) 
			if ( m == 0 || mn[i] < mn[m] ) m = i;
		ll t = inf;
		For ( i, 1, n ) 
			if ( mn[i] != inf && i != m ) t = min ( t, mn[i] );
		For ( i, 1, n ) 
			if ( (w[i] == mn[c[i]] || 
				w[i] + mn[c[i]] > A) 
					&& (c[i] == m || w[i] + mn[m] > B) 
						&& (c[i] != m || w[i] + t > B) ) cnt[c[i]]--;
		ll num = cnt[m];
		For ( i, 1, n )
			if ( mn[i] != inf && i != m )
				if ( mn[i] + mn[m] <= B ) num += cnt[i];
		ll ans = 1;
		For ( i, 1, n ) if ( mn[i] != inf 
			&& (i == m || mn[i] + mn[m] <= B) )
				ans = ans * C(num, cnt[i]) % p, num -= cnt[i];
		wln (ans); exit (0);
	}
	
}

ll f = 1;

int main() {
//	freopen("keep.in", "r", stdin);
//	freopen("keep.out", "w", stdout);
	n = read(), A = read(), B = read();
	For ( i, 1, n ) {
		c[i] = read(), w[i] = read();
		if ( c[i] != c[1] ) f = 0;
	}
//	if ( n <= 20 ) 
//				Subtask1::main ();
	if (f) 	Subtask2::main ();
	else 	Subtask3::main (); return 0;
}

/*
4 7 3
3 2
4 3
2 1
4 4

2

1 1 1
1 1

1
*/


Measured memory_bytes: 9600
typedef long long ll;
typedef long double ld;
#include <bits/stdc++.h>
using namespace std;

std::vector<ll> is_prime( 1e6+10,0 );

vector<long long> divisor(long long n) {
    vector<long long> ret;
    ll now = n;
    map<ll,ll> e;
    while(is_prime[now]!=0){
        e[is_prime[now]]++;
        now /= is_prime[now];
    }
    ret = {1};
    for (auto ee : e) {
        // std::cout << ee.first<<" "<<ee.second << std::endl;
        vector<ll> tret;
        for (auto es : ret) {
            tret.push_back(es);
        }
        for (auto es : tret) {
            for (int i = 1; i <= ee.second; i++) {
                ret.push_back(es*round(pow(ee.first,i)));
            }
        }
    }
    
    sort(ret.begin(), ret.end()); // 昇順に並べる
    ret.erase(std::unique(ret.begin(), ret.end()), ret.end());
    // for (auto e : ret) {
    //     std::cout << e<<" ";
    // }
    // std::cout << std::endl;
    if(n==1){
        return {1};
    }
    return ret;
}
int main() {
    ll N = 1e6+10;
    for( int i = 2; i <= N; i++ )
    {
        is_prime[ i ] = 1;
    }
    
    for( int i = 2; i <= N; i++ )
    {
        if( is_prime[ i ] ==1)
        {
            is_prime[i]=i;
            for( int j = 2 * i; j <= N; j += i )
            {
                is_prime[ j ] = i;
            }
        }
    }
    
    ll n;
    std::cin >> n;
    vector<ll> a(n);
    map<ll,ll> ex;
    
    for (int i = 0; i < n; i++) {
        std::cin >> a[i];
        ex[a[i]]++;
    }
    ll cnt = 0;
    for (int i = 0; i < n; i++) {
        bool ok = true;
        for (auto e : divisor(a[i])) {
            if(ex[e]>0){
                if(e==a[i]){
                    if(ex[e]==1){
                        continue;
                    }
                }
                ok=false;
                break;
            }
        }
        if(ok)cnt++;
    }
    
    std::cout << cnt << std::endl;
    
    
}


Measured memory_bytes: 51552
#include<iostream>
#include<algorithm>
#include<vector>
#include<map>
#include<cstdio>
#include<sstream>
#include<iterator>
#include<ctime>
#include<iomanip>
#define pb push_back
#define F first
#define S second 
#define all(n) n.begin(),n.end()
using namespace std;

int graph[110][110][100];

void draw(int x1,int y1,int z1,int x2,int y2,int z2)
{

  for(int i=x1;i<x2;i++)
    for(int j=y1;j<y2;j++)
      for(int k=z1;k<z2;k++)
	graph[i][j][k]++;
}

int main()
{
  int N,K;  
  
  cin >> N >> K;
  vector<int> X,Y,Z,X_1,Y_1,Z_1,X_2,Y_2,Z_2;
  for(int i=0;i<110;i++)
    for(int j=0;j<110;j++)
      for(int k=0;k<110;k++)
	graph[i][j][k] = 0;

  for(int i=0;i<N;i++)
    {
      int x1,x2,y1,y2,z1,z2;
      cin >> x1 >> y1 >> z1 >> x2 >> y2 >> z2;
      X_1.pb(x1),Y_1.pb(y1),Z_1.pb(z1),X_2.pb(x2),Y_2.pb(y2),Z_2.pb(z2);
      X.pb(x1),X.pb(x2),Y.pb(y1),Y.pb(y2),Z.pb(z1),Z.pb(z2);
    }
  
  sort(all(X)),sort(all(Y)),sort(all(Z));
  X.erase(unique(all(X)),X.end());
  Y.erase(unique(all(Y)),Y.end());
  Z.erase(unique(all(Z)),Z.end());
  
  for(int i=0;i<X_1.size();i++)
    {
      
      X_1[i] = find(all(X),X_1[i])-X.begin();
      Y_1[i] = find(all(Y),Y_1[i])-Y.begin();
      Z_1[i] = find(all(Z),Z_1[i])-Z.begin();
    
      X_2[i] = find(all(X),X_2[i])-X.begin();
      Y_2[i] = find(all(Y),Y_2[i])-Y.begin();
      Z_2[i] = find(all(Z),Z_2[i])-Z.begin();
    
    }
  
  for(int i=0;i<N;i++)
    draw(X_1[i],Y_1[i],Z_1[i],X_2[i],Y_2[i],Z_2[i]);

  long long ans = 0;
  for(int i=0;i<X.size()-1;i++)//x
    for(int j=0;j<Y.size()-1;j++)//y
      for(int k=0;k<Z.size()-1;k++)//z
	if(graph[i][j][k] < K)
	  continue;
	else
	  ans += (long long)(X[i+1]-X[i])*(long long)(Y[j+1]-Y[j])*(long long)(Z[k+1]-Z[k]);
	    	  
	 	 
  cout << ans << endl;

  return 0;
}

Measured memory_bytes: 5944
#include<iostream>
#include<vector>
#include<cstring>
#include<algorithm>
#include<cmath>
#include<queue>
#include<deque>
#include<map>
#include<bitset>
using namespace std;

typedef long long ll;
#define rep(i, n) for(int i = 0;i < (n);i++)
#define repr(i, n) for(int i = (n);i >= 0;i--)
#define repf(i, m, n) for(int i = (m);i < (n);i++)
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 dx[] = {0, 1, 0, -1}, dy[] = {1, 0, -1, 0};
//////////////////////////////////////////////////
ll mod = 1e9+7;

int main() {
    int n, k; cin >> n >> k;
    
    ll ans = 0;
    ll s = 0, e = 0;
    rep(i,k) (s += i) %= mod;
    for (int i = n; i >= n-k+1; i--) (e += i) %= mod;
    repf(i,k,n+2) {
        // cout << s << " " << e << endl;
        ll tmp = e-s+1;
        if (tmp < 0) (tmp = e+1+mod-s) %= mod;
        (ans += tmp) %= mod;
        (s += i) %= mod;
        (e += n-i) %= mod;
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 3632
#include <iostream>
#include <stdio.h>
#include <string>
#include <math.h>
#include <iomanip>
#include <vector>
#include <algorithm>
#include <cassert>
#include <utility>
#include <numeric>
#include <cstring>
#include <map>
#include <set>
#define rep(i,n) for (int i=0; i<(n); ++i)

using namespace std;
using ll = long long;

int main(){
    int N;

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

    sort(L.begin(),L.end());
    ll ans = 0;
    
    for (int i=0;i<N-2;i++){
        for (int j=i+1;j<N-1;j++){
            for(int k=N-1;k>j;k--){
                if(L[k] < L[i] + L[j]){
                    ans += 1;
                }
            }
        }
    }

    cout << ans;


    
}

Measured memory_bytes: 256
to=input()

if to=="SUN":
  print(7)
elif to=="MON":
  print(6)
elif to=="TUE":
  print(5)
elif to=="WED":
  print(4)
elif to=="THU":
  print(3)
elif to=="FRI":
  print(2)
else:
  print(1)

Measured memory_bytes: 3060
#include <algorithm>
#include <iostream>
#include <vector>

using namespace std;

typedef long long ll;

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

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

vector<ll> p;

double solve(const int N, const int K) {
    double acc = 0;
    double maximum = 0;
    for (int i = 0; i < K; i++) {
        acc += (1 + p[i]) / 2.0;
    }
    maximum = acc;

    for (int i = K; i < N; i++) {
        acc -= (1 + p[i - K]) / 2.0;
        acc += (1 + p[i]) / 2.0;
        chmax(maximum, acc);
    }

    return double(maximum);
}

int main(void) {
    int N, K;
    cin >> N >> K;

    p.resize(N);
    for (int i = 0; i < N; i++) {
        cin >> p[i];
    }

    printf("%.7f\n", solve(N, K));

    return 0;
}


Measured memory_bytes: 1792
# import numpy as np
n = int(input())
a_lst = list(map(int, input().split()))
x = 10 ** 18

# ans = np.prod(a_lst)



ans = 1
if 0 in a_lst:
    # print("a")
    ans = 0
else:
    for i in range(n):
        ans *= a_lst[i]
        if ans > x:
            ans = -1
            break
        # elif ans == 0:
        #     break
    
# if ans > x:
#     print(-1)
# else:
#     print(ans)
print(ans)

Measured memory_bytes: 21784
<?php
  $N = trim(fgets(STDIN));
  $str = trim(fgets(STDIN));
  
  if($N%2!=0) {
    echo "No";
  }
  else {
    $array1 = substr($str,0,$N/2);
    $array2 = substr($str,$N/2,$N);
    if($array1==$array2) {
        echo "Yes";
    }
    else {
        echo "No";
    }
  } 
 ?>

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

int main(void){
	string s;
	cin >> s;
	int ans = 0;
	for(int i = 0; i < s.size(); ++i){
		if(s[i]=='o') ans++;
	}
	cout << (ans + (15-s.size())>=8 ? "YES" : "NO") << endl;
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define FOR(i,o,n) for(long long i = o;i<n;i++)
#define oneforall ios::sync_with_stdio(false);cin.tie(0);
#define all(v) (v).begin(),(v).end()
#define ini(...) int __VA_ARGS__; in(__VA_ARGS__)
#define inl(...) long long __VA_ARGS__; in(__VA_ARGS__)
#define ins(...) string __VA_ARGS__; in(__VA_ARGS__)
#define int long long 
const long long inf=1e18;
void in(){} template <typename T,class... U> void in(T &t,U &...u){ cin >> t; in(u...);}
void out(){cout << "\n";} template <typename T,class... U> void out(const T &t,const U &...u){ cout << t; if(sizeof...(u)) cout << " "; out(u...);}
typedef vector<int> vi;
typedef vector<long long> vl;
typedef long long ll;
typedef vector<pair<long, long > > vpll;
typedef vector<pair<int, int > > vpii;
#define FORR(x,arr) for(auto& x:arr)
#define ZERO(a) memset(a,0,sizeof(a))





//3111111111111111111111111111111
	

	void solve(){
		

		ini(x);
		ini(k);
		ini(d);
		if(abs(x)/d>=k){
			return out(abs(x)-k*d);
		}
		int tmp1 = abs(x)/d;
		int tmpamari  = abs(x)%d;
		if((k-tmp1)%2 == 0){
			return out(tmpamari);
		}
		else{
			return out(abs(tmpamari-d));
		}
		
			
			
			


				
		


		
		
		
		

		


		
		
	}



	



















int32_t main() {
	oneforall
	oneforall
	oneforall
	oneforall
	oneforall
	oneforall
	oneforall
	oneforall
	oneforall
	oneforall
	oneforall
	oneforall
	oneforall 
	oneforall

	solve();
	


	return 0;
}


Measured memory_bytes: 3688
"use strict"
const create = () => {
    const input = require("fs").readFileSync("/dev/stdin", "utf8").trim().split("\n");
    const res = {
        "list": input, "index": 0, "max": input.length,
        "hasNext": function() {return this.index < this.max},
        "next": function() { if (!this.hasNext()) {throw "ArrayIndexOutOfBoundsException";}else{return this.list[this.index++];}}
    };
    return res;
}
const o = create();
const next = () => o.next()
const nextInt = () => parseInt(o.next())
const nextStrArray = () => o.next().split(" ")
const nextIntArray = () => o.next().split(" ").map(el => parseInt(el))
const nextCharArray = () => o.next().split("")
const hasNext = () => o.hasNext()
const myout = (...x) => console.log(...x)
const Main = () => {
    let s = next().split("").sort()
    let t = next().split("").sort().reverse()
    if(s < t) console.log("Yes")
    else console.log("No")

}
Main()


Measured memory_bytes: 29616
s = input()
if s == "SUN":
    print(7)
elif s == "MON":
    print(6)
elif s == "TUE":
    print(5)
elif s == "WED":
    print(4)
elif s == "THU":
    print(3)
elif s == "FRI":
    print(2)
elif s == "SAT":
    print(1)

Measured memory_bytes: 38384
#include "bits/stdc++.h"
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
const long long MOD = 1e9 + 7, MAX = 1e18, larg = 1e5, INF = -1e9;
long long A, B, C, D, E, F, G, H, I, J, K, L, N, M, O, P, Q, R, S, T, U, V, W;
typedef long long ll;
typedef pair<ll, ll> Pa;

int main()
{
	bool flag[100];
	cin >> N >> K;
	rep(i, N) {
		flag[i] = false;
	}
	rep(i, K) {
		cin >> D;
		rep(j, D) {
			cin >> A;
			A--;
			flag[A] = true;
		}
	}
	int cnt = 0;
	rep(i, N) {
		if (!flag[i]) cnt++;
	}
	cout << cnt;
}


Measured memory_bytes: 3624
#include <algorithm>
#include <cmath>
#include <complex>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <vector>
#include <functional>
#include <cstring>
#include <regex>
#include <random>
#include <cassert>
#include <stack>
#include <climits>
using namespace std;

#pragma region

#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define repr(i, s, n) for (int i = (s); i < (int)(n); i++)
#define revrep(i, n) for (int i = (n) - 1; i >= 0; i--)
#define revrepr(i, s, n) for (int i = (n) - 1; i >= s; i--)
#define debug(x) cerr << #x << ": " << x << "\n"
#define popcnt(x) __builtin_popcount(x)

const double PI = acos(-1.0);

using ll = long long;
using P = pair<int, int>;

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

template<class T>
istream& operator >>(istream &is, vector<T> &v) {
    for (int i = 0; i < (int)v.size(); i++) cin >> v.at(i);
    return is;
}

template<class T, class U>
ostream& operator <<(ostream &os, pair<T, U> p) {
    cout << '(' << p.first << ", " << p.second << ')';
    return os;
}

template<class T>
void print(const vector<T> &v, const string &delimiter = " ") { rep(i, v.size()) cout << (0 < i ? delimiter : "") << v.at(i); cout << endl; }

template<class T>
void print(const vector<vector<T>> &vv, const string &delimiter) { for (const auto &v: vv) print(v, delimiter); }

#pragma endregion


int main() {
    int h, w, k;
    cin >> h >> w >> k;
    vector<string> c(h);
    cin >> c;

    int ans = 0;
    rep(bit_h, 1 << h) rep(bit_w, 1 << w) {
        int cnt = 0;
        rep(i, h) rep(j, w) {
            if (bit_h >> i & 1) continue;
            if (bit_w >> j & 1) continue;

            if (c[i][j] == '#') cnt++;
        }

        if (cnt == k) ans++;
    }
    cout << ans << endl;
}

Measured memory_bytes: 3632