akhauriyash/Code-Regression huggingface dataset:
#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 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 int MOD=1e9+7;
const ll INF=1e18;
const ll inf=1e9;
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};
 
const int MAX=510000;


int main(){
  cin.tie(0);
  ios::sync_with_stdio(false); 
   
  ll n,h;
  cin >> n >> h;
  vector<ll> a(n),b(n);
  rep(i,n) cin >> a[i] >> b[i];
  
  sort(a.begin(),a.end(),greater<ll>());
  sort(b.begin(),b.end(),greater<ll>());
  
  vector<ll>s(n+1);
  ll num = 0;
  rep(i,n){
    if(b[i]>a[0]){
      s[i+1] = s[i] + b[i];
      num++;
    }
    else break;
  }
  
  ll ok = inf, ng = 0;
  while(abs(ok-ng)>1){
    ll mid = (ok+ng)/2;
    
    if(mid*a[0]>=h) ok=mid;
    else{
      if(mid<=num){
        if(s[mid]<h)ng=mid;
        else ok = mid;
      }
      else{
        if(s[num]+(mid-num)*a[0]<h)ng=mid;
        else ok = mid;
      }
    }
  }
  cout << ok << endl;
  return 0;
}


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

#define DIV 998244353

long long N, A, B, K;

long long fact[300005];

long long modpow(long long ori, long long po){
	long long res = 1;
	while(po > 0){
		if(po&1){
			res *= ori;
			res %= DIV;
		}
		ori *= ori;
		ori %= DIV;
		po >>= 1;
	}
	return res;
}

long long comb(long long m, long long n){
	long long ret = fact[m];
	ret *= modpow(fact[m-n], DIV - 2);
	ret %= DIV;
	ret *= modpow(fact[n], DIV - 2);
	ret %= DIV;
	return ret;
}

int main(){
	cin >> N >> A >> B >> K;

	fact[0] = 1;
	for(long long i = 1; i <= N; i++){
		fact[i] = fact[i-1] * i;
		fact[i] %= DIV;
	}

	long long ans = 0;
	for(long long i = 0; i <= N; i++){
		long long rest = K - A * i;
		if(rest % B != 0)
			continue;
		long long j = rest/B;
		if(j > N || j < 0)
			continue;
		ans += (comb(N, i) * comb(N, j))%DIV;
		ans %= DIV;
	}
	cout << ans << endl;
}

Measured memory_bytes: 2560
#include <bits/stdc++.h>
#include<algorithm>
#include<cstring>
#include<cmath>
#include<cstdlib>
#include<string.h>
using namespace std;
#define pb push_back
#define all(v) v. begin(),v. end()
#define  rep(i,n,v) for(i=n;i<v;i++)
#define per(i,n,v) for(i=n;i>v;i--)
#define ff first 
#define ss second 
#define pp pair<ll,ll>
#define ll  long long
#define endl '\n'
void solve()
{
  ll n, a,m=0,b=1, c,k=0, i, j,l=1e9+7;
  string s, r, y;
  cin>>n;
  ll ar[n];
  rep(i,0,n) cin>>ar[i];
  rep(i,0,n)
  {
    rep(j,i+1,n)
    {
      k+=(ar[i]*ar[j]);
    }
  }
  cout<<k;
}
int main()
{
 ios_base::sync_with_stdio(false);
  cin. tie(0);cout. tie(0);
    ll t=1;
 //  cin>>t;
    while(t--)
    {
      solve();
    }
    return 0;
}

Measured memory_bytes: 3656
#include <iostream>
#include <string>
using namespace std;
int main()
{
	while (1)
	{
		int a = 0;
		int aw = 1;
		int c[6] = { 1, 2, 3, 4, 5, 6 };
		cin >> a;
		if (a == 0)
		{
			break;
		}
		string s[10000];
		for (int i = 0; i < a; i++)
		{
			cin >> s[i];
		}
		for (int i = 0; i < a; i++)
		{
			int d[6];
			for (int j = 0; j < 6; j++)
			{
				d[j] = c[j];
			}
			if (s[i] == "North")
			{
				c[0] = d[1];
				c[2] = d[2];
				c[3] = d[3];
				c[1] = d[5];
				c[5] = d[4];
				c[4] = d[0];
				aw += c[0];
			}
			if (s[i] == "East")
			{
				c[0] = d[3];
				c[1] = d[1];
				c[4] = d[4];
				c[2] = d[0];
				c[5] = d[2];
				c[3] = d[5];
				aw += c[0];
			}
			if (s[i] == "West")
			{
				c[0] = d[2];
				c[1] = d[1];
				c[4] = d[4];
				c[2] = d[5];
				c[5] = d[3];
				c[3] = d[0];
				aw += c[0];
			}
			if (s[i] == "South")
			{
				c[0] = d[4];
				c[2] = d[2];
				c[3] = d[3];
				c[1] = d[0];
				c[5] = d[1];
				c[4] = d[5];
				aw += c[0];
			}
			if (s[i] == "Right")
			{
				c[0] = d[0];
				c[2] = d[4];
				c[3] = d[1];
				c[1] = d[2];
				c[5] = d[5];
				c[4] = d[3];
				aw += c[0];
			}
			if (s[i] == "Left")
			{
				c[0] = d[0];
				c[2] = d[1];
				c[3] = d[4];
				c[1] = d[3];
				c[5] = d[5];
				c[4] = d[2];
				aw += c[0];
			}
		}
		cout << aw << endl;
	}
	
	return 0;
}

Measured memory_bytes: 3436
#include <iostream>
#include <cstring>
#include <cstdlib>
#include <set>
#include <vector>
#include <map>
#include <cstdio>
#include <utility>
#include <algorithm>
#include <cmath>
#include <queue>
#include <stack>
#include <cassert>
#include <climits>
using namespace std;
typedef long long ll;
#define DEBUG
#ifdef DEBUG
	#define debug printf
#else
	#define debug(...)
#endif
int main(int argc, char const *argv[])
{
	int n,x;
	cin>>n>>x;
	int now = 0;
	int ans = 1;
	for(int i = 0;i < n; ++i)
	{
		int p;
		cin>>p;
		now += p;
		if(now <= x)
		{
			ans++;
		}
	}
	cout<<ans<<endl;
	return 0;
}

Measured memory_bytes: 256
li = list(map(int,input().split()))
takahashiturn=int(li[2]/li[1])
if li[2]%li[1]!=0:
    takahashiturn+=1
aokiturn=int(li[0]/li[3])
if li[0]%li[3]!=0:
    aokiturn+=1
if takahashiturn<=aokiturn:
    print('Yes')
else:
    print('No')

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


using namespace std;
using Graph = vector<vector<int>>;


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

  Graph g(n);
  for(int i=0;i<m;i++){
    int a,b; cin >> a >>b;
    g[a-1].push_back(b-1);
    g[b-1].push_back(a-1);
  }

  queue<int> q;
  q.push(0);

  vector<int> dist(n,-1);
  dist[0] =0;

  vector<int> ans(n);
  ans[0] =0;

  while(!q.empty()){
    int v = q.front();
    q.pop();
    for(auto nv: g[v]){
      if(dist[nv]!=-1) continue;
      dist[nv] = dist[v] +1;
      ans[nv] = v;
      q.push(nv);
    }
  }

  cout << "Yes" << endl;
  for(int i=1;i<n;i++) cout << ans[i]+1 <<endl;
}


Measured memory_bytes: 10560
#include <iostream>
#include <set>
using namespace std;
char a[100100];
int main(){
	string sunn = "Sunny", cloud = "Cloudy", rainn = "Rainy";
	string s;
	cin>>s;
	if (s==sunn)
		cout<<cloud;
	else if (s==cloud)
		cout<<rainn;
	else cout<<sunn;
	return 0;
}


Measured memory_bytes: 256
#include <algorithm>
#include <cassert>
#include <cmath>
#include <cstdio>
#include <deque>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>
using std::cerr;
using std::cin;
using std::cout;
using std::endl;

int main(void) {
  cout << std::fixed << std::setprecision(10);
  cin.tie(0);
  std::ios::sync_with_stdio(false);
  int n, k;
  cin >> n >> k;
  std::vector<int64_t> jewel(n);
  for (int i = 0; i < n; i++) {
    cin >> jewel[i];
  }
  int64_t result = 0;

  for (int left = 0; left <= n; left++) {
    for (int right = 0; left + right <= n; right++) {
      if (left + right > k) continue;
      std::vector<int> selected;
      for (int i = 0; i < left; i++) {
        selected.push_back(jewel[i]);
      }
      for (int i = 0; i < right; i++) {
        selected.push_back(jewel[n - 1 - i]);
      }

      //昇順ソート
      std::sort(selected.begin(), selected.end());

      int can_neglect     = k - left - right;
      int64_t temp_result = 0;
      for (auto x : selected) {
        if (x < 0 && can_neglect > 0) {
          can_neglect--;
        } else {
          temp_result += x;
        }
      }

      result = std::max(result, temp_result);
    }
  }
  cout << result << endl;

  return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <boost/multiprecision/cpp_int.hpp>
// #include <atcoder/all>

using boost::multiprecision::cpp_int;
using namespace std;
// using namespace atcoder;

#if __has_include("print.hpp")
  #include "print.hpp"
#endif

#define rep(i, n) for(ll i = 0; i < (ll)(n); i++)
#define ALL(x) (x).begin(), (x).end()
#define RALL(x) (x).rbegin(), (x).rend()
#define MOD 1000000007

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; }

typedef long long ll;
typedef pair<ll, ll> p;


int main(){
  ios::sync_with_stdio(false);
  cin.tie(0);
  string s;
  cin >> s;
  string tmp = s;
  reverse(ALL(tmp));
  if(s == tmp) cout << "Yes" << endl;
  else cout << "No" << endl;
}


Measured memory_bytes: 3584
num500 = int(input())
num100 = int(input())
num50 = int(input())
amount = int(input())
rst = 0
for itr500 in range(num500+1):
    for itr100 in range(num100+1):
        for itr50 in range(num50+1):
            kingaku = itr50*50+itr100*100+itr500*500
            #print("itersは50¥", itr50, "100¥", itr100, "500¥", itr500)
            #print(kingaku)
            if(kingaku==amount):
                rst += 1
print(rst)

Measured memory_bytes: 3060
#include<bits/stdc++.h>
//https://atcoder.jp/contests/abc076/tasks/abc076_c?lang=en
using namespace std;
string mn="zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz";
int main()
{
	string s,t;
	cin>>s>>t;
	for(int i=s.size()-t.size();i>=0;--i)
	{
		bool b=1;
		for(int j=0;j<t.size();++j)
		{
			if(s[i+j]=='?')
				continue;
			else if(s[i+j]!=t[j])
			{
				b=0;
				break;
			}
		}
		if(b==1&&!s.size()<t.size())
		{
			string st=s;
			for(int j=i;j<t.size()+i;j++)
				st[j]=t[j-i];
			for(int j=0;j<s.size();j++)
				if(st[j]=='?')
					st[j]='a';
			mn=min(st,mn);
		}
	}
	if(mn=="zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz")
		cout<<"UNRESTORABLE";
	else
		cout<<mn;
 
	return 0;
}

Measured memory_bytes: 3616
import sys
stdin = sys.stdin
sys.setrecursionlimit(10**6)
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
nn = lambda: list(stdin.readline().split())
ns = lambda: stdin.readline().rstrip()

n,s = na()
a = na()
mod = 998244353
dp = [0]*(s+1)
dp[0] = 1

for i in range(n):
    pd = [0]*(s+1)
    for j in range(s+1):
        if j+a[i] <= s:
            pd[j+a[i]] += dp[j]
        pd[j] += dp[j]*2%mod
    dp = pd

print(dp[s]%mod)

Measured memory_bytes: 74108
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int N, K, X, Y;
  cin >> N >> K >> X >>Y;
  if (K >= N)
  {cout << N*X <<endl;
  }
  if (N > K)
  {cout << K*X+(N-K)*Y <<endl;
  }
}

Measured memory_bytes: 256
#define _CRT_SECURE_NO_WARNINGS
#include <bits/stdc++.h>
//#include <intrin.h>
//#include <chrono>
//#include <random>
//#include <unordered_map>

using namespace std;

typedef long long ll;

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

	int otv = 0;
	for (int i = 0; i < k; i++)
		otv += a[i];
	cout << otv;
}

int main() {
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
#if defined(_DEBUG)
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif
	int q = 1;
	//cin >> q;
	for (; q > 0; q--) {
		solve();
		cout << '\n';
	}
}

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

int main(){
  int N;cin>>N;
  int A=0;
  if (N>=64) A=64;
  else if (N>=32) A=32;
  else if (N>=16) A=16;
  else if (N>=8) A=8;
  else if (N>=4) A=4;
  else if (N>=2) A=2;
  else A=1;
  
  cout<<A<<endl;
}

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

int main()
{
    int R;
    cin >> R;
    if(R < 1200) {
        cout << "ABC" << endl;
    } else if(R < 2800) {
        cout << "ARC" << endl;
    } else {
        cout << "AGC" << endl;
    }
    return 0;
}

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

class Program
{

	//Main
	static void Main(string[] args)
	{
		//読み込む
		double R = double.Parse(Console.ReadLine());
		double ans = 2 * R * Math.PI;

		//出力
		Console.WriteLine(ans);
	}
}


Measured memory_bytes: 18636
import numpy as np
N=int(input())
S_list=[]
T_point=[]
zisho = "abcdefghijklmnopqrstuvwxyz"
for i in range(N):
  SP = input().split()
  S_list.append(SP[0])
  zisho_num = 0
  for k in range(len(SP[0])):
    zisho_num = zisho_num + (zisho.index(SP[0][len(SP[0])-k-1])+1)*(100**(k+10-len(SP[0])))
  T_point.append(zisho_num*100+100-int(SP[1]))
T_point = np.array(T_point)
ind = T_point.argsort()
for i in range(N):
  print(ind[i]+1)

Measured memory_bytes: 12508
#include<bits/stdc++.h>
typedef unsigned long long int ull;
typedef long long int ll;
#define loop(i,a,b) for(int i=a;i<b;i++)
#define fastio ios_base::sync_with_stdio(false);
using namespace std;


int main(){
	fastio
	string s;
	cin >> s;
	int start=0;
	int end=s.size()-1;
	int count=0;
	while(start <= end){
		if(s[start++] != s[end--])
			count++;
	}
	cout << count << endl;
	return 0;
}

Measured memory_bytes: 256
n = int(input())
x = [[] for i in range(n)]
for i in range(n):
    x[i] = list(map(int, input().split()))
z = [[0, 1, 2, 3], [0, 2, 1, 1], [1, 0, 2, 1], [2, 0, 1, 0], [1, 2, 0, 0], [2, 1, 0, 1]]

def compare(x, y):
    succeed = False
    for i in range(6):
        match = True
        order = [0, 0, 0]
        for j in range(3):
            if {x[j], x[-j-1]} != {y[z[i][j]], y[-z[i][j]-1]}:
                match = False
                break
            if x[j] == y[z[i][j]]:
                order[j] = 1
                if x[j] == x[-j-1]:
                    order[j] = 2
        if match:
            if 2 in order:
                succeed = True
                break
            if (z[i][3] == 0 or z[i][3] == 3) and sum(order) % 2:
                succeed = True
                break
            if z[i][3] == 1 and not sum(order) % 2:
                succeed = True
                break
    if succeed:
        return True
    else:
        return False

different = True
for i in range(n):
    for j in range(i+1, n, 1):
        if compare(x[i], x[j]):
            different = False
            break
    if not different:
        break
if different:
    print('Yes')
else:
    print('No')

Measured memory_bytes: 7836
#include<iostream>
#include<vector>
#include<algorithm>
#include<unordered_map>

using namespace std;

int main(){
    long long n, d; cin>>n>>d;
    int ans = 0;
    for(int i = 0; i < n; i++){
        long long x, y; cin>>x>>y;
        if(x * x + y * y <= d * d) ans++;
    }
    cout<<ans<<endl;
}


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

#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
typedef long long ll;

int main(){
  ll l, r;
  cin >> l >> r;

  if(r-l>=2018) {
    cout << 0;
    return 0;
  }

  ll min = 2019;
  for(ll i=l; i<r; i++){
    for(ll j=l+1; j<=r; j++){
      if((i*j)%2019<=min) min = (i*j)%2019;
    }
  }

  cout << min;
  
}

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

int main(){
    int n,b,f,r,v;
    cin>>n;
    int data[4][3][10];
    for(int i=0;i<4;i++){
        for(int j=0;j<3;j++){
            for(int k=0;k<10;k++)data[i][j][k]=0;
        }
    }
    
    for(int i=0;i<n;i++){
        cin>>b>>f>>r>>v;
        data[b-1][f-1][r-1]+=v;
        if(data[b-1][f-1][r-1]<0)data[b-1][f-1][r-1]=0;
    }

    for(int i=0;i<4;i++){
        for(int j=0;j<3;j++){
            for(int k=0;k<10;k++){
                cout<<" "<<data[i][j][k];
            }
            cout<<"\n";
        }
        if(i!=3)cout<<"####################\n";
    }

    return 0;
}


Measured memory_bytes: 3072
#include <bits/stdc++.h>
#define int llint
#define rep(i, a, n) for(int (i) = (int)(a);(i) < (int)(n);++(i))
#define repe(i, a, n) for(int (i) = (int)(a);(i) <= (int)(n);++(i))
#define repif(i, a, x) for(int (i) = (int)(a);(x);++(i))
#define repr(i, a, n) for(int (i) = ((int)(a)-1);(i) >= (int)(n);--(i))
#define reper(i, a, n) for(int (i) = (int)(a);(i) >= (int)(n);--(i))
#define chmax(a, b) a = max(a, b)
#define chmin(a, b) a = min(a, b)
#define SIZE(x) ((int)(x).size())
#define ALL(x) (x).begin(), (x).end()
#define RNG(x, a, n) &((x)[a]), &((x)[n])
#define ADD(a, b) ((((a+MOD)%MOD)+((b+MOD)%MOD))%MOD)
#define MUL(a, b) ((((a)%MOD)*((b)%MOD))%MOD)
#define CEIL(x) ((int)ceil(((double)x)))
#define POW(x, y) ((int)pow(x, y))
#define UNIQUE(x) (x).erase(unique(ALL((x))), (x).end())
#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 fcout cout << fixed << setprecision(10)
#define pb push_back
#define pf push_front
#define mp make_pair
#define mt make_tuple
#define lb lower_bound
#define ub upper_bound
#define fi first
#define se second
#define PI (acos(-1))
#define EPS (1e-10)
#define INF INT_MAX
#define INFLL LLONG_MAX
#define MOD 1000000007
using llint = long long;
using VI = std::vector<int>;
using PII = std::pair<int, int>;
using SI = std::set<int>;
using MII = std::map<int, int>;
using TIII = std::tuple<int, int, int>;
using MCI = std::map<char, int>;
using VPII = std::vector<PII>;
using Complex = std::complex<double>;
using namespace std;


int N;
int a[100010];


int solve(){
	int ans1 = 0;
	int sum = 0;
	rep(i, 0, N){
		sum += a[i];
		if(i%2 == 0 && sum <= 0) ans1 += (1-sum), sum = 1;
		if(i%2 == 1 && sum >= 0) ans1 += (sum+1), sum = -1;
	}
	int ans2 = 0;
	sum = 0;
	rep(i, 0, N){
		sum += a[i];
		if(i%2 == 1 && sum <= 0) ans2 += (1-sum), sum = 1;
		if(i%2 == 0 && sum >= 0) ans2 += (sum+1), sum = -1;
	}
	return min(ans1, ans2);
}


signed main(){
	cin >> N;
	rep(i, 0, N) cin >> a[i];

	cout << solve() << endl;

	return 0;
}

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

public class Program
{
    static void Main()
    {
        var abc = Console.ReadLine().Split().Select(x => int.Parse(x)).ToArray();
        var noYam = abc[0];
        var yam = abc[1];
        var poi = abc[2];

        long count = yam;
        if (yam + noYam < poi)
        {
            count += yam + noYam + 1;
        }
        else
        {
            count += poi;
        }

        Console.WriteLine(count);
    }
}


Measured memory_bytes: 13268
#include <bits/stdc++.h>
#define all(cont) cont.begin(), cont.end()
#define pb push_back
#define fi first
#define se second
#define DEBUG(x) cerr << (#x) << ": " << (x) << '\n'

using namespace std;

typedef pair<int, int> pii;
typedef vector<int> vi;
typedef long long ll;
typedef unsigned long long ull;

template<class T> bool uin(T &a, T b) {return (a < b ? false : (a = b, true));}
template<class T> bool uax(T &a, T b) {return (a > b ? false : (a = b, true));}

//ifstream f(".in");
//ofstream g(".out");

int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
#ifdef LOCAL_DEFINE
  freopen(".in", "r", stdin);
#endif

  int n;
  cin >> n;
  vector<int> v(n + 2);
  for (int i = 1; i <= n; ++i) {
    cin >> v[i];
  }
  vector<int> left_gcd(n + 2);
  for (int i = 1; i <= n; ++i) {
    left_gcd[i] = __gcd(left_gcd[i - 1], v[i - 1]);
  }
  vector<int> right_gcd(n + 2);
  for (int i = n; i >= 1; --i) {
    right_gcd[i] = __gcd(right_gcd[i + 1], v[i + 1]);
  }
  int ans = 1;
  for (int i = 1; i <= n; ++i) {
//    cout << i << ' ' << left_gcd[i] << ' ' << right_gcd[i] << '\n';
    ans = max(ans, __gcd(left_gcd[i], right_gcd[i]));
  }
  cout << ans << '\n';

#ifdef LOCAL_DEFINE
  cerr << "Time elapsed: " << 1.0 * clock() / CLOCKS_PER_SEC << " s.\n";
#endif
  return 0;
}


Measured memory_bytes: 1408
Imports System

Public Class Program


    Public Shared Sub Main(args As String())

        Console.ReadLine()
        Dim input() As Integer = Array.ConvertAll(Of String, Integer)(Console.ReadLine.Split(" "), AddressOf Integer.Parse)


        For Each i As Integer In input

            If i Mod 2 = 0 Then

                If i Mod 3 = 0 Then

                ElseIf i Mod 5 = 0 Then

                Else
                    Console.WriteLine("DENIED")
                    Return
                End If

            End If

        Next

        Console.WriteLine("APPROVED")

    End Sub



End Class


Measured memory_bytes: 13140
#include<iostream>
#include<sstream>
#include<ios>
#include<iomanip>
#include<algorithm>
#include<vector>
#include<list>
#include<queue>
#include<cstdlib>
#include<cmath>
#include<queue>
#include<deque>
#include<map>
#include<string>
#include<numeric>
#include<set>
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define rep2(i, m, n) for(int i = (int)(m); i < (int)(n); i++)
#define rep_inv(i, n, m) for(int i = (int)(n); i > (int)(m); i--)
using namespace std;
using vi = vector<int>;
using vc = vector<char>;
using vvi = vector<vector<int>>;
using vvc = vector<vector<char>>;
using pii = pair<int, int>;
using vpii = vector<pii>;

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

  if(A <= 9 && B <= 9) cout << A*B << endl;
  else cout << "-1" << endl;
  
  return 0;
}

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

#define pb push_back
#define mk make_pair
#define lob lower_bound
#define upb upper_bound
#define fst first
#define scd second

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;

inline int read(){
	int f=1,x=0;char ch=getchar();
	while(!isdigit(ch)){if(ch=='-')f=-1;ch=getchar();}
	while(isdigit(ch)){x=x*10+ch-'0';ch=getchar();}
	return x*f;
}
inline ll readll(){
	ll f=1,x=0;char ch=getchar();
	while(!isdigit(ch)){if(ch=='-')f=-1;ch=getchar();}
	while(isdigit(ch)){x=x*10+ch-'0';ch=getchar();}
	return x*f;
}

const int MAXN=3005;
struct EDGE{int nxt,to;}edge[MAXN<<1];
int n,a[MAXN],head[MAXN],tot;
inline void add_edge(int u,int v){edge[++tot].nxt=head[u];edge[tot].to=v;head[u]=tot;}
int dfs(int u,int fa){
	bool fu=0;
	for(int i=head[u];i;i=edge[i].nxt)if(edge[i].to!=fa){
		int v=edge[i].to;fu|=(!dfs(v,u)&&a[u]>a[v]);
	}
	return fu;
}
int main() {
	n=read();
	for(int i=1;i<=n;++i)a[i]=read();
	for(int i=1,u,v;i<n;++i)u=read(),v=read(),add_edge(u,v),add_edge(v,u);
	for(int i=1;i<=n;++i){if(dfs(i,0))printf("%d ",i);}puts("");
	return 0;
}

Measured memory_bytes: 512
#include<stdio.h>
#include<string.h>
#define LEN 100005

typedef struct pp {
    char name[100];
    int t;
} P;

P Q[LEN];
int head, tail, n;

void enqueue(P x){
    Q[tail] = x;
    tail = (tail + 1) % LEN;
}

P dequeue(){
    P x = Q[head];
    head = (head + 1) % LEN;
    return x;
}

int min(int a, int b) { return a < b ? a : b;}

int main() {
    int elaps = 0, c;
    int i, q;
    P u;
    scanf("%d %d", &n, &q);
    for(i = 0; i < n; i++) {
        scanf("%s", Q[i].name);
        scanf("%d", &Q[i].t);
    }
    head = 0; tail = i++;

    while(head != tail) {
        u = dequeue();
        c = min(u.t,q);
        u.t -= c;
        elaps += c;
        if (u.t > 0) enqueue(u);
        else{
            printf("%s %d\n",u.name,elaps);
        }
    }
    return 0;
}


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

int main() {
  string s, ans = "";
  cin >> s;

  for (int i = 0; i < s.length(); i++) {
    if (s[i] == '0')
      ans.push_back('0');
    if (s[i] == '1')
      ans.push_back('1');
    if (s[i] == 'B' && ans.length() > 0)
      ans.pop_back();
  }

  cout << ans << endl;
}


Measured memory_bytes: 256
#include<iostream>
#include<vector>
#include<list>
#define INF 1e9
using namespace std;

void Dikstra(const vector<vector<pair<int, int> > >& G, vector<int>& d){
    d[0] = 0;
    list<int> i_gray;
    i_gray.push_back(0);
    vector<bool> is_black(d.size(), false);
    is_black[0] = true;
    while (!i_gray.empty()) {
        list<int>::iterator min_it = i_gray.begin();
        for (list<int>::iterator it = i_gray.begin(); it != i_gray.end(); it++) {
            if (d[*it] < d[*min_it]) min_it = it;
        }
        is_black[*min_it] = true;
        for (int i = 0; i < G[*min_it].size(); i++) {
            int v = G[*min_it][i].first;
            int w = G[*min_it][i].second;
            if (!is_black[v] && d[*min_it] + w < d[v]) {
                if (d[v] == INF) i_gray.push_back(v);
                d[v] = d[*min_it] + w;
            }
        }
        i_gray.erase(min_it);
    }
}

int main(){
    int n;
    cin >> n;
    vector<vector<pair<int, int> > > G(n);
    for (int i = 0; i < n; i++) {
        int u, k;
        cin >> u >> k;
        for (int j = 0; j < k; j++) {
            int v, c;
            cin >> v >> c;
            G[u].push_back(make_pair(v, c));
        }
    }
    vector<int> d(n, INF);
    Dikstra(G, d);
    for (int i = 0; i < n; i++) {
        cout << i << " " << d[i] << endl;
    }

    return 0;
}

Measured memory_bytes: 3124
import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        int[] list = {6, 9, 36, 81, 216, 729, 1296, 6561, 7776, 46656, 59049};
        int n = sc.nextInt();
        int[] dp = new int[n + 1];
        dp[0] = 0;
        for(int i = 1; i < n + 1; i++){
            dp[i] = i;
        }
        for(int num : list) {
            for(int i = num; i < n + 1; i++){
                dp[i] = Math.min(dp[i], dp[i - num] + 1);
            }
        }
        System.out.println(dp[n]);
    }
}


Measured memory_bytes: 23124
use v5.18; # strict say state
use warnings;
use List::Util qw(reduce first max min sum0);

chomp (my ($k, $x) = split / /, <STDIN>);
my @y;
for my $i (0..$k-1) {
  push @y, $x + $i;
}
for my $i (1..$k-1) {
  push @y, $x - $i;
}
@y = sort {$a <=> $b} @y;
say join(' ', @y);

Measured memory_bytes: 768
#include <cstdio>
int N,count=0;
void dfs(long long nextnum,unsigned	char flag){
	if(nextnum<=N){
		if(flag==7){
			count++;
		}
		dfs(nextnum*10+3,flag|01);
		dfs(nextnum*10+5,flag|02);
		dfs(nextnum*10+7,flag|04);
	}
} 
int main(){
	scanf("%d",&N);
	dfs(0,0);
	printf("%d",count);
	return 0;
}

Measured memory_bytes: 128
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (n); i++)
#define rem(i, m, n) for (int i = m; i < (n); i++)
#define eps (1e-7)
#define inf (1e9)
#define pi (acos(-1))
typedef long long ll;
typedef vector<int> vi;
typedef vector<long long> vl;
typedef vector<double> vd;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;

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

    string s, t;
    cin >> s >> t;

    int n = s.size();
    bool flag = false;
    rep(i, n)
    {
        if (s[i] == t[0])
        {
            flag = true;
            int j = 1;
            int k = 1;
            while (k < n)
            {
                if (i + j == n)
                    j = -i;
                if (s[i + j] != t[k])
                {
                    flag = false;
                    break;
                }
                j++;
                k++;
            }
        }
        if (flag)
            break;
    }
    if (flag)
        cout << "Yes"
             << "\n";
    else
    {
        cout << "No"
             << "\n";
    }

    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define mp make_pair
#define fi first
#define se second
#define VAL 100000
#define ll long long
#define INF 10000000000000000LL
#define pll pair<long long , long long>
const int MAX=1e5+10;
const ll MOD=1e9+7;
const int TOT_PRIMES=19;
const int MAX_A=70;
using namespace std;
vector<int>adj[MAX];
int main() 
{
	int n , m;
	cin>>n>>m;
	ll ans=0;
	int arr[m+1];
	for(int i=0;i<m;i++)
	{
		int x;
		cin>>x;
		ans+=x;
	}
	if(ans<=n)
		cout<<n-ans;
	else
		cout<<-1;
	
}

Measured memory_bytes: 5992
#include <algorithm>
#include <cassert>
#include <cmath>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
#define rep(i, n) for (int i = 0; i < (n); i++)

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

// const int INF = (1 << 30) - 1;
// const ll LL_INF = (1LL << 62) - 1;
// const ll MOD = 1e9 + 7;
// const double PI = M_PI;

int N;
// vector<int> A;

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cin >> N;
  // A.resize(N);
  // rep(i, N) { cin >> A[i]; }

  if (N % 1000 == 0) {
    cout << 0 << endl;
  } else {
    int ans = 1000 - (N % 1000);
    cout << ans << endl;
  }
  return 0;
}


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

int main() {
    pair<pair<string, int>, int> shop[110];

    int n;
    int buf;
    char bufchar[20];
    string bufstr;

    cin >> n;

    for (int i = 0; i < n; i++) {
        cin >> bufchar >> buf;
        bufstr = bufchar;
        shop[i] = make_pair(make_pair(bufstr, -buf), i);
    }

    sort(shop, shop+n);
    for (int i = 0; i < n; i++) {
        cout << shop[i].second + 1 << endl;

    }
}

Measured memory_bytes: 256
c = [list(map(int, input().split())) for _ in range(3)]

if c[0][0] - c[0][1] == c[1][0] - c[1][1] == c[2][0] - c[2][1] and c[0][1] - c[0][2] == c[1][1] - c[1][2] == c[2][1] - c[2][2]:
	print("Yes")
else:
	print("No")

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

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

  int a;
  int ans = 0;
  for(int i = 0; i < n; i++){
    cin >> a;
    ans += 2 *  min(a, abs(a - k));
  }
  cout << ans << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  long long int ans = 1;
  cin >> n;
  vector<long long int> a(n);

  for (int i = 0; i < n;i++){
    cin >> a[i];
    if(a[i]==0){
      cout << 0 << endl;
      return 0;
    }
    
  }
  for (int i = 0; i < n;i++){
    if (a[i] > 1000000000 && ans >= 1000000000) {
      cout << -1 << endl;
      return 0;
    }else if(a[i]>=1000000000&&ans>1000000000){
      cout << -1 << endl;
      return 0;
    }
    if (a[i] * ans > 1000000000000000000) {
      cout << -1 << endl;
      return 0;
    }
    ans *= a[i];
  }
    cout << ans << endl;
  return 0;
}

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

int main() {
	// your code goes here
	int n,i,k,j;
	cin>>n>>k;
	int ar[n+1],c[n+1]={0};
	ar[0]=0;
	for(i=1;i<=n;i++) cin>>ar[i];
	
	c[2]=abs(ar[2]-ar[1]);
	for(i=3;i<=n;i++)
	{
		 int u=INT_MAX;
		j=i-1;
		while(j>=1 && j>=i-k)
		{
			u=min(u,c[j] + abs( ar[i]-ar[j] ) );
			--j;
		}
		c[i]=u;
		
	}
	
	cout<<c[n];
	
	return 0;
}


Measured memory_bytes: 1024
#include<map>
#include<set>
#include<stack>
#include<queue>
#include<cmath>
#include<cstring>
#include<climits>
#include<cstdio>
#include<iostream>
#include<algorithm>
using namespace std;
#define LL long long
//#define getchar() (p1 == p2 && (p2 = (p1 = buf) + fread(buf, 1, 1 << 21, stdin), p1 == p2) ? EOF : *p1++)
//char buf[(1 << 21) + 1], *p1 = buf, *p2 = buf;
inline int read() {
	bool f=0;int x=0;char c=getchar();
	while(c<'0'||'9'<c){if(c==EOF)exit(0);if(c=='-')f=1;c=getchar();}
	while('0'<=c&&c<='9') x=(x<<3)+(x<<1)+(c^48),c=getchar();
	return !f?x:-x;
}
#define MAXN 200000
#define MAXM 500000
#define INF 0x3f3f3f3f
struct Edge{
	int nxt,v,cap;
}edge[2*MAXM+5];
int ecnt,head[MAXN+5],cur[MAXN+5];
void Init(){
	ecnt=-1,memset(head,-1,sizeof(head));
	return ;
}
void Addedge(int u,int v,int cap){
	//printf("%d %d %d\n",u,v,cap);
	edge[++ecnt]=(Edge){head[u],v,cap},head[u]=ecnt;
	edge[++ecnt]=(Edge){head[v],u,0},head[v]=ecnt;
	return ;
}
int N,S,T;
int dep[MAXN+5];
bool BFS(){
	queue<int> Q;
	for(int i=0;i<=N;i++)
		dep[i]=INF;
	dep[S]=0,Q.push(S);
	while(!Q.empty()){
		int u=Q.front();Q.pop();
		for(int i=head[u];~i;i=edge[i].nxt){
			int v=edge[i].v,cap=edge[i].cap;
			if(dep[v]==INF&&cap)
				dep[v]=dep[u]+1,Q.push(v);
		}
	}
	return dep[T]<INF;
}
int DFS(int u,int aug){
	if(u==T) return aug;
	int flow=0,f;
	for(int &i=cur[u];~i;i=edge[i].nxt){
		int v=edge[i].v,cap=edge[i].cap;
		if(dep[v]==dep[u]+1&&cap&&(f=DFS(v,min(aug,cap)))){
			aug-=f,flow+=f;
			edge[i].cap-=f,edge[i^1].cap+=f;
			if(!aug) break;
		}
	}
	return flow;
}
int Dinic(){
	int Max_Flow=0;
	while(BFS())
		memcpy(cur,head,sizeof(head)),Max_Flow+=DFS(S,INF);
	return Max_Flow;
}
queue<int> Q;
int ma[MAXN+5];
bool vis[MAXN+5];
vector<int> G[MAXN+5];
int cho1[MAXN+5],cho2[MAXN+5];
int main(){
	Init();
	int n=read();
	N=2*n+2,S=2*n+1,T=2*n+2;
	for(int i=1;i<n;i++)
		Addedge(S,i,1);
	for(int i=2;i<=n;i++)	
		Addedge(i+n-1,T,1);
	for(int i=1;i<n;i++){
		int c=read();
		for(int j=1;j<=c;j++){
			int w=read();
			G[w].push_back(i);
			if(w!=1)
				Addedge(i,w+n-1,1);
		}
	}
	int ans=Dinic();
	if(ans!=n-1)
		puts("-1"),exit(0);
	for(int s=1;s<n;s++)
		for(int i=head[s];~i;i=edge[i].nxt)
			if(!edge[i].cap)
				ma[s]=edge[i].v-(n-1);
	Q.push(1);
	int cnt=0;
	while(!Q.empty()){
		cnt++;
		int u=Q.front();Q.pop();
		for(int i=0;i<(int)G[u].size();i++){
			int s=G[u][i];
			if(vis[s]) continue;
			vis[s]=1,Q.push(ma[s]);
			cho1[s]=u,cho2[s]=ma[s];
		}
	}
	if(cnt!=n)
		puts("-1"),exit(0);
	for(int i=1;i<n;i++)
		printf("%d %d\n",cho1[i],cho2[i]);
	return 0;
}


Measured memory_bytes: 24924
#include <bits/stdc++.h>
#include <cstdio>
#include <cstdlib>
 
#ifdef _MSC_VER
#include <Windows.h>
#else
#include <unistd.h>
#endif
 
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 pair<int, int> PII;
typedef pair<long, long> PLL;
typedef long long LL;
//container util
//------------------------------------------
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB emplace_back
#define MP make_pair
#define SZ(a) int((a).size())
#define SORT(c) sort((c).begin(),(c).end())
 
//repetition
//------------------------------------------
#define FOR(i,a,b) for(LL i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)
 
//constant
//--------------------------------------------
const double EPS = 1e-10;
const double PI  = acos(-1.0);
const LL MOD=(LL)1e9+7;
//clear memory
#define CLR(a) memset((a), 0 ,sizeof(a))
 
#define INF 1LL << 50
 
int rest[101][101];
int main(){
    int H,W,N;
    cin>>H>>W>>N;
    vector<int>a(N);
    REP(i,N)cin>>a[i];
    vector<int>res;
    REP(i,N)REP(j,a[i]){
        res.PB(i+1);
    }
    int cnt=0;
    REP(i,H*W){
        if((i/W)%2==0)rest[i/W][i%W]=res[i];
        else rest[i/W][(W-1)-(i%W)]=res[i];
    }
    REP(i,H){
        REP(j,W){
            cout<<rest[i][j]<<" ";
        }
        cout<<endl;
    }
    return 0;
}

Measured memory_bytes: 512
#include <bits/stdc++.h>
#define REP(i,n) for (int i = 0; i <(n); ++i)
#define REP2(i,x,n) for (int i = x; i <(n); ++i)
#define ALL(v) v.begin(), v.end()
#define RALL(v) v.rbegin(), v.rend()
using namespace std;
using ll = long long;
using P = pair<int,int>;
static const double PI = acos(-1);
static const int INF = 1e9+7;
#define REP(i,n) for (int i = 0; i <(n); ++i)
//debug 
#ifdef _DEBUG
#define debug(var)  do{cout << #var << " :";view(var);}while(0)
#else
#define debug(...)
#endif
template<typename T> void view(T e){cout << e << endl;}
template<typename T> void view(const vector<T>& v){for(const auto& e : v){ cout << e << " "; } cout << endl;}
template<typename T> void view(const vector<vector<T> >& vv){ for(const auto& v : vv){ view(v); } }


int main(){
  //in
  int n,l,r;
  cin >> n >> l >> r;


  //L,Rで例外処理
  if(l > r){
    cout << 0 << endl;
    return 0;
  }
  if(l == r){
    cout << 1 << endl;
    return 0;
  }
  //L　<　Rのとき，nで例外処理
  if(n == 1){
    cout << 0 << endl;
    return 0;
  }
  if(n == 2){
    cout << 1 << endl;
    return 0;
  }
  //L<R

  ll ans = 0;
  //ans = (n-1)*r + l - (n-1)*l+r+ 1;
  ans = (ll)(n-1)*(r-l) + l - r + 1;
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 3640
def solve():
    MOD = 10**9 + 7

    strN = input().rstrip()
    D = int(input())

    maxD = len(strN)

    dp = [[[0]*(D) for j in range(2)] for i in range(maxD+1)]
    dp[0][0][0] = 1
    for d, Nd in enumerate(strN):
        Nd = int(Nd)
        for isLtN in range(2):
            for modD in range(D):
                dp[d][isLtN][modD] %= MOD
                for x in range(10):
                    if not isLtN and x > Nd: continue
                    isLtN2 = isLtN or x < Nd
                    modD2 = (modD+x) % D
                    dp[d+1][isLtN2][modD2] += dp[d][isLtN][modD]

    print((dp[-1][0][0] + dp[-1][1][0] - 1) % MOD)


solve()


Measured memory_bytes: 61808
#pragma GCC optimize("O3")   //
#include <bits/stdc++.h>
using namespace std;

#define rep(i, a, b) for(int i = a; i < (b); ++i)
#define per(i, b, a) for(int i = b - 1; i >= a; i--)
#define trav(a, x) for(auto& a : x)
#define all(x) x.begin(), x.end()
#define sz(x) (int)(x).size()
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef long double ld;

unsigned seed = std::chrono::system_clock::now().time_since_epoch().count();
std::mt19937 eng(seed);

uniform_int_distribution<> DD(0, (1ll << 31));

ll random2(){
    return (ll(DD(eng))*(1ll << 31) + ll(DD(eng))) & ((1ll << 62ll)-1);
}

ll n,m,k,q,T;

const ll big = 1000000007;
const ll big2 = 1000000009;
const ll mod =  998244353;

const int MAXN = 200001;

const int MAXM = 10000;

vector<vi> C(51, vi());
vector<vi> CW(51, vi());
vector<vi> CC(51, vi());

bool mark[51][MAXM] = {0};
ll dist[51][MAXM] = {0};

vl S, E;

ll start;


void dijk(){
    start = min((int)start, MAXM-1);
    priority_queue<pll> pq;
    pq.push({0, start*n + 0});

    rep(c1,0,n){
        rep(c2,0,MAXM){
            dist[c1][c2] = big*big;
        }
    }

    dist[0][start] = 0;

    while(!pq.empty()){
        int i = pq.top().second%n;
        int silver = pq.top().second/n;
        pq.pop();
        if(!mark[i][silver]){
            mark[i][silver] = 1;
            rep(c1,0,sz(C[i])){
                ll j = C[i][c1];
                ll d2 = CW[i][c1] + dist[i][silver];
                ll s2 = silver - CC[i][c1];
                if(silver >= CC[i][c1] && dist[j][s2] > d2){
                    dist[j][s2] = d2;
                    pq.push({-d2, s2*n+j});
                }
            }
            if(silver < MAXM-E[i]){
                ll s2 = silver + E[i];
                ll d2 = dist[i][silver] + S[i];
                if(dist[i][s2] > d2){
                    dist[i][s2] = d2;
                    pq.push({-d2, s2*n+i});
                }
            }
        }
    }
}


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

    //freopen("input.txt","r",stdin);
    //freopen("autput.txt","w",stdout);

    ll a,b,c,d,e;

    cin >> n >> m >> start;
    rep(c1,0,m){
        cin >> a >> b >> c >> d;
        a--;b--;
        C[a].push_back(b);
        C[b].push_back(a);
        CW[a].push_back(d);
        CW[b].push_back(d);
        CC[a].push_back(c);
        CC[b].push_back(c);
    }

    rep(c1,0,n){
        cin >> a >> b;
        E.push_back(a);
        S.push_back(b);
    }

    dijk();
    rep(c1,1,n){
        ll ans = big*big;
        rep(c2,0,MAXM){
            ans = min(ans, dist[c1][c2]);
        }
        cout << ans << "\n";
    }

    return 0;
}


Measured memory_bytes: 15784
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using static System.Math;
using System.Text;
using System.Threading;
using System.Globalization;
using System.Runtime.CompilerServices;
using Library;

namespace Program
{
    public static class ABC148E
    {
        static public int numberOfRandomCases = 0;
        static public void MakeTestCase(List<string> _input, List<string> _output, ref Func<string[], bool> _outputChecker)
        {
        }
        static public void Solve()
        {
            var N = NN;
            if (N % 2 == 1)
            {
                Console.WriteLine(0);
                return;
            }
            var fc = 0L;
            var tmp = 10L;
            while (N >= tmp)
            {
                fc += N / tmp;
                tmp *= 5;
            }
            Console.WriteLine(fc);
        }
        static class Console_
        {
            static Queue<string> param = new Queue<string>();
            public static string NextString() { if (param.Count == 0) foreach (var item in Console.ReadLine().Split(' ')) param.Enqueue(item); return param.Dequeue(); }
        }
        class Printer : StreamWriter
        {
            public override IFormatProvider FormatProvider { get { return CultureInfo.InvariantCulture; } }
            public Printer(Stream stream) : base(stream, new UTF8Encoding(false, true)) { base.AutoFlush = false; }
            public Printer(Stream stream, Encoding encoding) : base(stream, encoding) { base.AutoFlush = false; }
        }
        static public void Main(string[] args) { if (args.Length == 0) { Console.SetOut(new Printer(Console.OpenStandardOutput())); } var t = new Thread(Solve, 134217728); t.Start(); t.Join(); Console.Out.Flush(); }
        static long NN => long.Parse(Console_.NextString());
        static double ND => double.Parse(Console_.NextString());
        static string NS => Console_.NextString();
        static long[] NNList(long N) => Repeat(0, N).Select(_ => NN).ToArray();
        static double[] NDList(long N) => Repeat(0, N).Select(_ => ND).ToArray();
        static string[] NSList(long N) => Repeat(0, N).Select(_ => NS).ToArray();
        static IEnumerable<T> OrderByRand<T>(this IEnumerable<T> x) => x.OrderBy(_ => xorshift);
        static long Count<T>(this IEnumerable<T> x, Func<T, bool> pred) => Enumerable.Count(x, pred);
        static IEnumerable<T> Repeat<T>(T v, long n) => Enumerable.Repeat<T>(v, (int)n);
        static IEnumerable<int> Range(long s, long c) => Enumerable.Range((int)s, (int)c);
        static uint xorshift { get { _xsi.MoveNext(); return _xsi.Current; } }
        static IEnumerator<uint> _xsi = _xsc();
        static IEnumerator<uint> _xsc() { uint x = 123456789, y = 362436069, z = 521288629, w = (uint)(DateTime.Now.Ticks & 0xffffffff); while (true) { var t = x ^ (x << 11); x = y; y = z; z = w; w = (w ^ (w >> 19)) ^ (t ^ (t >> 8)); yield return w; } }
    }
}
namespace Library {
}


Measured memory_bytes: 14688
MOD = 1000000007

n,a,b = map(int,input().split())
A =1
B =1
for i in range(0,a,1):
    A = (A*(n-i)*pow((a-i),1000000005,1000000007))%MOD
for i in range(0,b,1):
    B = (B*(n-i)*pow((b-i),1000000005,1000000007))%MOD

print((pow(2,n,MOD) - A%MOD - B%MOD -1)%MOD)

Measured memory_bytes: 41584
H, W = map(int, input().split())
grid = []
for i in range(H):
  line = input()
  for i in range(len(line)):
    if line[i] == '#':
      grid.append(line)
      break
gridans = [[''] for i in range(len(grid))]
for i in range(W):
  flag = 0
  for j in range(len(grid)):
    if grid[j][i] == '#':
      flag = 1
  if flag == 1:
    for j in range(len(grid)):
      gridans[j][0] += grid[j][i]
for i in range(len(gridans)):
  print(gridans[i][0])


Measured memory_bytes: 3064
#include <cstdio>
#include <iostream>
#include <cstring>
#include <algorithm>
#include <cmath>
using namespace std;

int t, a, b, c;
int main()
{
    cin >> t;
    cin >> a;
    b = a;
    while(--t)
    {
        cin >> c;
        a = max(a, c);
        b = min(b, c);
    }
    cout << a - b;
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define _overload3(_1, _2, _3, name, ...) name
#define _rep(i, n) repi(i, 0, n)
#define repi(i, a, b) for (ll i = (ll)(a); i < (ll)(b); ++i)
#define rep(...) _overload3(__VA_ARGS__, repi, _rep, )(__VA_ARGS__)
#define ll long long
#define lld long double
#define ALL(x) x.begin(), x.end()
#ifdef DEBUG
#define line() cerr << "[" << __LINE__ << "] ";
#define dump(i) cerr << #i ": " << i << " ";
#define dumpl(i) cerr << #i ": " << i << endl;
#else
#define line(i)
#define dump(i)
#define dumpl(i)
#endif
using namespace std;
int main(int argc, char const *argv[])
{
    int n;
    cin >> n;
    cout << (n - 1) / 2 << endl;

    return 0;
}


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

using namespace std;

int main(){
    int n;
    cin >> n;
    vector<string> w;
    bool f = true;
    for(int i = 0; i < n; i++){
        string s;
        cin >> s;
        if(find(begin(w), end(w), s) == end(w)){
            w.emplace_back(s);
        }else{
            f = false;
            break;
        }
    }
    if(f){
        for(int i = 1; i < n; i++){
            if(w[i - 1].back() != w[i][0]){
                f = false;
                break;
            }
        }
    }
    cout << (f? "Yes":"No") << endl;
    return 0;
}


Measured memory_bytes: 764
#include<bits/stdc++.h>
#define FOR(i, a, b) for (int i = a; i < b; ++i)
#define rep(N) for (int i = 0; i < N; ++i)
#define Rep(a, b) for (int i = a; i < b; ++i)
#define For(i, N) for (int i = 0; i < N; ++i)
#define all(v) v.begin(), v.end()
#define rev(v) v.rbegin(), v.rend()
#define makei(N) int N; cin >> N;
#define makel(N) ll N; cin >> N;
#define makes(s) string s; cin >> s;
#define maked(d) double d; cin >> d;
#define makev(v, N) vi v(N); rep(N)cin >> v[i];
#define mod 1000000007
#define re return 0
#define distance(x1,y1,x2,y2) sqrt((x1 - x2)*(x1 - x2) + (y1 - y2)*(y1 - y2));

using namespace std;
using ll = long long int;
using vi = vector<int>;
using vvi = vector<vector<int>>;
using vll = vector<ll>;
using vb = vector<bool>;
using vvb = vector<vector<bool>>;
using vs = vector<string>;
using pii = pair<int, int>;
using pis = pair<int, string>;
using msi = map<string, int>;

template<typename T>
void say(T s) {
	cout << s << "\n";
}

template<typename T>
void say(vector<T> s) {
	auto itr = s.begin();
	cout << *(itr++);
	while (itr != s.end()) {
		cout << " " << *(itr++);
	}
	cout << "\n";
}

void yn(bool b) {
	if (b)say("Yes");
	else say("No");
}

void YN(bool b) {
	if (b)say("YES");
	else say("NO");
}

template<typename T>
void maxi(T &a, T b) {
	a = max(a, b);
}

template<typename T>
void mini(T &a, T b) {
	a = min(a, b);
}

void exact_say(double x) {
	cout << setprecision(numeric_limits<double>::max_digits10) << x << endl;
}

int main() {
	makei(n);
	if (n == 1)say("Hello World");
	else {
		makei(a);
		makei(b);
		say(a + b);
	}
}

Measured memory_bytes: 256
from itertools import product

H, W = map(int, input().split())
A = [list(input()) for _ in range(H)]
tmpH = -1
tmpW = -1
flag = True

for i, j in product(range(H), range(W)):
    if A[i][j] == "#":
        if i < tmpH or j < tmpW:
            flag = False
            break
        else:
            tmpH = i
            tmpW = j

print("Possible" if flag else "Impossible")

Measured memory_bytes: 3064
#include <iostream>
#include <vector>
#include <cmath>
using namespace std;
int main(){
    int N;
    cin >> N;
    vector<int> lists(N);
    for (int i = 0; i < N; i++) {
        int tmp;
        cin >> tmp;
        lists[i]=tmp;
    }
    int min = 2000000;
    for (int i = 0; i < 101; i++) {
      int alp = 0;
      for (int j = 0; j < N; j++) {
        alp += pow(lists[j]-i,2);
      }
      if (alp < min) {
          min = alp;
      }
    }
    cout << min;
    return 0;
}

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

int main() {
    const double p1=1.0, p2=2.0, p3=3.0;
    int n;
    double D1=0.0, D2=0.0, D3=0.0, D4=0.0;
    scanf("%d", &n);
    double x[n],y[n];
    for(int i=0;i<n;i++){
        scanf("%lf", &x[i]);
    }
    for(int i=0;i<n;i++){
        scanf("%lf", &y[i]);
    }

    for(int i=0;i<n;i++){
        D1 += pow(abs(x[i]-y[i]),p1);
        D2 += pow(abs(x[i]-y[i]),p2);
        D3 += pow(abs(x[i]-y[i]),p3);
        if(D4<abs(x[i]-y[i])) D4 = abs(x[i]-y[i]);
    }
    printf("%lf\n", pow(D1, 1.0/p1));
    printf("%lf\n", pow(D2, 1.0/p2));
    printf("%lf\n", pow(D3, 1.0/p3));
    printf("%lf\n", D4);

    return 0;
}


Measured memory_bytes: 3384