akhauriyash/Code-Regression huggingface dataset:
/**
 * Problem:	A. 
 * Author:	hkxadpall. 
 * Date:	2018-09-01. 
 * Upload:	AtCoder. 
 */
#include <stdio.h>
#include <iostream>
#include <algorithm>
#include <string.h>
#include <vector>
#include <queue> 
#include <map>
#include <set>
using namespace std;

namespace AuthorName { 
    template <typename _TpInt> inline _TpInt read();
    template <typename _TpRealnumber> inline double readr();
    template <typename _TpInt> inline void write(_TpInt x);
//	template <typename _TpSwap> inline void swap(_TpSwap &x, _TpSwap &y);
	
#	define Max_N 1007
	
	int n, m, a[Max_N];
	
	int main() 
	{
		n = read<int>();
		m = read<int>();
		printf(((n == 2) || (m == 2)) ? "No" : "Yes");
	    return 0;
	}

#	define Getchar() getchar()

    template <typename _TpInt>
    inline _TpInt read()       
    {
        register int flag = 1;
        register char c = Getchar();
        while ((c > '9' || c < '0') && c != '-') 
            c = Getchar();
        if (c == '-') flag = -1, c = Getchar();
        register _TpInt init = (c & 15);
        while ((c = Getchar()) <= '9' && c >= '0') 
            init = (init << 3) + (init << 1) + (c & 15);
        return init * flag;
    }

    template <typename _TpRealnumber>
    inline double readr()       
    {
        register int flag = 1;
        register char c = Getchar();
        while ((c > '9' || c < '0') && c != '-') 
            c = Getchar();
        if (c == '-') flag = -1, c = Getchar();
        register _TpRealnumber init = (c & 15);
        while ((c = Getchar()) <= '9' && c >= '0') 
            init = init * 10 + (c & 15);
        if (c != '.') return init * flag;
        register _TpRealnumber l = 0.1;
        while ((c = Getchar()) <= '9' && c >= '0') 
            init = init + (c & 15) * l, l *= 0.1;
        return init * flag;
    }

    template <typename _TpInt>
    inline void write(_TpInt x)
    {
        if (x < 0) {
            putchar('-');
            write<_TpInt>(~x + 1);
        }
        else {
            if (x > 9) write<_TpInt>(x / 10);   
            putchar(x % 10 + '0');
        }
    }

//	template <typename _TpSwap>
//	inline void swap(_TpSwap &x, _TpSwap &y)
//	{
//	    _TpSwap t = x;
//	    x = y;
//	    y = t;
//	}
}

int main()
{
    AuthorName::main();
    return 0;
}

Measured memory_bytes: 768
#include <stdio.h>
#define M 1000000007

unsigned long power(unsigned long x, unsigned long n) {
  if (n == 0) {
    return 1;
  }

  unsigned long res = power(x*x%M, n/2);
  if (n % 2 != 0) {
    res = res * x % M;
  }

  return res;
}

int main(void) {
  int m, n;
  scanf("%d %d", &m, &n);

  printf("%ld\n", power(m, n));

  return 0;
}

Measured memory_bytes: 596
#include <time.h>

#include <stdlib.h>
#include <cstdint>
#include <cassert>
#include <algorithm>
#include <functional>
#include <iostream>
#include <limits>
#include <cstdint>
#include <cassert>
#include <algorithm>
#include <functional>
#include <iostream>
#include <limits>

using namespace std;

int64_t gcd(int64_t a,int64_t b){
	if(a==0){
		return b;
	}else if(b==0){
		return a;
	}else{
		if(a>=b){
			return gcd(a%b,b);
		}else{
			return gcd(b%a,a);
		}
	}
}
int64_t lcm(int64_t a,int64_t b){
	return (a/gcd(a,b))*b;
}
int main() {
	int n;
	cin>>n;
	if(n==1){
		int64_t temp;
		cin>>temp;
		cout<<temp<<endl;
	}else{
		int64_t a,b;
		cin>>a;
		cin>>b;
		int64_t ans=lcm(a,b);
		for(int i=2;i<n;i++){
			int64_t temp;
			cin>>temp;
			ans=lcm(ans,temp);
		}
		cout<<ans<<endl;
	}





	return 0;

}

Measured memory_bytes: 256
import java.util.HashMap;
import java.util.Map;
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        // 解説youtube後
        Scanner sc = new Scanner(System.in);
        long a = sc.nextLong();
        long b = sc.nextLong();

        long ans = solve(a, b);
        System.out.println(ans);
    }

    static long solve(long a, long b) {
        long gcd = gcd(a, b);
        long ans = primeFactorize(gcd);
        return ans;
    }

    private static long primeFactorize(long gcd) {
        // 素因数分解の数値をキー、回数をバリューで保持る
        Map<Long, Long> m = new HashMap<>();
        for (long i = 2; i * i <= gcd; i++) {
            // System.err.printf("--%s \n", i);
            if (gcd % i != 0) {
                continue;
            }
            while (gcd % i == 0) {
                // System.err.printf(" %s ÷ %s \n", gcd, i);
                gcd /= i;
                m.put(i, m.getOrDefault(i, 0L) + 1);
            }
        }

        if (gcd > 1) {
            m.put(gcd, m.getOrDefault(gcd, 0L) + 1);
        }

        // System.err.println(m);
        return m.keySet().size() + 1;
    }

    static long gcd(long x, long y) {
        // gcd ワンライナー。x < yの場合x%yはxの値になり、gcdの引数はswapされる
        return y == 0 ? x : gcd(y, x % y);
    }
}


Measured memory_bytes: 23380
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N = 3e5 + 10;
int dp[2][81][322*80+10];
int a[81][81], b[81][81];
int main() {
    int base = 161*80+2;
    int inf = 0x3f3f3f3f;
    int n, m;
    cin >> n >> m;
    memset(dp, 0, sizeof dp);
    dp[1][0][base] = 1;
    dp[0][1][base] = 1;
    for(int i = 0; i < n; i++) for(int j = 0; j < m; j++) cin >> a[i][j];
    for(int i = 0; i < n; i++) for(int j = 0; j < m; j++) cin >> b[i][j];
    for(int i = 0; i < n; i++) {
        int now = (i&1);
        int nxt = !now;
        memset(dp[nxt], 0, sizeof dp[nxt]);
        for(int j = 0; j < m; j++) {
            for(int k = 0; k <= base*2; k++) {
                int src = dp[now][j+1][k];
                int cha = k+a[i][j]-b[i][j];
                int cha2 = k-a[i][j]+b[i][j];
                if(src == 1) {
                    dp[nxt][j+1][cha] = 1;
                    dp[nxt][j+1][cha2] = 1;
                }
                if(j != 0) {
                    src = dp[nxt][j][k];
                    if(src == 1) {
                        dp[nxt][j+1][cha] = 1;
                        dp[nxt][j+1][cha2] = 1;
                    }
                }
            }
        }
    }
    int ans = 12345678;
    for(int i = 0; i < 2*base; i++) {
        if(dp[n&1][m][i] == 1) {
            ans = min(ans, int(abs(i-base)));
        }
    }
    cout << ans << endl;
    return 0;
}

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

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

  for(int i=0; i<k; i++){
    if(i%2==0){
      if(a%2!=0)a--;
      b+=a/2;
      a/=2;
    }else{
      if(b%2!=0)b--;
      a+=b/2;
      b/=2;
    }
  }

  cout<<a<<" "<<b<<endl;
}


Measured memory_bytes: 256
<?php
$input = file_get_contents('php://stdin');
$inarr = explode("\n", $input);

$card = array_map(function ($e) {
  return explode(" ", $e);
}, array_splice($inarr, 0, 3));
 
$n = intval($inarr[0]);
$bList = array_splice($inarr, 1, $n);

$bingo=false;
foreach($bList as $b){
    #該当数字判定
    foreach($card as &$aList){
        $check = array_search($b, $aList);
        if($check!==false){
            $aList[$check]="0";
        }
      	unset($aList);
    }
    #ビンゴ判定
    #横
    foreach($card as $aList){
        if($aList[0]==$aList[1] and $aList[0]==$aList[2]){
            $bingo=true;
            echo "Yes";
            exit();
        }
    }
    #縦
    for($i=0; $i<3; $i++){
        if($card[0][$i]==$card[1][$i] and $card[0][$i]==$card[2][$i]){
            $bingo=true;
            echo "Yes";
            exit();
        }
    }
    #斜め
    if($card[0][0]==$card[1][1] and $card[0][0]==$card[2][2]){
        $bingo=true;
        echo "Yes";
        exit();
    }
    if($card[0][2]==$card[1][1] and $card[0][2]==$card[2][0]){
        $bingo=true;
        echo "Yes";
        exit();
    }
}
echo "No";

?>

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

using namespace std;

int x,y;
int main()
{
	scanf("%d%d",&x,&y);
	int tt=fabs(fabs(x)-fabs(y));
	if(!x||!y)
	{
		if(x<y) cout << tt << endl;
		else cout << tt+1 << endl;
		return 0;
	}
	if(1ll*x*y<0) cout << tt+1 << endl;
	else if(x>y) cout << tt+2 << endl;
	else cout << tt << endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <set>
#include <cmath>
typedef long long ll;

//マクロ
//forループ関係
//引数は、(ループ内変数,動く範囲)か(ループ内変数,始めの数,終わりの数)、のどちらか
//Dがついてないものはループ変数は1ずつインクリメントされ、Dがついてるものはループ変数は1ずつデクリメントされる
#define REP(i,n) for(ll i=0;i<(ll)(n);i++)
#define REPD(i,n) for(ll i=n-1;i>=0;i--)
#define FOR(i,a,b) for(ll i=a;i<=(ll)(b);i++)
#define FORD(i,a,b) for(ll i=a;i>=(ll)(b);i--)
//xにはvectorなどのコンテナ
#define ALL(x) (x).begin(),(x).end() //sortなどの引数を省略したい
#define SIZE(x) ((ll)(x).size()) //sizeをsize_tからllに直しておく
#define MAX(x) *max_element(ALL(x)) //最大値を求める
#define MIN(x) *min_element(ALL(x)) //最小値を求める
#define D()
//定数
#define INF 1000000000000 //10^12:極めて大きい値,∞
#define MOD 10000007 //10^9+7:合同式の法
#define MAXR 100000 //10^5:配列の最大のrange(素数列挙などで使用)
//略記
#define PB push_back //vectorヘの挿入
#define MP make_pair //pairのコンストラクタ
#define F first //pairの一つ目の要素
#define S second //pairの二つ目の要素

int main(){
	std::string s,t="";
	std::cin >> s;
	int num = s.size();
	while(num>0){
		if(s[num-1] == 'm') {
			num -= 5;
			t = "dream" + t;
		}else if(s[num-1] == 'e'){
			num -= 5;
			t = "erase" + t;
		}else if(s[num-1] == 'r' && s[num-7] == 'd'){
			num -= 7;
			t = "dreamer" + t;
		}else if(s[num-1] == 'r' && s[num-6] == 'e'){
			num -= 6;
			t = "eraser" + t;
		}else{
			num -= s.size();
		}
	}
	if(s==t) std::cout << "YES" << std::endl;
	else std::cout << "NO" << std::endl;
	return 0;
}


Measured memory_bytes: 512
#include <stdio.h>
#include <math.h>

int main(void){
    int n,i;
    scanf("%d",&n);
    printf("%d:",n);
    for(i=2;i<=sqrt(n);){
        if(n%i==0){
            printf(" %d",i);
            n = n/i;
        }else{
            i++;
        }
    }
    printf(" %d\n",n);
}


Measured memory_bytes: 2092
#include<bits/stdc++.h>
using namespace std;
int main(){
  int w,h,i,j,k;
  cin>>h>>w;
  string s[w][h];
  for(i=0;i<h;i++)
    for(j=0;j<w;j++) cin >> s[j][i];
  for(i=0;i<h;i++){
    for(j=0;j<w;j++){
      if(s[j][i]=="snuke"){
	cout << (char)('A'+j) << i+1 << endl;
	break;
      }
    }
  }
  return 0;
}


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

int main() {
	double v, t, y;
	while (cin >> v) {
		for (int i = 1;; i++) {
			y = 5 * i - 5;
			t = sqrt(y / 4.9);
			if (v <= 9.8 * t) {
				cout << i << endl;
				break;
			}
		}
	}
	return 0;
}


Measured memory_bytes: 3168
#include <iostream>
#include <vector>

using namespace std;

int main(){
  string s;
  int n;
  cin >> n;
  vector<string> q;
  for(int i=0;i<n;i++){
    cin >> s;
    q.push_back(s);
  }
  for(int i=1;i<n;i++){
    if(q[i-1][q[i-1].size()-1] != q[i][0]){
      cout << "No" << endl;
      return 0;
    }
    for(int j=0;j<i;j++){
      if(q[i] == q[j]){
      cout << "No" << endl;
      return 0;
      }
    }
  }
  cout << "Yes" << endl;
  
  return 0;
}

Measured memory_bytes: 256
#include<stdio.h>
#include<string.h>
int main(){
    int n,i;int d[4]={0};char s[3];
    scanf("%d\n",&n);
    for(i=0;i<n;i++){
        scanf("%s\n",s);
        if(s[0]=='A'){
            d[0]++;
        }else if(s[0]=='W'){
            d[1]++;
        }else if(s[0]=='T'){
            d[2]++;
        }else{
            d[3]++;
        }
    }
    printf("AC x %d\nWA x %d\nTLE x %d\nRE x %d\n",d[0],d[1],d[2],d[3]);
    return 0;
}

Measured memory_bytes: 1728
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<ll> vll;
#define all(x) (x).begin(), (x).end()
ll inf = LLONG_MAX;
long double pi = M_PI;
void Yes() {cout << "Yes" << endl;}
void No() {cout << "No" << endl;}
void YES() {cout << "YES" << endl;}
void NO() {cout << "NO" << endl;}

ll repsq(ll a, ll n, ll p) {
    if (n == 0) return 1;
    if (n % 2 == 0) {
        ll x = repsq(a, n / 2, p);
        return x * x % p;
    }
    return (a % p) * repsq(a, n - 1, p) % p;
}

//二項係数 mod p
ll modinv(ll n, ll p) {
  ll a = p, u = 1, v = 0;
  while (a) {
    ll t = n / a;
    n -= t * a;
    swap(n, a);
    u -= t * v;
    swap(u, v);
  }
  u %= p;
  if (u < 0) u += p;
  return u;
}

ll ncr(ll n, ll r, ll p) {
  r = min(r, n - r);
  ll ans = 1;
  for (ll i = 0; i < r; i++) {
    ans *= (n - i) % p;
    ans %= p;
  }
  for (ll i = 0; i < r; i++) {
    ans *= modinv(i + 1, p);
    ans %= p;
  }
  return ans;
}

int main() {
  ll n, a, b, p = 1000000007;
  cin >> n >> a >> b;

  ll ans = repsq(2, n, p) - 1;
  if (ans < 0) ans += p;
  ll aa = ncr(n, a, p);
  ll bb = ncr(n, b, p);
  ans -= aa;
  if (ans < 0) ans += p;
  ans -= bb;
  if (ans < 0) ans += p;
  cout << ans << endl;
}

Measured memory_bytes: 384
#include <bits/stdc++.h>
#include <string>
using namespace std;
#define ll long long
#define endl "\n"
#define print_array(name,n) for(ll o=0;o<n;o++) cout<<name[o]<<" "
#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define inf 2e18
#define pll pair<ll,ll>
#define pii pair<int,int>
bool sortbysecond(const pair<int,int> &a,const pair<int,int> &b){
	return (a.ss>b.ss);
}
 
ll gcd(ll a,ll b){ if(b==0) return a; return gcd(b,a%b) ;} 

template <typename T>
string NumberTostring(T Number )
{
	ostringstream ss;
	ss<<Number;
	return ss.str();
}
 
void solve(){
	string s;
	cin>>s;
	ll sum = 0;
	for(int i=0;i<s.size();i++){
		sum+= ((int)s[i] - (int)'0');
	}
	if(sum%9==0){
		cout<<"Yes"<<endl;
	}
	else{
		cout<<"No"<<endl;
	}
}
 
int main()
{
	#ifndef ONLINE_JUDGE
	freopen("input.txt","r",stdin);
	freopen("output.txt","w",stdout);
	#endif
    ios_base::sync_with_stdio(false);
    cin.tie(0);cout.tie(0);
	ll t;
	// cin>>t;
	t=1;
	while(t--){
		solve();
	}    
    return 0;
}

Measured memory_bytes: 3776
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using static System.Console;

public static partial class Program
{
    public static void Main()
    {
        var s = CRL();
        var p = s.Count(x => x == 'p');

        CWL(s.Length / 2 - p);
    }
}

public static partial class Program
{
    //テンプレここから
    public static long GCD(long a, long b) => b == 0 ? a : GCD(b, a % b);

    public static long LCM(long a, long b) => a * b / GCD(a, b);
    public static int ToInt(this double d) => (int) d;
    public static long ToLong(this double d) => (long) d;
    public static int ToInt(this string str) => int.Parse(str);
    public static long ToLong(this string str) => long.Parse(str);
    public static long[] ToLong(this IEnumerable<string> strs) => strs.Select(x => x.ToLong()).ToArray();
    public static int[] ToInt(this IEnumerable<string> strs) => strs.Select(x => x.ToInt()).ToArray();
    public static long[] ArrayLongs(this string str, char opr = ' ') => str.Split(opr).ToLong();
    public static int[] ArrayInts(this string str, char opr = ' ') => str.Split(opr).ToInt();
    public static string CRL() => Console.ReadLine();
    public static string RL() => ReadLine();
    public static void CWL(object obj) => Console.WriteLine(obj);
    public static void WL(object obj) => WriteLine(obj);
    public static long Diff(long a, long b) => Math.Abs(Math.Max(a, b) - Math.Min(a, b));
    public static int Diff(int a, int b) => Math.Abs(Math.Max(a, b) - Math.Min(a, b));
    public static long Sign(this long i) => Math.Sign(i);
    public static bool IsEven(this long i) => i % 2 == 0;
    public static bool IsEven(this int i) => i % 2 == 0;
    public static long[] dx = new long[] {0, -1, 0, 1};
    public static long[] dy = new long[] {-1, 0, 1, 0};
    public static long mod = 1000000007;
    public static string alphabet = "abcdefghijklmnopqrstuvwxyz";
    public static long ToLong(this char c) => c.ToString().ToInt();
    public static long[] Sort(this long[] array) => array.OrderBy(x => x).ToArray();
    public static int[] Sort(this int[] array) => array.OrderBy(x => x).ToArray();
    public static long[] DSort(this long[] array) => array.OrderByDescending(x => x).ToArray();
    public static int[] DSort(this int[] array) => array.OrderByDescending(x => x).ToArray();
    public static string Join(this IEnumerable<string> array, string sep = "") => string.Join(sep, array);

    public static string Join(this IEnumerable<char> array, string sep = "") => string.Join(sep, array);

    //テンプレここまで
}

Measured memory_bytes: 11360
import math
g = 0
K = int(input())
for a in range(1,K-1):
    for b in range(a+1,K):
        for c in range(b+1,K+1):
            g += math.gcd(math.gcd(a,b),c)*6
for d in range(1,K):
    for e in range(d+1,K+1):
        g+= math.gcd(d,e)*6
g+= K*(K+1)//2
print(g)

Measured memory_bytes: 9196
#define _USE_MATH_DEFINES
#include <math.h>
#include <iostream>
#include <iomanip>
#include <cstdlib>
#include <algorithm>
#include <numeric>
#include <stdio.h>
#include <vector>
#include <map>

using namespace std;
typedef long long ll;

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

int main() {

    ll N,K;
    cin >> N >> K;
    ll A;
    ll I = 0;
    rep(i,N){
        cin >> A;
        if(A==1){
            I = i;
        }
    }
    ll l = I/(K-1);
    if(I%(K-1)!=0) l++;
    ll r = (N-1-I)/(K-1);
    if((N-1-I)%(K-1)!=0) r++;
//    cout << l+r << endl;
    ll out = (N-1)/(K-1);
    if((N-1)%(K-1)!=0) out++;
    cout << out << endl;
    return 0;
}


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

int main(){
  
  int a,b;
  cin >> a >> b;
  
  if( (a <= 8 && b <= 8) && a-b <= 1 ){
    
  cout << "Yay!" << endl;
  
}

  else{
    
  cout << ":(" << endl;
    
  }
  
}


Measured memory_bytes: 256
n=int(input())
p=[int(x) for x in input().rstrip().split()]

cnt=0
for i in range(n-1):
  if p[i]==i+1:
    now=p[i+1]
    p[i+1]=p[i]
    p[i]=now
    cnt+=1
if p[n-1]==n:
  cnt+=1

print(cnt)


Measured memory_bytes: 20112
#include <iostream>
#include <sstream>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <algorithm>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cctype>
#include <cmath>
#include <cassert>
#include <sstream>
#include <fstream>

#define all(c) (c).begin(), (c).end()
#define iter(c) __typeof((c).begin())
#define cpresent(c, e) (find(all(c), (e)) != (c).end())
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define tr(c, i) for (iter(c) i = (c).begin(); i != (c).end(); ++i)
#define pb(e) push_back(e)
#define mp(a, b) make_pair(a, b)

using namespace std;
typedef long long unsigned int ll;
vector<int> x(4);
string ans;
void dfs(int i, string s, int f) {
  if (i == 4) {
    if (f == 7) ans = s;
    return;
  }

  dfs(i + 1, s + "+", f + x[i]);
  dfs(i + 1, s + "-", f - x[i]);
}

int main() {
  string x_;
  cin >> x_;
  for (int i = 0; i < 4; ++i) x[i] = (int)x_[i] - '0';
  dfs(1, "", x[0]);

  for (int i = 0; i < 4; ++i) {
    if (i < 3) {
      cout << x[i] << ans[i];
    } else {
      cout << x[i];      
    }

  }
  cout << "=7" << endl;
  return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
using namespace std;
typedef long long int lli;

int main() {
	int H, W;
	cin >> H >> W;
	int c[10][10];
	for (int i = 0;i<10;i++) {
		for (int j = 0;j<10;j++) cin >> c[i][j];
	}
	int A[40000];
	for (int i = 0;i<H*W;i++) cin >> A[i];
	int N = H * W;

	//壁の数に-1があればそれを1に変える
	for (int i = 0;i<H*W;i++) {
		if (A[i] == -1) A[i] == 1;
	}

	//iを1に変えるときの必要コストの最小を出したい.
	//ダイクストラ法
	int d[10];
	bool used[10];
	for (int i = 0;i<10;i++) {
		d[i] = 100000;
		used[i] = false;
	}
	d[1] = 0;
		while (true) {
			int v = -1;
			for (int u = 0;u<10;u++) {
				if (!used[u] && (v == -1 || d[u]<d[v])) v = u;
			}
			if (v == -1) break;
			used[v] = true;
			for (int u = 0;u<10;u++) {
				d[u] = min(d[u], d[v] + c[u][v]);
			}
		}
	//各数字iに対応してd[i]を足しあわせる
	int ans;
	for (int i = 0;i<H*W;i++) ans += d[A[i]];
	cout << ans;
}

Measured memory_bytes: 384
#include <algorithm>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <numeric>
#include <queue>
#include <string>
#include <vector>
using namespace std;
using ll = int64_t;

int main() {
  string s, t;
  cin >> s >> t;
  int a = stoll(s + t);
  for (int i = 1; i * i <= 100100; ++i) {
    if (i * i == a) {
      cout << "Yes" << endl;
      return 0;
    }
  }
  cout << "No" << endl;
  return 0;
}

Measured memory_bytes: 3612
N,K = list(map(int,input().split()))

X = []
Y = []
Z = []
for i in range(N):
    x,y = list(map(int,input().split()))
    X.append(x)
    Y.append(y)
    Z.append([x,y])

X.sort()
Y.sort()

min_rec=10**27

for i in range(N-1):
    for j in range(i+1,N):
        for k in range(N-1):
            for l in range(k+1,N):
                count=0
                for n in range(N):
                    if Z[n][0]>=X[i] and Z[n][0]<=X[j] and Z[n][1]>=Y[k] and Z[n][1]<=Y[l]:
                        count+=1
                if count==K:
                    min_rec = min(min_rec,(X[j]-X[i])*(Y[l]-Y[k]))

print(min_rec)

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

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


Measured memory_bytes: 3052
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (int)(n); i++)
#define REP(i,n) for (int i = 1; i < (int)(n); i++)
#define all(x) x.begin(),x.end()
#define rall(x) x.rbegin(),x.rend()
#define vout(x) rep(i,x.size()) cout << x[i] << " "
template<class T> bool chmin(T &a, T b) {if(a>b) {a=b;return 1;}return 0;}
using namespace std;
using vint = vector<int>;
using vvint = vector<vector<int>>;
using ll = long long;
using vll = vector<ll>;
using vvll = vector<vector<ll>>;
using P = pair<int,int>;
const int inf = 1e9;
const ll inf_l = 1e18;
const int MAX = 100005;

int main() {
    string s; cin >> s;
    int n = s.size();
    int k; cin >> k;
    set<string> st;
    for (int i = 0; i < n; i++) {
        for (int j = i; (j-i+1) <= k; j++) {
            string tmp = s.substr(i,j-i+1);
            st.insert(tmp);
        }
    } 
    auto itr = st.begin();
    rep(i,k-1) itr++;
    cout << *itr << endl;
}

Measured memory_bytes: 1664
import numpy as np
N=int(input())
A=np.empty(N)
for i in range(N):
    A[i]=int(input())
m = np.median(A)
dA = np.abs(A-m)
sdA=np.sort(dA)
D = int(sdA[0:2].sum() + sdA[2:].sum()*2)
print(D)

Measured memory_bytes: 23804
from collections import deque

H,W=map(int,input().split())
C=tuple(map(int,input().split()))
D=tuple(map(int,input().split()))

S=["*"*(W+4)]*(H+4)

for x in range(H):
    S[x+2]="**"+input()+"**"

V=[]
for a in range(-2,3):
    for b in range(-2,3):
        if not(a==b==0):
            if abs(a)+abs(b)<=1:
                V.append(((a,b),0))
            else:
                V.append(((a,b),1))

inf=float("inf")
Dist=[[inf]*(W+1) for _ in range(H+1)]

Q=deque([C])
Dist[C[0]][C[1]]=0

while Q:
    (x,y)=Q.popleft()
    for ((a,b),c) in V:
        try:
            if S[x+a+1][y+b+1]=="." and Dist[x][y]+c<Dist[x+a][y+b]:
                Dist[x+a][y+b]=Dist[x][y]+c
                if c==0:
                    Q.appendleft((x+a,y+b))
                else:
                    Q.append((x+a,y+b))
        except:
            pass

if Dist[D[0]][D[1]]<inf:
    print(Dist[D[0]][D[1]])
else:
    print(-1)



Measured memory_bytes: 95336
#include<stdio.h>

int main(){
    int N;
    int a[2][110];
    int i, j, k;
    int sum, ans=0;

    scanf("%d", &N);
    for(i=0; i<2; i++){
        for(j=0; j<N; j++){
            scanf("%d", &a[i][j]);
        }
    }

    for(i=0; i<N; i++){
        sum=0;
        for(j=0; j<N; j++){
            if(j>i){
                sum+=a[1][j];
            }else if(j<i){
                sum+=a[0][j];
            }else if(j==i){
                sum+=a[0][j];
                sum+=a[1][j];
            }
        }
        if(ans<sum){
            ans=sum;
        }
    }
    printf("%d", ans);

    return 0;
}

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

int main()
{
    int n, m;
    cin >> n >> m;
    vector<int> answer(n, 0);
    for(int i = 0; i < m; i++){
        int a, b;
        cin >> a >> b;
        answer.at(a-1)+=1;
        answer.at(b-1)+=1;
    }
    for(int i = 0; i<n;i++){
        cout << answer.at(i) << endl;
    }
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define mod 1000000007
#define pb push_back
#define rep(i,x) for(int i=0;i<x;i++)
ll dpa[100005],dpb[100005],a,b,x[1000005],ruia[100005],ruib[100005];
int n;
int la,ra,lb,rb;
int main(){
	scanf("%d%lld%lld",&n,&a,&b);
	for(int i=1;i<=n;i++){
		scanf("%lld",&x[i]);
	}
	dpa[0] = 1; dpb[0] = 1;
	ruia[0] = 1; ruib[0] = 1;
	for(int i=2;i<=n;i++){
		int id = upper_bound(x+1,x+n+1,x[i]-a)-x;
		//[lb,min(rb,id-1)]
		int R = min(rb,id-1);
		if(lb<=R) dpa[i-1] = (ruib[R]-ruib[lb-1]+mod)%mod;
		ruia[i-1] = (ruia[i-2]+dpa[i-1])%mod;
		id = upper_bound(x+1,x+n+1,x[i]-b)-x;
		//[la,min(ra,id-1)]
		R = min(ra,id-1);
		if(la<=R) dpb[i-1] = (ruia[R]-ruia[la-1]+mod)%mod;
		ruib[i-1] = (ruib[i-2]+dpb[i-1])%mod;
		ra++; rb++;
		if(x[i]-x[i-1]<a){
			la = ra;
		}
		if(x[i]-x[i-1]<b){
			lb = rb;
		}
	}
	ll ans = 0;
	for(int i=la;i<=ra;i++) ans+=dpa[i];
	for(int i=lb;i<=rb;i++) ans+=dpb[i];
	cout<<ans%mod<<endl;
}

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

int main(){
    string n;
    cin >> n;
    int ans = 0;
    for (long long i = 0; i < n.size(); i++){
        ans += n[i] - '0';
        ans %= 9;
    }
    if (ans == 0){
        cout << "Yes" << endl;
    }else{
        cout << "No" << endl;
    }
}

Measured memory_bytes: 3724
#include <bits/stdc++.h>
#define lop(i,s,t) for(int i=s;i<(t);++i)
#define rep(i,s,t) for(int i=s;i<=(t);++i)
using namespace std;
const int N=21,P=1e9+7;
void upd(int &a,int b){ a=a+b>=P?a+b-P:a+b; }
int d[N][N][2],ans,n,m,q,f[2][1<<N],nxt[1<<N][N];
int main(int argc,char *argv[]){
	cin>>n>>m>>q,--n;
	rep(k,1,q){
		int a,b,c;
		cin>>a>>b>>c;
		d[a][b-1][!c]=1;
	}
	lop(s,0,(1<<n))lop(j,0,n)if((s>>j&1)==0){
		int k=j,t=s;
		for(;k<n&&!((s>>k)&1);++k); 
		if(k<n)t-=(1<<k);
		nxt[s][j]=t+(1<<j); 
	}
	f[n&1][0]=1;
	rep(i,1,m){
		if(n&1)memcpy(f[0],f[1],sizeof(f[0])); 
		lop(j,0,n){
			int p=j&1,c=!p;
			memset(f[c],0,sizeof(f[c])); 
			lop(s,0,(1<<n))rep(num,0,1)if(!d[i][j][num]){
				if(!(((s>>j&1)==1)&&!num))
					upd(f[c][(s>>j&1)==num?s:nxt[s][j]],f[p][s]); 
			}
		}
	}
	lop(s,0,(1<<n))upd(ans,f[n&1][s]); 
	cout<<ans<<endl;
	return 0;
}


Measured memory_bytes: 61696
#include<bits/stdc++.h>
using namespace std;
inline int read(){
	int num=0;char c=' ';bool flag=true;
	for(;c>'9'||c<'0';c=getchar())
		if(c=='-')
			flag=false;
	for(;c>='0'&&c<='9';num=(num<<3)+(num<<1)+c-48,c=getchar());
	return flag ? num : -num;
}
int a,b,n,ans=2e9;
int main(){
	n=read();
	for(int i=1;i<n;i++){
		a=i;
		b=n-i;
		int sum=0;
		while(a){
			sum+=a%10;
			a/=10;
		}
		while(b){
			sum+=b%10;
			b/=10;
		}
		ans=min(ans,sum);
	}
	printf("%d\n",ans);
	return 0;
}

Measured memory_bytes: 256
(let* ((n (read))
       (k (read))
       (a (make-array (list (1+ n)))))
  (loop :for i :from 1 :to k
        :do (setf (aref a i) (read)))
  (loop :for i :from (1+ k) :to n
        :do (setf (aref a i) (read))
        :if (> (aref a i) (aref a (- i k)))
        :do (format t "Yes~%")
        :else
        :do (format t "No~%")))


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

class BIT{
public:
  int n,bit[200010];
  BIT(){fill(bit,bit+200010,0);}
  void add(int i,int x){
    while(i<=n){
      bit[i]+=x;
      i+=i&-i;
    }
  }
  int sum(int i){
    int s=0;
    while(i>0){
      s+=bit[i];
      i-=i&-i;
    }
    return s;
  }
};

int main() {
  BIT b;
  int q;
  cin >> b.n >> q;
  while(q--) {
    int x,y,z;
    cin >> x >> y >> z;
    if(x) cout << b.sum(z)-b.sum(y-1) << endl;
    else b.add(y,z);
  }
  return 0;
}


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

using namespace std;

typedef long long ll;

inline ll read(){
	char ch=getchar();ll x=0,f=1;
	while(ch>'9' || ch<'0'){
        if(ch=='-') f=-1;
	    ch=getchar();
	}
	while(ch>='0' && ch<='9'){
		x=x*10+ch-'0';
		ch=getchar();
	}
	return x*f;
}

int a[2020202];

bool cmp(int a,int b){
	return a>b; 
} 


int main(){
	int n=read();
	for(int i=1;i<=n;i++){
		a[i]=read();
	}
	sort(a+1,a+n+1,cmp);
	for(int i=1;i<=n;i++){
		if(i+1>a[i+1]){
			int ans=0;
			for(int j=i+1;a[j]==i;j++) ans^=1;
			ans|=(a[i]-i)&1;
			if(ans){
				puts("First");
			} 
			else{
				puts("Second");
			}
			return 0;
		}
	}
	return 0;
}



Measured memory_bytes: 768
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i=0; i<(n); ++i)
#define REP(i, d, n) for(int i=(d); i<(n); ++i)
#define all(v) v.begin(), v.end()
using ll = long long;
using P = pair<int, int>;

int main() {

    int n, m;
    cin >> n >> m;

    int ans = n * (n - 1) / 2;
    ans += m * (m - 1) / 2;

    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define rep(i,a,b) for(int i=a;i<b;i++)
#define rrep(i,a,b) for(int i=a;i>=b;i--)
#define erep(i,a,n) for(int i = a;i<=n;i++)
typedef long long ll;
#define int long long
#define vint vector<int>
#define vvint vector<vector<int>>
#define vstring vector<string>
#define vdouble vector<double>
#define vll vector<ll>:
#define vbool vector<bool>
#define INF 110101010101010101
#define MOD 1000000007
#define P = pair<int,int>;
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a = b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a = b; return 1; } return 0; }

signed main(){
  int n,k;
  cin >> n >> k;
  vint V(n);
  rep(i,0,n) cin >> V[i];
  int ans = 0;
  for(int l = 0;l <= k;l++){
    for(int r = 0;r <= k-l;r++){
      if(l + r > n) continue;
      int d = k - l - r;
      int now = 0;
      vint S;
      for(int i = 0;i < l;i++){
        now += V[i];
        S.push_back(V[i]);
      }
      for(int i = n-1;i >= n-r;i--){
        now += V[i];
        S.push_back(V[i]);
      }
      sort(S.begin(),S.end());
      for(int i = 0;i < d;i++){
        if(S.size() <= i) break;
        if(S[i] > 0) break;
        else now -= S[i];
      }
      ans = max(ans,now);
    }
  }
  cout << ans << endl;
}

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

typedef long long ll;
using namespace std;


int main()
{
  int n;
  cin>>n;
  int a[100];
  ll start=1000;
  ll div=0;
  ll kabu=0;
  rep(i,n)cin>>a[i];


  rep(i,n-1){
    if(a[i]<a[i+1]){
      kabu=(start+div)/a[i];
      div=(start+div)%a[i];
      start=kabu*a[i+1];
    }
  }

  cout<<start+div<<endl;

  return 0;
}


Measured memory_bytes: 3612
<?php
fscanf(STDIN, "%d", $n);
$one = intval($n % 10);
$ten = intval(($n / 10)%10);
$hundred = intval($n / 100);
if ($one == 7 || $ten == 7 || $hundred == 7) {
    echo "Yes\n";
} else {
    echo "No\n";
}


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

lli mod = 1000000007;
int n;


lli calc(int index, lli mask,vector<vector<lli> > &dp,vector<vector<int> > &arr)
{
    if(n == index)
    {
        if(mask == ((1<<n)-1))
            return 1;
        else
            return 0;
    }
    if(dp[index][mask] != -1)
        return dp[index][mask];
    lli ans = 0;
    for(int i=0;i<n;i++)
    {
        if(arr[index][i] == 1 && (mask&(1<<i))==0)
        {
            ans = (ans%mod + calc(index+1, (mask|(1<<i)),dp,arr)%mod)%mod;
        }
    }
    dp[index][mask] = ans;
    return ans;
}


int main()
{
    cin>>n;
    vector<vector<int> > arr(n,vector<int>(n));
    vector<vector<lli> > dp(n,vector<lli>(1<<n , -1));
    for(int i=0;i<n;i++)
        for(int j=0;j<n;j++)
            cin>>arr[i][j];
    cout<<calc(0,0,dp,arr);

}


Measured memory_bytes: 360832
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i, a, b) for (int i = (a); i < (b); i++)

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    // cout << fixed << setprecision(10);
    ll n, k;
    cin >> n >> k;
    vector<ll> a(n), s(n + 1);
    map<ll, vector<ll>> mp;
    s[0] = n % k;
    mp[s[0]].emplace_back(0);
    rep(i, 0, n) {
        cin >> a[i];
        s[i + 1] = (s[i] + a[i] + k - 1) % k;
        mp[s[i + 1]].emplace_back(i + 1);
    }
    ll ans = 0;
    for (auto &v : mp) {
        int m = v.second.size();
        if (m < 2)
            continue;
        rep(i, 0, m - 1) ans +=
            upper_bound(v.second.begin(), v.second.end(), v.second[i] + k - 1) -
            lower_bound(v.second.begin(), v.second.end(), v.second[i]) - 1;
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 25216
from collections import Counter
n=int(input())
A=Counter(list(map(int,input().split())))
x=[0,0]
for a in A:
  if A[a]>=2:
    x.append(a)
  if A[a]>=4:
    x.append(a)
x.sort()
print(x[-1]*x[-2])

Measured memory_bytes: 18600
A, B, M = map(int, input().split())

a_list = list(map(int, input().split()))
b_list = list(map(int, input().split()))

min_ab = min(a_list) + min(b_list)
for i in range(M):
  x, y, c = map(int, input().split())
  min_ab = min(a_list[x-1] + b_list[y-1] - c, min_ab)
print(min_ab)

Measured memory_bytes: 18648
import math

n = int(input())
h = int(input())
w = int(input())

remainder_row = n-h
remainder_col = n-w
total_row = remainder_row + 1
total_col = remainder_col + 1
combi_row = math.factorial(total_row) / math.factorial(remainder_row)
combi_col = math.factorial(total_col) / math.factorial(remainder_col)

print(int(combi_row * combi_col))

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

int main(){
    int n;
    cin >> n;
    for(int i=0;i<n;i++){
        bool ans(true);
        int in[10],a,b;
        for(int j=0;j<10;j++){
            cin >> in[j];
        }
        a = in[0];   b = 0;
        for(int j=1;j<10;j++){
            if(a<in[j]||b<in[j]){
                if(a<in[j]&&b<in[j]){
                    if(abs(a-in[j])>=abs(b-in[j])){
                        b = in[j];
                    }else{
                        a = in[j];
                    }
                }else if(a<in[j]){
                    a = in[j];
                }else{
                    b = in[j];
                }
            }else{
                ans = false;
            }
        }
        if(ans)
            cout << "YES" << endl;
        else
            cout << "NO" << endl;
    }
    return 0;
}


Measured memory_bytes: 3088
#include <bits/stdc++.h>
#define IOS  ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0)
#define mp    make_pair
#define pb    push_back
#define F     first
#define pi 	  3.14159265358979323846
#define S     second
#define ll    long long
#define ld    long double
#define sz(s) (ll)s.size() 
#define vl    vector < ll >
#define pll   pair < ll, ll >
#define ml    map < ll, ll >
#define mod   1000000007
#define q	998244353
#define MAXN  50005 
#define mx 10000005
#define rep(i,a,b)  for(ll i=a;i<b;i++)
#define inv(i,a,b)  for(ll i=a;i>=b;i--)
#define all(a)  (a).begin(),(a).end()
using namespace std;
int main(){
	IOS;
	ll t,n,l;
	ll i,j,m,mn,d,x,y,ans=mod,temp=0,p,k,c;
	string s,s1;
	cin>>n;
	ans=(1000-(n%1000))%1000;
	cout<<ans;
}

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

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


Measured memory_bytes: 256
import java.util.ArrayList;
import java.util.Scanner;

public class Main {
	

	
	public static void main(String[] args) {

		
		Scanner s = new Scanner(System.in);
		
			int a = s.nextInt();
			int b = s.nextInt();
			int c = s.nextInt();
			int d = s.nextInt();
			
			int ans1=0,ans2=0;
			if(a%d==0) {
				ans1=a/d;
			}
			else {
				ans1=a/d+1;
			}
			if(c%b==0) {
				ans2 = c/b;
			}
			else {
				ans2 = c/b+1;
			}
			if(ans1>=ans2) {
				System.out.println("Yes");
			}
			else {
				System.out.println("No");
			}
			

		
		
	}
}

Measured memory_bytes: 35772
#include <iostream>

using namespace std;

int main(){
	long long int h, w;
	cin >> h >> w;

	if(h == 1 || w == 1)
		cout << "1";
	else if(h * w % 2 == 0)
		cout << h * w / 2;
	else
		cout << (h * w + 1) / 2;
}

Measured memory_bytes: 3672
#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;

const int MAX = 1e5 + 5;
const int INF = 1001001001;
const int MOD = 1e9 + 7;

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

    for (int i = 1; i <= 1050; ++i) {
        if (floor(i * 0.08) == A && floor(i * 0.1) == B) {
            cout << i << endl;
            return 0;
        }
    }

    puts("-1");
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
 
using namespace std;
 
#define INF 1000000007
#define LINF 1000000000000000007
 
typedef long long ll;
typedef pair<ll,ll> P;


int n;

int main(){
	cin >> n;
	if(n == 1) cout << "Hello World" << endl;
	else {
		int a,b;
		cin >> a >>b;
		cout << a+b <<endl;
	}
	
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep0(i,n) for (int i = 0; i < (n); ++i)  //0index
#define rep1(i,n) for (int i = 1; i < (n); ++i)  //1index
#define REP(i,a,b) for (int i = a; i < (b); ++i)  //aからb - 1まで
#define mREP(i,a,b) for (int i = a; i > (b); --i)  //逆
#define all(x) (x).begin(),(x).end()
const int INF = 1000000007;  //最大値兼MOD
typedef long long ll;
using namespace std;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
ll gcd(ll a, ll b) { return b ? gcd(b, a%b) : a; }  //GCD
int dp[100010][3];
int a[100010][3];
int main(){
    string S;
    string a = "Sunny";
    string b = "Cloudy";
    string c = "Rainy";
    string output;
    cin >> S;
     
    if(S==a) output=b;
    if(S==b) output=c;
    if(S==c) output=a;

    cout << output << endl;
} 

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

using namespace std;

typedef long long int ll;
typedef double lf;
typedef bool bl;
typedef vector<ll> vl;
typedef vector<lf> vd;
typedef vector<bl> vb;
typedef string st;
typedef pair<ll,ll> pll;
typedef vector<pll> vpll;

#define INF (LONG_LONG_MAX / 4)
#define SORT(x) sort(x.begin(), x.end())
#define Mod % 1000000007

void re_curse() {
    ll h, w, K;
    cin>>h>>w>>K;
    vector <vl> arr(h, vl(w,0));
    vector <vl> brr;
    for (int i = 0; i < h; ++i) {
        string s;
        cin>>s;
        for (int j = 0; j < w; ++j) {
            arr[i][j] = s[j];
        }
    }
    ll ans = 0;
    for (int i = 0; i < (1<<h); ++i) {
        for (int j = 0; j < (1<<w); ++j) {
            brr = arr;
            for (int r = 0; r < h; ++r) {
                if (i & (1<<r)) {
                    for (int k = 0; k < w; ++k) {
                        brr[r][k] = 0;
                    }
                }
            }
            for (int c = 0; c < w; ++c) {
                if (j & (1<<c)) {
                    for (int k = 0; k < h; ++k) {
                        brr[k][c] = 0;
                    }
                }
            }
            ll c = 0;
            for (int k = 0; k < h; ++k) {
                for (int l = 0; l < w; ++l) {
                    if (brr[k][l] == '#') {
                        ++c;
                    }
                }
            }
            if (c == K) {
                ++ans;
            }
        }
    }
    cout<<ans<<endl;
}

int main() {
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    int t = 1;
    // cin>>t;
    for (int i = 1; i <= t; ++i) {
        re_curse();
    }
    return 0;
}


Measured memory_bytes: 3648
#include <iostream>
#include <vector>
#include <algorithm>
#include <map>
#include <numeric>
#include <string>
#include <cstdio>
#include <cstring>
#include <queue>
#include <stack>
#include <set>
#include <cmath>
#include <bitset>
#include <iomanip> 

using ll = long long;
using ull = unsigned long long;
using namespace std;

#define all(x) (x).begin(),(x).end()
#define rep(i,n) for(int i = 0;(i) < ((int)(n));++(i))
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define UNIQUE(v) v.erase( unique(v.begin(), v.end()), v.end() )
#define test(a) cout<<"line:"<<__LINE__<<"["<<(#a)<<": "<<(a)<<"]"<<endl

constexpr int INF = 1e9+7;
constexpr ll INFL = 9*1e18;

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

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

int inline digit(ll num){int tmp = 0;while(num){tmp++;num/=10;}return tmp;} // 桁数
template<typename T>inline T SUM(vector<T> vec){return accumulate(all(vec),(T)0);} // vectorの中身を全部足す
template<typename T>inline T digitSum(T num){T sum = 0;while(num){sum+=num%10;num/=10;}return sum;} // 各桁の和
template<typename T>inline T gcd(T a,T b){if(b == 0)return a;return gcd(b,a%b);} // 最大公約数
template<typename T>inline T lcm(T a, T b){T g = gcd(a,b);return a/g*b;} // 最小公倍数
template<typename T>inline T power(T a,T b){T tmp=1;rep(i,b){tmp*=a;}return tmp;} // 累乗
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
template<typename T>inline void print(T&& x){cout<<setprecision(32)<<x<<endl;}

int n,m;
vector<vector<int>> ab;
vector<map<int,int>> ans;
int dfs(int now,map<int,int> did){
  int res = 0;
  if(did.size() == n){
    return 1;
  }
  for(auto a : ab[now]){
    auto copy = did;
    if(copy[a])continue;
    copy[a]++;
    res += dfs(a,copy);
  }
  return res;
}


// TODO: write
int main() {
  ll x,y;cin>>x>>y;
  int ans = 0;
  while(x <= y){
    ans++;
    x *= 2;
  }
  print(ans);
  return 0;
}

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

int main()
{
    int a, b;
    cin >> a >> b;
    if(a % b == 0){
        cout << a/b << endl;
    }
    else{
        cout << a/b+1 << endl;
    }
    system("pause");
}

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

#define for_(i,a,b) for(int i=(a);i<(b);++i)

int M, N, ub[111][111], lb[111][111], skill[111];
bool learned[111];

bool all_learned() {
	for_(i,0,M) if (!learned[i]) return false;
	return true;
}

int main() {
	cin >> M >> N;
	
	for_(i,0,M) for_(j,0,N) {
		ub[i][j] = 100;
		lb[i][j] = 0;
	}
	
	for_(i,0,M) {
		int K;
		cin >> K;
		
		for_(j,0,K) {
			int s, t;
			string cnd;
			cin >> s >> cnd >> t;
			--s;
			
			if (cnd == ">=") lb[i][s] = max(lb[i][s], t);
			else ub[i][s] = min(ub[i][s], t);
		}
	}
	
	memset(skill, 0, sizeof(skill));
	memset(learned, 0, sizeof(learned));
	
	for_(i,0,M) {
		bool learn = true;
		for_(j,0,N) learn &= (lb[i][j] <= skill[j] && skill[j] <= ub[i][j]);
		if (learn) learned[i] = true;
	}
		
	while (!all_learned()) {
		int tar = -1;
		
		for_(i,0,N) {
			bool isok = true;
			
			for_(j,0,M) {
				if (learned[j]) continue;
				isok &= (skill[i] + 1 <= ub[j][i]);
			}
			
			if (isok) {
				tar = i;
				break;
			}
		}
		
		if (tar == -1) {
			cout << "No" << endl;
			return 0;
		}
		
		++skill[tar];
		
		for_(i,0,M) {
			bool learn = true;
			for_(j,0,N) learn &= (lb[i][j] <= skill[j] && skill[j] <= ub[i][j]);
			if (learn) learned[i] = true;
		}
	}
	
	cout << "Yes" << endl;
}

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

using pii = pair<int,int>;
using ll = long long;
#define rep(i, j) for(int i=0; i < (int)(j); i++)
#define repeat(i, j, k) for(int i = (j); i < (int)(k); i++)
#define all(v) v.begin(),v.end()
#define debug(x) cerr << #x << " : " << x << endl

template<class T> bool set_min(T &a, const T &b) { return a > b  ? a = b, true : false; }
template<class T> bool set_max(T &a, const T &b) { return a < b  ? a = b, true : false; }
// vector
template<class T> istream& operator >> (istream &is , vector<T> &v) { for(T &a : v) is >> a; return is; }
template<class T> ostream& operator << (ostream &os , const vector<T> &v) { for(const T &t : v) os << "\t" << t; return os << endl; }
// pair
template<class T, class U> ostream& operator << (ostream &os , const pair<T, U> &v) { return os << "<" << v.first << ", " << v.second << ">"; }

const int INF = 1 << 30;
const ll INFL = 1LL << 60;




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

    int N, M; cin >> N >> M;
    vector<int> S(M), C(M); rep(i, M) cin >> S[i] >> C[i];
    int n_min = N == 1 ? 0 : N == 2 ? 10 : 100;
    int n_max = N == 1 ? 10 : N == 2 ? 100 : 1000;
    repeat(i, n_min, n_max) {
        bool ok = true;
        rep(j, M) ok &= (to_string(i)[S[j] - 1] - '0') == C[j];
        if(ok) {
            cout << i << endl;
            return 0;
        }
    }
    cout << -1 << endl;
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
typedef int64_t LL;
#define rep(i,N) for(int i=0;i<(int)N;i++)
using namespace std;
int main()
{
  LL N,M,x,sum,tmp;
  priority_queue<LL> item;
  cin>>N>>M;
  rep(i,N){cin>>x;item.push(x);}
  rep(i,M)
  {
    tmp=item.top();
    item.pop();
    item.push(tmp/2);
    if(item.top()==0)break;
  }
  rep(i,N){sum+=item.top();item.pop();}
  cout<<sum<<endl;
}

Measured memory_bytes: 1400
#include <iostream>
#include <algorithm>
#include <string>
#include <math.h>
#include <bitset>
#include <vector>
#include <queue>
#include <map>
#include <set>

#define i64 int64_t
#define ff(ii,nn,mm) for(int ii=nn;ii<mm;ii++)
#define st(vvv) sort(vvv.begin(),vvv.end())
#define rvs(vvv) reverse(vvv.begin(),vvv.end())
int inf = 1000000007;
i64 giant = 4000000000000000000;

using namespace std;

//最大公約数
i64 gcd(i64 a, i64 b) {//a>bとすること
	i64 r = a % b;
	if (r == 0)return b;
	return gcd(b, r);
}

//最小公倍数
i64 lcm(i64 a, i64 b) {
	return a * b / gcd(a, b);
}


int main() {
	i64 a, b;
	cin >> a >> b;
	cout << lcm(a, b) << endl;
	return 0;
}

Measured memory_bytes: 256