akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;
#define REP(i,n) for (int i=0;i<(n);++i)
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
typedef long long ll;
const int INF = 1e9;

int N;
int a[110000];

ll sum = 0;
int m = INF, cnt = 0;

int main(){
    cin >> N;
    REP(i,N){
        cin >> a[i];
        sum += abs(a[i]);
        m = min(m,abs(a[i]));
        if(a[i] < 0) ++cnt;
    }
    if(cnt % 2 == 1){
        cout << sum - m*2 << endl;
    } else {
        cout << sum << endl;
    }

}

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

// 総数を1000000007（素数）で割った余り
const long long mod = 1e9 + 7;

using ll = long long;
using pii  = pair<int, int>;
using pll = pair<ll, ll>;
#define ull unsigned long long
#define ld long double
#define vi vector<int>
#define vll vector<ll>
#define vc vector<char>
#define vs vector<string>
#define vpii vector<pii>
#define vpll vector<pll>

#define rep(i, n) for (int i = 0, i##_len = (n); i < i##_len; i++)
#define rep1(i, n) for (int i = 1, i##_len = (n); i <= i##_len; i++)
#define repr(i, n) for (int i = ((int)(n)-1); i >= 0; i--)
#define rep1r(i, n) for (int i = ((int)(n)); i >= 1; i--)

#define sz(x) ((int)(x).size())
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()

#define SORT(v, n) sort(v, v + n);
#define VSORT(v) sort(v.begin(), v.end());
#define RSORT(x) sort(rall(x));
#define pb push_back
#define mp make_pair

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

ull gcd(ull a, ull b) { return b ? gcd(b, a % b) : a; }
ull lcm(ull a, ull b) { return a / gcd(a, b) * b; }


int main(){
    int s[] = {1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51};
    int k;
    cin >> k;
    cout << s[k-1] << endl;
    return 0;
}


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

int main() {
  int H, W;
  
  while(1) {
    cin >> H >> W;
    if (H == 0 && W == 0) break;
    else {
      for (int i = 0; i < H; i++) {
        for (int j = 0; j < W; j++) {
          if (i%2 == 0 && j%2 == 0) cout << "#";
          else if (i%2 == 1 && j%2 == 1) cout << "#";
          else cout << ".";
        }
        cout << endl;
      }
      cout << endl;
    }
  }
  
  return 0;
}


Measured memory_bytes: 3096
import math
n = int(input())
raw_w = input().split(" ")
w = []
sumTot = 0
min_diff = 10**9
for i in range(0, n):
    w += [int(raw_w[i])]
    sumTot += int(raw_w[i])
s_aux = sumTot
for j in range(0, n-1):
    s_aux -= w[j]
    s_izq = sumTot - s_aux
    if math.fabs(s_aux-s_izq) < min_diff:
        min_diff = int(math.fabs(s_aux-s_izq))
print(min_diff)

Measured memory_bytes: 3064
#include<bits/stdc++.h>
using namespace std;
#define pb  					push_back
#define mp 						make_pair
#define all(v) 					((v).begin()) ,((v).end())
#define let(o,v)				memset(o,v,sizeof (o))
typedef long long 				ll;
typedef vector<int>				vi;
typedef vector<vi>				vvi;
typedef vector<string>			vs;

const int MOD = (int)1e9 + 7;
const int oo = (int)1e9;
const ll OO = (ll)1e18;
const double PI = acos(-1.0);
const int N = (int)1e6 + 9;

bool isprime(int n) {
	if (n <= 1)
		return 0;
	for (int i = 2; i*i <= n; i++)
		if (n%i == 0)
			return false;
}
ll intlog(ll base, ll x) {
	return (log(x) / log(base));
}
bool prime[N];
void primee()
{

	for (int p = 2; p*p <= N; p++)
	{

		if (prime[p] == true)
		{
			for (int i = p * 2; i < N; i += p)
				prime[i] = false;
		}
	}

}
string decToBinary(ll n)
{
	string z = "";
	int i = 0;
	while (n > 0) {

		z += (n % 2) + 48;
		n = n / 2;
		i++;
	}
	reverse(all(z));
	return z;
}
int main()
{
	int a;
	scanf("%d",&a);
	vector<string> v;
	map<string, bool> mpp;
	bool f = 1;
	for (int i = 0; i < a; i++)
	{
		string s;
		cin >> s;
		if (i) {
			if (mpp[s] || s[0] != v.back().back()) f = 0;
		}
		v.pb(s);
		mpp[s] = 1;
	}
	if (f) printf("Yes\n");
	else printf("No\n");
	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <algorithm>
#define ll long long
using namespace std;
int main(){
    string s;
    cin>>s;
    for(int i=0;i<s.length();i++){
        if('1'==s[i]){
            s[i]='9';
        }else{
            s[i]='1';
        }
    }
    cout<<s<<endl;
    return 0;
}

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

#define F first
#define S second
#define MP make_pair
#define pb push_back
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()
#define LCM(a, b) (a) / __gcd((a), (b)) * (b)
#define CEIL(a, b) (a)/(b)+(((a)%(b))?1:0)
#define ln '\n'

using namespace std;
using LL = long long;
using ldouble = long double;
using P = pair<int, int>;
using LP = pair<LL, LL>;

static const int INF = INT_MAX;
static const LL LINF = LLONG_MAX;
static const int MIN = INT_MIN;
static const LL LMIN = LLONG_MIN;
static const int MOD = 1e9 + 7;
static const int SIZE = 200005;

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

vector<LL> Div(LL n) {
    vector<LL> ret;
    for(LL i = 1; i * i <= n; ++i) {
        if(n % i == 0) {
            ret.pb(i);
            if(i * i != n) ret.pb(n / i);
        }
    }
    sort(all(ret));
    return ret;
}

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

    int h, w;
    cin >> h >> w;
    int mp[105][105] = {};
    for(int i = 1; i <= h; ++i) {
        for(int j = 1; j <= w; ++j) {
            char c;
            cin >> c;
            if(c == '#') mp[i][j] = 1;
        }
    }

    bool fh[105] = {}, fw[105] = {};
    for(int i = 1; i <= h; ++i) {
        int s = 0;
        for(int j = 1; j <= w; ++j) {
            s += mp[i][j];

        }
        if(s == 0) fh[i] = true;

    }

    for(int j = 1; j <= w; ++j) {
        int s = 0;
        for(int i = 1; i <= h; ++i) {
            s += mp[i][j];

        }
        if(s == 0) fw[j] = true;
    }

    for(int i = 1; i <= h; ++i) {
        if(fh[i]) continue;
        for(int j = 1; j <= w; ++j) {
            if(fh[i] || fw[j]) continue;
            if(mp[i][j] == 1) cout << '#';
            else cout << '.';

        }
        cout << endl;
    }
    return 0;
}



Measured memory_bytes: 256
//submitted by Himj
#include<bits/stdc++.h>
#define ll long long
#define mod 1000000007
#define pb push_back
#define fi first
#define se second
#define fr(i,s,e) for(i=s;i<e;i++)
#define ms(arr,val) memset(arr,val,sizeof(arr))
using namespace std;

const int mxn=2e5+1;

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

  int t=1;
  //cin>>t;
    while(t--){
      ll n,p,i,j,ans=1;
      cin>>n>>p;
      j=2;
      while(j*j<=p)
      {
        ll cnt=0;
        while(p%j==0)
        {
          p/=j;
          cnt++;
        }
        ans*=pow(j,cnt/n);
        j++;
      }
      if(n==1)
        ans*=p;
      cout<<ans;

      
       
    }
  return 0;
  }



Measured memory_bytes: 256
#include <bits/stdc++.h>
#define _GLIBCXX_DEBUG
#define rep(i,n) for(int i=0;i<(n);++i)
#define repi(i,a,b) for(int i=int(a);i<int(b);++i)
#define all(x) (x).begin(), (x).end()
#define PI 3.14159265358979323846264338327950L
using namespace std;
typedef long long ll;
typedef long double ld;
int main() {
    int n;
    cin>>n;
    vector<int> w(n);
    int all=0,minus=0;
    rep(i,n){
        cin>>w[i];
        all+=w[i];
    }
    int minw=all;
    rep(i,n){
        minus+=w[i];
        minw=min(minw,abs((all-minus)-minus));
    }
    cout<<minw;
}

Measured memory_bytes: 3616
#include<bits/stdc++.h>
#define _ ios_base::sync_with_stdio(0);cin.tie(0);
#define REP(i,n) for(int i=0;i<(int)(n);i++)

using namespace std;


int main(){ _;
  int n,m;cin>>n>>m;
  for(int i=m/n;i>1;i--){
    if(m%i==0&&m/i>=n){
      cout<<i<<endl;
      return 0;
    }
  }
  cout<<1<<endl;
}


Measured memory_bytes: 256
import sys

readline = sys.stdin.readline
readlines = sys.stdin.readlines
ns = lambda: readline().rstrip() # input string
ni = lambda: int(readline().rstrip()) # input int
nm = lambda: map(int, readline().split()) # input multiple int 
nl = lambda: list(map(int, readline().split())) # input multiple int to list

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

    if temp!=1:
        arr.append([temp, 1])

    if arr==[]:
        arr.append([n, 1])

    return arr

n = int(input())
if n == 1:
    print(0)
    exit(0)
factors = factorization(n)

ans = 0
for pair in factors:
    p = pair[0]
    num = pair[1]
    cnt = 1
    while True:
        num -= cnt
        if num < 0:
            break
        cnt += 1
    ans += (cnt-1)
print(ans)

Measured memory_bytes: 9516
#include<bits/stdc++.h>
using namespace std;
int a[1000001],n,m,ans;
int main()
{
	scanf("%d",&n);
	for(int i=1;i<=2*n;i++)
	{
		scanf("%d",&a[i]);
	}
	sort(a+1,a+2*n+1);
	for(int i=1;i<=2*n;i+=2)
	{
		ans+=a[i];
	}
	printf("%d",ans);
	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <cstring>
#include <cmath>

using namespace std;

int main(){
    int n,k;
    int res=0;
    cin >> n >> k;
    for(int i=0;i<n;i++){
        int t;
        cin >>t;
        if(t>=k) res+=1;
    }
    cout << res << endl;
    return 0;
}

Measured memory_bytes: 256
import java.math.BigInteger;
import java.util.Scanner;

public class Main {
  public static void main(String[] args) {
    Scanner scanner = new Scanner(System.in);

    long M = 1_000_000_007;
    int N = scanner.nextInt();
    int[] A = new int[N];
    BigInteger lcm = BigInteger.ONE;
    for (int i = 0; i < N; i++) {
      A[i] = scanner.nextInt();
      lcm = lcm(lcm, BigInteger.valueOf(A[i]));
    }
    lcm = lcm.mod(BigInteger.valueOf(M));
    long res = 0;
    for (int i = 0; i < N; i++) {
      res += lcm.longValue() * inverse(A[i], M) % M;
      res %= M;
    }
    System.out.println(res);
  }

  private static BigInteger gcd(BigInteger i, BigInteger j) {
    if (i.compareTo(j) > 0) return gcd(j, i);
    while (i.compareTo(BigInteger.ZERO) > 0) {
      BigInteger r = j.mod(i);
      j = i;
      i = r;
    }
    return j;
  }

  private static BigInteger lcm(BigInteger i, BigInteger j) {
    return i.divide(gcd(i, j)).multiply(j);
  }

  private static long inverse(long a, long mod) {
    return modpow(a, mod - 2, mod);
  }

  private static long modpow(long a, long n, long mod) {
    long res = 1;
    while (n > 0) {
      if (n % 2 == 1) res = (res * a) % mod;
      a = (a * a) % mod;
      n >>= 1;
    }
    return res % mod;
  }
}


Measured memory_bytes: 151236
#include<bits/stdc++.h>
#define ll long long
#define rep(i,k,n) for(int i=k;i<=n;i++)
using namespace std;
const ll LMOD=1000000007;
char c[100005];
ll n;
ll f[100005][13];
int main()
{
	scanf("%s",c+1);
	while(c[++n]);n--;
	f[0][0]=1;
	for(ll i=1;i<=n;i++)
	{
		if(c[i]!='?')
		{
			for(ll j=0;j<13;j++)
			{
				f[i][(j*10+c[i]-'0')%13]+=f[i-1][j];
				f[i][(j*10+c[i]-'0')%13]%=LMOD;
			}
		}
		else
		{
			for(ll j=0;j<10;j++)
			{
				for(ll k=0;k<13;k++)
				{
					f[i][(k*10+j)%13]+=f[i-1][k];
					f[i][(k*10+j)%13]%=LMOD;
				}
			}
		}
	}
	cout<<f[n][5];
	return 0;
}


Measured memory_bytes: 10496
from collections import defaultdict

N = int(input())

"""
A, Bの桁数でfor文を回して大爆死しました
単純にN以下の自然数で先頭の数がa, 末尾の数がbになる数の個数C[(a, b)]を洗い出しておけば
求める個数は
    ¥Sum_{0<=a, b<=9} C[(a, b)] * C[(b, a)]
"""

C = defaultdict(int)
for i in range(1, N + 1):
    a = int(str(i)[0])
    b = int(str(i)[-1])
    C[(a, b)] += 1

ans = 0
for a in range(10):
    for b in range(10):
        ans += C[(a, b)] * C[(b, a)]

print(ans)


Measured memory_bytes: 40556
#include <bits/stdc++.h>
#include <boost/multiprecision/cpp_int.hpp>

#define repd(i, a, b) for (ll i = (a); i < (b); i++)
#define rep(i, n) repd(i, 0, n)

using namespace std;

namespace mp = boost::multiprecision;
using Bint = mp::cpp_int;

using ll = long long;
ll mod = pow(10, 9) + 7;

template <typename T> void output(T, ll);
ll gcd(ll, ll);
ll lcm(ll, ll);
Bint comb(Bint, Bint);
Bint f(Bint);
void prime_map(map<ll, ll> &, ll);

int main() {
    // source
    int n, m;
    cin >> n >> m;
    if (abs(n - m) > 1) {
        cout << 0 << endl;
        return 0;
    }

    ll ans = 1;
    if (abs(n - m) == 0) {
        repd(i, 1, n + 1) {
            ans *= i;
            ans %= mod;
        }
        repd(i, 1, m + 1) {
            ans *= i;
            ans %= mod;
        }
        ans *= 2;
        ans %= mod;
    } else {
        repd(i, 1, n + 1) {
            ans *= i;
            ans %= mod;
        }
        repd(i, 1, m + 1) {
            ans *= i;
            ans %= mod;
        }
        ans %= mod;
    }
    cout << ans << endl;
    return 0;
}

Bint f(Bint a) {
    Bint ans = 1;
    repd(i, 1, a + 1) { ans *= i; }
    return ans;
}

Bint comb(Bint a, Bint b) {
    Bint ans = 1;

    if (a < b) {
        return 0;
    }

    rep(i, b) {
        ans *= a - i;
        ans /= i + 1;
    }

    return ans;
}

template <typename T> void output(T a, int precision) {
    if (precision > 0) {
        cout << setprecision(precision) << a << "\n";
    } else {
        cout << a << "\n";
    }
}

template <typename T> T min(T a, T b) {

    if (a < b) {
        return a;
    } else {
        return b;
    }
}

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

void prime_map(map<ll, ll> &m, ll num) {
    ll cache = num;
    repd(i, 2, sqrt(num) + 2) {
        if (num % i == 0) {
            if (m[i] == 0) {
                m[i] = 1;
            } else {
                m[i]++;
            }

            num /= i;
            break;
        }
    }

    if (cache == num) {
        if (m[num] == 0) {
            m[num] = 1;
        } else {
            m[num]++;
        }
        return;
    } else {
        prime_map(m, num);
    }
}


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

int main() {
  int X,Y,Z;
  cin >> X >> Y >> Z;
  int cnt = 0;
  while(X >= Y+2*Z){
    cnt += 1;
    X = X-Y-Z;
  }
  cout << cnt << endl;
  return 0;
}

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

#include <algorithm>

using namespace std;

#define sqr(x) ((x) * (x))
#define all(v) (v).begin(), (v).end()
#define rall(v) (v).rbegin(), (v).rend()

typedef long long ll;

const int MOD = 1000000007;
const int INF = 1000000007;
const ll INFLL = 1000000000000000007LL;

void solve() {
  ll N;
  cin >> N;
  ll m = 1;
  for (ll i = 1; i * i <= N; i++) {
    if (N % i == 0) {
      m = max(m, i);
    }
  }
  cout << m + (N / m) - 2 << endl;
}

int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  // cout << fixed << setprecision(12);

  solve();

  return 0;
}


Measured memory_bytes: 256
#include <stdio.h>

int main(void)
{
  	char	c;
  
  	scanf("%c", &c);
  
  	if(c >= 'a' && c<= 'z')
    {
      	printf("a");
      	return (0);
    }
  	else if(c >= 'A' && c <= 'Z')
    {
     	printf("A");
      	return (0);
    }
  	return (0);
}

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

int main(){
  int ans = 1, a, b, c;
  cin >> a >> b >> c;
  
  if (b != a) ans++;
  if (c != a && c!=b) ans++;
  
  cout << ans << endl;
}

Measured memory_bytes: 256
#include <stdio.h>
int main(int argc, char const *argv[])
{
  int n;
  scanf("%d",&n);
  int l[n];
  int i,j,k;
  int c=0;
  int tmp;
  for(i=0;i<n;i++){
    scanf("%d",&l[i]);
  }
  for(i=0;i<n-1;i++){//大きい順
    for(j=i+1;j<n;j++){
      if(l[i]<l[j]){
        tmp=l[i];
        l[i]=l[j];
        l[j]=tmp;
      }
    }
  }
  for(i=0;i<n-2;i++){
    for(j=i+1;j<n-1;j++){
      for(k=j+1;k<n;k++){
        if(l[i]<l[j]+l[k]) c++;
        else break;
      }
    }
  }
  printf("%d",c);
  return (0);
}

Measured memory_bytes: 128
let group1 = [1;3;5;7;8;10;12]
let group2 = [4;6;9;11]
let group3 = [2]

let _ = Scanf.sscanf (read_line()) "%d %d" (fun x y ->
  if x = y then "Yes" else 
  if List.exists (fun a -> a = x) group1 && List.exists (fun a -> a = y) group1 then "Yes" else 
  if List.exists (fun a -> a = x) group2 && List.exists (fun a -> a = y) group2 then "Yes" else
  if List.exists (fun a -> a = x) group3 && List.exists (fun a -> a = y) group3 then "Yes" else "No"
) |> print_endline

Measured memory_bytes: 384
class UnionFind {
  constructor(n) {
    this.p = new Array(n).fill(null).map((_, i) => i)
    this.height = new Array(n).fill(0)
    this.size = new Array(n).fill(1)
  }

  unite(a, b) {
    this.link(this.findSet(a), this.findSet(b))
  }

  link(a, b) {
    if (a === b) return null

    if (this.height[a] > this.height[b]) {
      this.p[b] = a
      this.size[a] += this.size[b]
    } else {
      this.p[a] = b
      this.size[b] += this.size[a]

      if (this.height[a] === this.height[b]) this.height[b]++
    }
  }

  findSet(x) {
    if (this.p[x] === x) return x
    return this.findSet(this.p[x])
  }
}


const main = (input) => {
  const [t, ...q] = input.trim().split('\n')
  const [n,] = t.split(' ').map(Number)

  const uf = new UnionFind(n)

  for (let i=0; i<q.length; i++) {
    const [a, b] = q[i].split(' ').map(Number)
    uf.unite(a-1, b-1)
  }

  const ans = {}
  for (let i=0; i<n; i++) {
    ans[uf.findSet(i)] = 1
  }

  return console.log(Object.keys(ans).length - 1)
  // return console.log(Array.from(new Set(uf.p)).length - 1)
}

process.env.MYTEST
  ? (process.env.MYTEST === 'test' ? test() : main(require('fs').readFileSync('dev/stdin', 'utf8')))
  : main(require('fs').readFileSync('/dev/stdin', 'utf8'))

Measured memory_bytes: 64048
#include<iostream>
#include<vector>
#include<bits/stdc++.h>
#include<sstream>
using namespace std;
int main()
{	
	string s;
	vector<char> vec;
	char charac;
	cin>>s;
	istringstream stream(s);
	while (stream >> charac)
        vec.push_back(charac);
        
    if(vec[2]==vec[3]&&vec[4]==vec[5])
    {
    	cout<<"Yes";
	}
	else
	{
		cout<<"No";
	}
	return 0;
}

Measured memory_bytes: 256
#62c
import math
H,W = map(int, input().split())

#分け方は
#横 のみで分割
#縦 のみで分割
#縦→横 分割
#横→縦 分割　の4通り

devided = [[1,1],[1,1],[1,1]]
ans = H * W

def devision(dividend,divisor): #割られる数、割る数
    over = math.ceil(dividend/divisor)
    under = dividend//divisor
    
    if over == under:
        return over
    else:
        if abs(dividend/divisor - over) < abs(dividend/divisor - under):
            return over
        else:
            return under

        
def calc_ans(list_of_devided):   
    a = devided[0][0] * devided[0][1]
    b = devided[1][0] * devided[1][1]
    c = devided[2][0] * devided[2][1]
    #print(list_of_devided,a,b,c)
    
    if 0 in [a,b,c]:
        #print(H*W)
        return H*W
    else:
        #print(max(a,b,c) - min(a,b,c))
        return max(a,b,c) - min(a,b,c)

#横分割 ＝
devided[0][1] = W
devided[1][1] = W
devided[2][1] = W
devided[0][0] = devision(H,3)
devided[1][0] = devision(H - devided[0][0],2)
devided[2][0] = H - devided[0][0] - devided[1][0]
if ans > calc_ans(devided):
    ans = calc_ans(devided)
    
#縦分割 ||
devided[0][1] = devision(W,3)
devided[1][1] = devision(W - devided[0][1],2)
devided[2][1] = W - devided[0][1] - devided[1][1]
devided[0][0] = H
devided[1][0] = H
devided[2][0] = H
if ans > calc_ans(devided):
    ans = calc_ans(devided)
    
#縦→横 分割　├　
devided[0][1] = devision(W,3)
devided[0][0] = H
devided[1][1] = W - devided[0][1]
devided[2][1] = W - devided[0][1]
devided[1][0] = devision(H,2)
devided[2][0] = H - devided[1][0]
if ans > calc_ans(devided):
    ans = calc_ans(devided)
    
#横→縦　分割 ┬
devided[0][1] = W
devided[0][0] = devision(H,3)
devided[1][0] = H - devided[0][0]
devided[2][0] = H - devided[0][0]
devided[1][1] = devision(W,2)
devided[2][1] = W - devided[1][1]
if ans > calc_ans(devided):
    ans = calc_ans(devided)

print(ans)

Measured memory_bytes: 3192
import java.io.*;
import java.util.*;
import java.math.*;
class Main{
    public static void main(String[] args){
	BufferedReader sc=new BufferedReader(new InputStreamReader(System.in));
	try {
	    int n = Integer.valueOf(sc.readLine());
	    for(int i=0; i<n; i++){
		String[] st = sc.readLine().split(":");
		double a = Double.valueOf(st[0]);
		double b = Double.valueOf(st[1]);
		a = (a+b/60.0)*30.0;
		b *= 6.0;
		double c = Math.abs(a-b);
		if(c>180.0)
		    c = 360.0-c;
		if(c<30.0)
		    System.out.println("alert");
		else if(c<90.0)
		    System.out.println("warning");
		else
		    System.out.println("safe");
	    }
	}catch(Exception e){
	    System.out.println("Error");
	}
    }
}

Measured memory_bytes: 10000
#include "bits/stdc++.h"
using namespace std;

#define ll long long
#define rep(i,n) for(int i = 0;i < (n); i++)

int main() {
	string s;
	int q;
	int t, f;
	bool b = false;
	string c;
	cin >> s;
	cin >> q;
	rep(i, q) {
		cin >> t;
		if (t == 1) {
			if (b == false)b = true;
			else b = false;
		}
		else {
			cin >> f >> c;
			if ((f == 1 && b == false) || (f == 2 && b == true))s.insert(0, c);
			else s.insert(s.length(), c);
		}
	}
	if (b == true)reverse(s.begin(), s.end());
	cout << s << endl;

	return 0;
}

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

// definitions
#define F first
#define S second
#define all(x) x.begin(), x.end()
#define clr(x) memset(x, 0, sizeof(x))
#define rep(i, l, r) for (long long i = (l); i < (long long)(r); i++)
#define repb(i, r, l) for (long long i = (r); i > (long long)(l); i--)
#define pb push_back
#define pf push_front
#define mod1 998244353
#define mod 1000000007
#define MAX_CHAR 256


using namespace std;
typedef vector<long long> vl;
typedef vector<char> vc;
typedef vector<string> vs;
typedef vector< pair<long long, long long> > vp;
typedef vector<tuple<long long , long long , long long> > vtup;
typedef deque <long long> dql;
typedef deque <char> dqc;
typedef long double ld;
typedef long long ll;
typedef unsigned long long ull;


// prevent collisions in unordered_map
struct custom_hash {
    static uint64_t splitmix64(uint64_t x) {
        x += 0x9e3779b97f4a7c15;
        x = (x ^ (x >> 30)) * 0xbf58476d1ce4e5b9;
        x = (x ^ (x >> 27)) * 0x94d049bb133111eb;
        return x ^ (x >> 31);
    }

    size_t operator()(uint64_t x) const {
        static const uint64_t FIXED_RANDOM = chrono::steady_clock::now().time_since_epoch().count();
        return splitmix64(x + FIXED_RANDOM);
    }
};

typedef unordered_map <long long, long long, custom_hash> umap;


// standard functions
ll mystoi(string str)
{
    stringstream ss(str);
    ll ans=0;
    ss >> ans;

    return ans;
}


ll exp(ll x, ll ex) {
    ll ans = 1ll;
    while (ex > 0) {
        if (ex & 1ll) ans = (ans * x);
        ex >>= 1ll;
        x = (x * x);
    }
    return ans;
} 
 
ll nCrModp(ll n, ll r, ll p) 
{ 
    ll C[r+1]; 
    memset(C, 0, sizeof(C)); 
  
    C[0] = 1; 
    for (ll i = 1; i <= n; i++) 
    { 
        for (ll j = min(i, r); j > 0; j--) 
            C[j] = (C[j] + C[j-1])%p; 
    } 
    return C[r]; 
}
 
bool isPrime(ll n) 
{ 
    if (n <= 1)  return false; 
    if (n <= 3)  return true;  
    if (n%2 == 0 || n%3 == 0) return false; 
  
    for (ll i=5; i*i<=n; i=i+6) 
        if (n%i == 0 || n%(i+2) == 0) 
           return false; 
  
    return true; 
}

bool sort_cond(const pair<ll,ll> &a, const pair <ll,ll> &b)
{
    return a.second > b.second;
}

const ll MAXSIEVE=(1e3+5);
ll spf[MAXSIEVE];
void sieve() 
{ 
    spf[1] = 1; 
    for (ll i=2; i<MAXSIEVE; i++) 
        spf[i] = i; 

    for (ll i=4; i<MAXSIEVE; i+=2) 
        spf[i] = 2; 
  
    for (ll i=3; i*i<MAXSIEVE; i++) 
    { 
        if (spf[i] == i) 
        { 
            for (ll j=i*i; j<MAXSIEVE; j+=i) 
                if (spf[j]==j) 
                    spf[j] = i; 
        } 
    } 
}


// code beigns in main
int main()
{

    
    
    ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
    ll t=1;
    // cin >> t;
    
    while(t--)
    {
        ll m,n;
        cin >> m >>n;

        cout << nCrModp(m, 2, 1e18)+nCrModp(n,2,1e18) << endl;
    }
}


Measured memory_bytes: 256
#include<iostream>
using namespace std;
int main(){
	int x,y;
	for(int i=1;i<=3000;i++){
		cin>>x>>y;
		  if(x==0&&y==0){
			   i=10000;
		  }
		  else if(x>y){
			   cout<<y<<" "<<x<<endl;
		  }
		  else{
			   cout<<x<<" "<<y<<endl;
		  }
	}
}



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

int main() {
  int x;
  int a;
  cin >> x ;
  a = x % 10 ;
  if(a==3){
    cout << "bon" << endl;
  }
  else if(a==0 || a==1 || a==6 || a==8){
    cout << "pon" << endl;
  }
  else if(a==2 || a==4 || a==5 || a==7 || a==9){
    cout << "hon" << endl;
  }
}

Measured memory_bytes: 3640
package main

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

func main() {
	S := nextBytes()

	c := 0

	for i := 0; i < len(S); i++ {
		c += int(S[i] - '0')
		c = c % 9
	}

	if c == 0 {
		fmt.Println("Yes")
	} else {
		fmt.Println("No")
	}
}

var stdin = initStdin()

func initStdin() *bufio.Scanner {
	bufsize := 1 * 1024 * 1024 // 1 MB
	var stdin = bufio.NewScanner(os.Stdin)
	stdin.Buffer(make([]byte, bufsize), bufsize)
	stdin.Split(bufio.ScanWords)
	return stdin
}

func nextString() string {
	stdin.Scan()
	return stdin.Text()
}

func nextBytes() []byte {
	stdin.Scan()
	return stdin.Bytes()
}

func nextInt() int {
	i, _ := strconv.Atoi(nextString())
	return i
}

func nextInt64() int64 {
	i, _ := strconv.ParseInt(nextString(), 10, 64)
	return i
}

func debug(args ...interface{}) {
	fmt.Fprintln(os.Stderr, args)
}


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

int main(){
  int n,i,j,k,cn,cn2;
  cin >> n;
  string s[n];
  char x,y;
  for(i=0;i<n;i++)cin >> s[i];
  for(i=0;i<n;i++)sort(s[i].begin(),s[i].end());
  for(x='a';x<='z';x++){
    cn = 346;
    for(i=0;i<n;i++){
      cn2 = 0;
      for(j=0;j<s[i].size();j++){
        if(s[i][j]==x)cn2++;
      }
      cn = min(cn,cn2);
    }
    for(i=0;i<cn;i++)cout << x;
  }
  cout << endl;
  return 0;
}


Measured memory_bytes: 256
//Hey u r too far away to know this
//CHIRAGA196
#include <bits/stdc++.h>
using namespace std;
#define     ff                  first
#define     pb                  push_back
#define     ss                  second
#define     IOS                 ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define     all(v)              v.begin(), v.end()
#define     allr(v)             v.rbegin(), v.rend()
#define       int               long long
#define       endl             '\n'
const   int N = 1e6+5, Mod = 1e9 + 7;
int32_t main(){
        IOS;
       
        int n; cin >> n;
        vector<int> v(n);
        for(auto &x:v)
            cin >> x;
        vector<int> a(1000005, 0);
        int anss = 1;
        for(int i = 0; i < n; i++){
            int x = v[i];
            int l = v[i];
            for(int j = 1; j * j <= l; j++){

                if(v[i]%j == 0){
                    if(a[j] == 0){
                        a[j] = 1;
                    }
                    else{
                       if(j != 1){
                        anss = 0;
                        break;}
                    }
                    int rr = v[i]/j;
                    if(rr == 1)
                        continue;
                    if(j != rr){
                        if(a[rr] == 0)
                            a[rr] = 1;
                        else {
                            anss = 0;
                            break;
                        }
                    }
                }
            }
            if(anss == 0)
                break;
        }
        if(anss){
            cout << "pairwise coprime";
            return 0;
        }
        int ansr = v[0];
        for(int i = 0; i < n; i++)
            ansr = __gcd(ansr, v[i]);

        if(ansr == 1){
            cout << "setwise coprime";
            return 0;
        }
        cout << "not coprime";
        return 0;
}

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

int main()
{
    int N;
    string S;
    bool flg = false;
    cin>>N;
    for(int i=0;i<N;i++){
        cin>>S;
        if(S == "Y"){
            flg = true;
        }
    }
    if(flg){
        cout<<"Four"<<endl;
    }else{
        cout<<"Three"<<endl;
    }
}

Measured memory_bytes: 256
#include<stdio.h>

#define NIL NULL

struct node
{
  struct node *right;
  struct node *left;
  struct node *parent;
  int key;
};

typedef struct node * Node;

Node root;

Node treeMinimum(Node x)
{
  while(x->left != NIL)
    {
      x = x->left;
    }
  
  return x;
}

Node treeMaximum(Node x)
{
  while(x->right != NIL)
    {
      x = x->right;
    }
  
  return x;
}

Node treeSearch(Node u, int k)
{
  if(u == NIL || k == u->key) return u;
  if(k < u->key) return treeSearch(u->left,k);
  else return treeSearch(u->right,k);

}

Node treeSuccessor(Node x)
{
  Node y;
  
  if(x->right != NIL)
    {
      return treeMinimum(x->right);
    }
  y = x->parent;

  while(y != NIL && x == y->right)
    {
      x = y;
      y = y->parent;
    }
  
  return y;
}

void treeDelete(Node z){
  Node y; // node to be deleted
  Node x; // child of y

  if(z->left == NIL || z->right == NIL) y = z; //z にどちらかの子がいないなら(case 1,2)
  else y = treeSuccessor(z); //それ以外(case 3)なら次節点を探す

  if(y->left != NIL) x = y->left;  //y に左の子がいるなら x に代入
  else x = y->right; //それ以外なら x に y の右の子を代入

  if(x != NIL) x->parent = y->parent; //y が葉なら(case 1)

  if(y->parent == NIL) root = x; //y がrootなら
  else if(y == y->parent->left) y->parent->left = x; //y が左の子なら(case 2)
  else y->parent->right = x; //(case 2)

  if(y != z) z->key = y->key; //(case 3)
  
  return;
}

void insert(int k){
  Node y = NIL;
  Node x = root;
  Node z;

  z = malloc(sizeof(struct node));
  z->key = k;
  z->left = NIL;
  z->right = NIL;

  while(x != NIL)
    {
      y = x;

      if(z->key < x->key)
	{
	  x = x->left;
	}
      else
	{
	  x = x->right;
	}
    }
  z->parent = y;

  if(y == NIL)
    {
      root = z;
    }
  else if(z->key < y->key)
    {
      y->left = z;
    }
  else
    {
      y->right = z;
    }

  return;
}

void inorder(Node u)
{
  if(u == NIL) return;

  inorder(u->left);
  printf(" %d",u->key);
  inorder(u->right);

  return;
}
void preorder(Node u)
{
  if(u == NIL) return;

  printf(" %d",u->key);
  preorder(u->left);
  preorder(u->right);

  return;
}


int main(){
  int n, i, x;
  char com[20];
  scanf("%d", &n);

  for ( i = 0; i < n; i++ ){
    scanf("%s", com);
    if ( com[0] == 'f' ){
      scanf("%d", &x);
      Node t = treeSearch(root, x);
      if ( t != NIL ) printf("yes\n");
      else printf("no\n");
    } else if ( com[0] == 'i' ){
      scanf("%d", &x);
      insert(x);
    } else if ( com[0] == 'p' ){
      inorder(root);
      printf("\n");
      preorder(root);
      printf("\n");
    } else if ( com[0] == 'd' ){
      scanf("%d", &x);
      treeDelete(treeSearch(root, x));
    }
  }

  return 0;
}



Measured memory_bytes: 20460
#include <algorithm>
#include <cstdio>
#include <iostream>
#include <map>
#include <cmath>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
#include <stdlib.h>
#include <stdio.h>
using namespace std;

#define ll         long long
#define PI         acos(-1.0)
#define FOR(I,A,B) for(int I = (A); I < (B); ++I)

int main(){
    string s, p;
    getline(cin, s);
    getline(cin, p);
    s = s + s;
    FOR(i, 0, s.length()){
        int len = 0;
        FOR(k, 0, p.length()) if(p[k]==s[i+k]) len++;
        if(len==p.length()){
            cout << "Yes" << endl;
            return 0;
        }
    }
    cout << "No" << endl;
}

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

// #include <ext/pb_ds/assoc_container.hpp>
// #include <ext/pb_ds/tree_policy.hpp>

using namespace std;
// using namespace __gnu_pbds;

typedef long long ll;
typedef long double ld;
typedef unsigned int uint;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<vi> vvi;
typedef vector<vl> vvl;
typedef pair<int, int> pii;
typedef map<int, int> mpii;
typedef set<int> seti;

const int mxN = 2e5, iinf = 1e9 + 10, inf = 1e18 + iinf + 10, mod = 1000000007;
const ld pi = 4.0 * atanl(1.0), prec = .000001;

#define f first
#define s second
#define pb push_back
#define mp make_pair
#define all(c) c.begin(), c.end()
#define rall(c) c.end(), c.begin()
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)

int n, m, t, a[mxN];

void fast() { ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0); }

int main() {
  fast();
  cin >> n >> m;
  string s;
  cin >> s;
  if (s.size() < n + m + 1) {
    cout << "No";
    return 0;
  }
  if (s[n] != '-') {
    cout << "No";
    return 0;
  }
  for (int i = 0; i < s.size(); ++i) {
    if (i != n) {
      if (!isdigit(s[i])) {
        cout << "No";
        return 0;
      }
    }
  }
  cout << "Yes";

  return 0;
}



Measured memory_bytes: 3588
#define _USE_MATH_DEFINES
#include <iostream>
#include <string>
#include <list>
#include <vector>
#include <queue>
#include <algorithm>
#include <climits>
#include <cstring>
#include <cmath>
#include <stack>
#include <iomanip>
#include <tuple>
#include <functional>
#include <cfloat>
#include <map>
#include <set>
#include <array>
#include <stdio.h>
#include <string.h>
using ll = long long;
using namespace std;
//LLONG_MAX = 90^18
#define int long long
#define CONTAINS(v,n) (find((v).begin(), (v).end(), (n)) != (v).end())
#define SORT(v) sort((v).begin(), (v).end())
#define RSORT(v) sort((v).rbegin(), (v).rend())
#define ARY_SORT(a, size) sort((a), (a)+(size))
#define REMOVE(v,a) (v.erase(remove((v).begin(), (v).end(), (a)), (v).end()))
#define REVERSE(v) (reverse((v).begin(), (v).end()))
#define ARY_REVERSE(v,a) (reverse((v), (v)+(a)))
#define LOWER_BOUND(v,a) (lower_bound((v).begin(), (v).end(), (a)))
#define UPPER_BOUND(v,a) (upper_bound((v).begin(), (v).end(), (a)))
#define REP(i, n) for (int (i)=0; (i) < (n); (i)++)
#define CONTAINS_MAP(m, a) (m).find((a)) != m.end()
void YesNo(bool b) { cout << (b ? "Yes" : "No"); }
void Yes() { cout << "Yes"; }
void No() { cout << "No"; }
//max_element

int N, M;
int S[10];
int C[10];

signed main()
{
	cin >> N >> M;
	REP(i, M)
	{
		cin >> S[i] >> C[i];
	}

	int start = pow(10, N - 1);
	if (N == 1) start = 0;
	int end = pow(10, N);
	for (int i = start; i < end; i++)
	{
		bool is_good = true;
		for (int j = 0; j < M; j++)
		{
			if (N == 1)
			{
				if (S[j] == 1 && (i % 10 != C[j])) is_good = false;
			}
			if (N == 2)
			{
				if (S[j] == 2 && (i % 10 != C[j])) is_good = false;
				if (S[j] == 1 && ((i / 10 % 10) != C[j])) is_good = false;
			}
			if (N == 3)
			{
				if (S[j] == 3 && (i % 10 != C[j])) is_good = false;
				if (S[j] == 2 && ((i / 10 % 10) != C[j])) is_good = false;
				if (S[j] == 1 && ((i / 100 % 10) != C[j])) is_good = false;
			}
		}
		if (is_good)
		{
			cout << i << endl;
			return 0;
		}
	}

	cout << -1 << endl;
}




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

#define rep(i, n) for (int i = 0; i < (n); ++i)
#define rrep(i, n) for (int i = 1; i <= (n); ++i)
#define drep(i, n) for (int i = (n)-1; i >= 0; --i)
#define ddrep(i, n) for (int i = n; i > 0; --i)
#define srep(i, s, t) for (int i = s; i < t; ++i)
#define ssrep(i, s, t) for (int i = s; i <= t; ++i)
#define chmax(x, y) (x = max(x, y))
#define chmin(x, y) (x = min(x, y))

using ll = long long;
using pi = pair<int, int>;
using vi = vector<int>;
using vvi = vector<vi>;
using vl = vector<ll>;
using vvl = vector<vl>;
using ld = long double;
using str = string;

#define rng(a) a.begin(), a.end()
#define rrng(a) a.rbegin(), a.rend()
#define pb push_back
#define eb emplace_back
#define fi first
#define se second

long int M = 1e+9+7;
int inf = 1e+9;

int main(void){
    cin.tie(0);
    ios::sync_with_stdio(false);
    cout << std::setprecision(10);

    int a,p;
    cin >> a >> p;
    cout << ((a*3)+p)/2 << endl;
    return 0;
}

Measured memory_bytes: 256
# -*- coding: utf-8 -*-
import sys
sys.setrecursionlimit(10**9)
INF=10**18
MOD=10**9+7
input=lambda: sys.stdin.readline().rstrip()
YesNo=lambda b: bool([print('Yes')] if b else print('No'))
YESNO=lambda b: bool([print('YES')] if b else print('NO'))
int1=lambda x:int(x)-1

def main():
    N=int(input())
    a=list(map(int,input().split()))
    
    class BIT:
        def __init__(self,n):
            self.num=n
            self.dat=[0]*(self.num+1)
            self.depth=n.bit_length()
        
        def add(self,i,x):
            i+=1
            while i<=self.num:
                self.dat[i]+=x
                i+=i&-i
        
        def sum(self,i):
            i+=1
            s=0
            while i>0:
                s+=self.dat[i]
                i-=i&-i
            return s
        
        def lower_bound(self,x):
            sum_=0
            pos=0
            for i in range(self.depth,-1,-1):
                k=pos+(1<<i)
                if k<=self.num and sum_+self.dat[k]<x:
                    sum_+=self.dat[k]
                    pos+=1<<i
            return pos, sum_
    
    def nibutan(ok,ng):
        while abs(ok-ng) > 1:
            mid = (ok + ng) // 2
            if solve(mid):
                ok = mid
            else:
                ng = mid
        return ok
    
    def solve(mid):
        aa=[1 if x>=mid else -1 for x in a]
        b=BIT(N*2+1)
        c=0
        s=N
        b.add(s,1)
        for x in aa:
            s+=x
            c+=b.sum(s)
            b.add(s,1)
        return c>=-(-N*(N+1)//2//2)
    
    print(nibutan(1,10**9+1))

if __name__ == '__main__':
    main()


Measured memory_bytes: 119832
#include <iostream>
#include <stdio.h>
#include <string>
#include <vector>
#include <set>
#include <cmath>
#include <algorithm>
#define MP make_pair
using ll = long long;
using namespace std;

int main()
{
  ll N;
  cin >> N;
  vector<ll>A(N);
  int zero = 0;
  int one = 0;
  int two = 0;
  for(int i=0; i < N; i++){
    cin >> A[i];
    if(A[i] % 4 == 0){
      two++;
    }else if(A[i] % 2 == 0){
      one++;
    }else{
      zero++;
    }
  }
  //cout << zero << " " << one << " " << two << endl;
  if(one == 0){
    if(zero-1 > two)
      cout << "No" << endl;
    else
      cout << "Yes" << endl;
  }else if(two == 0){
    if(one < 2 || zero > 0)
      cout << "No" << endl;
    else
      cout << "Yes" << endl;
  }else if(zero == 0){
    cout << "Yes" << endl;
  }else{
    if(zero > two)
      cout << "No" << endl;
    else
      cout << "Yes" << endl;
  }
  return 0;
}


Measured memory_bytes: 1024
#include<iostream>
#include<vector>
#include<cmath>
#include<algorithm>
#include<utility>
#include<map>
#include<set>
#include<string>

using namespace std;
#define ll long long

int main(){
    ll A,B,C,D,tmp;
    ll c,d;
    ll ans = 0;
    ll sumC = 0, sumD = 0, sumCD = 0;
    cin >> A >> B >> C >> D;
    ll x = C * D;
    c = C;
    d = D;
 
    /* 自然数 a > b を確認・入替 */
    if(C < D){
        tmp = C;
        C = D;
        D = tmp;
    }
    /* ユークリッドの互除法 */
    ll r = C % D;
    while(r!=0){
        C = D;
        D = r;
        r = C % D;
    }
    ll CD = x / D;

    // cout << CD <<endl;
    // cout << c << d << endl;
    sumC = B/c - A/c;
    sumD = B/d - A/d;
    sumCD = B/CD - A/CD;
    if(A%c == 0)sumC++;
    if(A%d == 0)sumD++;
    if(A%CD == 0)sumCD++;
    // for(ll i = A; i <= B; i++){
    //     cout << "あまり" << i << endl;
    //     cout << i%c << i%d << i%CD<<endl;
    //     if(i % c == 0)sumC++;
    //     if(i % d == 0)sumD++;
    //     if(i % CD == 0)sumCD++;
    // }
    // cout << sumC << sumD << sumCD << endl;
    ans = B - A + 1 - sumC -sumD + sumCD;
    cout << ans << endl;
}

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 = sc.nextLong();
		long b = sc.nextLong();
		long c = sc.nextLong();
		long k = sc.nextLong();
		
		long sum = 0;
		
		
		if(k <= a) {
			System.out.println(k);
		}else if(k <= a + b) {
			System.out.println(a);
		}else if(k <= a + b + c) {
			System.out.println(a - ( k - a -b));
		}else {
			System.out.println((a -b));
		}
	}
}

Measured memory_bytes: 27000
#include<bits/stdc++.h>
using namespace std;
#define pb push_back
typedef long long ll;
const int M=2e5+4;
const int inf=0x3f3f3f3f;
const ll INF=1e18;
int b[M];

int main(){
    ll n,k;
    cin>>n>>k;
    n-=(n/k)*k;
    cout<<min(n,k-n);
    return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <queue>
#include <algorithm>
using namespace std;
#define rep(i, n)for(int i=0; i<n; i++)

int main(){
  long long A;
  string B;
  cin >> A >> B;
  //入力終わり

  //小数点を飛ばす
  //100倍して考える．最後に100で割る
  B.erase(1, 1);

  //stringをintに変換
  int B_ = atoi(B.c_str() );

  //100倍の帳尻合わせ
  cout << A * B_ / 100 << endl;

  return 0;
}


Measured memory_bytes: 3596
#include<bits/stdc++.h>
#define maxn 300100
using namespace std;
typedef pair<int,int> par;
struct data{int l,r,w,x,y;int operator<(const data& d)const{return w>d.w;}};
priority_queue<data>pq;
int n,a[2][maxn>>1];
par s[2][19][maxn>>1];
par qry(int d,int l,int r){
	int len=1,k=0;
	l=(l+1)>>1,r=(r+1)>>1;
	while((len<<1)<r-l+1)len<<=1,k++;
	return min(s[d][k][l],s[d][k][r-(1<<k)+1]);
}
data get(int l,int r){
	par a1=qry(l&1,l,r-1);
	par b1=qry(~l&1,a1.second+1,r);
	data d;
	d.l=l,d.r=r,d.w=a1.first;
	d.x=a1.second,d.y=b1.second;
	return d;
}
int main(){
	scanf("%d",&n);
	for(int i=1;i<=n;++i)
		scanf("%d",&a[i&1][(i+1)>>1]);
	memset(s,0x3f,sizeof(s));
	for(int d=0;d<2;++d){
		for(int i=1;i<=((n+1)>>1);++i)s[d][0][i]=par(a[d][i],(i<<1)-d);
		for(int i=1;i<19;++i)
			for(int j=1;j<=((n+1)>>1);++j)
				s[d][i][j]=min(s[d][i-1][j],s[d][i-1][j+(1<<i-1)]);
	}
	pq.push(get(1,n));
	while(pq.size()){
		data ret=pq.top();pq.pop();
//		printf("[%d,%d(%d,%d)]",ret.l,ret.r,ret.x,ret.y);
		printf("%d %d ",a[ret.x&1][(ret.x+1)>>1],a[ret.y&1][(ret.y+1)>>1]);
		if(ret.l<=ret.x-1)pq.push(get(ret.l,ret.x-1));
		if(ret.x+1<=ret.y-1)pq.push(get(ret.x+1,ret.y-1));
		if(ret.r>=ret.y+1)pq.push(get(ret.y+1,ret.r));
	}
}

Measured memory_bytes: 47860
#include <bits/stdc++.h>
#define ALL(obj) begin(obj), end(obj)
#define debug(x) cerr << #x << ": " << x << '\n'
using namespace std;
template <class T>
vector<T> make_vec(size_t a) {
    return vector<T>(a);
}
template <class T, class... Ts>
auto make_vec(size_t a, Ts... ts) {
    return vector<decltype(make_vec<T>(ts...))>(a, make_vec<T>(ts...));
}
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;
}

using ll = long long;
using ull = unsigned long long;
const int INF = 1e9;
// const int MOD = 1e9 + 7;

vector<vector<int>> G;
vector<ll> cnt;

void dfs(int v = 0, int p = -1, ll add = 0) {
    cnt[v] += add;
    for (auto u : G[v]) {
        if (u != p) {
            dfs(u, v, cnt[v]);
        }
    }
}

int main() {
    int N, Q;
    cin >> N >> Q;
    G.resize(N);
    cnt.assign(N, 0);
    for (int i = 0; i < N - 1; i++) {
        int a, b;
        cin >> a >> b;
        a--, b--;
        G[a].push_back(b);
        G[b].push_back(a);
    }
    for (int i = 0; i < Q; i++) {
        int p, x;
        cin >> p >> x;
        p--;
        cnt[p] += x;
    }
    dfs();
    for (int i = 0; i < N; i++) {
        cout << cnt[i];
        if (i != N - 1) cout << " ";
    }
    cout << endl;
}


Measured memory_bytes: 24320
#include <stdio.h>

int main(void) {
	int N, i;
	int HorieYui = 0;
	int HayamiSaori = 1;
	if (scanf("%d", &N) != 1) return 1;
	for (i = 0; i < N; i++) {
		char YusaKouzi[12];
		if(scanf("%s", YusaKouzi) != 1) return 1;
		if (YusaKouzi[0] == 'A') HorieYui++; else HorieYui--;
		if (HorieYui < 0) HayamiSaori = 0;
	}
	puts(HorieYui == 0 && HayamiSaori ? "YES" : "NO");
	return 0;
}

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

int main(){
  string str;
  cin>>str;
  string tmp="";
  
  for(char ch:str){
    if(ch!='A')tmp+=ch;
  }
  
  if(tmp!="KIHBR"){
    cout<<"NO"<<endl;
    return 0;
  }
  
  int kk=str.find('K');
  int ii=str.find('I');
  int hh=str.find('H');
  int bb=str.find('B');
  int rr=str.find('R');
  //  cout<<kk<<' '<<ii<<' '<<hh<<' '<<bb<<' '<<rr<<' '<<str.size()<<endl;
  
  if(kk>1 || ii-kk>1 || hh-ii>1 || bb-hh>2 || rr-bb >2 ||(int)str.size()-rr>2)cout<<"NO"<<endl;
  else cout<<"YES"<<endl;
  return 0;
}


Measured memory_bytes: 256
#include<cstdio>
#include<cmath>
#include<iostream>
#include<algorithm>
#include<cstring>
using namespace std;
#define ll long long
ll n,num[1000005],sum,ans=0;
int main()
{
	scanf("%lld",&n);
	for(int i=1;i<=n;i++)
	{
		scanf("%lld",&num[i]);
		sum+=num[i];
	}
	if(sum%((n+1)*n/2)){printf("NO");return 0;}
	sum/=(n+1)*n/2;int tmp=num[1];
	for(int i=1;i<n;i++)
	{
		num[i]-=num[i+1];
	}num[n]-=tmp;
	for(int i=1;i<=n;i++)
	{
		if(num[i]<-sum||(num[i]+sum)%n)
		{printf("NO");return 0;}
		ans+=(sum+num[i])/n;
	}
	if(ans==sum)printf("YES");
	else printf("NO");
	return 0;
}

Measured memory_bytes: 4568
// 基本テンプレート

#include <iostream>
#include <iomanip>
#include <cstdio>
#include <string>
#include <cstring>
#include <deque>
#include <list>
#include <queue>
#include <stack>
#include <vector>
#include <utility>
#include <algorithm>
#include <map>
#include <set>
#include <complex>
#include <cmath>
#include <limits>
#include <cfloat>
#include <climits>
#include <ctime>
#include <cassert>
#include <numeric>
#include <functional>
using namespace std;

#define rep(i,a,n) for(int (i)=(a); (i)<(n); (i)++)
#define repq(i,a,n) for(int (i)=(a); (i)<=(n); (i)++)
#define repr(i,a,n) for(int (i)=(a); (i)>=(n); (i)--)
#define int long long int

template<typename T> void chmax(T &a, T b) {a = max(a, b);}
template<typename T> void chmin(T &a, T b) {a = min(a, b);}
template<typename T> void chadd(T &a, T b) {a = a + b;}

typedef pair<int, int> pii;
typedef long long ll;

int dx[] = {0, 0, 1, -1};
int dy[] = {1, -1, 0, 0};
constexpr ll INF = 1001001001001001LL;
constexpr ll MOD = 1000000007LL;
constexpr ll BIN = (ll)1e16;

int N, a[60];

signed main() {
    /*
    random_device rnd;
    mt19937 rand_src(rnd());

    N = rand_src() % 50 + 1;
    rep(i,0,N) {
        a[i] = rand_src() % BIN + 1001;
        printf("show(%lld) = %lld\n", i, a[i]);
    }
    */

    
    cin >> N;
    rep(i,0,N) cin >> a[i];
    
    int ans = 0;
    while(1) {
        rep(i,0,N) {
            if(a[i] < N) continue;
            int diff = a[i] - (N-1);
            int cnt = (diff - 1) / N + 1;
            ans += cnt;
            a[i] -= N * cnt;
            rep(j,0,N) {
                if(i != j) a[j] += cnt;
            }
        }
        bool ok = true;
        rep(i,0,N) {
            if(a[i] >= N) ok = false;
        }
        if(ok) break;
    }
    cout << ans << endl;
    return 0;
}

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


#define rep(i, n) for(int i = 1; i < (int)(n); i++)

 int main(){
  int n, w[100];
  int total;

  cin >> n;
  rep(i,n+1) cin >> w[i];  

  rep(i,n+1) total += w[i];


  int s1 =0;
  int ans = total;

   rep(t,n){
    rep(i,n){

     s1 += w[i];

     int s2= total - s1;

     int dif = abs(s1-s2);

     if (dif <= ans) ans = dif;
    }    
   }

 cout << ans << endl;

 return 0;
}


Measured memory_bytes: 256
//   _/                _/                 _/_/_/   _/
//_/_/_/_/   _/_/   _/_/_/_/   _/_/    _/       _/_/
// _/     _/    _/   _/     _/    _/  _/_/_/     _/
//_/     _/    _/   _/     _/    _/  _/    _/   _/
// _/_/   _/_/       _/_/   _/_/      _/_/     _/
#include<iostream>
#include<algorithm>
#include<cmath>
#include<iomanip>
#include<set>
#include<map>
#include<queue>
#include<vector>
using namespace std;
typedef long long ll;
const int MOD=1e9+7;
const double pi=3.14159265358979323846;
const int inf=2e9;
const ll INF=5e18;
typedef pair<int,int> P;
int main() {
  cin.tie(0),cout.tie(0);
  ios::sync_with_stdio(false);
  int n,cnt=0;
  cin >> n;
  while(true) {
    cnt=0;
    for(int j=2; j*j<=n; j++) {
      if(n%j==0) {
        cnt++;
      }
    }
    if(cnt==0) {
      cout << n << endl;
      return 0;
    }
    n++;
  }
}

Measured memory_bytes: 256