akhauriyash/Code-Regression huggingface dataset:
n,m,x,y = map(int, input().split())
X = list(map(int, input().split()))
Y = list(map(int, input().split()))

xmax = max(X)
ymin = min(Y)

ans = "War"

for i in range(-100,101):
    if xmax < i <= ymin and x < i <= y:
        ans = "No War"
        break

print(ans)



Measured memory_bytes: 3060
#include <iostream>
#include <list>
#include <set>
#include <deque>
#include <queue>
#include <stack>
#include <vector>
#include <algorithm>
#include <map>
#include <chrono>
#include <valarray>
#include <math.h>
using namespace std;

using lli = long long int;
using Vint = std::vector<int>;
using Vlli = std::vector<lli>;
using Wint = std::vector<Vint>;
using Wlli = std::vector<Vlli>;
using Vbool = std::vector<bool>;
using Wbool = std::vector<Vbool>;
using pii = std::pair<int, int>;
using pll = std::pair<lli, lli>;
template <class T>
using Vec = std::vector<T>;

constexpr int MOD = 1e9 + 7;
constexpr int INFi = 2e9 + 1;
constexpr lli INFl = (lli)(9e18) + 1;
const vector<pii> DXDY = {std::make_pair(1, 0), std::make_pair(-1, 0), std::make_pair(0, 1), std::make_pair(0, -1)};
constexpr char BR = '\n';

#define DEBUG(x) std::cerr << #x << " = " << x << '\n';
#define FOR(i, a, b) for(int (i) = (a); (i) < (b); (i)++)
#define FOReq(i, a, b) for(int (i) = (a); (i) <= (b); (i)++)
#define rFOR(i, a, b) for(int (i) = (b); (i) >= (a); i--)
#define FORstep(i, a, b, step) for(int (i) = (a); i < (b); i += (step))
#define REP(i, n) FOR(i, 0, n)
#define rREP(i, n) rFOR(i, 0, (n-1))
#define vREP(ele, vec) for(auto &(ele) : (vec))
#define vREPcopy(ele, vec) for(auto (ele) : (vec))
#define SORT(A) std::sort((A).begin(), (A).end())
#define rSORT(A) std::sort((A).rbegin(), (A).rend())
// 座標圧縮 (for vector) : ソートしてから使うのが一般的 ; SORT(A) => COORDINATE_COMPRESSION(A)
#define COORDINATE_COMPRESSION(A) (A).erase(unique((A).begin(),(A).end()),(A).end())



template <class T> inline int argmin(std::vector<T> vec){return min_element(vec.begin(), vec.end()) - vec.begin();}
template <class T> inline int argmax(std::vector<T> vec){return max_element(vec.begin(), vec.end()) - vec.begin();}
template <class T> inline void chmax(T &a, T b){if(a < b) a = b;}
template <class T> inline void chmin(T &a, T b){if(a > b) a = b;}
inline int BitI(int k){return 1 << k;}
inline lli BitL(int k){return 1LL << k;}
inline int toInt(const string &s){int res = 0; for(char a : s) res = 10 * res + (a - '0'); return res;}
inline long long int toLong(const string &s){lli res = 0; for(char a : s) res = 10 * res + (a - '0'); return res;}
template <class T> inline std::string toString(T n){
  if(n == 0) return "0";
  std::string res;
  if(n < 0){n = -n;while(n != 0){res += (char)(n % 10 + '0'); n /= 10;}
  std::reverse(res.begin(), res.end()); return '-' + res;}
  while(n != 0){res += (char)(n % 10 + '0'); n /= 10;} std::reverse(res.begin(), res.end()); return res;
}

// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~




int main(void){
  lli n; cin >> n;
  lli res = 0;
  for(lli m = 1; m * m <= n; m++){
    if(n % m == 0){
      lli k = n / m; k--;
      if(k > m) res += k;
    }
  }
  cout << res << BR;
  return 0;
}

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

int main() {
        ios_base::sync_with_stdio(false); 
        cin.tie(NULL);
        // Code Starts...
        ll n,m;
        cin>>n>>m;
        if ((n==0 && m==0) || (n==1 && m==1)) cout<<"0"<<endl;
        else if (n==0) cout<<(m*(m-1))/2<<endl;
        else if (m==0) cout<<(n*(n-1))/2<<endl;
        else cout<<(n*(n-1))/2 + (m*(m-1))/2<<endl;
        // Code Ends...
        return 0;
}


Measured memory_bytes: 256
#ifdef OJ_MISC_OFFLINE

#include "prolog.h"

#else
#define LOG
#define PRINT
#define LCERR
#include <iostream>
auto optimize_cpp_stdio = []() {
    std::ios::sync_with_stdio(false);
    std::cin.tie(nullptr);
    std::cout.tie(nullptr);
    std::setvbuf(stdout, nullptr, _IOFBF, BUFSIZ);
    return 0;
}();
#endif

#include <algorithm>
#include <array>
#include <cassert>
#include <cstdio>
#include <cstdlib>
#include <iomanip>
#include <iostream>
#include <string>
#include <vector>

namespace {

using namespace std;

const double ratio = 380000.0;

int solve() {
    // handle IO here
    int N;
    cin >> N;
    double otoshidama = 0;
    for (int i = 0; i < N; ++i) {
        double x;
        string u;
        cin >> x >> u;
        if (u == "JPY") {
            otoshidama += x;
        } else {
            otoshidama += x * ratio;
        }
    }
    cout << setprecision(16) << otoshidama << '\n';
    return 0;
}

} // anonymous namespace

#ifdef OJ_MISC_OFFLINE

#include "epilog.h"

#else

int main() {
    return solve();
}

#endif


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define REP(i, n) for (int i = 0; i < (int)(n); i++)
#define REPR(i, n) for(int i = (int)(n); i >= 0; i--)
#define FOR(i, s, n) for (int i = (s); i < (int)(n); i++)
#define INF 2e9
#define ALL(v) v.begin(), v.end()
using namespace std;
typedef long long ll;

int main() {
    ll N;
    cin >> N;
    vector<ll> H(N);
    ll max_down = 0;
    ll cur_down = 0;
    REP(i, N){
        cin >> H[i];
        if (i > 0) {
            if (H[i] <= H[i-1]) {
                cur_down += 1;
            } else {
                if (max_down < cur_down) {
                    max_down = cur_down;
                }
                cur_down = 0;
            }
        }
    }
    if (max_down < cur_down) {
        max_down = cur_down;
    }
    cout << max_down << endl;
    return 0;
}



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

#define sws ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define ll long long
#define vi vector<int>
#define pb push_back
#define pii pair<int, int>
#define mp make_pair
#define ff first
#define ss second
#define vvi vector<vi>
#define all(x) x.begin(), x.end()
#define fo(i, n) for( int i = 0; i < n; i++ )

const int INF = 1e9;
const ll INFLL = 0x3f3f3f3f3f3f3f3f;
const int MOD = 1e9 + 7;


int main() {

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

    vi num(n, -1);
    bool pos = true;

    fo(i, m) {
        int s, c;
        cin >> s >> c;
        if ( num[s - 1] != -1 and num[s - 1] != c ) pos = false;
        num[s - 1] = c;
    }

    if ( !pos or (num[0] == 0 and  n != 1) ) {
        cout << -1 << endl;
        return 0;
    }

    fo(i, n) {
        if ( i == 0 ) {
            if ( num[i] == -1 ) {
                cout << (n == 1 ? 0 : 1);
            } else cout << num[i];
            continue;
        }
        cout << (num[i] == -1 ? 0 : num[i]);
    }
    cout << endl;

    return 0;
}

Measured memory_bytes: 3596
import sys
sys.setrecursionlimit(1000000)

n = int(input())


def calc(n, p):
    if n < p:
        return 0
    else:
        return n//p + calc(n//p, p)


if n % 2 == 1:
    print(0)
    sys.exit()

'''
ans = 0
n = n // 2
while(n>0):
    ans += n//5
    n = n//5
print(ans)
'''

print(calc(n//2, 5))



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

int main()
{

    string n;
    cin >> n;
    //A と T、C と G がそれぞれ対になります。
    string s;
    if(n=="A")s="T";
    if(n=="T")s="A";
    if(n=="C")s="G";
    if(n=="G")s="C";

    cout << s << endl;
    return 0;
}






Measured memory_bytes: 256
#include <bits/stdc++.h>
#define N 1001
using namespace std;
int n,p1,p2;
typedef pair<int,int> P;
vector<P> G[N],rG[N];
vector<P> A;

int used[N],god,devil;
vector<int> Idx[N];
int Sta[N];

void dfs(int pos, int sta){
  Idx[A.size()].push_back(pos);
  Sta[pos] = sta;

  for(P nx:G[pos]){
    int npos = nx.first;
    int nsta = sta ^ (!nx.second);
    if(used[npos]) assert(Sta[npos] == nsta);
    if(used[npos]++) continue;
    god += nsta;
    devil += !nsta;
    dfs(npos,nsta);
  }
  
  for(P nx:rG[pos]){
    int npos = nx.first;
    int nsta = sta ^ (!nx.second);
    if(used[npos]) assert(Sta[npos] == nsta);
    if(used[npos]++) continue;
    god += nsta;
    devil += !nsta;
    dfs(npos,nsta);
  }
}


void Push(vector<int> &res,int sta,int i){
  for(int p:Idx[i])if(sta == Sta[p]) res.push_back(p+1);
}

int dp[N][N];
vector<int> DP(){
  memset(dp,0,sizeof(dp));  
  dp[0][0] = 1;
  int n = A.size();
  for(int i=0;i<n;i++){
    int a = A[i].first;
    int b = A[i].second;
    for(int j=0;j<=p1;j++){
      dp[i+1][j+a] += dp[i][j];
      dp[i+1][j+b] += dp[i][j];
      dp[i+1][j+a] = min(2,dp[i+1][j+a]);
      dp[i+1][j+b] = min(2,dp[i+1][j+b]);

    }
  }

  if(dp[n][p1] != 1) return vector<int>(); 
  vector<int> res;
  int god = p1;
    for(int i=n-1;i>=0;i--){
      int a = A[i].first;
      int b = A[i].second;
      if(god-a>=0 && dp[i][god-a] == 1) Push(res,1,i),god -= a;
      else if(god-b>=0 && dp[i][god-b] == 1)Push(res,0,i),god -= b;
      else exit(1);
    }
    assert(god == 0);
    sort(res.begin(),res.end());
    return res;
}

int main(){
  while(1){
  cin>>n>>p1>>p2;
  if(!n&&!p1&&!p2)return 0;

  A.clear();
  memset(used,0,sizeof(used));
  memset(Sta,-1,sizeof(Sta));
  for(int i=0;i<N;i++) Idx[i].clear(),G[i].clear(),rG[i].clear();
  
  for(int i=0,x,y;i<n;i++){
    string str;
    cin>>x>>y>>str;
    x--,y--;
    G[x].push_back(P(y,str=="yes"));
    rG[y].push_back(P(x,str=="yes"));
  }

  for(int i=0;i<p1+p2;i++){
    if(used[i]++)continue;
    god = 1,devil = 0;
    dfs(i,1);
    A.push_back(P(god,devil));
  } 

  vector<int> ans = DP();
  if(p1&&ans.empty()) cout<<"no"<<endl;
  else {
    for(int p:ans)cout<<p<<endl;
    cout<<"end"<<endl;
  }
  }
  return 0;
}

Measured memory_bytes: 7272
n, m = map(int, input().split())
broken=set(int(input()) for _ in range(m))    

dp = [0]*(n+2)
mod = 1000000007
dp[n] = 1

for i in range(n-1,-1 , -1):
    if i in broken:
        continue
    else:
        dp[i] = dp[i+1] + dp[i+2]
print(dp[0]%mod)
    

Measured memory_bytes: 504540
import java.util.*;
import java.io.*;

public class Main{

	public static void main(String[] args) throws IOException {
		int N = readInt(), M = readInt();
		int max = 1;
		for(int i = 1; i<=Math.sqrt(M); i++) {
			if(M%i == 0) {
				if(M/i >= N) max = Math.max(i, max);
				if(i >= N) max = Math.max(M/i, max);
			}
		}
		println(max);
		exit();
	}

	final private static int BUFFER_SIZE = 1 << 16;
	private static DataInputStream din = new DataInputStream(System.in);
	private static byte[] buffer = new byte[BUFFER_SIZE];
	private static int bufferPointer = 0, bytesRead = 0;
	static PrintWriter pr = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)));

	public static String readLine() throws IOException {
		byte[] buf = new byte[64]; // line length
		int cnt = 0, c;
		while ((c = Read()) != -1) {
			if (c == '\n')
				break;
			buf[cnt++] = (byte) c;
		}
		return new String(buf, 0, cnt);
	}

	public static String read() throws IOException {
		byte[] ret = new byte[1024];
		int idx = 0;
		byte c = Read();
		while (c <= ' ') {
			c = Read();
		}
		do {
			ret[idx++] = c;
			c = Read();
		} while (c != -1 && c != ' ' && c != '\n' && c != '\r');
		return new String(ret, 0, idx);
	}

	public static int readInt() throws IOException {
		int ret = 0;
		byte c = Read();
		while (c <= ' ')
			c = Read();
		boolean neg = (c == '-');
		if (neg)
			c = Read();
		do {
			ret = ret * 10 + c - '0';
		} while ((c = Read()) >= '0' && c <= '9');

		if (neg)
			return -ret;
		return ret;
	}

	public static long readLong() throws IOException {
		long ret = 0;
		byte c = Read();
		while (c <= ' ')
			c = Read();
		boolean neg = (c == '-');
		if (neg)
			c = Read();
		do {
			ret = ret * 10 + c - '0';
		} while ((c = Read()) >= '0' && c <= '9');
		if (neg)
			return -ret;
		return ret;
	}

	public static double readDouble() throws IOException {
		double ret = 0, div = 1;
		byte c = Read();
		while (c <= ' ')
			c = Read();
		boolean neg = (c == '-');
		if (neg)
			c = Read();

		do {
			ret = ret * 10 + c - '0';
		} while ((c = Read()) >= '0' && c <= '9');

		if (c == '.') {
			while ((c = Read()) >= '0' && c <= '9') {
				ret += (c - '0') / (div *= 10);
			}
		}

		if (neg)
			return -ret;
		return ret;
	}

	private static void fillBuffer() throws IOException {
		bytesRead = din.read(buffer, bufferPointer = 0, BUFFER_SIZE);
		if (bytesRead == -1)
			buffer[0] = -1;
	}

	private static byte Read() throws IOException {
		if (bufferPointer == bytesRead)
			fillBuffer();
		return buffer[bufferPointer++];
	}

	static void print(Object o) {
		pr.print(o);
	}

	static void println(Object o) {
		pr.println(o);
	}

	static void flush() {
		pr.flush();
	}

	static void println() {
		pr.println();
	}

	static void exit() throws IOException {
		din.close();
		pr.close();
		System.exit(0);
	}
}


Measured memory_bytes: 22356
#include<iostream>
#include <cstdlib>
#include<string>
using namespace std;

int main(){
  string S;
  cin >> S;
  int min = abs(753 - atoi(S.substr(0,3).c_str()));
  for(int i = 1; i < S.size()-2;i++){
    //cout << min << endl;
    if(abs(753 - atoi(S.substr(i,3).c_str()))<min){
      min = abs(753 - atoi(S.substr(i,3).c_str()));
    }
  }
  
  cout << min << endl;
                
}


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

#define int long long

signed main(){
  int n;
  cin >> n;
  
  double a,ans = 0.0;

  for(int i = 1;i<=n;i++){
    cin >> a;
    ans += 1.0/a;
}
  
  
  cout << fixed << setprecision(10) << 1.0/ans << endl;
  
  return 0;
}

Measured memory_bytes: 256
import sys
from collections import deque

n = int(input())
a = list(map(int, sys.stdin.readline().split()))

ans = deque()

for i in range(n):
    if i % 2 == 0:
        ans.append(a[i])
    else:
        ans.appendleft(a[i])

if(len(a) % 2 != 0):
    ans.reverse()

print(' '.join(map(str, ans)))


Measured memory_bytes: 29104
a = int(input())
b = int(input())
c = int(input())
x = int(input())

ans = 0
for i in range(0,a+1):
  for j in range(0,b+1):
    for k in range(0,c+1):
      ttl = i * 500 + j * 100 + k * 50
      if(x==ttl):
        ans += 1

print(ans)


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

#define endl "\n"
#define fi first
#define se second
using namespace std;
typedef long long ll;
typedef pair<int, int> PII;
const int mod = 1e9 + 7;
const int maxn = 1e6 + 5;
const int inf = 0x3f3f3f3f;
const ll INF = 0x3f3f3f3f3f3f3f3f;

void header() {
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
}

ll qpow(ll a, ll b) {
    ll ans = 1;
    while (b) {
        if (b & 1) ans = ans * a;
        a = a * a;
        b >>= 1;
    }
    return ans;
}

void solve() {
    ll n, x = 0;
    cin >> n;
    while (n) {
        n >>= 1;
        x++;
    }
    cout << qpow(2, x) - 1 << endl;
}

int main() {
    header();
    solve();
    return 0;
}


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

int n, m, q ;
vector<int> a, b, c, d;
int ans = 0;

void dfs (vector<int> A){
    if(A.size() == n+1){
        int now = 0;
        rep(i, q){
            if(A[b[i]] - A[a[i]] == c[i]){
                now += d[i];
            }
        }
        ans = max(now, ans);
        return ;
    }


    A.push_back(A.back());
    while(A.back() <= m){
        dfs(A);
        A.back()++ ;
    }

}

int main() {
  cin >> n >> m >> q ;
  a = b = c = d = vector<int> (q);
  rep(i, q){
      cin >> a[i] >> b[i] >> c[i] >> d[i];
  }
  dfs(vector<int> (1,1));
  cout << ans << endl;
}



Measured memory_bytes: 3608
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define REP(i,m,n) for(int i=(int)(m); i<(int)(n); i++)
#define rep(i,n) REP(i,0,n)
#define RREP(i,m,n) for(int i=(int)(m); i>=(int)(n); i--)
#define rrep(i,n) RREP(i,n-1,0)
#define all(v) v.begin(), v.end()
const int inf = 1e9+7;
const ll longinf = 1LL<<60;
const ll mod = 1e9+7;

int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int N;
  cin >> N;
  vector<ll> A(N);
  rep(i, N) cin >> A[i];
  ll S = 0, X = 0;
  S = A[0] + A[1];
  REP(i, 2, N) X ^= A[i];
  if((S-X)&1) {
    cout << -1 << "\n";
    return 0;
  }
  ll D = (S-X)>>1;
  if(D > A[0]) {
    cout << -1 << "\n";
    return 0;
  }
  vector<ll> d(45);
  {
    int i = 0;
    while(X > 0) {
      d[i] = X&1;
      if(d[i] && (D>>i)&1) {
        cout << -1 << "\n";
        return 0;
      }
      X >>= 1;
      i++;
    }
  }
  rrep(i, 45) {
    if((D^(d[i]<<i)) > A[0]) continue;
    D ^= (d[i]<<i);
  }
  cout << (D==0 ? -1 : A[0]-D) << "\n";
  return 0;
}


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

using namespace std;

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

int main(){
	cin.tie(0);
	ios::sync_with_stdio(false);
	int n,m;
	cin>>n>>m;
	vector<int> a(n);
	rep(i,n)cin>>a[i];
	map<int, int> mp;
	mp[0] = 1;
	long long ans=0;
	int sum=0;
	rep(i,n){
		(sum += a[i]) %= m;
		ans += mp[sum] ++ ;
	}
	cout << ans << endl;
}

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

using namespace std;
#define int long long


#define ff first
#define ss second
#define endl "\n"
#define all(x) (x).begin(), (x).end()
#define sz(x) (int)(x.size())
#define PI 3.1415926535897932384626433832795
int MOD=1e9+7;
int powmod(int a,int l, int md){int res=1;while(l){if(l&1)res=res*a%md;l/=2;a=a*a%md;}return res;}
int binpow(int a,int l){int res=1;while(l){if(l&1)res=res*a;l/=2;a=a*a;}return res;}
typedef long long ll; typedef vector<ll> vi; typedef pair<ll, ll> ii; typedef vector<ii> vii;
#define pb push_back
int __set(int b, int i) {return b|(1<<i);} //set ith bit
int __unset(int b, int i) {return b&(~(1UL<<i));}
int __check(int b, int i) {return b&(1<<i);} //returns 0 if ith bit is 0
int mulmod(int a, int b, int md) {return ((a%md)*(b%md))%md;}
int addmod(int a, int b, int md) {return (a+b)%md;}
int submod(int a, int b, int md) {return (((a-b)%md)+md)%md;}
int divmod(int a, int b, int md) {return mulmod(a, powmod(b, md-2, md), md);} //if md is prime;
const ll inf = 0xFFFFFFFFFFFFFFFL; //very large number
// priority_queue<int, vector<int>, greater<int> > pq; //for min priority_queue
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
clock_t time_p=clock();
void time()
{
    time_p=clock()-time_p;
    cerr<<"Time Taken : "<<(float)(time_p)/CLOCKS_PER_SEC<<"\n";
}

mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

int getRand(int l, int r)
{
	uniform_int_distribution<int> uid(l, r);
	return uid(rng);
}

int n;
double x[1005], y[1005], X, Y, d, e;
double dist(double a, double b) {
	return a*a + b*b;
}
signed main(void)
{
	IOS;
	cin>>n;
	for (int i = 0; i < n; i++) {
		cin>>x[i]>>y[i];
		X += x[i]; Y += y[i];
	}
	X /= n; Y /= n;
	double Prob = 0.1;
	for (int i = 0; i < 30000; i++) {
		int f = 0;
		d = dist(X - x[0], Y - y[0]);
		for (int j = 1; j < n; j++) {
			e = dist(X - x[j], Y - y[j]);
			if (d < e) { d = e; f = j; }
		}
		X += (x[f] - X)*Prob;
		Y += (y[f] - Y)*Prob;
		Prob *= 0.999;
	}
	cout<<setprecision(20)<<sqrt(d)<<endl;
	return 0;
}


Measured memory_bytes: 256
ga={1, 3, 5, 7, 8, 10, 12}
gb={4, 6, 9, 11}
gc={2}
cin = input().split()
gx={int(cin[0])}
gy={int(cin[1])}
if gx <= ga and gy <= ga:
    print('Yes')
elif gx <= gb and gy <= gb:
    print('Yes')
elif gx <= gc and gy <= gc:
    print('Yes')
else:
    print('No')

Measured memory_bytes: 3064
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<climits>
#include<iostream>
#include<sstream>
#include<utility>
#include<map>
#include<vector>
#include<queue>
#include<algorithm>
#include<set>
#include<stack>
#define PI 3.14159265358
using namespace std;
typedef long long ll;
typedef pair<double,double>P;
queue<P>S;
P s,t;
int N;
int main()
{
	scanf("%d",&N);
	S.push(make_pair(0,0));
	S.push(make_pair(100.0,0));
	for(;N--;)
	{
		s=S.front();S.pop();
		queue<P>T;
		do
		{
			t=S.front();S.pop();
			P s1=make_pair(s.first+(t.first-s.first)/3,s.second+(t.second-s.second)/3);
			P s2=make_pair(s.first+(t.first-s.first)/3*2,s.second+(t.second-s.second)/3*2);
			
			T.push(s);
			T.push(s1);
			
			T.push(make_pair(s1.first+(s2.first-s1.first)*cos(PI/3.0)-(s2.second-s1.second)*sin(PI/3.0),
							s1.second+(s2.first-s1.first)*sin(PI/3.0)+(s2.second-s1.second)*cos(PI/3.0)));
			T.push(s2);
			s=t;
		}while(!S.empty());
		T.push(t);
		S=T;
	}
	for(;!S.empty();)
	{
		printf("%lf %lf\n",S.front().first,S.front().second);
		S.pop();
	}
	return 0;
}

Measured memory_bytes: 1376
import std.stdio;
import core.stdc.stdio;
import std.typecons;
import std.algorithm;

void main(){
	int n;
	long h;
	scanf("%d%lld",&n,&h);
	long[] ds = new long[n];
	long[] hs = new long[n-1];
	for(int i=0;i<n-1;i++)
		scanf("%lld%lld",&ds[i+1],&hs[i]);
	for(int i=1;i<n;i++)
		ds[i] += ds[i-1];
	//ds.writeln;
	long heal=0;
	long ans=0;
	int b=0;
	int e=0;
	alias Tuple!(int,"prev",int,"next") pn;
	pn[] list = new pn[n];
	for(int i=0;i<n;i++)
		list[i] = pn(i,i);
	for(int s=1;s<n;s++){
			/*
			s.writeln;
			writeln(b," ",e," ",list[b].next);
			writeln("heal ",heal);
			writeln;
			*/
		while(h<=ds[s]-heal){
			while(list[b].next != b){
				int k = list[b].next;
				if(min(ds[b]-heal,hs[b])<=min(ds[k]-heal,hs[k]))
					b=k;
				else
					break;
			}
			list[b].prev = b;
			
			long t = min(ds[b]-heal,ds[s]-heal-h+1);
			//t.writeln;	
			if(t>=hs[b]){
				long c = t/hs[b];
				ans += c;
				heal += hs[b]*c;
			}else{
				ans++;
				heal += min(ds[b]-heal,hs[b]);
			}
		}
		if(s==n-1)
			break;
		list[s].prev = e;
		list[e].next = s;
		e = s;
		while(1){
			int k=list[e].prev;
			if(hs[k]<=hs[e]){
				if(k==b){
					list[e].prev = e;
					b=e;
					break;
				}else{
					list[e].prev = list[k].prev;
					list[list[e].prev].next = e;
				}
			}else
				break;
		}
		//writeln;
	}
	printf("%lld\n",ans);
}

Measured memory_bytes: 4788
#include<bits/stdc++.h>
using namespace std;
#define MAXN	300005
template <typename T> void read(T &x) {
	x = 0; int f = 1;
	char c = getchar();
	for (; !isdigit(c); c = getchar()) if (c == '-') f = -f;
	for (; isdigit(c); c = getchar()) x = x * 10 + c - '0';
	x *= f;
}
struct interval {int l, r, len; };
bool operator < (interval x, interval y) {return x.len < y.len; }
int n, m, t[MAXN];
interval a[MAXN];
void modify(int pos, int d) {
	for (int i = pos; i <= m; i += i & -i)
		t[i] += d;
}
int query(int pos) {
	int ans = 0;
	for (int i = pos; i; i -= i & -i)
		ans += t[i];
	return ans;
}
int main() {
	read(n), read(m);
	for (int i = 1; i <= n; i++) {
		int l, r;
		read(l), read(r);
		a[i] = (interval) {l, r, r - l + 1};
	}
	sort(a + 1, a + n + 1);
	int pos = 1;
	for (int i = 1; i <= m; i++) {
		while (pos <= n && a[pos].len < i) {
			modify(a[pos].l, 1);
			modify(a[pos].r + 1, -1);
			pos++;
		}
		int ans = n - pos + 1;
		for (int j = i; j <= m; j += i)
			ans += query(j);
		printf("%d\n", ans);
	}
	return 0;
}

Measured memory_bytes: 4992
#include<bits/stdc++.h>
#define IOS ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define endl "\n"
#define pb push_back
#define mp make_pair
#define int long long
#define mod 1000000007
#define DEBUG cout<<"Hello1\n";
#define all(v) (v).begin(),(v).end()
#define clr(x) memset(x,0,sizeof(x))
#define deb(...) debug(#__VA_ARGS__, __VA_ARGS__);
const int N = 1e6 + 5;
const double pi =  acosl(-1);
const long long inf = 1e18 + 5;
using namespace std;
template<typename T> void debug(string s, T x)
{
	cout << s << " = " << x << "\n";
}
template<typename T, typename... Args> void debug(string s, T x, Args... args)
{
	cout << s.substr(0, s.find(',')) << " = " << x << " | ";
	debug(s.substr(s.find(',') + 2), args...);
}
template<class T> void print_container(T &container)
{
	for (auto &t : container)
	{
		cout << t << " ";
	}
	cout << endl;
}
template<class T> void print_pair_container(T &container)
{
	for (auto &t : container)
	{
		cout << t.first << " " << t.second << endl;
	}
	cout << endl;
}
template<class T> void printArr(T &a, int n)
{
	for (int i = 0; i < n; i++)
	{
		cout << a[i] << " ";
	}
	cout << endl;
}
typedef long long ll;
typedef pair<int, int> pii;

//Template Ends
int n;

void solve()
{
	cin >> n;

	if (n == 0) {
		cout << 1 << endl;
	} else {
		cout << 0 << endl;
	}
}

int32_t main()
{
	IOS;

		solve();

	return 0;
}



Measured memory_bytes: 3632
#include <stdio.h>
#include <stdlib.h>
#include <inttypes.h>

int asumisu(const void* x, const void* y) {
	int a = *(const int*)x, b = *(const int*)y;
	return a < b ? -1 : a > b;
}

int mizuhasu(const void* x, const void* y) {
	return asumisu(y, x);
}

int N;
int64_t K;
int A[222222];
int F[222222];

int main(void) {
	int i;
	int64_t no = 0, yes = INT64_C(22222222222222222);
	int64_t sum = 0;
	if (scanf("%d%" SCNd64, &N, &K) != 2) return 1;
	for (i = 0; i < N; i++) {
		if (scanf("%d", &A[i]) != 1) return 1;
	}
	for (i = 0; i < N; i++) {
		if (scanf("%d", &F[i]) != 1) return 1;
	}
	for (i = 0; i < N; i++) {
		sum += A[i];
	}
	if (sum <= K) {
		puts("0");
		return 0;
	}
	qsort(A, N, sizeof(*A), asumisu);
	qsort(F, N, sizeof(*F), mizuhasu);
	while (no + 1 < yes) {
		int64_t mid = no + (yes - no) / 2;
		int64_t cost = 0;
		for (i = 0; i < N; i++) {
			int64_t target = mid / F[i];
			if (A[i] > target) cost += A[i] - target;
		}
		if (cost <= K) yes = mid; else no = mid;
	}
	printf("%" PRId64 "\n", yes);
	return 0;
}


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

using namespace std;
typedef unsigned int ui;

int main()
{
  string const a = "CODEFESTIVAL2016";
  string in;
  cin >> in;
  int c = 0;
  for(int i = 0; i < a.size(); i++) if(a[i] != in[i]) c++;
  cout << c << endl;

  return 0;
}


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

int main() {
    int N;
    int a[114]; 
    cin >> N; 
    for (int i = 0; i < N; ++i){
    cin >> a[i]; 
    }
    int S[114]; 
    S[0] = 0; 
    for (int i = 0; i < N; ++i){
    S[i+1] = S[i] + a[i]; 
    }
    int b[114]; 
    for (int i = 0; i < N; ++i)
    cin >> b[i]; 
    int T[114]; 
    T[0] = 0; 
    for (int i = 0; i < N; ++i){
    T[i+1] = T[i] + b[N-1-i];
    }
    int m = 0; 
    for (int i = 1; i <= N; ++i){
    int q = S[i] + T[N+1-i]; 
    m = max(q, m); }
    cout << m << endl; 
  }

Measured memory_bytes: 256
S=list(input())
T=list(input())

answer=float("inf")
for i in range(len(S)-len(T)+1):
  ans=0
  for j in range(len(T)):
    if S[j+i]!=T[j]:
      ans+=1
      
  answer=min(answer,ans)
  #print(i,answer)

print(answer)

Measured memory_bytes: 8984
#include <bits/stdc++.h>
 
using namespace std;
 
#define lli long long int
#define REP(i,s,n) for(int i=s;i<n;i++)
#define MOD 1000000007
#define NUM 2520
#define DEBUG 0
#define mp(a,b) make_pair(a,b)
#define SORT(V) sort(V.begin(),V.end())
#define PI (3.141592653589794)
#define INF (1LL<<50)
 
map<lli,lli> cnt;

signed main(){

	lli n;
	cin>>n;
	lli m;
	cin>>m;

	REP(i,0,m){
		lli a,b;
		cin>>a>>b;
		cnt[a]++;
		cnt[b]++;
	}

	for(auto e:cnt){
		if(e.second%2){
			cout<<"NO"<<endl;
			return 0;
		}
	}
	cout<<"YES"<<endl;


	return 0;
}

Measured memory_bytes: 6144
#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<iomanip>
#include<math.h>
#include<complex>
#include<queue>
#include<deque>
#include<stack>
#include<map>
#include<set>
#include<bitset>
#include<functional>
#include<assert.h>
#include<numeric>
#include<stdio.h>
#include <cstdint>
using namespace std;
#define REP(i,m,n) for(int i=(int)(m) ; i < (int) (n) ; ++i )
#define rep(i,n) REP(i,0,n)
using ll = long long;
const int inf = 1e9 + 7;
const ll longinf = 1LL << 60;
const ll mod = 1e9 + 7;


int main()
{
	int sum;
	while (cin >> sum, sum) {
		for (int i = 0; i < 9; i++) {
			int tmp;
			cin >> tmp;
			sum -= tmp;
		}
		cout << sum << endl;
	}
	return 0;
}


Measured memory_bytes: 3068
using System;
using System.Linq;
using System.Numerics;

namespace c
{
    class Program
    {
        static void Main(string[] args)
        {
            var s = Console.ReadLine().ToCharArray().Select(x => int.Parse(x.ToString())).ToArray();
            var k = long.Parse(Console.ReadLine());

            var n = 1;
            for(var i = 0; i < Math.Min(s.Length, k); i++){
                if(s[i] >= 2){
                    n = s[i];
                    break;
                }
            }

            Console.WriteLine(n);
        }
    }
}


Measured memory_bytes: 13396
use std::io;
use std::cmp;
use std::collections::BinaryHeap;
use std::collections::HashMap;
use std::collections::HashSet;
use std::f64::consts::PI;

fn read_line() -> String {
    let mut buf = String::new();
    io::stdin().read_line(&mut buf).ok();
    buf
}

const MOD: i64 = 1_000_000_007;

fn extgcd(a: i64, b: i64, x: &mut i64, y: &mut i64) -> i64 {
    let mut d = a;
    if b != 0 {
        d = extgcd(b, a % b, y, x);
        *y -= (a / b) * (*x);
    } else {
        *x = 1; *y = 0;
    }
    d
}

fn mod_inverse(a: i64, m: i64) -> i64 {
    let mut x = 0;
    let mut y = 0;
    extgcd(a, m, &mut x, &mut y);
    (m + x % m) % m
}

fn mod_fact(n: i64, p: i64, e: &mut i64, fact: &Vec<i64>) -> i64 {
    *e = 0;
    if n == 0 {
        return 1;
    }

    let res = mod_fact(n/p, p, e, fact);
    *e += n/p;
    if (n/p %2 != 0) {
        return res * (p - fact[(n%p) as usize]) % p;
    }
    res * fact[(n%p) as usize] % p
}

fn mod_comb(n: i64, k: i64, memo: &Vec<i64>) -> i64 {
    if n < 0 || k < 0 || n < k {
        return 0;
    }
    let mut e1 = 0;
    let mut e2 = 0;
    let mut e3 = 0;
    let a1 = memo[n as usize];
    let a2 = memo[k as usize];
    let a3 = memo[(n-k) as usize];
    if e1 > e2 + e3 {
        return 0;
    }
    a1 * mod_inverse(a2 * a3 % MOD, MOD) % MOD
}


fn main() {
    let line: Vec<usize> = read_line().split_whitespace().map(|s| s.parse().unwrap()).collect();
    let n = line[0];
    let k = line[1];

    let mut memo = vec![0i64; n+10];
    memo[0] = 1;
    memo[1] = 1;
    for i in 2..memo.len() {
        memo[i] = (memo[i-1] * (i as i64)) % MOD;
    }
    let mut a: Vec<i64> = read_line().split_whitespace().map(|s| s.parse().unwrap()).collect();
    a.sort();

    let mut ans = 0;
    for i in 0..n {
        ans += (a[i] * mod_comb(i as i64, (k-1) as i64, &memo) % MOD);
        ans %= MOD;
    }
    for i in 0..n {
        ans += MOD - (a[i] * mod_comb((n-i-1) as i64, (k-1) as i64, &memo) % MOD);
        ans %= MOD;
    }
    
    println!("{}", ans);
}


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

int main(){
    int a, b;
    cin >>a>>b;
    for(int i = 0; i <= 100; i++){
        int s = a * i;
        s= s-(i - 1);
        if(s>=b)
        {
            cout << i << endl;
            return 0;
        }
    }
    
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <math.h>
#include <map>
#include <vector>
#include <tuple>
#include <algorithm>
using namespace std;
#define lli long long int
#define vi vector<int>
#define vlli vector<lli>
#define pii pair<int, int>
#define plli pair <lli, lli>
#define F(i,n) for(lli (i)=0;(i)<(n);(i)++)
#define FR(i,n) for(lli (i)=(n)-1;(i)>=0;(i)--)
#define FSG(i,a,b) for(lli (i)=(a);(i)<(b);(i)++)
#define FSGR(i,a,b) for(lli (i)=(b)-1;(i)>=(a);(i)--)
#define VAL(n) cout << n << endl;
#define VALD(n) cout << #n << ": " << n << endl;

int main(){
  string b;
  cin >> b;
  string a = " ";
  if(b == "A"){
    a = "T";
  }
  else if(b == "T"){
    a = "A";
  }
  else if(b == "C"){
    a = "G";
  }
  else{
    a = "C";
  }
  cout << a << endl;
  return 0;
}


Measured memory_bytes: 256
using System;
using System.Collections;
using System.Collections.Generic;

public class p0047
{
	p0047(){
		string str;
		string[] st;
		char[] ch = new char[3];
		char c;
		int p, q;
		
		for(int i = 0; i < 3; ++i)
			ch[i] = (char)('A'+i);
		
		while((str=Console.ReadLine()) != null){
			st = str.Split(',');
			p = conv(st[0]); 
			q = conv(st[1]);
			c = ch[p];
			ch[p] = ch[q];
			ch[q] = c;
		}
		
		for(int i = 0; i < 3; ++i)
			if(ch[i] == 'A'){
				Console.WriteLine("{0}", (char)('A'+i));
				break;
			}
	}
	
	public int conv(string str){
		return (int)(char.Parse(str)-'A');
	}
	
	public static int Main(string[] args){
		new p0047();
		return 0;
	}
}

Measured memory_bytes: 5260
#include<iostream>
#include<cstdio>
#include<cstdlib>
#include<cmath>
#include<cstring>
#include<string>
#include<algorithm>
using namespace std;
int a,b,k;

int main()
{
    cin>>a>>b>>k;
    int x1=0;
    for (int i=a; i<=(x1=min(b,a+k-1)); ++i)
    {
        cout<<i<<endl;
    }
    for (int i=max(x1+1,b-k+1); i<=b; ++i)
    {
        cout<<i<<endl;
    }
    return 0;
}


Measured memory_bytes: 256
import sys
input = sys.stdin.readline

N, M = map(int, input().split())
PYs = [tuple(map(int, input().split())) for _ in range(M)]
d =  dict()

last_P = -1
counter = 1
for P, Y in sorted(PYs):
    if last_P == P:
        counter += 1
    else:
        last_P = P
        counter = 1
    d[(P, Y)] = "{0:0>6}{1:0>6}".format(P, counter)
    
for t in PYs:
    print(d[t])

Measured memory_bytes: 37776
#include <algorithm>
#include <iostream>
#include <vector>
#include <queue>
#include <set>
#include <string>
#include <map>
#include <cmath>
#include <cstring>

#define fi first
#define se second
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define rrep(i,n) for (int i = 1; i < (n); ++i)
#define drep(i,n) for (int i = (n)-1; i >= 0; --i)
#define srep(i,s,t) for (int i = s; i < t; ++i)
#define all(x) (x).begin(), (x).end()
#define maxs(x,y) (x = max(x,y))
#define mins(x,y) (x = min(x,y))
#define pb push_back
#define sz(x) (int)(x).size()
#define PQ(T) priority_queue<T, v(T), greater<T> >

using namespace std;
typedef long long ll;
typedef unsigned uint;
typedef unsigned long long ull;
typedef pair<int,int> P;

const ll LINF = 1001002003004005006ll;
const int INF = 1001001001;

const int mod = 1000000007;

int main() {
    string s;
    cin >> s;
    rep(i,s.size()) {
        cout << 'x';
    }
    cout << endl;
    return 0;
}






















Measured memory_bytes: 256
def collatz(num):
  if num % 2 == 0:
    return num // 2
  else:
    return 3*num + 1

s = int(input())
appeared = set()

target = s
c = 1
while target not in appeared:
  appeared.add(target)
  target = collatz(target)
  c += 1
  
print(c)

Measured memory_bytes: 2940
import java.util.Arrays;
import java.util.Scanner;
 
class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		String t = sc.next();
		char[] ss = s.toCharArray();
		char[] ts = t.toCharArray();
		Arrays.sort(ss);
		Arrays.sort(ts);
		char[] rts = new char[ts.length];
		for(int i = 0;i < ts.length;i++){
			rts[i] = ts[ts.length-1-i];
		}
		String ns = new String(ss);
		String nt = new String(rts);
		if(ns.compareTo(nt)<0){
			System.out.println("Yes");
		} else {
			System.out.println("No");
		}
	}
}


Measured memory_bytes: 23124
#include<bits/stdc++.h>
using namespace std;
int main()
{
    long long n;
    cin>>n;
    vector<long long> v(n);
    for(long long i=0;i<n;i++)
    {
        cin>>v[i];
    }
    sort(v.begin(),v.end());
    cout<<v[n-1]-v[0]<<"\n";
    return 0;
}

Measured memory_bytes: 3580
#include<iostream>
#include<cmath>
#include<cstdio>
#include<vector>
#include<algorithm>
 
using namespace std;
 
double EPS = 1e-10;
 
double add(double a,double b){
  if(abs(a+b)<EPS*(abs(a)+abs(b)))return 0;
  return a+b;
}
 
struct point{
  double x,y;
  point() {}
  point(double x,double y):x(x),y(y){
  }
  point operator + (point p){
    return point(add(x,p.x),add(y,p.y));
  }
  point operator - (point p){
    return point(add(x,-p.x),add(y,-p.y));
  }
  point operator * (double d){
    return point(x*d,y*d);
  }
  point operator / (double d){
    return point(x/d,y/d);
  }
};
 
double dist(point a,point b){
	return sqrt(pow(a.x-b.x,2)+pow(a.y-b.y,2));
}
 
int main(void){
	int n,x,y,v;
	vector<point>P;
	vector<double>V;
	
	while(cin >> n,n){
		P.clear();
		V.clear();
		
		for(int i=0;i<n;i++){
			cin >> x >> y >> v;
			P.push_back(point(x,y));
			V.push_back(v);
		}
		
		
		double r=0.975;
		point now(0,0);
		
		for(double d=10;d>EPS;d*=r){
			int mx=0;
			double mxd=0;
			
			for(int j=0;j<P.size();j++){
				if(dist(now,P[j])/V[j]>mxd)mx=j,mxd=dist(now,P[j])/V[j];
			}
			
			now=now+((P[mx]-now)/dist(P[mx],now)*d);
		}
		
		double ans=0;
		for(int i=0;i<P.size();i++){
			ans=max(ans,dist(now,P[i])/V[i]);
		}
		printf("%.8f\n",ans);
	}
	
	return 0;
}

Measured memory_bytes: 1248
/**
 * @copyright (c) 2020 Daisuke Hashimoto
 */

#include <bits/stdc++.h>
using namespace std;
using ll = int64_t;
using Pair = pair<int64_t, int64_t>;

// std::cout << std::setprecision(20) << 1.1 << endl;

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

  int64_t A, V, B, W, T;
  cin >> A >> V >> B >> W >> T;
  if (W >= V) {
    cout << "NO" << endl;
  } else {
    if (abs(B - A) <= T * (V - W)) {
      cout << "YES" << endl;
    } else {
      cout << "NO" << endl;
    }
  }
  // const int64_t L = static_cast<int64_t>(T.length());
  return 0;
}


Measured memory_bytes: 3652
from collections import Counter
n=int(input())
brr=list(map(int,raw_input().split()))

def solve(arr,n):
    if n<=2:
        return 0

    freq=Counter(brr)
    arr=list(set(brr))
    arr.sort()
    count=0
    for i in range(len(arr)-2):
        for j in range(i+1,len(arr)-1):
            for k in range(j+1,len(arr)):
                if arr[i]+arr[j]>arr[k]:
                    count+=freq[arr[i]]*freq[arr[j]]*freq[arr[k]]
    return count

print(solve(brr,n))

Measured memory_bytes: 72056
#include <iostream>
#define rep(q,i) for(int i = 0; q > i; i++)
using namespace std;
int main(void){
  int a[3];
  rep(3,i) cin >> a[i];
  if(a[0] == a[1]){
    cout << a[2] << endl;
  } else if(a[0] == a[2]){
    cout << a[1] << endl;
  } else {
    cout << a[0] << endl;
  }
}

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

int PY[510] = {};
bool D[510][510] = {};
bool V[510] = {};
int X, Y;


bool link(int n, int m) {
	int p = n;
	int q = m;
	while (p != 0 && q != 0) {
		if (p > q)p %= q;
		else if (q > p)q %= p;
		else break;
	}
	return (p == 1 || q == 1) ? false : true;
}

bool match(int x) {
	if (x < 0) return true;
	if (V[x])return false;
	V[x] = true;
	for (int y = 0; y<Y; ++y) {
		if (!D[x][y]) continue;
		if (match(PY[y])) {
			PY[y] = x;
			return true;
		}
	}
	return false;
}




int main() {
	while (true) {
		cin >> X >> Y;
		if (X == 0 && Y == 0)break;
		int R[510] = {};
		int B[510] = {};
		for (int i = 0; i < X; i++) {
			cin >> R[i];
		}
		for (int i = 0; i < Y; i++) {
			cin >> B[i];
		}
		for (int i = 0; i < 510; i++) {
			for (int j = 0; j < 510; j++) {
				D[i][j] = false;
			}
		}
		for (int i = 0; i < X; i++) {
			for (int j = 0; j < Y; j++) {
				D[i][j] = link(R[i], B[j]);
			}
		}
		fill(PY, PY + Y, -1);
		int count = 0;
		for (int x = 0; x<X; ++x) {
			fill(V, V + X, false);
			if (match(x)) ++count;
		}
		cout << count << endl;
	}
	return 0;
}

Measured memory_bytes: 3376
#include <bits/stdc++.h>
using namespace std;
using ll=long long;
using vi = vector<int>;
using vvi = vector<vector<int>>;
using vl = vector<ll>;
using vvl = vector<vector<ll>>;
#define all(x) x.begin(),x.end()
#define rep(i,j,n) for (int i = j; i < (int)(n); i++)
#define _GLIBCXX_DEBUG
#define MOD 1000000007
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
//name[i][j]-> vvl name(i,vl(j))
//map<int,int>mp
//余りを切り上げる =>  (a + b - 1) / b 

signed main(){
	double a,b; cin>>a>>b;
	//bool ok=false;
	rep(i,0,10000){
		ll s=ll(i*0.08);
		ll t=ll(i*0.1);
		if(s==a && t==b){
			cout<<i;
			return 0;
		}
	}
	cout<<-1;
	
	return 0;
}

Measured memory_bytes: 256
#pragma GCC optimize("Ofast",3,"inline")
#include<bits/stdc++.h>
using namespace std;
#define fir first
#define sec second
#define m_p make_pair
#define y1 ygftgfgcdtfgxffgx
#define y2 yfdsesgvtyghftfvv
#define x1 xvyr6cf6fgcfgf676
#define x2 xcr6rfc5r66y6r6fr
#define up_bound upper_bound
#define low_bound lower_bound
#define next_per next_permutation
#define pb push_back
#define i_to_s to_string
typedef priority_queue<int> p_queue;
typedef priority_queue<int, vector<int>, greater<int> > min_p_queue;
typedef long long ll;
typedef long double ld;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
int mon[20]={31,28,31,30,31,30,31,31,30,31,30,31};
ll gcd(ll x,ll y){return ((y==0)?x:gcd(y,x%y));}
inline int read(){
	int x=0;char ch=getchar();
	while(ch<'0'||ch>'9')ch=getchar();
	while(ch>='0'&&ch<='9'){x=x*10+ch-'0';ch=getchar();}
	return x;
}
int f(int x,int y,int z) {
  return x*x+y*y+z*z+x*y+y*z+z*x;
}
int n,sum[100010];
int main(){
	ios_base::sync_with_stdio(false);
	cin.tie(0);
//	freopen(".in","r",stdin);
//	freopen(".out","w",stdout);
	cin >> n;
    for(int i=1;i<=100;i++)
      for(int j=1;j<=100;j++)
        for(int k=1;k<=100;k++)
          sum[f(i,j,k)]++;
  
 	for(int i=1;i<=n;i++)cout<<sum[i]<<'\n';
	return 0;
}


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

using namespace std;

const int maxn = 1e5 + 20;
int n, c, k, a[maxn], ind, bus;

int main()
{
    cin >> n >> c >> k;
    for (int i = 0; i < n; i++)
        cin >> a[i];
    sort (a , a + n);
    for (int i = 0; i < n - 1; i++)
    {
        if (i + 1 - ind + 1 > c || a[i + 1] > a[ind] + k)
        {
            bus++;
            ind = i + 1;
        }
    }
    cout << bus + 1<< endl;
    return 0;
}



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

const int MAXN = 5002;
int n, m;
int x[MAXN], y[MAXN];
int G[MAXN][MAXN];

int main() {
  while(cin >> n >> m) {
    vector<int> xs, ys;
    for(int i = 0; i < n; ++i) {
      cin >> x[i] >> y[i];
      xs.push_back(x[i]);
      ys.push_back(y[i]);
    }
    sort(xs.begin(), xs.end());
    sort(ys.begin(), ys.end());
    xs.erase(unique(xs.begin(), xs.end()), xs.end());
    ys.erase(unique(ys.begin(), ys.end()), ys.end());
    memset(G, 0, sizeof(G));
    for(int i = 0; i < n; ++i) {
      int nx = lower_bound(xs.begin(), xs.end(), x[i]) - xs.begin();
      int ny = lower_bound(ys.begin(), ys.end(), y[i]) - ys.begin();
      G[1+ny][1+nx] += 1;
    }
    for(int i = 0; i < MAXN; ++i) {
      for(int j = 0; j+1 < MAXN; ++j) {
        G[i][j+1] += G[i][j];
      }
    }
    for(int j = 0; j < MAXN; ++j) {
      for(int i = 0; i+1 < MAXN; ++i) {
        G[i+1][j] += G[i][j];
      }
    }
    while(m--) {
      int a, b, c, d;
      cin >> a >> b >> c >> d;
      a = lower_bound(xs.begin(), xs.end(), a) - xs.begin();
      b = lower_bound(ys.begin(), ys.end(), b) - ys.begin();
      c = upper_bound(xs.begin(), xs.end(), c) - xs.begin();
      d = upper_bound(ys.begin(), ys.end(), d) - ys.begin();
      cout << G[d][c] - G[d][a] - G[b][c] + G[b][a] << endl;
    }
  }
  return 0;
}

Measured memory_bytes: 99072
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define REP(i,n) FOR(i,0,n)
#define FOR(i,a,b) for(ll i=a;i<b;i++)
#define PB push_back
#define LB lower_bound
#define UB upper_bound
#define PQ priority_queue
#define UM unordered_map
#define ALL(a) (a).begin(),(a).end()
typedef vector<ll> vi;
typedef vector<vector<ll>> vvi;
const ll INF = (1ll << 60);
typedef pair<ll,ll> pii;
typedef vector<vector<ll>> Graph;
typedef vector<pii> vpii;

int main() {
  string s; cin>>s;
  UM<char,ll> um;
  for(char c:s) um[c]++;
  if((um['N']>0)^(um['S']>0)) {puts("No"); return 0;}
  if((um['E']>0)^(um['W']>0)) {puts("No"); return 0;}
  puts("Yes");
}


Measured memory_bytes: 256
import java.awt.Frame;
import java.awt.image.SinglePixelPackedSampleModel;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.StringTokenizer;

import javax.print.attribute.standard.Chromaticity;
import javax.sql.rowset.FilteredRowSet;
import javax.swing.BorderFactory;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.stream.events.EndDocument;
import javax.xml.transform.Templates;

import java.math.BigInteger;
import java.time.chrono.MinguoChronology;
import java.util.Scanner;

public class Main {
  static InputReader in;
  static PrintWriter out;
  
  static class Solution {
    void solve() throws IOException {
      int N = in.nextInt();
      int cnt;
      int[] A = new int[N];
      for (int i = 0; i < N; i++) {
        A[i] = in.nextInt();
      }
      
      cnt = bubbleSort(A, N);
      
      for (int i = 0; i < N; i++) {
        out.print(A[i]);
        if (i != N - 1) {          
          out.print(" ");
        } else {
          out.print("\n");
        }
      }
      
      out.println(cnt);
//      End solve()
    }
    
    int bubbleSort(int[] A, int N) {
      int cnt = 0;
      
      boolean flg = true;
      while (flg) {
        flg = false;
        for (int i = N - 1; i > 0; i--) {
          if (A[i] < A[i - 1]) {
            int tmp = A[i];
            A[i] = A[i - 1];
            A[i - 1] = tmp;
            
            cnt++;
            flg = true;
          }
        }
        
      }
      return cnt;
    }
    
//  End solution
  } 
  

  public static void main(String[] args) throws IOException {
    in = new InputReader(System.in);
    out = new PrintWriter(System.out);
    Solution solver = new Solution();
    solver.solve();
    out.close();
}

  static class InputReader {
    public BufferedReader br;
    public StringTokenizer st;
    
    public InputReader(InputStream stream) {
      br = new BufferedReader(new InputStreamReader(stream));
    }
   
    public int nextInt() throws IOException {
      while (st == null || !st.hasMoreTokens()) {
        st = new StringTokenizer(br.readLine());
      }
      return Integer.parseInt(st.nextToken());
    }
    
    public long nextLong() throws IOException {
      while (st == null || !st.hasMoreTokens()) {
        st = new StringTokenizer(br.readLine());
      }
      return Long.parseLong(st.nextToken()); 
    }
    
    public String next() throws IOException {
      while (st == null || !st.hasMoreTokens()) {
        st = new StringTokenizer(br.readLine());
      }
      return st.nextToken();
    }
    
    public double nextDouble() throws IOException {
      while (st == null || !st.hasMoreTokens()) {
        st = new StringTokenizer(br.readLine());
      }
      return Double.parseDouble(st.nextToken());
    }
    
  }
  
}

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

int main(){
    int N;
    vector<int> L(N);
    cin>>N;
    for(int i=0; i<N; i++) cin>>L[i];

    int ans = 0;
    for(int i=0; i<N; i++){
        for(int j=i+1; j<N; j++){
            for(int k=j+1; k<N; k++){
                if(L[i] != L[j] && L[i] != L[k] && L[j]!= L[k]){
                    if(L[i] + L[j] > L[k] && L[j] + L[k] > L[i] && L[i] + L[k] > L[j]) ans++;
                }
            }
        }
    }

    cout<<ans<<endl;
}

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

using ll=long long;
#define int ll

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

int read(){
  int i;
  scanf("%lld",&i);
  return i;
}

bool is_prime(int n){
  if(n==0||n==1) return false;
  if(n==2) return true;
  for(int i=2;i*i<=n;i++){
    if(n%i==0) return false;
  }
  return true;
}

signed main(){
  while(true){
    int N=read(),P=read();
    if(N==-1&&P==-1) break;
    vector<int> prime;
    vector<int> matsuzaki;
    ++N;
    while(1){ // O(P)
      if(is_prime(N)){
        prime.push_back(N);
        REP(j,prime.size()){ // O(P)
          matsuzaki.push_back(prime[j]+N);
        }
        if(prime.size()>=P){
          break;
        }
      }
      N++;
    }
    sort(matsuzaki.begin(),matsuzaki.end());
    cout << matsuzaki[P - 1] << endl;
  }    
}

Measured memory_bytes: 3276
#include <iostream>
#include <string>
#include <cmath>
#include <algorithm>

long long int n;
long long int a[200000] = {0};

int main(void) {
  std::cin >> n;

  for (size_t i = 0; i < n; i++) {
    std::cin >> a[i];
    a[i] -= i + 1;
  }

  std::sort(a, a + n);

  long long int median = (n % 2 == 0) ? a[n/2-1] : a[(n+1)/2-1];

  long long int sum = 0;
  for (long long i = 0; i < n; i++) {
    //sum += abs(a[i] - (b + i + 1));
    sum += abs(a[i] - median);
  }

  std::cout << sum << std::endl;

  return 0;
}

Measured memory_bytes: 1792