akhauriyash/Code-Regression huggingface dataset:
#!usr/bin/env python3
from collections import defaultdict
from collections import deque
from heapq import heappush, heappop
import sys
import math
import bisect
import random
def LI(): return list(map(int, sys.stdin.readline().split()))
def I(): return int(sys.stdin.readline())
def LS():return list(map(list, sys.stdin.readline().split()))
def S(): return list(sys.stdin.readline())[:-1]
def IR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = I()
    return l
def LIR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = LI()
    return l
def SR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = S()
    return l
def LSR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = LS()
    return l
sys.setrecursionlimit(1000000)
mod = 1000000007

#A
def A():
    s = S()
    for i in range(len(s)-1):
        if s[i] == s[i+1]:
            print("Bad")
            quit()
    print("Good")
    return

#B
def B():
    n,l = LI()
    a = [i+l for i in range(n)]
    ans = sum(a)
    m = n+l-1
    for i in a[::-1]:
        if i < 0:break
        m = min(m,i)
    ans -= m
    print(ans)
    return

#C
def gcd(a,b):
    if a == 0:
        return b
    return gcd(b%a,a)
def C():
    a,b,c,d = LI()
    g = gcd(c,d)
    l = c*d//g
    sc = b//c-(a-1)//c
    sd = b//d-(a-1)//d
    sl = b//l-(a-1)//l
    print(b-a+1-sc-sd+sl)
    return

#D
def D():
    n = I()
    w = LIR(n)
    w.sort(key = lambda x: x[1])
    t = 0
    for a,b in w:
        if t+a > b:
            print("No")
            quit()
        t += a
    print("Yes")
    return

#E
def E():
    n = I()

    return

#F
def F():
    n = I()

    return

#Solve
if __name__ == "__main__":
    D()


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

#define REP(i, x, n) for (int i = x; i < (int)(n); i++)
#define rep(i, n) REP(i, 0, n)
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define sz(x) (int)(x.size())
#define popcount(x) __builtin_popcount(x)
#define popcountll(x) __builtin_popcountll(x)
#define uniq(x) x.erase(unique(x.begin(), x.end()), x.end())
#define F first
#define S second
#define mp make_pair
#define eb emplace_back
#define pii pair<int, int>
#define pll pair<ll, ll>

using namespace std;

typedef long long ll;

/* --- INFやMODの値が適切か確認する --- */
// const int INF = 1 << 30;
// const ll INF = 1LL << 60;
// const ll MOD = 1000000007;

int main() {
  int n;
  string s;
  cin >> n;
  cin >> s;
  int ans = 0;

  for (int i = 0; i <= n; i++) {
    vector<int> c1(26, 0), c2(26, 0);
    for (int j = 0; j < i; j++) c1[(int)(s[j] - 'a')]++;
    for (int j = i; j < n; j++) c2[(int)(s[j] - 'a')]++;
    int tmp = 0;
    for (int j = 0; j < 26; j++)
      if (c1[j] > 0 && c2[j] > 0) tmp++;
    ans = max(ans, tmp);
  }

  cout << ans << endl;
}


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

int main(){
	int a1,a2,a3,b1,b2,b3,c[4][4],i,j;
	
	for(i=1;i<=3;i++)
	  for(j=1;j<=3;j++){
	  	cin>>c[i][j];
	  }
	
	b1=c[1][1];
	b2=c[1][2];
	b3=c[1][3];
	
	a2=c[2][1]-b1;
	if(a2!=c[2][2]-b2||a2!=c[2][3]-b3){
		cout<<"No"<<endl;
		return 0;
	}
	a3=c[3][1]-b1;
	if(a3!=c[3][2]-b2||a3!=c[3][3]-b3){
		cout<<"No"<<endl;
		return 0;
	}
	cout<<"Yes"<<endl;
	return 0;
}

Measured memory_bytes: 256
a,b = map(int,input().split())
p = input()


c = 0

for i in range(a):
	if p[i] != '-':
		c += 1
        
if p[a] == '-':
	c += 1
    
for i in range(b):
	if p[a+1] != '-':
		c += 1
        
if c == a + b + 1:
	print('Yes')
    
else:
	print('No')  


Measured memory_bytes: 3060
/**
 * code generated by JHelper
 * More info: https://github.com/AlexeyDmitriev/JHelper
 * @author NikuKyabe
 */

#include <iostream>
#include <fstream>

#include "bits/stdc++.h"

using namespace std;


class ADoubleHelix {
public:
    void solve(std::istream &in, std::ostream &out) {
      char b;
      in >> b;
      switch (b) {
        case 'A':
          out << 'T' << endl;
          break;
        case 'C':
          out << 'G' << endl;
          break;
        case 'G':
          out << 'C' << endl;
          break;
        case 'T':
          out << 'A' << endl;
          break;
      }
    }
};


signed main() {
  ios::sync_with_stdio(false);
  cout.tie(0);
  cout << fixed;
  ADoubleHelix solver;
  std::istream &in(std::cin);
  std::ostream &out(std::cout);
  solver.solve(in, out);
  return 0;
}


Measured memory_bytes: 256
#ifdef DEBUG

#else

#    pragma GCC optimize("O3,no-stack-protector")
#    pragma GCC optimize("unroll-loops")

#    if __cplusplus >= 201703L
#        pragma GCC target("avx2")
#    else
#        pragma GCC target("avx")
#    endif

#endif
// 実数の場合
// #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")

#define _USE_MATH_DEFINES
#include <bits/stdc++.h>
#define dump(x) cout << x << endl
typedef int64_t Int;

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

const double pi = M_PI;
const Int MOD = 1000000007;

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

    Int n, x;
    cin >> n >> x;
    vector<Int> m(n);
    for (Int i = 0; i < n; i++) {
        cin >> m[i];
    }

    Int ans = n;
    x = x - accumulate(m.begin(), m.end(), 0);
    sort(m.begin(), m.end());
    ans += x / m[0];

    cout << ans << endl;

    return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <string>
#include <utility>
#include <queue>
#include <algorithm>
#include <map>
#include <set>
#include <cmath>
//#include "h.h"
using namespace std;

#define ll long long
#define pint pair<int,int>
#define pll pair<ll,ll>
#define pb push_back
#define mp make_pair
#define SPACE " "
#define fpf first.first
#define fps first.second
#define spf second.first
#define sps second.second

#define all(VECTOR) (VECTOR).begin(),(VECTOR).end()

bool check(ll& a, ll& b, ll& c, ll cnt){
	if(a%2 == 1 || b%2 == 1 || c%2 == 1){
		cout << cnt << endl;
		return false;
	}
	if(a == b && b == c){
		cout << "-1" << endl;
		return false;
	}
	return true;
}
void updateABC(ll& a, ll& b, ll&c){
	ll A = a, B = b, C = c;
	a = (B + C) / 2;
	b = (C + A) / 2;
	c = (A + B) / 2;
}
int main(){

	ll a, b, c;
	cin >> a >> b >> c;
	ll cnt = 0;
	while(check(a, b, c, cnt)){
		updateABC(a, b, c);
		cnt ++;
	}

	return 0;
}

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

int main(){
	static int n,m;
	static set<int> S[200010];
	scanf("%d%d",&n,&m);
	for(int i = 1 ; i <= m ; i ++){
		int a,b;
		scanf("%d%d",&a,&b);
		S[a].insert(b);
		S[b].insert(a);
	}
	bool ret = false;
	for(int x: S[1]){
		ret |= S[x].find(n) != S[x].end();
	}
	if(ret)puts("POSSIBLE");
	else puts("IMPOSSIBLE");
}



Measured memory_bytes: 28416
#include <bits/stdc++.h>
using namespace std;
int main() {
    long long N;
    int P;
    cin >> N >> P;
    string s; cin >> s;
    vector<long long> x(P, 0);
    long long d = 1;
    long long k = 0;
    x[k]++;
    long long ans = 0;
    if(P == 2 || P == 5) {
        for (int i = 0; i < N; i++)
        {
            if((s[N-1-i] - '0') % P == 0) ans += N-i;
        }
        cout << ans << endl;
    }
    else {
        for (int i = 0; i < N; i++) {
            k = (k + (s[N-1-i] - '0') * d) % P;
            d = (d * 10) % P;
            x[k]++;
        }
        for (int i = 0; i < P; i++)
        {
            ans += x[i] * (x[i]-1) / 2;
        }
        cout << ans << endl;
    }
}

Measured memory_bytes: 640
#include<iostream>
#include <algorithm>
using namespace std;
 
int main() {
        int n;
        cin >> n;
        double numArr[n];
        int index = 0;
        while (n != index) {
          int input;
      cin >> input;
      numArr[index] = input;
      index += 1;
    }
 
        sort(numArr, numArr + n);
 
        for (int i = 0; i < n-1; ++i) {
        double first = numArr[i] + numArr[i+1];
        numArr[i+1] = first / 2;
    }
        cout << numArr[n-1];
 
        return 0;
}

Measured memory_bytes: 256
import java.util.Scanner;
public class Main {
	public static void main(String[] args){
		Scanner scan = new Scanner(System.in);
		int a = scan.nextInt();
		int b = scan.nextInt();
		if(a>b){
			System.out.println("a > b");
		}else if(a<b){
			System.out.println("a < b");
		}else{
			System.out.println("a == b");
		}
	}
}

Measured memory_bytes: 17160
#include <iostream>
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <vector>
#include <string>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <algorithm>

using namespace std;

#define rep(i,j) REP((i), 0, (j))
#define REP(i,j,k) for(int i=(j);(i)<(k);++i)
#define between(a,x,b) ((a)<=(x)&&(x)<=(b))
#define F first
#define S second
#define INF 1 << 30

typedef pair<int, int> pii;
int main(){
  int N, Q;
  while(scanf("%d%d", &N, &Q) && N+Q){

    vector<string>era(N);
    vector<pii>year(N);
    int a, b;
    string s;
    rep(i, N){
      cin >> s;
      era[i] = s;
      scanf("%d%d", &a, &b);


      year[i] = make_pair(b-a+1, b);
    }

    rep(i, Q){
      scanf("%d", &a);
      rep(i, year.size()){
	if(i+1 == year.size() && (year[i].F > a || year[i].S < a)) puts("Unknown");
	if(year[i].F > a || year[i].S < a) continue;
	cout << era[i];
	printf(" %d\n", a-year[i].F+1);
	break;
      }
    }
  }
  return 0;
}

Measured memory_bytes: 1316
#include<iostream>
#include<cstdio>
#include<cstdlib>
#include<cmath>
#include<cstring>
#include<algorithm>
#include<queue>
#define LL long long
#define inl inline
#define re register
#define MAXN 101000
using namespace std;
int n;
LL W,w[101];
LL dp[MAXN];
int v[MAXN],V;
int main()
{
	scanf("%d%lld",&n,&W);
	memset(dp,0x3f,sizeof(dp));
	for(int i=1;i<=n;i++)scanf("%lld",&w[i]),scanf("%d",&v[i]),V+=v[i];
	dp[0]=0;
	for(int j=1;j<=n;j++)
		for(int i=V;i>=v[i];i--)
		{
			dp[i]=min(dp[i-v[j]]+w[j],dp[i]);
		}
	for(int i=V;i>=0;i--)if(dp[i]<=W&&dp[i])
	{
		printf("%d",i);
		return 0;
	}
	return 0;
}



Measured memory_bytes: 1024
#include<iostream>
#include<vector>
#include<cstdio>
#include<string>
#include<algorithm>

#define ll long long

using namespace std;
long long n;


int main(){
    cin>>n;
    ll a=0,  b=0; cin>>a>>b;
    for(int i=1; i<n; i++){
	ll t1, a1; cin>>t1>>a1;
	ll mult = max((a-1)/t1+1, (b-1)/a1+1);
	a = t1*mult; b = a1*mult;
    }
    cout<<a+b;
}

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

using namespace std;

int main() {
    int N; cin>>N;
    string S; cin>>S;

    int ans=0;
    char prev=' ';
    for (int i=0;i<N;i++) {
        if (prev != S[i]) {
            ans++;
            prev = S[i];
        }
    }

    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 512
n = int(input())
a = list(map(int, input().split()))
b = [a[0]]
for i in range(n - 1):
    b.append(b[-1] + a[i + 1])
f = [True, False]
ans = float("inf")
for i in f:
    flag = i
    count = 0
    num = 0
    for j in range(n):
        if flag == True:
            if b[j] + num <= 0:
                count += 1 - b[j] - num
                num += 1 - b[j] - num
            flag = False
        else:
            if b[j] + num >= 0:
                count += b[j] + num + 1
                num -= b[j] + num + 1
            flag = True
    ans = min(ans, count)
print(ans)

Measured memory_bytes: 20336
#include <bits/stdc++.h>
using namespace std;
#define REP(i, n) for (int i = 0; i < (n); ++i)
#define Cout(s) cout << s << endl;
using ll = long long;
using P = pair<int, int>;

const ll INF = 1ll << 60;
ll MOD = 1e9 + 7;

int main()
{

    int d;
    cin >> d;

    if (d == 25)
    {
        cout << "Christmas" << endl;
    }
    else if (d == 24)
    {
        cout << "Christmas Eve" << endl;
    }
    else if (d == 23)
    {
        cout << "Christmas Eve Eve" << endl;
    }
    else
    {
        cout << "Christmas Eve Eve Eve" << endl;
    }

    return 0;
}

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

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

constexpr ll INF = -1e15;

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

int main()
{

    int n, m;

    std::cin >> n >> m;

    std::vector<std::vector<P>> g(n + 1);
    std::vector<std::vector<int>> rg(n + 1);

    rep(i, m)
    {
        int a, b, c;
        std::cin >> a >> b >> c;
        g[a].emplace_back(b, c);
        rg[b].emplace_back(a);
    }

    std::vector<ll> d(n + 1, INF);

    std::stack<int> stk;
    stk.push(n);

    std::set<int> set;

    set.emplace(n);

    while (!stk.empty())
    {
        int x = stk.top();

        stk.pop();

        for (auto y : rg[x])
        {
            if (!set.count(y))
            {
                stk.push(y);
                set.emplace(y);
            }
        }
    }

    d[1] = 0;

    rep(i, n)
    {
        bool f = 0;
        int pos = n;
        rep(j, n)
        {
            for (auto p : g[j + 1])
            {
                if (d[j + 1] != INF && p.second + d[j + 1] > d[p.first])
                {
                    if (d[p.first] != INF)
                    {
                        pos = p.first;
                    }
                    d[p.first] = d[j + 1] + p.second;
                    f = 1;
                }
            }
        }
        if (i == n - 1 && f && set.count(pos))
        {
            std::cout << "inf" << std::endl;
            return 0;
        }
    }

    std::cout << d[n] << std::endl;

    return 0;
}

Measured memory_bytes: 3800
#include<bits/stdc++.h>
#define reg(i,a,b) for(int i=a;i<=b;i++)
#define reh(i,a,b) for(int i=a;i>b;i--)
#define in(x) scanf("%d",&x)
#define fro freopen("D:\\testdata.in", "r", stdin)
#define il inline
#define lson(q) q<<1
#define rson(q) q<<1|1
using namespace std;
typedef long long ll;
const int mx=1e5+10;


int main(){
	int a,b,c;
	cin>>a>>b>>c;
	int t=min(abs(a-b),c);
	cout<<c-t<<endl;

	return 0;
}




Measured memory_bytes: 256
N = int(input())
P = [[0,0,0]]
for _ in range(N):
    tmp = list(map(int,input().split()))
    P.append(tmp)

for i in range(1,N+1):
    r = abs(P[i][1]-P[i-1][1])+abs(P[i][2]-P[i-1][2])
    t = P[i][0]-P[i-1][0]
    if r % 2 != t % 2 or r > t:
        print('No')
        exit()

print('Yes')


Measured memory_bytes: 27300
#include<bits/stdc++.h>
using namespace std;
#define int long long

struct edge{ int to,cost; };
const int N = 2e5+10;
vector< edge > G[N];

int prim(){
  typedef pair<int, int> P;
  const int INF = 1 << 30;

  priority_queue<P,vector<P>,greater<P>> que;
  vector<bool> visited(N,false);

  que.push({0,0}); //{距離,頂点}
  int total = 0;

  while( !que.empty() ){
    P p = que.top(); que.pop();
    int v = p.second;
    if(visited[v]) continue;
    visited[v] = true;
    total += p.first;
    for(auto e : G[v]){
      if(!visited[e.to]){
        que.push({e.cost,e.to});
      }
    }
  }
  return total;
}

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

  int n; cin >> n;
  vector< pair<pair<int,int>,int> > X,Y;
  for(int i = 0; i < n; i++){
    int x,y; cin >> x >> y;
    X.push_back({{x,y},i});
    Y.push_back({{y,x},i});
  }
  sort(X.begin(),X.end());
  sort(Y.begin(),Y.end());

  for(int i = 0; i < n-1; i++){
    int from = X[i].second;
    int a = X[i].first.first;
    int to = X[i+1].second;
    int c = X[i+1].first.first;
    G[from].push_back({to,abs(a-c)});
    G[to].push_back({from,abs(a-c)});
  }

  for(int i = 0; i < n-1; i++){
    int from = Y[i].second;
    int b = Y[i].first.first;
    int to = Y[i+1].second;
    int d = Y[i+1].first.first;
    G[from].push_back({to,abs(b-d)});
    G[to].push_back({from,abs(b-d)});
  }

  cout << prim() << endl;

  return 0;
}


Measured memory_bytes: 22820
#include<iostream>
#include<cmath>
#include<iomanip>
using namespace std;
#define PI acos(-1)
double a,b,h,m;
double alpha,bet,theta,length;
signed main(){
	cin>>a>>b>>h>>m;
	alpha=(60*h+m)/720*(2*PI);
	bet=m/60*(2*PI);
	theta=alpha-bet;
	length=sqrt(a*a+b*b-2.0*a*b*cos(theta));
	cout<<setprecision(10)<<length;
}

Measured memory_bytes: 4216
#include <bits/stdc++.h>
using namespace std;
int n,k;
long long nCr[2020][2020];
const long long mod = 1000000007;
long long f(int n,int r) {
    if (nCr[n][r]!=-1) return nCr[n][r];
    if (n==0&&n==1) return nCr[n][r] = 1;
    if (r==0 ||r==n) return nCr[n][r] = 1;
    else return nCr[n][r] = (f(n-1,r-1)+f(n-1,r))%mod;
}
int main() {
    memset(nCr,-1,sizeof nCr);
    scanf("%d %d",&n,&k);
    for (int i=1; i<=k; i++) {
        if (n-k-i+1<0) printf("0\n");
        else {
            printf("%d\n",(f(k-1,i-1)*f(n-k+1,i))%mod);
        }
    }
}


Measured memory_bytes: 32256
#include<bits/stdc++.h>
using namespace std;
vector<int>x;
vector<int>y;
vector<int>vec;

int main(){
  int n;
  long long p=0,q=0;
  cin>>n;
  for(int i=0;i<n;i++){
    int a;
    cin>>a;
    vec.push_back(a);
  }
  sort(vec.begin(),vec.end());
  int a=1,b=n-1;
  x.push_back(vec[0]);
  for(int i=0;i<n;i++){
    if(i%2==1){
      x.push_back(vec[a]);
      a++;
      if(a>b)break;
      x.push_back(vec[a]);
      a++;
    }
    else{
      x.push_back(vec[b]);
      b--;
      if(a>b)break;
      x.push_back(vec[b]);
      b--;
    }
    if(a>b)break;
  }
  a=0,b=n-2;
  y.push_back(vec[n-1]);
  for(int i=0;i<n;i++){
    if(i%2==0){
      y.push_back(vec[a]);
      a++;
      if(a>b)break;
      y.push_back(vec[a]);
      a++;
    }
    else{
      y.push_back(vec[b]);
      b--;
      if(a>b)break;
      y.push_back(vec[b]);
      b--;
    }
    if(a>b)break;
  }
  for(int i=1;i<n;i++){
    if(i==1)p+=abs(x[0]-x[1]);
    else{
      p+=abs(x[i-2]-x[i]);
    }
  }
  for(int i=1;i<n;i++){
    if(i==1)q+=abs(y[0]-y[1]);
    else{
      q+=abs(y[i-2]-y[i]);
    }
  }
  /*for(int i=0;i<n;i++){
    cout<<y[i]<<' ';
    }*/
  cout<<max(p,q)<<endl;
  return(0);
}


Measured memory_bytes: 1784
//Himanshu Shukla
#pragma GCC optimize("O2")
#include <bits/stdc++.h>
using namespace std;
#define FASTIO ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0)
//#define file_input
//#define multitest
//#define measure_time
#define ll long long
#define v32 vector<int>
#define v64 vector<ll>
#define s32 set<int>
#define s64 set<ll>
#define graph vector<v32>
#define p32 pair<int, int>
#define p64 pair<ll, ll>
#define sz(v) (ll)(v).size()
#define fi first
#define se second
#define ln '\n'
#define debug(x) cerr << (#x) << ": " << (x) << ln
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
inline ll add(ll a, ll b, ll m) { return (((a % m + b % m) % m + m) % m); }
inline ll mul(ll a, ll b, ll m) { return (((a % m * b % m) % m + m) % m); }
const double EPS = 1e-6;
const ll MOD = 1e9 + 7;
template <typename T, typename U>
ostream &operator<<(ostream &out, const pair<T, U> &p)
{
	out << '[' << p.fi << ", " << p.se << ']';
	return out;
}
template <template <typename, typename...> class ContainerType, typename ValueType, typename... Args>
void print_container(const ContainerType<ValueType, Args...> &c)
{
	cout << "{ ";
	for (const auto &v : c)
		cout << v << ' ';
	cout << '}' << ln;
}

void solve()
{
	ll n, k;
	cin >> n >> k;
	n %= k;
	if (n == 0)
		cout << 0 << ln;
	else
		cout << min(n, k - n) << ln;
	return;
}

int main()
{
	FASTIO;
#ifdef file_input
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif
	clock_t start, stop;
	int t = 1;
#ifdef multitest
	cin >> t;
#endif
#ifdef measure_time
	start = clock();
#endif
	for (int tc = 1; tc < t + 1; tc++)
		solve();
#ifdef measure_time
	stop = clock();
	cerr << "Time :" << fixed << setprecision(5) << double(stop - start) / double(CLOCKS_PER_SEC) << "s" << ln;
#endif
	return 0;
}


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

long long k, a, b, ans;

int main() {
        cin >> k >> a >> b;
                if(b-a > 2 && k > a-1) {
                        long long m = k-a+1;
                        ans = a + (b-a)*(m/2) + m%2;
                }
                else ans = k+1;
                cout << ans << endl;
                return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <cstdio>
#include <algorithm>
#include <vector>
#include <cmath>
#include <array>
#include <queue>
#include <map>
#include <set>
#include <stack>
#include <cstdint>
#include <unordered_set>
#include <ctime>
#include <numeric>
#include <cstdint>

using llint = long long int;
using u64 = std::uint_fast64_t;

void solve(void){

  int n;
  std::cin >> n;


  std::vector<int > f(n+1, -1);

  llint ret = 1;
  f[1] = 1;

  std::vector<int> sosuu(n, 10000000);
  int sosuu_cnt = 0;
  for(int k=2; k<=n; k++){
    for(auto j: sosuu){
      if(j*j>k) break;
      if(k%j == 0){
        f[k] = f[k/j]*2;
        if( (k/j) % j == 0) f[k] -= f[k/j/j];
        ret += ( (llint)k )*f[k];
        break;
      }
    }
    if(f[k] == -1){
      f[k] = 2;
      ret += ( (llint)k ) *2;
      sosuu[sosuu_cnt++] = k;
    }
  }

  //for(int i=1; i<=n; i++){
  //  std::cout << f[i].size() << std::endl;
  //}

  std::cout << ret << std::endl;
}
int main(void){
  solve();
  return 0;
}





Measured memory_bytes: 81356
#include <iostream>
#include <cstdio>
#include <cstring>
using namespace std;
int n,m;
int main()
{
	scanf("%d%d",&n,&m);
	if(n>=m)
		for(register int i=1;i<=n;i++) printf("%d",m);
	else
		for(register int i=1;i<=m;i++) printf("%d",n);
	printf("\n");
	return 0;
}

Measured memory_bytes: 256
#include<cstdio>
#define MOD 1000000007

int h, w, a, b;
int f[200005];

int pow(int x, int y) {
  if (y == 0) {
    return 1;
  }
  if (y % 2 == 1) {
    return 1ll * x * pow(x, y - 1) % MOD;
  } else {
    return pow(1ll * x * x % MOD, y / 2);
  }
}

int inv(int x) {
  return pow(x, MOD - 2);
}

int nCr(int n, int r) {
  return 1ll * f[n] * inv(f[n - r]) % MOD * inv(f[r]) % MOD;
}

int main() {
  scanf("%d %d %d %d", &h, &w, &a, &b);
  f[0] = 1;
  for (int i = 1; i <= h + w; i++) {
    f[i] = 1ll * f[i - 1] * i % MOD;
  }
  int ans = 0;
  for (int i = 1; i + a <= h; i++) {
    ans = (ans + 1ll * nCr(i + b - 2, i - 1) * nCr(h - i + w - b - 1, h - i)) % MOD;
  }
  printf("%d\n", ans);
}


Measured memory_bytes: 896
/*!enjoy karo yaar!*/

//CF,CC,AtC,SPOJ: hp1999
//HE: hemant269
//HR: hemant2132

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

#define     int             long long int
#define     fast()          ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define     all(x)          (x).begin(),(x).end()
#define     rz(x)           resize(x)
#define     mem(a,b)        memset(a,b,sizeof(a))
#define     sz(x)           ((int)(x.size()))
#define     pb              push_back
#define     pf              push_front
#define     pob             pop_back
#define     pof             pop_front
#define     ins             insert
#define     vi              vector<int>
#define     pii             pair<int,int>
#define     mii             map<int,int>
#define     F               first
#define     S               second
#define     makep           make_pair
#define     maket           make_tuple
#define     remax(a,b)      a=max(a,b)
#define     remin(a,b)      a=min(a,b)
#define     bitcount(x)     __builtin_popcountll(x)
#define     iceil(n,x)      (((n)+(x)-1)/(x))
#define     gcd(a,b)        (__gcd((a),(b)))
#define     lcm(a,b)        (((a)*(b))/gcd((a),(b)))
#define     dbug(x)         cout<<#x<<": "<<(x)<<"\n"
#define     flush           fflush(stdout)
#define     show(x)         for(auto zz:x)cout<<zz<<" ";cout<<"\n";
#define     show2(x)        for(auto zz:x)cout<<zz.F<<" "<<zz.S<<"\n";

typedef unsigned long long ull;
typedef long long ll;
typedef long double ld;

const ld pi=acos(-1);
const ll inf=1e18,M=1e9+7;
const int N=1;

void solve()
{
    int n,k;
    cin>>n>>k;

    int mn,mx,ans=0;
    for(int i=k;i<=n+1;++i)
    {
        mn=(i*(i-1))/2;
        mx=((n+1)*n)/2-(n-i)*(n-i+1)/2;
        ans=(ans+(mx%M-mn%M+M)%M)%M;
        ans=(ans+1ll)%M;

        //cout<<ans<<"\n";
    }

    cout<<ans;
}

int32_t main()
{
    fast();

    int t=1;
    //cin>>t;
    for(int z=1;z<=t;++z)
    {
        //cout<<"Case #"<<z<<": ";
        solve();
        //cout<<"\n";
    }

    return 0;
}



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

int main()
{
  long long int x, y, z;
  cin >> x >> y >> z;

  int ans = x / (y + z);

  if(x % (y + z) >= z) cout << ans << endl;
  else cout << ans - 1 << endl;

  return 0;
  
}


Measured memory_bytes: 256
#include<iostream>
#include<string>
#include<algorithm>
#include<map>
#include<set>
#include<utility>
#include<vector>
#include<cmath>
#include<cstring>
#include<cstdio>
#include<time.h>
#define loop(i,a,b) for(int i=a;i<b;i++) 
#define rep(i,a) loop(i,0,a)
#define pb push_back
#define mp make_pair
#define all(in) in.begin(),in.end()
const double PI=acos(-1);
const double EPS=1e-10;
using namespace std;
typedef long long ll;
typedef vector<int> vi;
int main(){
	int t;
	while(cin>>t,t){
		int n;
		cin>>n;
		int sum=0;
		rep(i,n){
			int a,b;
			cin>>a>>b;
			sum+=b-a;
		}
		if(sum>=t)cout<<"OK"<<endl;
		else cout<<t-sum<<endl;
	}
}

Measured memory_bytes: 1164
#include <bits/stdc++.h>
using namespace std;
 
#define ff first
#define ss second
#define mp(a,b) make_pair(a,b)
#define pb(a) push_back(a)
#define boost ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define check(x) cout << #x << " : " << (x) << endl
#define all(v) v.begin(),v.end() 
#define endl '\n'  
typedef long long ll; 
typedef unsigned long long ull; 
typedef long double ld;
typedef pair< ll , ll > mypair;
typedef priority_queue <ll> max_heap;
typedef priority_queue <mypair, vector<mypair>, greater<mypair> > min_heap;
const ll mod=1e9+7;
const ll inf=1e16;
const ll N=1e5+10;

int main()
{
	boost;
	ll a,b;
	cin>>a>>b;
	int temp=1;
	int ans=0;
	while(temp<b)
	{
		temp-=1;
		temp+=a;
		ans++;
	}
	cout<<ans;
	return 0;
}

Measured memory_bytes: 256
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#define N 2000000000
int main()
{
    int l,i,j,r,min=2018,a;
    scanf("%d %d",&l,&r);
    if(r<l+2019)
    {
        for(i=l;i<r;i++)
        {
            for(j=i+1;j<=r;j++)
            {
                a=(int)(((long)i*(long)j)%2019);
                if(a<min)min=a;
                if(min==0)goto end;
            }
        }
    }
    else
    {
        for(i=l;i<l+2019;i++)
        {
            for(j=i+1;j<=i+2020;j++)
            {
                a=(int)(((long)i*(long)j)%2019);
                if(a<min)min=a;
                if(min==0)goto end;
            }
        }
    }
    end:
    printf("%d",min);
    return 0;
}

Measured memory_bytes: 128
#include <stdio.h>
int main(){
	int n,i;
	int a[100];
	scanf("%d",&n);
	for(i=0;i<n;i++){
		scanf("%d",&a[n-i]);
	}
	for(i=1;i<=n;i++){
		if(i==n){
			printf("%d\n",a[i]);
		}else{
			printf("%d ",a[i]);
		}

	}
}

Measured memory_bytes: 1816
//#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
#define rep(i, n) for(int i=0; i<n; ++i)
#define all(v) v.begin(), v.end()
#define rall(v) v.rbegin(), v.rend()
using namespace std;
using ll = int64_t;
using P = pair<ll, int>;
using vs = vector<string>;
using vi = vector<int>;
using vvi = vector<vi>;
const int INF = 100010001;
const ll LINF = (ll)INF*INF*10;

int main() {
    int n;
    ll z, w;
    cin >> n >> z >> w;
    vector<ll> a(n);
    rep(i, n) {
        cin >> a[i];
    }

    vector<P> b(n), s(n);
    if(n != 1) {
        b[n-2].first = abs(a[n-1]-a[n-2]);
        b[n-2].second = n-2;
        s[n-2] = b[n-2];
    }
    for(int i = n-3; i>=0; --i) {
        if(abs(a[i]-a[n-1]) > b[i+1].first) {
            b[i] = P(abs(a[i]-a[n-1]), i);
        } else {
            b[i] = b[i+1];
        }
        if(abs(a[i]-a[n-1]) < s[i+1].first) {
            s[i] = P(abs(a[i]-a[n-1]), i);
        } else {
            s[i] = s[i+1];
        }
    }
    b[n-1].first = -1;
    s[n-1].first = LINF;

    int i = 0;
    int f = 0;
    ll ans = abs(w-a[n-1]);
    while(f != n) {
        if(!(i&1)) {
            if(abs(w-a[n-1]) < b[f].first) {
                z = a[b[f].second];
                f = b[f].second+1;
            } else {
                f = n;
                z = a[n-1];
            }
        } else {
            if(abs(z-a[n-1]) > s[f].first) {
                w = a[s[f].second];
                f = s[f].second+1;
            } else {
                f = n;
                w = a[n-1];
            }
        }
        ++i;
    }

    ans = max(ans, abs(z-w));
    cout << ans << endl;
}

Measured memory_bytes: 384
#include <iostream>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <string>
#include <map>
#include <algorithm>
#include <iomanip> //cout << fixed << setprecision(12) << ans << endl;
using namespace std;
 
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define rrep(i, n) for(int i = (int)(n-1); i >= 0; i--)
#define loop(i, l, r) for(int i = l; i < r; i++)
#define rloop(i, l, r) for(int i = l; i >= 0; i--)
#define all(x) (x).begin(),(x).end()
typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vec_i;
typedef pair<int,int> pair_ii;
typedef pair<ull,ull> pair_ull;
 
const int dx[4] = {0, 0, 1, -1};
const int dy[4] = {1, -1, 0, 0};
const int INF = 1e9;
const int MOD = 1e9+7;
 
int main()
{
	cin.tie(0);
	ios::sync_with_stdio(false);

	int n;
	cin >> n;
	vector<vec_i > a(n, vec_i(n-1));

	rep(i,n){
		rep(j, n-1){
			int x;
			cin >> x;
			a[i][j] = x-1;
		}
	}

	bool update = true;
	vec_i days(n,0);
	vec_i idx(n,0);
	while(update){
		update = false;
		rep(i,n){
			if(idx[i] == n-1)
				continue;
			int j = a[i][idx[i]];
			if(idx[j] == n-1)
				continue;
			if(i == a[j][idx[j]]){
				int day = max(days[i], days[j]);
				days[i] = day+1;
				days[j] = day+1;
				idx[i]++;
				idx[j]++;
				update = true;
				//cout << "pop:" << i << " " << j << endl;
			}
		}
	}

	int ans = 0;
	bool empty_flag = true;
	rep(i,n){
		if (idx[i] != n-1){
			empty_flag = false;
		}
		else{
			ans = max(ans, days[i]);
		}
	}
	if(empty_flag == true){
		cout << ans << endl;
	}else{
		cout << -1 << endl;
	}

}

Measured memory_bytes: 4224
c11, c12, c13 = gets.chomp.split.map(&:to_i)
c21, c22, c23 = gets.chomp.split.map(&:to_i)
c31, c32, c33 = gets.chomp.split.map(&:to_i)

0.upto(c11) do |a1|
  a2 = a1 - (c11 - c21)
  a3 = a1 - (c11 - c31)
  b1 = c11 - a1
  b2 = c12 - a1
  b3 = c13 - a1
  if [a2, a3, b1, b2, b3].all?{|e| e >= 0 && e <= 100}
    if a2 + b1 == c21 && a2 + b2 == c22 && a2 + b3 == c23 && a3 + b1 == c31 && a3 + b2 == c32 && a3 + b3 == c33
      puts 'Yes'
      exit
    end
  end
end
puts 'No'


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


int main(){
	int N;
	vector<int> h;
	cin >> N;
	rep(i,N){
		int t; cin >> t; h.push_back(t);
	}

	int pos = 0;
	vector<int> cost(N);
	cost[1] = abs(h[1]-h[0]);
	while(pos < N-2){
		cost[pos+2] = min(abs(h[pos+2]-h[pos+1])+cost[pos+1], abs(h[pos+2]-h[pos])+cost[pos]);
		pos++;
	}

	cout << cost[N-1] << endl;
	return 0;
}


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

template<long long mod>
class modint{
private:
  long long a;
public:
  constexpr modint(const long long x = 0) noexcept : a(x%mod) {}
  constexpr long long& value() noexcept { return a; }
  constexpr const long long& value() const noexcept { return a; }
  constexpr modint operator+(const modint rhs) const noexcept {
    return modint(*this) += rhs;
  }
  constexpr modint operator-(const modint rhs) const noexcept {
    return modint(*this) -= rhs;
  }
  constexpr modint operator*(const modint rhs) const noexcept {
    return modint(*this) *= rhs;
  }
  constexpr modint operator/(const modint rhs) const noexcept {
    return modint(*this) /= rhs;
  }
  constexpr modint& operator+=(const modint rhs) noexcept {
    a += rhs.a;
    if(a >= mod) a -= mod;
    return *this;
  }
  constexpr modint &operator-=(const modint rhs) noexcept {
    if(a < rhs.a) a += mod;
    a -= rhs.a;
    return *this;
  }
  constexpr modint& operator*=(const modint rhs) noexcept {
    a = a*rhs.a%mod;
    return *this;
  }
  constexpr modint& operator/=(modint rhs) noexcept {
    long long k = mod-2;
    while(k > 0){
      if(k&1){
        *this *= rhs;
      }
      rhs *= rhs;
      k /= 2;
    }
    return *this;
  }
  friend ostream& operator<<(ostream &os, const modint &X){
    return os << X.a;
  }
  friend istream& operator>>(istream &is, modint &X){
    is >> X.a;
    X.a %= mod;
    if(X.a < 0) X.a += mod;
    return is;
  }
};

int main(){
  using mint = modint<(int)1e9+7>;
  int N;
  cin >> N;
  vector<mint> dp(N+1);
  dp[0] = 1;
  dp[1] = 1;
  mint s = 2;
  for(int i = 2; i < N; ++i){
    dp[i] = s - dp[i-2];
    s += dp[i];
  }
  // for(auto e : dp)
  //   cerr << e << " ";
  // cerr << endl;
  mint ans = dp[N-1];
  for(int i = 0; i < N; ++i){
    ans += dp[i]*(N-1);
    if(i+1 < N and N >= 2){
      ans += dp[i]*(N-1)*(N-2);
      ans += dp[i]*(i+2);
    }
  }
  if(N >= 2) ans -= dp[N-2];
  cout << ans << endl;
}


Measured memory_bytes: 8064
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int day = scan.nextInt();
		final String C = "Christmas";
		final String E = " Eve";

		switch (day) {
		case 25:
			System.out.println(C);
			break;
		case 24:
			System.out.println(C + E);
			break;
		case 23:
			System.out.println(C + E + E);
			break;
		case 22:
			System.out.println(C + E + E + E);
			break;
		}

	}

}


Measured memory_bytes: 23124
import math

a, b, h, m = map(int, input().split())
theta_h = 2.5*math.pi - (2 * math.pi * ((h + (m/60))/12))
theta_m = 2.5*math.pi - (2 * math.pi *  (m/60) )

x_h = a * math.cos(theta_h)
y_h = a * math.sin(theta_h)
x_m = b * math.cos(theta_m)
y_m = b * math.sin(theta_m)

print(((x_h - x_m)**2 + (y_h-y_m)**2) ** 0.5)

Measured memory_bytes: 9528
#include <bits/stdc++.h>
  
using namespace std;
 
#define endl "\n"
#define JAM(x) cout<< #x <<" = "<<x<<"\n"
#define II() ( { int a ; read(a) ; a; } )
#define LL() ( { ll a ; read(a) ; a; } )
#define DD() ({double a; scanf("%lf", &a); a;})
 
 
//Fast Reader
template<class T>inline bool read(T &x){
    int c=getchar();int sgn=1;
    while(~c&&c<'0'||c>'9'){if(c=='-')sgn=-1;c=getchar();}
    for(x=0;~c&&'0'<=c&&c<='9';c=getchar())x=x*10+c-'0'; 
    x*=sgn; return ~c;
}
 
typedef long long ll;
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef pair<int,int> PII;
typedef vector<PII> VPI;
 
const int INF=2e9;
const int MX=100005;
const int MOD=1000000007;
const double PI=acos(-1.0);

vector<int> sieve(100001);


long long int power(long long int a,long long int b)
{
    a %= MOD;
    long long int res = 1;
    while (b > 0) {
        if (b & 1)
            res = res * a % MOD;
        a = a * a % MOD;
        b >>= 1;
    }
    return res;
}
bool isprime(int n)
{
    if(n==1)
    return 0;
    int i;
    for(i=2;i*i<=n;i++)
    {
        if(n%i==0)
        return false;
    }
    return true;
}

void SIEVE()
{
    int i,j;
    for(i=0;i<=100000;i++)
    sieve[i]=i;
    for(i=2;i*i<=100000;i++)
    {
        if(sieve[i]!=i)
        continue;
        for(j=i*i;j<=100000;j=j+i)
        {
            if(sieve[j]==j)
            sieve[j]=i;
        }
    }
}


/*_______________________________________________*/


int main()
{
    int n;
    cin>>n;
    long long int a[n],i;
    long long int ans=0,mx=0,ans1=0;
    for(i=0;i<n;i++)
    {
        cin>>a[i];
        mx=max(mx,a[i]);
        ans+=max(0ll,mx-a[i]);
    }
    cout<<ans;
}


Measured memory_bytes: 5180
#include <iostream>
#include <set> 
#include <iterator>
#include <bitset> 
#include <bits/stdc++.h> 
using namespace std;
typedef  long long int ll;
ll mod=1000000007;

    

int main() {
    int n;
    cin>>n;
    int a[n],b[n],c[n];
    for(int i=0;i<n;i++)
        cin>>a[i]>>b[i]>>c[i];
    ll dp[3][n];
    dp[0][0]=a[0];
    dp[1][0]=b[0];
    dp[2][0]=c[0];
    for(int i=1;i<n;i++)
    {   dp[0][i]=a[i]+max(dp[1][i-1],dp[2][i-1]);
        dp[1][i]=b[i]+max(dp[0][i-1],dp[2][i-1]);
        dp[2][i]=c[i]+max(dp[1][i-1],dp[0][i-1]);
    }
    cout<<max(dp[0][n-1],max(dp[1][n-1],dp[2][n-1]));
        
        
        
    
	return 0;
}


Measured memory_bytes: 3840
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define FAST ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
int main(){
    FAST
    int n,k;
    cin>>n>>k;
    vector<int>v(n);
    for(int i=0;i<n;i++)cin>>v[i];
    sort(v.begin(),v.end());
    auto it=lower_bound(v.begin(),v.end(),k);
    if(it==v.end())cout<<0;
    else cout<<n-(it-v.begin());
    
    return 0;
}

Measured memory_bytes: 640
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);

		while (true) {
			String num = sc.next();
			int length = num.length();
			int sum = 0;

			if (num.contentEquals("0")) {
				break;
			} else {
				for (int i = 0; i < length; i++) {
					sum += Character.getNumericValue(num.charAt(i));
				}
				System.out.println(sum);
			}
		}
	}
}



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

int a, b, c, k;

int main() {
  scanf("%d %d %d %d", &a, &b, &c, &k);

  int ans = 0;
  int take = min(a, k);
  ans += take;
  k -= take;

  take = min(b, k);
  k -= take;

  take = min(c, k);
  ans -= take;

  printf("%d\n", ans);
  return 0;
}


Measured memory_bytes: 3760
var
  t,i:longint;
Function max(x,y:longint):longint;
begin
  if x>y then exit(x) else exit(y);
end;
begin
  read(t);
  for i:=t to 999 do
    begin
      if (i mod 10=i div 100)and(i div 100=i div 10 mod 10) then
        begin
          write(i);
          exit;
        end;
    end;
end.

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

# define C continue;
# define R return

# define D double
# define I insert
# define ll long long
# define ld long double

# define ull unsigned long long
# define ui unsigned int

# define pb push_back
# define pf push_front

# define vi vector < int >
# define vc vector < char >
# define vs vector < string >
# define vb vector < bool >
# define vd vector < D >
# define vll vector < ll >
# define vull vector < ull >
# define vld vector < ld >

# define vvi vector < vector < int > >
# define vvb vector < vector < bool > >
# define vvc vector < vector < char > >
# define vvll vector < vector < ll > >
# define vvd vector < vector < D > >
# define vvld vector < vector < ld > >

# define all(v) (v).begin() , (v).end()
# define allrev(v) (v).rbegin() , (v).rend()
# define allcomp(v) v.begin() , v.end() , comp
# define allrevcomp(v) v.rbegin() , v.rend() , comp

# define pii pair < int , int >
# define pll pair < ll , ll >
# define pld pair < ld , ld >
# define pDD pair < D , D >

# define vpld vector < pld >
# define vpii vector < pii >
# define vpll vector < pll >
# define vpDD vector < pDD >

# define vvpii vector < vector < pii > >
# define F first
# define S second
# define mp make_pair

# define dist(a,b,p,q) sqrt((p-a)*(p-a) + (q-b)*(q-b))

# define pp(n) printf("%.10Lf",n);
# define line cout<<"\n";
# define fast ios_base::sync_with_stdio(false) ; cin.tie(0) ; cout.tie(0);

string vow = "aeiou";

const int dxhorse[] = {-2, -2, -1, -1, 1, 1, 2, 2};
const int dyhorse[] = {1, -1, 2, -2, 2, -2, 1, -1};

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

const ld pie = 3.14159265358979 ;
const ll mod = 1e9 + 7 ;

void solve ( int test_case )
{
    int n ; cin >> n ;

    for ( ; ; n++ )
    {
        string s = to_string ( n ) ;

        int i = 0 ;
        int z = s.size() ;

        for ( ; i < z && s[i] == s[0] ; i++ ) ;

        if ( i == z )
        {
            cout << s ;
            line ; return ;
        }
    }
}

int main()
{
    int t = 1;
    // cin >> t;

    for ( int i=0 ; i < t ; i++ ) solve(i);
    return 0;
}


Measured memory_bytes: 256
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <climits>
#include <cfloat>
#include <map>
#include <utility>
#include <set>
#include <iostream>
#include <memory>
#include <string>
#include <vector>
#include <deque>
#include <list>
#include <algorithm>
#include <functional>
#include <sstream>
#include <complex>
#include <stack>
#include <queue>

using namespace std;

//conversion
inline int toInt(string s) {int v; istringstream sin(s);sin>>v;return v;}
template<class T> inline string toString(T x) {ostringstream sout;sout<<x;return sout.str();}

//math
//-------------------------------------------
template<class T> inline T sqr(T x) {return x*x;}

//typedef
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef long long LL;

//container util
//------------------------------------------
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())
#define EACH(i,c) for(auto i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())

//repetition
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)
#define UNTIL(p) while(!(p))

//constant
const double EPS = 1e-5;
const double PI  = acos(-1.0);

//debug
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;

#define PUTS(x) cout << (x) << endl;

int main(void){
    cin.tie(0);
    ios::sync_with_stdio(false);
    int N,M;
    cin>>N>>M;
    VI k;
    for(int i = 1; i*i <= M; i++){
        if(M % i != 0)continue;
        k.PB(i);
        if(i!=1 && i*i!=M)
        {
            k.PB(M/i);
        }
    }
    k.PB(M);
    SORT(k);
    int ans = 1;
    for(int i = k.size() - 1; i >= 0; i--){
        int m = M / k[i];
        if(m >= N){
            ans = k[i];
            break;
        }
    }
    PUTS(ans);
}

Measured memory_bytes: 256
#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<bitset>
#include<set>
#include<map>
#include<stack>
#include<queue>
#include<deque>
#include<list>
#include<iomanip>
#include<cmath>
#include<cstring>
#include<functional>
#include<cstdio>
#include<cstdlib>
using namespace std;

#define repr(i, a, b) for (int i = (int)(a); i < (int)(b); i++)
#define rep(i, n) repr(i, 0, n)
#define INF 2e9
#define MOD 1000000007
//#define MOD 998244353
#define LINF (long long)4e18
#define jck 3.141592

const double EPS = 1e-10;

using ll = long long;
using Pi = pair<int,int>;
using Pl = pair<ll,ll>;

struct Combination{
    vector<long long> _fac,_finv,_inv;
    const int m = MOD;

    Combination(int sz) : _fac(sz),_finv(sz),_inv(sz){
        _fac[0] = _fac[1] = 1;
        _finv[0] = _finv[1] = 1;
        _inv[1] = 1;
        for(int i = 2; i <= sz; i++){
            _fac[i] = _fac[i-1]*i%m;
            _inv[i] = m-_inv[m%i]*(m/i)%m;
            _finv[i] = _finv[i-1]*_inv[i]%m;
        }
    }

    inline long long fac(int n){return _fac[n];}
    inline long long inv(int n){return _inv[n];}
    inline long long finv(int n){return _finv[n];}

    long long comb(int n,int k){
        if(n < k) return 0;
        if(n < 0 || k < 0) return 0;
        return _fac[n]*(_finv[k]*_finv[n-k]%m)%m;
    }
};

ll modinv(ll a, ll m) {
    ll b = m, u = 1, v = 0;
    while (b) {
        ll t = a / b;
        a -= t * b; swap(a, b);
        u -= t * v; swap(u, v);
    }
    u %= m;
    if (u < 0) u += m;
    return u;
}

int N;
vector<vector<int>> G;
ll dp[200010];
int sz[200010];
Combination C(200010);

void dfs1(int u, int p){
    dp[u] = 1;
    sz[u] = 1;
    ll now = 1;
    ll now2 = 1;
    for(int v : G[u]){
        if(v == p) continue;
        dfs1(v,u);
        sz[u] += sz[v];
        now *= C.fac(sz[v]);
        now %= MOD;
        now2 *= dp[v];
        now2 %= MOD;
    }
    dp[u] *= C.fac(sz[u]-1)*modinv(now,MOD)%MOD*now2%MOD;
    dp[u] %= MOD;
}

void dfs2(int u, int p){
    for(int v : G[u]){
        if(v == p) continue;
        ll s = dp[v];
        dp[v] *= C.finv(sz[v]-1);
        dp[v] %= MOD;
        dp[v] *= C.fac(N-1);
        dp[v] %= MOD;
        dp[v] *= C.finv(N-sz[v]);
        dp[v] %= MOD;
        ll k = dp[u];
        k *= C.finv(N-1);
        k %= MOD;
        k *= C.fac(N-1-sz[v]);
        k %= MOD;
        k *= C.fac(sz[v]);
        k %= MOD;
        k *= modinv(s,MOD);
        k %= MOD;
        dp[v] *= k;
        dp[v] %= MOD;
        dfs2(v,u);
    }
}

int main(){
    cin >> N;
    G.resize(N);
    rep(i,N-1){
        int a,b; cin >> a >> b;
        a--; b--;
        G[a].push_back(b);
        G[b].push_back(a);
    }
    dfs1(0,-1);
    dfs2(0,-1);
    rep(i,N) cout << dp[i] << endl;
}


Measured memory_bytes: 20980
package main

import (
	"bufio"
	"fmt"
	"math"
	"os"
	"sort"
	"strconv"
)

//Util
func nextStr() string {
	sc.Scan()
	return sc.Text()
}

func nextInt() int {
	sc.Scan()
	i, e := strconv.Atoi(sc.Text())
	if e != nil {
		panic(e)
	}
	return i
}

func maxInt(a, b int) int {
	if a > b {
		return a
	} else {
		return b
	}
}

func minInt(a, b int) int {
	if a > b {
		return b
	} else {
		return a
	}
}

func absInt(a int) int {
	if a >= 0 {
		return a
	} else {
		return -a
	}
}

func absFloat64(a float64) float64 {
	if a >= 0 {
		return a
	} else {
		return -a
	}
}

func maxFloat64(a, b float64) float64 {
	if a > b {
		return a
	} else {
		return b
	}
}

func minFloat64(a, b float64) float64 {
	if a > b {
		return b
	} else {
		return a
	}
}

func str2Int(s string) int {
	n, _ := strconv.Atoi(s)
	return n
}

func reverse(s string) string {
	runes := []rune(s)
	for i, j := 0, len(runes)-1; i < j; i, j = i+1, j-1 {
		runes[i], runes[j] = runes[j], runes[i]
	}
	return string(runes)
}

func powInt(p, q int) int {
	return int(math.Pow(float64(p), float64(q)))
}

func isPrime(x int) bool {
	if x == 1 {
		return false
	}
	if x == 2 {
		return true
	}
	if x%2 == 0 {
		return false
	}

	b := true
	rootx := int(math.Sqrt(float64(x)))
	i := 3
	for i <= rootx {
		if x%i == 0 {
			b = false
			break
		}
		i += 2
	}
	return b
}

func PrimeFactors(n int) (pfs []int) {
	// Get the number of 2s that divide n
	for n%2 == 0 {
		pfs = append(pfs, 2)
		n = n / 2
	}

	// n must be odd at this point. so we can skip one element
	// (note i = i + 2)
	for i := 3; i*i <= n; i = i + 2 {
		// while i divides n, append i and divide n
		for n%i == 0 {
			pfs = append(pfs, i)
			n = n / i
		}
	}

	// This condition is to handle the case when n is a prime number
	// greater than 2
	if n > 2 {
		pfs = append(pfs, n)
	}

	return
}

func sumInts(x []int) int {

	total := 0
	for _, v := range x {
		total += v
	}

	return total
}

//Main
const (
	initialBufSize = 10000
	maxBufSize     = 1000000
	mod            = 1e9 + 7
)

var (
	sc *bufio.Scanner = func() *bufio.Scanner {
		sc := bufio.NewScanner(os.Stdin)
		buf := make([]byte, initialBufSize)
		sc.Buffer(buf, maxBufSize)
		return sc
	}()
)

func main() {
	sc.Split(bufio.ScanWords)

	a := make([]int, 3)
	a[0], a[1], a[2] = nextInt(), nextInt(), nextInt()
	sort.Ints(a)
	m := a[2]

	if m%2 == 0 {
		fmt.Println(0)
	} else {
		fmt.Println(a[0] * a[1])
	}

}


Measured memory_bytes: 1772
#include  <iostream>
#include  <vector>
#include  <iomanip>

using namespace std;

int main()
{
	int n;
	cin >> n;
	vector <long double> A(n);
	for (int i = 0; i < n; i++)  cin >> A[i];

	long double s = 0;
	for (int i = 0; i < n; i++) {
		s += 1 / A[i];
	}
	cout << fixed << setbase(10) << 1 / s << endl;
}

Measured memory_bytes: 256
H, W = list(map(int, input().split()))


def calc(h,w):
    minv = 2 ** 32
    for i in range(1, h):
        s1 = i * w
        s2 = ((h-i) // 2) * w
        s3 = (h - i - ((h-i) // 2)) * w
        lmin = max(s1, s2, s3) - min(s1, s2, s3)
        minv = min(minv, lmin)

        s2v = (h - i) * (w // 2)
        s3v = (h - i) * (w - w // 2)
        minv = min(minv, max(s1, s2v, s3v) - min(s1, s2v, s3v))
    return minv

m = min(calc(H, W), calc(W, H))
print(m)


Measured memory_bytes: 41200