akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <iomanip>
using namespace std;

int main(int argc, char *argv[]){
    double a,b,c,d,e,f;
	
	while(cin >> a>> b >> c>> d>> e >>f){
		double x,y;
		double b0,c0,e0,f0;

		b0=b*d; c0=c*d;
		e0=e*a; f0=f*a;
		
		y=(c0-f0)/(b0-e0);
		x=(c-b*y)/a;

		cout << fixed << setprecision(3) << x << " " << y << endl;
	}
    return 0;
}

Measured memory_bytes: 1280
#include<iostream>
#include<queue>

using namespace std;
static const int N=100;
static const int INF=(1<<21);

int n,M[N][N];
int d[N];

void bfs(int s){
  queue<int>q;
  q.push(s);
  for(int i=0;i<n;i++)d[i]=INF;
  d[s]=0;
  int u;
  while(!q.empty()){
    u=q.front();q.pop();
    for(int v=0;v<n;v++){
      if(M[u][v]==0)continue;
      if(d[v]!=INF)continue;
      d[v]=d[u]+1;
      q.push(v);
    }
  }

  for(int i=0;i<n;i++){
    cout<<i+1<<" "<<((d[i]==INF)? (-1):d[i])<<endl;
  }
}
int main(){
  int u,k,v;
  cin>>n;
  for(int i=0;i<n;i++){
    for(int j=0;j<n;j++)M[i][j]=0;
  }
  for(int i=0;i<n;i++){
    cin>>u>>k;u--;
    for(int j=0;j<k;j++){
      cin>>v;
      v--;M[u][v]=1;
    }
  }
  bfs(0);return 0;
}



Measured memory_bytes: 3144
#include<algorithm>
#include<iostream>
#include<cstring>
#include<cstdio>
#include<cmath>
#include<vector>
using namespace std;
vector<int>G;
int main()
{
    
	 char ss[100005];
     scanf("%s",ss);
     int ll = strlen(ss);
	 int ans=strlen(ss);
     for(int i=1;i<ll;i++)
     {
     	if(ss[i]!=ss[i-1]) ans=min(ans,max(i,ll-i));
     	
	 }
	 cout<<ans;
	return 0;
}

Measured memory_bytes: 384
#include <bits/stdc++.h>
#define MOD 1000000007
#define pb push_back
#define ll long long
using namespace std;
const int nmax=201234;

int n,h[nmax],mid,rmax;
ll a[nmax],res;

struct linetree
{
    int l,r;
    ll v;
} dp[4*nmax];

void build(int f)
{
    if(dp[f].l!=dp[f].r)
    {
        int mid=(dp[f].l+dp[f].r)/2;
        dp[2*f].l=dp[f].l;
        dp[2*f].r=mid;
        dp[2*f+1].l=mid+1;
        dp[2*f+1].r=dp[f].r;
        build(2*f);
        build(2*f+1);
    }
    else{
        if(rmax<f)
            rmax=f;
    }
}

ll solve(int pos)
{
    int i=1;
    res=0;
    while(dp[i].l!=dp[i].r)
    {
        mid=(dp[i].l+dp[i].r)/2;
        if(dp[i].v+a[pos]>res)
            res=dp[i].v+a[pos];
        if(h[pos]<=mid)
            i=2*i;
        else
            i=2*i+1;
    }
    if(dp[i].v+a[pos]>res)
        res=dp[i].v+a[pos];
    i=1;
    while(dp[i].l!=dp[i].r)
    {
        if(dp[i].l==h[pos])
            dp[i].v=res;
        mid=(dp[i].l+dp[i].r)/2;
        if(h[pos]<=mid)
        {
            if(dp[2*i+1].v<res)
                dp[2*i+1].v=res;
            i=2*i;
        }
        else
            i=2*i+1;
    }
    dp[i].v=res;
}

int main()
{
    scanf("%d",&n);
    for(int i=1; i<=n; ++i)
    {
        scanf("%d",&h[i]);
    }
    for(int i=1; i<=n; ++i)
    {
        scanf("%lld",&a[i]);
    }
    dp[1].l=1;
    dp[1].r=n;
    build(1);
    for(int i=1; i<=n; ++i)
    {
        solve(i);
    }
    res=0;
    for(int i=0; i<=rmax; ++i)
    {
        if(res<dp[i].v)
            res=dp[i].v;
    }
    printf("%lld",res);
    return 0;
}


Measured memory_bytes: 13184
N = int(input())
vN = sorted([int(x) for x in input().split()],reverse=True)

for n in range(N-1):
  vN[n] = vN[n] / (2 ** (n+1))
vN[-1] = vN[-1] / (2 ** ((N - 1)))
print(sum(vN))

Measured memory_bytes: 3060
#include <stdio.h>
int main()
{
    int x[4], y[4];
    scanf("%d %d %d %d",&x[0], &y[0], &x[1], &y[1]);
    x[2]=x[1]+y[0]-y[1];
    y[2]=y[1]+x[1]-x[0];
    x[3]=x[0]+y[0]-y[1];
    y[3]=y[0]+x[1]-x[0];
    printf("%d %d %d %d\n",x[2], y[2], x[3], y[3]);
}


Measured memory_bytes: 128
#include "bits/stdc++.h"
using namespace std;
//#define mx  100001
#define ll long long
#define llu long long unsigned
#define pb push_back
#define s(v) sort(v.begin(),v.end())


int main(){
    ll n,sum=0,mx=0;
    cin>>n;
    ll a[n+7];
    for(int i=0; i<n; i++)cin>>a[i];
    mx=a[0];
    for(int i=1; i<n; i++){
        if(a[i]<mx){
            sum+=mx-a[i];
        }
        else mx=a[i];
    }
    cout<<sum<<endl;
}
//1794102596


Measured memory_bytes: 5184
A=[]
for i in range(3):
    A.append(list(map(int,input().split())))

bingo=[[False for i in range(3)] for j in range(3)]
N=int(input())
for i in range(N):
    b=int(input())
    for i in range(3):
        for j in range(3):
            if A[i][j]==b:
                bingo[i][j]=True

flag=False
for i in range(3):
    if (bingo[i][0]&bingo[i][1]&bingo[i][2])|(bingo[0][i]&bingo[1][i]&bingo[2][i]):
        flag=True

if (bingo[0][0]&bingo[1][1]&bingo[2][2])|(bingo[0][2]&bingo[1][1]&bingo[2][0]):
    flag=True

if flag:
    print("Yes")
else:
    print("No")


Measured memory_bytes: 3064
a,b,c=map(int,input().split())
t=[abs(a-b)+abs(c-b),abs(c-a)+abs(b-c),abs(a-b)+abs(c-a),abs(c-b)+abs(a-c),abs(a-c)+abs(b-a),abs(b-c)+abs(a-b)]
print(min(t))


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

using namespace std;
#define MXX 305
typedef pair<int,int> ii;
vector<ii> adj[1000];
vector<int> t_adj[1000];
bool visited[1000];
long long adj_mat[MXX][MXX];


void add_edge(int u,int v,int c)
{
    adj[u].push_back(ii(c,v));
    adj[v].push_back(ii(c,u));

}

bool flag[MXX][MXX];

void floydwarshall(int n)
{

    for(int k=0; k<n; k++)
    {
        for(int i=0; i<n; i++)
        {
            for(int j=0; j<n; j++)
            {
                if(adj_mat[i][k]+adj_mat[k][j]<adj_mat[i][j])
                {
                    adj_mat[i][j]=adj_mat[i][k]+adj_mat[k][j];
                }
                else if(adj_mat[i][k]+adj_mat[k][j]==adj_mat[i][j] && i!=k && j!=k)
                {
                    flag[i][j]=true;
                }
            }
        }
    }
}

int main()
{
    int n;
    long long ans=0;

        cin>>n;
        int mat[n][n];
     for(int i=0; i<n; i++)
        {
            for(int j=0; j<n; j++)
            {
                cin>>mat[i][j];
                adj_mat[i][j]=mat[i][j];
            }
        }

        floydwarshall(n);
        bool f=false;
        for(int i=0; i<n; i++)
        {
            for(int j=i+1; j<n; j++)
            {

                if(adj_mat[i][j]!=mat[i][j])
                {
                    f=true;
                    break;
                }
                else if(!flag[i][j])
                ans+=adj_mat[i][j];
            }
        }
        if(f)
        cout<<-1<<endl;
        else cout<<ans<<endl;
}


Measured memory_bytes: 1408
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ld long double
#define sf scanf
#define pf printf
#define pb push_back
#define llu unsigned long long
#define U unsigned int
#define SIZE 1000002
#define pie 3.14159265358979323
#define minuss 1e-6
#define FAST ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)

int main()
{
    char a;
    cin>>a;
    char b=a+1;
    cout<<b<<endl;
}


Measured memory_bytes: 256
#include <iostream>

using namespace std;

#define MAXN 100
int a[MAXN];
int N;
int main(){
    cin >> N;
    for(int i=0;i<N;i++){
        cin >> a[i];
    }
    int count = 0;
    for(int i=0;i<N-1;i++){
        if(a[i]==a[i+1]){
            count++;
            a[i+1] = -1;
        }
    }
    cout << count << endl;
    return 0;
}

Measured memory_bytes: 256
#include <stdio.h>

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

    int A[1000];
    int i;
    for (i = 0; i < n; i++) scanf("%d", A + i);

    int q;
    scanf("%d", &q);

    int b, e, t, k, temp;
    while (q--) {
        scanf("%d %d %d", &b, &e, &t);
        for (k = 0; k < e - b; k++) {
            temp = A[b+k];
            A[b+k] = A[t+k];
            A[t+k] = temp;
        }
    }

    n--;
    for (i = 0; i < n; i++) printf("%d ", A[i]);
    printf("%d\n", A[n]);

    return 0;
}


Measured memory_bytes: 2088
#include<bits/stdc++.h>
#define ll long long int
#define MAX 1000003
#define pii pair<ll,ll>
#define VP vector< pii >
#define MOD 1000000007
#define mp make_pair
#define pb push_back
#define rep(i,a,b) for(ll (i) = (a); (i) < (b); (i)++)
#define all(v) (v).begin(),(v).end()
#define S(x) scanf("%d",&(x))
#define S2(x,y) scanf("%d%d",&(x),&(y))
#define SL(x) scanf("%lld",&(x))
#define SL2(x) scanf("%lld%lld",&(x),&(y))
#define P(x) printf("%d\n",(x))
#define FF first
#define SS second
using namespace std;

int main(){
		ll n;
		cin>>n;
		vector<vector<ll>>pts(n,vector<ll>(3)),dp(n,vector<ll>(3));
		rep(i,0,n)
			{
				rep(j,0,3)
					{
						cin>>pts[i][j];
					}
			}

		rep(i,0,3)
			dp[0][i]=pts[0][i];
		rep(i,1,n)
			{
				rep(j,0,3)
					{
						dp[i][j]=max(dp[i-1][(j+1)%3],dp[i-1][(j+2)%3])+pts[i][j];
					}
			}
		cout<<max(dp[n-1][0],max(dp[n-1][1],dp[n-1][2]));
 
return 0;
}

Measured memory_bytes: 11136
#include <stdio.h>
int main(void)
{
int W, H, i, j;

while(1){
scanf("%d %d",&H,&W);

if(H == 0 && W == 0)
break;

for(i = 0; i < W; i++)
   putchar('#');
printf("\n");

for(i = 0; H - 2 > i; i++){
printf("#");
   for(j = 0; W - 2 > j; j++)
putchar('.');
printf("#\n");
}
for(i = 0; i < W; i++)
   putchar('#');
printf("\n\n");
}
return 0;
}

Measured memory_bytes: 588
#include<iostream>
#include<cstdio>
#include<algorithm>
#include<vector>
using namespace std;
int n, m,t;
int a[5];
int main()
{
	cin >> t;
	if (t % 1000 == 0)
		cout << 0 << endl;
	else
	{
		m = t / 1000;
		m++;
		t = 1000 * m - t;
			cout << t << endl;
	}
}

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

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

    if (a > b){
        puts("0");
        return 0;
    }
    if (n == 1 && a != b){
        puts("0");
        return 0;
    }
    if (a == b){
        puts("1");
        return 0;
    }

    ll mi = a * (n-1) + b;
    ll ma = a + b*(n-1);
    ll ans = ma - mi +1;
    cout << ans << endl;


    return 0;
}


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

#define IOS          ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define endl         "\n"
#define int          long long
#define all(v)       v.begin(),v.end()
#define sz(v)        (int)v.size()
#define pii          pair<int,int>
#define fi           first
#define se           second
#define forn(i,a,b)  for(int i=a;i<b;i++)
#define deb(x)       cout << #x << ' ' << x << endl
#define clock        cerr << 1000 * (double)clock() / (double)CLOCKS_PER_SEC << "ms" << endl;

void INPUT() {
	#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    #endif
}

string s, t, f;
int cache[3005][3005];

int dp(int i, int j) {
	if (i < 0 || j < 0) return 0; 
	int &ans = cache[i][j];
	if (ans != -1) return ans;
	if (s[i] == t[j]) {
		ans = 1 + dp(i - 1, j - 1);
	}
	else ans = max(dp(i - 1, j), dp(i, j - 1));
	return ans;
}

int32_t main(){
    IOS //INPUT();
    cin >> s >> t;
    memset(cache, -1, sizeof(cache));
    dp(sz(s) - 1, sz(t) - 1);
    int  i = sz(s) - 1, j = sz(t) - 1;
    string ans;
    while (i >= 0 && j >= 0) {
    	if (s[i] == t[j]) {
    		ans += s[i];
    		i--; j--;
    	}
    	else {
    		if (i - 1 >= 0 && j - 1 >= 0) {
    			if (cache[i - 1][j] > cache[i][j - 1]) i--;
    			else j--;
    		}
    		else if (i - 1 >= 0) i--;
    		else if (j - 1 >= 0) j--;
    		else break;
    	}
    }
    reverse(all(ans));
    cout << ans << endl;
    return 0;
}

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

#define REP(i,m,n) for(int i=(m); i<(int)(n); i++)
#define RREP(i,m,n) for(int i=(int)((n)-1); i>=m; i--)
#define rep(i,n) REP(i,0,n)
#define rrep(i,n) RREP(i,0,n)
#define all(a) (a).begin(),(a).end()
#define rall(a) (a).rbegin(),(a).rend()
#define fi first
#define se second
#define debug(...) {cerr<<"[L"<<__LINE__<<"] "; _debug(__VA_ARGS__);}

template<typename T>
string join(const vector<T>&v, string del=", "){ stringstream s;
    for(auto x : v) s << del << x; return s.str().substr(del.size());
}
template<typename T>
ostream& operator<<(ostream& o, const vector<T>&v){
    if(v.size()) o << "[" << join(v) << "]"; return o;
}
template<typename T>
ostream& operator<<(ostream& o, const vector<vector<T> >&vv){
    int l = vv.size();
    if(l){ o<<endl; rep(i,l) o << (i==0 ? "[ " : ",\n  " ) << vv[i] << (i==l-1 ? " ]" : ""); }
    return o;
}
template<typename T1, typename T2>
ostream& operator<<(ostream& o, const pair<T1, T2>& p){
    return o << "(" << p.first << ", " << p.second << ")";
}
inline void _debug(){cerr<<endl;}
template<class First, class... Rest>
void _debug(const First& first, const Rest&... rest){cerr<<first<<" ";_debug(rest...);}

typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vl;
typedef vector<vl> vvl;

const double PI = (1*acos(0.0));
const double EPS = 1e-9;
const int INF = 0x3f3f3f3f;
const ll INFL = 0x3f3f3f3f3f3f3f3fLL;
const ll mod = 1e9 + 7;

inline void finput(string filename) {
    freopen(filename.c_str(), "r", stdin);
}

int main(){
    ios_base::sync_with_stdio(0);
    // finput("./input");
    int n; cin >> n;

    vi cnt(n+1,0);
    REP(i,1,n+1){
        for(int j=i; j<=n; j+=i){
            cnt[j] += 1;
        }
    }
    int ans = 0;
    rep(i,n) ans += cnt[i];
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 7220
package main

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

func main() {
	r := bufio.NewReader(os.Stdin)

	var n, p int
	fmt.Fscanf(r, "%d %d\n", &n, &p)

	var s string
	fmt.Fscanf(r, "%s\n", &s)

	if p == 2 || p == 5 {
		tot := int64(0)
		for i, ch := range s {
			d := int(ch - '0')
			if d%p == 0 {
				tot += int64(i + 1)
			}
		}
		fmt.Println(tot)
		return
	}

	mc := make(map[int][]int64)
	mi := make(map[int]int)

	for x := 0; x < p; x++ {
		if _, ok := mc[x]; ok {
			continue
		}

		t := x
		l := 0
		for i := 0; ; i++ {
			t = (t * 10) % p
			l++
			if t == x {
				break
			}
		}

		cyc := make([]int64, l)
		for i := 0; i < l; i++ {
			t = (t * 10) % p
			mc[t] = cyc
			mi[t] = i
		}
	}

	mc[0][mi[0]] = 1

	tot := int64(0)
	shifts := 0
	prev := 0

	for _, d := range s {
		norm := func(i, l int) int {
			j := ((shifts + l - 1) / l)
			return (i + j*l - shifts) % l
		}

		cur := (prev + int(d-'0')) % p
		a := mc[cur]
		i := norm(mi[cur], len(a))
		tot += a[i]
		a[i]++

		shifts++
		prev = (cur * 10) % p
	}

	fmt.Println(tot)
}


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

using namespace std;
int main() {
	int n, m;
	cin >> n >> m;
	vector<vector<int>> da(n, vector<int>(0));
	for (int i = 0;i < m;i++) {
		int x, y;
		cin >> x >> y;
		da[x - 1].push_back(y - 1);
	}
	int s, g;
	cin >> s >> g;
	vector < vector<int>> dp(3, vector<int>(n, -1));
	dp[0][s - 1] = 0;
	queue<pair<int, int>> qu;
	qu.push(make_pair(s - 1, 0));
	while (!qu.empty()) {
		pair<int, int> p = qu.front();
		qu.pop();
		int co = dp[p.second][p.first];
		vector<int> no = da[p.first];
		int si = no.size();
		for (int i = 0;i < si;i++) {
			int se = no[i];
			int gg = (p.second + 1) % 3;
			if (dp[gg][se] < 0) {
				dp[gg][se] = dp[p.second][p.first] + 1;
				qu.push(make_pair(se, gg));
			}
			else {
				dp[gg][se] = min(dp[p.second][p.first] + 1, dp[gg][se]);
			}
		}
	}
	if (dp[0][g - 1] < 0) {
		cout << -1 << endl;
	}
	else {
		cout << dp[0][g - 1]/3 << endl;
	}
}

Measured memory_bytes: 7296
import sys


def solve():
    readline = sys.stdin.buffer.readline
    mod = 10 ** 9 + 7
    wn, wm, l = list(map(int, readline().split()))
    inf = 10 ** 13
    wl = [[inf] * wn for _ in range(wn)]
    for i in range(wn):
        wl[i][i] = 0

    for i in range(wm):
        wa, wb, wc = list(map(int, readline().split()))
        wl[wa - 1][wb - 1] = wc
        wl[wb - 1][wa - 1] = wc

    for i in range(wn):
        for j in range(wn):
            for k in range(wn):
                wl[j][k] = min(wl[j][k], wl[j][i] + wl[i][k])

    inf = 10 ** 13
    wwl = [[inf] * wn for _ in range(wn)]
    for i in range(wn):
        wwl[i][i] = 0

    for i in range(wn):
        for j in range(wn):
            if i != j and wl[i][j] <= l:
                wwl[i][j] = 1

    for i in range(wn):
        for j in range(wn):
            for k in range(wn):
                wwl[j][k] = min(wwl[j][k], wwl[j][i] + wwl[i][k])
    q = int(readline())
    for i in range(q):
        s, t = list(map(int, readline().split()))
        print(wwl[s-1][t-1] - 1 if wwl[s-1][t-1] != inf else -1)


if __name__ == '__main__':
    solve()


Measured memory_bytes: 55132
import java.util.*;
import java.math.*;

public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		// 整数の入力
		long n = sc.nextLong();
		long k = sc.nextLong();
		System.out.println(n%k==0?0:1);




	}


	public static boolean cIstrue(BigDecimal cc){
		BigDecimal forty = new BigDecimal("140");
		BigDecimal fseventy = new BigDecimal("170");
		int yon=cc.compareTo(forty);
		int nana=cc.compareTo(fseventy);

			// System.out.println("if140  "+yon);
			// System.out.println("if170  "+nana);
		if(yon==(-1)||yon==0){
			// System.out.println("goalFalse"+cc);
			return false;
		}
		if(nana==(-1)){
			// System.out.println("goalTrue"+cc);
			return true;
		}
		if(nana==(1)||nana==0){
			BigDecimal two = new BigDecimal("2");
			return cIstrue(cc.divide(two));
		}
		return false;
	}
}

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

int main () {
  int N;
  cin >> N;
  vector<long> A(N);
  for (int i = 0; i < N; i++) {
    cin >> A.at(i);
  }
  int count = 0;
  for (int i = 0; i < N; i++) {
    while(A.at(i)%2 == 0) {
      count++;
      A.at(i) /= 2;
    }
  }
  cout << count << endl;
}

Measured memory_bytes: 384
strs = gets.to_s.split("")

cnt = 0

idx = 1
prev_idx = 0
prev_str = strs[0]

while idx < strs.size
  current_str = strs.slice(idx, idx - prev_idx).join
  idx += 1
  next if prev_str == current_str
  prev_idx = idx - 1
  prev_str = current_str
  cnt += 1
end
puts cnt


Measured memory_bytes: 23548
import itertools
class Bit:
    def __init__(self, n):
        self.size = n
        self.tree = [0] * (n + 1)
 
    def sum(self, i):
        s = 0
        while i > 0:
            s += self.tree[i]
            i -= i & -i
        return s
 
    def add(self, i, x):
        while i <= self.size:
            self.tree[i] += x
            i += i & -i
def invnum(n,a):
    bit=Bit(n)
    res=0
    for j in range(n):
        res+=j-bit.sum(a[j])
        bit.add(a[j],1)
    return res
N=int(input())
A=[int(i) for i in input().split()]
B=[int(i) for i in input().split()]
flag=0
M=-1
if N%2==0:
    M=N//2
else:
    M=N//2+1
ans=(N*(N-1))//2
for seq in itertools.combinations(range(N),M):
    X=[]
    Y=[]
    era=[0 for i in range(N)]
    for i in seq:
        if i%2==0:
            X.append((A[i],i))
        else:
            X.append((B[i],i))
        era[i]=1
    for i in range(N):
        if era[i]==0:
            if i%2==0:
                Y.append((B[i],i))
            else:
                Y.append((A[i],i))
    X.sort()
    Y.sort()
    L=[]
    if N%2==1:
        for i in range(M-1):
            L.append(X[i])
            L.append(Y[i])
        L.append(X[-1])
    else:
        for i in range(M):
            L.append(X[i])
            L.append(Y[i])
    #print(L)
    flag2=1
    for i in range(N-1):
        if L[i][0]>L[i+1][0]:
            flag2=0
            break
    if flag2==1:
        flag=1
        S=[L[i][1]+1 for i in range(N)]
        tmp=invnum(N,S)
        ans=min(tmp,ans)
if flag==1:
    print(ans)
else:
    print(-1)


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

ll x;

int main()
{
    cin >> x;
    
    ll res = 0;
    res += (x / 500LL) * 1000LL;
    x %= 500LL;
    res += (x / 5LL) * 5LL;
    cout << res << endl;
    
    return 0;
}

Measured memory_bytes: 256
#include <iostream>

int main() {

	unsigned long long N;
	std::cin >> N;

	unsigned long long amari = 0;
	unsigned long long last_amari = 7 % N;
	amari += last_amari;
	int cnt = 1;

	if (N % 2 == 0||N%5==0) {
		std::cout << -1 << std::endl;
		return 0;
	}

	while(amari) {
		last_amari *= 10;
		last_amari %= N;
		amari += last_amari;
		amari %= N;
		cnt++;
	}
	
	std::cout << cnt << std::endl;
	return 0;
}

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

int main()
{
	int a[100000+1],b[100000+1],s[100000+1];
	
	a[0]=0;a[1]=0;
	b[0]=0;b[1]=0;
	s[0]=0;
	for(int i=2;i<=100000;i++){
		a[i]=1;
		b[i]=0;
	}
	for(int i=2;i<=int(sqrt(100000));i++){
		if (a[i]==1){
			for(int j=2*i;j<=100000;j+=i) a[j]=0;
		}
	}
	for(int i=1;i<=100000;i++){
		if (i%2==1 && a[i]==1 && a[(i+1)/2]==1) b[i]=1;
		s[i]=s[i-1]+b[i];
	}
	int q,l,r;
	cin>>q;
	for(int i=1;i<=q;i++){
		cin>>l>>r;
		cout<<s[r]-s[l-1]<<endl;
	}
	return 0;
}

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

int main(){
        int ans = 0;
        string s; cin >> s;
        for(int i=0; i<s.size(); i++){
                for(int j=0; j<s.size(); j++){
                        int cnt = 0;
                        for(int k=i; k<=j; k++){
                                if(s[k]=='A' or s[k]=='C' or s[k]=='G' or s[k]=='T') cnt ++;
                                else cnt = -1e8;
                        }
                        ans = max(ans, cnt);
                }
        }
        printf("%d\n", ans);
        return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define pb push_back
#define fi first
#define se second
typedef pair<ll,ll> P;
#define Mod 1000000007
using VP = vector<P>; using VVP = vector<VP>;
using VI = vector<ll>; using VVI = vector<VI>; using VVVI = vector<VVI>;
#define INF 1234567890


int main(){
    ll i,j;
	ll a,b;
	cin>>a>>b;
	ll n=1;
	ll ans=0;
	while(n<b){
		n+=a;
		n--;
		ans++;
	}
	cout<<ans<<endl;
    

    return 0;   
}

Measured memory_bytes: 256
def resolve():
  n = int(input())
  a = int(input())
  b = int(input())
  c = int(input())
  d = int(input())
  e = int(input())

  x = min(a, b, c, d, e)
  ans = (n + x - 1) // x + 4
  print(ans)

  return

if __name__ == "__main__":
  resolve()


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

using namespace std;

static const long long MOD = 1000000007LL;

int n;
char s[100005];
long long dp[100005][13];

int main(void) {
    int i, j, ki;
    long long res = 0;

    scanf("%s", s);
    n = strlen(s);

    dp[0][0] = 1;
    for (i = 0; i < n; i++) {
        int c;
        if (s[i] == '?') {
            c = -1;
        } else {
            c = s[i] - '0';
        }

        for (j = 0; j < 10; j++) {
            if (c != -1 && c != j) {
                continue;
            }

            for (ki = 0; ki < 13; ki++) {
                dp[i + 1][(ki * 10 + j) % 13] += dp[i][ki];
            }
        }

        for (j = 0; j < 13; j++) {
            dp[i + 1][j] %= MOD;
        }
    }
    res = dp[n][5];

    cout << res << endl;
}

Measured memory_bytes: 10496
fun main(args : Array<String>) {
    val (A, B, C, D) = readLine()!!.split(" ").map { it.toLong() }

    val LCM = lcm(C, D)
    val allNumsBetweenRange = B - A + 1
    val cNums = countHowManyNumbersMultipledBy(C, A, B)
    val dNums = countHowManyNumbersMultipledBy(D, A, B)
    val lcmNums = countHowManyNumbersMultipledBy(LCM, A, B)
    println(allNumsBetweenRange - (cNums + dNums) + lcmNums)
}


// from, to inlucsive
fun countHowManyNumbersMultipledBy(multiplier: Long, from: Long, to: Long) : Long {
    val supplement = if (from.mod(multiplier) == 0L) 1 else 0
    return to / multiplier - from / multiplier + supplement
}


fun lcm(a: Long, b: Long) : Long {
    return a  / gcd(a, b) * b
}


fun gcd(a: Long, b: Long) : Long {
    if (b == 0L) {
        return a
    }
    return gcd(b, a % b)
}

Measured memory_bytes: 37992
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {

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

  public void run() {

    try(BufferedReader br = new BufferedReader(new InputStreamReader(System.in))) {

      int n = Integer.parseInt(br.readLine());
      Card[] cards = new Card[n];
      char suit;
      int  value;

      for ( int i=0; i<n; i++ ) {
        suit = (char)br.read(); br.skip(1);
        value = Integer.parseInt(br.readLine());
        cards[i] = new Card(suit, value, i);
      }

      quickSortOfCards(cards, 0, n-1);
      dispCardArray(cards);
    }
    catch(IOException e) {
      System.out.println("IOException!");
    }
  }

  public void quickSortOfCards(Card[] card, int p, int r) {

    if( p < r) {
      int q = partitionOfCards(card, p, r);
      quickSortOfCards(card, p, q-1);
      quickSortOfCards(card, q+1, r);
    }
  }

  public int partitionOfCards(Card[] card, int p, int r) {

    int x = card[r].value;
    int i = p-1;
    Card t;

    for(int j=p; j<r; j++) {
      if(card[j].value <= x) {
        t = card[++i]; card[i] = card[j]; card[j] = t;
      }
    }
    t = card[i+1]; card[i+1] = card[r]; card[r] = t;

    return i+1;
  }

public void dispCardArray(Card[] target) {
  StringBuilder s = new StringBuilder();
  int l=target.length;
  boolean isStable = true;
  String sortState = "Stable";

  s.append(target[0]).append("\n");
  for (int i=1; i<l; i++) {
    s.append(target[i]).append("\n");
    if(isStable && target[i-1].value == target[i].value 
      && target[i-1].storedNo > target[i].storedNo) {
      sortState = "Not stable";
      isStable = false;
    }
  }

  System.out.println(sortState);
  System.out.print(s);
  }
}

class Card {
  char suit;
  int value;
  int storedNo;

  public Card( char suit, int value, int storedNo ) {
    this.suit  = suit;
    this.value = value;
    this.storedNo = storedNo;
  }
  public Card( Card card ) {
    this(card.suit, card.value, card.storedNo);
  }

  @Override
  public String toString() {
    return suit + " " + String.valueOf(value);
  }
}


Measured memory_bytes: 65552
M=1000003
o=->a,n{n<1?1:(n%2>0?a:1)*o[a,n/2]**2%M}
f=f=1,*(1..M).map{|i|f=f*i%M}
gets
$<.map{|s|x,d,n=s.split.map &:to_i
p d<1?o[x,n]:M-n<=(t=x*o[d,M-2]%M-1)?0:f[t+n]*o[f[t],M-2]*o[d,n]%M}

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

#define INF_LL (int64)1e18
#define INF (int32)1e9
#define REP(i, n) for(int64 i = 0;i < (n);i++)
#define FOR(i, a, b) for(int64 i = (a);i < (b);i++)
#define all(x) x.begin(),x.end()
#define fs first
#define sc second

using int32 = int_fast32_t;
using uint32 = uint_fast32_t;
using int64 = int_fast64_t;
using uint64 = uint_fast64_t;
using PII = pair<int32, int32>;
using PLL = pair<int64, int64>;

const double eps = 1e-10;

template<typename A, typename B>inline void chmin(A &a, B b){if(a > b) a = b;}
template<typename A, typename B>inline void chmax(A &a, B b){if(a < b) a = b;}

template<typename T>
vector<T> make_v(size_t a){return vector<T>(a);}

template<typename T,typename... Ts>
auto make_v(size_t a,Ts... ts){
  return vector<decltype(make_v<T>(ts...))>(a,make_v<T>(ts...));
}

template<typename T,typename V>
typename enable_if<is_class<T>::value==0>::type
fill_v(T &t,const V &v){t=v;}

template<typename T,typename V>
typename enable_if<is_class<T>::value!=0>::type
fill_v(T &t,const V &v){
  for(auto &e:t) fill_v(e,v);
}

int main(void){
	cin.tie(0);
	ios::sync_with_stdio(false);
	int64 N, M;
	cin >> N >> M;
	vector<PLL> v(N);
	REP(i, v.size()) {
		int64 a, b;
		cin >> a >> b;
		v[i] = PLL(a, b);
	}
	sort(all(v));
	int64 now = 0, res = 0, idx = 0;
	while(now < M) {
		if (v[idx].sc == 0) idx++;
		now++;
		res += v[idx].fs;
		v[idx].sc--;
	}
	cout << res << endl;
}


Measured memory_bytes: 1792
#include<iostream>
using namespace std;
int main()
{

     int n,d;
     cin>>n;

     for(int i=1;i<=9;i++)
     {
          if(n%i==0 )
          {
               d=n/i;
               if(d<=9 && d>=1)
                    goto end;
          }
     }
     goto en;
     end:
          cout<<"Yes"<<endl;
          return 0;
          en:
            cout<<"No"<<endl;
            return 0;



}


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

using namespace std;

int main(){
	char str[3];
  	cin >> str;
    int flag = 0;
  	for(int i=0; i<3; i++){
      if(str[i] == '7'){
      		flag = flag+1;
      }
    }
  if(flag>0)
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
}

Measured memory_bytes: 3628
#include <bits/stdc++.h>
using namespace std;
#define fast ios_base::sync_with_stdio(0); cin.tie(NULL); cout.tie(NULL);
#define fr(i,a,b) for(ll i=a; i<b; i++)
#define fr1(i,a,b) for(ll i=a; i>=b; i--)
#define ll long long int
#define ld long double
#define vi vector<ll>
#define vii vector <pair<ll,ll> >
#define viii vector <pair<ll,pair<ll,ll> > >
#define pb push_back
#define all(v) (v).begin(),(v).end()
#define mp(i,j) make_pair(i,j)
#define fi first
#define se second
#define input(a,n) fr(i,0,n)cin>>a[i]
#define output(a,n) fr(i,0,n)cout<<a[i]<<endl
#define dbg cout<<"hurr"<<endl;
#define dbg2 cout<<"hurr2"<<endl;
#define md 1000000007
#define inf 999999999999999999
#define sp << " " <<
#define endl "\n"
#define pi 3.14159265358979323846
#define fixd(x) cout << fixed << setprecision(x);
#define sz size()
#define yes cout<<"YES"<<endl
#define no cout<<"NO"<<endl
#define tr(container, it) for(typeof(container.begin()) it = container.begin(); it != container.end(); it++)
bool compare(pair<ll,ll> p1,pair<ll,ll> p2){
return p1.se>p2.se;
}
void solve(){
ll l;
cin>>l;
double vol=((double)l*(double)l*(double)l)/27;
fixd(8);
cout<<vol<<endl;
}
int main()
{   fast;
    ll t=1;
    //cin>>t;
    while(t--){
        solve();
    }
}


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

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

	int T;

	cin >> T;

	while(T--)
	{
		unordered_map <long long int,__int128> dist;
		long long int n,a,b,c,d;

		cin >> n >> a >> b >> c >> d;
		dist[n] = 0;
		priority_queue <pair<__int128,__int128>,vector<pair<__int128,__int128>>,greater<pair<__int128,__int128>>> pque;
		pque.push(make_pair(dist[n],n));

		while(!pque.empty())
		{
			__int128 val = pque.top().second;
			pque.pop();
			if(val==0)
			{
				break;
			}
			__int128 temp = (val - val/2)*d;
			__int128 cost = min(temp,a + (val%2)*d);
			if(dist.find(val/2)==dist.end())
			{
				dist[val/2] = dist[val] + cost;
				pque.push(make_pair(dist[val/2],val/2));
			}
			else
			{
				if(dist[val/2] > dist[val] + cost)
				{
					dist[val/2] = dist[val] + cost;
					pque.push(make_pair(dist[val/2],val/2));						
				}
			}
			temp = (val - ((val/2) + 1))*d;
			cost = min(temp,a + (2 - (val%2))*d);
			if(dist.find((val/2) + 1)==dist.end())
			{
				dist[(val/2) + 1] = dist[val] + cost;
				pque.push(make_pair(dist[(val/2) + 1],(val/2) + 1));
			}
			else
			{
				if(dist[(val/2) + 1] > dist[val] + cost)
				{
					dist[(val/2) + 1] = dist[val] + cost;
					pque.push(make_pair(dist[(val/2) + 1],(val/2) + 1));					
				}
			}			
			temp = (val - (val/3))*d;
			cost = min(temp,b + (val%3)*d);
			if(dist.find(val/3)==dist.end())
			{
				dist[val/3] = dist[val] + cost;
				pque.push(make_pair(dist[val/3],val/3));
			}
			else
			{
				if(dist[val/3] > dist[val] + cost)
				{
					dist[val/3] = dist[val] + cost;
					pque.push(make_pair(dist[val/3],val/3));						
				}
			}
			temp = (val - (val/3 + 1))*d;
			cost = min(temp,b + (3 - (val%3))*d);
			if(dist.find((val/3) + 1)==dist.end())
			{
				dist[(val/3) + 1] = dist[val] + cost;
				pque.push(make_pair(dist[(val/3) + 1],(val/3) + 1));
			}
			else
			{
				if(dist[(val/3) + 1] > dist[val] + cost)
				{
					dist[(val/3) + 1] = dist[val] + cost;
					pque.push(make_pair(dist[(val/3) + 1],(val/3) + 1));						
				}
			}
			temp = (val - (val/5))*d;
			cost = min(temp,c + (val%5)*d);			
			if(dist.find(val/5)==dist.end())
			{
				dist[val/5] = dist[val] + cost;
				pque.push(make_pair(dist[val/5],val/5));
			}
			else
			{
				if(dist[val/5] > dist[val] + cost)
				{
					dist[val/5] = dist[val] + cost;
					pque.push(make_pair(dist[val/5],val/5));						
				}
			}
			temp = ((val - (val/5 + 1))*d);
			cost = min(temp,c + (5 -(val%5))*d);			
			if(dist.find((val/5) + 1)==dist.end())
			{
				dist[(val/5) + 1] = dist[val] + cost;
				pque.push(make_pair(dist[(val/5) + 1],(val/5) + 1));
			}
			else
			{
				if(dist[(val/5) + 1] > dist[val] + cost)
				{
					dist[(val/5) + 1] = dist[val] + cost;
					pque.push(make_pair(dist[(val/5) + 1],(val/5) + 1));						
				}
			}
		}

		/*
		for(int i=0;i<=n;i++)
		{
			cout << i << ' ' << dist[i] << '\n';
		}
		*/
		long long int res = min(dist[0],dist[1] + d);
		cout << res << '\n';
	}
	return 0;
}

Measured memory_bytes: 4560
#include <algorithm>
#include<stdio.h>
#include <cstdio>
#include <iostream>
#include <iomanip>
#include <string>
#include <algorithm>
#include <vector>
#include <math.h>
#include <stack>
#include <queue>
#include <deque>     
#include<map>
#include <set>
#include<math.h>
using namespace std;
#define int long long
#define ll long long
#define ld long double
#define rep(i,n) for(ll i=0;i<n;++i)
#define Rep(i,n) for(ll i=1;i<=n;++i)
#define loop(i,m,n) for(ll i=m;i<n;++i)
#define rev(i,n) for(ll i=n-1;i>=0;--i)
#define ggr getchar(); getchar();return 0;
#define pie 3.141592653589793238462643383279
#define elif else if
#define P pair<ll,ll>
#define prique priority_queue<ll>
#define all(a)  (a).begin(),(a).end()
const int mod = 1000000007;
const int mod2 = 998244353;
int bin(int bina) {
	int ans = 0;
	for (int i = 0; bina > 0; i++)
	{
		ans = ans + (bina % 2) * pow(10, i);
		bina = bina / 2;
	}
	return ans;
}
bool prime(int n) {
	for (ll i = 2; i <= sqrt(n); i++) {
		if (n % i == 0)return false;
	}
	return n != 1;
}
int gcd(int x, int y) {
	if (y == 0)return x;
	return gcd(y, x % y);
}
int lcm(int x, int y) {
	return x * y / gcd(x, y);
}
int kai(int x, int y) {
	int res = 1;
	for (int i = x - y + 1; i <= x; i++) {
		res *= i; res %= mod;
	}
	return res;
}
int mod_pow(int x, int y, int m) {
	int res = 1;
	while (y > 0) {
		if (y & 1) {
			res = res * x % m;
		}
		x = x * x % m;
		y >>= 1;
	}
	return res;
}
int comb(int x, int y) {
	if (y > x)return 0;
	return kai(x,y)* mod_pow(kai(y,y), mod - 2, mod) % mod;
}
int per(int n, int r) {
	r = n - r;
	int sum = 1;
	int i;
	for (i = n; i >= r + 1; i--)sum *= i;
	return sum;
}
struct UnionFind {
	vector<int> par;

	UnionFind(int n) : par(n, -1) { }

	int root(int x) {
		if (par[x] < 0) return x;
		else return par[x] = root(par[x]);
	}

	bool issame(int x, int y) {
		return root(x) == root(y);
	}

	bool merge(int x, int y) {
		x = root(x); y = root(y);
		if (x == y) return false;
		if (par[x] > par[y]) swap(x, y);
		par[x] += par[y];
		par[y] = x;
		return true;
	}

	int size(int x) {
		return -par[root(x)];
	}
};
//cout << fixed << setprecision(10) << num << endl;
int a[100010], b[100010], c[100010], s[100010], d[100010];
signed main() {
	int q, w, e;
	cin >> q >> w >> e;
	rep(i, q) {
		cin >> a[i];
	}
	rep(i, w) {
		cin >> b[i];
	}
	rep(i, e) {
		cin >> s[i] >> d[i] >> c[i];
	}
	int ans = mod;
	rep(i, e) {
		ans = min(ans, a[s[i] - 1] + b[d[i] - 1] - c[i]);
	}
	sort(a, a + q);
	sort(b, b + w);
	ans = min(a[0] + b[0], ans);
	cout << ans << endl;
}


Measured memory_bytes: 4096
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); i++)
using namespace std;
typedef long long ll;
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;}


int main(){
  string s,t;
  cin >> s >> t;
  int ans = 0;
  rep(i,s.size()-(t.size()-1)) {
    int cnt = 0;
    rep(j,t.size()) {
      if (s.at(i+j) == t.at(j)) {
        cnt++;
      }
    }
    ans = max(ans, cnt);
  }
  cout << (int)t.size() - ans << endl;
}


Measured memory_bytes: 3560
def isprime(x):
    import math
    if  x == 2:
        return True
    elif x < 2 or x % 2 == 0:
        return False
    else:
        i = 3
        while i <= math.sqrt(x):
            if x % i == 0:
                return False
            i += 2
        return True

N = int(input())
A=[]
for i in range(N):
    A.append(int(input()))
counter = 0
for i in range(0, N):
    if isprime(A[i]):
        counter += 1
        
print(counter)

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

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

	int ans = 0;
	if (x == 3) {
		ans += 100000;
	}
	else if (x == 2) {
		ans += 200000;
	}
	else if (x == 1) {
		ans += 300000;
	}

	if (y == 3) {
		ans += 100000;
	}
	else if (y == 2) {
		ans += 200000;
	}
	else if (y == 1) {
		ans += 300000;
	}

	if (x == 1 && y == 1) {
		ans += 400000;
	}

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

Measured memory_bytes: 256
import java.util.*;
import java.math.*;
import java.io.*;
import java.lang.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int k = sc.nextInt();
        int res = 0;
        if(k != 1){
            res = n-k;
        }
        System.out.println(res);


        sc.close();
    }
}

class io {
    public static void br() {
        System.out.println("");
    }

    public static void yesno(boolean f) {
        System.out.println(f ? "yes" : "no");
    }

    public static void YesNo(boolean f) {
        System.out.println(f ? "Yes" : "No");
    }

    public static void YESNO(boolean f) {
        System.out.println(f ? "YES" : "NO");
    }

}

class Algo {
    public static int nibutan(int target, int[] ar) {
        // ar[i] >= target なる最小のiを探す
        int res;
        int high = ar.length;
        int low = 0;
        while (high > low) {
            res = (high + low) / 2;
            if (ar[res] < target) {
                // ↑↓ここを変える
                low = res + 1;
            } else {
                // ↓ここを変える
                high = res;
            }
        }
        return low;
    }

    public static boolean isOdd(int n) {
        return n % 2 == 1;
    }

    public static boolean isEven(int n) {
        return n % 2 == 0;
    }


}



Measured memory_bytes: 22612
#include <bits/stdc++.h>
#define rep(i,n) for(long long int i = 0; i < n; i++)
#define print(n) std::cout << n << std::endl
#define _print(n) std::cout << n
using namespace std;
typedef long long ll;
const int N = 1000000;

int main() {
    int n,m; cin >> n >> m;
    print(n * (n-1)/2 + m * (m-1)/2 );
}


Measured memory_bytes: 256
import sys
input = sys.stdin.readline
n = int(input())
h = list(map(int, input().split()))
if len(h) == 0:
    print('Yes')
    exit()
ma = 0
ans = True
for hi in h:
    t = hi + 1
    if t < ma:
        ans = False
        break
    if ma < hi:
        ma = hi
if ans:
    print('Yes')
else:
    print('No')


Measured memory_bytes: 14168
def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])
    if temp!=1:
        arr.append([temp, 1])
    if arr==[]:
        arr.append([n, 1])
    return arr

n=int(input())
x=factorization(n)
ans=0

if n==1:
  print(0)
  exit()
for i in range(len(x)):
  p=x[i][1]
  j=1
  while True:
    if p>=j:
      p-=j
      ans+=1
      j+=1
    if p<j:
      break
print(ans)    
    




Measured memory_bytes: 9284
#include<iostream>
#include<vector>
#include<algorithm>
#include<iomanip>

using namespace std;

#define REP(i, n) for(int i = 0; i < n; i++)
#define REPR(i, n) for(int i = n; i >= 0; i--)
#define FOR(i, m, n) for(int i = m; i < n; i++)
#define PI 3.141592653589793238
#define INF 1050000000

using vi = vector<int>;


int main() {

	int N;

	cin >> N;

	vector<double> V(N);

	REP(i, N)cin >> V[i];

	sort(V.begin(), V.end());

	double ans = (V[0] + V[1]) / 2.0;

	FOR(i, 2,N) {
		ans = (ans + V[i]) / 2.0;
	}

	cout << fixed << setprecision(15) << ans << endl;

	return 0;
}

Measured memory_bytes: 256
# -*- coding: utf-8 -*-
ans=input()
a=0
b=0
c=0
for i in ans:
    if i=='a':
        a+=1
    elif i=='b':
        b+=1
    elif i=='c':
        c+=1

if a==1 and b==1 and c==1:
    print("Yes")
else:
    print("No")


"""
bac

Yes


bab

No

abc

Yes

aaa

No
"""

Measured memory_bytes: 3060
n = int(input())

if n == 1:
    print(0)
    exit()

import math
def div(m):
  d = {}
  temp = int(math.sqrt(m))+1
  for i in range(2, temp):
    while m%i== 0:
      m //= i
      if i in d:
        d[i] += 1
      else:
        d[i] = 1
  if d == {}:
    d[m] = 1
  else:
    if m in d:
      d[m] += 1
    elif m != 1:
      d[m] =1
  return d

D = {}
for i in range(2, n+1):
    d = div(i)
    for k, v in d.items():
        if k in D:
            D[k] += v
        else:
            D[k] = v
#print(D)

A = set()
B = set()
P = set()
Q = set()
R = set()
for k, v in D.items():
    if v >= 74:
        R.add(k)
    if v >= 24:
        P.add(k)
    if v >= 14:
        Q.add(k)
    if v >= 4:
        B.add(k)
    if v >= 2:
        A.add(k)

ans = 0
b = len(B)
for a in A:
    if a not in B:
        ans += b*(b-1)//2
    else:
        ans += (b-1)*(b-2)//2

p = len(P)
for a in A:
    if  a not in P:
        ans += p
    else:
        ans += p-1

q = len(Q)
for b in B:
    if b not in Q:
        ans += q
    else:
        ans += q-1

ans += len(R)
print(ans)

Measured memory_bytes: 3188
#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<bitset>
#include<stack>
#include<unordered_map>
#include<utility>
#include<cassert>
#include<complex>
#include<numeric>
using namespace std;

//#define int long long
typedef long long ll;

typedef unsigned long long ul;
typedef unsigned int ui;
constexpr ll mod = 1000000007;
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++)
#define all(v) (v).begin(),(v).end()
typedef pair<ll, ll> LP;
typedef long double ld;
typedef pair<ld, ld> LDP;
const ld eps = 1e-12;
const ld pi = acos(-1.0);

ll mod_pow(ll a, ll n, ll m = mod) {
	a %= m;
	ll res = 1;
	while (n) {
		if (n & 1)res = res * a%m;
		a = a * a%m; n >>= 1;
	}
	return res;
}

struct modint {
	ll n;
	modint() :n(0) { ; }
	modint(ll m) :n(m) {
		if (n >= mod)n %= mod;
		else if (n < 0)n = (n%mod + mod) % mod;
	}
	operator int() { return n; }
};
bool operator==(modint a, modint b) { return a.n == b.n; }
modint operator+=(modint &a, modint b) { a.n += b.n; if (a.n >= mod)a.n -= mod; return a; }
modint operator-=(modint &a, modint b) { a.n -= b.n; if (a.n < 0)a.n += mod; return a; }
modint operator*=(modint &a, modint b) { a.n = ((ll)a.n*b.n) % mod; return a; }
modint operator+(modint a, modint b) { return a += b; }
modint operator-(modint a, modint b) { return a -= b; }
modint operator*(modint a, modint b) { return a *= b; }
modint operator^(modint a, int n) {
	if (n == 0)return modint(1);
	modint res = (a*a) ^ (n / 2);
	if (n % 2)res = res * a;
	return res;
}

ll inv(ll a, ll p) {
	return (a == 1 ? 1 : (1 - p * inv(p%a, a)) / a + p);
}
modint operator/(modint a, modint b) { return a * modint(inv(b, mod)); }
const int max_n = 1 << 18;
modint fact[max_n], factinv[max_n];
void init_f() {
	fact[0] = modint(1);
	for (int i = 0; i < max_n - 1; i++) {
		fact[i + 1] = fact[i] * modint(i + 1);
	}
	factinv[max_n - 1] = modint(1) / fact[max_n - 1];
	for (int i = max_n - 2; i >= 0; i--) {
		factinv[i] = factinv[i + 1] * modint(i + 1);
	}
}
modint comb(int a, int b) {
	if (a < 0 || b < 0 || a < b)return 0;
	return fact[a] * factinv[b] * factinv[a - b];
}

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




void solve() {
	int n, m; cin >> n >> m;
	vector<int> h(n);
	rep(i, n)cin >> h[i];
	int ans = 0;
	vector<vector<int>> G(n);
	rep(i, m) {
		int a, b; cin >> a >> b; a--; b--;
		G[a].push_back(b);
		G[b].push_back(a);
	}
	rep(i, n) {
		bool valid = true;
		for (int to : G[i]) {
			if (h[to] >= h[i])valid = false;
		}
		if (valid)ans++;
	}
	cout << ans << "\n";
}


signed main() {
	ios::sync_with_stdio(false);
	cin.tie(0);
	//cout << fixed << setprecision(7);
	//init_f();
	//init();
	//experi();
	//int t; cin >> t; rep(i, t)solve();
	solve();
	stop
		return 0;
}

Measured memory_bytes: 12968
import math
def combinations_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))

n,k=map(int,input().split())

waru=(10**9)+7
# if n==k:
#     print(1)
#     for i in range(k-1):
#         print(0)
#     quit()

for i in range(k):
    if n-k+1<i+1:
        print(0)
    else:
        ans=combinations_count(n-k+1, i+1)
        ans*=combinations_count(k-1, i)
        print(ans%waru)

Measured memory_bytes: 66404
#include<bits/stdc++.h>
#define rep(i,n)  for(ll i=0; i<n; i++)
#define vi vector<int>
#define all(x) (x).begin(),(x).end()
#define INF 1e9
using ll = long long;
using namespace std;
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }

int main(){
  ll q,h,s,d,n; cin >> q >> h >> s >> d >> n;
  chmin(h,q*2);
  chmin(s,h*2);
  cout << (s*2<d ? n*s : (n/2)*d+(n%2)*s);
  cout << "\n";
  return 0;
}


Measured memory_bytes: 256
# Balance
import numpy as np

# libraries

# input
N = int(input())
W = list(map(int, input().split()))

# solve
diff = np.inf
for _ in range(len(W)):
    s1 = sum(W[:_])
    s2 = sum(W[_:])
    diff = min(diff, abs(s1-s2))

# output
print(diff)

Measured memory_bytes: 12424
while True:
    m,f,r = map(int,input().split())
    
    
    point = 0
    if m == -1 and f == -1 and r == -1:
        break
    
    point += m + f
    
    if m == -1 or f == -1:
        print("F")
    elif point >= 80:
        print("A")
    elif 80 > point and point >= 65:
        print("B")
    elif 65 > point and point >=50:
        print("C")
    elif 50 > point and point >=30:
        if r >= 50:
            print("C")
        else:
            print("D")
    else:
        print("F")


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

using ll=long long;

int main() {
  int N; cin >>N;
  vector<int> s(N);
  int ans=0;
  rep(i,0,N) {
    cin >>s[i];
    ans+=s[i];
  }
  if (ans%10) {
    cout <<ans <<endl;
    return 0;
  } else {
    sort(s.begin(),s.end());
    rep(i,0,N) {
      if (s[i]%10) {
        cout <<ans-s[i] <<endl;
        return 0;
      }
    }
  }
  cout <<0 <<endl;
  return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define fs first
#define sc second
#define pb push_back
#define mp make_pair
#define eb emplace_back
#define ALL(A) A.begin(),A.end()
#define RALL(A) A.rbegin(),A.rend()
typedef long long ll;
typedef pair<ll,ll> P;
const ll mod=1000000007;
const ll LINF=1LL<<60;
const int INF=1<<30;

int main(){
	ll n;
	cin >> n;
	vector<ll> a(n);
	ll min = LINF;
	ll c = 0;
	ll sum = 0;
	for(int i = 0; i < n; i++) {
		cin >> a[i];
		if (abs(a[i]) < min){
			min = abs(a[i]);
		}
		if(a[i] < 0){
			c++;
		}
		sum += abs(a[i]);
	}

	if (c % 2 == 1){
		sum -= 2 * min;
	}

	cout << sum << endl;


	return 0;
}

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

typedef unsigned long long ull;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<double, double> pdd;
const ull mod = 1e9 + 7;
#define REP(i,n) for(int i=0;i<(int)n;++i)

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

template < typename T >
void vprint(T &v){
	REP(i, v.size()){
		cout << v[i] << " ";
	}
	cout << endl;
}

ll dominate(ll A, ll B){
	ll Z = ~A & B;
	return (Z==0);
}

int main(){
	ll N, K;
	cin >> N >> K;
	vector<ll> A(N), B(N);
	REP(i, N) cin >> A[i] >> B[i];

	ll C = K;
	ll res = 0;
	REP(i, N){
		if(dominate(C, A[i])) res += B[i];
	}
	REP(i, 32){
		if(K>>i&1==1){
			C = K;
			C &= ~(1<<i);
			C |= (1<<i)-1;
			ll tmp = 0;
			REP(i, N){
				if(dominate(C, A[i])){
					tmp += B[i];
				}
			}
			res = max(res, tmp);
		}
	}
	cout << res << endl;
    return 0;
}

Measured memory_bytes: 1792