akhauriyash/Code-Regression huggingface dataset:
#include <stdio.h>
#include <iostream>
#include <algorithm>
#include <math.h>
#include <vector>
#include <string>
#include <queue>
#include <numeric>

using namespace std;

typedef long long int ll;
typedef long int li;

int main(){
    ll n;
    char s[10];
    cin >> s;
    int a,b,c,d,e,f,g,h;
    a=s[0]-48;
    b=s[1]-48;
    c=s[2]-48;
    d=s[3]-48;
    e=s[5]-48;
    f=s[6]-48;
    g=s[8]-48;
    h=s[9]-48;
    n = a * 10000000 + b * 1000000 + c * 100000 + d * 10000 + e * 1000 + f * 100 + g * 10+h*1;
    if(n<=20190430)cout << "Heisei" << endl;
    else cout << "TBD" << endl;
}



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

typedef long long ll;
typedef unsigned long long ull;
struct edge { int u, v; ll w; };
 
ll MOD = 1000000007;
ll _MOD = 1000000009;
double EPS = 1e-10;

int main() {
  int N, sum = 0;
  int a[100], table[9] = {0};

  cin >> N;
  for (int i = 0; i < N; i++) {
    cin >> a[i];
  }
  
  for (int i = 0; i < N; i++) {
    if (a[i] >= 1 && a[i] <= 399) table[0]++;
    if (a[i] >= 400 && a[i] <= 799) table[1]++;
    if (a[i] >= 800 && a[i] <= 1199) table[2]++;
    if (a[i] >= 1200 && a[i] <= 1599) table[3]++;
    if (a[i] >= 1600 && a[i] <= 1999) table[4]++;
    if (a[i] >= 2000 && a[i] <= 2399) table[5]++;
    if (a[i] >= 2400 && a[i] <= 2799) table[6]++;
    if (a[i] >= 2800 && a[i] <= 3199) table[7]++;
    if (a[i] >= 3200) table[8]++;
  }

  for (int i = 0; i < 8; i++) {
    if (table[i] > 0) sum++;
  }
  int max = sum + table[8];
  int min = sum > 0 ? sum : 1;
  cout << min << " " << max << endl;
  return 0;
}


Measured memory_bytes: 256
n = int(input())

dp = [[0]*3 for _ in range(n+1)]
for i in range(n):
    a, b, c = map(int, input().split())
    dp[i+1][0] = a + max(dp[i][1], dp[i][2])
    dp[i+1][1] = b + max(dp[i][2], dp[i][0])
    dp[i+1][2] = c + max(dp[i][0], dp[i][1])
print(max(dp[n]))


Measured memory_bytes: 22764
#include <bits/stdc++.h>
#define pb push_back
#define Int long long
using namespace std;

const int MAXN=500005;
const int NAX=1005;
const long MOD=(long)(1e9+7);

Int N,M,K;
Int X,Y,Z;
Int H,W;
Int perform(Int x){
    return (x*(x+1))/2LL;
}
vector<Int> A;
vector<int> adj[MAXN];
using D=long double;

bool inRange(Int a,Int b){
    return a*b<=0;
}

int main()
{
    cin>>X>>Y>>H>>W;
    Int ans=X*H;
    ans=max(ans,X*W);
    ans=max(ans,Y*H);
    ans=max(ans,Y*W);
    if(ans<0){
        if((inRange(X,Y))||(inRange(H,W))) ans=0;
    }
    cout<<ans<<"\n";
}


Measured memory_bytes: 15348
#include <iostream>
#include <cstdlib>
#include <cstdio>
#include <algorithm>
#include <cstring>
#include <vector>
#include <cmath>
#include <bitset>
#include <queue>

using namespace std;
typedef long long ll;

int main() {
    int n, k;
    cin >> n >> k;
    int digit = log(n) / log(k);
    cout << (digit + 1);
}

Measured memory_bytes: 256
n = int(input())
A,B = [],[]
for i in range(n):
    a,b = map(int,input().split())
    A.append(a)
    B.append(b)
A.sort()
B.sort()
if n%2==1:
    x = A[n//2]
    y = B[n//2]
else:
    x = A[n//2 - 1]+A[n//2]
    y = B[n//2 - 1]+B[n//2]
print(y-x+1)

Measured memory_bytes: 25444
#include <bits/stdc++.h>
using namespace std;
/*const long long M = 1000000007 , N = 1001;
int r1,r2,r3,c1,c2,c3,c4,n,polycoff[N][N],group2[N][N];
string s1,s2,s3;
void fix(int &a){
	if(a >= M){
		a -= M;
	}else if(a < 0){
		a += M;
	}
}
int main(){
	cin >> n >> r1 >> s1 >> r2 >> s2 >> r3 >> s3;
	for(int i = 0 ; i < n ; i += 1){
		if(s1[i] != s2[i] && s2[i] == s3[i]){
			c1 += 1;
		}else if(s1[i] != s2[i] && s1[i] == s3[i]){
			c2 += 1;
		}else if(s1[i] == s2[i] && s2[i] != s3[i]){
			c3 += 1;
		}else{
			c4 += 1;
		}
	}
	int rr1 = r1-c2-c3-c4 , rr2 = r2-c1-c3-c4 , rr3 = r3-c1-c2-c4;
	for(int i = 0 ; i <= n ; i += 1){
		polycoff[i][0] = polycoff[i][i] = 1;
		for(int j = 1 ; j < i ; j += 1){
			polycoff[i][j] = polycoff[i-1][j] + polycoff[i-1][j-1];
			fix(polycoff[i][j]);
		}
	}
	for(int i = 0 ; i <= c3 ; i += 1){
		for(int j = 0 ; j <= c4 ; j += 1){
			group2[i+j][i-j+c4] = (long long)polycoff[c3][i] * polycoff[c4][j]%M;
		}
	}
	for(int i = 0 ; i <= c3+c4 ; i += 1){
		for(int j = -c4 ; j <= c3 ; j += 1){
			int jj = j+c4;
			group2[i][jj] += (i > 0 ? group2[i-1][jj] : 0) + (jj > 0 ? group2[i][jj-1] : 0);
			fix(group2[i][jj]);
			if(i > 0 && jj > 0){
				group2[i][jj] -= group2[i-1][jj-1];
			}
			fix(group2[i][jj]);
		}
	}
	long long ans = 0;
	for(int i = 0 ; i <= c1 ; i += 1){
		for(int j = 0 ; j <= c2 ; j += 1){
			int rrr1 = rr1 - i + j,rrr2 = rr2 + i - j , rrr3 = rr3 + i + j , rrr4 = max(-rrr1,-rrr2);
			if(rrr4 > c3+c4 || rrr3+c4 < 0){
				continue;
			}
			rrr3 = min(rrr3,c3);
			ans += (polycoff[c1][i]*polycoff[c2][j])*(group2[rrr4][c3+c4]-(rrr3+c4 > 0 ? group2[rrr4][rrr3+c4-1] : 0));
			ans %= M;
		}
	}
	cout << (ans+M)%M << endl;
}
*/
/*
3
1 000
1 100
0 111
*/
int n;

bool is_equal(int x[] , int y[]){
	for(int i = 0 ; i < n ; i += 1){
		if(x[i] != y[i]){
			return false;
		}
	}
	return true;
}

int main(){
	cin >> n;
	int x1[n],x2[n],x3[n];
	for(int i = 0 ; i < n ; i += 1){
		cin >> x2[i];
	}
	for(int i = 0 ; i < n ; i += 1){
		cin >> x3[i];
		x1[i] = i+1;
	}
	sort(x1,x1+n);
	int f1=0,f2=0,cnt=0;
	do{
		cnt += 1;
		if(is_equal(x1,x2)){
			f1 = cnt;
		}
		if(is_equal(x1,x3)){
			f2 = cnt;
		}
	}while(next_permutation(x1,x1+n));
	cout << abs(f1-f2) << endl;
}

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

int main(){
    long long int n, temp = 0;

    cin >> n;

    for(int i = 1; i <= n; i++){
        if(i % 3 == 0 || i % 5 == 0){

        }
        else{
            temp += i;
        }
    }

    cout << temp << "\n";
    return 0;
}

Measured memory_bytes: 3644
let split str delim =
  let rec doit s acc =
    match
      try Some (String.index s delim)
      with _ -> None
    with
    | None -> s :: acc
    | Some i ->
        let s1 = String.sub s 0 i in
        let s2 = String.sub s (i + 1) (String.length s - String.length s1 - 1) in
        doit s2 (s1 :: acc)
  in
  List.rev (doit str [])

let () =
  let l = read_line () in
  match List.map int_of_string (split l ' ') with
  | [] | [_] -> exit 1
  | n :: m :: _ ->
      let a = Array.make (n * m) 0 in
      let b = Array.make m 0 in
      for i = 1 to n do
        let l = read_line () in
        let ls = Array.of_list (List.map int_of_string (split l ' ')) in
        for j = 1 to m do
          a.(m*(i-1) + (j-1)) <- ls.(j-1)
        done
      done;
      for i = 1 to m do
        let x = read_int () in
        b.(i-1) <- x
      done;
      for i = 1 to n do
        let c = ref 0 in
        for j = 1 to m do
          c := !c + a.(m*(i-1) + (j-1)) * b.(j-1)
        done;
        Printf.printf "%d\n" !c
      done

Measured memory_bytes: 4572
function Main(input) {
	input = input.split("\n");
 	var N = input[0];
  
  	var counts = ["AC", "WA", "TLE", "RE"];
  	counts["AC"] = counts["WA"] = counts["TLE"] = counts["RE"] = 0;
  
	for(var i=1;i <= N;i++)
	{
  		var key = input[i];
  		counts[key] = (counts[key])? counts[key] + 1 : 1 ;
	}
  
  	console.log("AC x "+counts['AC']);
	console.log("WA x "+counts['WA']);
  	console.log("TLE x "+counts['TLE']);
  	console.log("RE x "+counts['RE']);
}

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

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

int main(){
	int a, b, c, d;
	cin >> a >> b >> c >> d;
	if(a+b > c+d)
		cout << "Left";
	else if (a+b == c+d)
		cout << "Balanced";
	else
		cout << "Right";
	return 0;
}


Measured memory_bytes: 256
import sys
from collections import deque
import copy
def main():
    A, B, C, D = map(int, input().split())
    while True:
        C -= B
        if C <= 0:
            print("Yes")
            sys.exit()
        A -= D
        if A <= 0:
            print("No")
            sys.exit()


if __name__ == '__main__':
    main()


Measured memory_bytes: 9528
#include<iostream>
#include<string>
#include<algorithm>	
#include<cmath>
using namespace std;
int test[123456];
int main() {
	int n, a, b = 0, c = 0, ans = 1; cin >> n;
	for (int h = 0; h < n; h++) {
		cin >> a;
		test[h] = a;
	}
	for (int h = 0; h < n - 1; h++) {
		if (test[h] < test[h + 1]) {
			if (c > 0) { c = 0; ans++; }
			else { b++; }
		}
		if (test[h] > test[h + 1]) {
			if (b > 0) { b = 0; ans++; }
			else { c++; }
		}
	}
	cout << ans << endl;
	cin >> n;
}

Measured memory_bytes: 640
#include <algorithm>
#include <cassert>
#include <cctype>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstring>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <string>
#include <tuple>
#include <unordered_map>
#include <vector>
#define rep(i, n) for (int i = 0; i < (int)(n); ++i)
#define show(x) cout << #x << " = " << x << endl;
using namespace std;
using ll = long long;
using pii = pair<int,int>;
#define MAX_V 100005
int V;
vector<int> G[MAX_V];
vector<int> rG[MAX_V];//辺を逆にしたグラフ
vector<int> vs;
bool used[MAX_V];
int cmp[MAX_V];//属する強連結成分のトポロジカル順序

void add_edge(int from, int to){
    G[from].push_back(to);
    rG[to].push_back(from);
}

void dfs(int v){
    used[v] = true;
    for(int i = 0; i < G[v].size(); ++i){
        if(!used[G[v][i]]) dfs(G[v][i]);
    }
    vs.push_back(v);
}

void rdfs(int v, int k){
    used[v] = true;
    cmp[v] = k;
    for(int i = 0; i < rG[v].size(); ++i){
        if(!used[rG[v][i]]) rdfs(rG[v][i], k);
    }
}
int scc(){
    memset(used, 0, sizeof(used));
    vs.clear();
    for(int v = 0; v < V; ++v){
        if(!used[v]) dfs(v);
    }
    memset(used, 0, sizeof(used));
    int k = 0;
    for(int i =(int) vs.size()-1; i >= 0; i--){
        if(!used[vs[i]]) rdfs(vs[i],k++);
    }
    return k;
}
int a[100005];
int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n,m;
    cin >> n >> m;
    V = n;
    vector<int>p(n);
    rep(i,n){
        cin >> p[i];
        p[i]--;
        a[p[i]] = i;
    }
    vector<int>x(m),y(m);
    rep(i,m){
        cin >> x[i] >> y[i];
        x[i]--,y[i]--;
        add_edge(x[i],y[i]);
        add_edge(y[i],x[i]);
    }
    int k = scc();
    
    int ans = 0;
    rep(i,n){
        if(p[i] == i){
            ans++;
        }else{
            if(cmp[i] == cmp[a[i]]){
                ans++;
            }
        }
    }
    cout << ans << endl;
    
}


Measured memory_bytes: 16764
#include <iostream>
#include <algorithm>
using namespace std;
typedef long long int LLI;

struct swords{
	LLI dmg;
	int type;
};

bool check(swords x, swords y)
{
	return (x.dmg < y.dmg);
}

LLI solution(swords arr[], int n, LLI h)
{
	int i = n-1;
	LLI sum = 0;
	sort(arr,arr+n,check);
	
	while( h > 0 )
	{
		if( arr[i].type == 1 ){
			h -= arr[i].dmg;
			sum++;
		}else{
			sum += h/arr[i].dmg;
			if( h % arr[i].dmg != 0 )
				sum++;
			break;
		}
		i--;
	}
	return sum;
}

int main()
{
	int n;
	LLI h;
	cin >> n >> h;
	
	LLI a, b;
	swords arr[2*n];
	for(int i = 0; i < n; i++)
	{
		cin >> a >> b;
		
		arr[2*i].dmg = a;
		arr[2*i].type = 0;
		
		arr[2*i+1].dmg = b;
		arr[2*i+1].type = 1;
	}
	cout << solution(arr,2*n,h);
}

Measured memory_bytes: 6748
#include<iostream>
#include<iomanip>
#include<algorithm>
#include<cmath>
#include<vector>
#include<string>
#include<bitset>
#include<queue>
#include<set>
#include<map>
using namespace std;

#define FOR(i,a,b) for (int i=(a);i<(b);++i)
#define ROF(i,b,a) for (int i=(b);i>(a);--i)
#define REP(i,n) FOR(i,0,n)
#define PER(i,n) ROF(i,n-1,-1)

typedef int i32;
typedef long long int i64;
typedef unsigned long long int ui64;
typedef float f32;
typedef double f64;
typedef long double f128;
typedef pair<int,int> Pi;

constexpr int INF = 1e9 + 7;
constexpr int dx[4] = {1,0,-1,0}, dy[4] = {0,1,0,-1};

int main() {
    int N; cin>>N;
    int cnt[N]; REP(i,N) cnt[i]=0;
    int a;
    REP(i,N) {
        cin>>a;
        while (a%2==0) {
                cnt[i]++;
                a /= 2;
        }
    }
    int c0=0,c1=0,c2=0;
    REP(i,N) {
        if (cnt[i]==0) c0++;
        else if (cnt[i]==1) c1++;
        else c2++;
    }
    string ans = "Yes";
    if (c1>0 && c0>c2) ans = "No";
    else if (c1==0 && c0>c2+1) ans = "No";
    cout<<ans<<endl;
}


Measured memory_bytes: 640
// ProblemURL : https://atcoder.jp/contests/abc053/tasks/arc068_a
// ---------------------------------------------
package main

import "fmt"

func main() {
	var x int
	fmt.Scan(&x)

	ans := x / 11
	r := x % 11
	if r == 0 {
		ans--
	}
	// fmt.Println(ans)
	ans = (ans * 2) + 1
	if (7 <= r && r <= 10) || r == 0 {
		ans++
	}
	fmt.Println(ans)
}


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

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

typedef long long ll;
using namespace std;
int mod = 1000000007;

int main(void){
    int N; cin >> N;
    int L[N]; rep(i, N) cin >> L[i];
    sort(L, L+N);
    //2本が決まるともう一本の取りうる値が決まる
    int cnt[2002] = {}; //cnt[i]は長さがi以下の棒の本数 cnt[j]-cnt[i-1]で長さi以上j以下の棒の本数
    rep(i, N){
        cnt[L[i]]++;
    }
    rep(i, 2001) cnt[i+1] += cnt[i];
    ll ans = 0;
    for(int i = 0; i < N; i++){
        int a = L[i];
        for(int j = i+1; j < N; j++){
            int b = L[j];
            //b-a < c < b+a
            int dlim = b-a, ulim = b+a;
            ll num_kouho;
            num_kouho = cnt[ulim-1] - cnt[dlim];
            if(dlim < a && a < ulim) num_kouho--;
            if(dlim < b && b < ulim) num_kouho--;
            ans += num_kouho;
        }
    }
    cout << ans/3 << endl;
    return 0;
}

Measured memory_bytes: 256
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <climits>
#include <cfloat>
#include <ctime>
#include <map>
#include <utility>
#include <set>
#include <iostream>
#include <memory>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <sstream>
#include <complex>
#include <stack>
#include <queue>
#include <numeric>
#include <list>

using namespace std;

#ifdef _MSC_VER
#define __typeof__ decltype
template <class T> int __builtin_popcount(T n) { return n ? 1 + __builtin_popcount(n & (n - 1)) : 0; }
#endif

#define foreach(it, c) for (__typeof__((c).begin()) it=(c).begin(); it != (c).end(); ++it)
#define all(c) (c).begin(), (c).end()
#define rall(c) (c).rbegin(), (c).rend()
#define popcount __builtin_popcount
           
#define rep(i, n) for (int i = 0; i < n; ++i)

template <class T> void max_swap(T& a, const T& b) { a = max(a, b); }
template <class T> void min_swap(T& a, const T& b) { a = min(a, b); }

const double EPS = 1e-10;
typedef long long ll;
typedef pair<int, int> pint;


int main()
{
    int n;
    static int new_ok[100010];
    scanf("%d", &n);
    rep (i, n)
    {
	int a, b;
	scanf("%d%d", &a, &b);
	++new_ok[min(b, n + 1)];
	--new_ok[min(a - 1, n + 1)];
    }
    ++new_ok[n + 1];

    int res = -3, ok = 0;
    for (int i = n + 1; i > 0; --i)
    {
	ok += new_ok[i];
	if (ok >= i)
	{
	    res = i - 1;
	    break;
	}
    }
    printf("%d\n", res);
}

Measured memory_bytes: 0
#include<iostream>
#include<vector>
#include<algorithm>
#include<math.h>
#include<iomanip>
using namespace std;
typedef long long ll;

int main() {
    int n; cin >> n;
    ll move = 0;
    ll ans = 0;
    ll prev = 0;
    for (int i = 0; i < n; i++) {
        ll h; cin >> h;
        if (h <= prev) move++;
        else move = 0;
        if (move > ans) ans = move;
        prev = h;
    }
    cout << ans << endl;
}


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

#define ll long long int

using namespace std;

int main()
{
     ll n,i,j,s=0,x;
     cin>>n;
     for(i=0;i<n;i++)
     {
         cin>>x;
         s+=x;
     }
     cout<<s-n<<endl;
    return 0;
}





Measured memory_bytes: 3616
#include <bits/stdc++.h>
using namespace std;
#define int long long
signed main() {
    int N;
    cin >> N;
    vector<int>A(N);
    vector<int>cnt(200005,0);
    for(int i = 0; i < N; i++) {
        cin >> A[i];
        cnt[A[i]]++;
    }
    int res = 0;
    for(int i = 1; i <= 200000; i++) {
        res+=cnt[i]*(cnt[i]-1)/2;
    }
    for(int i = 0; i < N; i++) {
        cout << res-((cnt[A[i]]*(cnt[A[i]]-1)/2)-((cnt[A[i]]-1)*(cnt[A[i]]-2)/2)) << endl;
    }
}


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

using namespace std;
typedef long long ll;
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<ll> VL;
typedef vector<VL> VVL;
typedef pair<int, int> PII;

#define FOR(i, a, n) for (ll i = (ll)a; i < (ll)n; ++i)
#define REP(i, n) FOR(i, 0, n)
#define ALL(x) x.begin(), x.end()
#define MP make_pair
#define PB push_back
#define MOD 1000000007
#define INF (1LL<<30)
#define LLINF (1LL<<60)
#define PI 3.14159265359
#define EPS 1e-12
#define int ll

signed main(void)
{
  while(true) {
    int n;
    cin >> n;
    if(!n) break;
    char a[105];
    REP(i, n) cin >> a[i];

    bool flag = true;
    int cnt[30] = {0};
    REP(i, n) {
      cnt[a[i]-'A']++;
      int m1 = -1, m2 = -1, i1;
      REP(j, 26) {
        if(cnt[j] > m1) {
          m2 = m1;
          m1 = cnt[j];
          i1 = j;
        } else if(cnt[j] > m2){
          m2 = cnt[j];
        }
      }
      //cout << m1 << " " << m2 << endl;
      if(m1 > m2+n-i-1) {
        cout << (char)('A'+i1) << " " << i+1 << endl;
        flag = false;
        break;
      }
    }
    if(flag) {
      cout << "TIE" << endl;
    }
  }

  return 0;
}

Measured memory_bytes: 3108
#include <bits/stdc++.h>
#define ll long long
using namespace std;
int main(){
    ll n;
    cin >> n;
    ll maxHeight = 0;
    ll sumHeight = 0;
    for(int i=0;i<n;i++){
        ll a;
        cin >> a;
        sumHeight += max(maxHeight-a,0ll);
        maxHeight = max(maxHeight,a);
    }
    cout << sumHeight;
    return 0;
}


Measured memory_bytes: 3632
#include<bits/stdc++.h>
using namespace std;
int main(){
    char x;
    cin>>x;
    if(x=='A'){
        cout<<'T';
    }
    else if(x=='T'){
        cout<<'A';
    }
    else if(x=='C'){
        cout<<'G';
    }
    else if(x=='G'){
        cout<<'C';
    }
}


Measured memory_bytes: 3580
N,M=map(int,input().split())
paths=[]
graph={}
for n in range(1,N+1):
    graph[n]=set()
for m in range(M):
    a,b=map(int,input().split())
    paths.append((a,b))
    graph[a].add(b)
    graph[b].add(a)

ans=0
for m in range(M):
    a,b=paths[m]
    graph[a].remove(b)
    graph[b].remove(a)
    
    land={1}
    connected={1}|graph[1]
    while land!=connected:
        land=connected.copy()
        for n in land:
            connected|=graph[n]
    if len(land)!=N:
        ans+=1

    graph[a].add(b)
    graph[b].add(a)

print(ans)


Measured memory_bytes: 3064
#include<bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i=0; i<n; i++)
#define rep1(i, n) for(int i=1; i<=n; i++)
#define repr(i, n) for(int i=n-1; i>=0; i--)
#define repr1(i, n) for(int i=n; i>=1; i--)
#define all(v) v.begin(),v.end()
using ll = long long;
using pii = pair<int, int>;
using pil = pair<int, ll>;
using pli = pair<ll, int>;
using pll = pair<ll, ll>;
const int INF = 1e9;
const ll LLINF = 1e18;
const ll MOD = 1e9+7;
const double EPS = 1e-10;
const double PI = acos(-1);
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }

int main() {
    int l, r, d;
    cin >> l >> r >> d;
    cout << r/d - (l-1)/d << endl;
}


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

int digits_sum(int a){
  int ans = 0;
  while(a>0){
    ans += a%10;
    a /= 10;
  }
  return ans;
}

int main(void){
  int N;
  cin >> N;
  if(N%digits_sum(N) == 0){
    cout << "Yes" << endl;
  }
  else{
    cout << "No" << endl;
  }
  return 0;
}

Measured memory_bytes: 256
# -*- coding: utf-8 -*-
import sys


def get_num():
    return int(input())


def get_nums(n):
    res = [0 for _ in range(n)]
    for i in range(n):
        res[i] = int(input())
    return res


def get_numbers():
    return map(int, input().split())


k, x = get_numbers()

cands = [str(x) for x in range(x - k + 1, x + k)]
print(" ".join(cands))


Measured memory_bytes: 38416
#include<stdio.h>

int main(){
	int N, a,b,c;
	scanf("%d", &N);
	c = N%10;
	b = (N%100 - c)/10;
	a = (N - b - c)/100;
	if(a == 7 || b == 7 || c == 7){
		printf("Yes\n");
	}else{
		printf("No\n");
	}
	return 0;
}

Measured memory_bytes: 2088
#include <iostream>
using namespace std;
char ch[10];
int main(){
	int n,i,oc = 0,point = 0,hc = 0;
	cin >> n;
	for(i=0;i<n;){
		cin >> ch;
		if(ch[0] == 'O'){
			oc++;
		}
		else if(ch[0] == 'H'){
			if(ch[1] == 'O'){
				point += 1 + hc;
				hc = 0;
			}
			else {
				hc++;
				if(hc > 3){
					hc--;
					point++;
				}
			}
		}
		if(oc == 3){
			cout << point << endl;
			point = 0;
			oc = 0;
			hc = 0;
			i++;
		}
	}
	return 0;
}

Measured memory_bytes: 0
/*
[abc112] D - Partition
*/

#include <algorithm>
#include <cassert>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
using namespace std;
typedef long long int ll;
typedef pair<int, int> pii;
typedef pair<ll, int> pli;

const int MAX_M = 1e9;
const int MAX_P = 1e5;

int N, M;

ll solve() {
    vector<int> divs;
    for (int i = 1; i * i <= M; i++) {
        if (M % i == 0) {
            divs.push_back(i);
            if (i * i != M) {
                divs.push_back(M / i);
            }
        }
    }
    sort(divs.begin(), divs.end(), greater<int>());

    for (int d : divs) {
        if (M / d >= N) {
            return d;
        }
    }
    return -1;
}

int main() {
    cin >> N >> M;

    cout << solve() << endl;

    return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <iomanip>
#include <algorithm>
#include <string>
#include <vector>
#include <map>
#include <set>
#include <cstdio>
#include <cstring>
using namespace std;

int main()
{
    cin.tie(0);
    int n, m, q;
    cin >> n >> m >> q;

    vector<int> as(q);
    for (auto &a: as) {
        cin >> a;
        a--;
    }

    map<int, vector<int>> poss;

    for (int i = 0; i < q; i++) {
        poss[as[i]].push_back(i);
    }

    vector<int> height(n, q);

    set<int> rest;
    for (int i = 0; i < m; i++) {
        rest.insert(i);
    }

    for (int i = q - 1; i >= 0; i--) {
        int cur = as[i];
        if (!rest.count(cur))
            continue;

        auto it = poss[cur].rbegin();
        auto end = poss[cur].rend();
        int partial = -1;

        for (int j = 0; j < height.size(); j++) {
            while (it != end && *it >= height[j])
                it++;

            if (it == end) {
                partial = j;
                break;
            }

            height[j] = *it++;
        }

        if (partial != -1) {
            if (cur != *rest.begin()) {
                cout << "No" << endl;
                return 0;
            }

            while (partial < height.size()) {
                if (height[partial] < 0)
                    break;
                height[partial++] = -1;
            }
        }

        // for (int j = 0; j < height.size(); j++)
        //     cout << i << ", " << j << ": " << height[j] << endl;
        // cout << endl;

        rest.erase(cur);
    }

    cout << "Yes" << endl;

    return 0;
}

Measured memory_bytes: 16640
'''
    Auther: ghoshashis545 Ashis Ghosh
    College: jalpaiguri Govt Enggineering College

'''
from os import path
import sys
from heapq import heappush,heappop
from functools import cmp_to_key as ctk
from collections import deque,defaultdict as dd 
from bisect import bisect,bisect_left,bisect_right,insort,insort_left,insort_right
from itertools import permutations
from datetime import datetime
from math import ceil,sqrt,log,gcd
def ii():return int(input())
def si():return input().rstrip()
def mi():return map(int,input().split())
def li():return list(mi())
abc='abcdefghijklmnopqrstuvwxyz'
mod=1000000007
# mod=998244353
inf = float("inf")
vow=['a','e','i','o','u']
dx,dy=[-1,1,0,0],[0,0,1,-1]

def bo(i):
    return ord(i)-ord('a')

file = 1





    
def solve():


    
    # for _ in range(ii()):

        
    ans = 0
    s = si()
    c = 0
    for i in s:
        if i=='S':
            ans = max(ans,c)
            c = 0
        else:
            c+=1
    ans = max(ans,c)
    print(ans)











        
if __name__ =="__main__":

    if(file):

        if path.exists('input.txt'):
            sys.stdin=open('input.txt', 'r')
            sys.stdout=open('output.txt','w')
        else:
            input=sys.stdin.readline
    solve()


Measured memory_bytes: 68296
#include <iostream>
#include <stack>
#include <string>
#include <cstdlib>
using namespace std;

int main(){
    string c;
    stack<int> stack;
    int a, b;

    while(cin >> c){
        if (c == "+") {
            b = stack.top(); stack.pop();
            a = stack.top(); stack.pop();
            stack.push(a + b);
        } else if (c == "-") {
            b = stack.top(); stack.pop();
            a = stack.top(); stack.pop();
            stack.push(a - b);
        } else if (c == "*") {
            b = stack.top(); stack.pop();
            a = stack.top(); stack.pop();
            stack.push(a * b);
        } else {
            stack.push(atoi(c.c_str()));
        }
    }

    cout << stack.top() << endl;

    return 0;
}


Measured memory_bytes: 3164
/*
このコード、と～おれ!
Be accepted!
∧＿∧　
（｡･ω･｡)つ━☆・*。
⊂　　 ノ 　　　・゜+.
　しーＪ　　　°。+ *´¨)
 　　　　　　　　　.· ´¸.·*´¨) ¸.·*¨)
		  　　　　　　　　　　(¸.·´ (¸.·'* ☆
*/

#include <cstdio>
#include <algorithm>
#include <string>
#include <cmath>
#include <cstring>
#include <vector>
#include <numeric>
#include <iostream>
#include <random>
#include <map>
#include <unordered_map>
#include <queue>
#include <regex>
#include <functional>
#include <complex>
#include <list>
#include <cassert>
#include <iomanip>
#include <set>
/*多倍長整数/cpp_intで宣言
#include <boost/multiprecision/cpp_int.hpp>
using namespace boost::multiprecision;
*/

//#pragma gcc target ("avx2")
//#pragma gcc optimization ("o3")
//#pragma gcc optimization ("unroll-loops")
#define rep(i, n) for(int i = 0; i < (n); ++i)
#define rep1(i, n) for(int i = 1; i <= (n); ++i)
#define rep2(i, n) for(int i = 2; i < (n); ++i)
#define repr(i, n) for(int i = n; i >= 0; --i)
#define reprm(i, n) for(int i = n - 1; i >= 0; --i)
#define printynl(a) printf(a ? "yes\n" : "no\n")
#define printyn(a) printf(a ? "Yes\n" : "No\n")
#define printYN(a) printf(a ? "YES\n" : "NO\n")
#define printim(a) printf(a ? "possible\n" : "imposible\n")
#define printdb(a) printf("%.50lf\n", a)//少数出力
#define printdbd(a) printf("%.16lf\n", a)//少数出力(桁少なめ)
#define prints(s) printf("%s\n", s.c_str())//string出力
#define all(x) (x).begin(), (x).end()
#define allsum(a, b, c) ((a + b) * c / 2.0)//等差数列の和、初項,末項,項数
#define pb push_back
#define priq priority_queue
#define rpriq priq<int, vector<int>, greater<int>>
#define deg_to_rad(deg) (((deg)/360.0)*2.0*PI)
#define rad_to_deg(rad) (((rad)/2.0/PI)*360.0)
#define Please return
#define AC 0
#define addf(T) [](T a, T b){return (a + b);}
#define minf(T) [](T a, T b){return min(a, b);}
#define maxf(T) [](T a, T b){return max(a, b);}
#define nopf(T) [](T a){return a;}


using ll = long long;

constexpr int INF = 1073741823;
constexpr int MINF = -1073741823;
constexpr ll LINF = ll(4661686018427387903);
constexpr ll MOD = 1000000007;
const long double PI = acos(-1.0L);

using namespace std;

void scans(string& str) {
	char c;
	str = "";
	scanf("%c", &c);
	if (c == '\n')scanf("%c", &c);
	while (c != '\n' && c != -1 && c != ' ') {
		str += c;
		scanf("%c", &c);
	}
}

void scanc(char& str) {
	char c;
	scanf("%c", &c);
	if (c == -1)return;
	while (c == '\n') {
		scanf("%c", &c);
	}
	str = c;
}

double acot(double x) {
	return PI / 2 - atan(x);
}

ll gcd(ll a, ll b) {
	if (b == 0) return a;
	return gcd(b, a % b);
}

ll lcm(ll number1, ll number2) {
	return number1 / gcd(number1, number2) * number2;
}

ll LSB(ll n) { return (n & (-n)); }

/*-----------------------------------------ここからコード-----------------------------------------*/



int main() {

	int n, k;
	scanf("%d%d", &n, &k);
	printf("%d\n", (--n + --k - 1) / k);


	Please AC;
}


Measured memory_bytes: 512
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#define FOR(i, n) for(int i = 0; i < (n); i ++)
#define CIN(type, val) type val; cin >> val;
#define COUT(val) cout << (val) << "\n";
#define RANGE(c) c.begin(), c.end()
using namespace std;

int main(void){
    CIN(int, n);
    CIN(int, k);
    
    COUT((2*k-1 <= n) ? "YES" : "NO");
}

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

using namespace std;

#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define rep2(i,n) for(int i=1;i<=(int)(n);i++)
#define rep3(i,n) for(int i=0;i<=(int)(n);i++)
#define REP(i,m,n) for(int i=m;i<(int)(n);i++)
#define repll(i,n) for(ll i=0;i<(ll)(n);i++)
#define repll2(i,n) for(ll i=1;i<=(ll)(n);i++)
#define REPLL(i,m,n) for(ll i=m;i<(ll)(n);i++)
#define INF 1e9  //
#define LINF 1e18  //
#define MOD (1e9)+7
#define MP make_pair
#define YES(n) cout << ((n) ? "YES" : "NO"  ) << endl
#define Yes(n) cout << ((n) ? "Yes" : "No"  ) << endl

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

//------------------------------------------------------

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

    int cnt = 0;

    rep(i, n) {
        int l, r;
        cin >> l >> r;
        cnt += r - l + 1;
    }

    cout << cnt << endl;

    return 0;
}



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

const int MAXN = 2005;

int N, Z, W, a[MAXN];

int dp[MAXN][MAXN][2], maxv[MAXN][MAXN][2], minv[MAXN][MAXN][2];

int main()
{
	srand(time(0));
	scanf("%d%d%d", &N, &Z, &W);
	memset(dp, -1, sizeof dp);
	for (int i = 1; i <= N; i++) scanf("%d", &a[i]);
	a[0] = W;
	for (register int j = N-1; j >= 0; j--) {
		for (register int i = j+1; i <= N; i++) {
			if (i == N) dp[i][j][0] = dp[i][j][1] = abs(a[i]-a[j]);
			else {
				dp[i][j][0] = maxv[i][i+1][1]; //k = i+1..n;
				dp[i][j][1] = minv[i][i+1][0]; // k = i+1..n;
			}
		}
		for (int k = 0; k < 2; k++) {
			maxv[j][N][k] = minv[j][N][k] = dp[N][j][k];
			for (int i = N-1; i >= 1; i--) {
				maxv[j][i][k] = max(maxv[j][i+1][k], dp[i][j][k]);
				minv[j][i][k] = min(minv[j][i+1][k], dp[i][j][k]);
			}
		}
	}
	int ans = 0;
	for (int j = 1; j <= N; j++)
		ans = max(ans, dp[j][0][1]);
	cout << ans << endl;
	return 0;
}


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

int main()
{
	vector<int> res;
	int n;
	double kg, m;
	while (~scanf("%d,%lf,%lf", &n, &kg, &m)){
		double bmi = kg / (m * m);
		if (bmi >= 25.){
			printf("%d\n", n);
		}
	}
}

Measured memory_bytes: 1212
#include <iostream>
#include <algorithm>

using namespace std;

int main() {
    long long s;
    cin >> s;
    long long ans = INT_MAX;
    
    while(s!=0) {
        ans = min(ans, abs(753 - s%1000));
        s /= 10;
    }

    cout << ans << endl;
}


Measured memory_bytes: 504
#include <bits/stdc++.h>
using namespace std;
#define f(i,a,b) for(ll i=a;i<b;i++)
#define rep(i,n) f(i,0,n)
#define fd(i,a,b) for(ll i=a;i>=b;i--)
#define pb push_back
#define mp make_pair
#define vi vector< int >
#define pc(x)  __builtin_popcount (x)
#define vl vector< ll >
#define ss second
#define ff first
#define ll long long
#define ld long double
#define pii pair< int,int >
#define pll pair< ll,ll >
#define sz(a) a.size()
#define inf (1000*1000*1000+5)
#define all(a) a.begin(),a.end()
#define tri pair<int,pii>
#define vii vector<pii>
#define vll vector<pll>
#define viii vector<tri>
#define mod 1000000007
#define pqueue priority_queue< int >
#define pdqueue priority_queue< int,vi ,greater< int > >
#define flush fflush(stdout) 
#define primeDEN 727999983
#define test ll t;cin >> t; while(t--)
#define nx_pe next_permutation(s.begin(),s.end())
#define cl cout<<"\n"

ll n,W;
ll w[105],val[105];
ll dp[105][100005];

ll sol(ll i,ll weight)
{
    if(i==n||weight>W)return 0;
    if(dp[i][weight]!=-1)return dp[i][weight];
    ll ans=0;
    ans=sol(i+1,weight);
    if(weight+w[i]<=W)
    ans=max(ans,sol(i+1,weight+w[i])+val[i]);
    return dp[i][weight]=ans;
}

    
int main()
{
   std::ios::sync_with_stdio(false);
   cin>>n>>W;
   rep(i,n)
   {
       cin>>w[i]>>val[i];
   }
   memset(dp,-1,sizeof dp);
   cout<<sol(0,0);
   
   
}







Measured memory_bytes: 82304
import java.util.*;

class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = Integer.parseInt(sc.next());
		int D = Integer.parseInt(sc.next());
		int[][] x = new int[N][D];
		for (int i=0;i<N;i++) {
			for (int j=0;j<D;j++) {
				x[i][j] = Integer.parseInt(sc.next());
			}
		}
		int ans = 0;
		for (int i=0;i<N;i++) {
			for (int j=i+1;j<N;j++) {
				int sum = 0;
				for (int k=0;k<D;k++) {
					sum += (x[j][k]-x[i][k])*(x[j][k]-x[i][k]);
				}
				if (Math.abs(Math.sqrt(sum)-Math.floor(Math.sqrt(sum))) < 0.00000001) {
					ans++;
				}
			}
		}
		System.out.println(ans);
	}
}

Measured memory_bytes: 21716
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;

namespace Contest
{
    class Program
    {


        public void Solve()
        {
            var sc = new Scanner();
            int N = sc.NextInt();
            int[] V = sc.IntArray();
            int[] C = sc.IntArray();
            int loop = 1 << N;
            int ans = 0;
            for (int i = 0; i < loop; i++)
            {
                int X = 0;
                int Y = 0;
                int cpL = i;
                for (int j = 0; j < N; j++)
                {
                    if (cpL % 2 == 1)
                    {
                        X += V[j];
                        Y += C[j];
                    }

                    cpL /= 2;
                }

                ans = Math.Max(ans, X - Y);
            }
            Console.WriteLine(ans);
        }

        static void Main() => new Program().Solve();
    }
}

class Scanner
{
    public Scanner()
    {
        _stream = new StreamReader(Console.OpenStandardInput());
        _pos = 0;
        _line = new string[0];
        _separator = ' ';
    }

    private char _separator;
    private StreamReader _stream;
    private int _pos;
    private string[] _line;

    #region get a element

    public string Next()
    {
        if (_pos >= _line.Length)
        {
            _line = _stream.ReadLine().Split(_separator);
            _pos = 0;
        }

        return _line[_pos++];
    }

    public int NextInt()
    {
        return int.Parse(Next());
    }

    public long NextLong()
    {
        return long.Parse(Next());
    }

    public double NextDouble()
    {
        return double.Parse(Next());
    }

    #endregion

    #region convert array

    private int[] ToIntArray(string[] array)
    {
        var result = new int[array.Length];
        for (int i = 0; i < array.Length; i++)
        {
            result[i] = int.Parse(array[i]);
        }

        return result;
    }

    private long[] ToLongArray(string[] array)
    {
        var result = new long[array.Length];
        for (int i = 0; i < array.Length; i++)
        {
            result[i] = long.Parse(array[i]);
        }

        return result;
    }

    private double[] ToDoubleArray(string[] array)
    {
        var result = new double[array.Length];
        for (int i = 0; i < array.Length; i++)
        {
            result[i] = double.Parse(array[i]);
        }

        return result;
    }

    #endregion

    #region get array

    public string[] Array()
    {
        if (_pos >= _line.Length)
            _line = _stream.ReadLine().Split(_separator);

        _pos = _line.Length;
        return _line;
    }

    public int[] IntArray()
    {
        return ToIntArray(Array());
    }

    public long[] LongArray()
    {
        return ToLongArray(Array());
    }

    public double[] DoubleArray()
    {
        return ToDoubleArray(Array());
    }

    #endregion
}

Measured memory_bytes: 13268
#include<bits/stdc++.h>
using namespace std;
#define MOD 1000000007
//#define MOD 998244353
#define INF 1000000010
#define EPS 1e-9
#define F first
#define S second

#define debug(x) cout<<x<<endl;
#define repi(i,x,n) for(int i=x;i<n;i++)
#define rep(i,n) repi(i,0,n)
#define lp(i,n) repi(i,0,n)
#define repn(i,n) for(int i=n;i>=0;i--)
#define int long long
#define endl "\n"

typedef pair<int,int> PII;
typedef pair<int,string> PIS;
typedef pair<string,int> PSI;


signed main(){
  cin.tie(0);	
  //ios::sync_with_stdio(false);
  int n,k;
  cin>>n>>k;
  int a[n],b[n];
  rep(i,n) b[i]=0;
  rep(i,n){
    cin>>a[i];
    a[i]--;
    b[a[i]]++;
  }

  queue<int> qq;
  rep(i,n){
    if(b[i]==0){
      qq.push(i);
    }
  }
  while(!qq.empty() ){
    int num=qq.front();
    qq.pop();
    b[a[num]]--;
    if(b[a[num]]==0) qq.push(a[num]);
  }
  int now=0;
  int nex=0;
  while(b[nex]==0){
    now++;
    nex=a[nex];
    if(now==k){
      cout<<++nex<<endl;
      return 0;
    }
  }
 
  int st=nex;
  int roop=1;
  nex=a[nex];
  while(nex!=st){
    roop++;
    nex=a[nex];
  }
  k-=now;
  k%=roop;
  rep(i,k){
    st=a[st];
  }
  cout<<++st<<endl;
	       
  return 0;
}


Measured memory_bytes: 7260
#include <bits/stdc++.h>
using namespace std;
#define IOS ios::sync_with_stdio(false); cin.tie(0);
#define FOR(i,s,n) for(int i = (s); i < (n); i++)
#define REP(i,n) FOR(i,0,n)
#define RREP(i,n) for(int i = (n); i >= 0; i--)
#define ALL(n) (n).begin(), (n).end()
#define RALL(n) (n).rbegin(), (n).rend()
#define ATYN(n) cout << ( (n) ? "Yes":"No") << '\n';
#define CFYN(n) cout << ( (n) ? "YES":"NO") << '\n';
#define OUT(n) cout << (n) << '\n';
using ll = long long;
using ull = unsigned long long;
using pii = pair<int,int>;
using pll = pair<ll,ll>;

int main(void)
{
    IOS
    ll X; cin >> X;
    ll ans = X / 11 * 2;
    if (X % 11 == 0);
    else if (X % 11 <= 6) ans +=1;
    else ans += 2;

    cout << ans << '\n'; 

    return 0;
}

Measured memory_bytes: 256
#### import ####
import sys
import math
from collections import defaultdict

#### 設定 ####
sys.setrecursionlimit(10**7)
def input():
  return sys.stdin.readline()[:-1]

#### 定数 ####
mod = 10**9 + 7

#### 読み込み ####
def I(): return int(input())
def II(): return map(int, input().split())
def III(): return list(map(int, input().split()))
def Line(N):
  read_all = [tuple(map(int, input().split())) for _ in range(N)]
  return map(list,zip(*read_all))

#################

H,W,K = II()
from itertools import product

if W==1:
  if K==1:
    print(1)
  else:
    print(0)
  exit()

#i番目のrowを通過後j+1にいる場合の数
dp = [[0]*W for _ in range(H+1)]
dp[0][0] = 1
for i in range(1,H+1):
  for j in range(W):
    if 0<=j-1:
      a = list(product(['+','-'],repeat=W-1))
      counter = 0
      for a1 in a:
        if a1[j-1]!= '+':
          continue
        else:
          for k in range(1,W-1):
            if a1[k] == '+' and a1[k-1] == '+':
              break
            else:
              if k == W-2:
                counter += 1
      dp[i][j] += dp[i-1][j-1]*counter
      dp[i][j] %= mod
      
    if W-1>=j+1:
      a = list(product(['+','-'],repeat=W-1))
      counter = 0
      for a1 in a:
        if a1[j]!= '+':
          continue
        else:
          for k in range(1,W-1):
            if a1[k] == '+' and a1[k-1] == '+':
              break
            else:
              if k == W-2:
                counter += 1
      dp[i][j] += dp[i-1][j+1]*counter
      dp[i][j] %= mod

    a = list(product(['+','-'],repeat=W-1))
    counter = 0
    for a1 in a:
      if j <= W-2:
        if a1[j] == '+':
          continue
      if j-1>=0:
        if a1[j-1] == '+':
          continue
      for k in range(1,W-1):
        if a1[k] == '+' and a1[k-1] == '+':
          break
        else:
          if k==W-2:
            counter += 1
    dp[i][j] += dp[i-1][j]*counter
    dp[i][j] %= mod

print(dp[H][K-1])

Measured memory_bytes: 51052
def main():
    inp = lambda: [int(x) for x in input().split()]    
    n, k = inp()
    a = inp()
    min_a = min(a)
    dp = [False] * (k+1)
    for i in range(k + 1):
        if i < min_a:
            dp[i] = False
        elif i in a:
            dp[i] = True
        else:
            for j in a:
                if i >= j and not dp[i-j]:
                    dp[i] = True
                    break

    ans = "First" if dp[k] else "Second"
    print(ans)


if __name__ == '__main__':
    main()


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

using namespace std;

#define ll long long
#define fix cout << fixed; cout << setprecision(10)





void solve() {

	long double a, b;
	cin >> a >> b;
	cout << (ll)(a * b) << "\n";
	




	
}

int main() {

	ios_base::sync_with_stdio(0);
	cin.tie(NULL);
	
	solve();

	return 0;
}

Measured memory_bytes: 3744
#include <algorithm>
#include <bitset>
#include <tuple>
#include <cstdint>
#include <cstdio>
#include <cctype>
#include <assert.h>
#include <stdlib.h>
#include <stdio.h>
#include <cassert>
#include <cfloat>
#include <climits>
#include <cmath>
#include <complex>
#include <ctime>
#include <deque>
#include <fstream>
#include <functional>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <list>
#include <limits>
#include <map>
#include <memory>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>
#include <math.h>

// ===============================================================

using namespace std;
using ll = long long;
using vl = vector<long long>;
using vll = vector<vector<long long>>;
using vs = vector<string>;
using vc = vector<char>;
using vcc = vector<vector<char>>;
using vm = vector<short>;
using vmm = vector<vector<short>>;
using pii = pair<int, int>;
using psi = pair<string, int>;
using ld = long double;
using ull = unsigned long long;
using ld = long double;

// ========================================================================



ll gcd(ll a, ll b)
{
	if (a % b == 0)
	{
		return(b);
	}
	else
	{
		return(gcd(b, a % b));
	}
}
//最大公約数
ll lcm(ll a, ll b)
{
	return a * b / gcd(a, b);
}
//最小公倍数
ll box(double a)
{
	ll b = a;
	return b;
}
//切り捨て
ll fff(double a)
{
	ll b = a + 0.5;
	return b;
}
//四捨五入
ll sum(ll n) {
	return (1 + n) * n / 2;
}
//1から整数nまでの合計を出す
ll mch(ll n) {
	if (n == 1) return 1;
	else return n * mch(n - 1);
}
//1から整数nまでの階乗を出す(INFで割っていない)
bool prime(ll a)//素数判定、primeならtrue,違うならfalse
{
	if (a < 2) return false;
	else if (a == 2) return true;
	else if (a % 2 == 0) return false;
	double m = sqrt(a);
	for (int i = 3; i <= m; i += 2)
	{
		if (a % i == 0)
		{
			return false;
		}
	}

	// 素数である
	return true;
}
//素数判定
ll modpow(ll a, ll n, ll mod) {
	ll hi = 1;
	while (n > 0) {
		if (n & 1) hi = hi * a % mod;
		a = a * a % mod;
		n >>= 1;
	}
	return hi;
}
//いろいろやります（ただの前座）
ll mg(ll a, ll mod) {
	return modpow(a, mod - 2, mod);
}
//割り算の10^9+7等対策で逆元を出します



// ========================================================================


int main() {
	ll n; cin >> n;
	vl a(n + 1);
	vl b(n);
	for (int i = 0; i < n + 1; i++) cin >> a[i];
	for (int i = 0; i < n; i++) cin >> b[i];
	ll cnt = 0;
	for (int i = 0; i < n ; i++) {
		if (b[i] > a[i]) {
			cnt += a[i];
			b[i] -= a[i];
			cnt += a[i + 1];
			a[i + 1] = max(0ll, a[i + 1] - b[i]);
			cnt -= a[i + 1];
		}
		else cnt += b[i];
	}
	cout << cnt << endl;

	return 0;
}

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

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

struct P
{
    int x;
    int y;
    int h;
};

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

    vector<P> v(N);
    for (int i = 0; i < N; i++) cin >> v[i].x >> v[i].y >> v[i].h;

    for (int cx = 0; cx <= 100; cx++)
    {
        for (int cy = 0; cy <= 100; cy++)
        {
            int pos = 0;
            while (v[pos].h == 0) pos++;

            int H = v[pos].h + abs(cx - v[pos].x) + abs(cy - v[pos].y); 

            bool flag = true;
            for (int i = 0; i < N; i++)
            {
                if (v[i].h != max(H - abs(cx - v[i].x) - abs(cy - v[i].y), 0))
                {
                    flag = false;
                    break;
                }
            }
            if (flag)
            {
                cout << cx << " " << cy << " " << H << endl;
                return 0;
            }
        }   
    }
    return 0;
}


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

char a[1000005];

int main()
{
    int len,i,cnt=0,X=0;
    scanf(" %s", a);
    len=strlen(a);
    for(i=0;i<len;i++){
        if(a[i]=='S')cnt++;
        if(a[i]=='T'){
            if(cnt==0)X++;
            else cnt--;
        }
    }
    printf("%d", X+cnt);
    return 0;
}


Measured memory_bytes: 384
#include <string>
#include <vector>
#include <algorithm>
#include <numeric>
#include <set>
#include <map>
#include <queue>
#include <iostream>
#include <sstream>
#include <cstdio>
#include <cmath>
#include <ctime>
#include <cstring>
#include <cctype>
#include <cassert>
#include <limits>
#include <functional>
#include <iomanip>
#include <complex>
#include <bitset>
#include <stack>
 
using namespace std;
 
#define rep(i,n) for(int (i)=0;(i)<(int)(n);++(i))
#define rer(i,l,u) for(int (i)=(int)(l);(i)<=(int)(u);++(i))
#define reu(i,l,u) for(int (i)=(int)(l);(i)<(int)(u);++(i))
#if defined(_MSC_VER) || __cplusplus > 199711L
#define aut(r,v) auto r = (v)
#else
#define aut(r,v) __typeof(v) r = (v)
#endif
#define each(it,o) for(aut(it, (o).begin()); it != (o).end(); ++ it)
#define all(o) (o).begin(), (o).end()
#define pb(x) push_back(x)
#define mp(x,y) make_pair((x),(y))
#define mset(m,v) memset(m,v,sizeof(m))
#define INF 0x3f3f3f3f3f3f3f3fLL
#define SIZE 200105
#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)
#define ALL(c) (c).begin(), (c).end()
 
typedef vector<int> vi; typedef pair<int, int> pii; typedef vector<pair<int, int> > vpii; typedef long long ll;
typedef pair<int,ll> pill; typedef pair<ll,int> plli; 
typedef pair<double, int> pdi;
template<typename T, typename U> inline void amin(T &x, U y) { if(y < x) x = y; }
template<typename T, typename U> inline void amax(T &x, U y) { if(x < y) x = y; }
typedef complex<double> P;
ll MOD = 1000000007;
//ll MOD=998244353;
typedef ll Weight;
struct Edge {
	int src, dst;
	Weight weight;
};
bool operator < (const Edge &e, const Edge &f) {
	return e.weight != f.weight ? e.weight > f.weight : // !!INVERSE!!
	e.src != f.src ? e.src < f.src : e.dst < f.dst;
}
typedef vector<Edge> Edges;
int H,W;
ll dp[1010][1010];
int main(){
	cin>>H>>W;
	string str[1010];
	rep(i,H)cin>>str[i];
	dp[0][0]=(ll)1;
	rep(i,H)rep(j,W){
		if(str[i][j]!='#'&&i>0)dp[i][j]=(dp[i][j]+dp[i-1][j])%MOD;
		if(str[i][j]!='#'&&j>0)dp[i][j]=(dp[i][j]+dp[i][j-1])%MOD;
	}
	cout<<dp[H-1][W-1]<<endl;
}

Measured memory_bytes: 9216