akhauriyash/Code-Regression huggingface dataset:
#include<bits/stdc++.h>
#define rep(i,n) for(int i=0;i<n;++i)
using namespace std;
using ll=long long;
constexpr ll mod=1000000007;
constexpr int inf=1000000000;
constexpr ll linf=1000000000000000000;

int main(){
    int n;
    scanf("%d",&n);
    map<int,int> mp;
    bool flag1=true;
    bool flag2=true;
    rep(k,n){
        int a;
        scanf("%d",&a);
        for(int i=2;i*i<=a;++i){
            if(a%i!=0)continue;
            while(a%i==0){
                a/=i;
            }
            if(mp[i]>0)flag1=false;
            ++mp[i];
        }
        if(a!=1){
            if(mp[a]>0)flag1=false;
            ++mp[a];
        }
    }
    if(flag1){
        cout<<"pairwise coprime\n";
    }
    else{
        for(auto e:mp){
            if(e.second==n)flag2=false;
        }
        if(flag2)cout<<"setwise coprime\n"<<endl;
        else cout<<"not coprime\n"<<endl;
    }
}


Measured memory_bytes: 7300
#include <bits/stdc++.h>
#include <cstdlib>
#include <cmath>
#include <algorithm>
using namespace std;
using ll = long long;
using P = pair<ll,ll>;
using Graph= vector<vector<ll>>;
struct edge{ll to ; ll cost ;} ;
using graph =vector<vector<edge>> ;
#define rep(i,n) for (ll i=0; i < (n); ++i)
#define rep2(i,n,m) for(ll i=n;i<=m;i++)
#define rep3(i,n,m) for(ll i=n;i>=m;i--)
#define pb push_back
#define eb emplace_back
#define ppb pop_back
#define mpa make_pair
#define fi first
#define se second 
#define set20 cout<<fixed<<setprecision(20) ;
const ll INF=1e18 ;
inline void chmax(ll& a,ll b){a=max(a,b);}
inline void chmin(ll& a,ll b){a=min(a,b);}
double pi=acos(-1) ;
ll gcd(ll a, ll b) { return b?gcd(b,a%b):a;}
ll lcm(ll a, ll b) { return a/gcd(a,b)*b;}
 

 int main(){
ll n , s ; cin>>n>>s ;
ll m = ll(sqrt(n)) ;
m ++ ;
if(n<s) cout<<-1<<endl ;
else if(n==s) cout<<n+1<<endl ;
else{ 
ll ans= -INF ;
rep2(i,2,m){
  ll now=0 ;
  ll base =n ;
  while(base>0){
  now+= base%i ;
  base/= i ;
  }
  if(now==s) {
    ans= i ;
    break ;
  }
}
 if(ans!= -INF) cout<<ans<<endl ;
 else{
  ll bns=-1 ;
  rep3(i,m,1){
    if(i<=s&& (n-(s-i))%i==0 && ((n-(s-i))/i)>i && s-i<(n-(s-i))/i){
      bns = (n-(s-i))/i ;
      break ;
    }
  }

  cout<<bns<<endl ;

 }
}
   return 0 ;
}



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

vector<vector<int>> graph(2005);

vector<int> bfs(int start, int n) {
  constexpr int INF = 1e9;
  queue<int> q;
  vector<int> dist(n, INF), reverse_graph(n, INF);
  dist[start] = 0;
  q.push(start);
  while (!q.empty()) {
    int from = q.front(); q.pop();
    for (int to : graph[from]) {
      if (dist[to] != INF) continue;  
      dist[to] = dist[from] + 1;
      reverse_graph[to] = from;
      q.push(to);
    }
  }
  pair<int, int> best(INF, -1);
  rep(v, n) {
    if (v == start) continue;
    for (int to : graph[v]) {
      if (to == start) best = min(best, make_pair(dist[v], v)); 
    }

  }
  if (best.first == INF) return vector<int>(n+1);
  int to = best.second;
  vector<int> res;
  while (to != INF) {
    res.push_back(to);
    to = reverse_graph[to];
  }
  return res; 
}

int main() {
  cin.tie(nullptr);
  ios::sync_with_stdio(false);
  cout << setprecision(20);

  int n, m;
  cin >> n >> m;
  rep(i, m) {
    int a, b;
    cin >> a >> b;
    --a; --b;
    graph[a].push_back(b); 
  }

  vector<int> ans(n+1);
  rep(i, n) {
    auto now = bfs(i, n);
    if (now.size() < ans.size()) ans = now;
  }
  if (ans.size() == n + 1) {
    cout << -1 << endl;
    return 0;
  }
  cout << ans.size() << endl;
  rep(i, ans.size()) {
    cout << ans[i] + 1 << endl;
  }
  return 0;
}


Measured memory_bytes: 512
l = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
K = int(input())
print(l[K - 1])

Measured memory_bytes: 3060
import core.bitop;
import std.algorithm;
import std.ascii;
import std.bigint;
import std.conv;
import std.functional;
import std.math;
import std.numeric;
import std.range;
import std.stdio;
import std.string;
import std.random;
import std.typecons;
import std.container;

alias sread = () => readln.chomp();
ulong bignum = 1_000_000_007;
alias SugarWater = Tuple!(long, "swater", long, "sugar");

T lread(T = long)()
{
    return readln.chomp.to!T();
}

T[] aryread(T = long)()
{
    return readln.split.to!(T[])();
}

void scan(TList...)(ref TList Args)
{
    auto line = readln.split();
    foreach (i, T; TList)
    {
        T val = line[i].to!(T);
        Args[i] = val;
    }
}

void main()
{
    long n, m;
    scan(n, m);
    auto lights = new long[][](m, n);
    foreach (i; iota(m))
    {
        auto k = aryread();
        foreach (s; k[1 .. $])
        {
            lights[i][s - 1]++;
        }
    }
    auto p = aryread();
    long count;
    // lights.writeln();
    foreach (i; 0 .. (1 << n))
    {
        long[] bits = i.bitary(n);
        bool check = true;
        foreach (j; iota(m))
        {
            long on;
            foreach (k; iota(n))
                on += bits[k] & lights[j][k];

            if (on % 2 != p[j])
                check = false;
        }
        if(check)
            count++;
    }
    count.writeln();
}

auto bitary(long n, long disit)
{
    auto ary = new long[](disit);
    long tmp;
    while (n > 0)
    {
        ary[tmp++] = n % 2;
        n = n >> 1;
    }
    ary.reverse();
    return ary;
}

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

int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);

	ll i,j,k,l,m,n,t;

	ll c,x,y;

	cin >> x >> y;

	if(y < 2*x)
	{
		cout << "No\n";
		return 0;
	}

	if((y-2*x)%2 != 0)
	{
		cout << "No\n";
		return 0;
	}

	t = (y-2*x)/2;

	c = x-t;

	if(c <0 || t < 0)
	{
		cout << "No\n";
		return 0;
	}

	cout << "Yes\n";

}

Measured memory_bytes: 3492
#include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <vector>
#include <cmath>
#include <queue>
#include <map>

using namespace std;

#define ll long long
#define db double
#define clr(a, b) memset(a, b, sizeof(a))

const int maxn = 5e5 + 10;
const int inf = 0x7ffffff;

void solve()
{
    ll n, m;
    cin >> n >> m;
    ll x;
    for (int i = 0; i < m;i++)
    {
        cin >> x;
        n -= x;
    }
    if(n<0)
        cout << "-1\n";
    else
        cout << n << "\n";
}

int main()
{
    //freopen("out","w",stdout);
    ios::sync_with_stdio(false);
    cin.tie(0);
    int T = 1;
    //cin >> T;
    while(T-- > 0)
        solve();

}

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

#define IOS ios::sync_with_stdio(false); cin.tie(0);
#define st first
#define nd second
#define endl '\n'
#define what_is(x) cerr << #x << " is " << x << endl;
#define what_is_v(x) cerr << #x << " is "; for(auto&e: (x)) cerr << e << ' '; cerr << '\n'; //vector, set
#define what_is_a(x, n) cerr << #x << " is "; for(int i=0;i<n;i++) cerr << x[i] << ' '; cerr <<  '\n'; //n first element of array
#define cerr_pair(x) '{' << x.st << ", " << x.nd << '}'
#define pwhat_is(x) cerr << #x << " is " << cerr_pair(x) << endl;
#define pwhat_is_v(x) cerr << #x << " is "; for(auto&e: (x)) cerr << cerr_pair(e) << ' '; cerr << '\n'; //vector, set
#define pwhat_is_a(x, n) cerr << #x << " is "; for(int i=0;i<n;i++) cerr << cerr_pair(x[i]) << ' '; cerr <<  '\n'; //n first element of array
// #define int long long
// #define pow mypow

typedef pair<int,int> pii;
const int N = 2e5+5;
const int INF = 1e9+5;
const int MOD = 1e9+7;

int n;
string s;
int left_white[N], right_red[N];
int32_t main()
{
	IOS
	cin >> n >> s;
	s = '*' + s;
	for(int i=1; i<=n; i++) 
		left_white[i] = left_white[i-1] + (s[i] == 'W');
	for(int i=n; i>=1; i--) 
		right_red[i] = right_red[i+1] + (s[i] == 'R');

	int ans = INF;
	for(int r=0; r<=n; r++){ //last position of red
		int min_operations = max(left_white[r], right_red[r+1]);
		ans = min(ans, min_operations);
	}
	cout << ans << endl;
	return 0;
}


Measured memory_bytes: 5336
#include<stdio.h>
int main(void)
{
    int a,b;
	while(scanf("%d",&a)!=EOF){
		b=a%39;
		if(b==0){
			printf("3C39\n");
		}
		else{ 
			printf("3C%02d\n",b);
		}
	}
	return 0;
}

Measured memory_bytes: 2564
import math

A,B,H,M=(int(x) for x in input().split())

rShort = H*30+M*0.5
rLong = M*6


ang=abs(rLong-rShort)



ang=min(ang,abs(360-ang))


ans=A*A+B*B-2*A*B*math.cos(math.radians(ang))

print(math.sqrt(ans))

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

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

    int h,w;
    char chars[2] = { '#', '.' };
    while(cin >> h >> w){
        if(h == 0 && w == 0)
            return 0;

        int row_switch = 0;
        int char_switch = 0;
        for (int row = 0; row < h; row++ ){
            if(row_switch == 0)
                char_switch = 0;
            else
                char_switch = 1;

            for(int col = 0; col < w; col++ ){
                cout << chars[char_switch];
                char_switch = (char_switch + 1) % 2;
            }
            cout << endl;
            row_switch = (row_switch + 1) % 2;
        }

        cout << endl;
    }

    return 0;
}

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

using namespace std;

int main()
{
    #ifdef LOCAL_EXEC
    #else
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    #endif // LOCAL_EXEC
    long long int n,i,j,k,x,y,z;
    cin>>n>>k;
    vector<pair<long long int,long long int> >vt[n+1];
    long long int A[n+1]={0},P[n+1]={0};
    for(i=1;i<=n;i++){
        cin>>A[i];
    }
    for(i=1;i<=n;i++){
        cin>>P[i];
    }
    for(i=1;i<=n;i++){
        bool visited[n+1]={false};
        x=i;
        while(visited[x]==false){
            visited[x]=true;
            vt[i].push_back({A[x],P[A[x]]});
//       cout<<A[x]<<" "<<P[A[x]]<<endl;
            x=A[x];
        }

    }
    for(i=1;i<=n;i++){
        for(j=1;j<vt[i].size();j++){
         vt[i][j].second+=vt[i][j-1].second;
        }
    }
    long long int result=-LONG_LONG_MAX;
     for(i=1;i<=n;i++){
        x=0;
        y=vt[i].size();
        if(k>vt[i].size()&&vt[i].back().second>0){
                x=vt[i].back().second*(k/vt[i].size());
            y=k%y;
            if(y==0){
                x=vt[i].back().second*(k/vt[i].size()-1);
                y=vt[i].size();
            }
        }
        for(j=0;j<min(k,y);j++){
         //cout<<x<<" ";

         result=max(result,x+vt[i][j].second);
        }
       //cout<<endl;
    }
    cout<<result;
    return 0;
}


Measured memory_bytes: 403692
import collections
n=int(input())
v=list(map(int,input().split()))
ve=v[0::2]
vo=v[1::2]

ce=collections.Counter(ve).most_common(2)
co=collections.Counter(vo).most_common(2)

if len(set(v))==1:
    ans=n//2
else:
    if ce[0][0]!=co[0][0]:
        ans=n-ce[0][1]-co[0][1]
    elif ce[0][0]==co[0][0] and len(ce)==1:
        ans=n//2-co[0][0]
    elif ce[0][0]==co[0][0] and len(co)==1:
        ans=n//2-ce[0][0]
    else:
        ans=n-max(ce[0][1],co[0][1])-max(ce[1][1],co[1][1])
print(ans)

Measured memory_bytes: 16564
#include<iostream>
#include<math.h>
#include<algorithm>
using namespace std;
int main()
{
	long long a, b, c;
	cin >> a >> b >> c;
	if (a % 2 == 0 || b % 2 == 0 || c % 2 == 0)cout << 0 << endl;
	else
	{
		int d = max(a, max(b, c));
		if (d == a)cout << b * c << endl;
		else if (d == b)cout << a * c << endl;
		else if (d == c)cout << b * a << endl;
	}
	return 0;
}


Measured memory_bytes: 256
from itertools import combinations_with_replacement
N,M,Q=map(int,input().split())
a=[0]*Q
b=[0]*Q
c=[0]*Q
d=[0]*Q
ans=0
for i in range(Q):
    a[i],b[i],c[i],d[i]=map(int,input().split())
    b[i]-=1
    a[i]-=1
for i in combinations_with_replacement(range(M),N):
    kari=0
    for j in range(Q):
        if i[b[j]]-i[a[j]]==c[j]:
            kari+=d[j]
    ans=max(kari,ans)
print(ans)

Measured memory_bytes: 9064
#include <cstdio>
#include <algorithm>
using namespace std;
int main(){
	//freopen("_inthenumberofper.txt","r",stdin);

	unsigned int per[100005];
	int N;
	scanf("%d",&N);
	int  i,j,count = 0;
	for(i=0;i<N;i++){
		scanf("%d",&per[i]);
		/*for(j = 0;j<i;j++){
			if(per[i]==per[j]){
				count -=2;
				per[i]=0;
				per[j]=0;
				break;
			}
		}*/
	}
	sort(per,per+N);
	count = N;
	for(i = 1;i<N;i++){
		if(per[i]==per[i-1]){
			count-=2;
			i++;
		}
	}
	printf("%d",count);
	return 0;
}

Measured memory_bytes: 512
#ABC 106 B
def make_divisors(n):
    divisors = []
    for i in range(1, int((n**0.5)+1)):
        if n % i == 0:
            divisors.append(n)
            if i != n //i:
                divisors.append(n//i)
    return divisors

n = int(input())
count = 0
for i in range(1, n+1, 2):
    if len(make_divisors(i)) == 8:
        count += 1
print(count)


Measured memory_bytes: 3060
n=int(input())
po,ne=[],[]
now=0
for i in range(n):
    p=0
    mp=0
    for j in input():
        p+=(1,-1)[j==")"]
        mp=min(p,mp)
    if mp:
        if p>=0:
            po.append((mp,p))
        else:ne.append((mp-p,-p))
    else:now+=p
po.sort(reverse=1)
ne.sort(reverse=1)
for m,p in po:
    if m+now<0:print("No");exit()
    else:now+=p
nnow=0
for m,p in ne:
    if m+nnow<0:print("No");exit()
    else:nnow+=p
print("Yes" if now==nnow else "No") 

Measured memory_bytes: 44512
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.IO;
using System.Text;
using System.Globalization;
using System.Diagnostics;
 

class Solve
{
    public Solve() { }
    public static int Main()
    {
        new Solve().calc();
        return 0;
    }
 
 
    Scanner cin;
 
    void calc()
    {
        cin = new Scanner();
        int N = cin.nextInt();
        int A = cin.nextInt();
        int B = cin.nextInt();
        var mod = new Modulo(3000);
 
        Console.WriteLine(N*A<B ? N*A : B);
    }
}
class Modulo
{
    private const int M = 1000000007;
    private readonly int[] m_facs;
    public int Mul(int a, int b)
    {
        return (int)(Math.BigMul(a, b) % M);
    }
    public Modulo(int n)
    {
        m_facs = new int[n + 1];
        m_facs[0] = 1;
        for (int i = 1; i <= n; ++i)
        {
            m_facs[i] = Mul(m_facs[i - 1], i);
        }
    }
    public int Fac(int n)
    {
        return m_facs[n];
    }
    public int Pow(int a, int m)
    {
        switch (m)
        {
        case 0:
            return 1;
        case 1:
            return a;
        default:
            int p1 = Pow(a, m / 2);
            int p2 = Mul(p1, p1);
            return ((m % 2) == 0) ? p2 : Mul(p2, a);
        }
    }
    public int Div(int a, int b)
    {
        return Mul(a, Pow(b, M - 2));
    }
    public int Ncr(int n, int r)
    {
        if (n < r) { return 0; }
        if (n == r) { return 1; }
        int res = Fac(n);
        res = Div(res, Fac(r));
        res = Div(res, Fac(n - r));
        return res;
    }
}
 
class Scanner
{
    string[] s;
    int i;
 
    char[] cs = new char[] { ' ' };
 
    public Scanner()
    {
        s = new string[0];
        i = 0;
    }
 
    public string next()
    {
        if (i < s.Length) return s[i++];
        string st = Console.ReadLine();
        while (st == "") st = Console.ReadLine();
        s = st.Split(cs, StringSplitOptions.RemoveEmptyEntries);
        if (s.Length == 0) return next();
        i = 0;
        return s[i++];
    }
 
    public int nextInt()
    {
        return int.Parse(next());
    }
    public int[] ArrayInt(int N, int add = 0)
    {
        int[] Array = new int[N];
        for (int i = 0; i < N; i++)
        {
            Array[i] = nextInt() + add;
        }
        return Array;
    }
 
    public long nextLong()
    {
        return long.Parse(next());
    }
 
    public long[] ArrayLong(int N, long add = 0)
    {
        long[] Array = new long[N];
        for (int i = 0; i < N; i++)
        {
            Array[i] = nextLong() + add;
        }
        return Array;
    }
 
    public double nextDouble()
    {
        return double.Parse(next());
    }
 
 
    public double[] ArrayDouble(int N, double add = 0)
    {
        double[] Array = new double[N];
        for (int i = 0; i < N; i++)
        {
            Array[i] = nextDouble() + add;
        }
        return Array;
    }
}


Measured memory_bytes: 11200
x1,y1,x2,y2 = list(map(int,input().split()))
 
a = x2-x1
b = y2-y1
y3 = y2 + a
x3 = x2 - b
y4 = y3 -b
x4 = x3 -a
 
print(x3,y3,x4,y4)

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

  ll N;
  int x;

int main(){
  cin >> N;
  x = N / 1000;

  if (x*1000 == N){
    cout << 0 << endl;
  }else{
  cout << (x+1)*1000 - N << endl;
  }

}

Measured memory_bytes: 3612
#include <iostream>

using namespace std;

int main()
{
	int a,b;
	cin >> a >> b;
	if(a==1)
	{
		a=14;
	}
	if(b==1)
	{
		b=14;
	}

	if(a<b)
	{
		cout <<"Bob"<<endl;
	}else if(b<a){
		cout<<"Alice"<<endl;
	}else{
		cout<<"Draw"<<endl;
	}
	return 0;
}

Measured memory_bytes: 256
/*
ID: 5ak0
PROG:
LANG: C++11
*/

#include <bits/stdc++.h>
#define fr first
#define sc second
#define pb push_back
#define mpr make_pair

using namespace std;

typedef long long ll;
typedef pair<int, int> pii;
const int INF = 1e9 + 7;

int n;
vector <ll> a, b;
set <ll> v;
ll ans;

int main(){
    #ifndef SAKO
    //freopen(".in", "r", stdin);
    //freopen(".out", "w", stdout);
    #endif // SAKO
    ios_base::sync_with_stdio(0);

    cin >> n;
    a.resize(n), b.resize(n + 1);
    for (int i = 0; i < n; ++i){
        cin >> a[i];
        b[a[i]] = i;
    }
    for (int i = 0; i < n; ++i){
        v.insert(b[i + 1]);
        auto itr = v.find(b[i + 1]);
        ll l = -1, r = -1;
        auto itr2 = itr;
        if (itr != v.begin())
            --itr2, l =* itr2;
        else
            l = -1;
        itr2 = itr;
        ++itr2;
        if (itr2 != v.end())
            r =* itr2;
        else
            r = n;
        ll tmp = (*itr - l) * (r - *itr) * (i + 1LL);
        ans += tmp;
    }
    cout << ans;

    return 0;
}


Measured memory_bytes: 12800
n = int(input())
d,x = map(int,input().split())
A = []
for _ in range(n):
    A.append(int(input()))
ans = 0
for a in A:
    i = 0
    tmp = a*i + 1
    while(tmp <= d):
        ans += 1
        i += 1
        tmp = a*i + 1
print(ans+x)

Measured memory_bytes: 3064
package main

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

const (
	maxBufsize = 1000000
)

func inputs(lines int, rdr *bufio.Reader) []string {
	var strSlice []string

	//rdr := bufio.NewReaderSize(os.Stdin, maxBufsize)

	for i := 0; i < lines; i++ {

		line := ReadLine(rdr)
		strSlice = append(strSlice, line)

	}

	return strSlice
}

// ReadLine is to read long line
func ReadLine(rdr *bufio.Reader) string {
	buf := make([]byte, 0, maxBufsize)
	for {
		l, p, e := rdr.ReadLine()

		if e != nil {
			panic(e)
		}
		buf = append(buf, l...)
		if !p {
			break
		}
	}

	return string(buf)
}

func main() {

	rdr := bufio.NewReaderSize(os.Stdin, maxBufsize)
	line0 := inputs(1, rdr)

	tmp := strings.Split(line0[0], " ")
	A, _ := strconv.Atoi(tmp[0])
	B, _ := strconv.Atoi(tmp[1])
	N, _ := strconv.Atoi(tmp[2])

	x := int(math.Min(float64(B-1), float64(N)))

	ans := A * x / B

	fmt.Println(ans)
}


Measured memory_bytes: 1816
#include <bits/stdc++.h>
#include <boost/range/adaptor/reversed.hpp>
#include <boost/range/algorithm/sort.hpp>
#include <boost/range/irange.hpp>

using namespace std;
using boost::irange;
using boost::sort;
using boost::adaptors::reversed;

int main() {
    int n, m;
    cin >> n >> m;
    vector<int> a(n);
    double sum = 0;

    for (int i = 0; i < n; i++) {
        cin >> a[i];
        sum += a[i];
    }
    sort(a, greater<int>());
    double b = sum / (4 * m);
    bool cond = a[m - 1] >= b;

    cout << (cond ? "Yes" : "No") << endl;

}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <iostream>
#include <vector>
#include <algorithm>
#include <set>
// #include <numeric>
#include <complex>
#include <tuple>

#define FAST ios_base::sync_with_stdio(false); cin.tie(0)
#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<int(b);++i)
#define rep(...) _overload3(__VA_ARGS__,repi,_rep,)(__VA_ARGS__)
#define repr(i, a, b) for(int i=int(a); i>=int(b); i--)
#define reps(i,n) for(int i=1;i<=int(n);++i)
#define RREP(i,x) for(int i=((int)(x)-1);i>=0;i--)
#define RREPS(i,x) for(int i=((int)(x));i>0;i--)
#define iceil(x,y) (x+y-1)/y
#define FOR(it,c) for(__typeof((c).begin()) it=(c).begin(); it!=(c).end(); ++it)
#define all(x) (x).begin(),(x).end()
#define UNIQUE(v) v.erase( unique(v.begin(), v.end()), v.end() )

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

using namespace std;
typedef long long int ll;
typedef unsigned long long int ull;
typedef pair<int, int> PII;
typedef pair<ll, ll> PLL;
typedef pair<int, PII> PP;

ll n;
ll p[110];

int main()
{
	FAST;

	cin >> n;
	rep(i,n) cin >> p[i];
	sort(p, p+n, std::greater<ll>());
	
	ll ans=0;
	ans += p[0]/2;
	rep(i,1,n) ans+=p[i];

	cout << ans <<"\n";

	return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<string>
#include<algorithm>
using namespace std;
static const int N = 1000;

int lcs(string X, string Y) {
  int c[N + 1][N + 1];
  int m = X.size();
  int n = Y.size();
  int maxl = 0;
  X = ' ' + X;
  Y = ' ' + Y;
  for ( int i = 0; i <= m; i++ ) c[i][0] = 0;
  for ( int j = 1; j <= n; j++ ) c[0][j] = 0;

  for ( int i = 1; i <= m; i++ )
    for ( int j = 1; j <= n; j++ ) {
      if ( X[i] == Y[j] )
        c[i][j] = c[i - 1][j - 1] + 1;
      else
        c[i][j] = max(c[i - 1][j], c[i][j - 1]);
      maxl = max(maxl, c[i][j]);
    }

  return maxl;
}

int main() {
  string s1, s2;
  int n; cin >> n;
  for ( int i = 0; i < n; i++ ) {
    cin >> s1 >> s2;
    cout << lcs(s1, s2) << endl;
  }
  return 0;
}


Measured memory_bytes: 7068
main = do
  [a,b,c] <- map read . words <$> getLine :: IO [Int]
  if a ^ 2 + b ^ 2 == c ^ 2
    then print $ a * b `div` 2
    else if a ^ 2 + c ^ 2 == b ^ 2
           then print $ a * c `div` 2
           else print $ b * c `div` 2


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

int main()
{
  int n; cin >> n;
  int a[n];
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }

  if (n == 1) {
    cout << a[0] << endl;
    return 0;
  }

  int i;
  for (i = n-1; i >= 0; i-=2) {
    cout << a[i] << " ";
  }

  i = (n % 2 != 0 ? i = 1 : i = 0);

  for (; i < n; i+=2) {
    cout << a[i] << " ";
  }

  cout << endl;
  return 0;
}


Measured memory_bytes: 3072
N, M = map(int, input().split())
S = list(map(int, input().split()))
T = list(map(int, input().split()))

MOD = 10**9 + 7

dp = [[1 for _ in range(M + 1)] for _ in range(N + 1)]
for i in range(1, N + 1):
    for j in range(1, M + 1):
        if S[i - 1] == T[j - 1]:
            dp[i][j] = (dp[i - 1][j] + dp[i][j - 1]) % MOD
        else:
            dp[i][j] = (dp[i - 1][j] + dp[i][j - 1] - dp[i - 1][j - 1]) % MOD

ans = dp[N][M]
print(ans)



Measured memory_bytes: 74460
#include<stdio.h>
#include<algorithm>
using namespace std;
char in[2];
int m[30][30];
int dp[101][21][21][1<<8];
int dx[]={1,0,-1,0};
int dy[]={0,1,0,-1};
int can[11][110];
int lis[11];
int con[11];
int main(){
	int a,b;
	while(scanf("%d%d",&b,&a),a){
		int sr,sc;
		for(int i=0;i<a;i++)for(int j=0;j<b;j++){
			scanf("%s",in);
			if(in[0]=='P'){sr=i;sc=j;}
			if(in[0]=='P'||in[0]=='.')m[i][j]=-1;
			else m[i][j]=in[0]-'0';
		}
		int c;scanf("%d",&c);
		for(int i=0;i<11;i++)for(int j=0;j<110;j++)can[i][j]=0;
		for(int i=0;i<c;i++){
			int p,q,r,s;
			scanf("%d%d%d%d",&p,&q,&r,&s);
			for(int j=r;j<s;j++)can[p][j]=max(can[p][j],q);
		}
		for(int i=0;i<11;i++)lis[i]=-1;
		int sz=0;
		for(int i=0;i<10;i++){
			bool ok=false;
			for(int j=0;j<101;j++)if(can[i][j])ok=true;
			if(ok){
				con[sz]=i;
				lis[i]=sz++;
			}
		}
		for(int i=0;i<101;i++){
			for(int j=0;j<a;j++)for(int k=0;k<b;k++)for(int l=0;l<(1<<sz);l++){
				dp[i][j][k][l]=-1;
			}
		}
		int ret=0;
		dp[0][sr][sc][0]=0;
		for(int i=0;i<100;i++){
			for(int j=0;j<a;j++)for(int k=0;k<b;k++)for(int l=0;l<(1<<sz);l++){
				if(!~dp[i][j][k][l])continue;
				ret=max(ret,dp[i][j][k][l]);
				for(int x=0;x<4;x++){
					if(j+dx[x]<0||j+dx[x]>=a||k+dy[x]<0||k+dy[x]>=b)continue;
					if(~m[j+dx[x]][k+dy[x]]){
						if(!~lis[m[j+dx[x]][k+dy[x]]])continue;
						if(l&(1<<lis[m[j+dx[x]][k+dy[x]]]))continue;
						dp[i][j][k][l+(1<<lis[m[j+dx[x]][k+dy[x]]])]=max(dp[i][j][k][l+(1<<lis[m[j+dx[x]][k+dy[x]]])],dp[i][j][k][l]+can[m[j+dx[x]][k+dy[x]]][i]);
					}else{
						dp[i+1][j+dx[x]][k+dy[x]][l]=max(dp[i+1][j+dx[x]][k+dy[x]][l],dp[i][j][k][l]);
					}
				}
			}
		}
		printf("%d\n",ret);
	}
}

Measured memory_bytes: 45432
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
# define mod 1000000007
# define INF (1 << 29)
# define MAX_N 1000010
/* ちゃんと考えてわかって実装 */

int main(void){
    string s;
    cin >> s;
    s[3] = '8';
    cout << s;
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <string> 
#include <math.h>
#include <set>
#include <vector>
#include <numeric>
#define rep(i,n) for(int i=0; i< (int)(n); ++i)
using namespace std;


int main(){
	cin.tie(0);
	ios::sync_with_stdio(false);
    
    int k, s;
    cin >> k >> s;

    int ans;
    for(int x=0; x <= k; ++x){
    	for(int y=0; y<= k; ++y){
    		int total = s - x - y;
    		if(0<=total and total <=k) ans++;
    	}
    }
    cout << ans << "\n";
} 


Measured memory_bytes: 256
import java.util.Scanner;

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

        char[] s = sc.next().toCharArray();
        int a = 0;
        int b = 0;

        for (int i = 0; i < s.length; i++) {
            if (s[i] == '0')
                a++;
            else if (s[i] == '1')
                b++;
        }

        System.out.println(Math.min(a, b) * 2);
    }
}

Measured memory_bytes: 26000
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define INF 1e9+7
#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
#define all(x) (x).begin(),(x).end()
ll min(ll a,ll b){
  if(a>b){
    return b;
    }
      else{
        return a;
      }
  }
  
  ll max(ll a,ll b){
    if(a>b){
      return a;
    }
    else{
      return b;
    }
  }

ll power(ll a,ll b){
 ll ans=1;
 for(ll i=1;i<=b;i++){
ans*=a;
  }
  return ans;
}

 ll gcd(ll m,ll n){
 	if(n==0){
       return m;
     }
   return gcd(n,m%n);
 }
ll lcm(ll a,ll b){
  ll g=gcd(a,b);
  return a/gcd(a,b)*b;
		

}
int main(){
ll N;
  cin>>N;
  
  vector<ll>A(N);
   rep(i,N){
    cin>>A[i];
  }
  
  double P=0;
  
  ll S=A[0];
 for(ll i=1;i<N;i++){
   S=lcm(S,A[i]);
   
  }
  
  
 
  
  rep(i,N){
    P+=S/A[i];
          }
    
  double ans=S*1.0/P;
  
  printf("%.14lf",ans);
 
}



Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define FOR(i,k,n) for(int i = (k); i < (n); i++)
#define REP(i,n) FOR(i,0,n)
#define ALL(a) begin(a),end(a)
#define MS(m,v) memset(m,v,sizeof(m))
#define D10  fixed<<setprecision(5)
typedef vector<int> vi;
typedef vector<string> vs;
typedef pair<short, short> P;
typedef complex<double> Point;
typedef long long ll;
const int INF = 114514810;
const int MOD = 100000007;
const double EPS = 1e-10;
const double PI = acos(-1.0);
struct edge
{
	int from, to, cost;
	bool operator < (const edge& e) const { return cost < e.cost; }
	bool operator >(const edge& e) const { return cost > e.cost; }
};
///*************************************************************************************///
///*************************************************************************************///
///*************************************************************************************///

int W, N, w[1005], v[1005];
P dp[1005][10005];

P solve(int i, int j)
{
	if (dp[i][j].first >= 0) return dp[i][j];
	if (i == N) return P(0, 0);
	P res;
	if (j < w[i]) res = solve(i + 1, j);
	else
	{
		P a = solve(i + 1, j);
		P b = solve(i + 1, j - w[i]);
		b.first += v[i]; b.second += w[i];
		if (a.first != b.first) res = max(a, b);
		else res = min(a, b);
	}

	return dp[i][j] = res;
}

int main()
{
	int cse = 0;
	while (cin >> W >> N, W)
	{
		cse++;
		MS(dp, -1);
		char c;
		REP(i, N) cin >> v[i] >> c >> w[i];
		cout << "Case " << cse << ":" << endl << solve(0, W).first << endl << solve(0, W).second << endl;

	}
}

Measured memory_bytes: 40576
#pragma GCC optimize(2)
#pragma GCC optimize(3)
#include<bits/stdc++.h>
using namespace std;
#define rint register int
#define rep(i,l,r) for(rint i=l;i<=r;i++)
#define per(i,l,r) for(rint i=l;i>=r;i--)
#define ll long long
#define ull unsigned long long
#define pii pair<int,int>
#define pll pair<ll,ll>
#define pb push_back
#define fir first
#define sec second
#define mset(s,t) memset(s,t,sizeof(s))
template<typename T1,typename T2>void ckmin(T1 &a,T2 b){if(a>b)a=b;}
template<typename T1,typename T2>void ckmax(T1 &a,T2 b){if(a<b)a=b;}
template<typename T>T gcd(T a,T b){return b?gcd(b,a%b):a;}
int read(){
  int x=0,f=0;
  char ch=getchar();
  while(!isdigit(ch))f|=ch=='-',ch=getchar();
  while(isdigit(ch))x=10*x+ch-'0',ch=getchar();
  return f?-x:x;
}
string s;
int main(){
  cin>>s;
  if(s[s.size()-1]=='s')s+="es";
  else s+="s";
  cout<<s;
}

Measured memory_bytes: 3636
from collections import deque

H,W = map(int,input().split())
Ch,Cw = map(lambda x:int(x)-1 ,input().split())
Dh,Dw = map(lambda x:int(x)-1 ,input().split())
grid = []
cost = []
INF = 10**9+7

for i in range(H):
    b = input()
    grid.append(b)
    c = [INF for _ in range(W)]
    cost.append(c)

p = (Ch,Cw)
dqe = deque([p])
cost[Ch][Cw] = 0
while len(dqe) != 0:
    x,y = dqe.popleft()
    comsumption = cost[x][y]
    for nx,ny in [(x-1,y),(x+1,y),(x,y-1),(x,y+1)]:
        if nx < 0 or nx >= H or ny < 0 or ny >= W:
            continue
        if grid[nx][ny] == '#':
            continue
        if cost[nx][ny] <= comsumption:
            continue
        cost[nx][ny] = comsumption
        np = (nx,ny)
        dqe.appendleft(np)
    
    for nx in range(x-2,x+3):
        for ny in range(y-2,y+3):
            if (nx == x and ny == y):
                continue
            if nx < 0 or nx >= H or ny < 0 or ny >= W:
                continue
            if grid[nx][ny] == '#':
                continue
            if cost[nx][ny] <= comsumption+1:
                continue
            cost[nx][ny] = comsumption+1
            np = (nx,ny)
            dqe.append(np)

ans = cost[Dh][Dw]
if ans == INF:
    ans = -1

print(ans)

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

using namespace std;
typedef long long ll;

#define out(ans) cout << ans << endl
#define in(n) cin >> n
#define floop(i, N) for (ll i = 0; i < N; i++)
#define floop1(i, N) for (ll i = 1; i <= N; i++)
#define floopi(i, j, N) for (ll j = i + 1; j < N; j++)

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

constexpr int inf = 1e9;
constexpr ll linf = 1e18;

void solve();

int main()
{
    solve();
}

void solve()
{
    int n;
    in(n);
    int sum = 0;
    int x[n];
    floop(i, n)
    {
        in(x[i]);
        sum += x[i];
    }
    sum /= n;
    ll ans = linf;
    floop(j, 101)
    {
        ll k = 0;
        floop(i, n)
        {
            k += (x[i] - j) * (x[i] - j);
        }
        chmin(ans, k);
    }
    out(ans);
}

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

using namespace std;

int n, k, x, p, a[200001];
double rez, s;

int main()
{
    cin >> n >> k;
    for (int i = 1; i <= n; ++i) cin >> a[i];
    for (int i = 1; i <= n; ++i)
    {
        p = a[i] * (a[i] + 1) / 2;
        s = s + (p * 1.0 / a[i]);
        if (i >= k)
        {
            p = a[i - k] * (a[i - k] + 1) / 2;
            if (i - k > 0) s -= p * 1.0 / a[i - k];
            if (s > rez) rez = s;
        }
    }
    cout << fixed << setprecision(7) << rez;
	return 0;
}


Measured memory_bytes: 1024
#include<bits/stdc++.h>
using namespace std;
static const int N_MAX = 200000;

void rec(int idx, int add, vector<int> nodes[], int counter[]){
    counter[idx] += add;
    for (int i=0;i<nodes[idx].size();i++){
        rec(nodes[idx][i],counter[idx],nodes,counter);
    }
}

void dfs( vector<int> nodes[], int counter[], int visited[]){
    stack<pair<int,int> > S;
    S.push(make_pair(1,0));
    while(S.size()){
        pair <int,int> p = S.top();
        S.pop();
        if (visited[p.first]==1){
            continue;
        }
        visited[p.first]=1;
        counter[p.first]+=counter[p.second];
        //cout << p.first << endl;
        for (int i=0;i<nodes[p.first].size();i++){
                S.push(make_pair(nodes[p.first][i],p.first));   
            }
    }

}

int main(){
    vector<int> nodes[N_MAX+1];
    int counter[N_MAX+1];
    int visited[N_MAX+1];
    int n,q;
    int a,b;
    cin >> n >> q;
    for (int i=0;i<n-1;i++){
        cin  >> a >>b;
        nodes[a].push_back(b);
        nodes[b].push_back(a);
    }


    for (int i=0;i<n;i++){
        counter[i+1]=0;
        visited[i+1]=0;
                
    }
    for (int i=0;i<q;i++){
        cin  >> a >>b;
        counter[a]+=b;
        
    }
    //rec(1,0,nodes,counter); //嘘解法
    dfs(nodes,counter,visited);
    for (int i=0;i<n;i++){
        if (i!=0)cout << " ";
        cout << counter[i+1];
    }
    cout << endl;

}


Measured memory_bytes: 15628
a,b,c,d=map(int, input().split())
#print(d-b,c-a)
dp=[[1]*(d-b+1) for _ in range(c-a+1)]
mod=998244353 
for h in range(1,c-a+1):
    dp[h][0]=pow(b,h,mod)
for w in range(1,d-b+1):
    dp[0][w]=pow(a,w,mod)
for w in range(1,d-b+1):
    for h in range(1,c-a+1):
        #print(dp[h][w-1]*(h+b+1),dp[h-1][w]*(w+a+1),dp[h-1][w-1]*(h+b-1)*(w+a-1))
        dp[h][w]=dp[h][w-1]*(h+a)+dp[h-1][w]*(w+b)-dp[h-1][w-1]*(w+b-1)*(h+a-1)
        dp[h][w]%=mod
#print(*dp)
print(dp[c-a][d-b])

Measured memory_bytes: 132948
var a:array[0..101,0..101] of longint;
    i,j,n,m:longint;
    ch:char;
begin
  readln(n,m);
  for i:=1 to n do
  begin
    for j:=1 to m do
    begin
      read(ch);
      if ch='#' then
      begin
        if a[i-1,j-1]<>-1 then inc(a[i-1,j-1]);
        if a[i-1,j]<>-1 then inc(a[i-1,j]);
        if a[i-1,j+1]<>-1 then inc(a[i-1,j+1]);
        if a[i,j-1]<>-1 then inc(a[i,j-1]);
        a[i,j]:=-1;
        if a[i,j+1]<>-1 then inc(a[i,j+1]);
        if a[i+1,j-1]<>-1 then inc(a[i+1,j-1]);
        if a[i+1,j]<>-1 then inc(a[i+1,j]);
        if a[i+1,j+1]<>-1 then inc(a[i+1,j+1]);
      end;
    end;
    readln;
  end;
  for i:=1 to n do
  begin
    for j:=1 to m do
    begin
      if a[i,j]=-1 then write('#')
      else write(a[i,j]);
    end;
    writeln;
  end;
end.

Measured memory_bytes: 128
#include<iostream>
#include<string>
#include<cstdio>
#include<vector>
#include<cmath>
#include<algorithm>
#include<functional>
#include<iomanip>
#include<queue>
#include<ciso646>
#include<random>
#include<map>
#include<set>
#include<complex>
#include<bitset>
#include<stack>
#include<unordered_map>
#include<utility>
using namespace std;
typedef long long ll;
typedef unsigned long long ul;
typedef unsigned int ui;
const ll mod = 1000000007;
typedef long double ld;
typedef complex<ld> Point;
const ll INF = mod * mod;
typedef pair<int, int> P;
#define stop char nyaa;cin>>nyaa;
#define rep(i,n) for(int i=0;i<n;i++)
#define per(i,n) for(int i=n-1;i>=0;i--)
#define Rep(i,sta,n) for(int i=sta;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
#define per1(i,n) for(int i=n;i>=1;i--)
#define Rep1(i,sta,n) for(int i=sta;i<=n;i++)
const ld eps = 1e-6;
const ld pi = acos(-1.0);
typedef pair<ld, ld> LDP;
typedef pair<ll, ll> LP;

void solve() {
	int n; ll t; cin >> n >> t;
	vector<ll> h(n);
	rep(i, n) {
		cin >> h[i];
	}
	vector<ll> ans(n);
	ll sum = 0, ma = 0;
	rep(i, n) {
		sum += h[i];
		ma = max(ma, h[i]);
		ll dif = t - sum;
		if (dif < 0)ans[i] = 1;
		else ans[i] = dif / ma + 2;
	}
	rep(i, n)cout << ans[i] << endl;
}

int main() {
	ios::sync_with_stdio(false);
	cin.tie(0);
	solve();
	//stop
	return 0;
}


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

typedef complex<double> P;
typedef pair<P, P> L;
typedef pair<P, double> C;

#define X real()
#define Y imag()
#define EPS (1e-10)
#define EQ(a,b) (abs((a) - (b)) < EPS)
#define EQV(a,b) ( EQ((a).X, (b).X) && EQ((a).Y, (b).Y) )
#define LE(n, m) ((n) < (m) + EPS)
#define GE(n, m) ((n) + EPS > (m))

#define fr first
#define sc second

double dot(P a, P b) {
    return (a.X * b.X + a.Y * b.Y);
}
double cross(P a, P b) {
    return (a.X * b.Y - a.Y * b.X);
}

int ccw(P a, P b, P c) {
    b -= a; c -= a;
    if( cross(b,c) > EPS ) return +1;
    if( cross(b,c) < -EPS ) return -1;
    if( dot(b,c) < 0 ) return +2;
    if( norm(b) < norm(c) ) return -2;
    return 0;
}

P crossp_ll(P a1, P a2, P b1, P b2) {
    double d1 = cross(b2-b1, b1-a1);
    double d2 = cross(b2-b1, a2-a1);
    if( EQ(d1,0) && EQ(d2,0) ) return a1; // same line
    if( EQ(d2,0) ) assert(false); // precondition not satisfied
    return a1 + d1 / d2 * (a2 - a1);
}

// ????§???¢??????????????? a, b, c ???????????????????????£??????????????????
P circumcenter(P a, P b, P c) {
    a = (a-c) * 0.5;
    b = (b-c) * 0.5;
    return c + crossp_ll(a, a*P(1,1), b, b*P(1,1));
}

int main() {
    int n; cin >> n;
    for(int i=0; i<n; i++) {
        P a, b, c;
        cin >> a.X >> a.Y >> b.X >> b.Y >> c.X >> c.Y;

        double x = abs(a-b), y = abs(b-c) , z = abs(c-a);
        double cos = (x * x + y * y - z * z) / (2 * x * y);
        double sin = sqrt(1 - cos * cos);
        double r = z / sin / 2;

        P s = circumcenter(a,b,c);
        s.X = round(s.X * 1000) / 1000;
        s.Y = round(s.Y * 1000) / 1000;
        r = round(r * 1000) / 1000;
        printf("%.3f %.3f %.3f\n",s.X, s.Y, r);
    }
    return 0;
}

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

typedef long long ll;
typedef unsigned long long ull;

#define F first
#define S second
#define ALL(a) a.begin(),a.end()
#define mp make_pair
#define pb push_back
#define FOR(i,a,b) for(int i=a;i<b;i++)
#define FORN(i,a,b) for(int i=a;i<=b;i++)
#define INT_MAXI 2147483647
#define INT_MINI -2147483648
#define REV(a) reverse(a.begin(),a.end())
#define NP(a) next_permutation(a.begin(),a.end())

typedef pair<int,int> pi;
typedef pair<ll,ll> pl; 

int main(){
	ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
	//cout<<"input"<<endl;freopen("input.txt","r",stdin);
	//cout<<"output"<<endl;freopen("output.txt","w",stdout);

	string x,y;
	cin>>x>>y;
	int sum = y.size();
	for(int i=0;i<x.size() - y.size() + 1;i++){
		int temp = 0;
		for(int j=0;j<y.size();j++){
			if(x[i+j]!=y[j])
				temp+=1;
		}
		sum = min(sum , temp );
		
	}
	cout<<sum<<endl;

	return 0;
}

Measured memory_bytes: 3616
package main

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

var sc = bufio.NewScanner(os.Stdin)

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

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

func main() {
	sc.Split(bufio.ScanWords)
	var a, b int
	a = nextInt()
	b = nextInt()

	leftA := float64(a) / 0.08
	rightA := float64(a+1) / 0.08
	leftB := float64(b) / 0.1
	rightB := float64(b+1)/0.1 - 1

	if a%2 != 0 {
		leftA++
		rightA--
	}

	//fmt.Println(leftA, leftB, rightA, rightB)
	ans := -1
	if leftA < leftB {
		for i := int(leftA); i <= int(rightA); i++ {
			if i == int(leftB) {
				ans = i
				break
			}
		}
	} else {
		for i := int(leftB); i <= int(rightB); i++ {
			if i == int(leftA) {
				ans = i
				break
			}
		}
	}

	fmt.Println(ans)

}


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

using namespace std;
using ll = long long;

const int N = 200005;

int main() {
	long double a, b, h, m;
	cin >> a >> b >> h >> m;
	long double x1, y1, x2, y2, a1, a2;
	long double t = 60 * h + m;
	long double tot = 60 * 12;
	a1 = t / tot * 2 * acosl(-1);
	a2 = m / 60 * 2 * acosl(-1);
	a1 = 2*acosl(-1) - a1;
	a2 = 2*acosl(-1) - a2;
	x1 = -sinl(a1) * a;
	y1 = cosl(a1) * a;
	x2 = -sinl(a2) * b;
	y2 = cosl(a2) * b;

	long double dx = x1 - x2, dy = y1 - y2;
	long double ans = sqrtl(dx * dx + dy * dy);
	cout << fixed << setprecision(20) << ans << endl;
}


Measured memory_bytes: 4168
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.StringTokenizer;

/**
 * for (int i = 0; i < N; i++) {}
 * System.out.println();
 * @author mj
 *
 */
public class Main implements Runnable { //クラス名はMain2

	public static void main(String[] args) {
		Thread.setDefaultUncaughtExceptionHandler((t, e) -> System.exit(1));
		new Thread(null, new Main(), "", 16 * 1024 * 1024).start(); //16MBスタックを確保して実行
	}

	public void run() {
		FastScannerMain2 sc = new FastScannerMain2(System.in);

		try {
			long N = sc.nextLong();
			long A = sc.nextLong();
			long B = sc.nextLong();
			long ans = 0;

			if (A == 0 || (A == 0 && B == 0)) {
				ans = 0;
			} else {
				long sumA = 0;
				long num = N / (A + B);
				long num2 = N % (A + B);

				sumA += num * A;

				if (num2 > A) {
					sumA += A;
				} else {
					sumA += num2;
				}

				ans = sumA;

				if (A == 0) {
					ans = 0;
				}
			}

			System.out.println(ans);
		} catch (Exception e) {
			e.printStackTrace();
		}

	}
}

//高速なScanner
class FastScannerMain2 {
	private BufferedReader reader = null;
	private StringTokenizer tokenizer = null;

	public FastScannerMain2(InputStream in) {
		reader = new BufferedReader(new InputStreamReader(in));
		tokenizer = null;
	}

	public String next() {
		if (tokenizer == null || !tokenizer.hasMoreTokens()) {
			try {
				tokenizer = new StringTokenizer(reader.readLine());
			} catch (IOException e) {
				throw new RuntimeException(e);
			}
		}
		return tokenizer.nextToken();
	}

	public String nextLine() {
		if (tokenizer == null || !tokenizer.hasMoreTokens()) {
			try {
				return reader.readLine();
			} catch (IOException e) {
				throw new RuntimeException(e);
			}
		}
		return tokenizer.nextToken("\n");
	}

	public long nextLong() {
		return Long.parseLong(next());
	}

	public int nextInt() {
		return Integer.parseInt(next());
	}

	public double nextDouble() {
		return Double.parseDouble(next());
	}

	public int[] nextIntArray(int n) {
		int[] a = new int[n];
		for (int i = 0; i < n; i++)
			a[i] = nextInt();
		return a;
	}

	public long[] nextLongArray(int n) {
		long[] a = new long[n];
		for (int i = 0; i < n; i++)
			a[i] = nextLong();
		return a;
	}
}


Measured memory_bytes: 28500
#include<iostream>
#include<vector>
#include<string>
#include<algorithm>
using namespace std;
typedef long long int ll;
#define rep(i,n) for(int i=0;i<(int)n;i++)
#define all(a) (a).begin(),(a).end()
#define allg(a) (a).begin(),(a).end(),greater<>()
#define SUM(a) accumulate((a).begin(),(a).end(),0)

int main(void) {
	int ans = 0;
	int n; cin >> n;
	vector<int> v(n); rep(i, n)cin >> v[i];
	sort(allg(v));
	bool flag = 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 (v[i] < v[j] + v[k])ans++;
				else {
					break;
					flag = 1;
				}
			}
			if (flag) {
				flag = 0;
				break;
			}
		}
	}
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 256
// 12/07/2020  @ 19:54:17
// *****************************************************************
// *****************************************************************
#include <bits/stdc++.h>
// *****************************************************************
// *****************************************************************
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); srand(chrono::high_resolution_clock::now().time_since_epoch().count());
#define fr(i,n) for(llu i=0;i<n;i++)
#define fl(j,a,b) for(llu j=a;j<=b;j++)
#define Pi 3.1415926535897932384626
#define mod 1e9+7
#define MID(a,b) ((a + b) >> 1)
#define MAX(a,b) ((a) > (b) ? (a): (b))
#define MIN(a,b) ((a) < (b) ? (a) :(b))
#define pb push_back
#define mp make_pair
#define deb(x) cout << #x << "=" << x << endl
#define deb2(x, y) cout << #x << "=" << x << "," << #y << "=" << y << endl
#define all(x) x.begin(), x.end()
#define vi vector<int>
#define vl vector<ll>
#define pi pair<int, int>
#define pl pair<ll, ll>
#define printer(a, n) fr(i,n) cout << a[i] << " ";
// *****************************************************************
// *****************************************************************
typedef long long unsigned int llu;
typedef long long int ll;
// *****************************************************************
// *****************************************************************
using namespace std;
// *****************************************************************
// *****************************************************************

                   // Dream it. Wish it. Do it.

                         // tannatsri //

              // Without tact you can learn nothing.

// *****************************************************************
// *****************************************************************
bool rev(ll a, ll b) {
    return a > b;
}
// *****************************************************************
void solution() {
	int a[5];
	fr(i, 5) cin >> a[i];
	cout << (find(a,a +5, 0) - a )+ 1;

}
// *****************************************************************
int main() {
    IOS;
    // #ifndef ONLINE_JUDGE
        // freopen("C:/Users/Mr.Tanishq/Desktop/noc/input.txt", "r", stdin);
        // freopen("C:/Users/Mr.Tanishq/Desktop/noc/output.txt", "w", stdout);
        // freopen("C:/Users/Mr.Tanishq/Desktop/noc/error.txt", "w", stderr);
    // #endif
    // *****************************************************************
    // *****************************************************************
    int t = 1;
    // cin >> t;
    while(t--) {

       solution();
       cout << "\n";
    }
    return 0;
}

Measured memory_bytes: 3576
#include <bits/stdc++.h>
#define fi first
#define se second
#define rep(i,n) for(int i = 0; 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 rng(a) a.begin(),a.end()
#define sz(x) (int)(x).size()
#define uni(x) x.erase(unique(rng(x)),x.end())
#define show(x) cout<<#x<<" = "<<x<<endl;
#define PQ(T) priority_queue<T,v(T),greater<T> >
#define newline puts("")
#define v(T) vector<T>
#define vv(T) v(v(T))
#define chmin(x,y) x=min(x,y)
#define chmax(x,y) x=max(x,y)
#define EPS (1e-10)
#define equals(a, b) (fabs((a)-(b)) < EPS)
using namespace std;
typedef long long int ll;
typedef pair<int,int> P;
typedef set<int> S;
typedef queue<int> Q;
typedef queue<P> QP;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vl;
typedef vector<P> vp;
typedef vector<double> vd;
typedef pair<double,double> PD;
typedef pair<int,P> ed;
const ll LINF = 1001002003004005006ll;
const int INF = 1001001001;
const int MOD = 1000000007;

struct mint {
  ll x;
  mint():x(0){}
  mint(ll x):x((x%MOD+MOD)%MOD){}
  mint& fix() { x = (x%MOD+MOD)%MOD; return *this;}
  mint operator-() const { return mint(0) - *this;}
  mint& operator+=(const mint& a){ if((x+=a.x)>=MOD) x-=MOD; return *this;}
  mint& operator-=(const mint& a){ if((x+=MOD-a.x)>=MOD) x-=MOD; return *this;}
  mint& operator*=(const mint& a){ (x*=a.x)%=MOD; return *this;}
  mint operator^(int b) {mint res = 1;while(b > 0) {if(b&1) {res = (res*(*this));}*this=(*this)*(*this);b>>=1;} return res;}
  mint operator+(const mint& a)const{ return mint(*this) += a;}
  mint operator-(const mint& a)const{ return mint(*this) -= a;}
  mint operator*(const mint& a)const{ return mint(*this) *= a;}
  bool operator<(const mint& a)const{ return x < a.x;}
  bool operator==(const mint& a)const{ return x == a.x;}
};
typedef vector<mint> vm;
typedef vector<vm> vvm;
  
int main() {
  int N;
  cin >> N;
  vi A(N);
  vi sum(N,0);
  rep(i,N) {
    cin >> A[i];
    sum[A[i]]++;
  }
  mint ans = 1;
  if(N&1) {
    if(sum[0]!=1) {
      cout << 0 << endl;
      return 0;
    }
    srep(i,1,(N+1)/2) {
      if(sum[i*2]!=2) {
        cout << 0 << endl;
        return 0;
      }
      ans *= 2;
    }
  } else {
    rep(i,N/2) {
      if(sum[i*2+1]!=2) {
        cout << 0 << endl;
        return 0;
      }
      ans *= 2;
    }
  }
  cout << ans.x << endl;
  return 0;
}

Measured memory_bytes: 1024