akhauriyash/Code-Regression huggingface dataset:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace _0184
{
    public class Program

    {
        public static void Main(string[] args)
        {
            while (true)
            {
                int n = RInt();
                if (n == 0) break;

                int[] Cnt = new int[7];
                for (int i = 0 ; i < n ; i++)
                {
                    int ageClass = (RInt() / 10);
                    if (ageClass <= 5) Cnt[ageClass]++; else Cnt[6]++;
                }

                for (int i = 0 ; i < Cnt.Length ; i++)
                {
                    Console.WriteLine(Cnt[i]);
                }
            }
        }

        static string RSt() { return Console.ReadLine(); }
        static int RInt() { return int.Parse(Console.ReadLine().Trim()); }
        static long RLong() { return long.Parse(Console.ReadLine().Trim()); }
        static double RDouble() { return double.Parse(Console.ReadLine()); }
        static string[] RStAr(char sep = ' ') { return Console.ReadLine().Trim().Split(sep); }
        static int[] RIntAr(char sep = ' ') { return Array.ConvertAll(Console.ReadLine().Trim().Split(sep), e => int.Parse(e)); }
        static long[] RLongAr(char sep = ' ') { return Array.ConvertAll(Console.ReadLine().Trim().Split(sep), e => long.Parse(e)); }
        static double[] RDoubleAr(char sep = ' ') { return Array.ConvertAll(Console.ReadLine().Trim().Split(sep), e => double.Parse(e)); }
        static string WAr<T>(IEnumerable<T> array, string sep = " ") { return string.Join(sep, array.Select(x => x.ToString()).ToArray()); }
    }

}



Measured memory_bytes: 19988
#include <stdio.h>
#include <limits.h>
#define N 1000000

typedef struct data
{
    char c;
    int v;
} DATA;

DATA L[N], R[N];
int n;
void mergeSort(DATA *, int, int);
void merge(DATA *, int, int, int);
int partition(DATA *, int, int);
void quickSort(DATA *, int, int);

int main()
{

    int i, v;
    DATA Card_A[N], Card_B[N];
    char S[5];
    int stable = 1;

    scanf("%d", &n);

    for (i = 0; i < n; i++)
    {
        scanf("%s %d", S, &v);
        Card_A[i].c = Card_B[i].c = S[0];
        Card_A[i].v = Card_B[i].v = v;
    }

    mergeSort(Card_A, 0, n);
    quickSort(Card_B, 0, n - 1);

    for (i = 0; i < n; i++)
    {
        if (Card_A[i].c != Card_B[i].c)
            stable = 0;
    }

    if (stable == 1)
        printf("Stable\n");
    else
        printf("Not stable\n");

    for (i = 0; i < n; i++)
    {
        printf("%c %d\n", Card_B[i].c, Card_B[i].v);
    }

    return 0;
}

void mergeSort(DATA Card_A[], int left, int right)
{

    int mid;
    if (left + 1 < right)
    {
        mid = (left + right) / 2;
        mergeSort(Card_A, left, mid);
        mergeSort(Card_A, mid, right);
        merge(Card_A, left, mid, right);
    }
}

void merge(DATA Card_A[], int left, int mid, int right)
{
    int n1, n2;
    int i, j, k;

    n1 = mid - left;
    n2 = right - mid;

    for (i = 0; i < n1; i++)
    {
        L[i] = Card_A[left + i];
    }
    for (i = 0; i < n2; i++)
    {
        R[i] = Card_A[mid + i];
    }

    L[n1].v = INT_MAX;
    R[n2].v = INT_MAX;

    i = j = 0;

    for (k = left; k < right; k++)
    {
        if (L[i].v <= R[j].v)
        {
            Card_A[k] = L[i];
            i++;
        }
        else
        {
            Card_A[k] = R[j];
            j++;
        }
    }
}

void quickSort(DATA Card_A[], int p, int r)
{
    int q;
    if (p < r)
    {
        q = partition(Card_A, p, r);
        quickSort(Card_A, p, q - 1);
        quickSort(Card_A, q + 1, r);
    }
}

int partition(DATA Card_A[], int p, int r)
{
    int i, j;

    DATA t, x;
    x = Card_A[r];
    i = p - 1;
    for (j = p; j < r; j++)
    {
        if (Card_A[j].v <= x.v)
        {
            i++;
            t = Card_A[i];
            Card_A[i] = Card_A[j];
            Card_A[j] = t;
        }
    }
    t = Card_A[i + 1];
    Card_A[i + 1] = Card_A[r];
    Card_A[r] = t;
    return i + 1;
}



Measured memory_bytes: 4044
#include<iostream>
#include<cstring>

using namespace std;

int n,m,q,v[100005],color[100005];

struct edge{
    int index;
    edge *next;
};

struct head{
    int index;
    edge *first;
}heads[100005];

void dfs(int pre,int num,int c){
    v[num]=1;
    color[num]=c;
    edge *e=heads[num].first;
    while(e!=NULL){
        if(e->index!=pre&&v[e->index]==0)
            dfs(num,e->index,c);
        e=e->next;
    }
}

int main(){
    memset(v,0,sizeof(v));
    memset(color,0,sizeof(color));
    memset(heads,0,sizeof(heads));
    cin>>n>>m;
    int i,j,c=0;
    for(i=0;i<n;i++){
        heads[i].index=i;
    }
    for(i=0;i<m;i++){
        int a,b;
        cin>>a>>b;
        edge *e1=new edge();
        edge *e2=new edge();
        e1->index=b;
        e2->index=a;
        e1->next=heads[a].first;
        e2->next=heads[b].first;
        heads[a].first=e1;
        heads[b].first=e2;
    }
    for(i=0;i<n;i++){
        if(v[i]==0)dfs(-1,i,++c);
    }
    cin>>q;
    for(i=0;i<q;i++){
        int a,b;
        cin>>a>>b;
        if(color[a]==color[b])cout<<"yes"<<endl;
        else cout<<"no"<<endl;
    }
}

Measured memory_bytes: 16340
import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        // int TC = Integer.parseInt(sc.next(), 10);
        
        while (true) {
            int N = sc.nextInt();
            if (N == 0) break;
            int[] arr = new int[N];
            for (int i = 0; i < N; i++) {
                arr[i] = sc.nextInt();
            }
            Arrays.sort(arr);
            int total = 0;
            for (int i = 1; i < N - 1; i++) {
                total += arr[i];
            }
            System.out.println(total / (N-2));
        }
    }
    
}




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

using namespace std;

#define INF 1000000007
#define LINF (1LL << 62)
#define PI 3.14159265358979

typedef long long i64;
typedef pair<i64,i64> P;

inline i64 mod(i64 a, i64 m) { return (a % m + m) % m; }

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 n;
void solve(){
	cin >> n;
	
	n%=10;
	if(n == 3) cout << "bon" << endl;
	else if(n == 0 || n == 1 || n == 6 || n == 8) cout << "pon" << endl;
	else cout << "hon" << endl;
}

int main(){
	std::cin.tie(0);
	std::ios::sync_with_stdio(false);
	int t = 1;
	//cin >> t;
	while(t--){
		solve();
	}
	
	return 0;
}

Measured memory_bytes: 3652
import std.algorithm, std.container, std.conv, std.math, std.range, std.typecons, std.stdio, std.string;

auto rdsp(){return readln.splitter;}
void pick(R,T)(ref R r,ref T t){t=r.front.to!T;r.popFront;}
void readV(T...)(ref T t){auto r=rdsp;foreach(ref v;t)pick(r,v);}
void readA(T)(size_t n,ref T[]t){t=new T[](n);auto r=rdsp;foreach(ref v;t)pick(r,v);}

void main()
{
  int n; long k; readV(n, k);
  long[] a; readA(n, a);

  if (k == 0) {
    writeln(a.sum);
    return;
  }

  auto m = 40;
  auto dp = new long[][](m+1, 2);
  foreach (ref dpi; dp) dpi[] = -1;
  dp[$-1][1] = 0;

  foreach_reverse (i; 0..m)
    foreach (j; 0..2) {
      auto d = j ? k.bit(i) : 1;
      foreach (b; 0..d+1)
        if (dp[i+1][j] >= 0)
          dp[i][j && b == k.bit(i)].maxU(dp[i+1][j] + (1L<<i)*a.count!(ai => ai.bit(i) == 1-b));
    }

  writeln(dp[0].reduce!max);
}

auto bit(long a, size_t b) { return (a>>b)&1; }
auto maxU(T)(ref T a, T b) { return a = max(a, b); }


Measured memory_bytes: 5628
#include <cstdio>
#include <cstring>
#define Maxn 300
#define Maxk 10
#define Inf 0x3f3f3f3f
int f[Maxn+5][Maxn+5];
int d[Maxk+5][Maxk+5];
//f[i][j]表示从S到T的路径上有i个x和j个y时其余边的最小可能长度 
//d[x][y]=min{f[i][j]+i*x+j*y}
//f[i][j]=max{d[x][y]-i*x-j*y}
int mx(int a,int b){
    return a>b?a:b;
}
int mn(int a,int b){
    return a<b?a:b;
}
int n,m;
int main(){
    scanf("%d%d",&n,&m);
    for(int i=1;i<=n;i++)
        for(int j=1;j<=m;j++)
            scanf("%d",&d[i][j]);
    for(int i=0;i<=100;i++)
        for(int j=0;j<=100;j++)
            for(int x=1;x<=n;x++)
                for(int y=1;y<=m;y++)
                    f[i][j]=mx(f[i][j],d[x][y]-i*x-j*y);
    for(int x=1;x<=n;x++)
        for(int y=1;y<=m;y++){
            int now=Inf;
            for(int i=0;i<=100;i++)
                for(int j=0;j<=100;j++)
                    now=mn(now,f[i][j]+i*x+j*y);
            if(now!=d[x][y]){puts("Impossible");return 0;}
        }
    puts("Possible");puts("202 10401");
    for(int i=1;i<=100;i++)printf("%d %d X\n",i,i+1);
    for(int i=102;i<202;i++)printf("%d %d Y\n",i,i+1);
    for(int i=0;i<=100;i++)
        for(int j=0;j<=100;j++)
            printf("%d %d %d\n",i+1,202-j,f[i][j]);
    puts("1 202");
}

Measured memory_bytes: 384
package main

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

var sc = bufio.NewScanner(os.Stdin)

func init() {
	sc.Split(bufio.ScanWords)
	sc.Buffer(make([]byte, 1024*1024), bufio.MaxScanTokenSize)
}

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

func nextInt() int {
	a, _ := strconv.Atoi(next())
	return a
}

func main() {
	N := nextInt()
	var n int
	l := make([]int, N)
	for i := 0; i < N; i++ {
		n = nextInt()
		l[i] = n
	}

	for i := N - 1; i > 0; i-- {
		if l[i-1] > l[i] {
			l[i-1]--
		}
		if l[i-1] > l[i] {
			fmt.Println("No")
			return
		}
	}
	fmt.Println("Yes")
}


Measured memory_bytes: 5240
#include <iostream>
//#include <set>
using namespace std;

int main(void) {
  string S;
  cin >> S;
  
  int alphabet[26] = { 0 };
  int index;
  for (int i = 0; i < S.size(); ++i) {
    index = int(S[i]) - 97;
    ++alphabet[index];
  }
  int min = -1;
  for (int i = 0; i < 26; i++) {
    if (alphabet[i] == 0) {
      min = i;
      break;
    }
  }
  
  if (min == -1) cout << "None" << endl;
  else cout << (char)(min + 97) << endl;
  
  
  return 0;
}

Measured memory_bytes: 512
#include <bits/stdc++.h>
using namespace std;
#define FOR(i,a,b) for(int i=(a),i##formax=(b);i<i##formax;i++)
#define FORR(i,a,b) for(int i=(a),i##formax=(b);i>=i##formax;i--)
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define pcnt __builtin_popcount
#define sz(x) (int)(x).size()
#define maxs(x,y) x=max(x,y)
#define mins(x,y) x=min(x,y)
#define show(x) cout<<#x<<" = "<<x<<endl;
#define all(a) (a.begin()),(a.end())
#define each(it,c) for(__typeof((c).begin()) it=(c).begin();it!=(c).end();it++)
#define perm(c) sort(all(c));for(bool c##p=1;c##p;c##p=next_permutation(all(c)))
#define bitComb(a,n,k) for(int a##x,a##y,a=(1<<k)-1;a<(1<<n);a##x=a&-a,a##y=a+a##x,a=(((a&~a##y)/a##x)>>1)|a##y)
#define uniq(v) sort(all(v));v.erase(unique(all(v)), v.end())
#define bit(n) (1LL<<(n))
#define randInt(l,r) (uniform_int_distribution<ll>(l,r)(rnd))
#define randDouble(l,r) (uniform_real_distribution<double>(l,r)(rnd))
#define dout(d) printf("%.12f\n",d)

typedef long long ll;
typedef __int128_t lll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
template<class T>using V=vector<T>;
template<class T>using VV=V<V<T>>;
template<class T,class Y>ostream& operator<<(ostream& o,const pair<T,Y>& p){return o<<"("<<p.fi<<", "<<p.se<<")";}
template<typename A,size_t N,typename T>void Fill(A (&array)[N],const T&v){fill((T*)array,(T*)(array+N),v);}
lll gcd(lll a,lll b,lll &x,lll &y){if(!b){x=1;y=0;return a;}lll d=gcd(b,a%b,y,x);y-=a/b*x;return d;}
ll gcd(ll a,ll b){lll x=0,y=0;return gcd(a,b,x,y);}
ll modInv(ll a,ll m){lll x,y;gcd(a,m,x,y);return (x%m+m)%m;}
ll modPow(lll a,lll n,ll m){if(!a)return a;lll p=1;for(;n>0;n>>=1,a=a*a%m)if(n&1)p=p*a%m;return(ll)p;}
bool isPrime(ll n){if(n<2||n%2==0)return n==2;lll t=n-1,d=t/(t&-t);for(lll a:{2,325,9375,28178,450775,9780504,1795265022})if(a%n){for(t=d,a=modPow(a,t,n);t!=n-1&&a!=1&&a!=n-1;a=a*a%n,t=t*2%n);if(a!=n-1&&t%2==0)return 0;}return 1;}
const int IINF = 1e9+6;
const ll LINF = 1e18;
const int MOD = 1e9+7;
const double PI = acos(-1);
const double EPS = 1e-10;
static random_device rd;
static mt19937 rnd(rd());

const int N = 1e5;
struct Prime{
  vector<ll> pl;
  void init(int a){ // a以下の素数列挙
    pl.resize(0);
    vector<bool> z(a+1, true);
    for(int i=2; i<=a; i++){
      if(z[i])pl.push_back(i);
      for(int b=i*2; b <= a; b+=i) z[b]=false;
    }
  }
  void divisor(ll a, vector<ll>& v){
    v = vector<ll>(1,1);
    for(ll b: pl){
      if(b*b > a) break;
      if(a%b) continue;
      int l=0, vs=v.size();
      while(a%b==0){
        a /= b;
        for(int i=v.size()-1; i>=l; i--) v.push_back(v[i] * b);
        l += vs;
      }
    }
    if(a>1) for(int i=v.size()-1; i>=0; i--) v.push_back(v[i] * a);
    sort(v.begin(), v.end());
  }
} pr;
ll n;
vector<ll> v;
main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  cin >> n;
  ll ans = 0;
  pr.init(1000000);
  pr.divisor(n, v);
  for(ll a:v){
    ll b = n/a-1;
    if(a < b) ans += b;
  }
  cout << ans << endl;
}

Measured memory_bytes: 1528
s = input()

flag = False
if s[0] == "0": flag = True
if s[-1] == "1": flag = True

N = len(s) // 2 + len(s) % 2
for i in range(N):
  if s[i] != s[-2 - i]:
    flag = True

if flag:
  print("-1")
  exit()

re = 1
for i in range(1, len(s)):
  print(re, i + 1)
  if s[i - 1] == "1":
    re = i + 1

Measured memory_bytes: 4648
import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int ans = 0;
        for (int i = 0; i < n; i++) {
            ans += sc.nextInt() - 1;
        }
        System.out.println(ans);
    }
}


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

#undef _P
#define _P(...) (void)printf(__VA_ARGS__)
#define FOR(x,to) for(x=0;x<(to);x++)
#define FORR(x,arr) for(auto& x:arr)
#define ITR(x,c) for(__typeof(c.begin()) x=c.begin();x!=c.end();x++)
#define ALL(a) (a.begin()),(a.end())
#define ZERO(a) memset(a,0,sizeof(a))
#define MINUS(a) memset(a,0xff,sizeof(a))
//-------------------------------------------------------

ll N;
ll A[505][505];

const int prime_max = 1000000;
int NP,prime[100000],divp[prime_max];
map<int,int> M;

void cprime() {
	if(NP) return;
	for(int i=2;i<prime_max;i++) if(divp[i]==0) {
		prime[NP++]=i;
		for(ll j=1LL*i*i;j>=i&&j<prime_max;j+=i) if(divp[j]==0) divp[j]=i;
	}
}

ll LCM(ll a,ll b) {
	if(a==0) return b;
	if(b==0) return a;
	return a/__gcd(a,b)*b;
}

void solve() {
	int i,j,k,l,r,x,y; string s;
	
	cin>>N;
	
	cprime();
	
	vector<int> P[2];
	FOR(i,500) {
		if(i%2==0) {
			P[0].push_back(prime[i]);
			P[1].push_back(prime[i+1]);
		}
		else {
			P[0].push_back(prime[998-(i-1)]);
			P[1].push_back(prime[999-(i-1)]);
		}
	}
	
	FOR(y,500) FOR(x,500) if((x+y)%2==0) {
		i=(x+y)/2;
		j=(x-y)/2+249;
		A[y][x]=1LL*P[0][i]*P[1][j];
	}
	FOR(y,500) FOR(x,500) if((x+y)%2==1) {
		if(y) A[y][x]=LCM(A[y-1][x],A[y][x]);
		if(x) A[y][x]=LCM(A[y][x-1],A[y][x]);
		if(y<499) A[y][x]=LCM(A[y+1][x],A[y][x]);
		if(x<499) A[y][x]=LCM(A[y][x+1],A[y][x]);
		A[y][x]++;
	}
	
	
	FOR(y,N) {
		FOR(x,N) cout<<A[y][x]<<" ";
		cout<<endl;
	}
	
}


int main(int argc,char** argv){
	string s;int i;
	if(argc==1) ios::sync_with_stdio(false), cin.tie(0);
	FOR(i,argc-1) s+=argv[i+1],s+='\n'; FOR(i,s.size()) ungetc(s[s.size()-1-i],stdin);
	cout.tie(0); solve(); return 0;
}



Measured memory_bytes: 9472
#define _CRT_SECURE_NO_WARNINGS
#include <bits/stdc++.h>
#include <chrono>
#include <random>

using namespace std;

#define int long long
#define ll long long
//#define double long double
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()

const int INF = 2e9;
const int MB = 20;
const int MOD = 998244353;

void solve() {
    int n = 3;
    vector<vector<int>> a(n, vector<int>(n));
    vector<vector<bool>> good(n, vector<bool>(n));
    for (int i = 0; i < n; i++) {
        for (int j = 0; j < n; j++) {
            cin >> a[i][j];
        }
    }
    int m;
    cin >> m;
    for (int i = 0; i < m; i++) {
        int x;
        cin >> x;
        for (int j = 0; j < n; j++) {
            for (int c = 0; c < n; c++) {
                if (a[j][c] == x) good[j][c] = true;
            }
        }
    }

    for (int i = 0; i < n; i++) {
        bool one = true;
        bool two = true;
        for (int j = 0; j < n; j++) {
            if (!good[i][j]) one = false;
            if (!good[j][i]) two = false;
        }
        if (one || two) {
            cout << "Yes";
            return;
        }
    }
    
    if ((good[0][0] && good[1][1] && good[2][2]) || (good[2][0] && good[1][1] && good[0][2])) {
        cout << "Yes";
    }
    else {
        cout << "No";
    }
}
signed main() {
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);
    solve();
}

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

int main() {
#ifdef LOCAL
    freopen("xxx.in", "r", stdin);
    freopen("xxx.out", "w", stdout);    
#endif
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    int n, m;
    cin >> n >> m;
    
    int j = 0;
    if ((n % 2) == 1) {
        for (int i = 0; i < m; ++i) {
            cout << j + 1 << " " << n - j << "\n";
            ++j;
        }
    } else {
        for (int i = 0; i < min(m, n / 4); ++i) {
            cout << j + 1 << " " << n - j << "\n";
            ++j;
        }
        for (int i = min(m, n / 4); i < m; ++i) {
            cout << j + 1 << " " << n - j - 1 << "\n";
            ++j;
        }
    }
    return 0;
}

Measured memory_bytes: 3648
#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;
using VP = vector<P>;
using VVP = vector<VP>;
using VI = vector<ll>;
using VVI = vector<VI>;
using VVVI = vector<VVI>;
const int inf = 1e9 + 7;
const ll INF = 1LL << 61;
const ll mod = 1e9 + 7;

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

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

int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    int i, j;
    int n;
    cin>>n;
    ll a[n],b[n];
    for(i=0;i<n;i++) cin>>a[i]>>b[i];
    if(n%2==0){
    sort(a,a+n);
    sort(b,b+n);
    ll m = a[(n-1)/2]+a[n/2];
    ll M = b[(n-1)/2]+b[n/2];
    cout<<M-m+1<<endl;
    }else {
        sort(a,a+n);
        sort(b,b+n);
        ll m = a[n/2];
        ll M = b[n/2];
        cout<<M-m+1<<endl;
    }
    


}

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

int main() {
  int a,b;
  cin >> a >> b;
  int sum = a + b;
  if(sum == 3){
    cout << 3;
  }else if(sum == 4){
    cout << 2;
  }else if(sum == 5){
    cout << 1;
  }
}

Measured memory_bytes: 256
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools
from collections import deque

sys.setrecursionlimit(10**7)
inf = 10**20
mod = 10**9 + 7

DR = [1, -1, 0, 0]
DC = [0, 0, 1, -1]

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()
     
def main():
    N, K = LI()
    cnt = 0
    while N:
        N = N//K
        cnt += 1
    print(cnt)
main()



Measured memory_bytes: 66924
using System;
using System.Linq;
using System.Collections.Generic;

class Program
{

    static void Main(string[] args)
    {
        var A = int.Parse(Console.ReadLine());
        var B = int.Parse(Console.ReadLine());
        var C = int.Parse(Console.ReadLine());
        var D = int.Parse(Console.ReadLine());
        var E = int.Parse(Console.ReadLine());

        var times = new int[] { A, B, C, D, E };
        var lastIndex = 0;
        var maxDiff = -1;
        for (int i = 0; i < times.Length; i++)
        {
            var time = times[i];
            if (time % 10 == 0)
            {
                continue;
            }
            var diff = 10 - time % 10;
            if (maxDiff < diff)
            {
                lastIndex = i;
                maxDiff = diff;
            }
        }

        var sum = 0;
        for (int i = 0; i < times.Length; i++)
        {
            if (lastIndex == i)
            {
                sum += times[i];
                continue;
            }

            sum += ((times[i] + 9) / 10) * 10;
        }

        Console.WriteLine(sum);
    }


}



Measured memory_bytes: 11092
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.io.StringReader;
import java.util.ArrayList;
import java.util.StringTokenizer;

public class Main  implements Runnable {
    public static void main(String[] args) {

        new Thread(null, new Main(), "", 16 * 1024 * 1024).start();

    }

    public void run() {
    	FastScanner sc = new FastScanner(System.in);
/*		FastScanner sc = new FastScanner("6 6 \r\n" +
				"..#..#\r\n" +
				"......\r\n" +
				"#..#..\r\n" +
				"......\r\n" +
				".#....\r\n" +
				"....#.");*/
    	//FastScanner sc = new FastScanner("1000000000000");
		//long n = Long.parseLong(sc.next());
		int a = Integer.parseInt(sc.next());
		int p = Integer.parseInt(sc.next());
		//int m = Integer.parseInt(sc.next());
		//int x2000 = Integer.parseInt(sc.next());
		//int t = Integer.parseInt(sc.next());
		//int k = 0;
		//int k = Integer.parseInt(sc.next());
		//String str = sc.next();
		//char c[] = str.toCharArray();
		//char a[][] = new char[n];
		//int atmp[] = new int[h];
		//int max= 0;
		//int blackar[][] = new int[h*w][2];
		//int p=0;
		
		PrintWriter out = new PrintWriter(System.out);
		//for(long i = 1; i < n; i++)
		//{
		//	if(n/i==n%i)
		//	{
		//		out.println(n + ":" + i + ":" + n/i + ":" + n%i+":"+ (n/(n%i)-1));
		//	}
		//}


		out.println((a*3+p)/2);
		out.flush();
	}

    static class FastScanner {
        private BufferedReader reader = null;
        private StringTokenizer tokenizer = null;
        public FastScanner(String in) {
        	StringReader sr = new StringReader(in);
            reader = new BufferedReader(new BufferedReader(sr));
            tokenizer = null;
        }
        public FastScanner(InputStream in) {
            reader = new BufferedReader(new InputStreamReader(in));
            tokenizer = null;
        }

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

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

            return tokenizer.nextToken("\n");
        }

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

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

    }

}

Measured memory_bytes: 23252
#include <iostream>
#include <vector>
#include <iomanip>
#include <algorithm>
#define rep(x,n) for(int x=0;x<(n);x++)
#define all(vec) vec.begin(),vec.end()


using namespace std;
template<typename T>
ostream& operator<<(ostream& os,const vector<T>& vec){
    os << "[";
    for(const auto& v : vec){
        os << v << ",";
    }
    os << "]";
    return os;
}

int main(){
    int k = 0;
    while(true){
        k++;
        int n; cin >> n;
        if(n == 0) break;
        // (X1,Y1) is upper left.
        // (X1,Y1) is lower right.
        vector<double> X1(n),X2(n),Y1(n),Y2(n);
        rep(i,n){
            double x,y,r;
            cin >> x >> y >> r;
            X1[i] = x-r;
            X2[i] = x+r;
            Y1[i] = y-r;
            Y2[i] = y+r;
        }
        vector<double> X,Y;
        X.insert(X.end(),all(X1));
        X.insert(X.end(),all(X2));
        Y.insert(Y.end(),all(Y1));
        Y.insert(Y.end(),all(Y2));

        sort(all(X));
        sort(all(Y));

        X.erase(unique(all(X)),X.end());
        Y.erase(unique(all(Y)),Y.end());

        rep(i,n){
            X1[i] = lower_bound(all(X),X1[i]) - X.begin();
            X2[i] = lower_bound(all(X),X2[i]) - X.begin();
            Y1[i] = lower_bound(all(Y),Y1[i]) - Y.begin();
            Y2[i] = lower_bound(all(Y),Y2[i]) - Y.begin();
        }
        vector<vector<char>> is_on(X.size(),vector<char>(Y.size()));
        for(int i=0;i<n;i++){
            for(int sx=X1[i];sx<X2[i];sx++){
                for(int sy=Y1[i];sy<Y2[i];sy++){
                    is_on[sx][sy] = true;
                }
            }
        }
        double ans = 0;
        for(int i=0;i<X.size()-1;i++){
            for(int j=0;j<Y.size()-1;j++){
                if(is_on[i][j]){
                    ans += (X[i+1]-X[i]) * (Y[j+1]-Y[j]);
                }
            }
        }
        cout << fixed << setprecision(2);
        cout << k << " " << ans << endl;
    }
}

Measured memory_bytes: 1344
#include <bits/stdc++.h>
using namespace std;
int main(){
    int k;
   string s;
   cin >> k >>s;
   if(s.size() <= k){
       cout << s << endl;
   }else{
       for(int i = 0;i<k;i++){
           cout << s.at(i);
       }
       cout << "..." << endl;
   }
 
}


Measured memory_bytes: 3632
#include <bits/stdc++.h>
using namespace std;
const int N=2050;
inline int gi(){
  char ch=getchar();int x=0,q=0;
  while(ch<'0' || ch>'9') ch=='-'?q=1:0,ch=getchar();
  while(ch>='0' && ch<='9') x=x*10+ch-'0',ch=getchar();
  return q?(-x):x;
}
int a[N],ans;
bitset<4000001>f;
int main(){
  int n=gi(),mn=1e9,p;
  f.set(0);
  for (int i=1; i<=n; ++i){
    a[i]=gi(),ans+=a[i];
    f|=f<<a[i];
  }
  for (int i=0; i<=ans; ++i)
    if (f[i]==1)
      if (abs(ans-2*i)<mn)
	mn=abs(ans-2*i),p=max(i,ans-i);
  cout<<p;
  return 0;
}


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

#define LL long long
#define REP(i, n) for(int i = 0; i < (int)(n); i++)
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define ALL(x) (x).begin(),(x).end()
const int IINF = 1e9;
const LL LINF = 1e18;
const LL mod = 1e9+7;

int main() {
    string s;
    cin >> s;
    int r = (s[0] == 'o') + (s[1] == 'o') + (s[2] == 'o');
    int res = 700 + r*100;
    cout << res << endl;
    return 0;
}



Measured memory_bytes: 256
#include <cstdio>

int main()
{
  int n;
  scanf("%d",&n);
  static int a[100000];
  for(int i=0;i<n;i++){
    scanf("%d",a+i);
    a[i]--;
  }
  int C=0;
  for(int i=0;i<n;i++){
    if(a[i]>i&&a[a[i]]==i){
      C++;
    }
  }
  printf("%d\n",C);
  return 0;
}


Measured memory_bytes: 512
#include<iostream>
#include<map>
using namespace std;
int S;
main()
{
	cin>>S;
	map<int,int>M;
	for(int i=1;i<=S;i++)
	{
		int t=i;
		for(int j=i;j<=S;j+=++t)M[j]++;
	}
	long ans=0;
	for(int i=1;i<=S;i++)
	{
		if(S%i==0)
		{
			ans+=1L*M[i]*M[S/i];
		}
	}
	cout<<ans<<endl;
}



Measured memory_bytes: 7700
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<string> vs;
typedef vector<bool> vb;
typedef vector<char> vc;
typedef vector<ll> vll;
typedef vector<vector<int>> vvi;
typedef vector<vector<string>> vvs;
typedef vector<vector<char>> vvc;
typedef vector<vector<bool>> vvb;
typedef pair<int,int> P;
typedef pair<ll, ll> Pll;
#define vrep(v,n) for(int i=0;i<n;i++){cin >> v.at(i);} 
#define rep(i, l, n) for (int i = l; i < (int)(n); i++)
#define repn(i, l, n) for (int i = l; i <= (int)(n); i++)
#define pb push_back 
void chmin(int &a, int b) {if(a > b) a = b;}

const int mod = 1000000007;
const int inf = 1e9;
int dx[4] = {1,-1,0,0};
int dy[4] = {0,0,1,-1};


int main(){
    ll n, k;
    cin >> n >> k;
    int ans = 0;
    while(n > 0){
        n /= k;
        ans++;
    }
    cout << ans;
}

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

int LinearSearch(int n, int *S, int _key){
    for (int i = 0; i < n; i++){
        if (S[i] == _key){
            return i;
        }
    }
    return -1;
}

int main(){
    int n, q;
    int *S, *T;
    int C = 0;

    cin >> n;
    S = new int[n];

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

    cin >> q;
    T = new int[q];

    for (int j = 0; j < q; j++){
        cin >> T[j];
        for (int i = 0; i < n; i++){
            if (S[i] == T[j]){
                C += 1;
                break;
            }
        }
    }

    delete[] S;
    delete[] T;

    cout << C << endl;

    return 0;
}


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

ll dp[100000];

int main(){
    int n;
    cin >> n;
    int h[n];
    for(int i = 0; i < n; i++){
        cin >> h[i];
    }
    dp[0]=0;
    dp[1]=abs(h[0]-h[1]);
    

    for(int i = 1; i <= n; i++){
        dp[i+1]=min(dp[i-1]+abs(h[i-1]-h[i+1]),dp[i]+abs(h[i]-h[i+1]));
    }

    cout << dp[n-1] <<endl;

}

Measured memory_bytes: 1408
#gcdは3.4.3だとfractionsにある
from fractions import gcd

from math import factorial as f

from math import ceil,floor,sqrt

from sys import exit

from copy import deepcopy
import numpy as np

import bisect
import re


ii = lambda : int(input())
mi = lambda : map(int,input().split())
li = lambda : list(map(int,input().split()))



def main():
    w = ['Sunny', 'Cloudy', 'Rainy','Sunny']
    s = input()
    for i in range(3):
        if w[i] == s:
            print(w[i+1])
            
main()


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

const double eps = 1e-9;
struct V {
  double x, y;
  V(double x=0, double y=0): x(x), y(y) {}
  V& operator+=(const V& v) { x += v.x; y += v.y; return *this;}
  V operator+(const V& v) const { return V(*this) += v;}
  V& operator-=(const V& v) { x -= v.x; y -= v.y; return *this;}
  V operator-(const V& v) const { return V(*this) -= v;}
  V& operator*=(double s) { x *= s; y *= s; return *this;}
  V operator*(double s) const { return V(*this) *= s;}
  V& operator/=(double s) { x /= s; y /= s; return *this;}
  V operator/(double s) const { return V(*this) /= s;}
  double dot(const V& v) const { return x*v.x + y*v.y;}
  double cross(const V& v) const { return x*v.y - v.x*y;}
  double norm2() const { return x*x + y*y;}
  double norm() const { return sqrt(norm2());}
  
  int ort() const { // orthant
    if (abs(x) < eps && abs(y) < eps) return 0;
    if (y > 0) return x>0 ? 1 : 2;
    else return x<0 ? 3 : 4;
  }
  bool operator<(const V& v) const {
    int o = ort(), vo = v.ort();
    if (o != vo) return o < vo;
    return cross(v) > 0;
  }
};
istream& operator>>(istream& is, V& v) {
  is >> v.x >> v.y; return is;
}
ostream& operator<<(ostream& os, const V& v) {
  os<<"("<<v.x<<","<<v.y<<")"; return os;
}

int main() {
  int n;
  cin >> n;
  vector<V> v(n);
  rep(i,n) cin >> v[i];
  sort(v.begin(), v.end());
  double ans = 0;
  rep(l,n) {
    int r = l;
    V now;
    rep(i,n) {
      now += v[r];
      ans = max(ans, now.norm());
      r = (r+1)%n;
    }
  }
  printf("%.12f\n", ans);
  return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;using ll=long long;using uint=unsigned int;using pii=pair<int,int>;using pll=pair<ll,ll>;using ull = unsigned long long;using ld=long double;template<typename T>void _(const char*s,T h){cerr<<s<<" = "<<h<<"\n";}template<typename T,typename...Ts>void _(const char*s,T h,Ts...t){int b=0;while(((b+=*s=='(')-=*s==')')!=0||*s!=',')cerr<<*s++;cerr<<" = "<<h<<",";_(s+1,t...);}// break continue pop_back 998244353
#define int ll
#define pii pll
#define f first
#define s second
#define pb emplace_back
#define forn(i,n) for(int i=0;i<(n);++i)
#define sz(a)((int)(a).size())
#define sqr(x) ((x)*(x))
struct init{init(){cin.tie(0);iostream::sync_with_stdio(0);cout<<fixed<<setprecision(10);cerr<<fixed<<setprecision(5);}~init(){
#ifdef LOCAL
#define dbg(...) _(#__VA_ARGS__,__VA_ARGS__)
cerr<<"Time elapsed: "<<(double)clock()/CLOCKS_PER_SEC<<"s.\n";
#else
#define dbg(...) 
#endif
}}init;template<typename T,typename U>void upx(T&x,U y){if(x<y)x=y;}template<typename T,typename U>void upn(T&x,U y){if(x>y)x=y;}mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());const int D=4,dx[]={+1,0,-1,0},dy[]={0,+1,0,-1};

int clev(string dd){
    int n=sz(dd);
    int ans=0;
    for(int len=n;len<=n+n;++len){
        vector<int> m(len),d(len);
        int delta=len-n;
        forn(i,n)d[i+delta]=dd[i]-'0';
        forn(mask,1<<len-1){
            int res=1;
            forn(i,len-1)m[i]=mask>>i&1;
            forn(i,(len+1)/2){
                int rel1=d[i]+m[i];if(i)rel1-=m[i-1]*10;
                int rel2=-d[len-i-1]-m[len-i-1];if(len-i-1)rel2+=m[len-i-2]*10;
                if(rel1!=rel2){
                    res=0;
                }else{
                    int l=!i,r=9;
                    upx(l,l-rel1);
                    upn(r,r-rel1);
                    if(l<=r)res*=r-l+1;
                    else res=0;
                }
            }
            ans+=res;
        }
    }
    return ans;
}


int32_t main(){
    string dd;
    cin>>dd;
    cout<<clev(dd)<<'\n';
    return 0;
}


Measured memory_bytes: 3640
#include<bits/stdc++.h>
using namespace std;
const long long maxn=2e5+5;
const long long inf=0x3f3f3f3f;
long long a[maxn];
int main(){
	ios::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
	//freopen(".in","r",stdin);
	//freopen(".out","w",stdout);
	long long n,k;
	cin>>n>>k;
	for(long long i=1;i<=n;i++)
		cin>>a[i];
	for(long long i=k+1;i<=n;i++)
	{
		long long j=i-k;
		if(a[i]>a[j])
			cout<<"Yes\n";
		else
			cout<<"No\n";
	}
	return 0;
}




Measured memory_bytes: 5216
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,sse3,sse4,popcnt,abm,mmx")

#include <bits/stdc++.h>   
#include <stdio.h>    
 
using namespace std;
     
#define F first
#define S second
#define lb lower_bound               
#define ub upper_bound
#define pb push_back
#define pf push_front    
#define ppb pop_back
#define mp make_pair
#define bpp __builtin_popcountll                                                                                        
#define sqr(x) ((x) * (x)) 
#define al 0x3F3F3F3F
#define sz(x) (int)x.size()
#define all(x) x.begin(), x.end()
#define in insert
#define ppf pop_front
#define endl '\n'
#define int long long
 
typedef unsigned long long ull;
typedef long long ll;
typedef long double ld;
typedef pair <int, int> pii;
 
const int mod = (int)1e9 + 7;
const int N = (int)2e5 + 123;
const ll inf = (ll)3e18 + 1;

const double pi = acos (-1.0);
const double eps = 1e-10;
const int dx[] = {0, 0, 1, 0, -1};
const int dy[] = {0, 1, 0, -1, 0};

int n;
ld x[N], y[N];
char d[N];

inline ld f (ld c) {
   ld mx_x = -inf, mx_y = -inf, mn_x = inf, mn_y = inf;
   for (int i = 1; i <= n; i ++) {
      if (d[i] == 'D') {
         ld val = y[i] - c;
         if (mx_y < val) mx_y = val;
         if (mn_y > val) mn_y = val;
         if (mx_x < x[i]) mx_x = x[i];
         if (mn_x > x[i]) mn_x = x[i];
      }  
      if (d[i] == 'U') {
         ld val = y[i] + c;
         if (mx_y < val) mx_y = val;
         if (mn_y > val) mn_y = val;
         if (mx_x < x[i]) mx_x = x[i];
         if (mn_x > x[i]) mn_x = x[i];
      }
      if (d[i] == 'R') {
         ld val = x[i] + c;
         if (mx_x < val) mx_x = val;
         if (mn_x > val) mn_x = val;
         if (mx_y < y[i]) mx_y = y[i];
         if (mn_y > y[i]) mn_y = y[i];
      }
      if (d[i] == 'L') {
         ld val = x[i] - c;
         if (mx_x < val) mx_x = val;
         if (mn_x > val) mn_x = val;
         if (mx_y < y[i]) mx_y = y[i];
         if (mn_y > y[i]) mn_y = y[i];
      }
   }
   return (mx_x - mn_x) * (mx_y - mn_y);
}

inline void boost () {                    
   ios_base :: sync_with_stdio (NULL);
   cin.tie (NULL), cout.tie (NULL);          
}                                                     

inline void Solve () {
   cin >> n;
   for (int i = 1; i <= n; i ++) cin >> x[i] >> y[i] >> d[i];
   ld l = 0.0, r = 100000000.0;
   ld ans;
   for (int it = 0; it <= 400; it ++) {
      ld h = (r - l) / 3.0;
      ld m1 = l + h;
      ld m2 = r - h; 
      ld M1 = f (m1), M2 = f (m2);
      if (M1 < M2) r = m2, ans = M1;
      else l = m1, ans = M2;
   }
   cout << fixed << setprecision (9) << ans;
}                                     

main () {                                       
// freopen (".in", "r", stdin);    
// frexopen (".out", "w", stdout);              
   boost ();
   int tt = 1;
// cin >> tt;   
   while (tt --) {
      Solve ();
   }                                               
   return 0;      
}


Measured memory_bytes: 6016
<?php
  
  $yohou = str_split(trim(fgets(STDIN))) ;
  $tenki = str_split(trim(fgets(STDIN))) ;
  $c = 0 ;
for($i=0;$i<3;$i++){
if($yohou[$i]==$tenki[$i]){
$c++;
}
}

echo $c ;

Measured memory_bytes: 3828
#include <stdio.h>
int main(){
  double a[11];
  double s;
  int i;
  while(scanf("%lf",&a[1])!=EOF){
    for(i=2;i<=10;i++){
      a[i]=0;
      if(i%2==0)a[i]=a[i-1]*2;
      else a[i]=a[i-1]/3;
    }
    for(i=1;i<=10;i++)s+=a[i];
    printf("%.8f\n",s);s=0;
  }
  return 0;
}

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

void insertionSort(int* A, int N){
    int i,v,j,t;
    for(i=0;i<N;i++){
        v = A[i];
        j = i - 1;
        while (j >= 0 and A[j] > v){
           A[j+1] = A[j];
           j-=1;
           A[j+1] = v;
        }
        
        for(t=0;t<N-1;t++){
            cout<<A[t]<<" ";
        }
        cout<<A[N-1]<<endl;
    }
}
int main(){
    int A[1000];
    int k,N;
    cin>>N;
    for(k=0;k<N;k++){
        cin>>A[k];
    }
    insertionSort(A,N);
    
}


Measured memory_bytes: 3092
#include <iostream>
#include <string>
#include <unordered_map>
using namespace std;
using LL = long long;
using ULL = unsigned long long;
using pii = pair<int, int>;
using pll = pair<LL, LL>;
const int MAX_N = 1e5;
unordered_map<string, int> occ;


int main()
{
    occ.reserve(4 * MAX_N);
    occ.max_load_factor(0.25);
    cin.sync_with_stdio(0);

    int N;
    cin >> N;
    
    while (N--)
    {
        string verdict;
        cin >> verdict;

        ++occ[verdict];
    }

    for (const string &verdict : {"AC", "WA", "TLE", "RE"})
    {
        cout << verdict << " x " << occ[verdict] << "\n";
    }
}

Measured memory_bytes: 6220
#include <bits/stdc++.h>
using namespace std;
const long double PI = acos(-1);
typedef long long ll;
typedef pair<int64_t,int64_t> pll;
int dx[]={1,-1,0,0,1,-1,1,-1};
int dy[]={0,0,1,-1,1,-1,-1,1};
#define INF (2147483647)
#define mod (1000000007)
#define limit (7368791)
#define rep(i,a,b) for (int64_t i = (a); i < (b); i++)
#define REP(i,n) rep(i,0,n)
#define ALL(a) begin(a),end(a)
#define sz(s) (s).size()
#define pb push_back
#define mp make_pair
#define fi first
#define se second

void solve()
{
   int x,sum=0;
   REP(i,2){
       cin>>x;
        if(x==1)sum+=300000;
        else if(x==2)sum+=200000;
        else if(x==3)sum+=100000;
   }if(sum==600000)sum=1000000;
   cout<<sum<<endl;
}
int main()
{
    cin.tie(0);
	ios::sync_with_stdio(false);
    solve();
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define mp make_pair
#define pb push_back
#define sz(x) (int)x.size()
#define all(x) begin(x), end(x)
#define debug(x) cerr << #x << " " << x << '\n'
using namespace std;
using ll = long long;
using pii = pair<int,int>;
using pli = pair<ll,int>;
const int INF = 0x3f3f3f3f, N = 505;
const ll LINF = 1e18 + 5;
int n, k, h[N];
ll dp[N][N];
int main()
{
 	ios::sync_with_stdio(false);
 	cin.tie(0);
 	cin >> n >> k;
 	for(int i=1;i<=n;i++) cin >> h[i];
 	for(int i=0;i<=n;i++)
 		for(int j=0;j<=n;j++)
 			dp[i][j] = LINF;
 	dp[0][0] = 0;
 	for(int i=1;i<=n;i++)
 		for(int j=1;j<=n-k;j++)
 			for(int t=0;t<i;t++)
 				dp[i][j] = min(dp[i][j],dp[t][j-1]+max(0,h[i]-h[t]));
 	ll ans = LINF;
 	//for(int i=1;i<=n;i++) for(int j=1;j<=i;j++) debug(dp[i][j]);
 	for(int i=1;i<=n;i++)
 			ans = min(ans,dp[i][n-k]); //debug(dp[n][i]);
 	if(ans==LINF) ans = 0;
  	cout << ans;
	return 0;
}


Measured memory_bytes: 1408
#include <iostream>
#include <algorithm>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <numeric>
#include <bitset>
#include <cmath>

static const int MOD = 1000000007;
using ll = long long;
using u32 = unsigned;
using u64 = unsigned long long;
using namespace std;

template<class T> constexpr T INF = ::numeric_limits<T>::max()/32*15+208;

int main() {
    ll a, b, c;
    scanf("%lld %lld.%lld", &a, &b, &c);
    b = b*100+c;
    cout << a*b/100 << "\n";
    return 0;
}

Measured memory_bytes: 3688
#include <bits/stdc++.h>
#define REP(i,n) for (int i = 0; i < (n); i++)
#define RREP(i, s, n) for (int i = s; i < (n); i++)
#define ALL(a) a.begin(), a.end()
#define RALL(a) a.rbegin(), a.rend()
#define maxs(x,y) x = max(x, y)
#define mins(x,y) x = min(x, y)
using namespace std;
using ll = long long;
typedef pair<int, int> pint;
typedef pair<ll, ll> pll;
const ll MOD = 1000000007;
const ll INF = MOD * MOD;
const int inf = (1<<29);

int main() {

    ll S;
    cin >> S;

    ll x1, y1, x2, y2, x3, y3;
    
    x1 = 0;
    y1 = 0;    
    x2 = 1000000000;
    y2 = 1;

    x3 = (x2 - S % x2) % x2;
    y3 = (S + x3) / x2;

    cout << x1 << " " << y1 << endl;
    cout << x2 << " " << y2 << endl;
    cout << x3 << " " << y3 << endl;

    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int N;
  cin >> N;
  int sum1 = 0;
  int sum2 = 0;
  
  vector<int>W(N);
  for (int i = 0; i < N; i++) {
    cin >> W.at(i);
    sum2 += W.at(i);
  }

  vector<int>count(N-1);
  for (int i = 0; i < N-1; i++) {
    sum1 += W.at(i);
    sum2 -= W.at(i);
    count.at(i) = abs(sum1-sum2);
  }
  sort(count.begin(), count.end());
  cout << count.at(0) << endl;
}
  

Measured memory_bytes: 3604
#include <stdio.h>
int main() {
	double a, b, c, d, e, f;
	double x, y;
	while(scanf(" %lf %lf %lf %lf %lf %lf",
				&a, &b, &c, &d, &e, &f) != EOF) {
		x = (e * c - b * f) / (a * e - b * d);
		y = (a * f - c * d) / (a * e - b * d);
		if (x == -0.0)
			x = 0.0;
		if (y == -0.0)
			y = 0.0;
		printf("%.3lf %.3lf\n", x, y);
	}
	return 0;
}

Measured memory_bytes: 652
#include <iostream>
#include <vector>
#include <algorithm>
#include <climits>
#include <string>
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
int dfs(int sv,vector<int> *adj_list,vector<bool> &visited,vector<int> &dp){
	int maxm = 0;
	visited[sv] = true;
	for(int x:adj_list[sv]){
		if(!visited[x]){
			maxm = max(maxm,1+dfs(x,adj_list,visited,dp));
		}
		else{
			maxm = max(maxm,1+dp[x]);
		}
	}
	return dp[sv] = maxm;
}
int main(int argc,char const* argv[]){
	ios_base::sync_with_stdio(false);
	cin.tie(nullptr);
	int n,m;
	cin>>n>>m;
	vector<int> *adj_list = new vector<int>[n+1];
	for(int i=0;i<m;i++){
		int u,v;
		cin>>u>>v;
		adj_list[u].push_back(v);
	}
	vector<bool> visited(n+1,false);
	vector<int> dp(n+1,0);
	int maxm = 0;
	for(int i=1;i<=n;i++){
		if(!visited[i]){
			maxm = max(maxm,dfs(i,adj_list,visited,dp));
		}
	}
	cout<<maxm<<endl;
	delete []adj_list;
	return 0;
}

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

using namespace std;

#define LIMIT 100
typedef int64_t ll;
typedef pair<ll, ll> ii;
typedef tuple<int, int, int> iii;
int gcd(ll a, ll b) { return (b==0)?a:gcd(b, a%b); }
int lcm(ll a, ll b) { ll i=(a/gcd(a,b))*b; assert(i>0); return i; }



//  ***** MAIN *****
int main(){
  //ios::sync_with_stdio(false);
  cin.tie(NULL);
  int n,h;
  cin >> n >> h;
  queue<iii> qu;

  int a[100000];
  int b[100000];

  for (int i = 0; i < n; ++i) {
    cin >> a[i] >> b[i];
  }
  sort(b, b+n);
  sort(a, a+n);
  int i = n-1, k = n-1;
  int t =0;
  while(h > 0){
    if(b[k] >a[i]){
      h -= b[k];
      k--;
    }
    else{
      h -= a[i];
    }
    t++;
  }
  std::cout << t << std::endl;

  return 0;
}




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

//型定義
typedef long long ll;

//定数
const ll INF=1e+10;
const int MOD=1e+9+7;

//REPマクロ
#define REP(i,n) for(ll i=0;i<(ll)(n);i++)
#define REPD(i,n) for(ll i=n-1;i>=0;i--)
#define REP2(i,a,b) for(ll i=a;i<(ll)(b);i++)
#define REPD2(i,a,b) for(ll i=a;i>(ll)(b);i--)

// 多次元 vector 生成
template<class T>
vector<T> make_vec(size_t a){
    return vector<T>(a);
}
template<class T, class... Ts>
auto make_vec(size_t a, Ts... ts){
  return vector<decltype(make_vec<T>(ts...))>(a, make_vec<T>(ts...));
}

//vectorの扱い
#define ALL(x) (x).begin(),(x).end() //sortなどの引数省略
#define SIZE(x) ((ll)(x).size()) //size
#define MAX(x) *max_element(ALL(x)) //最大値
#define MIN(x) *min_element(ALL(x)) //最小値

int main(){
    ll N,M,V,P;
    cin>>N>>M>>V>>P;
    vector<ll> A(N);
    vector<ll> A_sort(N);
    REP(i,N){
        cin>>A[i];
        A_sort[i]=A[i];
    }
    sort(ALL(A_sort));
    vector<ll> s(N+1,0);
    REP(i,N){
        s[i+1]=s[i]+A_sort[i];
    }

    ll l=-1;
    ll r=INF;
    while(r-l>1){
        ll x=(l+r)/2;
        bool ok=true;
        int num=upper_bound(ALL(A_sort),x+M)-A_sort.begin();
        int over=N-num;
        if(over>=P) ok=false;

        ll nokori=(V-P)*M;

        REP(i,N-P){
            ll cnt=min(M,x+M-A_sort[i]);
            nokori-=cnt;
        }

        if(x<=A_sort[N-P-1]){
            nokori+=M;
            nokori-=min(M,x+M-A_sort[N-P]);
        }

        if(nokori>0) ok=false;
        if(ok){
            r=x;
        }else{
            l=x;
        }
    }

    int ans=A_sort.end()-upper_bound(ALL(A_sort),l);
    cout<<ans<<endl;


}

Measured memory_bytes: 5620
#include <iostream>
#include <cstdio>
#include <vector>
#include <string>
#include <algorithm>
#include <set>
#include <map>

#define rep(i,n) for(int i=0; i<(n); i++)
#define reps(i,x,n) for(int i=x; i<(n); i++)
#define rrep(i,n) for(int i=(n)-1; i>=0; i--)
#define all(X) (X).begin(),(X).end()
#define X first
#define Y second
#define pb push_back
#define eb emplace_back

using namespace std;
typedef long long int ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;

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 (a>b) { a=b; return 1; } return 0; }

template<class A, size_t N, class T> void Fill(A (&a)[N], const T &v){ fill( (T*)a, (T*)(a+N), v ); }

const ll INF = 0x3fffffff;


int main(){
	//ios_base::sync_with_stdio(0);
	int N, ans=0;
	int A[100005];
	vector<int> v;

	cin >> N;
	rep(i,N) cin >> A[i];
	rep(i,N) v.emplace_back( A[i] );

	sort( all(v) );

	ll sum = 0;
	for(auto a: v){
		if( sum * 2 < a ){
			ans = 0;
		}
		sum += a;
		chmin(sum, INF);
		ans++;
	}

	cout << ans << endl;

	return 0;
}


Measured memory_bytes: 1276