akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;
#define M 1000000007
long long int power(int a,int b)
{
    if(b==0)
        return 1;
    long long int k=power(a,b/2);
    if(b%2==0)
        return ((k%M)*(k%M))%M;
    else
        return ((k%M)*(k%M)*(a%M))%M;
}
long long int fact(long long int n)
{
    if(n==1 || n==0)
        return 1;
    else
        return ((n%M)*(fact(n-1)%M))%M;

}
int div(int n)
{  int c=0;
    for(int i=1;i<sqrt(n);i++)
    {
        if(n%i==0)
        {
          c++;
        }
    }
    c=c*2;
    if(pow(sqrt(n),2)==(sqrt(n)*sqrt(n)))
        c++;
    return  c;
}

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
     #ifndef ONLINE_JUDGE
 
    freopen("input.txt","r",stdin);
    freopen("output.txt","w",stdout);
 
   #endif
   
   int m;
   cin>>m;
   set<string> s;
   char c;
   for(int i=1;i<=m;i++)
   {  


    string str;
    cin>>str;
    if(i!=1 && c!=str[0] )
    {
        cout<<"No";
        return 0;
    }
    s.insert(str);
    if(s.size()!=i)
    {
        cout<<"No";
        return 0;
    }

    c=str[str.length()-1];

   }
   cout<<"Yes";




 return 0;
}








Measured memory_bytes: 3656
n=int(input())
t=[0]*(n+1)
x=[0]*(n+1)
y=[0]*(n+1)
for i in range(n):
  t[i+1],x[i+1],y[i+1]=map(int,input().split())
  
  lim_t=t[i+1]-t[i]
  lim_x=x[i+1]-x[i]
  lim_y=y[i+1]-y[i]
  
  if abs(lim_x)+abs(lim_y)>lim_t or (lim_t-lim_x-lim_y)%2==1:
    print('No')
    exit()
    
print('Yes')

Measured memory_bytes: 17292
#include<iostream>
#include <cstdio>
#include<cstring>
#include <cstdlib>  
#include<cmath>   
#include <cctype>
#include<string>
#include<set>
#include <iomanip>
#include <map>
#include<algorithm>
#include <functional>
#include<vector>
#include<climits>
#include<stack>
#include<queue>
#include <deque>
#include <climits>
#include <typeinfo>
#include <utility> 
using namespace std;
using ll = long long;
double pi() { return 3.14; }
int sum(int a, int b) { return a + b; }
int mul(int a, int b) { return a * b; }
int main() {
	int K, N;
	cin >> N >> K;
	if (K == 1) { cout << 0 << endl; }
	else { cout << N - K << endl; }
	return 0;

}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n)for(int i=0;i<(n);i++)
#define ALL(a) (a).begin(), (a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define pb push_back
using ll = long long;
using P = pair<int, int>;

const int MAX = 110000;
int dp[MAX];

int rec(int n){
    if(n == 0) return 0;
    if(dp[n] != -1) return dp[n];
    int res = n;
    for(int pow6 = 1; pow6 <= n; pow6*=6) res = min(res, rec(n-pow6) + 1);
    for(int pow9 = 1; pow9 <= n; pow9*=9) res = min(res, rec(n-pow9) + 1);
    return dp[n] = res;
}

int main(){
    int n; cin >> n;
    memset(dp, -1, sizeof(dp));
    cout << rec(n) << endl;
}

Measured memory_bytes: 3840
#include <iostream>
#include <bits/stdc++.h>
#include <math.h>

using namespace std;

int main(){
    long long n,a,b;
    cin>>n>>a>>b;
    
    if((b-a)%2==0){
        cout<<(b-a)/2<<endl;
    }else{
        cout<<min(a-1,n-b)+1+(b-a-1)/2<<endl;
    }
    
    return 0;
}

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

int main() {
	int N ;
    cin >> N ;
    int S , H , J , I ;
    S = N / 1000;
    N = N % 1000 ;
    H = N / 100;
    N = N % 100;
    J = N / 10;
    N = N % 10;
    I = N / 1;
    if((S == H && H == J) || (H == J && J == I)){
    	cout << "Yes" << endl;
    }else{
    	cout << "No" << endl;
    }
}


Measured memory_bytes: 3540
import java.util.Scanner;

public class Main {
	int max = 0;
	int count = 0;
	void run() {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		String s = sc.next();
		for(int i = 0; i < n; i++) {
			char c = s.charAt(i);
			if(c == 'I') count++;
			else count--;
			if(count > max) {
				max = count;
			}
		}
		System.out.println(max);
		sc.close();
	}

	public static void main(String[] args) {
		new Main().run();
	}
}

Measured memory_bytes: 23124
#include <iostream>
#include <string.h>
#include <string>
#include <algorithm>
#include <cstdlib>
using namespace std;

int main() {
    char t[1000];
    char w[10];
    int i;
    int count;
    count = 0;
    cin >> w;
    while(cin >> t){
        if(t == "END_OF_TEXT"){
            break;
        }
        i = 0;
        while(t[i]){
            t[i] = tolower(t[i]);
            i++;
        }

        //if(strstr(t, w) != NULL){
        if(!strcmp(t, w)){
            count++;
        }
    }
    cout << count << endl;
	return 0;
}



Measured memory_bytes: 3068
#pragma GCC target ("avx2")
#pragma GCC optimize ("unroll-loops")
#pragma GCC optimize ("O3")
#include "bits/stdc++.h"
#include <unordered_set>
#include <unordered_map>
#include <random>
using namespace std;
typedef long long ll;
const ll MOD = 1'000'000'007LL; /*998'244'353LL;*/
#define pb push_back
#define mp make_pair
#define all(x) (x).begin(), (x).end()
#define rep(i, n) for(int (i)=0; (i)<(n); (i)++)
const int dx[4]={ 1,0,-1,0 };
const int dy[4]={ 0,1,0,-1 };

int N;
pair<ll, ll> v[100001];
ll ans[100000] ={};

signed main(){
    cin >> N;
    rep(i, N){
        cin >> v[i].first;
        v[i].second = i;
    }
    sort(v, v+N);
    reverse(v, v+N);
    v[N].first = 0;

    ll m = INT_MAX;
    rep(i, N){
        m = min(m, v[i].second);
        ans[m] += (v[i].first-v[i+1].first)*(i+1);
    }
    rep(i, N) cout << ans[i] << endl;
}

Measured memory_bytes: 5824
#include <bits/stdc++.h>
using namespace std;
template <typename T> void read(T &t) {
	t=0; char ch=getchar(); int f=1;
	while (ch<'0'||ch>'9') { if (ch=='-') f=-1; ch=getchar(); }
	do { (t*=10)+=ch-'0'; ch=getchar(); } while ('0'<=ch&&ch<='9'); t*=f;
}
typedef long long ll;
int n;
ll ans,a,b,c;
int main() {
	//freopen("1.txt","r",stdin);
	read(n);
	for (int i=1;i<=n;i++) {
		a=i,b=(n/i)*i,c=(b-a)/i+1;
		ans+=(a+b)*c/2;
	}
	printf("%lld\n",ans);
	return 0;
}
/*
  0. Enough array size? Enough array size? Enough array size? Interger overflow?
  
  1. Think TWICE, Code ONCE!
  Are there any counterexamples to your algo?
    
  2. Be careful about the BOUNDARIES!
  N=1? P=1? Something about 0?
    
  3. Do not make STUPID MISTAKES!
  Time complexity? Memory usage? Precision error?
*/

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

namespace AtCoder
{
    public class Program
    {
        public static void Main(string[] args)
        {
            new Program().Solve(new ConsoleInput(Console.In, ' '));
        }

        public void Solve(ConsoleInput cin)
        {
          var a = cin.ReadInt;
          var b = cin.ReadInt;
          WriteLine(a * b % 2 == 0 ? "Even" : "Odd");
        }
    }

    public class ConsoleInput
    {
        private readonly System.IO.TextReader _stream;
        private char _separator = ' ';
        private Queue<string> inputStream;
        public ConsoleInput(System.IO.TextReader stream, char separator = ' ')
        {
            this._separator = separator;
            this._stream = stream;
            inputStream = new Queue<string>();
        }
        public string Read
        {
            get
            {
                if (inputStream.Count != 0) return inputStream.Dequeue();
                string[] tmp = _stream.ReadLine().Split(_separator);
                for (int i = 0; i < tmp.Length; ++i)
                    inputStream.Enqueue(tmp[i]);
                return inputStream.Dequeue();
            }
        }
        public string ReadLine { get { return _stream.ReadLine(); }}
        public int ReadInt { get { return int.Parse(Read); }}
        public long ReadLong { get { return long.Parse(Read); }}
        public double ReadDouble { get { return double.Parse(Read); }}
        public string[] ReadStrArray(long N) { var ret = new string[N]; for (long i = 0; i < N; ++i) ret[i] = Read; return ret;}
        public int[] ReadIntArray(long N) { var ret = new int[N]; for (long i = 0; i < N; ++i) ret[i] = ReadInt; return ret;}
        public long[] ReadLongArray(long N) { var ret = new long[N]; for (long i = 0; i < N; ++i) ret[i] = ReadLong; return ret;}
    }
}

Measured memory_bytes: 27896
def solve():
    s = input()
    l = list(map(int,s))
    dp = [[0]*2 for _ in range(len(l)+10)]
    dp[0][1] = 1
    #dp[i][j] = i桁見た　ぎりぎりがどうか
    # １を立てるなら２通り，立てないなら1通り
    mod = 10**9+7
    for i in range(len(l)):
        if l[i]==1:
            dp[i+1][1]+=dp[i][1]*2
            dp[i+1][0]+=dp[i][0]*2
            dp[i+1][0]+=dp[i][1]
            dp[i+1][0]+=dp[i][0]
            dp[i+1][0]%=mod
            dp[i+1][1]%=mod
        else:
            dp[i+1][1]+=dp[i][1]
            dp[i+1][0]+=dp[i][0]*2
            dp[i+1][0]+=dp[i][0]
            dp[i+1][0]%=mod
    print((dp[len(l)][0]+dp[len(l)][1])%mod)
if __name__ == "__main__":
    solve()

Measured memory_bytes: 56924
#include <bits/stdc++.h>
#include <iostream>
#include <string>
#include <math.h>
#include <vector>
#include <signal.h> 
#include <locale> 
#include <algorithm>

#define fo(i,n) for(long long int i=0;i<n;i++)
#define fo1(i, n) for (long long int i = 1; i <= (long long int)(n); i++)
#define pb push_back
#define fill_vector(n,v) for(long long int i=0;i<n;i++){long long int temp;cin>>temp;v.push_back(temp); }
#define print_vector(n,v) for(long long int i=0;i<n;i++){cout<<v[i]<<"\n"; } 
#define sortv(v) sort(v.begin(), v.end())
#define sortvo(v) sort(v.begin(), v.end(),greater<long long int>())
#define f(i,l,r) for(ll i=l;i<=r;i++)
#define rf(i,r,l) for(ll i=r;i>=l;i--)
#define fast ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define vi vector< int>
#define vs vector<string>
#define y() cout<<"YES"<<"\n"
#define n() cout<<"NO"<<"\n"
#define logbase(x,y) {log10(y)/log10(x)}

typedef int long long ll;
using namespace std;

int main()
{
	ll t=1;
	//cin>>t;
	while(t--)
	{
		ll n;
		cin>>n;
		vi v;
		fill_vector(n,v);
		ll max=-1,count=0;
		fo(i,n)
		{
			if(max<v[i])
			{max=v[i];}
			else
			{
				count+=max-v[i];}			
	}
	cout<<count;
}
	return 0;
}


Measured memory_bytes: 4236
#include <iostream>
#include <algorithm>
#include <cstring>
#include <cstdio>
#include <vector>
#include <queue>
#include <stack> 
#include <set>
#include <map>
using namespace std;

#define N 100020
const int INF = 1 << 30;

int a[N];

int main()
{
	//freopen("in.in", "r", stdin);
	//freopen("out.out", "w", stdout);
     
    int H, W, h, w;
    cin >> H >> W >> h >> w;

    if (H % h == 0 && W % w == 0) puts("No");
    else
    {
    	puts("Yes");
    	if (H % h)
    	{
    		for (int i = 0; i < H; ++i)
    		{
    			for (int j = 0; j < W; ++j)
    			{
    				printf("%d%c", i % h? -1000:1000 * (h - 1) - 1, j == W - 1? '\n':' ');
    			}
    		}
    	}
    	else
    	{
    		for (int i = 0; i < H; ++i)
    		{
    			for (int j = 0; j < W; ++j)
    			{
    				printf("%d%c", j % w? -1000:1000 * (w - 1) - 1, j == W - 1? '\n':' ');
    			}
    		}
    	}
    }
	return 0;
}


Measured memory_bytes: 1792
a,b,k = map(int, input().split())
for i in range(k):
    if i % 2 == 0: 
        if a % 2 == 0:
            a //= 2
            b += a
        else:
            a -= 1
            a //= 2
            b += a
    else:
        if b % 2 == 0:
            b //= 2
            a += b
        else:
            b -= 1
            b //= 2
            a += b
print(a,b)

Measured memory_bytes: 3064
#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <sstream>
#include <cstdio>
#include <complex>
using namespace std;

int main() {
  int N , W;
  cin >> N >> W;
  vector<vector<int> > vs(N+1, vector<int>(W+1, -1));
  vs[0][0] = 0;
  for (int i = 1; i <= N; i++) {
    int v, w;
    cin >> v >> w;
    for (int j = 0; j <= W; j++) {
      vs[i][j] = max(vs[i-1][j], vs[i][j]);
      if (w + j > W || vs[i-1][j] < 0) continue;
      vs[i][j + w] = max(vs[i][j + w], vs[i-1][j] + v);
    }
  }
  int res = 0;

  for (int i = 0; i <= W; i++) {
    res = max(res, vs[N][i]);
  }
  cout << res << endl;
}

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

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

map<string, int> f(string s, int& i) {
	map<string, int> m;
	for (;;) {
		map<string, int> _m;
		if (s[i] == '(') {
			i++;
			_m = f(s, i);
		}
		else {
			string t;
			t.push_back(s[i]);
			i++;
			if ('a'<=s[i] && s[i]<='z') {
				t.push_back(s[i]);
				i++;
			}
			_m[t] = 1;
		}
		int z = 0;
		for (; '0'<=s[i] && s[i]<='9'; i++)
			z = z * 10 + (s[i] - '0');
		if (z == 0) z = 1;
		for (auto x: _m) m[x.first] += z * x.second;
		if (s[i] == ')') break;
	}
	i++;
	return m;
}

int main() {
	for (;;) {
		string s; cin >> s;
		if (s == ".") break;
		vector<map<string, int> > vm;
		int l = 0, sign = 1;
		for (;;) {
			int r;
			for (r = l; s[r] != '+' && s[r] != '-' && s[r] != '.'; r++);
			int i = 0;
			map<string, int> m = f(s.substr(l, r - l) + ")", i);
			for (auto& x: m) x.second *= sign;
			vm.push_back(m);
			if (s[r] == '+') l = r + 1;
			if (s[r] == '-') {
				l = r + 2;
				sign = -1;
			}
			if (s[r] == '.') break;
		}
		int M = vm.size();
		vector<string> v;
		for (auto m: vm)
			for (auto x: m)
				v.push_back(x.first);
		sort(v.begin(), v.end());
		v.erase(unique(v.begin(), v.end()), v.end());
		int N = v.size();
		vector<vector<ll> > a(N, vector<ll>(M));
		for (int j = 0; j < M; j++)
			for (auto x: vm[j]) {
				int i = lower_bound(v.begin(), v.end(), x.first) - v.begin();
				a[i][j] = x.second;
			}
		int i = 0;
		for (int j = 0; j < M; j++) {
			int k;
			for (k = i; k < N && a[k][j] == 0; k++);
			if (k == N) continue;
			swap(a[i], a[k]);
			for (int k = i + 1; k < N; k++) {
				ll d = gcd(a[i][j], a[k][j]);
				ll x = a[i][j] / d, y = a[k][j] / d;
				for (int _j = j; _j < M; _j++)
					a[k][_j] = x * a[k][_j] - y * a[i][_j];
				d = 0;
				for (int _j = j; _j < M; _j++)
					d = gcd(d, a[k][_j]);
				if (d == 0) continue;
				for (int _j = j; _j < M; _j++)
					a[k][_j] /= d;
			}
			i++;
		}
		vector<int> x(M);
		for (x[M - 1] = 1; ; x[M - 1]++) {
			bool ok = true;
			int i;
			for (i = M - 2; i >= 0; i--) {
				ll sum = 0;
				for (int j = M - 1; j > i; j--)
					sum += a[i][j] * x[j];
				if (sum % a[i][i]) break;
				x[i] = -sum / a[i][i];
				if (x[i] <= 0) break;
			}
			if (i == -1) break;
		}
		for (int j = 0; j < M; j++)
			cout << x[j] << (j + 1 < M ? ' ' : '\n');
	}
}

Measured memory_bytes: 3016
import math
#import numpy as np
import queue
from collections import deque,defaultdict
import heapq as hpq
import time
from sys import stdin,setrecursionlimit
#from scipy.sparse.csgraph import dijkstra
#from scipy.sparse import csr_matrix
ipt = stdin.readline
setrecursionlimit(10**7)

def main():
    n = int(ipt())
#    n = 500
    cos = [[min(i,j,n-1-i,n-1-j) for i in range(n)] for j in range(n)]
#    p = [(i//n,i%n) for i in range(n**2)]
    p = [((int(i)-1)//n,(int(i)-1)%n) for i in ipt().split()]
    ans = 0
    q = []
    al = [[True]*n for i in range(n)]

    for px,py in p:
        ans += cos[px][py]
        q.append((px,py,cos[px][py]))
        al[px][py] = False
        while q:
            qx,qy,qc = q.pop()
            if qx != 0 and cos[qx-1][qy] > qc:
                cos[qx-1][qy] = qc
                q.append((qx-1,qy,qc+al[qx-1][qy]))
            if qx != n-1 and cos[qx+1][qy] > qc:
                cos[qx+1][qy] = qc
                q.append((qx+1,qy,qc+al[qx+1][qy]))
            if qy != 0 and cos[qx][qy-1] > qc:
                cos[qx][qy-1] = qc
                q.append((qx,qy-1,qc+al[qx][qy-1]))
            if qy != n-1 and cos[qx][qy+1] > qc:
                cos[qx][qy+1] = qc
                q.append((qx,qy+1,qc+al[qx][qy+1]))

    print(ans)

    return

if __name__ == '__main__':
    main()


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

using namespace std;

typedef long long lli;

const int N = 100000 + 10;

int a[N], cnt[N];

int main()
{
	lli sum;
	int n, q, b, c, i;
	cin>>n;
	sum = 0;
	for (i=0; i<n; i++)
	{
		cin>>a[i];
		cnt[a[i]] ++;
		sum += a[i];
	}
	cin>>q;
	while (q --)
	{
		cin>>b>>c;
		sum -= 1LL * b * cnt[b];
		sum += 1LL * c * cnt[b];
		cout<<sum<<endl;
		cnt[c] += cnt[b];
		cnt[b] = 0;
	}
	return 0;
}

Measured memory_bytes: 4304
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define tcase int _; cin >> _; while(_--)
const int MAX = 1e6;

string a, b;

void solve() {
	cin >> a >> b;
	int n = (int)a.size();
	int ans = 0;
	for(int i=0; i<n; i++) if(a[i] != b[i]) ans++;
	cout << ans << "\n";

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

 	solve();

  	return 0;
}



Measured memory_bytes: 3812
s=input()
t=input()

ans = "Yes"
_dict = {}

for i in range(len(s)):
    if s[i] not in _dict:
        _dict[s[i]]=t[i]
    elif s[i] in _dict:
        if t[i] != _dict[s[i]]:
            ans="No"
            break

_dict = {}
for i in range(len(s)):
    if t[i] not in _dict:
        _dict[t[i]]=s[i]
    elif t[i] in _dict:
        if s[i] != _dict[t[i]]:
            ans="No"
            break
print(ans)

Measured memory_bytes: 3632
#include <bits/stdc++.h>
using namespace std;
int main() {
    int n, l;
    cin >> n >> l;
    int aji=0, taberu=500;
    for (int i = 0; i < n; i++)
    {
        aji += l + i;
        if(abs(taberu) > abs(l+i))
        taberu = l + i;
    }
    aji -= taberu;
    cout << aji << endl;
}

Measured memory_bytes: 256
H, W = map(int, input().split())
N = int(input())
a = input().split()
a_i = [int(s) for s in a]
result = [[0] * W for i in range(H)]
count = 0
#奇数行目は逆からいれていけば解決!
for i in range(H):
    if(i % 2 == 0):
        #偶数行目は普通にいれていく
        for j in range(W):
            if(a_i[count] > 1):
                result[i][j] = count + 1
                a_i[count] -= 1
            elif(a_i[count] == 1):
                result[i][j] = count + 1
                count += 1
                
    if(i % 2 != 0):
        #奇数行目は逆から入れていく
        for j in range(W-1, -1, -1):
            if(a_i[count] > 1):
                result[i][j] = count + 1
                a_i[count] -= 1
            elif(a_i[count] == 1):
                result[i][j] = count + 1
                count += 1

                
print("\n".join([" ".join(map(str, l)) for l in result]))

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

int main(){
  int n,temp,a[100]={},cont=0,result=0;
  cin>>n;
  for(int i=0; i<n; i++){
    cin>>a[i];
    if(a[i] == a[i-1]){
      cont++;
      if(cont%2 == 0){
	result++;
      }
    }else{
      cont=1;
    }
  }
  cout<<result<<endl;
  
}


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

#define _overload3(_1,_2,_3,name,...) name
#define _rep(i,n) repi(i,0,n)
#define repi(i,a,b) for(int i=(int)a, i##_len=(b); i<i##_len; i++)
#define rep(...) _overload3(__VA_ARGS__,repi,_rep,)(__VA_ARGS__)

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

using namespace std;

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

const long long INF = LLONG_MAX/3;

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; }
inline void Yes (bool condition) { if(condition) { cout << "Yes" << endl; } else { cout << "No" << endl;} }

struct UnionFind{
	std::vector<int> par,siz;
	void init(int n){
		par.resize(n);
		for(int i=0;i<n;i++)par[i]=i;
		siz.resize(n,1);
	}
	UnionFind(int n){
		init(n);
	}
	int root(int n){
		if(par[n]==n)return n;
		else return par[n]=root(par[n]);
	}
	bool issame(int x,int y){
		return (root(x)==root(y));
	}
	bool marge(int a,int b){
		if(issame(a,b))return false;
		else{
			a=root(a),b=root(b);
			if(siz[a]<siz[b])swap(a,b);
			siz[b]+=siz[a];
			par[a]=par[b];
			return true;
		}
	}
	int size(int n){
		return siz[root(n)];
	}
};

long long gcd(long long a,long long b){
    if(b==0)return a;
    return gcd(b,a%b);
}
long long lcm(long long i,long long j){
    return i*(j/gcd(i,j));
}

const int MOD=998244353;
long long fac[510000], finv[510000], inv[510000];
long long MAX=510000;
bool COMinited=false;
long long COM(int n, int k){
	if(COMinited==false){
		fac[0] = fac[1] = 1;
    	finv[0] = finv[1] = 1;
    	inv[1] = 1;
    	for (int i = 2; i < MAX; i++){
        	fac[i] = fac[i - 1] * i % MOD;
        	inv[i] = MOD - inv[MOD%i] * (MOD / i) % MOD;
        	finv[i] = finv[i - 1] * inv[i] % MOD;
    	}
		COMinited=true;
	}
    if (n < k) return 0;
    if (n < 0 || k < 0) return 0;
    return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}
long long modpow(long long a, long long n, long long mod) {
    long long res = 1;
    while (n > 0) {
        if (n & 1) res = res * a % mod;
        a = a * a % mod;
        n >>= 1;
    }
    return res;
}
long long modinv(long long a, long long mod) {
    return modpow(a, mod - 2, mod);
}
template< typename T >
struct BinaryIndexedTree {
  vector< T > data;

  BinaryIndexedTree(int sz) {
    data.assign(++sz, 0);
  }

  T sum(int k) {
    T ret = 0;
    for(++k; k > 0; k -= k & -k) ret += data[k];
    return (ret);
  }

  void add(int k, T x) {
    for(++k; k < data.size(); k += k & -k) data[k] += x;
  }
};

signed main(){
	int n,l;
	cin>>n>>l;
	int a[100010];
	rep(i,n)cin>>a[i];
	int m=-1;
	rep(i,1,n){
		if(a[i]+a[i-1]>=l){
			m=i;
			break;
		}
	}
	if(m==-1){
		puts("Impossible");
	}else{
		puts("Possible");
		rep(i,1,m)cout<<i<<endl;
		for(int i=n-1;i>=m+1;i--)cout<<i<<endl;
		cout<<m<<endl;
	}
}


Measured memory_bytes: 1536
#include "bits/stdc++.h"
#define ll unsigned long long
#define PI 3.1415926535897932384626433832795l
#define MAX_NUM 1000000000
#define line printf("-----------------\n");
using namespace std;
int SET(int N, int pos) { return N = N | (1 << pos); }
int RESET(int N, int pos) { return N = N & ~(1 << pos); }
bool CHECK(int N, int pos) { return (bool)(N & (1 << pos)); }
template <typename T>
inline T __lcm(T a, T b)
{
    return (a * b) / __gcd(a, b);
}
struct node
{
    ll x, y, cnt;
};
int dx[] = {0, 1, 0, -1, -1, 1, -1, 1};
int dy[] = {1, 0, -1, 0, 1, 1, -1, -1};

ll a[1000000];

void solve()
{
    ll n;
    cin>>n;
    ll flag=1;
    for(ll i=0;i<n;i++)
    {
        cin>>a[i];
        if(a[i]==0)
        {
            flag=0;
        }
    }
    if(flag)
    {
        ll flag2=1;
        ll sum=1;
        for(ll i=0;i<n;i++)
        {
            double temp1 = sqrt(sum*1.0);
            double temp2 = sqrt(a[i]*1.0);
            double temp = temp1*temp2;
            if(temp>1000000007)
            {
                flag2=0;
                break;
            }
            else
            {
                sum*=a[i];
            }
        }
        if(sum>1000000000000000000)
        {
            flag2=0;
        }
        if(flag2)
        {
            cout<<sum<<endl;
        }
        else
        {
            cout<<-1<<endl;
        }
        
    }
    else
    {
        cout<<0<<endl;
    }
    

}

int main()
{
#ifndef ONLINE_JUDGE
    freopen("inputf.txt", "r", stdin);
    freopen("outputf.txt", "w", stdout);
#endif // ONLINE_JUDGE
    //ios_base::sync_with_stdio(false);
    //cin.tie(NULL);
    //cout.tie(NULL);

    solve();
    return 0;
}

Measured memory_bytes: 4432
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define sqr(x) ((x)*(x))
#define mp make_pair
#define uint unsigned
inline char gc(){
    static char buf[100000],*p1=buf,*p2=buf;
    return p1==p2&&(p2=(p1=buf)+fread(buf,1,100000,stdin),p1==p2)?EOF:*p1++;
}
#define gc getchar
inline int read(){
	int x = 0; char ch = gc(); bool positive = 1;
	for (; !isdigit(ch); ch = gc())	if (ch == '-')	positive = 0;
	for (; isdigit(ch); ch = gc())	x = x * 10 + ch - '0';
	return positive ? x : -x;
}
inline void write(int a){
    if(a>=10)write(a/10);
    putchar('0'+a%10);
}
inline void writeln(int a){
    if(a<0){
    	a=-a; putchar('-');
	}
	write(a); puts("");
}
const int mod=1000000007,N=1500;
int n,k,ans,q[N],tot,M[N];
inline int ksm(ll a,int b){
	int ans=1;
	for(;b;b>>=1){
		if(b&1)ans=ans*a%mod;
		a=a*a%mod;
	}
	return ans;
}
inline ll chu(int x){
	return (x&1)?1:((mod+1)>>1);
}
int solve(int x){
	if(M[x]!=-1)return M[x];
	int ans=ksm(k,(q[x]+1)/2);
	for(int i=1;i<x;i++)if(q[x]%q[i]==0)ans=(ans-solve(i))%mod;
	ans=(ans+mod)%mod;
	return M[x]=ans;
}
int main(){
	n=read(); k=read(); memset(M,-1,sizeof(M));
	for(int i=1;i*i<=n;i++)if(n%i==0){
		q[++tot]=i; if(i*i!=n)q[++tot]=n/i; 
	}
	sort(&q[1],&q[tot+1]);
	for(int i=1;i<=tot;i++){
		M[i]=ksm(k,(q[i]+1)/2);
		for(int j=1;j<i;j++)if(q[i]%q[j]==0)M[i]=(M[i]-M[j])%mod;
	}
	for(int i=1;i<=tot;i++)ans=(ans+solve(i)*chu(q[i])%mod*q[i])%mod;
	cout<<(ans+mod)%mod<<endl;
}

Measured memory_bytes: 256
import java.util.Scanner;

public class Main {
    public static void main(String... args){
        Scanner scan = new Scanner(System.in);
        String s = scan.nextLine();
        String s2;
        for(int i = 0;i < s.length();i++){
            s2 = s.substring(i, i+1);
            if(s2.equals(s2.toUpperCase()))System.out.print(s2.toLowerCase());
            else System.out.print(s2.toUpperCase());
        }
        System.out.println();

        scan.close();
    }

    

}


Measured memory_bytes: 26684
#include "bits/stdc++.h"

using namespace std;

using ll = long long;
using ld = long double;

const int INF = (1 << 30) - 1;
const ll INF64 = ((ll)1 << 62) - 1;
const double PI = 3.1415926535897932384626433832795;

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

bool solve(int n, int m, const vector<int>& l, vector<int>& r, vector<int>& d) {
	vector<vector<pair<int, int>>> graph(n);
	for (int i = 0; i < m; i++) {
		graph[l[i]].emplace_back(r[i], d[i]);
		graph[r[i]].emplace_back(l[i], -d[i]);
	}

	vector<bool> used(n);
	vector<int> dist(n);
	for (int i = 0; i < n; i++) {
		if (used[i]) {
			continue;
		}

		queue<int> que;
		que.push(i);
		used[i] = true;
		dist[i] = 0;
		while (!que.empty()) {
			int now = que.front(); que.pop();
			for (auto e : graph[now]) {
				int next = e.first;
				int cost = e.second;

				if (used[next] && dist[now] + cost != dist[next]) {
					return false;
				} else if (!used[next]) {
					used[next] = true;
					dist[next] = dist[now] + cost;
					que.push(next);
				}
			}
		}
	}

	return true;
}

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

	int n, m;
	cin >> n >> m;
	vector<int> l(m), r(m), d(m);

	for (int i = 0; i < m; i++) {
		cin >> l[i] >> r[i] >> d[i];
		l[i]--; r[i]--;
	}

	cout << (solve(n, m, l, r, d) ? "Yes" : "No") << endl;
	return 0;
}


Measured memory_bytes: 11776
#include<iostream>
using namespace std;
int main(void)
{
	int a,b,c,coin=0,cnt=0;
	cin>>a>>b>>c;
	while(1){
		if(c<=coin) break;
		cnt+=1;
		coin+=a;
		if(cnt%7==0) coin+=b;
	}
	cout<<cnt<<endl;
	return 0;
}


Measured memory_bytes: 3072
a,b,c,x,y=map(int,input().split())
if a+b>2*c and x>=y:
    if a<2*c:
        print(2*c*y+a*(x-y))
    else:
        print(2*c*x)
elif a+b>2*c and x<y:
    if b<2*c:
        print(2*c*x+b*(y-x))
    else:
        print(2*c*y)
else:
    print(a*x+b*y)

Measured memory_bytes: 3064
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		int n = sc.nextInt();
	long a[]=new long[n];
for(int i=0;i<=n-1;i++){
	a[i]=sc.nextLong();
}
System.out.println(haimax(a)-haimin(a));
	}public static int haimax(int a[]) {
		int d;
		d = a[0];
		for (int i = 0; i <= a.length - 1; i++) {
			if (d <= a[i]) {
				d = a[i];
			}

		}
		return d;
	}
	public static long haimax(long a[]) {
		long d;
		d = a[0];
		for (int i = 0; i <= a.length - 1; i++) {
			if (d <= a[i]) {
				d = a[i];
			}

		}
		return d;
	}

public static long haimin(long a[]) {
		long d;
		d = a[0];
		for (int i = 0; i <= a.length - 1; i++) {
			if (d >= a[i]) {
				d = a[i];
			}

		}
		return d;
	}
}

Measured memory_bytes: 21844
#include <bits/stdc++.h>
#include <vector>
#include <iostream>
#include <map>
#include <cmath>
#include <string>
#include <math.h>
using namespace std;

#define rep(i, o) for (int i = 0; i < (o); ++i)
#define REP(i,a,b)for(int i=(int)(a);(i)<=(int)(b);i++)
#define NUM 20

typedef long long ll;


ll gcd(ll a, ll b) { return b ? gcd(b, a%b) : a; }
ll lcm(ll c, ll d) { return c / gcd(c, d) * d; }

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

  int fact = 1;
  vector<int> perm(n);
  for (int i = n; i > 0; i--)
  {
      perm[i-1] = i;
      fact *= i;
  }

  double x_y[n][2] = {0};
  rep(i, n) cin >> x_y[i][0] >> x_y[i][1];

  double total_len = 0;
  do 
  {
      int count = 0; 
      for (int i = 0; i < n-1; i++)
      {
          /* code */
          total_len += sqrt((x_y[perm[i]-1][0]-x_y[perm[i+1]-1][0]) * (x_y[perm[i]-1][0]-x_y[perm[i+1]-1][0]) + 
                            (x_y[perm[i]-1][1]-x_y[perm[i+1]-1][1])*(x_y[perm[i]-1][1]-x_y[perm[i+1]-1][1]));
        //   cout << setprecision(NUM) << total_len << endl;
      }
  } while (next_permutation(perm.begin(), perm.end()));
  double ans = total_len/fact;
  cout << setprecision(NUM) << ans << endl;
  return 0;
}

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

using namespace std;

int main(){
	long N;
	long long A[200000] = {0};
	long long sum = 0;
	long long tmp = 0; // 現在の最高身長
	cin >> N;

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

	for (int i = 0; i < N; i++) {
		if(tmp > A[i]) {
			sum += tmp - A[i];
			A[i] = tmp;
		}
		else if(tmp < A[i]) {
			tmp = A[i];
		}
		// cout << "A[" << i << "]の踏み台は" << tmp - A[i] << "\n";		
	}

	cout << sum << "\n";
	return 0;
}

Measured memory_bytes: 5128
#include <stdio.h>
#include <inttypes.h>

int l, k;

uint64_t kugyu[128];

uint64_t mizuhasu(int left) {
	uint64_t hocchann = 1;
	if (left < 0) return 0;
	if (kugyu[left]) return ~kugyu[left];

	hocchann += mizuhasu(left - 1 - 1);
	hocchann += mizuhasu(left - 1 - k);

	return ~(kugyu[left] = ~hocchann);
}

int main(void) {
	if (scanf("%d%d", &l, &k) != 2) return 1;
	printf("%" PRIu64 "\n", mizuhasu(l - 1) + mizuhasu(l - k));
	return 0;
}



Measured memory_bytes: 2112
#include<stdio.h>


int main(void){
	
	int r,g,b,n;
	int i,j,k;
	int Rn,Gn;
	int count;
	
	scanf("%d %d %d %d",&r,&g,&b,&n);

	count = 0;

	for(i=0;i*r<= n;i++){
		Rn = i * r;
		for(j=0;j*g+Rn <= n;j++){
			Gn = j * g;
			if((n - (Gn + Rn)) % b == 0){
				count++;
//				printf("%d : %d %d %d\n",count,i,j,(n - (Gn + Rn)) / b);
			}
		}
	}

	printf("%d\n",count);


	return 0;
}

Measured memory_bytes: 128
#include<bits/stdc++.h>
using namespace std;
#define rep(i,j,n) for(int i=(int)(j);i<(int)(n);i++)
#define REP(i,j,n) for(int i=(int)(j);i<=(int)(n);i++)
#define MOD 1000000007
#define int long long
#define ALL(a) (a).begin(),(a).end()
#define vi vector<int>
#define vii vector<vi>
#define pii pair<int,int>
#define priq priority_queue<int>
#define disup(A,key) distance(A.begin(),upper_bound(ALL(A),(int)(key)))
#define dislow(A,key) distance(A.begin(),lower_bound(ALL(A),(int)(key)))
#define tii tuple<int,int,int>
#define Priq priority_queue<int,vi,greater<int>>
#define pb push_back
#define mp make_pair
#define INF (1ll<<60)
signed main(){
  int N; cin>>N;
  vi B(N+1,INF);
  REP(i,1,N) cin>>B[i];
  int ans=0;
  REP(i,1,N){
    ans+=min(B[i-1],B[i]);
  }
  cout<<ans<<endl;
  }



Measured memory_bytes: 256
#include<iostream>
#include<string>
using namespace std;
int main()
{
    long long a,b,k;
    cin>>a>>b>>k;
    if(a>=k)a-=k;
    else
    {
        k-=a;
        a=0;
        b-=k;
        if(b<0)b=0;
    }
    cout<<a<<" "<<b<<endl;
}

Measured memory_bytes: 256
import queue
N,M=map(int,input().split())
G=[[1 for i in range(N)] for i in range(N)]
H=[[] for i in range(N)]
for i in range(N):
    G[i][i]-=1
for i in range(M):
    a,b=map(int,input().split())
    G[a-1][b-1]-=1
    G[b-1][a-1]-=1
for i in range(N):
    for j in range(N):
        if G[i][j]==1:
            H[i].append(j)
A=[[[],[]]]
k=0
q=queue.Queue()
reached=[0 for i in range(N)]
dist=[-1 for i in range(N)]
for i in range(N):
    if reached[i]==1:
        continue
    q.put(i)
    reached[i]=1
    dist[i]=0
    while(not(q.empty())):
        r=q.get()
        A[k][dist[r]].append(r)
        for p in H[r]:
            if reached[p]==0:
                q.put(p)
                dist[p]=(dist[r]+1)%2
                reached[p]=1
    k+=1
    A.append([[],[]])
for i in range(k):
    for j in range(2):
        for x in A[i][j]:
            for y in A[i][j]:
                if x==y:
                    continue
                if G[x][y]==1:
                    print(-1)
                    exit()
B=[]
for i in range(k):
    B.append((len(A[i][0]),len(A[i][1])))
dp=[[0 for i in range(N+1)] for i in range(k+1)]
dp[0][0]=1
for i in range(1,k+1):
    for j in range(N+1):
        if dp[i-1][j]==0:
            continue
        dp[i][j+B[i-1][0]]=1
        dp[i][j+B[i-1][1]]=1
delta=N
for i in range(N+1):
    if dp[k][i]==1:
        tmp=abs(N-2*i)
        if tmp<delta:
            delta=tmp
X=(N+delta)//2
Y=(N-delta)//2
print((X*(X-1)+Y*(Y-1))//2)


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

long long ans;

void calc(long long a, long long b) {
	if (a % b == 0) {
      ans += (a * 2) - b;
      return;
    }
  ans += (a / b) * b * 2;
  calc(b, a % b);
}

int main() {
  long long n, x;
  cin >> n >> x;
  ans = n;
  if (x < n - x)
    x = n - x;
  calc(x, n - x);
  	cout << ans;
 	return 0; 
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define int long long
#define rep(i,n) for(int i=0;i<n;i++)
#define Rep(i,a,b) for(int i=a;i<b;i++)
#define REP(i,a,b) for(int i=a;i<=b;i++)
#define rev(i,n) for(int i=n-1;i>=0;i--)
#define vi vector<int>
#define pb push_back
#define pi pair<int,int>
#define vp vector<pair<int,int> >
#define mp make_pair
#define all(v) (v).begin(),(v).end()
#define fi first
#define se second

using namespace std;

signed main(){
    int n,k;
    cin>>n>>k;
    if(k==1)cout<<0<<endl;
    else cout<<!!(n%k)<<endl;
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <functional>
#include <string>
#include <vector>
#include <iostream>
using namespace std;

#define REP(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)
typedef long long ll;
typedef vector<long long> vll, vLL;

bool check(const string& s,const string& t){
	int n = s.size();
	int m = t.size();
	for(int i=0;i<=n-m;i++){
		bool ok = true;
		REP(j,m){
			if(s[i+j]!='?' && s[i+j]!=t[j])ok=false;
		}
		if(ok)return true;
	}
	return false;
}
int main() {
	cin.tie(0);
	ios::sync_with_stdio(false);

	string s;
	int ans=0;
	cin >> s;

	for(int i=1;i<s.size();i++){
		if(s[i]!=s[i-1])ans++;
	}
	cout << ans << endl;

	return 0;
}


Measured memory_bytes: 1144
import sys
import math

input = sys.stdin.readline

N, K = map(int, input().split())
ans = 0
for i in range(1, N+1):
    if i >= K:
        ans += 1 / N
    else:
        ans += 1/(N*2**math.ceil(math.log2(K/i)))
print(ans)

Measured memory_bytes: 3060
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int startTime =sc.nextInt()+sc.nextInt();
		if(startTime > 23) {
			System.out.println(startTime -24);
		}else {
			System.out.println(startTime);
		}

	}
}



Measured memory_bytes: 21972
import sys
def f(x):
    return x[1:],x[0]
a=input()
b=input()
c=input()
y='a'
while 1:
    if y=='a':
        if a=='':
            print('A')
            sys.exit()
        else:
            a,y=f(a)
    if y=='b':
        if b=='':
            print('B')
            sys.exit()
        else:
            b,y=f(b)
    if y=='c':
        if c=='':
            print('C')
            sys.exit()
        else:
            c,y=f(c)

Measured memory_bytes: 3064
//i ll be the king
#include<bits/stdc++.h>
#define ll long long int
#define ld long double
#define sync ios_base::sync_with_stdio(false); cin.tie(NULL) 
#define input(arr,n) for(ll i1=0;i1<n;i1++ )cin>>arr[i1]
#define rep(n) for(ll i2=0;i2<n;i2++)
#define vmp(v,a,b) v.push_back(make_pair(a,b))
#define si(a) scanf("%lld",&a)
#define pi(a) printf("%lld",a)
#define aset(a,n,k) for(ll i3=0;i3<n;i3++)a[i3]=k; 	
#define mod 1000000007
#define mp(a,b) make_pair(a,b)
#define f first
#define s second 
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
#define ordered_set tree<ll, null_type,greater_equal<ll>, rb_tree_tag,tree_order_statistics_node_update>//s.order_of_key(val) *s.find_by_orde(ind)
using namespace std;
int main()
{
	sync;
	ll a,b,c;
	cin>>a>>b>>c;
	cout<<a+b+c-max(a,max(b,c));
}
	
	


Measured memory_bytes: 256
#include<bits/stdc++.h>
#define rep(i,f,n) for(ll i=(f); (i) < (n); i++)
#define repe(i,f,n) for(ll i=(f); (i) <= (n); i++)
using namespace std;
using ll = long long;
#define MOD (ll)1000000007
#define PI 3.14159265359
#define P pair<ll, ll>
//printf("%.10f\n")
//cout << fixed << setprecision(10);
template<class T> inline bool chmax(T& a, T b){if (a < b) { a = b; return true; } return false;}
template<class T> inline bool chmin(T& a, T b){if (a > b) { a = b; return true; } return false;}
ll INF = 1e+18;
int iINF = 1e9;

int
main()
{
  double a, b, x; cin >> a >> b >> x;
  double s = x / a;
  bool flag = s >= (a * b) / 2;

  auto area = [&](double th, bool flag){
      double dgree = th * PI / 180.0;
    if(flag){
      return (a * b) - (a *(a * tan(dgree))/2) >= s;
    } else {
      return b * (b /tan(dgree)) / 2 >= s;
    }
  };

  double ok = 0;
  double ng = 91;
  while(ng - ok > 0.0000001){
    double th = (ok + ng) / 2;
    if(area(th, flag)) ok = th;
    else ng = th;
  }

  printf("%.10f\n", ok);

  return 0;
}


Measured memory_bytes: 4252
import java.util.Scanner;

//Alphametic
public class Main{

	static char[] s;
	static int id;
	
	static boolean exp(){
		int a = fact();
		if(a==-1)return false;
		while(true){
			char c = s[id++];
			if(c=='=')break;
			int x = fact();
			if(x==-1)return false;
			a+=x;
		}
		int b = fact();
		if(b==-1)return false;
		return a==b;
	}
	
	static int fact(){
		int x = s[id++]-'0';
		if(x==0&&Character.isDigit(s[id]))return -1;
		while(Character.isDigit(s[id])){
			x *= 10;
			x += s[id++]-'0';
		}
		return x;
	}
	
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		while(sc.hasNext()){
			String r = sc.next();
			String ans = "NA";
			for(int i=0;i<10;i++){
				s = (r.replace("X", (char)(i+'0')+"")+"$").toCharArray();
				id = 0;
				if(exp()){
					ans = i+"";
					break;
				}
			}
			System.out.println(ans);
		}
	}
}

Measured memory_bytes: 0
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.HashMap;
import java.util.Map;
import java.util.Scanner;
import java.util.TreeSet;


public class Main {
	
	public static void main(String[] args) throws IOException{
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		Map<Integer,Integer> cur_map = new HashMap<Integer,Integer>();
		Map<Integer,Integer> pre_map = new HashMap<Integer,Integer>();
		String str;
		
		while((str = br.readLine()) != null && !(str.equals(""))){
			int com = Integer.parseInt(str.substring(0,str.indexOf(",")));
			if(cur_map.get(com) == null){
				cur_map.put(com, 1);
			}else{
				cur_map.put(com, cur_map.get(com)+1);
			}
		}
		
		while((str = br.readLine()) != null && !(str.equals(""))){
			int com = Integer.parseInt(str.substring(0,str.indexOf(",")));
			if(pre_map.get(com) == null){
				pre_map.put(com, 1);
			}else{
				pre_map.put(com, pre_map.get(com)+1);
			}
		}
		
		for(int c_com:new TreeSet<Integer>(cur_map.keySet())){
			if(pre_map.containsKey(c_com)){
				System.out.println("" + c_com + " " + (cur_map.get(c_com) + pre_map.get(c_com)));
			}
		}
		
	}
}

Measured memory_bytes: 0
''' بِسْمِ اللَّهِ الرَّحْمَٰنِ الرَّحِيمِ '''
#codeforces
gi = lambda : list(map(int,input().split()))
a, b = gi()
for k in range(1001):
	if int(k * .08) == a and int(k * .1) == b:
		print(k)
		exit()
print(-1)

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

int main() {
  string a,b;
  cin >> a>>b;
string c,d;
c=a;
d=b;
for( int i=0;i<stoi(b)-1;i++){
c+=a;}  

for( int i=0;i<stoi(a)-1;i++){
d+=b;}

if(a>b) cout << d;
else cout << c;}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
const int N=1e5+10;
const int inf=1e6+7;
int A[N],B[N];
long num;

int main(){
	int a,b,m;
	cin>>a>>b>>m;
	int minnuma=inf;int minnumb=inf;
	for(int i=0;i<a;i++){
		scanf("%d",&A[i]);
		if(minnuma>A[i]) minnuma=A[i];
	}
	
	for(int i=0;i<b;i++){
		scanf("%d",&B[i]);
		if(minnumb>B[i]) minnumb=B[i];
	}
	int minnumc=inf;
	int x,y,c;
	for(int i=0;i<m;i++){
		scanf("%d %d %d",&x,&y,&c);
		num=A[x-1]+B[y-1]-c;
		if(minnumc>num) minnumc=num;
	}
	cout<<min(minnuma+minnumb,minnumc)<<endl;
}

Measured memory_bytes: 1024
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using P = pair<int, int>;
using PLL = pair<ll, ll>;
#define rep(i,n) for(int i = 0; i < (int)(n); i++)
#define repn(i,n) for(int i = 0; i <= (int)(n); i++)
#define srep(i,l,n) for(int i = l; i < (int)(n); i++)
#define srepn(i,l,n) for(int i = l; i <= (int)(n); i++)
#define drep(i,n) for(int i = (int)(n-1); i >= 0; i--)
#define drepn(i,n) for(int i = (int)(n); i >= 0; i--)
#define size(s) (int)s.size()
#define debug(var)  do{std::cout << #var << " : ";view(var);}while(0)
template<typename T> void view(T e){std::cout << e << std::endl;}
template<typename T> void view(const std::vector<T>& v){for(const auto& e : v){ std::cout << e << " "; } std::cout << std::endl;}
template<typename T> void view(const std::vector<std::vector<T> >& vv){ for(const auto& v : vv){ view(v); } }
template<typename T> inline istream& operator>>(istream &i, vector<T> &v) {rep(j, size(v)) i >> v[j]; return i;}
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
template<class T> T gcd(T a, T b) {if(b==0)return a; else return gcd(b,a%b);}
template<class T> T lcm(T a, T b) {return a/gcd(a,b)*b;}
template<class T = int> using V = vector<T>;
template<class T = int> using VV = vector<V<T>>;
bool isIn(int i, int j, int h, int w) {return i >= 0 && i < h && j >= 0 && j < w;}
void Yes(){cout << "Yes" << endl;}
void No(){cout << "No" << endl;}
void YES(){cout << "YES" << endl;}
void NO(){cout << "NO" << endl;}
void err() {cout << -1 << endl;}
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
#define pb push_back
#define ep emplace_back

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

#define PI acos(-1);
int dx[4] = {1,-1,0,0};
int dy[4] = {0,0,1,-1};
int ddx[8] = {1,1,1,-1,-1,-1,0,0};
int ddy[8] = {0,1,-1,0,1,-1,1,-1};


int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    int n, m, k;
    cin >> n >> m >> k;
    bool ok = false;
    repn(i, n) repn(j, m) {
        if(i * j + (n - i) * (m - j) == k) ok = true;
    }
    if(ok) Yes(); else No();
}

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

#define REP(i, n) for (int i = 0; i < (int)(n); i++)
#define REPl(i, n) for (ll i = 0; i < (ll)(n); i++)
#define REPR(i, n) for(int i = n; i >= 0; i--)
#define REPRl(i, n) for(ll i = n; i >= 0; i--)
#define FOR(i, m, n) for(int i = m; i < (int)n; i++)
#define FORl(i, m, n) for(ll i = m; i < (ll)n; i++)
#define ALL(v) v.begin(), v.end()
ll gcd(ll a,ll b) {
  return b? gcd(b,a%b): a;  
}
ll lcm(ll a,ll b) {
  return a*b/gcd(a,b);
}
bool isLowerCase(char c){
  return (c>='a'&&c<='z');
}
int main() {
  int x;cin>>x;
  int mx=1;
  for(int j=2;j*j<=x;j++){
    for(int i=j;i<=x;i*=j){
      if(i>mx)mx=i;
    }
  }
  cout<<mx<<endl;
}


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

#ifdef _DEBUG
#define debug(x) cerr << "line: " << __LINE__ << ", func: " << __func__ << " ->  " << #x << " = " << x << endl
#else
#define debug(x)
#endif

#define all(s) begin(s), end(s)
#define rall(s) rbegin(s), rend(s)
#define rep(i, a, b) for (int i = (a); i < (b); i++)
#define rrep(i, a, b) for (int i = ((a)-1); i >= (b); i--)
#define pb push_back
#define sz(a) int((a).size())

using namespace std;

using ll = long long;
using ull = unsigned long long;
using i_i = pair<int, int>;
using ll_ll = pair<ll, ll>;
using d_ll = pair<double, ll>;
using ll_d = pair<ll, double>;
using d_d = pair<double, double>;

static constexpr ll LL_INF = 1LL << 60;
static constexpr int I_INF = 1 << 28;
static constexpr double PI = static_cast<double>(3.14159265358979323846264338327950288);
static constexpr double EPS = numeric_limits<double>::epsilon();
static constexpr ll MOD = 2019;

static map<type_index, const char* const> scanType = {
    {typeid(int), "%d"}, {typeid(ll), "%lld"}, {typeid(double), "%lf"}, {typeid(char), "%c"}};

template <class T> static void scan(vector<T>& v);
[[maybe_unused]] static void scan(vector<string>& v, bool isWord = true);
template <class T> static inline bool chmax(T& a, T b);
template <class T> static inline bool chmin(T& a, T b);
template <class A, size_t N, class T> static void Fill(A (&arr)[N], const T& val);

int main(int argc, char* argv[]) {
  long long L;
  scanf("%lld", &L);
  long long R;
  scanf("%lld", &R);

  ll ans = LL_INF;
  int diff = min(int(R - L), 2020);

  rep(i, L, L + diff) rep(j, L + 1, L + diff + 1) {
    ll l = i % MOD;
    ll r = j % MOD;
    chmin(ans, (l * r) % MOD);
  }

  cout << ans << endl;
  return 0;
}

template <class T> static void scan(vector<T>& v) {
  auto tFormat = scanType[typeid(T)];
  for (T& n : v) {
    scanf(tFormat, &n);
  }
}

static void scan(vector<string>& v, bool isWord) {
  if (isWord) {
    for (auto& n : v) {
      cin >> n;
    }
    return;
  }

  int i = 0, size = v.size();
  string s;
  getline(cin, s);

  if (s.size() != 0) {
    i++;
    v[0] = s;
  }

  for (; i < size; ++i) {
    getline(cin, v[i]);
  }
}

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

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

template <class A, size_t N, class T> void Fill(A (&arr)[N], const T& val) {
  std::fill((T*)arr, (T*)(arr + N), val);
}


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

int main() {
	// your code goes here
	string s;
	cin>>s;
	cin>>s;
//	cout<<s<<endl;
    //int n = s.size();
    //cout<<n<<endl;
	if(s.size()%2 !=0 ) 
	{
	    cout<<"No"<<endl;
	}
	else
	{
	    int ptr1 = 0;
	    int ptr2 = s.size()/2;
	   // cout<<ptr2<<endl;
	    bool ans = true;
	    while(ptr2<s.size())
	    {
	        if(s[ptr1] != s[ptr2]) ans = false;
	        ptr1++;
	        ptr2++;
	    }
	    if(ans) cout<<"Yes"<<endl;
	    else cout<<"No"<<endl;
	}
	return 0;
}


Measured memory_bytes: 256
#include "bits/stdc++.h"
using namespace std;
#define pb          push_back
#define mp          make_pair
#define pii         pair<int,int>
#define vi          vector<int>
#define vii         vector<pii>
#define mi          map<int,int>
#define mii         map<pii,int>
#define all(a)      (a).begin(),(a).end()
#define x           first
#define y           second
#define sz(x)       (int)x.size()
#define endl        '\n'
#define hell        1000000007
#define N	    100001
#define rep(i,a,b)  for(int i=a;i<b;i++)
typedef long long ll;
bool comp(pair<string, pair<int, int> > &a, pair<string, pair<int, int> > &b) {
	if(a.x == b.x) {
		return a.y.x >= b.y.x;
	}
	else
		return a.x < b.x;
}
void solve(){
	int n;
	cin>>n;
	vector<pair<string, pair<int, int> > > v;
	for(int i = 0; i < n; i++) {
		string s;
		int a;
		cin>>s>>a;
		v.pb(mp(s, mp(a, i)));
	}
	sort(all(v), comp);
	for(int i = 0; i < n; i++) 
		cout<<v[i].y.y + 1<<endl;
}
int main() {
	int t;
	//cin>>t;
	t = 1;
	while(t--){
		solve();
	}
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
 
using namespace std;
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 INF 1000000000000 //10^12:極めて大きい値,∞
#define MOD 1000000007 //10^9+7:合同式の法
#define MAXR 100000 //10^5:配列の最大のrange(素数列挙などで使用)
#define PI 3.14159265359 //πの値
//略記
#define PB push_back //vectorヘの挿入
#define MP make_pair //pairのコンストラクタ
#define F first //pairの一つ目の要素
#define S second //pairの二つ目の要素

 
int main() {
cin.tie(0);
ios::sync_with_stdio(false);
  string S;
  cin >> S;
  cout << S[0] << S[1] << S[2];
}

Measured memory_bytes: 3648