akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <algorithm>
#include <cstdio>
#include <vector>
#include <math.h>
#include <iomanip>
#include <bitset>
#include <string>
#include <cstring>
#include <stdlib.h>
#include <utility>
#include <set>
using namespace std;
typedef long long int ll;
typedef long double ld;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
const long long INF = 1LL << 60;
typedef pair<ll,ll> pairs;
bool pairCompare(const pair<double,ll>& firstElof, const pair<double,ll>& secondElof){
    return firstElof.first < secondElof.first;
}
#define MAX_N 1000100
bool x[MAX_N];
ll num[MAX_N];
ll fibl[MAX_N]={0};
// 四方向への移動ベクトル
const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};
 
ll fib(ll a){
    if (fibl[a]!=0)return fibl[a];
    if (a==0){
        return 0;
    }else if (a==1){
        return 1;
    }
    return fibl[a]=fib(a-1)+fib(a-2);
}
 
ll eratosthenes(ll n) {
    int p = 0;
    for (ll i=0; i<=n; ++i) x[i] = true;
    x[0] = x[1] = false;
    for(int i=2; i<=n; ++i) {
        if(x[i]) {
            p++;
            for(int j=2*i; j<=n; j+=i) x[j] = false;
        }
        
        num[i] = p;
    }
    return p;
}
 
ll gcd(ll a,ll b){
    if (a%b==0)return(b);
    else return(gcd(b,a%b));
}
 
ll keta(ll N){
    int tmp{};
    while( N > 0 ){
        tmp += ( N % 10 );
        N /= 10;
    }
    N = tmp;
    return N;
}

int main(){
    ll k,t,rest;
    cin >> k >> t;
    ll a[t];
    for (ll i=0;i<t;i++)cin >> a[i];
    sort(a,a+t);
    rest=a[t-1];
    for (ll i=t-2;i>=0;i--){
        rest=abs(rest-a[i]);
    }
    cout << max(rest-1,0LL) << endl;
    return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<cstdio>
#include<math.h>
#include<string>
#include<algorithm>
#include<functional>
#include<vector>
#include<set>
#include<map>
#define INF 999999
#define EPS 1.0e-6

using namespace std;

typedef long long ll;
typedef pair<int,int> P;
typedef pair<int, P> PP;

int n,m;
vector<int> e[10];
int a[10];

int main()
{
	cin>>n>>m;
	int ai,bi;
	for(int i=0;i<m;i++){
		cin>>ai>>bi;
		ai--; bi--;
		e[ai].push_back(bi);
		e[bi].push_back(ai);
	}
	a[0]=0;
	for(int i=1;i<n;i++){
		a[i]=i;
	}

	int ans=0;

	do{
		int ope=0;
		for(int i=1;i<n;i++){
			int s=a[i-1],t=a[i];
			int jope=0;
			for(int j=0;j<e[s].size();j++){
				if(e[s][j]==t){
					jope++; break;
				}
			}
			if(jope==0){
				ope++;
				break;
			}
		}
		if(ope==0)ans++;

	}while(next_permutation(a+1,a+n));

	cout<<ans<<endl;

	return 0;
}

Measured memory_bytes: 256
#include<stdio.h>
#include<math.h>
main(){
	double x1,y1,x2,y2,d;
	scanf("%lf %lf %lf %lf",&x1,&y1,&x2,&y2);
	printf("%.5f\n",sqrt((x2-x1)*(x2-x1)+(y2-y1)*(y2-y1)));
	return 0;}

Measured memory_bytes: 656
#include<stdio.h>
int main(void)

{
	int a,b,h,w;
	while(1){
	scanf("%d %d",&h,&w);
	if(h == 0 && w == 0){
		break;
	}
	for(a=0;a<h;a++){
		for(b=0;b<w;b++){
			printf("#",h);
		}
		printf("\n");
	}
	printf("\n");
}
return 0;
}

Measured memory_bytes: 588
#include<bits/stdc++.h>
using namespace std;
     
int main(){
  string a,b;
  int key=0;
  cin>>a>>b;
  for(int i=0;i<=a.size();i++){
  if(a.size()>b.size()){
    cout<<"GREATER"<<endl;
    key=1;
    break;
  }
  else if(a.size()<b.size()){
    cout<<"LESS"<<endl;
    key=1;
    break;
  }
  else if(a[i]>b[i]){
    cout<<"GREATER"<<endl;
    key=1;
    break;
  }
  else if(a[i]<b[i]){
    cout<<"LESS"<<endl;
    key=1;
    break;
  }
  }
  if(key==0)cout<<"EQUAL"<<endl;
  return 0;
}


Measured memory_bytes: 256
#include<stdio.h>
#include<algorithm>

int n, k;
int w[100000];

int check(int p) {
    int weight = p;
    int num = 1;
    for (int j = 0; j < n; ++j) {
        if (weight - w[j] < 0) {
            ++num;
            weight = p;
        }
        if (num > k) {
            return j;
        }
        weight -= w[j];
    }

    return n;
}

int binarySearch(int w[], int left, int right) {

    if (left == right) return right;
    int mid = (left + right) / 2;
    int v = check(mid);

    if (v >= n) return binarySearch(w, left, mid);
    if (v < n) return binarySearch(w, mid + 1, right);

    return -1;
}

int main() {

    scanf("%d %d", &n, &k);
    int max = 0;
    int sum = 0;
    for (int i = 0; i < n; ++i) {
        scanf("%d", &w[i]);
        max = std::max(max, w[i]);
        sum += w[i];
    }
    int index = binarySearch(w, max, sum);
    if (index < 0) {
        printf("error: not found!!\n");
    }
    printf("%d\n", index);
}

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

const int inf = -1000;

int main() {

    int n,l;
    cin>>n>>l;

    int arr[n];
    int sum  =0;
    for(int i=0;i<n;++i){
        arr[i] = l+i;
        sum+=arr[i];

    }
    if(l>=0){
        sum-=l;
        cout<<sum;
        return 0;
    }
    else{
        for(int i=0;i<n;++i){
            if(arr[i]==0){
                cout<<sum;
                return 0;

            }


        }
        sum-=arr[n-1];
        cout<<sum;
    }
    return 0;
      }


Measured memory_bytes: 256
#include<stdio.h>
#include<string.h>
#include<math.h>
#include<stdlib.h>
#include<limits.h>

#define rep(i,begin,end) for(int i=begin; i<end; i++)
#define revrep(i,begin,end) for(int i=begin; i>end; i--)
#define lld long long int

int main(){
    lld n, d, m;
    scanf("%lld %lld %lld", &n, &m, &d);
    lld buf;
    if(d == 0){
        buf = n;
    }else if(d < (n+1)/2){
        buf = 2 * (n - 2*d) + d*2;
    }else if(d >= (n+1)/2){
        buf = n;
    }else{
        buf = 0;
    }
    double ans;
    ans = (double)buf * (m-1)/ pow(n, 2);
    printf("%.10lf", ans);

    return 0;
}

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

inline int read() {
	int num = 0, sym = 1;
	char ch = getchar();
	while (ch < '0' || ch > '9') {
		if (ch == '-')
			sym = -1;
		ch = getchar();
	}
	while ('0' <= ch && ch <= '9') {
		num = (num << 3) + (num << 1) + (ch ^ 48);
		ch = getchar();
	}
	return num * sym;
}

int x, y, z; 

int main() {
//	freopen(".in", "r", stdin);
//	freopen("out", "w", stdout);
	x = read();
	y = read();
	z = read();
	printf("%d %d %d", z, x, y);
	return 0;
}


Measured memory_bytes: 256
import Control.Monad
import Data.Maybe
import qualified Data.ByteString.Char8 as BS
import Data.List
import qualified Data.Vector.Unboxed as VU
import qualified Data.Vector.Unboxed.Mutable as VUM

readInt = fst . fromJust . BS.readInt
readIntList = map readInt . BS.words
getInt = readInt <$> BS.getLine
getIntList = readIntList <$> BS.getLine

main = do
    [n,maxW] <- getIntList
    items <- replicateM n $ do
        [w,v] <- getIntList
        return (w,v)
    print $ (solve maxW items) VU.! maxW


solve maxW [] = VU.replicate (maxW+1) 0
solve maxW ((w,v):xs) 
  = let a = solve maxW xs 
    in VU.generate (maxW+1)
      $ \i -> if w <= i then
                  max (a VU.! i) (a VU.! (i-w) + v)
              else a VU.! i

Measured memory_bytes: 81916
//😄😄😄😄😄😄😄😄😄😄😄😄😄
//Apno Swagat che//
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define vll vector<ll>
#define vi vector<int>
#define pi pair<int,int>
#define vp vector<pi>
#define pb push_back
#define mp make_pair
#define F first
#define S second
#define For(i,a,b) for(ll i=a;i<b;i++)
#define endl "\n"
#define debug(x) cout<<"AA Baju Smit------> "<<#x<<" -> "<<x<<endl
#define all(x) x.begin(),x.end()
#define mint map<int,int>
#define mod 10000007
#define ciN cin
////////////////////////////////////////////////////////////////
//Ha Moj Ha///
////////////////////////////////////////////////////////////////
////TEST CASES ATTACHED CHE BHULTO NAI......///////////////////


void jabru() {
	int n; ciN >> n;
	vi h(n);
	For(i, 0, n) {
		cin >> h[i];
	}
	vi dp(n + 1, 0);
	dp[0] = 0;
	dp[1] = 0;
	dp[2] = abs(h[0] - h[1]);
	For(i, 3, n + 1) {
		int x = abs(h[i - 1] - h[i - 2]) + dp[i - 1];
		int y = abs(h[i - 1] - h[i - 3]) + dp[i - 2];
		dp[i] = min(x, y);
	}
	cout << dp[n] << endl;



}




////////////////////////////////////////////////////////////////
//Bas aabaju nai javanu///
////////////////////////////////////////////////////////////////

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

//	int t; cin >> t;
	//while (t--)
	jabru();

	return 0;
}





///////////////////////////////////////////////////////////////////////////////////////////
//Kai baju bhai???


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

bool C[10000][10000] = {};
long long int X[10000] = {};
long long int Y[10000] = {};

int N, Q;

int main()
{
	cin >> N;

	vector<int> A(N + 1);
	A[0] = 0;
	for (int i = 1; i <= N; ++i)
		cin >> A[i];

	int sum = abs(A[N] - A[0]);
	for (int i = 1; i <= N; ++i)
		sum += abs(A[i] - A[i - 1]);

	vector<int> ans(N + 1);
	for (int i = 1; i <= N; ++i)
	{
		int j = (i + 1) % (N + 1);
		int d0 = A[i] - A[i - 1];
		int d1 = A[j] - A[i - 1];
		bool f0 = d0 >= 0;
		bool f1 = d1 >= 0;

		if (f0 == f1 && abs(d0) <= abs(d1))
			ans[i] = sum;
		else if (f0 == f1 && abs(d0) > abs(d1))
			ans[i] = sum - 2 * abs(A[j] - A[i]);
		else
			ans[i] = sum - 2 * abs(d0);
	}

	for (int i = 1; i <= N; ++i)
		cout << ans[i] << endl;
}


Measured memory_bytes: 2048
#include<stdio.h>
int main(){
    int A,B;
    int ans = 0;
    scanf("%d",&A);
    scanf("%d",&B);
    
    ans = A + B;
    if(ans < A - B){
        ans = A - B;
    }
    if(ans < A * B){
        ans = A * B;
    }
    printf("%d",ans);
    return 0;
}


Measured memory_bytes: 128
using System;
using System.Collections.Generic;
public class Aprob {
    public static void Main() {
        string A = Console.ReadLine();
        string B = Console.ReadLine();
        string C = Console.ReadLine();
        int length = Math.Max(Math.Max(A.Length, B.Length),C.Length)+5;
        int[,] data = new int[3, length];
        int val = 0;
        for (int i = 0; i < 3; i++) {
            for (int j = 0; j < length; j++) {
                data[i, j] = -1;
            }
        }
        for (int i = 0; i < A.Length; i++) {
            if (A.Substring(i, 1) == "a") {
                val = 0;
            } else if (A.Substring(i, 1) == "b") {
                val = 1;
            } else {
                val = 2;
            }
            data[0, i] = val;
        }
        for (int i = 0; i < B.Length; i++) {
            if (B.Substring(i, 1) == "a") {
                val = 0;
            } else if (B.Substring(i, 1) == "b") {
                val = 1;
            } else {
                val = 2;
            }
            data[1, i] = val;
        }
        for (int i = 0; i < C.Length; i++) {
            if (C.Substring(i, 1) == "a") {
                val = 0;
            } else if (C.Substring(i, 1) == "b") {
                val = 1;
            } else {
                val = 2;
            }
            data[2, i] = val;
        }
        int check = 0;
        int[] count = new int[3];
        while (true) {
            if (data[check, count[check]] == -1) {
                break;
            } else {
                count[check]++;
                check = data[check, count[check]-1];
            }
        }
        if (check == 0) {
            Console.WriteLine("A");
        } else if (check == 1) {
            Console.WriteLine("B");
        } else {
            Console.WriteLine("C");
        }
    }
}

Measured memory_bytes: 13140
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<ll> VI;
typedef vector<VI> VVI;
#define FOR(i,a,b) for(ll i=(a);i<(b);++i)
#define rep(i,n)  FOR(i,0,n)
#define PRINT(V) for (auto v : (V)) cout << v << " "

int main()
{
    int n; cin >> n;
    VI p(n), q(n);
    rep(i, n) cin >> p[i];
    rep(i, n) cin >> q[i];

    VI x(n); rep(i, n) x[i] = i + 1;
    int a = 0, b = 0, k = 0;
    do{
        if (x == p) a = k;
        if (x == q) b = k;
        ++k;
    }while(next_permutation(x.begin(), x.end()));

    cout << abs(a - b) << endl;
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
struct Fast { Fast() { cin.tie(0); ios::sync_with_stdio(false); cout << fixed << setprecision(20);} } fast;


int main(){
    int a, b;
    cin >> a >> b;
    cout << (a - 1) * (b - 1) << endl;
}

Measured memory_bytes: 256
program main;
var 
   a : integer;
begin
    readln(a);
    if a < 1000 then 
        writeln(1000-a)
    else 
        begin 
            while ( a > 1000 ) do
                dec(a,1000);
            if a = 0 then 
                writeln('0')
            else
                writeln(1000-a);
        end;
end.

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

int main(){
#define ROOP(i,n)   for(int i=0 ; i<n ; i++)
    long N, K;
    cin >> N >> K;
    
    vector<long> A(N);
    ROOP(i,N)   cin >> A.at(i);
    
  	if((N-1) % (K-1) == 0)    cout << (N-1)/(K-1) << endl;
	else	cout << (N-1)/(K-1) + 1 << endl;
}



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

int main () {

    string N;
    cin >> N;

    int ans = 0;

    for (int i = 0; i < N.size(); i++) {
        if (N[i] == '2') {
            ans++;
        }
    }
    cout << ans << endl;
    
    return 0;
}

Measured memory_bytes: 256
# frozen_string_literal: true

$n = gets.chomp.to_i

$m = gets.chomp.to_i

$all = (1..$n).to_a

$graph = {}

$nodes = []
$m.times do
  s, t = gets.chomp.split(' ').map(&:to_i)

  $graph[s] ||= []
  $graph[s] << t
  $nodes << t
end

$stack = $all - $nodes

$res = []
uniq = true
until $stack.empty?
  uniq = false if $stack.length != 1 && uniq
  team = $stack.pop

  $res << team

  next unless $graph[team]

  $graph[team].each do |t|
    $stack << t unless $graph.any? { |k, l| k != team && l.include?(t) }
  end
  $graph.delete(team)
end

puts $res.join("\n")

puts uniq ? 0 : 1



Measured memory_bytes: 8988
#define _CRT_SECURE_NO_WARNINGS
#define _USE_MATH_DEFINES
#pragma comment(linker, "/STACK:16777216")

#include <cstdlib>
#include <cstdio>
#include <cstring>
#include <string>
#include <vector>
#include <iostream>
#include <map>
#include <stack>
#include <set>
#include <queue>
#include <numeric>
#include <algorithm>
#include <utility>
#include <bitset>
#include <cmath>
#include <sstream>
#include <functional>
#include <iomanip>

#define all(a) (a).begin(),(a).end()
#define sz(a) (int)(a).size()
#define eps (1e-15)
using namespace std;

typedef long long ll;
typedef vector<int> vi;
typedef vector< vi > vvi;
typedef vector<double> vd;
typedef vector< vd > vvd;
typedef vector< string > vs;
typedef pair< int, int > pii;
typedef vector< pii > vpii;

vector<long long> p_pow;
const int p = 61;

long long myhash(string s)
{
	long long res = 0;
	for (int i = 0; i < sz(s); i++)
	{
		res += (s[i] - 'a' + 1) * p_pow[i];

	}
	return res;
}

int main()
{
#ifdef LOCAL_MACHINE
	freopen("input.txt", "rt", stdin);
	freopen("output.txt", "wt", stdout);
#endif

	int n, m, x;
	cin >> n >> m >> x;
	vector<bool> toll(n + 1, false);
	for (int i = 0; i < m; i++)
	{
		int cur;
		cin >> cur;
		toll[cur] = true;
	}
	int r1 = 0, r2 = 0;
	for (int i = x; i <= n; i++)
	{
		if (toll[i])
			r1++;
	}
	for (int i = x; i >= 0; i--)
	{
		if (toll[i])
			r2++;
	}
	cout << min(r1, r2);
	return 0;

}

Measured memory_bytes: 256
#include<iostream>
#include<cstring>
#include<vector>
#include<set>
#include<algorithm>

#define X first
#define Y second

using namespace std;

typedef pair<int,int> P;

const int MAX = 100;
bool come[MAX][MAX];
P field[MAX][MAX];
int N;

void init(){
  memset(come,false,sizeof(come));
}

void input(){
  for(int i = 0; i < N; i++)
    for(int j = 0; j < N; j++) cin >> field[i][j].X >> field[i][j].Y;
}

bool find(vector<P>& v, P p){
  for(int i = 0; i < (int)v.size(); i++)
    if(p == v[i]) return true;
  return false;
}
void solve(){

  int ans = 0;

  for(int i = 0; i < N; i++)
    for(int j = 0; j < N; j++){
      if(come[i][j]) continue;
      P now = P(j,i);
      vector<P> V;
      V.push_back(now);
      while(1){
	P nex;
	nex.X = field[now.Y][now.X].X;
	nex.Y = field[now.Y][now.X].Y;
	if(V[0] == nex) break;
	if(find(V,nex) || come[nex.Y][nex.X]){
	  V.clear();
	  break;
	}
	V.push_back(nex);
	now = nex;
      }
      if(!V.empty()){
	ans++;
	for(int i = 0; i < (int)V.size(); i++)
	  come[V[i].Y][V[i].X] = true;
      }
    }
  cout << ans << endl;
}

int main(){
  while(cin >> N && N){
    init();
    input();
    solve();
  }
  return 0;
}

Measured memory_bytes: 1300
#include <iostream>
#include<vector>
#include<algorithm>
#include<string>
#include<map>
#include<set>
#include<stack>
#include<queue>
#include<math.h>
using namespace std;
typedef long long ll;
#define int long long
typedef vector<int> VI;
#define REP(i,n) for(int i=0;i<n;i++)
#define eREP(i,n) for(int i=0;i<=n;i++)
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define eFOR(i,a,b) for(int i=(a);i<=(b);++i)
#define SORT(c) sort((c).begin(),(c).end())
#define rSORT(c) sort((c).rbegin(),(c).rend())
#define LB(x,a) lower_bound((x).begin(),(x).end(),(a))
#define UB(x,a) upper_bound((x).begin(),(x).end(),(a))
#define INF 1000000000
#define LLINF 9223372036854775807
#define mod 1000000007
//vector<vector<int> > dp;
//vector<vector<vector<int> > > vvvi;
//dp=vector<vector<int> >(N, vector<int>(M,0));
//vector<pair<int,int> > v;
//v.push_back(make_pair(x,y));
//do {
//    print(v);
//  } while (std::next_permutation(v.begin(), v.end()));


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

	int N;
	cin >> N;
	string S, T;
	cin >> S >> T;

	int cnt=0,ans=-1;

	for (int i = N - 1; i >= 0; i--) {
			int a = i;
			int j = N - 1;

			while (a >= 0) {
				if (S[j] != T[a] || a==0) {
					if (S[j] == T[a])cnt++;
					ans = max(ans, cnt);
					//cout << cnt << endl;
					cnt = 0;
					break;
				}
				else {
					cnt++;
					a--;
					j--;
				}
			}
		
	}

	cout << 2 * N - ans << endl;
	return 0;
}



Measured memory_bytes: 256
/*package whatever //do not write package name here */

import java.io.*;
import java.util.Scanner;

class Main {
	public static void main (String[] args) {
		Scanner in = new Scanner(System.in);
		int x = in.nextInt();
		if(x >= 30)
		    System.out.println("Yes");
		else
	        System.out.println("No");
	}
}

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

int main()
{
	int n, l; cin >> n >> l;
	
	vector<int> d(n);
	int sum = 0;
	int min_d_abs = 2147483647;
	int index;
	for (int i = 0; i < n; i++) {
		d[i] = l + i;
		sum += d[i];

		if (abs(d[i]) < abs(min_d_abs)) {
			min_d_abs = d[i];
			index = i;
		}
		
	}
	
	cout << sum - d[index] << endl;
	return 0;
}

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

int main(){
	string s, strCopy;
	while (getline(cin, s)) {
		for(int j=0 ; j<26 ; j++){
			for(int i=0 ; i<s.size() ; i++){
				if(s[i]>='a' && s[i]<='z'){
					s[i] = (s[i]=='z')? 'a' : s[i] + 1;
				}
			}
			if( s.find( "the" ) != string::npos || s.find( "this" ) != string::npos || s.find( "that" ) != string::npos){
				cout << s << endl;
			}
		}
	}
	
	return 0;
}

Measured memory_bytes: 0
#include <bits/stdc++.h>
using namespace std;
#define lli long long int
#define mp(a,b) make_pair(a,b)
#define pb(a) push_back(a)
#define fr(i,n) for(i=0;i<n;i++)
#define F first
#define S second
#define fast std::ios_base::sync_with_stdio(false)
#define mod 1000000007
#define pi 3.14159265
int main() {
	fast;
	lli a,b;
	cin>>a>>b;
	cout<<(a*b)/__gcd(a,b);
	
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<n;++i)
#define all(x) (x).begin(),(x).end()
using namespace std;
const int INF=1145141919,MOD=1e9+7;
const int64_t LINF=8931145141919364364,LMOD=998244353;
// const int dy[]={0,-1,0,1,1,-1,-1,1};
// const int dx[]={1,0,-1,0,1,1,-1,-1};

int main() {
    int64_t w,h; cin>>w>>h;
    int64_t x,y; cin>>x>>y;
    double ans=w*h/2.0;
    if(w==2*x and h==2*y){
        printf("%.10f 1", ans);
    }else{
        printf("%.10f 0", ans);
    }
    return 0;
}

Measured memory_bytes: 256
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Numerics;
using System.Text;
using static System.Math;

namespace CSharpSpiral {
	class Program {
		static void Main(string[] args) {
			var sw = new StreamWriter(Console.OpenStandardOutput()) {
				AutoFlush=
#if DEBUG
			true
#else
			false
#endif
			};
			Console.SetOut(sw);
			new Program().Solve(new ConsoleInput(
#if DEBUG
			new StreamReader("../../../inputData.txt")
#else
			Console.In
#endif
			, ' '));
			Console.Out.Flush();
		}
		public void Solve(ConsoleInput cin) {
			var A = cin.ReadLong;
			var B = decimal.Parse(cin.Read);
			int B100 = (int)(B*100);
			Console.WriteLine(A*B100/100);
		}

	}
	static class ExtendClass {
		public static string Join<T>(this IEnumerable<T> X, string separator = " ") => string.Join(separator, X);
		
	}
	class ConsoleInput {
		private readonly TextReader _stream;
		private readonly char _separator = ' ';
		private readonly Queue<string> inputStream;
		public ConsoleInput(TextReader stream, char separator = ' ') {
			this._separator=separator;
			this._stream=stream;
			inputStream=new Queue<string>();
		}
		public string Read {
			get {
				if(inputStream.Count!=0) return inputStream.Dequeue();
				string[] tmp = _stream.ReadLine().Split(_separator);
				for(int i = 0; i<tmp.Length; ++i)
					inputStream.Enqueue(tmp[i]);
				return inputStream.Dequeue();
			}
		}
		public string ReadLine { get { return _stream.ReadLine(); } }
		public int ReadInt { get { return int.Parse(Read); } }
		public long ReadLong { get { return long.Parse(Read); } }
		public double ReadDouble { get { return double.Parse(Read); } }
		public string[] ReadStrArray(long N) {
			var ret = new string[N];
			for(long i = 0; i<N; ++i)
				ret[i]=Read;
			return ret;
		}
		public int[] ReadIntArray(long N) { var ret = new int[N]; for(long i = 0; i<N; ++i) ret[i]=ReadInt; return ret; }
		public long[] ReadLongArray(long N) { var ret = new long[N]; for(long i = 0; i<N; ++i) ret[i]=ReadLong; return ret; }
		public double[] ReadDoubleArray(long N) { var ret = new double[N]; for(long i = 0; i<N; ++i) ret[i]=ReadDouble; return ret; }
		public bool isEOF {
			get { return _stream.Peek()==-1; }
		}
	}
}

Measured memory_bytes: 27916
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define UNIQUE(v) v.erase(unique(all(v)), v.end());
#define ZIP(v) sort(all(v)),UNIQUE(v)
#define ADD(a, b) a = (a + b) % mod
#define SUB(a, b) a = (a+mod-b)%mod
#define MUL(a, b) a = (a * b) % mod
#define repi(i,m,n) for(int i = m;i < n;i++)
#define drep(i,n,m) for(int i = n;i >= m;i--)
#define rep(i,n) repi(i,0,n)
#define rrep(i,n) repi(i,1,n+1)
#define chmin(x,y) x = min(x,y)
#define chmax(x,y) x = max(x,y)
#define all(v) v.begin(),v.end()
#define rall(v) v.rbegin(), v.rend()
#define dmp(x,y) make_pair(x,y)
#define pb(x) push_back(x)
#define fi first
#define se second
typedef pair<int,int> P;
typedef pair<int, P> PP;
typedef pair<P, int> Pi;
typedef vector<int> vi;
typedef deque<int> dq;
const int inf = 1e9+7;
const int INF = 1e18+7;

signed main(){
	int n, ans = 0;
	scanf("%lld",&n);
	rep(i,n+1)rep(j,n+1){
		if(4*i+7*j == n)ans = 1;
	}
	printf("%s\n", ans ? "Yes" : "No");
	return 0;
}






Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define ll long long
const int maxn=5e3+5;

int main()
{
	ios::sync_with_stdio(false);
	cin.tie(0);
    string s;
    cin>>s;
    int n=s.size();
    int flag=0;
    for(int i=0;i<n;i++)
    {
        if(s[i]=='7')
            flag=1;
    }
    if(flag)
        cout<<"Yes"<<'\n';
    else
        cout<<"No"<<'\n';




}


Measured memory_bytes: 3648
#include <stdio.h>
#include <stdlib.h>

#define ll long long
#define MD 1000000007
#define mod(n) ((n%MD+MD)%MD)
#define max(x, y) (x>y? x : y)
#define min(x, y) (x<y? x : y)
#define mul3(x, y, z) (mod(mod(x*y)*z))



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

    int ans = 1;
    while(X*ans%360!=0){
        ans++;
    }

    printf("%d", ans);

    return 0;
}



Measured memory_bytes: 1680
#include <iostream>
#include <string>
#include <vector>
#include <map>
#include <cstring>
#include <iomanip>
#include <cmath>

using namespace std;

int main(){
    int N;
    cin >> N;
    int A[N+1];
    A[0]=0;
    for(int i=0; i< N; i++ ) cin >> A[i+1];
    long long S=0;
    for(int i=0; i < N+1; i++ ){
        S += abs(A[i]-A[(i+1)%(N+1)]);
    }
    for(int i=1; i<= N; i++){
        long long sum =S;
        int priv = (N+1+i-1)%(N+1);
        int nxt = (i+1)%(N+1);
        sum -= abs(A[priv]-A[i]);
        sum -= abs(A[nxt]-A[i]);
        sum += abs(A[nxt]-A[priv]);
        cout << sum << " "<<endl;
    }
    return 0;
}

Measured memory_bytes: 1664
#include <bits/stdc++.h>
#include <random>
#include <ctime>
//#include <ext/pb_ds/assoc_container.hpp>
//#include <ext/pb_ds/tree_policy.hpp>
#pragma GCC optimize("-O3")
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
//#pragma GCC target("avx2")
#define ll long long
#define mp make_pair
#define pb push_back
#define fi first
#define se second
#define pll pair<ll,ll>
#define ld long double
#define pld pair<ld,ld>
#define pii pair<int,int>
#define sqr(a) ((a)*(a))
#define all(v) v.begin(),v.end()

using namespace std;
//using namespace __gnu_pbds;

const ll MOD = 1e9+7;
const ll INF=1e18;
const ld E=1e-8;
mt19937_64 rnd(time(0));
ll p1 = 31, p2 = 29, p3 = 7, p4=rnd()%100+1, md1 = MOD, md2 = 998244353, md3=998244357, md4=rnd()%1000000000;

//using ord_set=tree<T,null_type,less<T>,rb_tree_tag,tree_order_statistics_node_update>;

ll n, m, k, h, T;
pii b[300001];

ll binpow(ll h, ll r, ll md = MOD)
{
    ll l = 1;
    while (r)
    {
        if (r & 1) l *= h, l %= md;
        h *= h;
        h %= md;
        r /= 2;
    }
    return l;
}

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

int main()
{
    //freopen("input.txt","r",stdin);
    //freopen("output.txt","w",stdout);
    //freopen("capitals.in","r",stdin);
    //freopen("capitals.out","w",stdout);
    ios::sync_with_stdio(0);
    cin.tie(0);
    ll a;
    ld b;
    cin >> a >> b;
    cout << (ll)floor(a*b);
    return 0;
}

/*
4
1 4 3 6
3
1 2 3
4
6 3 4 1
*/


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

main() {
    int A,B,K; cin >> A >> B >> K;
    int count = 0;
    for(int i=100;i>=1;i--){
        if(A%i==0 && B%i==0){
            if(count==K-1){cout << i << endl;}
            count++;
        }
    }

    return 0;
}

Measured memory_bytes: 256
#include<cstdio>
#include<cmath>
#include<algorithm>
#include<iostream>
#include<vector>
#include<queue>
#include<string>
#include<cstring>
#include<queue>
#include<map>
#include<set>
#include<stack>
using namespace std;
#define ll long long
#define ull unsigned long long
#define up(i,a,b) for(register int i=(a);i<=(b);i++)
#define down(i,a,b) for(register int i=(a);i>=(b);i--)
#define mem(x,y) memset(x,(y),sizeof x)
#define ff first
#define ss second
#define mp(x,y) make_pair(x,y)
#define pb(x) push_back(x)
#define sc(a) scanf("%d",&a)
#define scl(a) scanf("%lld",&a)
#define scs(a) scanf("%s",a)
#define pr(a,b) printf("%d%c",a,b)
#define prl(a,b) printf("%lld%c",a,b)
#define PQ priority_queue
#define ld long double
#define all(v) v.begin(),v.end()
#define IOS ios::sync_with_stdio(false),cin.tie(0),cout.tie(0)

typedef pair<ll,ll> pii;
typedef map<int,int> mii;
typedef vector<int> V;

template<typename T>
T gcd(T a,T b) {
	return !b?a:gcd(b,a%b);
}

inline int read() {
	int input=0,v=1;
	char c=getchar();
	while((c<'0'||c>'9')&&c!='-')c=getchar();
	if(c=='-')v=-1,c=getchar();
	while(c>='0'&&c<='9')input=input*10+c-'0',c=getchar();
	return v*input;
}

const ll mod=1e9+7;
ll dp[110][500];
int main() {
	int n;
	sc(n);
	up(i,1,4)up(o,1,4)up(p,1,4)dp[3][i*100+o*10+p]=1;
	dp[3][132]=dp[3][123]=dp[3][312]=0;
	// 1-A 2-C 3-G 4-T
	up(i,4,n)
	up(o,1,4)
	up(p,1,4)
	up(j,1,4) {
		int x=o*100+p*10+j,go=0;
		int gg[10]={0};
		if(p==1&&j==2)gg[3]++;
		if(p==1&&j==3)gg[2]++;
		if(p==3&&j==1)gg[2]++;
		if(o==1&&j==3)gg[2]++;
		if(o==1&&p==3)gg[2]++;
		
		up(k,1,4)if(!gg[k])dp[i][p*100+j*10+k]=(dp[i][p*100+j*10+k]+dp[i-1][x])%mod;
	}
	ll ans=0;
	up(i,1,4)up(o,1,4)up(p,1,4)ans=(ans+dp[n][i*100+o*10+p])%mod;
	prl(ans,'\n');
}

Measured memory_bytes: 640
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
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

M1, D1 = MAP()
M2, D2 = MAP()

print(0 if M1==M2 else 1)


Measured memory_bytes: 10628
#include <iostream>
#include <vector>
#include <string.h>
#include <set>
#include <map>
#include <unordered_map>
#include <assert.h>
#include <algorithm>
#include <queue>
#include <bitset>
#include <stack>
#include <chrono>
#include <random>
#define all(x) x.begin(),x.end()
#define ff first
#define ss second
#define ll long long
#define INF 1000000000000000000
#define MOD 1000000007
#define rnd mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
#define FIO ios_base::sync_with_stdio(false); cin.tie(NULL);
#define uid uniform_int_distribution <int>
using namespace std;

int main() {
	string s;
	cin >> s;
	int n = (int) s.size();
	vector<int> pre(n);
	for (int i = 0; i < n; i++) {
		if (s[i] == '<') {
			pre[i] = (i > 0 ? pre[i - 1] + 1 : 1);
		}
		else {
			pre[i] = 0;
		}
	}
	vector<int> suf(n);
	for (int i = n - 1; i >= 0; i--) {
		if (s[i] == '>') {
			suf[i] = (i < n - 1 ? suf[i + 1] + 1 : 1);
		}
		else {
			suf[i] = 0;
		}
	}
	ll ans = pre[n - 1] + suf[0];;
	for (int i = 0; i < n - 1; i++) {
		ans += max(pre[i], suf[i + 1]);
	}
	cout << ans;
}


Measured memory_bytes: 4740
import numpy as np

k, n = map(int, input().split())
a = np.array([int(i) for i in input().split()])
#a.insert(0, 0)
#a.append(k)
#a = np.array(a)

d = np.diff(a)
diff_k = k - a[-1] + a[0]

if diff_k >= max(d):
    s = sum(d)
else:
    s = sum(d) - max(d) + diff_k

print(s)


Measured memory_bytes: 35092
#include<bits/stdc++.h>
#define REP(i,n) for(int (i)=0 ;(i)<(n);(i)++)
#define REPR(i,n) for(int (i)=(n);(i)>=0;(i)--)
#define FOR(i,m,n) for(int (i)=(m);(i)<(n);(i)++)
#define ALL(x) x.begin(),x.end()
#define REVERSE(x) reverse(x.begin(),x.end())
#define SORT(x,n) sort(x,x)
#define P pair<int,int>
typedef long long LL;
const int INF=1000000007;
using namespace std;
int main(){
int N,M;
cin>>N>>M;
priority_queue<long double> A;
REP(i,N){
    long double a;
    cin>>a;
    A.push(a);
}
REP(i,M){
    long double b=A.top();
    A.pop();
    A.push(b/2);
}
LL sum=0;
while(!A.empty()){
    sum+=A.top();
    A.pop();
}
LL ans=sum;
cout<<sum;
}

Measured memory_bytes: 2420
N = int(input())
A = [list(map(int, input().split())) for _ in range(N)]

dp = A
cnt = 0
for i in range(N):
    for j in range(N):
        if all(dp[i][j] < dp[i][k] + dp[k][j] for k in range(N) if k != i and k != j):
            cnt += dp[i][j]
        if any(dp[i][j] > dp[i][k] + dp[k][j] for k in range(N)):
            print(-1)
            exit()

print(cnt // 2)


Measured memory_bytes: 52024
#include <iostream>
#include <vector>
#include <bitset>
#include <cstring>
#include <queue>
#include <stack>
#include <algorithm>
#include <set>
using namespace std;
typedef long long ll;

ll dp[200200][30];

int main(){
	cin.tie(nullptr);
	ios::sync_with_stdio(false);
	int n,t; cin >> n >> t;
	vector<int> v;
	vector<pair<int,int>> u;
	for(int i=0;i<n;i++){
		int a,b; cin >> a >> b;
		if(a==0){
			v.push_back(b);
		}
		else{
			u.push_back(make_pair(a,b));
		}
	}
	sort(v.begin(),v.end());
	sort(u.begin(),u.end(),[](auto i,auto j){
		return (ll)i.first*(j.second+1)>(ll)j.first*(i.second+1);
	});
	for(int i=0;i<=n;i++){
		for(int j=0;j<30;j++){
			dp[i][j]=2e9;
		}
	}
	dp[0][0]=0;
	for(int i=0;i<u.size();i++){
		for(int j=0;j<30;j++){
			dp[i+1][j]=min(dp[i+1][j],dp[i][j]);
			dp[i+1][j+1]=min(dp[i+1][j+1],dp[i][j]+1LL+(ll)u[i].first*(dp[i][j]+1)+u[i].second);
		}
	}
	vector<ll> sum(v.size()+1,0);
	for(int i=0;i<v.size();i++){
		sum[i+1]=sum[i]+1+v[i];
	}
	int ans=0;
	for(int i=0;i<30;i++){
		for(int j=0;j<sum.size();j++){
			if(t>=dp[u.size()][i]+sum[j]){
				ans=max(ans,i+j);
			}
		}
	}
	cout << ans << endl;
}

Measured memory_bytes: 49652
#include<stdio.h>
/*ALDS1_1_D*/

int main(void)
{
	int n;
	int exchange_origin[200000]={0};
	int exchange_gain;
	int exchange_gain_max;
	int i,j; 
	int min;
	
	scanf("%d",&n);
	for(i=0;i<n;i++){
		scanf("%d",&exchange_origin[i]);
	}
	
	min=exchange_origin[0];
	exchange_gain_max=exchange_origin[1]-exchange_origin[0];
	
	for(i=0;i<n-1;i++){
		if(exchange_origin[i]>min)continue;
		min=exchange_origin[i];
		for(j=i+1;j<n;j++){
			exchange_gain=exchange_origin[j]-min;
			if(exchange_gain_max<exchange_gain){
				exchange_gain_max=exchange_gain;
			}
		}
	}
	
	printf("%d\n",exchange_gain_max);
}


Measured memory_bytes: 2636
#include <bits/stdc++.h>
using namespace std;
int main(void){
    // Your code here!
    int n,a=0,b;
    cin>>n;
    for(int i=0;i<n;i++){
        cin>>b;
        a+=b%2;
    }
    if(a%2==0){
        cout<<"YES"<<endl;
    }else{
        cout<<"NO"<<endl;
    }
}


Measured memory_bytes: 256
#include<iostream>

using namespace std;

// 元となるプログラムの動作。
void call(int n) {
	// 最初にループカウンタに1を代入
	int i = 1;
CHECK_NUM:
	// 処理の都合上、ループカウンタの値を加工する必要があるため、
	// xにループカウンタの値を代入する。
	int x = i;
	// ループカウンタの値が3の倍数の場合、半角スペース+カウンタの値を出力
	// ループの最後にジャンプ
	if (x % 3 == 0) {
		cout << " " << i;
		goto END_CHECK_NUM;
	}
INCLUDE3:
	// 1の位が3の場合、半角スペース+カウンタの値を出力
	// ループの最後にジャンプ
	if (x % 10 == 3) {
		cout << " " << i;
		goto END_CHECK_NUM;
	}
	// 3でない場合は10で割り、結果が0になるまで繰り返す。
	// つまり、3が含まれる値であるか判定している。
	x /= 10;
	if (x) goto INCLUDE3;
END_CHECK_NUM:
	// iをカウントアップし、nの値を超えるまでの間処理を繰り返す。
	if (++i <= n) goto CHECK_NUM;
	cout << endl;
}

// 

int main() {
	int n;
	cin >> n;

	for (int i = 1; i <= n; ++i) {
		if (i % 3 == 0) {
			cout << " " << i;
		}
		else {
			for (int x = i; x > 0; x /= 10) {
				if (x % 10 == 3) {
					cout << " " << i;
					break;
				}
			}
		}
	}
	cout << endl;

	return 0;
}

Measured memory_bytes: 1160
import numpy as np

mod = 998244353

n = int(input())
 
D = list(map(int, input().split()))
 
dic = [0] * n
for x in D:
    dic[x] += 1
 
if dic[0] != 1 or D[0] != 0:
    print(0)
    exit()
  
ans = 1
for i in range(1, n):
    if dic[i] == 0:
        if sum(dic[i:]) == 0:
            break
        else:
            print(0)
            exit()
 
    ans = (ans * pow(dic[i-1], dic[i], mod)) % mod
 
print(ans)

Measured memory_bytes: 23352
#include<bits/stdc++.h>
    using namespace std;
     
    #define       pb(a)             push_back((a))
    #define       mp(a,b)           make_pair((a),(b))
    #define       REP(a,b)          for(ll i=(a);i<(b);i++)
    #define       REP2(a,b)         for(ll j=(a);j<(b);j++)
    #define       REPE(a,b,c,d)     REP(a,b)for(ll j=(c);j<(d);j++)
    #define       REPV(a,b,c)       for(ll (a)=b;(a)<(c);(a)++)
    #define       IREP(a,b)         for(ll i=(a);i>=(b);i--)
    #define       IREP2(a,b)        for(ll j=(a);j>=(b);j--)
    #define       IREPV(a,b,c)      for(ll (a)=b;(a)>=(c);(a)--)
    #define       all(v)            (v).begin(),(v).end()
    #define       Trvs(c)           for (auto it = (c).begin(); it != (c).end(); it++)
    #define       INF               INT_MAX
    #define       sz(x)             x.size()
    #define       flash             ios_base::sync_with_stdio(false);cin.tie(NULL);
    #define       F                 first
    #define       S                 second
    #define       MOD               1000000007
     
    using         ll     = long long;
    using         vi     = vector<int>;
    using         vvi    = vector<vi>;
    using         vll    = vector<ll>;
    using         vvll   = vector<vll>;
    using         vb     = vector<bool>;
    using         vd     = vector<double>;
    using         vs     = vector<string>;
    using         pii    = pair<int, int>;
    using         pll    = pair<ll, ll>;
    using         pdd    = pair<double, double>;
    using         vpii   = vector<pii>;
    using         vvpii  = vector<vpii>;
    using         vpll   = vector<pll>;
    using         vvpll  = vector<vpll>;
    using         vpdd   = vector<pdd>;
    using         vvpdd  = vector<vpdd>;
     
     
    ll gcd(ll a,ll b){
    	if(b==0)return a;
    	return gcd(b,a%b);
    }
    ll lcm(ll a,ll b){
     
    	return a*b/gcd(a,b);
    }
     
    ll ceeel(ll n,ll a){
    	if(n%a==0) return n/a;
    	return n/a +1;
    }
    ll power(ll x, ll y){
    	ll ans=1;
    	REP(0,y){
    		ans*=x;
    	}
    	return ans;
    }
     
    void solve(){
    	ll n,m; cin >> n >> m;
    	if(n==m){
    		cout<<"Yes";
    	}
    	else cout<<"No";
    }
     
     
    	
     
     
    int main(){
     
    	flash
    
    	
    	//ll t;cin>>t;while(t--)
    	solve();
     
     
    	return 0;
    }

Measured memory_bytes: 256
def product(A, B):
    C = [[0]*n for i in range(n)]
    for i in range(n):
        for j in range(n):
            C[i][j] = sum([A[i][k]*B[k][j] for k in range(n)]) % p
    return C

def matpow(A, k):
    if k == 1:
        return A
    if k % 2 == 0:
        B = matpow(A, k//2)
        return product(B, B)
    return product(A, matpow(A, k-1))

n, k = map(int, input().split())
p = 10**9+7
A = [list(map(int, input().split())) for i in range(n)]
B = matpow(A, k)
print(sum([sum(B[i]) for i in range(n)]) % p)


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

#define int long long
#define fi first
#define se second

const int inf = 1e18 + 9;
typedef pair<int, int> P;

int n, m, k, s;
int p, q;

int C[101010];
queue<int> que;

struct edge {
  int to, cost;
};

int d[101010];
vector<edge> G[101010];

void dijkstra()
{
  priority_queue<P, vector<P>, greater<P>> qu;
  fill(d, d + n, inf);

  d[0] = 0;
  qu.push(P(0, 0));

  while (!qu.empty()) {
    P p = qu.top(); qu.pop();
    int v = p.se;
    if (d[v] < p.fi) continue;

    for (int i = 0; i < G[v].size(); i++){
      edge e = G[v][i];

      if (C[e.to] == s + 1) continue;
      if (C[e.to] > 0) {
        if (d[e.to] > d[v] + q) {
          d[e.to] = d[v] + q;
          qu.push(P(d[e.to], e.to));
        }
      }
      else {
        if (d[e.to] > d[v] + e.cost){
          d[e.to] = d[v] + e.cost;
          qu.push(P(d[e.to], e.to));
        }
      }
    }
  }
}

signed main()
{
  cin >> n >> m >> k >> s;
  cin >> p >> q;
  
  for (int i = 0; i < k; i++){
    int c;
    cin >> c;
    c--;
    C[c] = s + 1;
    que.push(c);
  }

  for (int i = 0; i < m; i++){
    int a, b;
    cin >> a >> b;
    a--; b--;
    G[a].push_back((edge){b, p});
    G[b].push_back((edge){a, p});
  }

  while (!que.empty()){
    int v = que.front(); que.pop();

    if (C[v] == 0) continue;

    for (int i = 0; i < G[v].size(); i++){
      edge e = G[v][i];
      if (C[e.to] != 0) continue;
      C[e.to] = C[v] - 1;
      que.push(e.to);
    }
  }

  dijkstra();

  cout << d[n - 1] - (C[n - 1] ? q : p)<< endl;
}

Measured memory_bytes: 17416
N = int(input())

xy = []
for i in range(N):
    x, y = map(str, input().split())
    y = int(y)
    xy.append([x, y])

sort_xy = sorted(sorted(xy), key=lambda x: (x[0],-x[1]))

for i in range(N):
    for j in range(N):
        if sort_xy[i][0] == xy[j][0]:
            if sort_xy[i][1] == xy[j][1]:
                print(j + 1)

Measured memory_bytes: 3064
#include <bits/stdc++.h>
#define SpeeD ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0);
#define ll long long
#define endl '\n'
//pair<int, int> *p=new pair<int, int>[n];
//std::vector<pair<int,int>> vp;
//v.push_back(make_pair(x,y))
//pair<int, int> p[1000001];
//string *s=new string [n];
//int freq[e];
//freq[a[i]-'a']++; freq[a[i]]++;
 using namespace std;
ll n,t,m,c1,c2,c,x,y,sum,mn=999999999,avg,pos,dif,j,dis,mx,xi,yi,q;
vector<ll>v;
set<int>s;
map<ll , ll >mp;
bool PE(int x)
{
for (int i=2;i*i<=x;i++)
if (x%i==0)
return false;
return true;
}
bool PR(string s)
{
int n=s.length();
for(int i=0;i<n/2;i++)
if(s[i]!=s[n-i-1])
return false;
return true;
}

int main(void) 
{ SpeeD;
long double p =6.28318530717958623200/2.0;
cin>>m>>n;
ll a[n];
for (int i = 0 ; i < n;i++){
cin>>a[i];
c+=a[i];}
if (m-c >=0)cout<<m-c;
else cout<<-1;


}

Measured memory_bytes: 3716
#include <bits/stdc++.h>
using namespace std;
using ll = long long; using ull = unsigned long long;
//#define int ll
using vb = vector<bool>; using vvb = vector<vb>;
using vi = vector<int>; using vvi = vector<vi>;
using vl = vector<ll>; using vvl = vector<vl>;
template<class T> using V = vector<T>;
template<class T> using VV = vector<V<T>>;
#define fi first
#define se second
#define maxs(x,y) (x=max(x,y))
#define mins(x,y) (x=min(x,y))
using pii = pair<int,int>; using pll = pair<ll,ll>;
#define FOR(i,a,b) for(ll i = (a); i < (ll)(b); ++i)
#define REP(i,n) FOR(i,0,n)
#define RFOR(i,a,b) for(ll i = (ll)(b)-1;i >= a;--i)
#define RREP(i,n) RFOR(i,0,n)
#define ALL(obj) (obj).begin(), (obj).end()
#define rALL(obj) (obj).rbegin(), (obj).rend()
#define eb(val) emplace_back(val)
const double PI = acos(-1), EPS = 1e-10;
const ll MOD = 1e9+7;
signed main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  int m,n;
  cin >> n >> m;
  string s;
  cin >> s;
  m--;
  s[m] = tolower(s[m]);
  cout << s << endl;
}


Measured memory_bytes: 256
const main = (input) => {
  const n = Number(input)
  const nOne = n % 10
  if (nOne === 2 || nOne === 4 || nOne === 5 || nOne === 7 || nOne === 9) {
    console.log('hon')
  } else if (nOne === 0 || nOne === 1 || nOne === 6 || nOne === 8) {
    console.log('pon')
  } else {
    console.log('bon')
  }
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'))

Measured memory_bytes: 29620
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define repp(i,m,n) for(int (i)=(m);(i)<(n);(i)++)
#define repm(i,n) for(int (i)=(n-1);(i)>=0;(i)--)
#define INF (1ll<<60)
#define all(x) (x).begin(),(x).end()
typedef long long lint;
const lint MOD =1000000007;
const lint MAX = 10000000;
using Graph =vector<vector<lint>>;
typedef pair<lint,lint> P;

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

void COMinit() // 二項係数を求める時は前処理としてCOMinit()をする
{
    fac[0] = fac[1] = 1;
    finv[0] = finv[1] = 1;
    inv[1] = 1;
    for (lint 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(lint n, lint k)
{
    if (n < k)
        return 0;
    if (n < 0 || k < 0)
        return 0;
    return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}

lint primary(lint num)
{
    if (num < 2) return 0;
    else if (num == 2) return 1;
    else if (num % 2 == 0) return 0; // 偶数はあらかじめ除く

    double sqrtNum = sqrt(num);
    for (int i = 3; i <= sqrtNum; i += 2)
    {
        if (num % i == 0)
        {
            // 素数ではない
            return 0;
        }
    }

    // 素数である
    return 1;
}
   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;
}

    //A1+B1とA2+B2の和が等しいときはinfA1,A2がそれぞれB1,B2より大きいまたその逆の時は必ずどっちかが先行し続けるため0;abs(A1-B1)>abs(A2-B2)のときは先に追い抜くより多く先行してしまうため０
   // それ以外では一回ごとにdif離れるのでdif/dif1の切り上げ*2-1;dif1%dif=0のときは最後に交わるため一足す
  int main(){
      lint T1,T2,A1,A2,B1,B2;
      cin>>T1>>T2>>A1>>A2>>B1>>B2;
      A1*=T1;
      B1*=T1;
      A2*=T2;
      B2*=T2;
      lint g=0;
    lint dif=abs(A1+A2-B1-B2);
    lint dif1=abs(A1-B1);
    if(dif!=0){
    if(dif1%dif==0)g++;
    }
      if(dif==0)cout<<"infinity";
      else if(A1>B1&&A2>B2)cout<<0;
      else if(A1<B1&&A2<B2)cout<<0;
      else if(abs(A1-B1)>abs(A2-B2))cout<<0;
      else cout<<(lint)((dif1+dif-1)/dif)*2-1+g;

    }
     
  


Measured memory_bytes: 256
#include <cstdio>
#include <iostream>
#include <string>
#include <vector>
#include <sstream>
#include <map>
#include <set>
#include <queue>
#include <algorithm>
#include <cmath>
#include <cstring>
#include <typeinfo>
#include <numeric>
#include <functional>
#include <unordered_map>
#include <bitset>
#include <stack>


using namespace std;
using ll = long long;
using ull = unsigned long long;

const ll INF = 1e16;
const ll MOD = 1e9 + 7;

#define REP(i, n) for(ll i = 0; i < n; i++)







int main() {
    ll n;
    cin >> n;
    vector<ll> a(n);
    REP(i, n){
        cin >> a[i];
    }
    vector<vector<ll>> dp(n + 1, vector<ll>(n + 1, -INF));
    REP(i, n + 1){
        dp[i][i] = 0;
    }
    for(ll i = 1; i <= n; i++){
        for(ll j = 0; j <= n - i; j++){
            dp[j][i + j] = -max(dp[j][i + j - 1] + a[j + i - 1], dp[j + 1][i + j] + a[j]);
        }
    }
    cout << -dp[0][n] << endl;
}

Measured memory_bytes: 70784
#pragma GCC optimize(2)
#pragma GCC optimize(3)
#include <bits/stdc++.h>
#define ios ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0)
#define debug  freopen("in.txt","r",stdin),freopen("out.txt","w",stdout);
#define pb push_back
#define all(x) x.begin(),x.end()
#define fs first
#define sc second
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> pii;
const int maxn = 1e6+10;
const int maxM = 1e6+10;
const int inf = 0x3f3f3f3f;
const ll inf2 = 0x3f3f3f3f3f3f3f3f;
const int mod = 998244353;
template<class T>void read(T &x){
    T s=0,w=1;
    char ch=getchar();
    while(ch<'0'||ch>'9'){if(ch=='-')w=-1;ch=getchar();}
    while(ch>='0'&&ch<='9') s=s*10+ch-'0',ch=getchar();
    x = s*w;
}
template<class H, class... T> void read(H& h, T&... t) {
    read(h);
    read(t...);
}
struct segtree{
    struct node{
        int l,r;
        ll sum,lazy;
    }tr[int(2e5)*4 + 10];
    void pushup(node &cur,node &L,node &R){
        cur.sum = L.sum + R.sum;
        cur.sum %= mod;
    }
    void pushdown(node &cur,node &L,node &R){
        if(cur.lazy == 0) return ;
        L.lazy += cur.lazy; L.lazy%=mod;
        R.lazy += cur.lazy; R.lazy%=mod;
        L.sum += (ll)(L.r - L.l + 1) * cur.lazy%mod; L.sum%=mod;
        R.sum += (ll)(R.r - R.l + 1) * cur.lazy%mod; R.sum%=mod;
        cur.lazy = 0;
    }
    void build(int l,int r,int u = 1){
        tr[u] = {l,r};
        if(l != r){
            int mid = (l+r)>>1;
            build(l,mid,u*2);
            build(mid+1,r,u*2+1);
        }
    }
    void modify(int l,int r,ll v,int u = 1){
        if(l <= tr[u].l && tr[u].r <= r){
            tr[u].lazy += v; tr[u].lazy%=mod;
            tr[u].sum += (tr[u].r - tr[u].l +1) * v%mod; tr[u].sum %= mod;
        }else{
            pushdown(tr[u],tr[u*2],tr[u*2+1]);
            int mid  = (tr[u].l + tr[u].r) >>1;
            if(l<=mid) modify(l,r,v,u*2);
            if(r>mid) modify(l,r,v,u*2+1);
            pushup(tr[u],tr[u*2],tr[u*2+1]);
        }
    }
    ll query(int l,int r,int u = 1){
        if(l <= tr[u].l && tr[u].r <= r){
            return tr[u].sum;
        }else{
            pushdown(tr[u],tr[u*2],tr[u*2+1]);
            int mid = (tr[u].l + tr[u].r)>>1;
            ll sum = 0;
            if(l<=mid) sum += query(l,r,u*2),sum%=mod;
            if(r > mid) sum += query(l,r,u*2+1),sum%=mod;
            return sum;
        }
    }

}tree;
int N,K;
pii line[15];
void solve(){
	tree.build(1,N+1);
	tree.modify(1,1,+1);
	for(int i = 1;i<=N;i++){
		for(int j = 1;j<=K;j++){
			int l = line[j].fs,r = line[j].sc;
			tree.modify(min(i+l,N+1),min(i+r,N+1),tree.query(i,i));
		}
	}

	cout<<tree.query(N,N)<<'\n';
}	
int main(){
	// debug;
	
	read(N,K);
	for(int i =1;i<=K;i++){
		read(line[i].fs,line[i].sc);
	}
	solve();
	return 0;
}


Measured memory_bytes: 15896
#include <cstdio>

int p[200010], r[200010];

int main(){
  int N; scanf("%d", &N);
  for(int i = 1; i <= N; i++) scanf("%d", &p[i]);

  int s = 1, e = N; bool v = true;

  for(int i = N; i >= 1; i--){
    r[v ? s : e] = p[i];
    if(v) s++; else e--;
    v = !v;
  }

  for(int i = 1; i <= N; i++) printf("%d ", r[i]);
  printf("\n");
  return 0;
}

Measured memory_bytes: 3712