akhauriyash/Code-Regression huggingface dataset:
#include<bits/stdc++.h>
using namespace std;
 
typedef long long ll;
typedef vector<pair<ll, ll>> vpll;
typedef pair<ll, ll> pll;
#define mod 1000000007
#define all(x) (x).begin(), (x).end()
#define pb push_back
#define yes(a) printf(a ? "yes\n" : "no\n")
#define Yes(a) printf(a ? "Yes\n" : "No\n")
#define YES(a) printf(a ? "YES\n" : "NO\n") 
const long double PI = acos(-1);
const long long INF = (1 << 30);
ll gcd(ll a,ll b){return b ? gcd(b,a%b) : a;}
ll lcm(ll a,ll b){return a / gcd(a,b) * b;}
ll stringcount(string s, char c){return count(s.cbegin(), s.cend(), c);}
bool isInteger(double x){return floor(x) == x;}
ll ceil(const ll a, const ll b){return ((a)+(b)-1)/b;}

ll h, w;
string s[51];
ll dist[51][51];

int main(){
  ios::sync_with_stdio(false);
  cin.tie(0);
	
  ll n, a, b;
  cin >> n >> a >> b;
  while(1){
    if(a+1 == b){
      cout << "Borys" << endl;
      break;
    }
    a++;
    if(b-1 == a){
      cout << "Alice" << endl;
      break;
    }
    b--;
  }
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
int main(){
  double a,b,x;
  cin >> a>>b>>x;
  double y,ans,arc,aa;
  if(a*a*b/2<=x){
    y=2*b-2*x/(a*a);
    ans=y/a;
    arc=atan(ans);
    aa=arc*180/M_PI;
  }else{
    y=2*x/(a*b);
    ans=b/y;
    arc=atan(ans);
    aa=arc*180/M_PI;
  }
  printf("%.10lf",aa);
}
    

Measured memory_bytes: 4036
#include <iostream>
#include <vector>
#include <string>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <map>
#include <algorithm>	// require sort next_permutation count __gcd reverse etc.
#include <cstdlib>	// require abs exit atof atoi 
#include <cstdio>		// require scanf printf
#include <functional>
#include <numeric>	// require accumulate
#include <cmath>		// require fabs
#include <climits>
#include <limits>
#include <cfloat>
#include <iomanip>	// require setw
#include <sstream>	// require stringstream 
#include <cstring>	// require memset
#include <cctype>		// require tolower, toupper
#include <fstream>	// require freopen
#include <ctime>		// require srand
#include <complex>
#define rep(i,n) for(int i=0;i<(n);i++)
#define ALL(A) A.begin(), A.end()
#define EPS 1e-9

using namespace std;
typedef complex<double> P;

int main()
{
//	cut here before submit 
//	freopen ("testcase.overlaps_of_seals", "r", stdin );
	int n;
	while (scanf ("%d", &n ), n ){
		vector<P> p(n );
		rep (i, n ){
			double x, y;
			scanf ("%lf,%lf", &x, &y );
			p[i].real() = x;
			p[i].imag() = y;
		} // end rep

		vector<P> ip; ip.clear();		
		rep (i, n ){
			for (int j = i+1; j < n; j++ ){
				P d = p[j] - p[i];
				if (abs (d) < 2. ){
					double t = acos (abs(d)/2.0 );
					ip.push_back (p[i]+polar(1.0, arg(d)+t ) );
					ip.push_back (p[i]+polar(1.0, arg(d)-t ) );
				} // end if
			} // end for									
		} // end rep

		int res = 1;
		rep (i, ip.size() ){
			int curr = 0;
			rep (j, n ){
				if (abs (ip[i] - p[j] ) < 1. + EPS ){
		 			curr++;
				} // end if
			} // end rep
			res = max (res, curr );
		} // end rep
		cout << res << endl;

	} // end loop
		
	return 0;
}

Measured memory_bytes: 1384
#include <bits/stdc++.h>
using namespace std;
#define rep(i,N) for(int i=0,i##_max=(N);i<i##_max;++i)
#define repp(i,l,r) for(int i=(l),i##_max=(r);i<i##_max;++i)
#define per(i,N) for(int i=(N)-1;i>=0;--i)
#define perr(i,l,r) for(int i=r-1,i##_min(l);i>=i##_min;--i)
#define all(arr) (arr).begin(), (arr).end()
#define SP << " " <<
#define SPF << " "
#define SPEEDUP cin.tie(0);ios::sync_with_stdio(false);
#define MAX_I INT_MAX //1e9
#define MIN_I INT_MIN //-1e9
#define MAX_UI UINT_MAX //1e9
#define MAX_LL LLONG_MAX //1e18
#define MIN_LL LLONG_MIN //-1e18
#define MAX_ULL ULLONG_MAX //1e19
  typedef long long ll;
  typedef pair<int,int> PII;
  typedef pair<char,char> PCC;
  typedef pair<ll,ll> PLL;
  typedef pair<char,int> PCI;
  typedef pair<int,char> PIC;
  typedef pair<ll,int> PLI;
  typedef pair<int,ll> PIL; 
  typedef pair<ll,char> PLC; 
  typedef pair<char,ll> PCL; 

inline void YesNo(bool b){ cout << (b?"Yes" : "No") << endl;}
inline void YESNO(bool b){ cout << (b?"YES" : "NO") << endl;}
inline void Yay(bool b){ cout << (b?"Yay!" : ":(") << endl;}

int main(void){
  SPEEDUP
  cout << setprecision(15);
  int N;cin >> N;
  int x = 1;
  while(true){
    if((x*108)/100 == N){
      cout << x << endl;
      return 0;
    }
    if((x*108)/100 > N)break;
    ++x;
  }
  cout << ":(" << endl;
  return 0;
}


Measured memory_bytes: 256
import java.lang.Math

fun main(args: Array<String>) {
    val INF = 10e15.toLong()
    val N = readInputLine().toInt()
    val AArr = Array(N) { readInputLine().split(" ").map { it.toLong() }.toLongArray() }
    val dist = Array(N) { AArr[it].copyOf() }

    for (k in 0 until N) {
        for (i in 0 until N) {
            for (j in 0 until N) {
                dist[i][j] = Math.min(dist[i][j], dist[i][k] + dist[k][j])
            }
        }
    }

    var ans = 0L

    for (i in 0 until N) {
        for (j in i + 1 until N) {
            var addFlag = true
            if (dist[i][j] < AArr[i][j]) {
                println(-1)
                return
            }
            for (k in 0 until N) {
                if (k == i || k == j) {
                    continue
                }
                if (dist[i][j] == dist[i][k] + dist[k][j]) {
                    addFlag = false
                    break
                }
            }
            if (addFlag) {
                ans += dist[i][j]
            }
        }
    }

    println(ans)
}

fun readInputLine(): String {
    return readLine()!!
}


Measured memory_bytes: 49972
#include<bits/stdc++.h>
#define fi first
#define se second
#define ll long long
#define pb push_back
#define pii pair<int,int>
using namespace std;
const int mod = 1e9+7;
int n;
string s;
int dp[3005][3005],pr[3005];// dp[i][j] _ after i-th position,there are j more left less than i
main() {
    cin >> n >> s;
    s.insert(s.begin(),'<');

    dp[0][0] = 1;
    for (int i  = 0; i < n; i++) {
    int rem = n - i;
    pr[0] = dp[i][0];
    for (int j = 1; j <= n; j++)
        pr[j] = (pr[j-1] + dp[i][j])%mod;
    //for (int j = 0; j <= rem; j++)
     if (s[i] == '<') {
     for (int j = 0; j <= rem; j++)
        (dp[i+1][j] += pr[j])%=mod;
      //  for (int k = j;k <=rem;k++)
       //     (dp[i+1][k] += dp[i][j])%=mod;
        }
        else {
        for (int j = 0; j < rem; j++)
        (dp[i+1][j] += (pr[rem] - pr[j])%mod)%=mod;
            //for (int k = 0; k < j;k++)

            //(dp[i+1][k] += dp[i][j])%=mod;
        }
    }
    cout << (dp[n][0]+mod)%mod;



}
/*
5
<<<<
20
>>>><>>><>><>>><<>>



*/



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

int main() {
  int n;
  cin >> n;
  vector<string> v;
  string w[n];
  bool flag = true;
  for (int i = 0; i < n; i++) {
    cin >> w[i];
    v.push_back(w[i]);
    if (i == 0) continue;
    if (w[i - 1][w[i - 1].size() - 1] != w[i][0]) {
      flag = false;
    }
    for (int j = 0; j < v.size() - 1; j++) {
      if (v[j] == w[i]) {
        flag = false;
      }
    }
  }
  if (flag) cout << "Yes" << endl;
  else cout << "No" << endl;
  return 0;
}


Measured memory_bytes: 256
import bisect
import collections
import itertools

def getint(): return int(input())
def getints(): return list(map(int, input().split()))
def getint2d(rows): return [getints() for _ in range(rows)]
def getgrid(rows): return [input() for _ in range(rows)]
def array1d(n, value): return [value for _ in range(n)]
def array2d(n, m, value): return [array1d(m, value) for _ in range(n)]

n,t=getints()
ts=getints()

segm = [[s,s+t] for s in ts]

update = True
while update:
    update = False
    new_segm = [segm[0]]
    for i in range(1, len(segm)):
        if new_segm[-1][1] >= segm[i][0]:
            new_segm[-1][1] = segm[i][1]
            update = True
        else:
            new_segm.append(segm[i])
    segm = new_segm

res = 0
for s in segm:
    res += s[1] - s[0]

print(res)


Measured memory_bytes: 107856
#include<cmath>
#include<iostream>
#include<iomanip>
#include<iso646.h>
#include<string>
#include<vector>

#define For(counter,initial_value,conditions) for( int counter = initial_value; counter < conditions; counter++ )

using namespace std;
int
main()
{
	int x, y, z;
	cin >> x >> y >> z;
	int ans = (x - z) / (y + z);
	cout << ans << endl;
}

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

int main(){
  int  n;
  double x,sum=0;
  string u;
  cin >> n;
  for(int i=0;i<n;i++){
    cin >> x >> u;
    if(u=="JPY") sum += x;
    else sum += x*380000.0;
  }
  cout << sum << endl;
}


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

struct Card {
  char suit;
  int value;
};



void bubbleSort(struct Card a[], int n) {
  bool f = true;
  while (f) {
    f = false;
    for (int i = 0; i<n-1; i++) {
      if (a[i].value > a[i+1].value) {
        Card t = a[i];
        a[i] = a[i+1];
        a[i+1] = t;
        f = true;
      }
    } 
  }
}


void selectionSort(struct Card a[], int n) {
  for (int i = 0; i<n; i++) {
    int minj = i;
    for (int j = i; j<n; j++) {
      if (a[minj].value > a[j].value)
      minj = j;
    }
    Card t = a[i];
    a[i] = a[minj];
    a[minj] = t;
  }
}

bool isStable(struct Card a[], struct Card b[], int n) {
  for (int i = 0; i < n; i++) {
    if (a[i].suit != b[i].suit) return false;
  }
  return true;
}

int main() {
  int n;
  cin >> n;
  Card c1[100], c2[100];
  rep(i, n) cin >> c1[i].suit >> c1[i].value;
  rep(i, n) c2[i] = c1[i];

  bubbleSort(c1, n);
  rep(i, n) {
    if (i==n-1) {
      cout << c1[i].suit << c1[i].value << endl;
    }
    else {
      cout << c1[i].suit << c1[i].value << ' ' << flush;
    }
  }
  cout << "Stable" << endl;

  selectionSort(c2, n);
  rep(i, n) {
    if (i==n-1) {
      cout << c2[i].suit << c2[i].value << endl;
    }
    else {
      cout << c2[i].suit << c2[i].value << ' ' << flush;
    }
   }

  if (isStable(c1, c2, n)) {
    cout << "Stable" << endl;
  } 
  else {
    cout << "Not stable" << endl;
  }


  return 0;
}



Measured memory_bytes: 3100
N, M = map(int, input().split())
l = [list(map(int, input().split())) for _ in range(N)]

a = 0

for xs in (1, -1):
  for ys in (1, -1):
    for zs in (1, -1):
      l_s = [x*xs + y*ys + z*zs for x, y, z in l]
      l_s.sort(reverse=True)
      a = max(sum(l_s[:M]), a)

print(a)


Measured memory_bytes: 3352
#include <iostream>
using namespace std;
int main(void){
    int x1,x2,x3,x4,x5;
    cin>>x1>>x2>>x3>>x4>>x5;
    
        if(x1==0){
        cout<<"1"<<endl;
    }
        if(x2==0){
        cout<<"2"<<endl;
    }
        if(x3==0){
        cout<<"3"<<endl;
    }
        if(x4==0){
        cout<<"4"<<endl;
    }
        if(x5==0){
        cout<<"5"<<endl;
    }
}


Measured memory_bytes: 3624
#include <iostream>
#include <string>
#include <vector>
#include <list>
#include <map>
#include <queue>
#include <stack>
#include <algorithm>
#include <fstream>
#include <sstream>
#include <iomanip>
#define ll long long

using namespace std;

long long MOD = 1000000007;

bool judge(int y, int x, vector<vector<char>> &A, vector<vector<char>> &B){
    int M=B.size();
    for(int i=0; i<M; i++){
        for(int j=0; j<M; j++){
            if(A[y+i][x+j]!=B[i][j]){
                return false;
            }
        }
    }
    return true;
}

int main(){
    int N, M;
    cin >> N >> M;

    vector<vector<char>> A(N,vector<char>(N));
    for(auto &line:A){
        for(auto &a:line){
            cin >> a;
        }
    }
    vector<vector<char>> B(M,vector<char>(M));
    for(auto &line:B){
        for(auto &b:line){
            cin >> b;
        }
    }

    for(int i=0; i<N-M+1; i++){
        for(int j=0; j<N-M+1; j++){
            if(judge(i,j,A,B)){
                cout << "Yes" << endl;
                return 0;
            }
        }
    }
    cout << "No" << endl;
}

Measured memory_bytes: 3596
#include<stdio.h>
#define FOR(n) for(int i=0;i<n;i++)
#define PRN(n) printf("%d\n",n)
#define PRS(s) printf("%s\n",s)
int main(void){
  int n,cnt=0;
  scanf("%d",&n);
  FOR(n){
    int a;
    scanf("%d",&a);
    if(a!=i+1)cnt++;
  }
  if(cnt<3){
    PRS("YES");
  }else{
    PRS("NO");
  }
  return 0;
}

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

const int MAX_N = 200005;
int64_t as[MAX_N];

int main() {
  int N;
  scanf("%d", &N);
  for (int i = 0; i < N; ++i) {
    scanf("%lld", as + i);
  }
  std::sort(as, as + N);
  int64_t ans = 0;
  int count = N;
  int i = N - 1;
  while (count > 0) {
    ans += as[i] * std::min(2, count);
    count -= 2;
    i--;
  }
  ans -= as[N-1];
  printf("%lld\n", ans);
}


Measured memory_bytes: 5380
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const ll MOD = 1e9 + 7;
const ll INF = 1LL << 60;
#define rep(i, a, n) for (ll i = (a); i < (n); i++)
#define debug(x) cerr << #x << ": " << x << endl;
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;}

int main() {
    ll n;
    cin >> n;
    vector<ll> a(n), c(n-1);
    ll ans = 0;
    rep(i, 0, n) cin >> a[i];
    rep(i, 0, n) {
        ll b;
        cin >> b;
        ans += b;
    }
    debug(ans)
    rep(i, 0, n-1) cin >> c[i];
    rep(i, 0, n-1) {
        if(a[i+1] - a[i] == 1) ans += c[a[i]-1];
    }
    cout << ans << endl;
}

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

// {U}{INT,LONG,LLONG}_{MAX,MIN}
#define INF         INT_MAX/3
#define LLINF       LLONG_MAX/3
#define MOD         (1000000007LL)
#define MODA(a, b)  a=((a)+(b))%MOD
#define MODP(a, b)  a=((a)*(b))%MOD
#define inc(i, l, r)   for(int i=(l);i<(r);i++)
#define dec(i, l, r)   for(int i=(r)-1;i>=(l);i--)
#define pb          push_back
#define se          second
#define fi          first
#define mset(a, b)  memset(a, b, sizeof(a))

using LL  = long long;
using G   = vector<vector<int>>;

int di[] = {0, -1, 0, 1};
int dj[] = {1, 0, -1, 0};
// }}}

int main() {
    cin.tie(0);ios::sync_with_stdio(false);
    double t, x;cin >> t >> x;
    printf("%.9lf\n", t/x);
    return 0;
}


Measured memory_bytes: 256
import math

a, b, x = map(int, input().split())

tan_theta = 2*(b/a-x/math.pow(a, 3))
tan_theta2 = a * pow(b, 2) / (2 * x)

if math.pow(a, 3) / 2 * tan_theta < x:
    theta = math.atan(tan_theta)
else:
    theta = math.atan(tan_theta2)

print(math.degrees(theta))


Measured memory_bytes: 3188
#include<iostream>

using std::cout;
using std::cin;
using std::endl;

void check(int m, int f, int r) {
    int sum = m + f;
    if (m == -1 || f == -1) {
        cout << 'F' << endl;
    } else if (sum >= 80) {
        cout << 'A' << endl;
    } else if (sum >= 65) {
        cout << 'B' << endl;
    } else if (sum >= 50) {
        cout << 'C' << endl;
    } else if (sum >= 30 && r >= 50) {
        cout << 'C' << endl;
    } else if (sum >= 30) { // ???????¨?50?????????
        cout << 'D' << endl;
    } else {
        cout << 'F' << endl;
    }
}

int main(void) {
    int m;
    int f;
    int r;
    cin >> m >> f >> r;
    while (m != -1 || f != -1 || r != -1) {
        check(m, f, r);
        cin >> m >> f >> r;
    }
    return 0;
}

Measured memory_bytes: 3096
#include <iostream>
#include <vector>
#include <string>
#include <cmath>
#include <deque>
#include <utility>
#include <algorithm>
using namespace std;

int main(void){
    string s;
    cin>>s;
    
    string ss=s[0]+to_string(s.size()-2)+s[s.size()-1];
    
    cout<<ss<<endl;
}


Measured memory_bytes: 256
//#include<iostream>
//#include<string>
//#include<math.h>
//#include<string.h>
#include<bits/stdc++.h>
const int N=1e5+5;
char s[N];
int flag=0;
using namespace std;

int main()
{
	cin>>s;
	int l=strlen(s);
	for(int i=0;i<=l-1;i++){
		if(s[i]=='C') flag=1;
		if(s[i]=='F'&&flag==1){
	
			cout<<"Yes"<<endl;
			return 0;
		}
	}
	cout<<"No"<<endl;
	return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <cstring>
#include <fstream>
#include <random>
#include <cmath>
#include <iomanip>
#include <climits>
#include <cstdlib>
#include <algorithm>
#include <vector>
#include <map>
#include <deque>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <list>
#include <unordered_map>
#include <bitset>
#include <sstream>

typedef  long long ll;
#define mop 1000000007
using namespace std;

int main() {
   
    ll a,b,c;
    cin >> a >> b >> c;
    if(c < a+b){
        cout << "No" << endl;
        return 0;
    }
    ll judge = a*a + b*b + c*c - 2*a*b - 2*b*c - 2*c*a;
    if(judge > 0){
        cout << "Yes" << endl;
    }else{
        cout << "No" << endl;
    }
}

Measured memory_bytes: 256
//高知能系Vtuberの高井茅乃です。
//Twitter: https://twitter.com/takaichino
//YouTube: https://www.youtube.com/channel/UCTOxnI3eOI_o1HRgzq-LEZw

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;

#define INF 1999999999
#define REP(i,n) for(int i=0;i<n;i++)
#define REP1(i,n) for(int i=1;i<=n;i++)
#define MODA 1000000007 

int main() {
	int ans = 0;
	int tmp;
	int n;
	ll k;
	cin >> n >> k;
	vector<int> a(n+1);
	a[0] = 0;
	REP1(i, n) cin >> a[i];
	ll t = 0;
	int now = 1;
	vector<ll> cou(n+1, -1);
	while(cou[now] < 0 && t < k){
		//cout << now << " " << t << " " << a[now] << " " << cou[a[now]] << endl;
		cou[now] = t;
		t++;
		now = a[now];
	}	
	if(t == k) cout << now << endl;
	else{
		ll war = t - cou[now];
		ll res = k - t;
		//cout << res % war << endl;
		REP1(i, n){
			//cout << i << " " << cou[i] << endl;
			if(cou[i] - cou[now] == res % war) cout << i << endl;
		}
	}
}

Measured memory_bytes: 5636
#include <iostream>
#include <iomanip>
#include <cmath>
#include <string>
#include <vector>
#include <queue>
#include <stack>
#include <algorithm>
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vll;
const ll mod=1e9+7;

int main(){
	ll N;
	cin >> N;
	ll min=N*2;

	for(ll i=1; i<=sqrt(N); i++){
		if(N%i==0){
			if(min>i+N/i) min=i+N/i;
		}
	}

	cout << min-2 << endl;
	return 0;
}

Measured memory_bytes: 256
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.io.FilterInputStream;
import java.io.BufferedInputStream;
import java.io.InputStream;

/**
 * @author khokharnikunj8
 */

public class Main {
    public static void main(String[] args) {
        new Thread(null, new Runnable() {
            public void run() {
                new Main().solve();
            }
        }, "1", 1 << 26).start();
    }

    void solve() {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        ScanReader in = new ScanReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        BPowerSocket solver = new BPowerSocket();
        solver.solve(1, in, out);
        out.close();
    }

    static class BPowerSocket {
        public void solve(int testNumber, ScanReader in, PrintWriter out) {
            int a = in.scanInt();
            int b = in.scanInt();
            int inital = 1;
            int ans = 0;
            while (inital < b) {
                inital += (a - 1);
                ans++;
            }
            out.println(ans);
        }

    }

    static class ScanReader {
        private byte[] buf = new byte[4 * 1024];
        private int index;
        private BufferedInputStream in;
        private int total;

        public ScanReader(InputStream inputStream) {
            in = new BufferedInputStream(inputStream);
        }

        private int scan() {
            if (index >= total) {
                index = 0;
                try {
                    total = in.read(buf);
                } catch (Exception e) {
                    e.printStackTrace();
                }
                if (total <= 0) return -1;
            }
            return buf[index++];
        }

        public int scanInt() {
            int integer = 0;
            int n = scan();
            while (isWhiteSpace(n)) n = scan();
            int neg = 1;
            if (n == '-') {
                neg = -1;
                n = scan();
            }
            while (!isWhiteSpace(n)) {
                if (n >= '0' && n <= '9') {
                    integer *= 10;
                    integer += n - '0';
                    n = scan();
                }
            }
            return neg * integer;
        }

        private boolean isWhiteSpace(int n) {
            if (n == ' ' || n == '\n' || n == '\r' || n == '\t' || n == -1) return true;
            else return false;
        }

    }
}



Measured memory_bytes: 23508
#include<bits/stdc++.h>
#define ll long long
#define ld long double
#define fastio ios_base::sync_with_stdio(0);cin.tie(NULL);cout.tie(NULL)
#define pb push_back
#define pf push_front
#define mp make_pair
#define mod 1000000007
#define vll vector<ll>
#define inf 1e18
#define pll pair<ll,ll>
#define ff first 
#define ss second 
#define PI acos(-1)
using namespace std;
ll n,k;
ll a[200005];
ll check(ll x)
{
	ll sum=0;
	for(ll i=1;i<=n;i++)
	{
		if(a[i]>x)
		sum+=(ceil(1.0*(a[i])/x) -1);
	}
	if(sum<=k)return 1;
	return 0;
}
int main() 
{
    fastio; 
    ll T=1;
    //cin>>T; 
    while(T--)
    { 	
    	cin>>n>>k;
    	for(ll i=1;i<=n;i++)cin>>a[i];
    	ll lo=1,hi=*max_element(a+1,a+n+1);
    	while(lo<hi)
    	{
    		ll mid=(lo+hi)/2;
    		if(check(mid))
    		{
    			hi=mid;
			}
			else
			{
				lo=mid+1;
			}
		}
		cout<<hi<<endl;
	}
}
 

Measured memory_bytes: 5120
#include <iostream>
#include <algorithm>
#include <cmath>
#include <string>
#include <array>
#include <vector>
#include <functional>
#include <unordered_map>
#include <map>
#include <numeric>
#include <limits>
#include <utility>
#include <queue>
#include <random>
using namespace std;

int main(){
	int x, a, b;

	cin >> x;
	cin >> a;
	cin >> b;

	int s, t;

	if (x > a) {
		s = x - a;
	} else {
		s = a - x;
	}

	if (x > b) {
		t = x - b;
	} else {
		t = b - x;
	}

	if (s > t) {
		cout << "B";
	} else {
		cout << "A";
	}

	return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<cmath>

int main(){
  int a,b;
  std::cin>>a>>b;
  double f = std::ceil(a/.08), f2=b/.1;
  int s=f*.1, s2=f2*.08;
  if(s == b)
    std::cout<<f<<std::endl;
  else if(s2 == a)
    std::cout<<f2<<std::endl;
  else
    std::cout<<"-1\n";
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
long long p = 1e9+7;
long long solve(long long x, long long n){
    long long temp = x, res = 1;
    while(n!=0){
        if(n&1) res = (res*temp)%p;
        temp = (temp*temp)%p;
        n/=2;
    }
    return res;
}
int main()
{
    long long N;
    cin>>N;
    if(N<2)
        cout<<0;
    else
        cout<<(solve(10, N)-solve(9, N)-solve(9, N) + solve(8, N)+10*p)%p;
}


Measured memory_bytes: 3632
def funct(a):
  c = 1
  if(0 in a):	return 0
  for i in range(len(a)):
    c *= a[i]
    if(c > 10 ** 18):
      return -1
  return c
n = input()
a = [int(x) for x in input().split()]
print(funct(a))


Measured memory_bytes: 21768
#include <iostream>
#include <cstring>
#include <bits/stdc++.h>
using namespace std;
string a,b;
int n;
int main()
{
    cin>>a>>b;
    if(a.length()>b.length())
    n=b.length();
    else
    n=a.length();
    for(int i=0;i<n;i++)
    {
        cout<<a[i]<<b[i];
    }
    if(a.length()>b.length())
    for(int i=n;i<a.length();i++)
    {
        cout<<a[i];
    }
    else
    {
            for(int i=n;i<b.length();i++)
    {
        cout<<b[i];
    }
    }
    cout<<endl;
    return 0;
}

Measured memory_bytes: 256
#include<stdio.h>
int main()
{
    int n,s[10000],i,j,mini,temp,swap=0;
    scanf("%d",&n);
    for(i=0; i<n; i++)
    {
        scanf("%d",&s[i]);
    }
    for(i=0; i<n; i++)
    {
        mini=i;
        for(j=i; j<n; j++)
        {
            if (s[j]<s[mini])
            {
                mini=j;
            }
        }
        if(i!=mini){
        temp=s[i];
        s[i]=s[mini];
        s[mini]=temp;
        swap++;}
    }
    for(i=0; i<n; i++)
        {
            if(i<n-1)
                printf("%d ",s[i]);
            if(i==n-1)
                printf("%d\n",s[i]);
        }
    printf("%d\n",swap);
}



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

int main(){
    int A,B;
    cin>>A>>B;
    if(A<=8){
        if(B<=8){
            cout<<"Yay!"<<endl;
        }
        else{
            cout<<":("<<endl;
        }
    }
    else{
            cout<<":("<<endl;
    }
}

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

using ll = int64_t;
#define int ll

#define FOR(i, a, b) for (int i = int(a); i < int(b); i++)
#define REP(i, b) FOR(i, 0, b)
#define MP make_pair
#define PB push_back
#define EB emplace_back
#define ALL(x) x.begin(), x.end()

using pi = pair<int, int>;
using vi = vector<int>;
using ld = long double;

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

template <class T> ostream &operator<<(ostream &os, const vector<T> &v) {
  os << "{";
  REP(i, (int)v.size()) {
    if (i)
      os << ",";
    os << v[i];
  }
  os << "}";
  return os;
}

ll read() {
  ll i;
  scanf("%" SCNd64, &i);
  return i;
}

void printSpace() { printf(" "); }

void printEoln() { printf("\n"); }

void print(ll x, int suc = 1) {
  printf("%" PRId64, x);
  if (suc == 1)
    printEoln();
  if (suc == 2)
    printSpace();
}

string readString() {
  static char buf[3341000];
  scanf("%s", buf);
  return string(buf);
}

char *readCharArray() {
  static char buf[3341000];
  static int bufUsed = 0;
  char *ret = buf + bufUsed;
  scanf("%s", ret);
  bufUsed += strlen(ret) + 1;
  return ret;
}

template <class T, class U> void chmax(T &a, U b) {
  if (a < b)
    a = b;
}

template <class T, class U> void chmin(T &a, U b) {
  if (b < a)
    a = b;
}

template <class T> T Sq(const T &t) { return t * t; }

const int mod = 1e9 + 7;

signed main() {
  int n = read();
  map<int, int> cntMap;
  REP(i, n) {
    int a = read();
    if (cntMap.count(a) == 0)
      cntMap[a] = 1;
    else
      cntMap[a]++;
  }
  int ans = 0;
  for (auto &p : cntMap) {
    if (p.second & 1)
      ans++;
  }
  print(ans);
}


Measured memory_bytes: 6528
#include <bits/stdc++.h>
#define pb push_back
#define F first
#define S second

using namespace std;

typedef long long ll;
typedef pair<int,int> pii;
int cnt[27];
int check(char c, string& str,int n){
    for (int i= 0;i < n;i++)
        if (str[i] != c) return false;
    return true;
}
int main(){
    string str;
    cin >> str;
    for (int i = 0;i < str.length();i++){
        cnt[str[i] - 'a']++;
    }
    int minop = 1e9;
    for (int i= 0 ;i < 26;i++){
        char cchar = i + 'a';
        string strc = str;
        int op = 0,n = str.length();
        while(!check(cchar,strc,n)){
            n--;
            op++;
            for (int i= 0;i < n;i++){
                if (strc[i] == cchar || strc[i + 1] == cchar) strc[i] = cchar;
            }
        }

        minop = min(minop,op);
    }
    cout << minop << endl;
    return 0;
}


Measured memory_bytes: 256
#include<stdio.h>

int main(){
   int n,i,x;
   scanf("%d",&n);
   for(i=1;i<=n;i++){
     x=i;
     if(x%3==0){
       printf(" %d",i);
     }else if(x%10==3){
       printf(" %d",i);
   }else{
     while(x !=0){
       x /=10;
       if(x%10==3){
         printf(" %d",i);
         break;
       }
     }
   }
 }
   printf("\n");
   return 0;
}


Measured memory_bytes: 2104
#include<stdio.h>
int main(){
	int h, w;
	int i, j;
	while(1){
		scanf("%d %d", &h, &w);
		if(h == 0 && w == 0)break;
		for(i = 0;i < h;i++){
			for(j = 0;j < w;j++){
				printf("#");
			}
			printf("\n");
		}
		printf("\n");
	}
	return 0;
}


Measured memory_bytes: 2044
#include <iostream>

using namespace std;

int main()
{
    int n, m;
    while(cin >> n >> m,n){
    int taro[n] = {0};
    int hanako[m] = {0};
    int taro_sum = 0;
    int hanako_sum = 0;
    int min_sum = 10010;
    int taro_min = -1, hanako_min;

    for (int i = 0; i < n; i++)
    {
        cin >> taro[i];
        taro_sum += taro[i];
    }
    for (int i = 0; i < m; i++)
    {
        cin >> hanako[i];
        hanako_sum += hanako[i];
    }
    for (int i = 0; i < n; i++)
    {
        for (int j = 0; j < m; j++)
        {
            if (taro_sum - taro[i] + hanako[j] == hanako_sum - hanako[j] + taro[i])
            {
                if (min_sum > taro_sum - taro[i] + hanako[j])
                {
                    min_sum = taro_sum - taro[i] + hanako[j];
                    taro_min = taro[i];
                    hanako_min = hanako[j];
                }
            }
        }
    }
    if(taro_min == -1){
        cout << -1 << endl;
    }else{
    cout << taro_min << ' ' << hanako_min << endl;
    }
    }
}


Measured memory_bytes: 3012
n = int(input())
T = list(map(int, input().split()))
A = list(map(int, input().split()))

MOD = 10 ** 9 + 7

# T -> の向きでみて増加している場合と初項は対応するAの要素はa >= t
# 同様に、A <- の向きでみて増加している場合と初項は対応するTの要素はa <= t


cap = [min(t, a) for t, a in zip(T, A)]

if max(A) != max(cap) or max(T) != max(cap):
  print(0)
  exit()

capm = max(cap)

cm = cap.count(capm)

ans = 1

if cm > 2:
  for _ in range(cm - 2):
    ans *= capm
    ans %= MOD

for i in range(1, n - 1):
  if cap[i] == capm:
    break
  if cap[i - 1] == cap[i] and cap[i] <= cap[i + 1]:
    if cap[i] < cap[i + 1] or not cap[i + 1] == capm: 
      ans *= cap[i]
      ans %= MOD

for i in reversed(range(1, n - 1)):
  if cap[i] == capm:
    break
  if cap[i + 1] == cap[i] and cap[i] <= cap[i - 1]:
    if cap[i] < cap[i - 1] or not cap[i - 1] == capm: 
      ans *= cap[i]
      ans %= MOD
      
print(ans)

Measured memory_bytes: 25500
#include<bits/stdc++.h>
#define rep(i,a,b) for(int i=a;i<=b;++i)
#define per(i,a,b) for(int i=a;i>=b;--i)
#define repd(i,a,b) for(int i=a;i>=b;--i)
#define rvc(i,S) for(int i=0;i<(int)S.size();++i)
#define fore(i,x) for(int i = head[x] ; i ; i = e[i].next)
#define mp make_pair
#define pb push_back
#define maxn 200005
#define ll long long 
#define fi first
#define se second
#define debug(...) fprintf(stderr,__VA_ARGS__)
using namespace std;
int n,m;
int vis[maxn];
int fa[maxn];
int dep[maxn];
vector<int> G1[maxn],G2[maxn];
void dfs(int x)
{ if(vis[x]) return;
  vis[x]=1;
  int pre=0;
  for(int i=0;i<G2[x].size();i++)
   { int u=G2[x][i];
     dfs(u);
     if(dep[u]>dep[pre]) pre=u;
   }
   fa[x]=pre;dep[x]=dep[pre]+1;
}
int main()
{ cin>>n>>m;
  rep(i,1,m+n-1)
  {int x,y; scanf("%d%d",&x,&y);
   G1[x].pb(y); G2[y].pb(x);
  }
  rep(i,1,n)
  { if(!vis[i])  
      dfs(i);
  } 
  rep(i,1,n) printf("%d\n",fa[i]);
return 0;	
}

Measured memory_bytes: 22912
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define ll long long
int in() {int x; cin>>x; return x;}
ll lin() {ll x; cin>>x; return x;}
string sin() {string x;cin>>x;return x;}
using graph = vector<vector<int>>;
using graph2 = vector<vector<pair<int, int>>>;

int main(){
    int n, m;
    cin>>n>>m;
    int a[n];
    rep(i, n){
        a[i]=1;
    }
    int b[n];//checker
    int x, y;
    b[0]=1;
    rep(i, m){
        cin>>x>>y;
        if(b[x-1]==1){
            if(a[x-1]>1){
                b[y-1]=1;
            }
            else{
                b[x-1]=0;
                b[y-1]=1;
            }
        }
        a[x-1]--;
        a[y-1]++;
    }
    int count=0;
    rep(i, n){
        if(b[i]==1){
            count++;
        }
    }
    cout<<count<<endl;
}

Measured memory_bytes: 1024
/*------------------------------------
........Bismillahir Rahmanir Rahim....
..........created by Abdul Aziz.......
------------------------------------*/
#include <iostream>
#include <algorithm>
#include <stdio.h>
#include <cmath>
#include <vector>
#include <set>
#include <list>
#include <stack>
#include <map>
#include <cstring>
#include <unordered_map>
#include <queue>
#define   mod  998244353
#define   int  long long 
#define   ld   long double
#define   pb   push_back
#define   vi  vector<int> 
#define   dbg(x)  cerr << #x << " = " << x << '\n'
#define   sz(x)  (int)x.size()
#define   all(a) (a.begin(),a.end())
#define   ff   first
#define   ss   second
#define   pii  pair<int,int> 
#define   lcm(a,b) (a*b)/__gcd(a,b) 
using namespace std;

inline void solve(){
    int  r, c, a, b; 
    cin >> r >> c >> a >> b ; 
    for (int i=0;i<r;i++){
        for (int j=0;j<c;j++){
            if ((i<b and j<a) or (i>=b and j>=a)) cout << 0 ;
          	else cout << 1 ;
        }
      	cout << endl;
    }
}

signed main()
{
    int n=1; // cin>>n;
    while (n--) solve();
    return 0;
}


Measured memory_bytes: 3632
#include <iostream>
using namespace std;
int main(){
  int a,b,c,d;
  cin>>a>>b>>c>>d;
  int A=a/d;
  int B=c/b;
  if(a%d!=0)A++;
  if(c%b!=0)B++;
  if(A>=B)cout<<"Yes"<<endl;
  else cout<<"No"<<endl;
  return 0;
}


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

using namespace std;

#define LL long long
#define DD double
#define Pb push_back
#define Bp pop_back
#define Pf push_front
#define Fp pop_front
#define Ub upper_bound
#define Lb lower_bound
#define In insert
#define All(x) x.begin(), x.end()
#define mem(a, b) memset(a, b, sizeof(a))
#define fast ios_base::sync_with_stdio(0);cin.tie(0)
#define X first
#define Y second
#define mx1 10
#define mx2 110
#define mx3 1010
#define mx4 10010
#define mx5 100010
#define mx6 1000010

typedef vector<LL> Vl;
typedef vector<DD> Vd;
typedef vector<bool> Vb;
typedef vector<Vl> VVl;
typedef pair<LL, LL> Pll;
typedef pair<DD, DD> Pdd;
typedef vector<Pll> Vpl;
typedef vector<Pdd> Vpd;
typedef queue<LL> Ql;
typedef stack<LL> Sl;
typedef deque<LL> Dl;

LL _set(LL N, LL pos) {return N = N | (1 << pos);}
LL _reset(LL N, LL pos) {return N = N & ~(1 << pos);}
bool _check(LL N, LL pos) {return (bool)(N & (1 << pos));}
bool _upper(char a) {return a >= 'A' && a <= 'Z';}
bool _lower(char a) {return a >= 'a' && a <= 'z';}
bool _digit(char a) {return a >= '0' && a <= '9';}

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

///**************************DONE****************************///

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

    if((a + b) % 2)
        cout << "IMPOSSIBLE\n";
    else
        cout << (a + b) / 2 << '\n';
    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std; 
#define ll long long int
#define pb push_back
#define mp make_pair
#define pll pair<ll,ll>
#define INF LLONG_MAX
#define PI acos(-1)
#define MOD 1e9 + 7
#define N 1e5 + 10

struct gem
{
	ll v;
	ll c;
	ll x;
	bool operator<(gem other) const
    {
        return x<other.x;
    }

};
int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);
	ll n;
	cin>>n;
	ll i=0;
	vector<pair<double,gem> > vec;
	gem g[n];
	for(i=0;i<n;i++)
	{
		cin>>g[i].v;
	}
	for(i=0;i<n;i++)
	{
		cin>>g[i].c;
		g[i].x=(g[i].v*1.0)/g[i].c;
	}
	double x=0.0;
	for(i=0;i<n;i++)
	{
		x=(g[i].c*1.0)/g[i].v;
		vec.pb(mp(x,g[i]));
		//cout<<x<<"\n";
	}
	sort(vec.begin(),vec.end());
	gem ge;
	ll sum=0,t=0;
	for(i=0;i<n;i++)
	{
		ge=vec[i].second;
		t=sum+ge.v-ge.c;
		if(sum<t)
		{
			sum=t;
		}
	}
	cout<<sum;
}	

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int mod=1e9+7;
const int N=1000010;
int main()
{
  int s;
  cin>>s;
  vector<int> v(N);
  v[0]=s;
  for(int i=1;i<=N;i++) {if(v[i-1]&1) v[i]=3*v[i-1]+1; else v[i]=v[i-1]/2;}
  for(int i=0;i<=N;i++) for(int j=i+1;j<=N;j++) if(v[j]==v[i]) return cout<<(j+1)<<endl,0;
  return 0;
}


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

int main(int argc, char const* argv[])
{
	int a,b;
  	cin >> a >> b;
  	
  	if (a > 8 || b > 8){
      cout << ":(" << endl;
    }else{
      cout << "Yay!" << endl;
    }
  
    return 0;
}


Measured memory_bytes: 256
import sys

x, a, b = map(int, sys.stdin.readline().split())

def main():
    d = -a + b
    if d <= 0: ans = 'delicious'
    elif d <= x: ans = 'safe'
    else: ans = 'dangerous'
    print(ans)

if __name__ ==  '__main__':
    main()

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

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

  vector<int> seikai_counts(N, 0);

  for (int i = 0; i < Q; i++) {
    int Ai;
    cin >> Ai;
    seikai_counts[Ai - 1]++;
  }

  for (int i = 0; i < N; i++) {
    if (K > Q - seikai_counts[i]) {
      cout << "Yes" << endl;
    } else {
      cout << "No" << endl;
    }
  }
}


Measured memory_bytes: 1024
def i():
	return int(input())
def i2():
	return map(int,input().split())
def s():
	return str(input())
def l():
	return list(input())
def intl():
	return list(int(k) for k in input().split())

a,b = i2()
if a*b%2 == 0:
	print("No")
else:
	print("Yes")

Measured memory_bytes: 3060
#include <bits/stdc++.h>
#define int long long
#define endl '\n'
#define FOR(i, a, n) for (int i = (a); i < (n); ++i)
#define REP(i, n) FOR(i, 0, n)
using namespace std;

int N, M;
int a[50], b[50];
int u[20], v[20];
vector<int> g[50];
int pre[50];
int st[20];
int id[50][50];

void dfs(int cv, int pv) {
    pre[cv] = pv;
    for (int nv : g[cv]) if (nv != pv) {
        dfs(nv, cv);
    }
}

void _main() {
    cin >> N;
    REP (i, N - 1) {
        cin >> a[i] >> b[i];
        a[i]--; b[i]--;
        g[a[i]].push_back(b[i]);
        g[b[i]].push_back(a[i]);
        id[a[i]][b[i]] = id[b[i]][a[i]] = i;
    }
    cin >> M;
    REP (i, M) {
        cin >> u[i] >> v[i];
        u[i]--; v[i]--;
        REP (j, N) pre[i] = -1;
        dfs(u[i], -1);
        int cv = v[i];
        while (pre[cv] >= 0) {
            int pv = pre[cv];
            st[i] |= (1LL << id[cv][pv]);
            cv = pv;
        }
    }
    int ans = 0;
    REP (bit, 1LL << M) {
        int k = (__builtin_popcountll(bit) % 2 == 1 ? -1 : 1);
        int st2 = 0;
        REP (i, M) if (bit >> i & 1) {
            st2 |= st[i];
        }
        (ans += k * (1LL << (N - 1 - __builtin_popcountll(st2))));
    }
    cout << ans << endl;
}

signed main(signed argc, char **argv) {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    cout << fixed << setprecision(10);
    _main();
    return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <cmath>
#include <cstdlib>
#include <cstring>
#include <climits>
#include <algorithm>
#include <numeric>
#include <utility>
#include <random>
#include <chrono>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>

using namespace std;

using LL = long long;
using ULL = unsigned long long;
using PII = pair<int, int>;
using PIL = pair<int, LL>;
using PLL = pair<LL, LL>;
// const int mod = 1e9 + 7;
// const int mod = 998244353;

inline void quickread() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
}

const int maxn = 1e7 + 5;
int a[maxn];
LL ans = 0;
inline void work() {
    for (int i = 1; i <= 10000000; ++i) {
        for (int j = i; j <= 10000000; j += i) 
            a[j]++;
    }
    int n;
    cin >> n;
    for (int i = 1; i <= n; ++i) {
        ans += (LL)i * a[i]; 
    }
    cout << ans << endl;
}

int main() {
    // freopen(".txt", "r", stdin);
    quickread();
    work();
    return 0;
}

Measured memory_bytes: 42712
n, m, c = map(int, input().split())
b = list(map(int, input().split()))
a = [0] * n
for i in range(n):
    a[i] = list(map(int, input().split()))
ans = 0

for i in range(n):
    zzz = 0
    for j in range(m):
        zzz += a[i][j] * b[j]
    if zzz > -c:
        ans += 1

print(ans)


Measured memory_bytes: 62320
N, Q = map(int, input().split())
S = input()

memo = [0 for _ in range(N)]
cnt = 0
for i in range(1, N):
    if S[i - 1] == 'A' and S[i] == 'C':
        cnt += 1
    memo[i] = cnt

for _ in range(Q):
    x, y = map(int, input().split())
    x -= 1
    y -= 1
    print(memo[y] - memo[x])



Measured memory_bytes: 52640
#include<iostream>
#include<vector>
#include<algorithm>
#include<map>
#include<cstring>
#include<math.h>
#include<bitset>
#include<queue>
#include<set>
#include<iomanip>
#include<math.h>
// #include<bits/stdc++.h>
using namespace std;
#define ll long long
constexpr long long int INFLL = 1001001001001001LL;
constexpr int INFI = 1000000007;

int main(){
  int N;
  cin >> N;
  tuple<int,int,int> ans;
  vector<int> X(N),Y(N),H(N);
  tuple<int,int,int> G;
  for(int i=0; i<N; i++){
    cin >> X[i] >> Y[i] >> H[i];
    if(H[i] >= 1){
      G = make_tuple(X[i], Y[i], H[i]);
    }
  }
  for(int i=0; i<=100; i++){
    for(int j=0; j<=100; j++){
      int H_mid = get<2>(G) + abs(i-get<0>(G)) + abs(j-get<1>(G));
      bool ok=true;
      for(int k=0; k<N; k++){
        int H_sub = H_mid - abs(i-X[k]) -abs(j-Y[k]);
        H_sub = max(H_sub,0);
        if(H_sub != H[k]){
          ok = false;
          break;
        }
      }
      if(ok){
        ans = make_tuple(i, j, H_mid);
      }
    }
  }
  cout << get<0>(ans) << " " << get<1>(ans) << " " << get<2>(ans) << endl;
  return 0;
}


Measured memory_bytes: 256
#![allow(unused_imports)]
#![allow(non_snake_case, unused)]

use std::cmp::*;
use std::collections::*;
use std::ops::*;

// https://atcoder.jp/contests/hokudai-hitachi2019-1/submissions/10518254

macro_rules! eprint {
	($($t:tt)*) => {{
		use ::std::io::Write;
		let _ = write!(::std::io::stderr(), $($t)*);
	}};
}
macro_rules! eprintln {
	() => { eprintln!(""); };
	($($t:tt)*) => {{
		use ::std::io::Write;
		let _ = writeln!(::std::io::stderr(), $($t)*);
	}};
}
macro_rules! dbg {
	($v:expr) => {{
		let val = $v;
		eprintln!("[{}:{}] {} = {:?}", file!(), line!(), stringify!($v), val);
		val
	}}
}

macro_rules! mat {
	($($e:expr),*) => { Vec::from(vec![$($e),*]) };
	($($e:expr,)*) => { Vec::from(vec![$($e),*]) };
	($e:expr; $d:expr) => { Vec::from(vec![$e; $d]) };
	($e:expr; $d:expr $(; $ds:expr)+) => { Vec::from(vec![mat![$e $(; $ds)*]; $d]) };
}

macro_rules! ok {
	($a:ident$([$i:expr])*.$f:ident()$(@$t:ident)*) => {
		$a$([$i])*.$f($($t),*)
	};
	($a:ident$([$i:expr])*.$f:ident($e:expr$(,$es:expr)*)$(@$t:ident)*) => { {
		let t = $e;
		ok!($a$([$i])*.$f($($es),*)$(@$t)*@t)
	} };
}

pub fn readln() -> String {
	let mut line = String::new();
	::std::io::stdin().read_line(&mut line).unwrap_or_else(|e| panic!("{}", e));
	line
}

macro_rules! read {
	($($t:tt),*; $n:expr) => {{
		let stdin = ::std::io::stdin();
		let ret = ::std::io::BufRead::lines(stdin.lock()).take($n).map(|line| {
			let line = line.unwrap();
			let mut it = line.split_whitespace();
			_read!(it; $($t),*)
		}).collect::<Vec<_>>();
		ret
	}};
	($($t:tt),*) => {{
		let line = readln();
		let mut it = line.split_whitespace();
		_read!(it; $($t),*)
	}};
}

macro_rules! _read {
	($it:ident; [char]) => {
		_read!($it; String).chars().collect::<Vec<_>>()
	};
	($it:ident; [u8]) => {
		Vec::from(_read!($it; String).into_bytes())
	};
	($it:ident; usize1) => {
		$it.next().unwrap_or_else(|| panic!("input mismatch")).parse::<usize>().unwrap_or_else(|e| panic!("{}", e)) - 1
	};
	($it:ident; [usize1]) => {
		$it.map(|s| s.parse::<usize>().unwrap_or_else(|e| panic!("{}", e)) - 1).collect::<Vec<_>>()
	};
	($it:ident; [$t:ty]) => {
		$it.map(|s| s.parse::<$t>().unwrap_or_else(|e| panic!("{}", e))).collect::<Vec<_>>()
	};
	($it:ident; $t:ty) => {
		$it.next().unwrap_or_else(|| panic!("input mismatch")).parse::<$t>().unwrap_or_else(|e| panic!("{}", e))
	};
	($it:ident; $($t:tt),+) => {
		($(_read!($it; $t)),*)
	};
}


pub fn main() {
	let _ = ::std::thread::Builder::new().name("run".to_string()).stack_size(32 * 1024 * 1024).spawn(run).unwrap().join();
}

const MOD: u32 = 1_000_000_007;
const INF: i64 = std::i64::MAX/3;

fn solve() {
	let x = read!(i64);
	let mut ans = INF;
	for i in 1..1000 {
		for j in 1..1000 {
			if x*i==360*j {
				ans = min(ans, i);
			}
		}
	}
	println!("{}",ans);
}

fn run() {
    solve();
}


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

using namespace std;

using ll = long long;

struct Prime {
    int N;
    vector<bool> is_p;

    Prime(int _N) : N(_N), is_p(N + 1, true) {
        is_p[0] = is_p[1] = false;
        for (long long i = 2; i <= N; ++i) {
            if (is_p[i])
                for (long long j = i * i; j <= N; j += i)
                    is_p[j] = false;
        }
    }
    bool operator[](const int idx) const { return is_p[idx]; }
};

template<class T>
std::vector<std::pair<T, T>> PrimeFactorization(T n) {
    std::vector<std::pair<T, T>> pf;
    T m = n;
    for (T i = 2; i * i <= n; ++i) {
        if (m % i != 0) continue;
        T cnt = 0;
        while (m % i == 0) { ++cnt; m /= i; }
        pf.emplace_back(std::make_pair(i, cnt));
    }
    if (1 < m) pf.emplace_back(std::make_pair(m, 1));

    return pf;
}

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

bool Check(const ll p, const ll n, const vector<ll> &a) {
    if (a[0] % p != 0) return false;
    for (ll s = 0; s <= min(n, p - 2); ++s) {
        ll sum = 0;
        for (ll x = s; x <= n; x += p - 1) sum += a[x];
        if (sum % p != 0) return false;
    }
    return true;
}

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

    ll n;
    cin >> n;

    vector<ll> a(n + 1);
    for (int i = n; 0 <= i; --i) cin >> a[i];

    Prime primes(n);
    set<ll> ans_p;
    for (ll p = 2; p <= n; ++p) {
        if (primes[p] && Check(p, n, a)) ans_p.insert(p);
    }

    ll g = abs(a[0]);
    for (int i = 1; i <= n; ++i) g = gcd(g, abs(a[i]));
    auto pf = PrimeFactorization<ll>(g);
    for (auto it : pf) ans_p.insert(it.first);

    // auto pf = PrimeFactorization<ll>(abs(a[n]));
    // for (auto p : pf) {
    //     if (Check(p.first, n, a)) ans_p.insert(p.first);
    // }

    for (auto p : ans_p) cout << p << '\n';

    return 0;
}


Measured memory_bytes: 384
n,k = map(int,input().split())
def jun(x):
    num = 1
    for i in range(1,x+1):
        num *= i
    return num
def p(y,x):
    num = 1
    for i in range(x+1,y+1):
        num *= i
    return num
def conv(n,m):
    if n-m < m:m = n-m
    if m == 0:return 1
    return p(n,n-m) // p(m,1)
#print(conv(5,3))
#print(jun(5))
for i in range(1,k+1):
    aocov = conv(k-1,i-1)
    akanarabi = jun(n-k-(i-1) + i)//(jun(n-k-(i-1)) * jun(i))
    print((aocov*akanarabi) % ((10**9) + 7))

Measured memory_bytes: 46556
#include <bits/stdc++.h>
using namespace std;
//#include <ext/pb_ds/assoc_container.hpp>
//using namespace __gnu_pbds;
//typedef tree <int,null_type,less <int>, rb_tree_tag, tree_order_statistics_node_update> indexed_set;
// #include <ext/rope>
// using namespace __gnu_cxx;
typedef long long int ll;
typedef long double ld;
#define FAST ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define rep(g, i, n) for (ll g = i; g < n; g++)
#define rev(g, n, i) for (ll g = n - 1; g >= i; g--)
#define all(v) v.begin(), v.end()
#define pb push_back
#define mxe(v) *max_element(v.begin(),v.end())
#define mne(v) *min_element(v.begin(),v.end())
#define ve vector
#define lb lower_bound
#define ub upper_bound
#define bb break
#define cc continue
#define rem 1000000007
#define PI 3.141592653589793238462643383279502
ll power(ll x, ll y, ll p) 
{ 
    ll res = 1;      // Initialize result 
    x = x % p;  // Update x if it is more than or 
    while (y > 0) 
    { 
        if (y & 1) 
            res = (res*x) % p; 
        y = y>>1; // y = y/2 
        x = (x*x) % p; 
    } 
    return res; 
} 
ll modInverse(ll n, ll p) 
{ 
    return power(n, p-2, p); 
} 
struct point
{
    ll x,y;
};
int main()
{
    FAST
    // freopen("input1.txt", "r", stdin);
    // freopen("output.txt", "w", stdout);
    /*ll tests;
    cin>>tests;
    rep (gg,0,tests)
    {}*/
    string s,t;
    cin>>s>>t;
    t.pop_back();
    if (s==t)
    {
        cout<<"Yes\n";
    }
    else
    {
        cout<<"No\n";
    }
    
}


Measured memory_bytes: 3648
#include <iostream>
#include <string>
#include <array>
#include <vector>
#include <queue>
#include <stack>
#include <list>
#include <set>
#include <map>
#include <algorithm>
#include <cmath>
#include <iomanip>

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

typedef long long ll;
typedef unsigned long long ull;
typedef unsigned int uint;

using namespace std;

#ifdef INPUT
#include <sstream>
stringstream input(R"(
7
0 3 2 1 2 2 5
)");
#define cin input
#endif

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

	map<int, int> d;

	int x;
	cin >> x;

	REP (i, n - 1)
	{
		int x;
		cin >> x;
		++d[x];
	}

	if (x != 0 || d.begin()->first != 1)
	{
		cout << 0 << endl;
		return 0;
	}

	ll r = 1;
	d[0] = 1;
	REP (i, n - 2)
	{
		REP (j, (int)d[i + 1])
		{
			r *= d[i];
			r %= 998244353;
		}
	}

	cout << r << endl;

	return 0;
}


Measured memory_bytes: 4992