akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <iomanip>
#include <cmath>
#include <cstdlib>
#include <map>
#define ll long long
#define REP(i, x) for(int (i) = 0; (i) < (x); (i) ++)
#define pi 3.1415926535
const int MOD = 1000000007;
using namespace std;

int main() {
	double n, k;
	cin >> n >> k;
	double ans = 0;
	for (double i = 1; i <= n; i++) {
		double a = i;
		double count = 0;
		while (a < k) {
			a *= 2;
			count++;
		}
		ans += (1 / (pow(2, count)))*(1 / n);
	}
	cout << setprecision(13) << ans << endl;
	return 0;
}

Measured memory_bytes: 256
h,w = map(int,input().split())
s = [input()for i in range(h)]
OK = True
for i in range(h):
    for j in range(w):
        if s[i][j] == '.':continue
        ok = False
        if i-1>=0 and s[i-1][j] == '#':ok = True
        if j-1>=0 and s[i][j-1] == '#':ok = True
        if i+1<=h-1 and s[i+1][j] == '#':ok = True
        if j+1 <= w-1 and s[i][j+1] == '#':ok = True
        if not ok:
            OK = False
            break
            
if OK :print('Yes')
else:print('No')

Measured memory_bytes: 3064
#include <algorithm>
#include <iostream>
#include <math.h>
#include <string>
using namespace std;
int main() {
  int a,b,c,x; cin>>a>>b>>c>>x;
  int ans=0;
  for(int i=0;i<=a;i++){
    for(int j=0;j<=b;j++){
      for(int k=0;k<=c;k++){
        if(x==500*i+100*j+50*k) ans++;
      }
    }
  }
  cout<<ans<<endl;
  return 0;
}

Measured memory_bytes: 256
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		long a = Long.parseLong(sc.next());
//		String t = sc.next();
//		String buff="";
		long b = Long.parseLong(sc.next());
		//int c = Integer.parseInt(sc.next());
		//int n = Integer.parseInt(sc.next());
		//long res=n;
		//int l = Integer.parseInt(sc.next());
		//int sum=0;
		//String s = sc.next();
		//String t = sc.next();
		//String b = sc.next();
		//int a = Integer.parseInt(sc.next());
		//String t = sc.next();

		if(a==b) {//a、e、i、o、u
			System.out.println("Draw");
		}else if(a==1){
			System.out.println("Alice");
		}else if(b==1) {
			System.out.println("Bob");
		}else if(a>b) {
			System.out.println("Alice");
		}else {
			System.out.println("Bob");
		}
		/*for(int i=0;i<t.length();i++) {
			if(t.substring(i,i+1).equals(",")) {
				buff+=" ";
			}else {
				buff+=t.substring(i, i+1);
			}
		}*/
		//System.out.println(buff);
	}
}




Measured memory_bytes: 21588
#include <bits/stdc++.h>
using namespace std;
#define mod 1000000007
char a[1005][1005];
long long int dp[1005][1005];
bool vis[1005][1005];
int n,m;
int valid(int x,int y)
{
    return (x>=0&&x<n&&y>=0&&y<m&&a[x][y]=='.');
}
int main()
{
    int i,j,x,y;
    cin>>n>>m;
    for(i=0;i<n;i++)
    {
        for(j=0;j<m;j++)
        cin>>a[i][j];
    }
    memset(vis,false,sizeof(vis));
    queue<pair<int,int> >q;
    q.push({0,0});
    dp[0][0]=1;
    vis[0][0]=true;
    while(!q.empty())
    {
        x=q.front().first;
        y=q.front().second;
        q.pop();
        if(!vis[x+1][y]&&valid(x+1,y))
        {
            vis[x+1][y]=1;
            if(valid(x,y)&&valid(x+1,y-1))
            dp[x+1][y]=(dp[x][y]%mod+dp[x+1][y-1]%mod)%mod;
            else
            if(valid(x,y))
            dp[x+1][y]=dp[x][y];
            q.push({x+1,y});
        }
        if(!vis[x][y+1]&&valid(x,y+1))
        {
            vis[x][y+1]=1;
            if(valid(x,y)&&valid(x-1,y+1))
            dp[x][y+1]=(dp[x][y]%mod+dp[x-1][y+1]%mod)%mod;
            else
            if(valid(x,y))
            dp[x][y+1]=dp[x][y];
            q.push({x,y+1});
        }
    }
    cout<<dp[n-1][m-1];
    return 0;
}

Measured memory_bytes: 10112
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
using VI = vector<ll>;
using VV = vector<VI>;
using VS = vector<string>;

// tourist set
template <typename A, typename B>
string to_string(pair<A, B> p);

template <typename A, typename B, typename C>
string to_string(tuple<A, B, C> p);

template <typename A, typename B, typename C, typename D>
string to_string(tuple<A, B, C, D> p);

string to_string(const string& s) {
  return '"' + s + '"';
}

string to_string(const char* s) {
  return to_string((string) s);
}

string to_string(bool b) {
  return (b ? "true" : "false");
}

string to_string(vector<bool> v) {
  bool first = true;
  string res = "{";
  for (int i = 0; i < static_cast<int>(v.size()); i++) {
    if (!first) {
      res += ", ";
    }
    first = false;
    res += to_string(v[i]);
  }
  res += "}";
  return res;
}

template <size_t N>
string to_string(bitset<N> v) {
  string res = "";
  for (size_t i = 0; i < N; i++) {
    res += static_cast<char>('0' + v[i]);
  }
  return res;
}

template <typename A>
string to_string(A v) {
  bool first = true;
  string res = "{";
  for (const auto &x : v) {
    if (!first) {
      res += ", ";
    }
    first = false;
    res += to_string(x);
  }
  res += "}";
  return res;
}

template <typename A, typename B>
string to_string(pair<A, B> p) {
  return "(" + to_string(p.first) + ", " + to_string(p.second) + ")";
}

template <typename A, typename B, typename C>
string to_string(tuple<A, B, C> p) {
  return "(" + to_string(get<0>(p)) + ", " + to_string(get<1>(p)) + ", " + to_string(get<2>(p)) + ")";
}

template <typename A, typename B, typename C, typename D>
string to_string(tuple<A, B, C, D> p) {
  return "(" + to_string(get<0>(p)) + ", " + to_string(get<1>(p)) + ", " + to_string(get<2>(p)) + ", " + to_string(get<3>(p)) + ")";
}

void debug_out() { cerr << endl; }

template <typename Head, typename... Tail>
void debug_out(Head H, Tail... T) {
  cerr << " " << to_string(H);
  debug_out(T...);
}

#ifdef LOCAL
#define debug(...) cerr << "[" << #__VA_ARGS__ << "]:", debug_out(__VA_ARGS__)
#else
#define debug(...) 42
#endif
// tourist set end

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; }

#define FOR(i,a,b) for(ll i=(a);i<(b);++i)
#define rep(i,b) FOR(i, 0, b)
#define ALL(v) (v).begin(), (v).end()
#define p(s) cout<<(s)<<endl
#define p2(s, t) cout << (s) << " " << (t) << endl
#define br() p("")
#define pn(s) cout << (#s) << " " << (s) << endl
#define p_yes() p("Yes")
#define p_no() p("No")
#define pb(s) push_back(s)
#define SZ(x) ((int)(x).size())

void no(){p_no(); exit(0);}
void yes(){p_yes(); exit(0);}

const ll mod = 1e9 + 7;
const ll inf = 1e18;

void vprint(vector<ll> A){
    ll L = A.size();
    FOR(i, 0, L){
        if(i) cout << ' ';
        cout << A[i];
    }
    cout << endl;
}

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

    // input
    string s; cin >> s;
    if(s.find("AC")==string::npos){
      p_no();
    }else{
      p_yes();
    }
    
    return 0;
}

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

typedef pair<int,int> P;
#define ll long long
#define ld long double
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define PI 3.14159265358979323846
#define sz(x) ((int)(x).size())
#define chmin(x,y) x = min(x,y)
#define chmax(x,y) x = max(x,y)

const int INF = 1e9;
const int MOD = 1e9 + 7;
const ll LINF = 1e18;
int main()
{
    ll a,b,c,k; cin >> a >> b >> c >> k;
    ll ans = 0;
    if(k>a)
    {
        ans += a;
        k -= a;
    }else
    {
        ans = k;
        cout << ans << endl;
        return 0;
    }
    
    if(k>b)
    {
        k -= b;
    }else
    {
        cout << ans << endl;
        return 0;
    }
    ans -= k;
    cout << ans << endl;
    
}

Measured memory_bytes: 3620
#include <bits/stdc++.h>
using namespace std;
struct fast_ios { fast_ios(){ cin.tie(0); ios::sync_with_stdio(false); cout << fixed << setprecision(20); }; } fast_ios_;
#define FOR(i, begin, end) for(int i=(begin);i<(end);i++)
#define REP(i, n) FOR(i,0,n)
#define IFOR(i, begin, end) for(int i=(end)-1;i>=(begin);i--)
#define IREP(i, n) IFOR(i,0,n)
#define Sort(v) sort(v.begin(), v.end())
#define Reverse(v) reverse(v.begin(), v.end())
#define all(v) v.begin(),v.end()
#define SZ(v) ((int)v.size())
#define Lower_bound(v, x) distance(v.begin(), lower_bound(v.begin(), v.end(), x))
#define Upper_bound(v, x) distance(v.begin(), upper_bound(v.begin(), v.end(), x))
#define Max(a, b) a = max(a, b)
#define Min(a, b) a = min(a, b)
#define bit(n) (1LL<<(n))
#define bit_exist(x, n) ((x >> n) & 1)
#define Ans(f, y, n) if(f) cout << y << endl; else cout << n << endl;
#define debug(x) cout << #x << "=" << x << endl;
#define vdebug(v) cout << #v << "=" << endl; REP(i, v.size()){ cout << v[i] << ","; } cout << endl;
#define mdebug(m) cout << #m << "=" << endl; REP(i, m.size()){ REP(j, m[i].size()){ cout << m[i][j] << ","; } cout << endl;}
#define pb push_back
#define f first
#define s second
#define int long long
#define INF 1000000000000000000

using vec = vector<int>;
using mat = vector<vec>;
using Pii = pair<int, int>;
using PiP = pair<int, Pii>;
using PPi = pair<Pii, int>;
using bools = vector<bool>;
using pairs = vector<Pii>;

template<typename T> void readv(vector<T> &a){ REP(i, a.size()) cin >> a[i]; }
void readv_m1(vector<int> &a){ REP(i, a.size()){cin >> a[i]; a[i]--;} }

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

int mod = 1000000007;
//int mod = 998244353;
#define Add(x, y) x = (x + (y)) % mod
#define Mult(x, y) x = (x * (y)) % mod



signed main(){

    int N, X; cin >> N >> X;
    vec S(N);; readv(S);
    Sort(S);

    int M = 100001;
    mat dp(N + 1, vec(M));
    REP(i, M) dp[0][i] = i;

    REP(i, N) REP(j, M) dp[i + 1][j] = (i * dp[i][j] + dp[i][j % S[i]]) % mod;
    
    cout << dp[N][X] << endl;

    return 0;
}


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

# Aに対してワーシャルフロイドを適用した結果と比較して解を求める
ans = (
    -1 if any(
        A[u][v] > A[u][k] + A[k][v]
        for u in range(N)
        for v in range(u + 1, N)
        for k in range(N)
        if k != u and k != v
    ) else
    sum(sum(a) for a in A) // 2 - sum(
        A[u][v]
        for u in range(N)
        for v in range(u + 1, N)
        if any(
            A[u][v] == A[u][k] + A[k][v]
            for k in range(N)
            if k != u and k != v
        )
    )
)

# 出力
print(ans)


Measured memory_bytes: 50140
#include <iostream>
#include <vector>
#include <string>
#include <utility>
#include <queue>
#include <algorithm>
#include <map>
#include <set>
#include <cmath>
//#include "h.h"
using namespace std;

#define MOD 1000000007

#define ll long long
#define pint pair<int, int>
#define pll pair<ll, ll>
#define pb push_back
#define mp make_pair
#define pm(first), (second) pb(mp(first), (second))
#define SPACE " "
#define fpf first.first
#define fps first.second
#define spf second.first
#define sps second.second

#define all(X) (X).begin(), (X).end()

int main(){

	string S;
	cin >> S;
	int ans = 0;
	for(int i = 0; i < S.size(); i ++){
		if(i%2 == 0 && S[i] == 'p')ans--;
		if(i%2 == 1 && S[i] == 'g')ans++;
	}
	cout << ans << endl;

	return 0;
}

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

int main(){
  long long hu=1e18;
  long long n;
  cin>>n;
  for(long long i=1;i*i<=n;i++){
    if(n%i!=0){
      continue;
    }
    long long j=n/i;
    hu=min(hu,i+j-2);
  }
  cout<<hu<<endl;
}
    


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

namespace B_MinorChange
{
    class Program
    {
        static void Main(string[] args)
        {
            var a = Console.ReadLine().ToList();
            var b = Console.ReadLine().ToList();
            var cnt = 0;
            for (int i = 0; i <= a.Count()-1; ++i)
                if (a[i] != b[i])
                    cnt++;
            Console.WriteLine(cnt);
        }
    }
}


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

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

	long double a[n], dp[n+1][n+1];

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

    //dp[0][0]=1;

    for (int i = 0; i <= n; ++i)
	for(int j=0;j<=n;j++)
		 dp[i][j]=1;
         
	for (int i = 1; i <=n; ++i)
	{   	 
		  	dp[i][0]=dp[i-1][0]*(1-a[i-1]);
            dp[0][i]=dp[0][i-1]*(a[i-1]);
		  
	}

	for (int i = 1; i <= n; ++i)
	{
		for(int j=1;j<=n;j++)
		{   dp[i][j]=0;
			if((i+j)<=n)
            dp[i][j]=dp[i-1][j]*(1-a[i+j-1])  + dp[i][j-1]*a[i+j-1];
		}
	}
    
    long double ans=0;

    for (int i = 0; i <= n; ++i)
	{
		for(int j=0;j<=n;j++)
		{     

			//cout<<setprecision(19)<<dp[i][j]<<"  ";
            if(i+j==n  && j>i)
            	ans+=dp[i][j];
		}
		//cout<<endl;

    }		

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



	return 0;
}

Measured memory_bytes: 140928
import numpy as np
#入力
N = input()
A = input()
#入力値を取り出す
B = np.array(list(map(int,A.split( ))))
ans = 1
for i in range(1, len(B)):
    if(len(B[0:-i][B[0:-i] > B[-i]])>0):
        ans = ans
    else:
        ans = ans + 1
print(ans)

Measured memory_bytes: 12488
use std::cmp;
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
    ($($r:tt)*) => {
        let mut s = {
            use std::io::Read;
            let mut s = String::new();
            std::io::stdin().read_to_string(&mut s).unwrap();
            s
        };
        let mut iter = s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
}

macro_rules! input_inner {
    ($iter:expr) => {};
    ($iter:expr, ) => {};

    ($iter:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($iter, $t);
        input_inner!{$iter $($r)*}
    };
}

macro_rules! read_value {
    ($iter:expr, ( $($t:tt),* )) => {
        ( $(read_value!($iter, $t)),* )
    };

    ($iter:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($iter, $t)).collect::<Vec<_>>()
    };

    ($iter:expr, chars) => {
        read_value!($iter, String).chars().collect::<Vec<char>>()
    };

    ($iter:expr, usize1) => {
        read_value!($iter, usize) - 1
    };

    ($iter:expr, $t:ty) => {
        $iter.next().unwrap().parse::<$t>().expect("Parse error")
    };
}

const N_MAX: usize = 1e5 as usize;

fn main() {
    input!{
        n: usize,
        h: [i32; n],
    }

    let mut dp = [0; N_MAX];
    dp[0] = 0;
    dp[1] = (h[0] - h[1]).abs();

    for i in 2..n {
        dp[i] = cmp::min(dp[i-1] + (h[i-1] - h[i]).abs(), dp[i-2] + (h[i-2] - h[i]).abs());
    }

    println!("{}", dp[n-1]);
}


Measured memory_bytes: 3196
//include
//------------------------------------------
#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <queue>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <fstream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <string>
#include <cstring>
#include <ctime>
#include <climits>
#include <limits>

using namespace std;

//conversion
//------------------------------------------
inline int toInt(string s) { int v; istringstream sin(s); sin >> v; return v; }
template<class T> inline string toString(T x) { ostringstream sout; sout << x; return sout.str(); }

//math
//-------------------------------------------
template<class T> inline T sqr(T x) { return x * x; }

//typedef
//------------------------------------------
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef long long LL;

//container util
//------------------------------------------
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define EXISTch(s,c) ((((s).find_first_of(c)) != std::string::npos)? 1 : 0)//cがあれば1 if(1)
#define SORT(c) sort((c).begin(),(c).end())

#define REP(i,n) for(int i=0;i<(int)n;++i)
#define FOR(i,c) for(__typeof((c).begin())i=(c).begin();i!=(c).end();++i)

//constant
//--------------------------------------------
const double EPS = 1e-10;
const double PI = acos(-1.0);
const int INF = (int)1000000007;
const LL MOD = (LL)1000000007;//10^9+7
const LL INF2 = (LL)100000000000000000;//10^18

struct UnionFind {
	vector< int > data;

	UnionFind(int sz) {
		data.assign(sz, -1);
	}

	bool unite(int x, int y) {
		x = find(x), y = find(y);
		if (x == y) return (false);
		if (data[x] > data[y]) swap(x, y);
		data[x] += data[y];
		data[y] = x;
		return (true);
	}

	int find(int k) {
		if (data[k] < 0) return (k);
		return (data[k] = find(data[k]));
	}

	int size(int k) {
		return (-data[find(k)]);
	}
};

int main() {

	int n, m; cin >> n >> m;

	UnionFind uf(n);


	for (int i = 0; i < m; i++) {
		int x, y, z; cin >> x >> y >> z;
		x--; y--;

		uf.unite(x, y);
	}

	int ans = 0;
	for (int i = 0; i < n; i++) {
		if (i == uf.find(i))ans++;
	}

	cout << ans << endl;

	return 0;
}

Measured memory_bytes: 640
#include <bits/stdc++.h>
   
using namespace std;
     
#define PB(x) push_back(x)
#define ALL(x) (x).begin(), (x).end()
#define ALLR(x) (x).rbegin(), (x).rend()
#define MP(x) make_pair(x);
    
#define debug(x) cerr << #x << '=' << x << endl;
#define debug2(x, y) cerr << #x << '=' << x << ' ' << #y << '=' << y << endl;
#define debugn(a) for (int x: a) cerr << x << ' '; cerr << endl;
     
#define int long long
     
typedef pair<int, int> ii;
typedef vector<int> vi;
typedef vector<pair<int, int>> vii;
typedef vector<string> vs;
typedef unsigned long long ull;

const int INF = 1e9;


int32_t main()
{
	int n;
	cin >> n;
	int h[n+1];
	h[0] = INF;
	for (int i = 1; i <= n; i++)
		cin >> h[i];
		
	int dp[n+1];
	dp[1] = 0;
	for (int i = 2; i <= n; i++) {
		dp[i] = min(dp[i-1] + abs(h[i]-h[i-1]),dp[i-2] + abs(h[i]-h[i-2]));
	}
	cout << dp[n] << endl;
}



Measured memory_bytes: 1792
#include <bits/stdc++.h>
using namespace std;
int main(){
	int a, b;
  	
  	cin >> a >> b;
	if (a > b){
    	for (int i = 0;i < a; i++){
        	cout << b;
        }
    }else{
    	for (int i = 0;i < b;i++){
        	cout << a;
        }
    }
}

Measured memory_bytes: 256
def roots(l,i,v,ans):
    if i<len(l):
        roots(l,i+1,v,ans)
        roots(l,i+1,v+[l[i]],ans)
        return
    else:
        if v!=[]:
            ans.append(v)
        return ans

def sumL(l):
    ans=[0]*len(l[0])
    for i in range(len(l)):
        for j in range(len(l[i])):
            ans[j]+=l[i][j]
    return ans

n,m,x=[int(i) for i in input().split(" ")]
l=[]
for i in range(n):
    l.append([int(i) for i in input().split(" ")])

ans=[]
roots(l,0,[],ans)

minV=10**10

for i in ans:
    flag=True
    s=sumL(i)
    for j in s[1:]:
        if j<x:
            flag=False
            break
    if flag and minV>s[0]:
        minV=s[0]
if minV==10**10:
    print(-1)
else:
    print(minV)


Measured memory_bytes: 9388
#include <cstdio>
#include <queue>
#include <algorithm>
#define maxn 200005
using namespace std;

int a[maxn], n;

struct Position
{
	int lf, rf, comfort;
	inline Position(int l, int r)
	{
		lf = l, rf = r;
		comfort = min(l, r);
	}
	inline bool operator<(const Position& p) const
	{
		return comfort < p.comfort;
	}
};

priority_queue<Position> q;

inline bool cmp(int x, int y) {return x > y;}

int main(int argc, char** argv)
{
	scanf("%d", &n);
	for(int i=0; i<n; i++)
		scanf("%d", a + i);
	sort(a, a + n, cmp);
	q.push(Position(a[0], a[1]));
	long long res = a[0];
	for(int i=2; i<n; i++)
	{
		Position p = q.top();
		if(q.size() > 1) q.pop();
		res += p.comfort;
		q.push(Position(a[i], p.lf));
		q.push(Position(a[i], p.rf));
	}
	printf("%lld\n", res);
	return 0;
}

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

using namespace std;

int main(){

  int h,w;
  cin >> h >> w;
  vector<vector<char>> v(h, vector<char>(w));

  // 入力 (2重ループを用いる)
  for (int i = 0; i < h; i++) {
    for (int j = 0; j < w; j++) {
      cin >> v.at(i).at(j);
    }


    }
    for (int i = 0; i < 2*h; i++) {
      for (int j = 0; j < w; j++) {
        cout << v.at(i/2).at(j) ;
      }
      cout << endl;
  }
}


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

int main()
{
  ll a, b, k; cin >> a >> b >> k;
  cout << max(0LL, a - k) << " " << max(0LL, b - max(0LL, k - a)) << endl;
  return 0;
}

Measured memory_bytes: 256
chomp($n = <>);
($t, $a) = split(/ /, <>);
@h = ("", split(/ /, <>));

for $i (1 .. $n){
	$dif = abs($a - ($t - ($h[$i] * 0.006)));
	if($i == 1){
		$min = $dif;
		$r = $i;
	}else{
		if($min > $dif){
			$min = $dif;
			$r = $i;
		}
	}
}

print "$r\n";


Measured memory_bytes: 640
import java.util.Arrays;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int[] array = new int[3];
        for (int i = 0; i < 3; i++) {
            array[i] = sc.nextInt();
        }
        Arrays.sort(array);
        System.out.println(array[0] * array [1] / 2);
    }
}


Measured memory_bytes: 21716
s = input()
q = int(input())
st = 0
str1 = ""
str2 = ""
for _ in range(q):
    query = list(input().split())
    if query[0] == "1":
        st = 1 if st == 0 else 0
    else:
        if query[1] == "1":
            if st == 0:
                str1 += query[2]
            else:
                str2 += query[2] 
        else:
            if st == 0:
                str2 += query[2] 
            else:
                str1 += query[2] 

if st == 0:
    ans = str1[::-1] + s + str2
else:
    ans = str2[::-1] + s[::-1] + str1
    
print(ans)

Measured memory_bytes: 4408
const int LG = 21;
const int FN = 400005;
const long long MOD = 1e9 + 7;
const long long INF = 1e9;
const long long INFLL = 1e18;

#include <bits/stdc++.h>

using namespace std;

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

#define forn(i, n) for (int (i) = 0; (i) != (n); (i)++)
#define all(v) (v).begin(), (v).end()
#define rall(v) (v).rbegin(), (v).rend()
#define popcount(x) __builtin_popcount(x)
#define popcountll(x) __builtin_popcountll(x)
#define fi first
#define se second
#define re return
#define pb push_back
#define uniq(x) sort(all(x)); (x).resize(unique(all(x)) - (x).begin())

#ifdef LOCAL
#define dbg(x) cerr << __LINE__ << " " << #x << " " << x << endl
#define ln cerr << __LINE__ << endl
#else
#define dbg(x) void(0)
#define ln void(0)
#endif // LOCAL

int cx[4] = {-1, 0, 1, 0};
int cy[4] = {0, -1, 0, 1};

ll inq(ll x, ll y)
{
    if (!y) re 1 % MOD;
    ll l = inq(x, y / 2);
    if (y % 2) re l * l % MOD * x % MOD;
    re l * l % MOD;
}

ll rev(ll x)
{
    return inq(x, MOD - 2);
}

bool __precomputed_combinatorics = 0;
vector<ll> __fact, __ufact, __rev;

void __precompute_combinatorics()
{
    __precomputed_combinatorics = 1;
    __fact.resize(FN);
    __ufact.resize(FN);
    __rev.resize(FN);
    __rev[1] = 1;
    for (int i = 2; i < FN; i++) __rev[i] = MOD - __rev[MOD % i] * (MOD / i) % MOD;
    __fact[0] = 1, __ufact[0] = 1;
    for (int i = 1; i < FN; i++) __fact[i] = __fact[i - 1] * i % MOD, __ufact[i] = __ufact[i - 1] * __rev[i] % MOD;
}

ll fact(int x)
{
    if (!__precomputed_combinatorics) __precompute_combinatorics();
    return __fact[x];
}

ll cnk(int n, int k)
{
    if (k < 0 || k > n) return 0;
    if (!__precomputed_combinatorics) __precompute_combinatorics();
    return __fact[n] * __ufact[n - k] % MOD * __ufact[k] % MOD;
}

int Root(int x, vector<int> &root)
{
    if (x == root[x]) return x;
    return root[x] = Root(root[x], root);
}

void Merge(int v, int u, vector<int> &root, vector<int> &sz)
{
    v = Root(v, root), u = Root(u, root);
    if (v == u) return;
    if (sz[v] < sz[u])
    {
        sz[u] += sz[v];
        root[v] = u;
    }
    else
    {
        sz[v] += sz[u];
        root[u] = v;
    }
}

int ok(int x, int n)
{
    return 0 <= x && x < n;
}

const int N = 400000;

signed main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    ll n;
    cin >> n;
    vi a(n), b(n);
    vi q(n);
    forn(i, n) cin >> a[i];
    forn(i, n) cin >> b[i];
    forn(i, n) q[i] = b[i] - a[i];
    ll dist = 0;
    if (dist < 0) cout << "No", exit(0);
    forn(i, n) dist += q[i];
    ll s = 0;
    forn(i, n) if (q[i] > 0) s += (q[i] + 1) / 2;
    if (s <= dist) cout << "Yes", exit(0);
    cout << "No";
}

/* Note:
Check constants at the beginning of the code.
    N is set to 4e5 but be careful in problems with large constant factor.
    Setting N in every problem is more effective.
Check corner cases.
    N = 1
No def int long long for now.
Add something here.
*/


Measured memory_bytes: 384
#include<bits/stdc++.h>
#define watch(x) cout << (#x) << " is " << (x) << endl
typedef long long ll;
using namespace std;
int static fast = [](){
  ios::sync_with_stdio(false);
  cin.tie(0); cout.tie(0); return 0;
}();

int main() {
    string s;
    cin >> s;
    int acc = 0;
    for(char c: s) {
        acc += c-'0';
    }
    if (stoi(s) % acc == 0)
        cout << "Yes" << endl;
    else
        cout << "No" << endl;
    return 0;
}


Measured memory_bytes: 256
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Stack;
import java.util.StringTokenizer;

public class Main {

	class Node {
		int p = -1, l, r;
	}
	
	public static void main(String[] args) throws IOException {
		new Main().run();
	}
	
	public void run() throws IOException {
		BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
		int n = Integer.parseInt(reader.readLine());
		Node[] nodes = new Node[n];
		for (int i = 0; i < n; i++)
			nodes[i] = new Node();
		for (int i = 0; i < n; i++) {
			StringTokenizer st = new StringTokenizer(reader.readLine());
			int id = Integer.parseInt(st.nextToken());
			int l = Integer.parseInt(st.nextToken());
			int r = Integer.parseInt(st.nextToken());
			nodes[id].l = l;
			nodes[id].r = r;
			if (l != -1)
				nodes[l].p = id;
			if (r != -1)
				nodes[r].p = id;
		}
		reader.close();

		int rootId = -1;
		for (int i = 0; i < n; i++) {
			if (nodes[i].p == -1) {
				rootId = i;
				break;
			}
		}

		System.out.println("Preorder");
		preOrder(nodes, rootId);
		System.out.println("Inorder");
		inOrder(nodes, rootId);
		System.out.println("Postorder");
		postOrder(nodes, rootId);
	}
	
	public void preOrder(Node[] nodes, int rootId) {
		Stack<Integer> stack = new Stack<Integer>();
		stack.push(rootId);
		while (!stack.isEmpty()) {
			int cur = stack.pop();
			System.out.print(" " + cur);
			if (nodes[cur].r != -1)
				stack.push(nodes[cur].r);
			if (nodes[cur].l != -1)
				stack.push(nodes[cur].l);
		}
		System.out.println("");
	}

	public void inOrder(Node[] nodes, int rootId) {
		Stack<Integer> stack = new Stack<Integer>();
		int cur = rootId;
		while (cur != -1 || !stack.isEmpty()) {
			if (cur != -1) {
				stack.push(cur);
				cur = nodes[cur].l;
			} else {
				cur = stack.pop();
				System.out.print(" " + cur);
				cur = nodes[cur].r;
			}
		}
		System.out.println("");
	}

	public void postOrder(Node[] nodes, int rootId) {
		Stack<Integer> stack = new Stack<Integer>();
		int lastVisited = -1;
		int cur = rootId;
		while (cur != -1 || !stack.isEmpty()) {
			if (cur != -1) {
				stack.push(cur);
				cur = nodes[cur].l;
			} else {
				int peekId = stack.peek();
				if (nodes[peekId].r != -1 && nodes[peekId].r != lastVisited) {
					cur = nodes[peekId].r;
				} else {
					System.out.print(" " + peekId);
					lastVisited = stack.pop();
				}
			}
		}
		System.out.println("");
	}
}



Measured memory_bytes: 24460
import java.util.*;
public class Main{
  public static void main(String[]args){
      Scanner sc = new Scanner(System.in);

      int a = sc.nextInt();
      int b = sc.nextInt();
      int c = sc.nextInt();
      int d = sc.nextInt();

      System.out.println(Math.min(a,b)+Math.min(c,d));

  }
}

Measured memory_bytes: 23764
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (n); i++)
#define repi(i, s, n) for (int i = (s); i < (n); i++)
#ifdef LOCAL
#define INPUT_FILE                              \
  ifstream in("atcoder-problems/arc073_a.txt"); \
  cin.rdbuf(in.rdbuf());
#else
#define INPUT_FILE
#endif
#define CIN_OPTIMIZE \
  cin.tie(0);        \
  ios::sync_with_stdio(false);
typedef pair<int, int> P;
typedef long long ll;
const int INF = 100100100;
const ll LINF = 1e18 + 100;
const int MOD = 1e9 + 7;

int main() {
  INPUT_FILE CIN_OPTIMIZE;

  int N, T;
  cin >> N >> T;

  vector<int> c(N);
  rep(i, N) { cin >> c[i]; }

  ll ans = 0;
  repi(i, 1, N) {
    ans += c[i] - c[i - 1] > T ? T : c[i] - c[i - 1];
  }
  ans += T;

  cout << ans << endl;
}

Measured memory_bytes: 1024
#include <bits/stdc++.h>
#define N 100
#define INF 1e9 + 5
#define LINF 1e18 + 5

using namespace std;
using ll = long long;
string a, b;
int memo[3002][3002];
int solve(int y, int x)
{

    if (x == 0 || y == 0)
        return memo[y][x] = 0;
    int &best = memo[y][x];
    if (best != -1)
        return best;
    best = max(solve(y - 1, x), solve(y, x - 1));
    if (a[y] == b[x])
        best = max(best, solve(y - 1, x - 1) + 1);
    return best;
}
/*
 abyxb
a10000 
x11122
y11222
b12223
*/
int main()
{
    std::ios_base::sync_with_stdio(false); cin.tie(NULL);
    cin >> a >> b;
    a = "$" + a;
    b = "$" + b;
    int y , x;
    y = a.length()-1;
    x = b.length()-1;
    //memo.resize(a.length() + 1, vector<int>(b.length() + 1, -1));
    memset(memo, -1, sizeof(memo));
    int maxlenth = solve(y, x);
    string t = "";
    while (x > 0 && y > 0)
    {
        if (memo[y][x] == memo[y - 1][x])
            y--;
        else if (memo[y][x] == memo[y][x - 1])
            x--;
        else
        {
            t = a[y--] + t;
            x--;
        }
    }
    cout << t;
    return 0;
}

Measured memory_bytes: 35968
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef long double ld;
int h,w;
ll MOD = 1e9+7,memo[1000][1000];
char m[1000][1000];

ll dp(int i,int j){
	if(i < 0 || j < 0 || m[i][j] == '#') return 0;
	if(i == 0 && j == 0) return 1;
	if(memo[i][j] != -1) return memo[i][j];
	ll ret = (dp(i-1,j)+dp(i,j-1))%MOD;
	memo[i][j] = ret;
	return ret;
}

int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	memset(memo,-1,sizeof(memo));
	cin>>h>>w;
	for(int i=0;i<h;i++){
		string s;
		cin>>s;
		for(int j=0;j<w;j++){
			m[i][j] = s[j];
		}
	}
	cout<<dp(h-1,w-1)<<"\n";
	return 0;
}

Measured memory_bytes: 9088
# by the authority of GOD     author: manhar singh sachdev #

import os,sys
from io import BytesIO, IOBase

def main():
    a,b,c,d = map(int,input().split())
    print(max(a*d,a*c,b*d,b*c))

#Fast IO Region
BUFSIZE = 8192
class FastIO(IOBase):
    newlines = 0
    def __init__(self, file):
        self._fd = file.fileno()
        self.buffer = BytesIO()
        self.writable = "x" in file.mode or "r" not in file.mode
        self.write = self.buffer.write if self.writable else None
    def read(self):
        while True:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            if not b:
                break
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines = 0
        return self.buffer.read()
    def readline(self):
        while self.newlines == 0:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            self.newlines = b.count(b"\n") + (not b)
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines -= 1
        return self.buffer.readline()
    def flush(self):
        if self.writable:
            os.write(self._fd, self.buffer.getvalue())
            self.buffer.truncate(0), self.buffer.seek(0)
class IOWrapper(IOBase):
    def __init__(self, file):
        self.buffer = FastIO(file)
        self.flush = self.buffer.flush
        self.writable = self.buffer.writable
        self.write = lambda s: self.buffer.write(s.encode("ascii"))
        self.read = lambda: self.buffer.read().decode("ascii")
        self.readline = lambda: self.buffer.readline().decode("ascii")
sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)
input = lambda: sys.stdin.readline().rstrip("\r\n")

if __name__ == '__main__':
    main()

Measured memory_bytes: 62604
#include <iostream>
#include <string>
//#include <math.h>
using namespace std;

int main(){
  int k,n; //池の周りの距離、家の数
  int house; //それぞれの家
  int between; //家の間
  int a;
  cin >> k >> n;
  int maxlength = -1;
  int kari;
  cin >> house;
  kari = house;
  a = house;
  for(int i=0; i<n-1; i++){
    cin >> house;
    if(maxlength < house - a){
      maxlength = house - a;
    }
    a = house;
  }
  int b;
  b = kari + k - house;
  if(maxlength < b){
    cout << k - b << '\n';
  }else{
    cout << k - maxlength << '\n';
  }

  return 0;
}


Measured memory_bytes: 256
#include <iostream>

int main()
{
	int x, a, b;
	std::cin >> x >> a >> b;
	a = std::abs( x - a );
	b = std::abs( x - b );
	if( a > b ) {
		std::cout << "B" << std::endl;
	}
	else {
		std::cout << "A" << std::endl;
	}
	return 0;
}



Measured memory_bytes: 256
#include<stdio.h>
int main()
{
    int a,b;
    char op;
    while(1)
    { scanf("%d %c %d",&a,&op,&b);
        if(op == '+')
       {

        printf("%d\n",a+b);
       }

       else if (op=='-')
       {
        printf("%d\n",a-b);
       }

       else if (op=='*')
       {
        printf("%d\n",a*b);
       }

        else if (op=='/')
       {
           printf("%d\n",a/b);
       }

       else if(op=='?'){break;}


    }
        return 0;
    }


Measured memory_bytes: 2688
#include<bits/stdc++.h>
#define int long long
#define REP(i,a,n) for(int i=a;i<(n);i++)
using namespace std;
int ans=0,sum[200001];
int n,a[200001];
signed main()
{
	ios::sync_with_stdio(0);
    cin.tie(0);cout.tie(0);
	cin>>n;
	sum[0]=0;
	REP(i,0,n){
		cin>>a[i];
		sum[i+1]=sum[i]+a[i];
	}
	REP(i,0,n){
		ans+=((sum[i+1]-a[i])%(long long)(1e9+7)*(a[i]%(long long)(1e9+7)))%(long long)(1e9+7);
		ans%=(long long)(1e9+7);
	}
	cout<<ans<<endl;
    return 0;
}


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

using namespace std;
 
#define rep(i,n) for(int i=0;i<(int)(n);i++)

typedef long long ll;

int main() {
    int a; cin >> a;
    string s; cin >> s;
    if(a>=3200)cout<<s<<endl;
    else cout<<"red"<<endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <iomanip>
#include <string>
#include <string.h>
#include <math.h>
#include <cmath>
#include <vector>
#include <list>
#include <set>
#include <map>
#include <algorithm>
#include <utility>
#include <deque>
#include <queue>
#include <functional>
#include <boost/multiprecision/cpp_int.hpp>

#define rep(i, n) for(int i = 0; i < n; ++i)
#define REP(i, m, n) for(int i = m; i < n; ++i)
#define rrep(i,n) for(int i = n; i >= 0; --i)
#define RREP(i, m, n) for(int i = n; i >= m; --i)
#define llrep(i, n) for(ll i = 0; i < n; ++i)
#define llREP(i, m, n) for(ll i = m; i < n; ++i)
#define llrrep(i,n) for(ll i = n; i >= 0; --i)
#define llRREP(i, m, n) for(ll i = n; i >= m; --i)

using ll = long long;
using ull = unsigned long long;
using pii = std::pair<int, int>;
using pll = std::pair<long long, long long>;
using pil = std::pair<int, long long>;
using pli = std::pair<long long, int>;
using plpii = std::pair<long long, std::pair<int, int>>;
using pdd = std::pair<double, double>;
using pis = std::pair<int, std::string>;

const long long INF = 1000000000000000001;
const long long _MOD = 1000000007;
const long long MOD = 998244353;
const int ALPHABET = 27;
const double pi = 3.14159265358979;

using namespace std;
namespace mp = boost::multiprecision;

struct node {
	ll distance;
	vector<pil> conected;
};

void dikstra(node* nodes, int startAt) {
	priority_queue<pli, vector<pli>, greater<pli>> que;
	que.push(pli(0, startAt));

	while (!que.empty()) {
		pli t = que.top();
		que.pop();
		if (t.first > nodes[t.second].distance) continue;

		rep(i, nodes[t.second].conected.size()) {
			if (nodes[nodes[t.second].conected[i].first].distance > nodes[t.second].distance + nodes[t.second].conected[i].second) {
				nodes[nodes[t.second].conected[i].first].distance = nodes[t.second].distance + nodes[t.second].conected[i].second;

				que.push(pli(nodes[nodes[t.second].conected[i].first].distance, nodes[t.second].conected[i].first));
			}
		}
	}
}

struct train {
	int u;
	int v;
	ll a;
	ll b;
};

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

	int n, m, s, t;
	cin >> n >> m >> s >> t;
	train* trains = new train[m];
	rep(i, m) cin >> trains[i].u >> trains[i].v >> trains[i].a >> trains[i].b;

	node* nodes = new node[n * 2];
	rep(i, n * 2) nodes[i].distance = INF;
	nodes[s - 1].distance = 0;
	nodes[t - 1 + n].distance = 0;

	rep(i, m) {
		nodes[trains[i].u - 1].conected.push_back(pil(trains[i].v - 1, trains[i].a));
		nodes[trains[i].v - 1].conected.push_back(pil(trains[i].u - 1, trains[i].a));
		nodes[trains[i].u - 1 + n].conected.push_back(pil(trains[i].v - 1 + n, trains[i].b));
		nodes[trains[i].v - 1 + n].conected.push_back(pil(trains[i].u - 1 + n, trains[i].b));
	}
	
	dikstra(nodes, s - 1);
	dikstra(nodes, t - 1 + n);

	ll* ans = new ll[n+1];
	ans[n] = 0;
	rrep(i, n - 1) {
		ans[i] = max(ans[i + 1], 1000000000000000 - (nodes[i].distance + nodes[i + n].distance));
	}

	rep(i, n) cout << ans[i] << "\n";

	return 0;
}


Measured memory_bytes: 23420
#include <stdio.h>
#include <math.h>

int main(void)
{

  int d,t;
  double x,y;
  double seta;

  seta = 90;
  x = 0.0;
  y = 0.0;
  while(1){
    scanf("%d,%d",&d,&t);
    if (!d && !t) break;

    x += cos(seta*M_PI/180) * d;
    y += sin(seta*M_PI/180) * d;
    seta -= t;

  }

  printf("%d\n%d\n",(int)x,(int)y);

  return 0;
}



Measured memory_bytes: 2044
S = input()

if S[0] == 'R' and S[1] == 'R' and S[2] == 'R':
    print(3)
elif S[0] == 'R' and S[1] == 'R' and S[2] == 'S':
    print(2)
elif S[0] == 'S' and S[1] == 'R' and S[2] == 'R':
    print(2)
elif S[0] == 'S' and S[1] == 'S' and S[2] == 'S':
    print(0)
else:
    print(1)

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

typedef long long ll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<string> vs;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef vector<pii> vpii;
typedef vector<pll> vpll;
#define rep(i, n) for(int i = 0; i < (n); i++)
#define rep1(i, n) for(int i = 1; i < (n); i++)
#define all(a) begin(a),end(a)
template<class T> istream& operator >> (istream& s, vector<T>& v)
{ for (T& x: v) { s >> x; } return s;}
template<class T> void cout_h(const vector<T>& c, int n=INT_MAX)
{ rep(i, min(n, (int)c.size())) cout << c[i] << (i==c.size()-1?"\n":" "); }
template<class T> inline bool chmin(T& a, T b) {return a>b?a=b,true:false;}
template<class T> inline bool chmax(T& a, T b) {return a<b?a=b,true:false;}
#define D1(a) cout<<#a<<":"<<a<<"\n"
#define D2(a,b) cout<<#a<<":"<<a<<","<<#b<<":"<<b<<endl 
#define D3(a,b,c) cout<<#a<<":"<<a<<","<<#b<<":"<<b<<","<<#c<<":"<<c <<endl
#define D4(a,b,c,d) cout<<#a<<":"<<a<<","<<#b<<":"<<b<<","<<#c<<":"<<c<<","<<#d<<":"<<d<<endl 
#define MOD 1000000007

int main()
{
    int N; cin >>N;
    vector<int> a(N); cin >> a;
    vector<int> b(N, 0);

    for (int n = N; n >= 1; n--) {
        int sum=0;
        for (int k = n*2; k <= N; k += n) {
            sum+=b[k-1];
        }
        sum %= 2;
        b[n-1] = (sum == a[n-1] ? 0 : 1);
    }

    int c = count(all(b), 1);
    cout << c << endl;
    if (c != 0) {
        int o = 0;
        rep(i, N) {
            if (b[i]) {
                if (o==0) cout << i+1;
                else cout << " " << i+1; 
                o++;
            }
        }
        cout << endl;
    }
}


Measured memory_bytes: 2432
x,k,d = map(int,input().split())
if x < 0:
    x = -x
if x >= k*d:
    ans = x - k*d
else:
    t = x//d
    if (k-t)%2 == 0:
        ans = x-d*t
    else:
        ans = d*(t+1)-x
print(ans)

Measured memory_bytes: 9180
import java.io.*;
import java.util.*;
import java.lang.*;


class Solution{

    void solve() throws IOException {
        BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(System.in));

        int N =  Integer.parseInt(bufferedReader.readLine());

        String[] input = bufferedReader.readLine().split(" ");

        int sum = 0;

        HashSet<Integer> hashSet = new HashSet<Integer>();

        
        for(int i = 0 ; i < input.length ; i++){
            int number = Integer.parseInt(input[i]);
            sum+=number;
            
            // if(!hashSet.contains(number)){
            //     hashSet.add(number);
                

            // }
            
        }

        int mean  = (int)Math.round(sum/(double)input.length);


        int offset = 0;

        for(int i = 0 ; i < input.length ; i++){
            offset+=(int)Math.pow((Integer.parseInt(input[i])-mean),2);
        }

       System.out.println(offset);
    }    

}

class Main{
    public static void main(String[] args) throws IOException{
        new Solution().solve();
    }
}

Measured memory_bytes: 32696
#import sys
MOD = 10 ** 9 + 7
INFI = 10**10
#input = sys.stdin.readline
import math
from collections import deque
import itertools
import heapq
#import bisect
from fractions import Fraction
import copy
from functools import lru_cache



def sosuhante(n):
    for k in range(2, int(math.sqrt(n))+1):
        if n% k ==0:
            return False
    return True
def cmb(n, r):
    if n - r < r: r = n - r
    if r == 0: return 1
    if r == 1: return n

    numerator = [n - r + k + 1 for k in range(r)]
    denominator = [k + 1 for k in range(r)]

    for p in range(2,r+1):
        pivot = denominator[p - 1]
        if pivot > 1:
            offset = (n - r) % p
            for k in range(p-1,r,p):
                numerator[k - offset] /= pivot
                denominator[k] /= pivot

    result = 1
    for k in range(r):
        if numerator[k] > 1:
            result *= int(numerator[k])

    return result

def kingaku(a,b,n):
    keta=len(str(n))
    return a*n+b*keta

def my_index(l, x, default=False):
    if x in l:
        return l.index(x)
    else:
        return default

#    h,w,a,b = map(int, input().split())
#    c = [[0 for j in range(n)] for i in range(n)]

def ret(a):
    c=[None]*(len(a)-1)
    if len(a)==1:
        return a[0]
    elif len(a)==0:
        return 0
    for i in range(1,len(a)):
        c[i-1]=abs(a[i]-a[i-1])
    return ret(c)



def main():
    n=list(input().split())
    a=int(n[0])
    b=int((str(n[1][0])+str(n[1][2:4])))
#    print(a,b)
    ans=a*b//100
    temp=float(n[1])
 #   print(a*temp)
    print(ans)










if __name__ == "__main__":

    main()

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

int main()
{
	int a, b, c, counts;
	scanf("%d %d %d", &a, &b, &c);
	for(int i = a; i<=b; i++)
	{
		if(c % i == 0)
		{
			counts++;
		}
	}
	printf("%d\n", counts);
	
	return 0;
}


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

using namespace std;

int arr[1000000][3],ans[1000000][3];
vector<int>crr;


int  main()
{
	ios_base::sync_with_stdio(false);
    cin.tie(NULL);
	int n,a,b,c,d;
	cin>>n;
	for (int i = 1; i <=n; ++i)
	{
		cin>>arr[i][0]>>arr[i][1]>>arr[i][2];
		ans[i][0]=0;
		ans[i][1]=0;
		ans[i][2]=0;
	}
	ans[0][0]=0;ans[0][1]=0;ans[0][2]=0;
	ans[1][0]=arr[1][0];ans[1][1]=arr[1][1];ans[1][2]=arr[1][2];
	
	for (int i = 2; i <=n; ++i)
	{
		if(ans[i-1][1]>ans[i-1][2])
			ans[i][0]=arr[i][0]+ans[i-1][1];
		else
			ans[i][0]=arr[i][0]+ans[i-1][2];

		if(ans[i-1][2]>ans[i-1][0])
			ans[i][1]=arr[i][1]+ans[i-1][2];
		else
			ans[i][1]=arr[i][1]+ans[i-1][0];

		if(ans[i-1][1]>ans[i-1][0])
			ans[i][2]=arr[i][2]+ans[i-1][1];
		else
			ans[i][2]=arr[i][2]+ans[i-1][0];

		// if(arr[i][1]>arr[i][2])
		// 	ans[i][1]=max(arr[i][1]+ans[i-1][0],ans[i][1]);
		// else
		// 	ans[i][2]=max(arr[i][2]+ans[i-1][0],ans[i][2]);

		// if(arr[i][2]>arr[i][0])
		// 	ans[i][2]=max(arr[i][2]+ans[i-1][1],ans[i][2]);
		// else
		// 	ans[i][0]=max(arr[i][0]+ans[i-1][1],ans[i][0]);

		// if(arr[i][1]>arr[i][0])
		// 	ans[i][1]=max(arr[i][1]+ans[i-1][2],ans[i][1]);
		// else
		// 	ans[i][0]=max(arr[i][0]+ans[i-1][2],ans[i][0]);


	}
	b=max(ans[n][0],ans[n][1]);
	b=max(b,ans[n][2]);
	cout<<b;
	return 0;
}


Measured memory_bytes: 5504
/* nothing is impossible */
#include <bits/stdc++.h> 
 
#define mp make_pair
#define mt make_tuple
#define eb emplace_back
#define fi first
#define se second
#define ff first
#define ss second
#define pb push_back
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define forn(i, n) for (int i = 0; i < (int)(n); ++i)
#define for1(i, n) for (int i = 1; i <= (int)(n); ++i)
#define ford(i, n) for (int i = (int)(n) - 1; i >= 0; --i)
#define fore(i, a, b) for (int i = (int)(a); i <= (int)(b); ++i)
using namespace std;
typedef long long ll;
typedef vector<ll> vi;
typedef vector<vi> vvi;
typedef pair<ll, ll> pii;
typedef long double ld;
typedef string st;
const double PI=3.14159265358979323846264338327950288419716939937510582097494459230;
const ll MOD = 1e9 + 7 ;
const ll INF=1e14;                                                                                           
ll mpow(ll a,ll b,ll p=MOD){a=a%p;ll res=1;while(b>0){if(b&1)res=(res*a)%p;a=(a*a)%p;b=b>>1;}return res%p;}             
const ll N=1000008;

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

  ll n,t;
  cin>>n>>t;
  ll min=1e14;
  while(n--)
  {
    ll x,y;
    cin>>x>>y;
    if(y<=t)
    {
      min=std::min(min,x);
    }
  }
  if(min==1e14)
  {
    cout<<"TLE";
  }
  else
  cout<<min;
  return 0;   
}

Measured memory_bytes: 256
#include <cstdio>
#include <cstring>
#include <vector>
using namespace std;

struct Node {
	int parent;
	vector<int> child;
};

#define INF (1<<30)

int cost[20][20],cSum,N;
bool vis[20];
Node T[20];

void make_tree(int v,int p) {
	vis[v]=true;
	T[v].parent=p;
	for(int i=0;i<N;i++) {
		if(cost[v][i]!=INF&&!vis[i]) {
			T[v].child.push_back(i);
			make_tree(i,v);
		}
	}
}

void dfs(int v,int c) {
	vis[v]=true;
	if(T[v].child.empty()) {
		return;
	}
	for(int i=0;i<T[v].child.size();i++) {
		if(!vis[T[v].child[i]]) dfs(T[v].child[i],cost[v][T[v].child[i]]);
	}
	cSum+=c*2;
}

int solve() {
	cSum=0;
	int node=0;
	while(~node) {
		dfs(node,0);
		if(~T[node].parent) cSum+=cost[node][T[node].parent];
		node=T[node].parent;
	}
	return cSum;
}

int main() {
	while(scanf("%d",&N)&&N) {
		for(int i=0;i<N;i++) {
			for(int j=0;j<N;j++) {
				cost[i][j]=INF;
			}
		}
		int a,b,t;
		for(int i=0;i<(N-1);i++) {
			scanf("%d %d %d",&a,&b,&t);
			cost[a-1][b-1]=cost[b-1][a-1]=t;
		}
		int ans=INF;
		for(int i=0;i<N;i++) {
			memset(vis,false,sizeof(vis));
			for(int j=0;j<N;j++) T[j].child.clear();
			make_tree(i,-1);
			memset(vis,false,sizeof(vis));
			ans=min(ans,solve());
		}
		printf("%d\n",ans);
	}
}

Measured memory_bytes: 1052
#include<stdio.h>
#include<stdlib.h>
typedef unsigned long long int lli;
typedef struct DATA{
	lli price;
	int bottle;
} DATA;
int asc(const void *a,const void*b){
	DATA *data_a = (DATA*)a;
	DATA *data_b = (DATA*)b;
	if(data_a->price > data_b->price){
		return 1;
	}
	return -1;
}
int main(void){
	int N,M;
	DATA data[100000];
	scanf("%d %d",&N,&M);
	for(int i = 0;i<N;i++){
		scanf("%llu %d",&data[i].price,&data[i].bottle);
	}
	
	qsort(data,N,sizeof(DATA),asc);
	int count =0;
	lli price = 0;
	for(int i=0;i<N;i++){
		if(count + data[i].bottle > M){
			price += (M-count)*data[i].price;
			break;
		}else{
			price += data[i].price * data[i].bottle;
			count += data[i].bottle;
		}
	}
	printf("%llu\n",price);
	return 0;
}

Measured memory_bytes: 3324
#include<iostream>
using namespace std;
int main()
{
    long double p = 3.14159265359;
    long long  n,m;
    cin>>m>>n;
    long long a[n];
    long long sum = 0;
    long long o = -1;
    for(int i=0;i<n;i++){
        cin>>a[i];
        sum += a[i];
    }
    cout<<max(m-sum,o);
    }



Measured memory_bytes: 3668
#include <iostream>
#include <cstdio>
#include <cstring>
using namespace std;
const int MAX = 2 * 1e5;
char buffer[MAX + 10];
char arr[MAX + 10];
int d[MAX + 10];
typedef long long ll;
#define debug
int main(int argc, char *argv[]) {
	scanf("%s", buffer);
	int len = strlen(buffer);
	int index = 0;
	int i, j;
	for(i = 0; buffer[i] != 'A'; i++);
	for(j = len - 1; buffer[j] != 'Z'; j--);
	
	cout << j - i + 1 << endl;
	
	
		
}

Measured memory_bytes: 384