akhauriyash/Code-Regression huggingface dataset:
#include <cstdio>
#include <iostream>
#include <algorithm>
#include <cstring>
#include <string>
#include <vector>
#include <set>
#include <map>
#include <utility>
#include <cstdlib>
#include <memory>
#include <queue>
#include <cassert>
#include <cmath>
#include <ctime>
#include <complex>
#include <bitset>
#include <fstream>
#include <unordered_map>
#include <unordered_set>
#include <numeric>

using namespace std;

#define ws ws_____________________
#define y1 y1_____________________
#define y0 y0_____________________
#define left left_________________
#define right right_______________
#define next next_________________
#define prev prev_________________
#define hash hash_________________

#define pb push_back
#define fst first
#define snd second
#define mp make_pair 
#define sz(C) ((int) (C).size())
#define forn(i, n) for (int i = 0; i < int(n); ++i)
#define ford(i, n) for (int i = int(n) - 1; i >= 0; --i)
#define all(C) begin(C), end(C)

typedef long long ll;
typedef unsigned long long ull;
typedef unsigned int uint;
typedef pair<int,int> pii;
typedef pair<ll, ll> pll;
typedef vector<ll> vll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<pii> vii;
typedef long double ld;
typedef complex<double> cd;

#ifdef LOCAL
#define eprintf(args...) fprintf(stderr, args), fflush(stderr)
#else
#define eprintf(...) ;
#endif

#define FILE_NAME "a"

int k;
vi a;

bool read() {
	if  (scanf("%d", &k) < 1) {
		return 0;
	}
	a.resize(k);
	forn(i, k) {
		scanf("%d", &a[i]);
	}
	return 1;
}

const ll INF = 1e18;

ll go(ll n) {
	forn(i, k) {
		n -= n % a[i];
	}
	return n;
}

void solve() {
	ll L = -1;
	ll R = INF;
	while (L != R - 1) {
		ll M = (L + R) / 2;
		if  (go(M) < 2) {
			L = M; 
		} else {
			R = M;
		}
	}

	ll mn = R;

	L = -1;
	R = INF;
	while (L != R - 1) {
		ll M = (L + R) / 2;
		if (go(M) <= 2) {
			L = M;
		} else {
			R = M;
		}
	}

	ll mx = L;

	if  (mn <= mx) {
		cout << mn << " " << mx << endl;
	} else {
		cout << "-1" << endl;
	}
}

int main() {
#ifdef LOCAL
	freopen(FILE_NAME ".in", "r", stdin);
	// freopen(FILE_NAME ".out", "w", stdout);
#endif

	while (read()) {
		solve();
	}

#ifdef LOCAL
	eprintf("Time: %.10f\n", (double) clock() / CLOCKS_PER_SEC);
#endif
	return 0;
}


Measured memory_bytes: 640
PROGRAM piyo
      IMPLICIT NONE
      integer :: a,b,k,i
      
      read*,k
      read*,a,b
      
      do i = a,b
        if( mod(i,k)==0 )then
          print*,'OK';stop;
        end if
      end do
      
      print*,'NG'
      
      END PROGRAM

Measured memory_bytes: 2852
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<ctime>
#include<cctype>
#include<climits>
#include<iostream>
#include<string>
#include<vector>
#include<map>
#include<list>
#include<queue>
#include<deque>
#include<algorithm>
#include<numeric>
#include<utility>
#include<complex>
#include<memory>
#include<functional>
#include<set>
 
using namespace std;
 
#define ALL(g) (g).begin(),(g).end()
#define REP(i, x, n) for(int i = x; i < n; i++)
#define rep(i,n) REP(i,0,n)
#define P(p) cout<<(p)<<endl;
#define p(p) cout<<(p)<<" ";
#define pb push_back
#define mp make_pair
#define INF 1<<25

typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<string> vs;
typedef pair<int, int> pi;
typedef long long ll;

//int dy[8]={1,1,1,0,0,-1,-1,-1};
//int dx[8]={-1,0,1,-1,1,-1,0,1};
int dx[4]={0,1,0,-1};
int dy[4]={1,0,-1,0};
struct S{
	int a,b,c;
};
bool asc(const S& left,const S& right){
	return left.c > right.c;
}
int main(){
	cin.tie(0);
	ios::sync_with_stdio(false);
	int N;
	cin>>N;
	vi a(N),color(8,0);
	int r=0;
	rep(i,N){
		cin>>a[i];
		if(a[i]<400)color[0]++;
		else if(a[i]<800)color[1]++;
		else if(a[i]<1200)color[2]++;
		else if(a[i]<1600)color[3]++;
		else if(a[i]<2000)color[4]++;
		else if(a[i]<2400)color[5]++;
		else if(a[i]<2800)color[6]++;
		else if(a[i]<3200)color[7]++;
		else r++;
	}
	int cnt=0;
	rep(i,8){
		if(color[i]>0)cnt++;
	}
	if(cnt!=0){
		p(cnt)P(cnt+r);
	}
	else {
		p("1")P(cnt+r);
	}
	return 0;
}



Measured memory_bytes: 256
const log = console.log;

const createScanFunctions = (input: string) => {
  const str = input.trim();
  const len = str.length;
  let index = 0;

  const scan = () => {
    const startIndex = index;

    while (index < len) {
      const char = str[index];

      if (char === " " || char === "\n")
        return str.substring(startIndex, index++);

      index++;
    }

    return str.substr(startIndex);
  };

  const scanInt = () => parseInt(scan());

  return { scan, scanInt };
};

const createArrayOfNumberArrays = (length: number) => {
  const array = new Array<number[]>(length);
  for (let i = 0; i < length; i++) array[i] = [];

  return array;
};

const isEven = (n: number) => (n & 1) === 0;

// ----

function Main(input: string): void {
  const { scanInt } = createScanFunctions(input);

  // prepare graph
  const n = scanInt();
  const adjacentVertexIdTable = createArrayOfNumberArrays(n);
  const adjacentVertexDistanceTable = createArrayOfNumberArrays(n);
  const vertexColorArray = new Array<number | undefined>(n).fill(undefined);

  function linkVertices(id: number, adjacentId: number, distance: number) {
    adjacentVertexIdTable[id].push(adjacentId);
    adjacentVertexDistanceTable[id].push(distance);
    adjacentVertexIdTable[adjacentId].push(id);
    adjacentVertexDistanceTable[adjacentId].push(distance);
  }

  function paintVertex(id: number, color: number) {
    vertexColorArray[id] = color;
  }

  const getVertexColor = (id: number) => vertexColorArray[id];

  // read edges data
  const edgeCount = n - 1;

  for (let i = 0; i < edgeCount; i++)
    linkVertices(scanInt() - 1, scanInt() - 1, scanInt());

  // prepare search, visit first vertex
  const recentVisitedStack: number[] = [];

  vertexColorArray[0] = 0;
  recentVisitedStack.push(0);

  const visitAdjacentVerticesOf = (vertexId: number, searchStack: number[]) => {
    const adjacentVertexIdArray = adjacentVertexIdTable[vertexId];
    const adjacentVertexDistanceArray = adjacentVertexDistanceTable[vertexId];
    const len = adjacentVertexIdArray.length;

    const currentColor = getVertexColor(vertexId);
    if (currentColor === undefined)
      throw new Error(`Vertex id: ${vertexId} not colored.`);

    for (let i = 0; i < len; i++) {
      const adjacentVertexId = adjacentVertexIdArray[i];

      if (vertexColorArray[adjacentVertexId] !== undefined) continue; // already visited

      const adjacentColor = isEven(adjacentVertexDistanceArray[i])
        ? currentColor
        : currentColor ^ 1;

      paintVertex(adjacentVertexId, adjacentColor);

      searchStack.push(adjacentVertexId);
    }
  };

  // search & paint
  while (true) {
    const vertexId = recentVisitedStack.pop();
    if (vertexId === undefined) break;

    visitAdjacentVerticesOf(vertexId, recentVisitedStack);
  }

  // output
  for (const color of vertexColorArray) log(color);
}

Main(require("fs").readFileSync("/dev/stdin", "utf8"));

Measured memory_bytes: 81072
#include<stdio.h>
int main()
{
    int A;
    int B;
    int T;
    int F;


    scanf("%d %d %d", &A, &B, &T);
    F = (T+0.5) / A;
    if(A > (T + 0.5)){
        printf("0 \n");
        }else{
        printf("%d",F * B);
        }
        return 0;
    }

Measured memory_bytes: 128
#include<bits/stdc++.h>
#define _overload3(_1, _2, _3, name, ...) name
#define _rep(i, n) repi(i, 0, n)
#define repi(i, a, b) \
  for (ll i = static_cast<int>(a); i < static_cast<int>(b); ++i)
#define rep(...) _overload3(__VA_ARGS__, repi, _rep, ) (__VA_ARGS__)  // NOLINT
#define chmax(x, a)  do { x = max(x, a); } while(0)
#define chmin(x, a)  do { x = min(x, a); } while(0)

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

ll gcd(ll x, ll y) {
  if (y < x)
    swap(x, y);
  if (x == 0)
    return y;
  return gcd(y % x , x);
}

std::map<ll, ll> decomposePrime(ll n) {
    std::map<ll, ll> m;
    ll x = 2;
    while (x * x <= n) {
        if (n % x == 0) {
            m[x]++;
            n /= x;
        } else {
            x++;
        }
    }
    if (n > 1)
        m[n]++;
    return m;
}

void solve() {
  ll N;
  cin >> N;
  vector<ll> a(N);
  rep(i, N)
    cin >> a[i];

  bool pw = true;
  vector<bool> appeared(2000000);
  for (auto e : decomposePrime(a[0])) {
    appeared[e.first] = true;
  }
  for (ll i = 1; i < N; i++) {
    for (auto e : decomposePrime(a[i])) {
      if (appeared[e.first])
        pw = false;
      appeared[e.first] = true;
    }
  }
  if (pw) {
    cout << "pairwise coprime" << endl;
    return;
  }

  bool sw = true;
  ll t = a[0];
  for (ll i = 1; i < N; i++) {
    t = gcd(t, a[i]);
  }
  if (t != 1)
    sw = false;

  if (sw) {
    cout << "setwise  coprime" << endl;
    return;
  }

  cout << "not coprime" << endl;
}

int main() {
  //ll T;
  //cin >> T;
  //rep(_,T)
    solve();
  return 0;
}


Measured memory_bytes: 11436
import java.util.*;
import java.io.PrintWriter;
import static java.lang.Integer.*;
import static java.lang.Long.*;
import static java.lang.Math.*;
import static java.lang.System.*;

public class Main {
	public static final int MOD = 1000000007;
	public static void main(String[] args) {
		int i,j;
		Scanner sc = new Scanner(in);
		int n = parseInt(sc.next());
		int r = parseInt(sc.next());
		sc.close();
		int na = n>=10?r:100*(10-n)+r;
		out.println(na);
	}
}


Measured memory_bytes: 23124
#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <cmath>
#include <utility>
#include <iomanip>
using namespace std;
typedef long long ll;

const ll MOD = 1e9+7;

int main()
{
	int a,b,c;
	int ans=0;
	cin>>a>>b>>c;
	ans=max(c-(a-b),0);
	cout<<ans<<endl;
	return 0;
}

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

int main()
{
    int n, m, k, l;
    cin >> n >> m;
    vector<int> table(m);
    for (int i = 0; i < m; i++)
        table[i] = 0;
    for (int i = 0; i < n; i++)
    {
        cin >> k;
        for (int j = 0; j < k; j++)
        {
            cin >> l;
            l--;
            table[l]++;
        }
    }
    int ans = 0;
    for (int i = 0; i < m; i++)
    {
        if (table[i] == n)
            ans++;
    }
    cout << ans << endl;
}


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

#define int long long
typedef long long ll;
//const int INF = 2e9;
//const ll INF = 9e18;

signed main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    int K;
    cin >> K;
    int p = 7%K;
    int cnt = 1;
    while (cnt <= 100000000){
        if (p==0) {
            cout << cnt << "\n";
            return 0;
        }
        p = (10*p + 7)%K;
        cnt++;
    }
    cout << -1 << "\n";
    return 0;
}

Measured memory_bytes: 3648
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import accumulate, permutations, combinations, product, groupby, combinations_with_replacement
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

H1, M1, H2, M2, K = MAP()

t1 = 60*H1+M1
t2 = 60*H2+M2

print(t2-t1-K)


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

using namespace std;

int k;
int ans = 0;
int main()
{

    cin >> k;

    for (int i = 1; i <= k ;i++)
        for (int j = 1; j <=k ;j++)
            for (int z = 1; z <= k; z++)
                ans += (gcd(i, gcd(j, z)));

    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 3580
#include <iostream>
#include <set>
#include <map>
#include <vector>
#include <algorithm>
#include <iomanip>
#include <climits>
#include <numeric>
#include <cmath>
#include <queue>
#include <sstream>
#include <string.h>
#include <bitset>

using namespace std;
typedef long long ll;
vector<vector<pair<int, int>>> G;
vector<int> list;

void search(int v, int color) {
  list[v] = color;
  for (pair<int,int> nv : G[v]) {
    if (list[nv.first] != -1) continue;
    search(nv.first, (color + nv.second) % 2);
  }
}

int main() {
  int N;
  cin >> N;
  list.resize(N, -1);
  G.resize(N, vector<pair<int, int>>());
  for (int i = 0; i < N - 1; i++) {
    int a, b, c;
    cin >> a >> b >> c;
    a--; b--;
    G[a].push_back({b, c % 2});
    G[b].push_back({a, c % 2});
  }
  
  search(0, 0);
  
  for (int i = 0; i < N; i++) {
    cout << list[i] << endl;
  }
  return 0;
}


Measured memory_bytes: 7424
#include <cstdio>
#include <iostream>
#include <array>
#include <vector>
#include <algorithm>
#include <functional>
#include <tuple>
#include <map>
#include <unordered_map>
#include <set>
#include <unordered_set>
#include <queue>
#include <utility>
#include <memory>
#include <valarray>
#include <climits>

using namespace std;

using ll = long long int;

#define loop(i, N) for (int i = 0; i < N; ++i)
#define scanInt(x) int x; scanf("%d", &x); getchar();
#define scanLLInt(x) ll x; scanf("%lld", &x); getchar();
#define scanVecInt(A, N) vector<int> A(N); loop(i, N){scanf("%d", &(A[i])); getchar();}
#define scanVecLLInt(A, N) vector<ll> A(N); loop(i, N){scanf("%lld", &(A[i])); getchar();}

int main()
{
    scanInt(r);
    scanInt(g);
    scanInt(b);
    const int num = r * 100 + g * 10 + b;
    if (num % 4 == 0){
        puts("YES");
    }else{
        puts("NO");
    }
}


Measured memory_bytes: 256
import math

def get_primes(max_number):
    if max_number == 2:
        return [2]
    elif max_number < 3:
        return []
     
    numbers = range(1, max_number + 2, 2)
    nroot = math.floor(max_number ** 0.5)
    n = len(numbers)
    numbers[0] = 0
    for i in range(1, n):
        x = numbers[i]
        if x > nroot:
            break
        if x and i + x < n:
            for j in range(i+x, n, x):
                numbers[j] = 0
    x=[2] + filter(None, numbers[1:])
    return x

primes = get_primes(50100)
while True:
    try:
        n = input()
    except:
        break
    for a in primes:
        if a<n: b=a
        elif a>n: break
    print b,a

Measured memory_bytes: 6376
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ABC85_3
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] s = Console.ReadLine().Split(' ');
            int N = int.Parse(s[0]);
            int Y = int.Parse(s[1]);
            bool Out = false;
            for (int i = 0; i <= N; i++)
            {
                for (int j = 0; j <= N - i; j++)
                {
                    int k = N - j - i;
                    if (i * 10000 + j * 5000 + k * 1000 == Y)
                    {
                        Console.WriteLine(i + " " + j + " " + k);
                        Out = true;
                        break;
                    }
                }
                if (Out)
                {
                    break;
                }
            }
            if (!Out)
            {
                Console.WriteLine(-1 + " " + -1 + " " + -1);
            }

        }
    }
}


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

int main() {
  vector<int> t(5);
  for (int i = 0; i < 5; ++i)
    cin >> t[i];
  sort(t.begin(), t.end(), [](const int a, const int b) {
                             int ai = (a % 10 == 0) ? 10 : (a % 10);
                             int bi = (b % 10 == 0) ? 10 : (b % 10);
                             return ai > bi; });
  int r = 0;
  for (int u : t) {
    if (r % 10)
      r += 10 - r % 10;
    r += u;
  }
  cout << r << "\n";
  return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h> 
long long K;
int k,n,tot,WZ;
int a[234234],fir[234234],go[234234],wz[234234];

int main()
{
  int i;
  scanf("%d%lld",&n,&K);
  for(i=1;i<=n;i++) 
    {
	 scanf("%d",&a[i]);
	 if(!fir[a[i]]) fir[a[i]]=i;}
  for(i=n;i>=1;i--)
    {
	  if(!wz[a[i]]) go[i]=fir[a[i]];
	  else go[i]=wz[a[i]];
	  wz[a[i]]=i;
	}
  tot=1,WZ=1;	
  while(1)
  {
    
    if(go[WZ]<=WZ) tot++;
    WZ=go[WZ]+1; 
    if(WZ==n+1) break;
  }
  k=K%tot;
  if(!k) return 0;
  WZ=1;
  while(1)
    {
    	if(k==1) break;
      	if(go[WZ]<=WZ) k--;
    WZ=go[WZ]%n+1; 
    }
  while(WZ<=n)
  {
    if(go[WZ]>WZ) WZ=go[WZ];
    else printf("%d ",a[WZ]);
    WZ++;
  }
}

Measured memory_bytes: 4608
x,n=map(int,input().split())
if n==0:
    print(x)
    exit()
p=list(map(int,input().split()))

for j in range(100):
    a1=x-j
    a2=x+j
    if a1 not in p:
        print(a1)
        exit()
    if a2 not in p:
        print(a2)
        exit()
    

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


const int N = 2e5 + 5;




int n, m, a[N];


int main(){
    ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
    cin >> n >> m;
    for(int i = 0; i < 2 * n; i++){
        cin >> a[i];
    }
    sort(a, a + 2 * n);
    int l = 0, r = n;
    while(r > l){
        int mid = (r + l + 1) >> 1;
        bool p = true;
        for(int i = 0; i < mid; i++){
            if(a[2 * n - mid + i] + a[2 * n - mid - i - 1] < m){
                p = false;
                break;
            }
        }
        if(p){
            l = mid;
        }
        else{
            r = mid - 1;
        }
    }
    int ans = 0;
    for(int i = 0; i < l; i++){
        ans = max(ans, a[2 * n - l + i] + a[2 * n - l - i - 1] - m);
    }
    for(int i = 0; i < n - l; i++){
        ans = max(ans, a[i] + a[2 * n - l * 2 - i - 1]);
    }
    cout << ans;
}


Measured memory_bytes: 1024
import sys
from collections import defaultdict, deque

sys.setrecursionlimit(10 ** 7)
# ----------

INF = float("inf")
MOD = 10 ** 9 + 7
# ----------

N, M = map(int, input().split())
G = defaultdict(list)
for i in range(M):
    a, b = map(int, input().split())
    a -= 1
    b -= 1
    G[a].append(b)
    G[b].append(a)


q = deque()

# 0 を頂点とする
ans = [-1 for _ in range(N)]
ans[0] = 0
q.append(0)

while q:
    v = q.popleft()
    for u in G[v]:
        if ans[u] != -1:
            continue
        ans[u] = v + 1
        q.append(u)

print('Yes')
for i in range(1,N):
    print(ans[i])


Measured memory_bytes: 41280
/*#pragma GCC optimize("unroll-loops")
#pragma GCC optimize("Ofast")*/
//#pragma GCC optimize("fast-math")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,avx2,tune=native")
//#pragma GCC optimize("unroll-loops")
//#define _CRT_SECURE_NO_WARNINGS
//#pragma GCC optimize("unroll-loops")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,avx2,tune=native")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,avx2,tune=native")
//#pragma GCC optimize("unroll-loops")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,avx2,tune=native")
//#pragma GCC optimize("Ofast,no-stack-protector")
#include <iostream>
#include <vector>
#include <map>
#include <stack>
#include <unordered_map>
#include <unordered_set>
#include <set>
#include <bitset>
#include <algorithm>
#include <string>
#include <deque>
#include <queue>
#include <math.h>
#include <random>
using namespace std;
typedef long long  ll;
typedef pair<ll, ll> pii;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef long double ld;
#define all(a) a.begin(), a.end()
#define lb(a, x) lower_bound(a.begin(), a.end(), x)
#define pb(x) push_back(x)
#define fr(i, n) for(int i = 0; i < n; ++i)
//typedef cc_hash_table<int, int, hash<int>> hst2;
//typedef cc_hash_table<int, hst2, hash<int>> hst;
typedef pii ord_set_t;
#ifdef ABCD
typedef set<ord_set_t> ordered_set;
int __builtin_popcount(int x)
{
	int cnt = 0;
	for (; x > 0; x >>= 1) cnt += x & 1;
	return cnt;
}

#else
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
mt19937 rnd(239);
using namespace __gnu_pbds;
typedef tree<
	ord_set_t,
	null_type,
	less<ord_set_t>,
	rb_tree_tag,
	tree_order_statistics_node_update>
	ordered_set;
#endif
const int N = 501;
ll a[N];
ll k;
bool check(ll p, ll n)
{
	ll sum = 0;
	fr(i, n) sum += a[i] % p;
	ll mas[N];
	fr(i, n) mas[i] = a[i] % p;
	sort(mas, mas + n);
	ll d = sum / p;
	fr(i, d) {
		sum -= mas[n - i - 1];
		sum += p - mas[n - i - 1];
	}
	return sum <= 2ll*k;
}
int main()
{

	ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#ifdef ABCD
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#else

#endif
	ll n; cin >> n >> k;
	fr(i, n) cin >> a[i];
	ll sum = 0;
	fr(i, n) sum += a[i];
	ll ans = 0;
	for (ll i = 1, sz = sqrt(sum) + 1; i < sz; ++i)
	{
		if (sum %i == 0)
		{
			if (check(i, n)) ans = max(ans, i);
			if(check(sum/i, n)) ans = max(ans, sum / i);
		}
	}
	cout << ans;
}


Measured memory_bytes: 256
#include<stdio.h>
int main(){

  double x1,y1,x2,y2;
  scanf("%lf %lf %lf %lf", &x1, &y1, &x2, &y2 );

  double dis;
  dis = ( x1 - x2 ) * ( x1 - x2 ) + ( y1 - y2 ) * ( y1 - y2 );

  int i;
  double min,max,ave;
  min = 0;
  max = 1000000000;
  
  for ( i = 0 ; i < 100 ; i++ ){

    ave = ( min + max ) / 2;
    
    if ( dis > ave * ave ) min = ave;
    if ( dis <= ave * ave ) max = ave;

  }

  printf("%.6lf\n", ave);

  return 0;

  
}

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

int main() {
 int N, A[210];
  cin >> N;
  for (int i = 0; i < N; i++){
    cin >> A[i];
  }
  int res = 0;
  while (true){
    bool exist_odd = false;
    for (int i = 0; i < N; i++){
    if (A[i] % 2 != 0)
      exist_odd = true;
    }
    if (exist_odd == true)
      break;
    for (int i = 0; i < N; i++){
      A[i] /= 2;
    }
      res++;
  }
  cout << res << endl;
}

Measured memory_bytes: 256
# ??????????????°???????????????????????????????????????n, k ????????????????????????????????????????????§???
# P???????±?????????°??¨????????????????????????????????????????°???????????????????
# k, P, n[] ?????\?????????k??°????????????????????\????????????????????°v????????????????????¢??°???????????°???
# v >= n ??¨???????????????v???????????¨?????????
# ????????????????????????P????????????????????????????????????????????¢?´¢???????????°?????????
# ????¨????????£??????´??????loadable_num ??? load_weights.size ????????§????????????
# ??????????????????????????¨???????????????????????????

# ALDS1_4_D: Allocation

MAX_N_LOADS = 100000
MAX_WEIGHT  = 10000

def loadable_num(n_trucks, load_weights, capacity)
  w_loaded = 0
  n_trucks_loaded = 0
  load_weights.each_with_index do |weight, i|
    return i if capacity < weight
    w_loaded += weight
    if capacity < w_loaded
      w_loaded = weight
      n_trucks_loaded += 1
      return i if n_trucks == n_trucks_loaded
    end
  end
  load_weights.size
end

def find_min_capacity(n_trucks, load_weights)
  left    = 0
  right   = MAX_N_LOADS * MAX_WEIGHT
  n_loads = load_weights.size
  while left < right
    mid = (left + right) / 2
    n_loadables = loadable_num(n_trucks, load_weights, mid)
    if n_loadables < n_loads
      left = mid + 1
    else
      right = mid
    end
  end
  right
end

n_loads, n_trucks = gets.split.map &:to_i
load_weights = n_loads.times.map do
  gets.chomp.to_i
end

puts find_min_capacity(n_trucks, load_weights)

Measured memory_bytes: 7780
#include<bits/stdc++.h>
using namespace std;
using Graph = vector<vector<int>>;
#define ll long long
#define all(x) (x).begin(),(x).end()
#define rep(i, n) for(ll i = 0; i < n; i++)
const ll INF = 1LL << 60;

int main(){
    int N, M, Q; cin >> N >> M >> Q;
    vector<vector<int>> trains(N, vector<int>(N, 0)), sum(N + 1, vector<int>(N + 1, 0));
    rep(i, M){
        int l, r; cin >> l >> r;
        l--;
        r--;
        trains[l][r]++;
    }
    for(int i = 0; i < N; i++){
        for(int j = 0; j < N; j++){
            sum[i + 1][j + 1] = sum[i + 1][j] + sum[i][j + 1] - sum[i][j] + trains[i][j];
        }
    }

    vector<int> ans;
    rep(i, Q){
        int l, r; cin >> l >> r;l--;
        int tmp = sum[r][r] - sum[l][r] - sum[r][l] + sum[l][l];
        ans.push_back(tmp);
    }

    // rep(i, N + 1){
    //     rep(j, N + 1)cout << sum[i][j] << " ";
    //     cout << endl;
    // }
    rep(i, Q)cout << ans[i] << endl;

}

Measured memory_bytes: 5900
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef long double ld;
typedef vector<ll> vl;
typedef vector<string> vs;
typedef vector<char> vc;
typedef queue<ll> ql;
typedef deque<ll> dql;
typedef priority_queue<ll/*, vl, greater<ll>*/> pql; //降順(/*昇順*/)
typedef set<ll> sl;
typedef pair<ll, ll> pl;
typedef vector<vl> vvl;
typedef vector<pl> vpl;
#define rep(i, n) for(ll i = 0; i < ll(n); i++)
#define rep2(i, n) for(ll i = 1; i <= ll(n); i++)
//#define rep(i, k, n) for(ll i = k-1; i < ll(n); i++)
//#define rep2(i, k, n) for(ll i = k; i <= ll(n); i++)
#define all(v) (v).begin(), (v).end()
bool chmin(ll &a, ll b) {if(b < a) {a = b; return 1;} return 0;}
bool chmax(ll &a, ll b) {if(b > a) {a = b; return 1;} return 0;}
const ll INF = 1LL << 60;
const ll MOD = 1e9 + 7;
//const ll MOD = 998244353;
const ll MAX = 1e9;
const char newl = '\n';

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

  ll n, k;
  cin >> n >> k;
  
  ll a;
  vl cnt(n+1);
  rep(_, n) {
    cin >> a;
    cnt[a]++;
  }
  
  vl num;
  rep2(i, n) {
    if(cnt[i]==0) continue;
    num.push_back(cnt[i]);
  }
  sort(all(num));
  
  ll ns=num.size(), ans=0;
  rep(i, ns-k) ans += num[i];
  cout << ans << newl;
  return 0;
}

Measured memory_bytes: 6724
#include <iostream>
#include <string>
#include <algorithm>
using namespace std;
int main(void){
    long int n,m;
    cin>>n>>m;
    if(n==1||m==1){
        cout<<abs(max(n,m)-2);
    }else{
        cout<<(m-2)*(n-2);
    }
    return 0;
}


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

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

#define _rrep(i,n) _rrange(i,n,0)
#define _rrange(i,a,b) for(int i=int(a)-1;i>=int(b);--i)
#define rrep(...) _overload(__VA_ARGS__,_rrange,_rrep,)(__VA_ARGS__)

#define _all(arg) begin(arg),end(arg)
#define uniq(arg) sort(_all(arg)),(arg).erase(unique(_all(arg)),end(arg))
#define getidx(ary,key) lower_bound(_all(ary),key)-begin(ary)
#define clr(a,b) memset((a),(b),sizeof(a))
#define bit(n) (1LL<<(n))
#define popcount(n) (__builtin_popcountll(n))

using namespace std;

template<class T>bool chmax(T &a, const T &b) { return (a<b)?(a=b,1):0;}
template<class T>bool chmin(T &a, const T &b) { return (b<a)?(a=b,1):0;}

typedef long long ll;
typedef long double R;
const R EPS=1e-9L; // [-1000,1000]->EPS=1e-8 [-10000,10000]->EPS=1e-7
inline int sgn(const R& r){return(r > EPS)-(r < -EPS);}
inline R sq(R x){return sqrt(max(x,0.0L));}

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

// Problem Specific Parameter:

int main() {
  int n, m; cin >> n >> m;
  vector<int> x(m);
  vector<int> gap(m-1);
  vector<int> place(n);
  for(int i = 0; i < m; ++i) {
    cin >> x[i];
  }
  sort(x.begin(), x.end());
  for(int i = 1; i < m; ++i) {
    gap[i-1] = x[i] - x[i-1];
  }
  sort(gap.begin(), gap.end(), greater<int>());
  int ans = x[m-1] - x[0];
  if(m <= n) {
    cout << 0 << endl;
    return 0;
  }
  for(int i = 0; i < n-1; ++i) {
    ans -= gap[i];
  }
  cout << max(ans,0) << endl;

  return 0;
}


Measured memory_bytes: 1408
a,b,c,x,y = list(map(int,input().split()))
cost = []
tmp = 0
i = 0
# i == Cの数 (Cの倍額でA*1+B*1)
while i <= max(x,y) :
    tmp += i * 2 * c
    tmp += max(x-i,0)*a + max(y-i,0) * b
    cost.append(tmp)
    i += 1
    tmp = 0

print(min(cost))
    


Measured memory_bytes: 7100
#include<bits/stdc++.h>
#define rep(i, n) for(int i=0; i<n; i++)
#define repo(i, n) for(int i=1; i<=n; i++)
#define ssort(a) sort(a.begin(), a.end())
#define INF 1001001001
#define INFll 100100100100100
// debug用
#define PrintVec(x) for (auto elementPrintVec: x) { cout << elementPrintVec << " "; } cout << endl;

using namespace std;
using ull = unsigned long long;
using ll = long long;
using P = pair<int, int>;
const int mod = 1000000007;

/*
1≤k≤n≤10^7
p は素数 (上の実装ではさらに p>n を仮定している)
*/

const int MAX = 510000;//階乗の配列数
const int MOD = 1000000007;

long long fac[MAX], finv[MAX], inv[MAX];

// テーブルを作る前処理
void COMinit() {
    fac[0] = fac[1] = 1;
    finv[0] = finv[1] = 1;
    inv[1] = 1;
    for (int i = 2; i < MAX; i++){
        fac[i] = fac[i - 1] * i % MOD;
        inv[i] = MOD - inv[MOD%i] * (MOD / i) % MOD;
        finv[i] = finv[i - 1] * inv[i] % MOD;
    }
}

// 二項係数計算
long long COM(int n, int k){
    if (n < k) return 0;
    if (n < 0 || k < 0) return 0;
    return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}

// mod. m での a の逆元 a^{-1} を計算する
long long modinv(long long a, long long m) {
    long long b = m, u = 1, v = 0;
    while (b) {
        long long t = a / b;
        a -= t * b; swap(a, b);
        u -= t * v; swap(u, v);
    }
    u %= m;
    if (u < 0) u += m;
    return u;
}

// a^n mod を計算する
long long modpow(long long a, long long n, long long mod) {
    long long res = 1;
    while (n > 0) {
        if (n & 1) res = res * a % mod;
        a = a * a % mod;
        n >>= 1;
    }
    return res;
}


int main(){
  int n;
  cin >> n;
  ll ans=modpow(10, n, mod)-2*modpow(9, n, mod)+modpow(8, n, mod)+mod*2;
  ans%=mod;
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 3640
#include <iostream>
#include <cstdio>
#include <string>
#include <algorithm>
#include <utility>
#include <cmath>
#include <vector>
#include <stack>
#include <queue>
#define rep(i, n) for(int i = 0; i < n; i++)
using namespace std;
typedef long long ll;
ll mod = 1000000007;

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

    if(c == d) {
        rep(j, n) {
            ll k = a + (n-1-2*j)*c;
            if(b == k) {
                cout << "YES" << endl;
                return 0;
            }
        }

        cout << "NO" << endl;
        return 0;
    }

    rep(j, n) {
        ll u = a + (n-1-j)*c - j*d;
        ll v = a - j*c + (n-1-j)*d;
        if(u <= b && b <= v) {
            cout << "YES" << endl;
            return 0;
        }
    }

    cout << "NO" << endl;

    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int n,k;
char s[100005];
int main()
{
    scanf("%d",&n);
    scanf("%s",s+1);
    scanf("%d",&k);
    for(int i=1;i<=n;i++)
        if(s[i]!=s[k]) s[i]='*';
    printf("%s",s+1);
}


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

#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))

ll N;
ll L[4000];

// https://atcoder.jp/contests/abc143/submissions/8034764

void input()
{
    cin >> N;
    for (int i = 1; i <= N; i++)
        cin >> L[i];
}

void solve()
{
    input();
    vector<ll> v(N);
    for (int i = 0; i < N; i++)
        v[i] = L[i + 1];
    sort(v.begin(), v.end());
    ll ans = 0;
    for (ll mid = N - 1; mid >= 0; mid--)
    {
        for (ll low = mid - 1; low >= 0; low--)
        {
            auto itr = lower_bound(v.begin(), v.end(), v[mid] + v[low]);
            ll ng = distance(itr, v.end());
            ans += (N - 1 - mid) - ng;
            //cerr << v[mid] + v[low] << " " << ng << " " << (N-1-mid)-ng << endl;
        }
    }
    cout << ans << endl;
    return;
}

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

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

struct Node{
	int key;
	Node *next, *prev;
};

Node *nil;

void init(){
	nil = (Node *)malloc(sizeof(Node));
	nil -> next = nil;
	nil -> prev = nil;
}

void insert(int key){
	Node *p = (Node *)malloc(sizeof(Node));
	p->key = key;
	
	p->next = nil->next;
	nil->next->prev = p;
	nil -> next = p;
	p -> prev = nil;
}

void deleteNode(Node *t){
	if(t == nil){
		return;
	}
	t->prev->next = t->next;
	t->next->prev = t->prev;
	free(t);
}

Node* listSearch(int key){
	Node *cur = nil->next;
	while(cur != nil && cur->key != key){
		cur = cur->next;
	}
	return cur;
}

void deleteFirst(){
	deleteNode(nil->next);
}

void deleteLast(){
	deleteNode(nil->prev);
}

void deleteKey(int key){
	deleteNode(listSearch(key));
}

int main(){
	ios::sync_with_stdio(false);
	int n, key;
	string s;
	Node *cur;
	
	cin >> n;
	
	init();
	
	for(int i = 0 ; i< n ; i++){
		cin >> s;
		if(s == "insert") {
			cin >> key;
			insert(key);
		}
		else if(s == "delete") {
			cin >> key;
			deleteKey(key);
		}
		else if(s == "deleteFirst"){
			deleteFirst();
		}
		else if(s == "deleteLast") {
			deleteLast();
		}
	}
	
	int j = 0;
	cur = nil->next;
	
	while(1) {
		if(cur == nil){
			break;
		}
		
		if(j++ > 0){
			cout << " ";
		}
		
		cout << cur->key;
		cur = cur->next;
	}
	
	cout << "\n";
	
	return 0;
}  

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

int main() {
  int a, b;
  cin >> a >> b;
  if (a%3==0 || b%3==0 || (a+b)%3==0) {
    cout << "Possible" << endl;
  }
  else {
    cout << "Impossible" << endl;
  }
}


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

int main(){
  int n;
  cin>>n;
  int a[n];
  for(int i=0;i<n;i++){
    cin>>a[i];
  }
  
  int ans[n];
  ans[0]=0;
  ans[1]=abs(a[0]-a[1]);
  for(int i=2;i<n;i++){
    ans[i]=min(ans[i-2]+abs(a[i]-a[i-2]),ans[i-1]+abs(a[i]-a[i-1]));
  }
  cout<<ans[n-1]<<endl;
  return 0;
}

Measured memory_bytes: 1024
/**
 * code generated by JHelper
 * More info: https://github.com/AlexeyDmitriev/JHelper
 * @author alireza_kaviani
 */

#include <bits/stdc++.h>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/assoc_container.hpp>

using namespace std;
using namespace __gnu_pbds;

template<class T> using Tree = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;

typedef long long ll;
typedef long double ld;
typedef pair<ll, ll> pll;
typedef pair<double, double> pdd;

#define all(x)                      (x).begin(),(x).end()
#define Sort(x)                     sort(all((x)))
#define X                           first
#define Y                           second
#define Mp                          make_pair
#define sep                         ' '
#define endl                        '\n'
#define debug(x)                    cerr << #x << " = " << x << endl
#define SZ(x)                       ll(x.size())
#define fast_io                     ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define set_random                  mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());

ll poww(ll a, ll b, ll md) {
    return (!b ? 1 : (b & 1 ? a * poww(a * a % md, b / 2, md) % md : poww(a * a % md, b / 2, md) % md));
}

const ll MAXN = 1e6 + 10;
const ll LOG = 22;
const ll INF = 8e18;
const ll MOD = 1e9 + 7; // 998244353; // 1e9 + 9;

ll n, mod[3] = {998244353, ll(1e9 + 7), ll(1e9 + 9)}, base[3] = {31, 37, 41};
ll hs[3][MAXN], pw[3][MAXN], inv[3][MAXN];
string s;

void Hash() {
    for (ll i = 0; i < 3; i++) {
        ll inverse = poww(base[i], mod[i] - 2, mod[i]);
        pw[i][0] = inv[i][0] = 1;
        for (ll j = 1; j < MAXN; j++)
            pw[i][j] = pw[i][j - 1] * base[i] % mod[i], inv[i][j] = inv[i][j - 1] * inverse % mod[i];
        for (ll j = 0; j < n; j++) {
            hs[i][j + 1] = (hs[i][j] + (s[j] - 96) * pw[i][j]) % mod[i];
        }
    }
}

pair<ll, pll> get(ll l, ll r) {
    return {(hs[0][r] - hs[0][l] + mod[0]) * inv[0][l] % mod[0],
            {(hs[1][r] - hs[1][l] + mod[1]) * inv[1][l] % mod[1],
             (hs[2][r] - hs[2][l] + mod[2]) * inv[2][l] % mod[2]}};
}

ll check(ll x) {
    set<pair<ll, pll>> st;
    for (ll i = 0; i + x <= n; i++) {
        if (i >= x) st.insert(get(i - x, i));
        pair<ll, pll> p = get(i, i + x);
        if (st.find(p) != st.end()) return 1;
    }
    return 0;
}

int main() {
    fast_io;

    cin >> n >> s;
    Hash();

    ll l = 0, r = n + 1;
    while (r - l > 1) {
        ll mid = (l + r) / 2;
        if (check(mid)) l = mid;
        else r = mid;
    }

    cout << l << endl;

    return 0;
}
/*

*/


Measured memory_bytes: 51840
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define REP(i, s, n) for (int i = (s); i < (int)(n); i++)
#define INF 100000000

using namespace std;

int main() {
   int n;
   cin >> n;
   cout << 800*n-200*(n/15) << endl;
 }

Measured memory_bytes: 384
from collections import Counter
def main():
    X,N = map(int, input().split())
    p = list(map(int, input().split()))
    counter = Counter(p)
    gap = 0
    while 1:
        if counter.get(X-gap,0)==0:
            print(X-gap)
            return
        elif counter.get(X+gap,0)==0:
            print(X+gap)
            return
        else:
            gap+=1


main()


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

int main(){
	cin.tie(0);
	ios::sync_with_stdio(false);
	int n,k;cin >> n >> k;
	vector<int> a(n);
	rep(i,n) cin >> a.at(i);
	vector<ll> b;
	rep(i,n){
		ll sum=0;
		for(int j=i;j<n;++j){
			sum+=a.at(j);
			b.pb(sum);
		}
	}
	ll ans=0;
	for(int i=60;i>=0;--i){
		ans+=((ll)1<<i);
		int cnt=0;
		rep(j,b.size()) if((b.at(j)&ans)==ans) cnt++;
		if(cnt<k) ans-=((ll)1<<i);
	}
	cout << ans << endl;
}

Measured memory_bytes: 6256
#include <iostream>
#include <vector>
#define rep(i,n) for (int i = 0; i < n; ++i)
using namespace std;
using ll = long long;
using P = pair<int,int>;

int main() {
  ll N;
  char name[20];
  cin >> N;
  int i = 0;
  while (N > 0) {
    if (N % 26 == 0) {
      name[i] = 26 + 96;
      N /= 26;
      N--;
      i++;
    } else {
      name[i] = N % 26 + 96;
      N /= 26;
      i++;
    }
  }
  i--;
  while(i >= 0) {
    cout << name[i];
    i--;
  }
  cout << endl;
  return 0;
}

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

int main(){
  long long int a,b=0;
  cin >> a;
  string s;
  cin >> s;
  for(int i=0;i<s.size();i++){
    if(s.at(i)!='.') b=b*10+s.at(i)-48;
  }
  cout << a*b/100 << endl;
}

Measured memory_bytes: 3608
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <string>
#include <sstream>
#include <complex>
#include <vector>
#include <list>
#include <queue>
#include <deque>
#include <stack>
#include <map>
#include <set>
#include <iomanip>
using namespace std;
typedef long long ll;
template<typename T> using min_priority_queue = priority_queue<T, vector<T>, greater<T>>;

#define EPS (1e-7)
#define INF (1e15)
#define PI (acos(-1))
#define MOD 1000000007

#define REP(i,n) for(int i=0;i<n;i++)
#define REPS(i,f,n) for(int i=(f);i<(n);i++)
#define EACH(it,v) for(__typeof((v).begin()) it=(v).begin();it!=(v).end();it++)

#define dump(x)  cout << #x << " = " << (x) << endl;
#define debug(x) cout << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;
#define arrdump(n,a) for(int i=0;i<n;i++) {cout<<((i>0)? " ":"")<<a[i];}cout<<"\n";


typedef pair<int, int> P;
typedef pair<ll, ll> LP;
typedef pair<int, P> PP;
typedef pair<ll, LP> LPP;

int dy4[]={0, 0, 1, -1};
int dx4[]={1, -1, 0, 0};
int dx8[]={0, 0, 1, -1, 1, 1, -1, -1};
int dy8[]={1, -1, 0, 0, 1, -1, -1, 1};

// https://atcoder.jp/contests/abc060/tasks/abc060_b?lang=ja

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

    for (int i = 1; i <= a*b; i++) if (a*i%b==c){
            cout << "YES" << "\n";
            return 0;
    }

    cout << "NO" << "\n";

    return 0;
}


Measured memory_bytes: 384
#include <iostream>
#include <vector>
#include <set>
#include <deque>
#include <map>
#include <iomanip>
#include <queue>
#include <stack>
#include <algorithm>
#include <cmath>
#include <cstring>
#include <utility>
using namespace std;
int ky[8] = {-1,1,-2,2,-2,2,-1,1}; 
int kx[8] = {-2,-2,-1,-1,1,1,2,2};
int dy[4] = {-1,0,1,0};
int dx[4] = {0,1,0,-1};
int ddy[8] = {-1,0,1,-1,1,-1,0,1};
int ddx[8] = {-1,-1,-1,0,0,1,1,1};
typedef long long ll;
#define pi pair
#define MP make_pair
#define PB push_back
#define F first
#define S second
#define rep1(i,a,b) for(int i = a; i < b; i++)
#define rep2(i,a,b) for(int i = a; i <= b; i++) 
#define INF 999999999999
const double PI = acos(-1.0); 
ll a;
double b;
ll t;

int main()
{
    ios::sync_with_stdio(0);
    cin.tie(0);
    //freopen("input.txt","r",stdin);
    //freopen("output.txt","w",stdout);
    cin >> a >> b;
    t = (ll)(b * 100 + 0.5);
    cout << (ll)(a * t) / 100 << '\n';

	return 0;
}

Measured memory_bytes: 3744
#include <iostream>
#include <numeric>
#include <math.h>
#include <algorithm>
#include <float.h>
#include <limits>
#include <vector> 
#include <string.h>
#include <iomanip>

#define rep(i,a,n) for(ll int (i) = (a);(i) < (n);(i)++)
#define urep(i,a,n) for(ll int (i) = (a);(i) > (n);(i)--)
#define MOD 1000000007
#define INF 2147483647
#define ll long long
#define asort(a) sort(a.begin(),a.end());//昇順ソート
#define usort(a) sort(a.rbegin(),a.rend());//降順ソート

using namespace::std;

int jo(ll int a, ll int b){//累乗
    ll int num=1;
    rep(i,0,b) num=num*a;
    return num;
}
char tobig(char s){//char大文字化
  return (s-0x20);
}
char tolow(char s){//char小文字化
  return (s+0x20);
}
int ctoi(char a){//char->int
  if('0'<=a&&a<='9') return (a-'0');
  return -1;
}

int gcd(ll int a,ll int b) {//最大公約数
  if(a<b) return gcd(b,a);
  int c;
  while ((c=a%b)) {
    a=b;
    b=c;
  }
  return b;
}
int lcm(ll int a,ll int b){//最小公倍数
 return (a*b)/gcd(a,b);
}


int main(){
  string A;cin>>A;
  int ans=0;
  rep(i,0,6) ans+=ctoi(A[i]);
  cout<<ans;
    
}




// vector<vector<int>> 変数名(左の個数, vector<int>(右の個数));

//cout<<fixed<<setprecision(n);  //小数点n桁まで表示

//  vector<pair<int,int>> data(N);  //2つのデータを格納、.first/.secondで参照
// pairのソートはfirst優先の昇順


Measured memory_bytes: 256
import scala.io.StdIn._

object Main {
  def main(args: Array[String]): Unit = {
    val n = readLine().map(_.toInt)
    val hs = readLine().split(" ").map(_.toInt)

    var ans = 0
    hs.foldLeft(0)((a, b) => {
      if (b > a) ans += b - a
      b
    })
    println(ans)
  }
}


Measured memory_bytes: 25796
<?php

$w = trim(fgets(STDIN));
$w = str_split($w);
$count = array_count_values($w);


$cnt = 0;
foreach($count as $val){
    if($val % 2 == 0){
        $cnt++;
    }
}
if($cnt == count($count)){
    echo "Yes";
}else{
    echo "No";
}


Measured memory_bytes: 4604
card=[] 
for i in range(3):
  card+=list(map(int,input().split()))
n=int(input())
bingo=[0]*9
for i in range(n):
  s=int(input())
  if s in card:
    bingo[card.index(s)]=1
if bingo[0] == 1:
  if (bingo[1] == 1 and bingo[2] == 1) or (bingo[3] == 1 and bingo[6] == 1) or (bingo[4] == 1 and bingo[8] == 1):
    print("Yes")
    exit()
if bingo[2] == 1:
  if (bingo[4] == 1 and bingo[6] == 1) or (bingo[5] == 1 and bingo[8] == 1):
    print("Yes")
    exit()
if (bingo[1] == 1 and bingo[4] == 1 and bingo[7] == 1) or (bingo[3] == 1 and bingo[4] == 1 and bingo[5] == 1) or (bingo[6] == 1 and bingo[7] == 1 and bingo[8] == 1):
    print("Yes")
    exit()
print("No")

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

int main() {
	int n;
	double ans=0;
	array<double, 110> a;
	cin >> n;
	for (int i = 1; i <= n;i++) {
		cin >> a[i];
		ans += 1 / a[i];
	}
	
	cout << 1 / ans;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0; i<(n); i++)
#define rrep(i,n) for(int i=(n)-1; i>=0; i--)
#define FOR(i,a,b) for(int i=(a); i<(b); i++)
#define RFOR(i,a,b) for(int i=(b-1); i>=(a); i--)
#define ALL(v) v.begin(), v.end()
#define RALL(v) v.rbegin(), v.rend()
#define UNIQUE(v) v.erase( unique(v.begin(), v.end()), v.end() );
#define pb push_back
using ll = long long;
using P = pair<int, int>;
using D = double;
using LD = long double;
const int mod = 1e9+7;
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 h; cin >> h;
    ll x = log2(h);
    cout << (1LL << x+1) - 1 << endl;
}


Measured memory_bytes: 384
import sys

N, H = map(int, input().split())
AB = [list(map(int, input().split())) for _ in range(N)]

if N == 1:
	cnt = 1
	H -= AB[0][1]
	if H > 0:
		cnt += -(-H//AB[0][0])
	print(cnt)
	sys.exit()



AB.sort(reverse = True)
max_A = AB[0][0]
AB.sort(reverse = True, key = lambda x: x[1])

cnt = 0

for i in range(N):
	katana_B = AB[i][1]
	if katana_B < max_A:
		break
	else:
		H -= katana_B
		cnt += 1

	if H <= 0:
		break

if H > 0:
	cnt += -(-H//max_A)

print(cnt)



Measured memory_bytes: 29164
use std::cmp::*;
use std::collections::*;
use std::io::*;
use std::str::FromStr;
fn read<T: FromStr>() -> T {
    let stdin = stdin();
    let stdin = stdin.lock();
    let token: String = stdin
        .bytes()
        .map(|c| c.expect("failed to read char") as char)
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect();
    token.parse().ok().expect("failed to parse token")
}
fn main() {
    let n: usize = read();
    let p: usize = read();
    let mut a: Vec<i64> = (0..n).map(|_| read()).collect();
    let mut odd = 0;
    for i in a {
        if i % 2 != 0 {
            odd += 1;
        }
    }
    let mut ans: i64 = 1;
    if odd == 0 {
        if p == 0 {
            for i in 0..n {
                ans *= 2;
            }
            println!("{}", ans);
        } else {
            println!("{}", 0);
        }
    } else {
        for i in 0..n - 1 {
            ans *= 2;
        }
        println!("{}", ans);
    }
}


Measured memory_bytes: 2076
#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<map>
#include<set>
#include<cstdio>
#include<cmath>
#include<deque>
#include<numeric>
#include<queue>
#include<stack>
#include<cstring>
#include<limits>
#include<functional>
#include<unordered_set>
#include<iomanip>
#include<cassert>
#include<regex>
#include<bitset>
#include<complex>
#include<chrono>
#include<random>
#define rep(i,a) for(int i=(int)0;i<(int)a;++i)
#define rrep(i,a) for(int i=(int)a-1;i>=0;--i)
#define REP(i,a,b) for(int i=(int)a;i<(int)b;++i)
#define RREP(i,a,b) for(int i=(int)a-1;i>=b;--i)
#define pb push_back
#define eb emplace_back
#define all(x) x.begin(),x.end()
using ll=long long;
constexpr ll mod = 1e9 + 7;
constexpr ll INF = 1LL << 60;

ll gcd(ll n, ll m) {
	ll tmp;
	while (m!=0) {
		tmp = n % m;
		n = m;
		m = tmp;
	}
	return n;
}

ll lcm(ll n, ll m) {
	return abs(n) / gcd(n, m)*abs(m);//gl=xy
}
 
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;
}
 
using namespace std;

ll dp[25][50005];
void solve(){
  int n,m;
  cin>>n>>m;
  vector<int>c(m);
  rep(i,m)cin>>c[i];
  rep(i,25){
    rep(j,50005)dp[i][j]=INF;
  }
  dp[0][0]=0;
  rep(i,m){
    rep(j,n+1){
      if(j-c[i]>=0)dp[i+1][j]=min(dp[i][j],dp[i+1][j-c[i]]+1);
      chmin(dp[i+1][j],dp[i][j]);
    }
  }
  cout<<dp[m][n]<<endl;
}

int main(){
	ios::sync_with_stdio(false);
  cin.tie(0);
	cout<<fixed<<setprecision(15);
  solve();
	return 0;
}



Measured memory_bytes: 12984
#include <bits/stdc++.h>
#define ll long long
#define pb push_back
#define vl vector
#define ff first
#define ss second
using namespace std;
int main()
{
    ll n,m,t,i,j,a,b,k;
    string s;
    cin>>n>>s;
    for(i=0;i<s.size();i++)
    {
        for(j=0;j<n;j++)
        {
            s[i]++;
            if(s[i]=='Z'+1) s[i]='A';
        }
    }
    cout<<s;
    
}

Measured memory_bytes: 3628