akhauriyash/Code-Regression huggingface dataset:
#include <stdio.h>
/*
#include <stdlib.h>

int answer[] = { 3, 6, 9, 12, 13, 15, 18, 21, 23, 24, 27, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 42, 43, 45, 48, 51, 53, 54, 57, 60, 63, 66, 69, 72, 73, 75, 78, 81, 83, 84, 87, 90, 93, 96, 99, 102, 103, 105, 108, 111, 113, 114, 117, 120, 123, 126, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 141, 143, 144, 147, 150, 153, 156, 159, 162, 163, 165, 168, 171, 173, 174, 177, 180, 183, 186, 189, 192, 193, 195, 198, 201, 203, 204, 207, 210, 213, 216, 219, 222, 223, 225, 228, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 243, 246, 249, 252, 253, 255, 258, 261, 263, 264, 267, 270, 273, 276, 279, 282, 283, 285, 288, 291, 293, 294, 297, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, 402, 403, 405, 408, 411, 413, 414, 417, 420, 423, 426, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 441, 443, 444, 447, 450, 453, 456, 459, 462, 463, 465, 468, 471, 473, 474, 477, 480, 483, 486, 489, 492, 493, 495, 498 }, count = 0;
*/
/*
void check_answer(int i)
{
    if( i != answer[count] ){
        printf("\ni: %d  answer[%d]: %d\n", i, count, answer[count]);
        exit(0);
    }
    ++count;
}
*/
void CHECK_NUM(const int i, int *x)
{
    *x = i;
}

int INCLUDE3(const int i, const int x)
{
    if( x % 10 == 3 ){
        printf(" %d", i);
        //check_answer(i);
        return 1;
    }

    return 0;
}

void call(int n)
{
    int i = 1, x;

    do{
        CHECK_NUM(i, &x);
        if( x % 3 == 0 ){
            printf(" %d", i);
            //check_answer(i);
            continue;
        }
        if( INCLUDE3(i, x) ) continue;
        while( x /= 10, x )
            if( INCLUDE3(i, x) ) break;
    }while( ++i <= n );

    printf("\n");
}

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

    call(n);

    return 0;
}

Measured memory_bytes: 596
//Relive your past life.
//Face your demons.
//The past is never dead,it is not even past.
//The memories are not only the key to the past but...also to the future.
//coded in Rusty Lake
#include<cmath>
#include<math.h>
#include<ctype.h>
#include<algorithm>
#include<bitset>
#include<cassert>
#include<cctype>
#include<cerrno>
#include<cfloat>
#include<ciso646>
#include<climits>
#include<clocale>
#include<complex>
#include<csetjmp>
#include<csignal>
#include<cstdarg>
#include<cstddef>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<ctime>
#include<cwchar>
#include<cwctype>
#include<deque>
#include<exception>
#include<fstream>
#include<functional>
#include<iomanip>
#include<ios>
#include<iosfwd>
#include<iostream>
#include<istream>
#include<iterator>
#include<limits>
#include<list>
#include<locale>
#include<map>
#include<memory>
#include<new>
#include<numeric>
#include<ostream>
#include<queue>
#include<set>
#include<sstream>
#include<stack>
#include<stdexcept>
#include<streambuf>
#include<string>
#include<typeinfo>
#include<utility>
#include<valarray>
#include<vector>
#include<string.h>
#include<stdlib.h>
#include<stdio.h>
#define ll   long long
#define pb   push_back
#define mp   make_pair
#define orz  1000000007
using namespace std;
int n;
char s[105],t[105];
int main(){
    scanf("%d",&n);
    for(int i=1;i<=n;++i)scanf(" %c",s+i);
    for(int i=1;i<=n;++i)scanf(" %c",t+i);
    for(int i=0;i<=n;++i){
        bool ok=1;
        for(int j=i+1;j<=n;++j)if(s[j]!=t[j-i])ok=0;
        if(ok){
            printf("%d\n",n+i);
            return 0;
        }
    }
    //system("pause");
    return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <string>
#include <typeinfo>
#include <cmath>
#include <vector>
#define rep(i,n) for(int i=0;i<n;i++)
#define ll long long int
#define ii pair<int,int>
#define MAX 1000000007
using namespace std;

int main(void){
	string s;
	cin>>s;
	int a[3];
	a[2]=s[0]-'0';
	a[1]=s[1]-'0';
	int min=1000;
	for(int i=2;i<s.length();i++){
		a[0]=s[i]-'0';
		int score=a[2]*100+a[1]*10+a[0];
		if(abs(score-753)<min)min=abs(score-753);
		a[2]=a[1];
		a[1]=a[0];
	}
	cout<<min<<endl;
	return 0;
}


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

int main() {
 int a , b , c;
  cin >> a >> b >> c;
  if (a+b==c){
    cout << "Yes" << endl;
  }
    else if (a+c==b){
    cout << "Yes" << endl;
  }
   else if (c+b==a){
    cout << "Yes" << endl;
   }
  else {
    cout << "No" << endl;
  }
}



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

int main()
{
	int n, a;
	int xn[60];
	cin >> n >> a;
	for (int i = 0; i < n; i++)
	{
		cin >> xn[i];
	}
	unsigned long long dp[55][55][2510];
	for (int i = 0; i < 55; i++)
	{
		for (int j = 0; j < 55; j++)
		{
			for (int k = 0; k < 2510; k++)
			{
				dp[i][j][k] = 0;
			}
		}
	}
	dp[0][0][0] = 1;
	for (int i = 0; i < n; i++)
	{
		for (int j = 0; j <= n; j++)
		{
			for (int k = 0; k < 2510; k++)
			{
				if (j - 1 >= 0 && k - xn[i] >= 0)
					dp[i + 1][j][k] = dp[i][j][k] + dp[i][j - 1][k - xn[i]];
				else
					dp[i + 1][j][k] = dp[i][j][k];
			}
		}
	}
	unsigned long long count = 0;
	for (int i = 1; i <= n; i++)
	{
		for (int j = 0; j < 2510; j++)
		{
			if (j % i != 0)
				continue;
			if (j / i == a)
				count += dp[n][i][j];
		}
	}
	cout << count << endl;
}


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

using ll=long long;
int main(){
    int n; ll a,b;
    cin>>n>>a>>b;
    vector<ll> x(n);
    for(int i=0;i<n;i++) cin>>x[i];

    ll res=0;
    for(int i=0;i+1<n;i++){
        ll d=x[i+1]-x[i];
        res+=min(d*a,b);
    }
    cout<<res<<endl;
    
    return 0;
}

Measured memory_bytes: 1024
#include <bits/stdc++.h>
using namespace std;
int main() {
  
  int64_t A,B,C,D;
  cin >> A >> B >> C >> D;
  int64_t c_be , d_be , cd_be ;
  
  int a = C;
  int b = D;
  int r = 1;
  while(r > 0){
    r = b % a;
    b = a;
    a = r;
  }
  int64_t M = (C*D)/b;
    
  if(A % C == 0){
    c_be = A/C;
  }
  else{
    c_be = A/C + 1;
  }
  
  if(A % D == 0){
    d_be = A/D;
  }
  else{
    d_be = A/D + 1;
  }
  
  if(A % M == 0){
    cd_be = A/M;
  }
  else{
    cd_be = A/M + 1;
  }
  
  int64_t sum_c = 0;
  int64_t sum_d = 0;
  int64_t sum_cd = 0;
  int64_t all_sum = B - A + 1;
  
  for(int64_t i = c_be ; i <= B/C ; i++){
    sum_c++;
  }
  
  for(int64_t i = d_be ; i <= B/D ; i++){
    sum_d++;
  }
  
  for(int64_t i = cd_be ; i <= B/M ; i++){
    sum_cd++;
  }
  
  cout << all_sum - sum_c - sum_d + sum_cd << endl;
}

Measured memory_bytes: 256
#include <cstdio>
#include <cmath>
#include <iostream>
#include <sstream>
#include <string>
#include <vector>
#include <map>
#include <queue>
#include <algorithm>

#ifdef _DEBUG
#define DMP(x) cerr << #x << ": " << x << "\n"
#else
#define DMP(x) ((void)0)
#endif

const int MOD = 1000000007, INF = 1111111111; 
using namespace std;
typedef long long lint;

int main() {

	cin.tie(0);
	ios::sync_with_stdio(false);

	int N;
	vector<int> G(3);
	cin >> N >> G[0] >> G[1] >> G[2];

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

	int cnt, tmp, bit, bitmp;
	int out = INF;
	for (int ran = 0; ran < 100; ran++) {

		random_shuffle(G.begin(), G.end());
		vector<int> ans(3, INF);
		bit = (1 << N) - 1;

		for (int k = 0; k < 3; k++) {

			for (int i = 1; i < (1 << N); i++) {

				cnt = -1, tmp = 0;
				for (int j = 0; j < N; j++) {
					if (i & (1 << j) & bit) {
						cnt++;
						tmp += len[j];
					}
				}

				if (!tmp) continue;

				if (ans[k] > abs(tmp - G[k]) + cnt * 10) {
					ans[k] = abs(tmp - G[k]) + cnt * 10;
					bitmp = ~i;
				}

			}
			bit &= bitmp;
		}
		out = min(out, ans[0] + ans[1] + ans[2]);
	}
	cout << out << "\n";

	return 0;
}

Measured memory_bytes: 256
#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
const ll MOD = 1000000007LL;

int main() {
	int N;
	cin >> N;
	int ans = 0;
	for (int i = 1; i <= N; i += 2) {
		int cnt = 0;
		for (int j = 1; j <= i; j++) if (i%j == 0) cnt++;
		if (cnt == 8) ans++;
	}
	cout << ans << endl;
}


Measured memory_bytes: 256
#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
using ll = long long;
const ll MOD = 1000000007;

ll ka(ll i){
    if(i==0) return 1LL;
    return (i*ka(i))%MOD;
}

int main() {
    int N,T;
    cin >> N >> T;
    vector<ll> vect(N);
    for(int i=0;i<N;i++){
        cin >> vect[i];
    }
    vector<ll> dp(N,0);

    sort(vect.begin(),vect.end());

    dp[0]++;

    for(int i=1; i<N ;i++){
        auto itr = lower_bound(vect.begin(),vect.end(),vect[i] - T);
        int tmp = i - (itr-vect.begin());
        dp[i] = (dp[i-1]*(tmp+1))%MOD;
    }
    cout << dp[N-1] << endl;

    return 0;
}



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

int main() {
  int A, B, H, M;
  cin >> A >> B >> H >> M;
  
  double pi = 3.141592653589793;
  double w_A = pi / 360.0;
  double w_B = pi / 30.0;
  double t_A = (60.0 * H + M) * w_A;
  double t_B = M * w_B;
  
  double t = t_A - t_B;
  double c = cos(t);
  double xx = A*A + B*B - 2.0*A*B*c;
  double x = sqrt(xx);
  cout << fixed << setprecision(10);
  cout << x;

}

Measured memory_bytes: 4144
#include <algorithm>
#include <iostream>
#include <iomanip>
#include <cstring>
#include <string>
#include <vector>
#include <random>
#include <bitset>
#include <queue>
#include <cmath>
#include <stack>
#include <set>
#include <map>
typedef long long ll;
using namespace std;
const ll MOD = 1000000007LL;

class SegmentTree {
    using F = function<ll(ll, ll)>;
    const F f;
    int n, init;
    vector<int> node;

public:
    SegmentTree(int sz, const F f, ll init) : f(f), init(init) {
        n = 1;
        while (n < sz) n <<= 1;
        node.assign(2 * n, init);
    }

    void update(int x, ll val) {
        x += n;
        node[x] = val;
        while (x >>= 1) {
            node[x] = f(node[2 * x + 0], node[2 * x + 1]);
        }
    }

    // [a:b)
    ll query(int a, int b) {
        ll l = init, r = init;
        for (a += n, b += n; a < b; a >>= 1, b >>= 1) {
            if (a & 1) l = f(l, node[a++]);
            if (b & 1) r = f(node[--b], r);
        }
        return f(l, r);
    }
};

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

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

    int n;
    cin >> n;

    SegmentTree seg(n, gcd, 0);
    for (int i = 0; i < n; i++) {
        int a;
        cin >> a;
        seg.update(i, a);
    }

    int ans = 1;
    for (int i = 0; i < n; i++) {
        ans = max(ans, gcd(seg.query(0, i), seg.query(i+1, n)));
    }

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

Measured memory_bytes: 1280
#include <stdio.h>
int main(void)
{
  int a,b;
  scanf("%d%d",&a,&b);
  if(a==1 && b!=1)
  {
    printf("Alice\n");
  }
  else if(a!=1 && b==1)
  {
    printf("Bob\n");
  }
  else if(a>b)
  {
    printf("Alice\n");
  }
  else if(a<b)
  {
    printf("Bob\n");
  }
  else
  {
    printf("Draw\n");
  }
  return 0;
}


Measured memory_bytes: 128
#pragma GCC optimize("Ofast")
#include <bits/stdc++.h>

using namespace std;

//vector string deque break continue
#define forn(i, s, f) for (int i = (int)s; i < (int)f; i++)
#define ll long long
#define ull unsigned long long
#define ld long double
#define pii pair <int, int>
#define fs first
#define sc second
#define pf push_front
#define pb push_back
#define pop_f pop_front
#define pop_b pop_back
#define eb emplace_back
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define sz(x) (int)(x).size()

template <typename T> istream& operator>>(istream& in, vector <T>& a) {for (auto& i : a) in >> i; return in;}
template <typename T> ostream& operator<<(ostream& out, vector <T>& a)  {for (auto& i : a) out << i << " "; return out;}
template <typename T, typename U> void chkmin(T& a, U b) {if (a > b) a = b;}
template <typename T, typename U> void chkmax(T& a, U b) {if (a < b) a = b;}

int main() {
    ios_base::sync_with_stdio(0), cin.tie(0);
    int n;
    cin >> n;
    set <string> a;
    forn (i, 0, n) {
        string s;
        cin >> s;
        a.insert(s);
    }
    cout << sz(a);
    return 0;
}

Measured memory_bytes: 19288
#include<iostream>
#include<vector>

using namespace std;

int main()
{
	int n;
	cin>>n;
	
	vector <int> v;
	for(int i=0;i<n;i++)
	{
		int input;
		cin>>input;
		v.push_back(input);
	}
	
	int ans = 0;
	
	for(int i=0;i<n;i++)
	{
		int product = 0;
		for(int j=n-1;j>i;j--)
		{
			product+=v[j];
		}
		ans+=v[i]*product;
	}
	
	cout<<ans;
	
	return 0;
}

Measured memory_bytes: 256
n,k=map(int,input().split())
s=input()+"d"
d=[]
r=s[0]
c=0
for i in range(n+1):
    if r==s[i]:
        c+=1
    else:
        d.append(c)
        r=s[i]
        c=1
if s[0]=="0":
        d=[0]+d
if s[-2]=="0":
    d+=[0]
if len(d)<=2*k+1:
    print(n)
else:
    l=sum(d[:2*k+1])
    p=sum(d[:2*k+1])
    for i in range((len(d)-2*k-1)//2):
        p=p-d[2*i]-d[2*i+1]+d[2*i+2*k+1]+d[2*i+2*k+2]
        l=max(l,p)
    print(l)

Measured memory_bytes: 4852
#include <bits/stdc++.h>
using namespace std;
#define INF 0x7fffffff
#define lson t << 1, l, mid
#define rson t << 1 | 1, mid + 1, r
#define mem0(x) memset(x, 0, sizeof(x))
#define mem1(x) memset(x, -1, sizeof(x))
#define all(x) x.begin(), x.end()
#define sz(x) x.size()
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define rep(i, a, b) for (int i = a; i < b; i++)
#define per(i, a, b) for (int i = a; i > b; i--)
typedef long long LL;
typedef pair<int, int> pii;
typedef vector<int> vi;
//---------------------------------------------------------//
const int N = 2e5 + 5;

int n, flag, dist1[N], dist2[N], vis[N];
int x, y, z;
vi e[N], path;

void DFS1(int u, int pre, int d)
{
	dist1[u] = d;
	rep(i, 0, sz(e[u]))
	{
		int v = e[u][i];
		if (v == pre)  continue;
		DFS1(v, u, d + 1);
	}
}

void DFS2(int u, int pre, int d)
{
	dist2[u] = d;
	rep(i, 0, sz(e[u]))
	{
		int v = e[u][i];
		if (v == pre)  continue;
		DFS2(v, u, d + 1);
	}
}

void dfs1(int u, int pre)
{
	++x;
	rep(i, 0, sz(e[u]))
	{
		int v = e[u][i];
		if (v == pre || vis[v] == 2)  continue;
		dfs1(v, u);
	}
}

void dfs2(int u, int pre)
{
	++y;
	rep(i, 0, sz(e[u]))
	{
		int v = e[u][i];
		if (v == pre || vis[v] == 1)  continue;
		dfs2(v, u);
	}
}

int main()
{
//	ios::sync_with_stdio(false);
	scanf("%d", &n);
	rep(i, 0, n - 1)
	{
		int u, v;
		scanf("%d%d", &u, &v);
		e[u].pb(v); e[v].pb(u);
	}
	dist1[1] = 0;
	DFS1(1, 0, 0);
	dist2[n] = 0;
	DFS2(n, 0, 0);
//	rep(i, 0, sz(path))  cout << path[i] << " "; cout << endl;
	rep(i, 1, n + 1)
	{
		if (dist1[i] + dist2[i] == dist1[1] + dist2[1])
		{
			if (dist1[i] <= dist1[n] / 2)  vis[i] = 1;
			else  vis[i] = 2;
		}
	}
	dfs1(1, 0);
	dfs2(n, 0);
//	--x; --y; z = dist1[1] + dist2[1] - 1;
//	cout << x << " " << y << " " << z << endl;
//	int X = x + (z + 1) / 2, Y = y + (z - (z + 1) / 2);
	if (x > y)  printf("Fennec\n");
	else  printf("Snuke\n");

	return 0;
}

Measured memory_bytes: 16128
#include <iostream>
#include <algorithm>
#include <functional>
#include <vector>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <string>

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

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

const ll mod = 1000000007;

int main(){
  int n; cin >> n;
  vector<int> p(n), q(n);
  rep(i, n) cin >> p[i];
  rep(i, n) cin >> q[i];
  rep(i, n){
    p[i]--;
    q[i]--;
  }

  vector<int> idx(n);
  rep(i, n) idx[i] = i;
  int a, b;
  int cnt = 1;
  do {
    if (p == idx) a = cnt;
    if (q == idx) b = cnt;
    cnt++;
  } while(next_permutation(idx.begin(), idx.end()));

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


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define REP(i, n) for(int i = 0; i < n; i++)
#define REPR(i, n) for(int i = n; i >= 0; i--)
#define FOR(i, m, n) for(int i = m; i < n; i++)
#define INF 1e9
#define ALL(v) v.begin(), v.end()
#define downque(que)  priority_queue<ll> que;
#define upque(que) priority_queue<ll, vector<int>, greater<int>> que;
typedef long long ll;

int main(){
    int n; cin>>n;
    vector<int> x(n);
    vector<int> y(n);

    REP(i,n){
     int a; cin>>a;
     x[i]=a; y[i]=a;
    }
    
   sort(ALL(y));
   int c1=y[n/2-1];
   int c2=y[n/2];

   REP(i,n){
       if(x[i]<=c1)cout<<c2<<endl;
       else if(x[i>=c2])cout<<c1<<endl;
   }
}

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

using namespace std;
 
int main () {
  
  int64_t n; cin >> n;

  string s[200005];
  for (int i=0; i<n; i++)	cin >> s[i];
  set<string> values;
  for (int i=0; i<n; i++) {
    values.insert(s[i]);
  }
  cout << values.size() << endl;
}

Measured memory_bytes: 25400
n = gets.to_i
a = gets.split.map(&:to_i)
b = gets.split.map(&:to_i)
ans = 0
rest = 0
n.times do |i|
  beat = [b[i] + rest, a[i]].min
  rest = [b[i] - [a[i] - rest, 0].max, 0].max
  ans += beat
end
ans += [rest, a[n]].min
puts ans

Measured memory_bytes: 19612
#include <bits/stdc++.h> 
int main() {
	int k;
   std::cin>>k;
   int a[] = {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};
  std::cout << a[k-1] << std::endl;
}

Measured memory_bytes: 256
#define _CRT_SECURE_NO_WARNINGS 1
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <cstdlib>
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <queue>
#include <climits>
#include <map>
#include <stack>
using namespace std;
#define M_PI 3.141592
#define toRad 2.0*M_PI/360.0
#define inin(x) int x;cin>>x;
#define all(x) x.begin(),x.end()
#define debug(x) cout<<#x<<" "<<x<<endl;
#define rep(i,n) for(int i=0;i<(int)n;i++)
typedef pair<int, int> pii;

int memo[60000] = {};
vector<int> pri;
void calc()
{
	for (int i = 2; i < 60000; i++)
	{
		if (memo[i] == 0)
		{
			pri.push_back(i);
			for (int l = i; l < 60000; l += i)
			{
				memo[l] = 1;
			}
		}
	}
}

int main()
{
	calc();
	int n;
	while (cin >> n)
	{
		cout << *(lower_bound(all(pri), n)-1) << " " << *(upper_bound(all(pri), n)) << endl;
	}
}

Measured memory_bytes: 1504
#include    <bits/stdc++.h>
#define     ll long long
#define     ull unsigned long long
#define     ld long double
#define     prec(k) fixed << setprecision(k)
#define     up(i, k, n) for (int i = k ; i < n ; i ++)
#define     down(i, k, n) for (int i = k ; i >= n ; i --)
#define     ii pair<int, int>
#define     pll pair <ll, ll>
#define     X first
#define     Y second
#define     str basic_string <int>
const int maxN = (int) 1e4 + 7;
const int maxM = (int) 1e5 + 7;
const int maxT = (int) 1e6 + 7;

using namespace std;

static int n, m, low[maxM], num[maxM], parent[maxM], cnt, childnum[maxM];
vector <int> adj[maxM];
static bool IsArticulation[maxM];

void DFS(int u)
{
	num[u] = ++ cnt;
	low[u] = maxT;
	for (auto v : adj[u])
	if (parent[v] == 0)
	{
		parent[v] = u;
		DFS(v);
		low[u] = min(low[u], low[v]);
	}
	else if (parent[v] != 0 && v != parent[u]) low[u] = min(low[u], num[v]);

}

void Bridges()
{
	cout << "Briges :" << '\n';
	up(v, 1, n + 1)
	{
		int u = parent[v];
		if (u != -1 && low[v] >= num[v])
			cout << u << ' ' << v << '\n';
	}
}

void Articulations()
{
	//cout << "Articulations : " << '\n';
	up(v, 1, n + 1)
	{
		int u = parent[v];
		if (u != -1) childnum[u] ++;
	}

	up(u, 1, n + 1)
	IsArticulation[u] = (childnum[u] >= 2 && parent[u] == -1);

	up(v, 1, n + 1)
	{
		int u = parent[v];
		if (u != -1 && parent[u] != -1 && low[v] >= num[u])
			IsArticulation[u] = true;
	}

	up(i, 1, n + 1)
	if (IsArticulation[i]) cout << i - 1 << '\n';
}

void ArticulationAndBridge()
{
	//Bridges();
	Articulations();
}

void solve()
{
	up(u, 1, n + 1)
	if (parent[u] == 0) parent[u] = -1, DFS(u);

	ArticulationAndBridge();
}

void enter()
{
	cin >> n >> m;
	int u, v;
	up(i, 0, m)
	{
		cin >> u >> v;
		u ++, v ++;
		adj[u].push_back(v);
		adj[v].push_back(u);
	}
}

int main()
{
    #ifdef QuanPham
    auto start = chrono::steady_clock::now();
    #endif
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);

    enter();
    solve();

    #ifdef QuanPham
    auto end = chrono::steady_clock::now();
    cerr << "In milliseconds : "
         << chrono::duration_cast<chrono::milliseconds>(end - start).count();
    cerr << '\n' << "In seconds : "
         << chrono::duration_cast<chrono::seconds>(end - start).count() << '\n';
    #endif
    return 0;
}



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

        switch(n%10){
            case 2:
            case 4:
            case 5:
            case 7:
            case 9:
                System.out.println("hon");
                break;
            case 0:
            case 1:
            case 6:
            case 8:
                System.out.println("pon");
                break;
            case 3:
                System.out.println("bon");
                break;
        }
    }
}

Measured memory_bytes: 26912
#include<bits/stdc++.h>
using namespace std;
int main(){
    string a;
    cin >> a;
    int count = 0;
    for(int i = 0;i<a.size()/2;i++){
        if(a.at(i) != a.at(a.size()-i-1))
            count++;
    }
  cout << count << endl;
}

Measured memory_bytes: 256
require 'set'; require 'prime'; require 'pp'
INF=Float::INFINITY; MOD=10**9+7
s, c = gets.chomp.split.map(&:to_i)

if 2*s >= c # c全部使う
  puts c/2
else
  puts s + (c - 2*s) / 4
end




Measured memory_bytes: 14604
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int,int>;

int main() {
    int h1, m1, h2, m2, k;
    cin >> h1 >> m1 >> h2 >> m2 >> k;
    
    int ans = h2 * 60 + m2 - h1 * 60 - m1 - k;
    cout << max(0, ans) << endl;
    
    return 0;
}


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

using namespace std;

#define MAX 100001
#define MOD 1000000007
typedef long long ll;

int bit[MAX], N;

int sum(int i)
{
    int s = 0;
    while (i > 0) {
        s += bit[i];
        i -= i & -i;
    }
    return s;
}

void add(int i, int x)
{
    while (i <= N) {
        bit[i] += x;
        i += i & -i;
    }
}

int main()
{
    ll fact[MAX];    
    fact[0] = 1;
    for (int i = 1; i < MAX; i++) {
        fact[i] = ((ll)i * fact[i-1]) % MOD;
    }
    
    int R, s, t;
    while (cin >> N, N) {
        cin >> R;
        vector<ll> v(N);
        for (int i = 0; i < N; i++) {
            v[i] = i + 1;
        }
        for (int i = 0; i < R; i++) {
            cin >> s >> t;
            s--; t--;
            swap(v[s], v[t]);
        }

        memset(bit, 0, sizeof(bit));
        
        ll res = 0;
        for (int i = N-1; i >= 0; i--) {
            add(v[i], 1);
            res += fact[(N - i - 1)] * sum(v[i]-1);
            res %= MOD;
        }
        cout << res << endl;
    }       
    return 0;
}

Measured memory_bytes: 5044
#include <algorithm>
#include <cstdio>
#include <iostream>
#include <utility>
#include <vector>
using namespace std;

int main(){
  int n;
  scanf("%d", &n);
  for (int i = 0; i < n; i++){
    int t;
    scanf("%d", &t);
    vector<int> d(t, 0);
    for (int j = 0; j < t; j++){
      scanf("%d", &(d[j]));
    }
    int upmax = 0;
    int downmax = 0;
    for (int j = 0; j < t-1; j++){
      if ((d[j+1] > d[j]) && ((d[j+1] - d[j]) > upmax)){
        upmax = d[j+1]-d[j];
      }else if ((d[j+1] < d[j]) && ((d[j] - d[j+1]) > downmax)){
        downmax = d[j]-d[j+1];
      }
    }
    printf("%d %d\n", upmax, downmax);
  }
}

Measured memory_bytes: 1192
using System;
using System.Collections.Generic;
using System.Linq;
using static System.Console;

namespace AtCoder.Probrems.Solvers.ABC129
{
    public class C
    {
        static void Main(string[] args)
        {
            var nm = ReadLine().Split().Select(long.Parse).ToArray();
            var n = nm[0];
            var m = nm[1];
            var ax = new HashSet<long>();
            for (int i = 0; i < m; i++)
            {
                ax.Add(long.Parse(ReadLine()));
            }
            WriteLine(Solve(n, m, ax));
        }

        public static long Solve(long n, long m, HashSet<long> ax)
        {
            var ans = new long[n + 1];
            ans[0] = 1;

            for (int i = 1; i <= n; i++)
            {
                if (ax.Contains(i))
                    continue;

                var f1 = i - 2;
                var f2 = i - 1;
                var a1 = f1 >= 0 ? ans[f1] : 0;
                var a2 = f2 >= 0 ? ans[f2] : 0;
                ans[i] = (a1 + a2) % MOD;
            }
            return ans[n];
        }
        private const int MOD = 1000000007;
    }
}


Measured memory_bytes: 21344
/*
  A - A - Children and Candies (ABC Edit)
  Contest 043
  Rakesh Kumar --> 02/08/2020
 */

#include <bits/stdc++.h>

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

    int n = 0;
    std::cin >> n;
    std::cout << ((n * (n + 1)) >> 1) << std::endl;

    return 0;
}


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

using namespace std;

typedef pair<int,int> pint;
int man[10002];
pint box[500];
int dp[10001];
int inf=1000000000;
int main(){
    int m,n;
    cin>>m>>n;
    for(int i=1;i<=m;++i) cin>>man[i];
    for(int i=0;i<n;++i) cin>>box[i].first>>box[i].second;
    sort(man+1,man+m+1,greater<int>());
    for(int i=0;i<m;++i){
        man[i+1] +=man[i];
        dp[i]=inf;
    }
    dp[m]=inf;
    dp[0]=0;
    for(int i=0;i<n;++i){
        for(int j=m;j>=0;--j){
            dp[j]=min(dp[j],dp[max(j-box[i].first,0)]+box[i].second);
        }
    }
    int ans=0;
    for(int i=0;i<=m;++i) ans=max(ans,man[i]-dp[i]);
    cout<<ans<<endl;
    return 0;
}

Measured memory_bytes: 3236
#include <iostream>
#include <vector>
#include<iomanip>
#include <algorithm>
using namespace std;
typedef long long ll;
#define rep(i,n) for(int i=0;i<(n);i++)

static const int MAX = 1e5;
int t[MAX+1];
int x[MAX+1];
int y[MAX+1];
int N;

int main(int argc, const char * argv[]) {
    int i;
    cin >> N;
    for (i = 0; i < N; i++)
        cin >> t[i] >> x[i] >> y[i];
    int sx, sy, st;
    sx = 0;
    sy = 0;
    st = 0;
    bool flag = true;
    for (i = 0; i < N; i++) {
        int r = abs(sx + sy - (x[i] + y[i]));
        int rt = t[i] - st;
        if (r > rt) {
            flag = false;
        }
        if ((rt - r) % 2 != 0) {
            flag = false;
        }
    }
    
    if (flag)
        cout << "Yes" << endl;
    else {
        cout << "No" << endl;
    }
    return 0;
}

Measured memory_bytes: 1408
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using Graph = vector<vector<int>>;
const int MOD = 1e9 + 7;

Graph G;
vector<vector<ll>> dp;

void dfs(int v, int p = -1) {
    if (dp[v][0] && dp[v][1])
        return;

    dp[v][0] = dp[v][1] = 1;

    for (auto nv : G[v]) {
        if (p == nv)
            continue;
        dfs(nv, v);
        (dp[v][0] *= (dp[nv][0] + dp[nv][1])) %= MOD;
        (dp[v][1] *= dp[nv][0]) %= MOD;
    }
}

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

    int N;
    cin >> N;
    G.resize(N);
    dp.resize(N, vector<ll>(2));
    for (int i = 0; i < N - 1; ++i) {
        int x, y;
        cin >> x >> y;
        x--, y--;
        G[x].push_back(y);
        G[y].push_back(x);
    }

    int s = 0;
    dfs(s);
    cout << (dp[s][0] + dp[s][1]) % MOD << endl;

    return 0;
}


Measured memory_bytes: 18176
#include <stdio.h>
#include <string>
#include <cstring>
#include <stdlib.h>
#include <math.h>
#include <algorithm>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <list>
#include <iterator>
#include <assert.h>
#pragma warning(disable:4996) 

typedef long long ll;
#define MIN(a, b) ((a)>(b)? (b): (a))
#define MAX(a, b) ((a)<(b)? (b): (a))
#define LINF 9223300000000000000
#define INF 2140000000
const long long MOD = 1000000007;
using namespace std;


int main(int argc, char* argv[])
{
    int x,a;
    scanf("%d%d", &x,&a);
    if(x<a) {
        printf("0\n");
    }
    else {
        printf("10\n");
    }









    return 0;
}


Measured memory_bytes: 128
import java.util.Scanner;
public class Main{
    public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    String A = sc.next();
    String B = sc.next();
    int count = 0;
    for(int i = 0; i<A.length();i++){
      if(A.charAt(i) != B.charAt(i)){
        count++;
      }
    }
    System.out.println(count);
  }
}


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

using namespace std;

int a[5001];
int f[3001][3001], g[3001][3001], h[3001][3001];
const int mod = 998244353;
int n, s, ans = 0;
int main( ) {
	scanf("%d %d", &n, &s);
	for (int i = 1; i <= n; i ++) scanf("%d", &a[i]);
	f[0][0] = g[0][0] = h[0][0] = 1;
	for (int i = 1; i <= n; i ++) {
	//	g[i][0] = h[i][0] = 1;
		for (int j = s; j >= 0; j --) {
			if (j >= a[i]) {
				f[i][j] = (f[i - 1][j] + f[i - 1][j - a[i]]) % mod;
				g[i][j] = (f[i - 1][j] + f[i - 1][j - a[i]]) % mod;
			}
			else {
				f[i][j] = f[i - 1][j];
				g[i][j] = f[i - 1][j];
			}
		}
		f[i][0] = (f[i][0] + 1) % mod;
		for (int j = 0; j <= s; j ++) h[i][j] = (h[i - 1][j] + f[i][j]) % mod;
	}
	printf("%d\n", h[n][s]);
	return 0;
}


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

using namespace std;

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

typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<string> vs;
typedef pair<int, int> pii;
typedef long long ll;

#define all(a)  (a).begin(),(a).end()
#define rall(a) (a).rbegin(), (a).rend()
#define pb push_back
#define mp make_pair
#define each(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define exist(s,e) ((s).find(e)!=(s).end())
#define range(i,a,b) for(int i=(a);i<(b);++i)
#define rep(i,n)  range(i,0,n)
#define clr(a,b) memset((a), (b) ,sizeof(a))
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;

const double eps = 1e-10;
const double pi  = acos(-1.0);
const ll INF =1LL << 62;
const int inf =1 << 29;

struct team{
	int a,t,n;
	bool operator<(const team &arg)const{
		if(a==arg.a&&t==arg.t) return n<arg.n;
		if(a==arg.a) return t<arg.t;
		return a>arg.a;
	}
};

team info[55];

int wrong[55][11];

int main(void){
	int t,p,r;
	while(cin >> t >> p >> r){
		if(t==0)
			break;
		rep(i,55)rep(j,11) wrong[i][j]=0;
		rep(i,55) info[i].a=info[i].t=0,info[i].n=i+1;
		rep(i,r){
			int tid,pid,times;
			cin >> tid >> pid >> times;
			string m;
			cin >> m;
			if(wrong[tid][pid]!=-1){
				if(m=="CORRECT"){
					info[tid-1].a++;
					info[tid-1].t+=(times+1200*wrong[tid][pid]);
					wrong[tid][pid]=-1;
				}else
					wrong[tid][pid]++;
			}
		}
		sort(info,info+t);
		rep(i,t) cout << info[i].n << " " << info[i].a << " " << info[i].t << endl;
	}
	return 0;
}

Measured memory_bytes: 1236
n,k = map(int, input().split())
r,s,p = map(int, input().split())
T = input()

def get_score(te):
    if te == "r":
        return p
    elif te == "s":
        return r
    elif te == "p":
        return s
    else:
        return 0

ans = 0
for i in range(k):
    tmp = list(T[i::k])
    # print(tmp)
    for j in range(len(tmp) -1):
        if tmp[j] == tmp[j+1]:
            tmp[j+1] = "x"
    # print(tmp)
    for j in range(len(tmp)):
        ans += get_score(tmp[j])
    # print(ans)

print(ans)

Measured memory_bytes: 4084
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <sstream>
#include <queue>
#include <deque>
#include <bitset>
#include <iterator>
#include <list>
#include <stack>
#include <map>
#include <set>
#include <functional>
#include <numeric>
#include <utility>
#include <limits>
#include <time.h>
#include <math.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <assert.h>

using namespace std;

#define debug(x) cout << '>' << #x << ':' << x << endl;
#define loop(i,n) for(int i=0;i<(n);i++)
#define fori(a,b,i) for(int i=(a);i<=(b);i++)
#define ford(a,b,i) for(int i=(a);i>=(b);i--)
#define fast_io ios_base::sync_with_stdio(false) , cin.tie(NULL);


#define INF 0x3f3f3f3f
#define PI 3.1415926535897932384626433832795
#define MOD 1000000007

#define fir first
#define sec second
#define pb push_back
#define mp make_pair

typedef pair<int, int> PII;
typedef vector<int> VI;
typedef vector<string> VS;
typedef vector<PII> VII;
typedef vector<VI> VVI;
typedef map<int,int> MII;
typedef set<int> SI;
typedef long long int llint;


int main(){
	fast_io;
	int n, m;
    cin>>n>>m;
    if(n < m){
        while(m--){
            cout<<n;
        }
    }
    else{
        while(n--){
            cout<<m;
        }
    }
    //else cout<<"No";
	return 0;
}


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

using namespace std;
int v[200003];
int n, st, dr, sol, k;

bool solve(int usu)
{
    int act = 0;

    for(int i = 1; i <= n; ++i)
    {
        if(v[i] <= usu) continue;
        act += (v[i] / usu + (v[i] % usu != 0) - 1);
        if(act > k) return 0;
    }

    return act <= k;
}

int main()
{
    ios::sync_with_stdio(false);
    cin >> n >> k;
    for(int i = 1; i <= n; ++i)
    {
        cin >> v[i];
        dr = max(dr, v[i]);
    }

    st = 1;

    while(st <= dr)
    {
        int mij = (st + dr) / 2;
        if(solve(mij))
        {
            sol = mij;
            dr = mij - 1;
        }
        else st = mij + 1;
    }

    cout << sol;
    return 0;
}


Measured memory_bytes: 4324
n, q = gets.chomp.split.map(&:to_i)
A = []
n.times{ 
    A.push([])
}

q.times{
    choice, t, x = gets.chomp.split(" ").map(&:to_i)
    case choice
    when 0
        A[t].push(x)
    when 1
        puts A[t][-1] unless A[t][-1].nil?
    when 2
        A[t].pop
    end
    }


Measured memory_bytes: 9660
#include <bits/stdc++.h>
using namespace std;
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; }

// 二項係数を用いる
const int MAX = 1000100;
const int MOD = 1000000007;

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

  // テーブルを作る前処理
  /* facが普通の階乗を求めている。invが逆数を求めている。finvが逆数の階乗を求めている。*/
void COMinit() {
    fac[0] = fac[1] = 1;
    finv[0] = finv[1] = 1;
    inv[1] = 1;
    for(int i = 2; i < MAX; i++) {
        fac[i] = fac[i-1] * i % MOD;
        inv[i] = MOD - inv[MOD%i] * (MOD/i) % MOD;
        finv[i] = finv[i-1] * inv[i] % MOD;
    }
}

  // 二項係数を計算する
long long COM(int n, int k) {
    if(n < k) return 0;
    if(n < 0 || k < 0) return 0;
    return fac[n] * (finv[k] * finv[n-k] % MOD) % MOD;
}

long long nn, kk;

int main() {
    cin >> nn >> kk;
    COMinit();
    long long ans = 0;
    for(int i = 0; i < min(nn, kk+1); ++i) {
        long long sum = COM(nn, i);
        sum *= COM(nn-1, i);
        sum %= MOD;
        ans += sum;
        ans %= MOD;
    }
    cout << ans << endl;
}

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

int main() {
    int N; cin >> N;
    int A[100010], B[100010];
    for(int i=0; i<N; ++i) cin >> A[i] >> B[i];
    long S=0;
    for(int i=N-1; i>=0; --i){
        if((S+A[i])%B[i]) S += B[i] - (S+A[i])%B[i];
    }
    cout << S << endl;
	return 0;
}


Measured memory_bytes: 1024
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i,n) for(int (i)=0;(i)<(int)(n);++(i))
#define all(x) (x).begin(),(x).end()
#define pb push_back
#define fi first
#define se second
#define dbg(x) cout<<#x" = "<<((x))<<endl
template<class T,class U> ostream& operator<<(ostream& o, const pair<T,U> &p){o<<"("<<p.fi<<","<<p.se<<")";return o;}
template<class T> ostream& operator<<(ostream& o, const vector<T> &v){o<<"[";for(T t:v){o<<t<<",";}o<<"]";return o;}

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

    vector<int> a;
    map<int,vector<int>> idx;
    a.pb(-1);
    rep(i,n){
        int t;
        scanf(" %d", &t);
        a.pb(t);
        idx[t].pb(i+1);
    }
    a.pb(-1);

    n += 2;
    vector<bool> sink(n);
    sink[0] = sink[n-1] = true;

    int now = 1;
    if(idx.count(0)){
        for(int i:idx[0]){
            sink[i] = true;
            if(sink[i-1] && sink[i+1]) --now;
            if(!sink[i-1] && !sink[i+1]) ++now;
        }
    }

    int ans = now;
    for(const auto &p:idx){
        if(p.fi == 0) continue;
        for(int i:p.se){
            sink[i] = true;
            if(sink[i-1] && sink[i+1]) --now;
            if(!sink[i-1] && !sink[i+1]) ++now;
        }
        ans = max(ans,now);
    }

    printf("%d\n", ans);
    return 0;
}



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

bool map[8][8] = { 0 };
int siz[3] = { 1,2,3 }, dir[2][4] = { {1,0, -1,0},{0,1,0,-1} };
void bomb(int x, int y) {
	if (x < 0 || y < 0 || x >= 8 || y >= 8 || !map[y][x]) return;

	map[y][x] = false;
	for (int i = 0; i < 4; i++) {
		for (int j = 0; j < 3; j++) {
			bomb(x + dir[0][i] * siz[j], y + dir[1][i] * siz[j]);
		}
	}
}

int main() {
	int n, x, y;
	string str;
	cin >> n;
	for (int l = 1; l <= n; l++) {
		for (int i = 0; i < 8; i++) {
			cin >> str;

			for (int j = 0; j < 8; j++) {
				if (str[j] == '1') map[i][j] = true;
				else map[i][j] = false;
			}
		}
		cin >> x >> y;
		bomb(x - 1, y - 1);

		cout << "Data " << l << ":" << endl;
		for (int i = 0; i < 8; i++) {
			for (int j = 0; j < 8; j++) {
				cout << map[i][j];
			}
			cout << endl;
		}
	}

	return 0;
}

Measured memory_bytes: 3136
#include <bits/stdc++.h>
#define REP(i, n) for (int i = 0; (i) < (int)(n); ++ (i))
#define REP3(i, m, n) for (int i = (m); (i) < (int)(n); ++ (i))
#define REP_R(i, n) for (int i = (int)(n) - 1; (i) >= 0; -- (i))
#define REP3R(i, m, n) for (int i = (int)(n) - 1; (i) >= (int)(m); -- (i))
#define ALL(x) begin(x), end(x)
using namespace std;

bool solve(int n, const vector<int> & s) {
    multiset<int, greater<int> > a(ALL(s));
    vector<int> cur, prv;
    cur.push_back(*a.begin());
    a.erase(a.begin());
    REP (i, n) {
        prv = cur;
        for (int x : prv) {
            auto it = a.upper_bound(x);
            if (it == a.end()) return false;
            cur.push_back(*it);
            a.erase(it);
        }
    }
    return true;
}

int main() {
    int n; cin >> n;
    vector<int> s(1 << n);
    REP (i, 1 << n) {
        cin >> s[i];
    }
    cout << (solve(n, s) ? "Yes" : "No") << endl;
    return 0;
}


Measured memory_bytes: 15348
#include<bits/stdc++.h>
#include<iostream>
#include<cstdio>
#include<cstring>
#include<algorithm>
#include<cmath>
#define ll long long
#define PB push_back
#define POP pop_back()
#define PII pair<int,int>
#define FI first
#define SE second
#define ULL unsigned long long
#define endl '\n'
using namespace std;
const int INF=0x3f3f3f3f;
const double pi=acos(-1),eps=1e-8;

int main()
{

	long double a,b;
	cin>>a>>b;
	ll ans=a*b;
	cout<<ans<<endl;
 	return 0;
}







Measured memory_bytes: 3728
import sys
def rs(): return sys.stdin.readline().rstrip()
def ri(): return int(sys.stdin.readline())
def ria(): return list(map(int, sys.stdin.readline().split()))
def ws(s): sys.stdout.write(s); sys.stdout.write('\n')
def wi(n): sys.stdout.write(str(n)); sys.stdout.write('\n')
def wia(a, sep=' '): sys.stdout.write(sep.join([str(x) for x in a])); sys.stdout.write('\n')


def solve(n, k):
    return 0


def main():
    n = ri()
    a = ria()
    cnt = 0
    for i in range(n):
        if i % 2 == 0 and a[i] % 2 == 1:
            cnt += 1
    wi(cnt)


if __name__ == '__main__':
    main()


Measured memory_bytes: 61832
#include<bits/stdc++.h>
 
#define IOS ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define int long long
#define rep(i,a,b)    for(int i=a;i<b;i++)
#define repn(i,a,b)   for(int i=a;i>=b;i--)
#define F first
#define S second
#define pii pair<int,int>
#define vi vector<int>
#define vii vector<pii>
#define pb push_back
#define mp  make_pair
#define all(v) (v).begin(), (v).end()
#define mod 1000000007
 
using namespace std;

int i,j,k;
 
int max(int a, int b)
{
    if(a>b) return a;
    else return b;
}
 
int min(int a,int b)
{
    if(a<b) return a;
    else return b;
}

int fast_power(int a,int b)
{
    int res=1;
    while(b>0)
    {
        if(b%2==0)
        {
            b/=2;
            a=(a*a)%mod;
        }
        else
        {
             b/=2;
             res=(res*a)%mod;
            a=(a*a)%mod;
        }
    }
    return res;
}

signed main()
{
    IOS;
    int n,m;
    cin>>n>>m;
    cout<<(n*(n-1)/2)+(m*(m-1)/2);
    
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define lsb(x) (x & (-x))
#define ll long long
// 82

using namespace std;

const int MOD = (int) 1e9 + 7;
const int MAXN = (int) 1e5;
const ll INF = (1LL << 60);

vector < pair <int, int> > g[MAXN + 1];

struct Edge {
    int x, y;
    int d;
}edges[2 * MAXN + 1];

ll dst[2][MAXN + 1];
int dp[2][MAXN + 1];

priority_queue < pair <ll, int> > pq;

int n;

inline void mod(int &x) {
    if(x >= MOD)
        x -= MOD;
}

inline void dijkstra(int nod, bool t) {
    int i;
    for(i = 1; i <= n; i++) {
        dst[t][i] = INF;
    }
    dp[t][nod] = 1;
    dst[t][nod] = 0;
    pq.push({0, nod});
    while(!pq.empty()) {
        ll d = -pq.top().first;
        nod = pq.top().second;
        pq.pop();
        if(d != dst[t][nod])
            continue;
        for(auto it : g[nod]) {
            if(dst[t][it.first] > dst[t][nod] + it.second) {
                dst[t][it.first] = dst[t][nod] + it.second;
                dp[t][it.first] = dp[t][nod];
                pq.push({-dst[t][it.first], it.first});
            }
            else if(dst[t][it.first] == dst[t][nod] + it.second) {
                dp[t][it.first] += dp[t][nod];
                mod(dp[t][it.first]);
            }
        }
    }
}



int main() {
    //ifstream cin("A.in");
    //ofstream cout("A.out");
    int i, m, s, t, x, y, d;
    ios::sync_with_stdio(false);
    cin >> n >> m;
    cin >> s >> t;
    for(i = 1; i <= m; i++) {
        cin >> x >> y >> d;
        g[x].push_back({y, d});
        g[y].push_back({x, d});
        edges[i] = {x, y, d};
    }
    dijkstra(s, 0);
    dijkstra(t, 1);
    int ans = (1LL * dp[0][t] * dp[0][t]) % MOD;
    for(i = 1; i <= n; i++) {
        if(dst[0][i] == dst[0][t] / 2 && dst[1][i] == dst[0][t] / 2) {
            int ways = (1LL * dp[0][i] * dp[1][i]) % MOD;
            ans = (ans - (1LL * ways * ways) % MOD);
            if(ans < 0)
                ans += MOD;
        }
    }
    for(i = 1; i <= m; i++) {
        x = edges[i].x;
        y = edges[i].y;
        d = edges[i].d;
        if(dst[0][x] > dst[0][y])
            swap(x, y);
        if(dst[0][x] + dst[1][y] + d == dst[0][t] && min(dst[0][x], dst[1][y]) + d > max(dst[0][x], dst[1][y])) {
            int ways = (1LL * dp[0][x] * dp[1][y]) % MOD;
            ans = (ans - (1LL * ways * ways) % MOD);
            if(ans < 0)
                ans += MOD;
        }
    }
    cout << ans;
    //cin.close();
    //cout.close();
    return 0;
}


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


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

struct edge {int to; ll cost; };

int dx[] = {-1, 1, 0,  0};
int dy[] = { 0, 0, 1, -1};
 
int main(){
  int h, w, k;
  cin >> h >> w >> k;
  vector<vector<int>> a(h, vector<int>(w, 0));
  int s = 0;
  int bith=1<<h, bitw=1<<w;
  for(int i=0; i<h; i++){
    for(int j=0; j<w; j++){
      char c;
      cin >> c;
      if(c=='#'){
        a[i][j]=1;
        s++;
      }
    }
  }
  int sw[w]={}, sh[h]={};
  for(int i=0; i<w; i++){
    for(int j=0; j<h; j++){
      sw[i] += a[j][i];
      sh[j] += a[j][i];
    }
  }
  k = s-k;
  int ans = 0;
  for(int i=0; i<bith; i++){
    for(int j=0; j<bitw; j++){
      int tmp = 0;
      for(int l=0; l<h; l++) if (i & (1<<l)) tmp+=sh[l];
      for(int m=0; m<w; m++) if (j & (1<<m)) tmp+=sw[m];
      for(int l=0; l<h; l++) {
        for(int m=0; m<w; m++){
          if ((i & (1<<l)) && (j & (1<<m))) tmp -= a[l][m];
        }
      }
      if(tmp == k) ans++;
    }
  }
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 3624
N, M = map(int,input().split())
K = [list(map(int,input().split())) for i in range(N)]

SS = []
for k in K:
    for s in k[1:]:
        SS.append(s)

SS_d = [x for x in set(SS) if SS.count(x) > N-1]

print(len(SS_d))

Measured memory_bytes: 3060
import Control.Monad
import Data.Maybe
import qualified Data.ByteString.Char8 as BS
import Data.Array.Unboxed
import Data.Bits
import Data.List
import qualified  Data.ByteString as B


bsToInt :: BS.ByteString -> Int
bsToInt = fst . fromJust . BS.readInt

bsToIntList :: BS.ByteString -> [Int]
bsToIntList = map bsToInt . BS.words

main :: IO ()
main = do 
    (n:m:_) <- bsToIntList <$> BS.getLine
    as <- bsToIntList <$> BS.getLine
    let rst = n - sum as
    let res = if rst < 0 then -1 else rst
    print $ res

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

string N;

signed main() {
    cin.tie(0); ios::sync_with_stdio(false);
    cin >> N;
    int fx = 0;
    rep(i, N.size()) fx += N[i]-'0';
    if (stoi(N)%fx==0) cout << "Yes" << endl;
    else cout << "No" << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define fast ios_base::sync_with_stdio(0); cin.tie(NULL); cout.tie(NULL);
#define endl '\n'
#define fr(i,a,b) for(ll i=a; i<b; i++)
#define fr1(i,a,b) for(ll i=a; i>=b; i--)
#define ll long long int
#define ld long double
#define vi vector<ll>
#define pb push_back
#define all(v) (v).begin(),(v).end()
#define mp(i,j) make_pair(i,j)
#define fi first
#define se second
#define input(a,n) fr(i,0,n)cin>>a[i]
#define output(a,n) fr(i,0,n)cout<<a[i]<<" "
#define dbg cout<<"hurr"<<endl;
#define dbg2 cout<<"hurr2"<<endl;
#define md 1000000007
#define sp << " " <<
#define pi 3.14159265358979323846
#define fixd(x) cout << fixed << setprecision(x);

int main()
{
    fast;
    string s,t,ans="";
    cin >> s >> t;
    ll n=s.size(),m=t.size();
    ll dp[n+1][m+1];
    fr(i,0,n+1)
        dp[i][0]=0;
    fr(i,0,m+1)
        dp[0][i]=0;
    fr(i,1,n+1)
    {
        fr(j,1,m+1)
        {
            if(s[i-1]==t[j-1])
                dp[i][j]=dp[i-1][j-1]+1;
            else
                dp[i][j]=max(dp[i-1][j],dp[i][j-1]);
        }
    }
    while(n>0 && m>0)
    {
        if(s[n-1]==t[m-1])
        {
            ans+=s[n-1];
            n--;
            m--;
        }
        else if(dp[n][m-1]>dp[n-1][m])
            m--;
        else
            n--;
    }
    fr1(i,ans.size()-1,0)
        cout << ans[i];
}

Measured memory_bytes: 70656
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll maxn=1e18;

int main()
{
    ll n,h,w;
    scanf("%lld%lld%lld",&n,&h,&w);
    ll ans=0;
    for(int i=1;i<=n;i++)
    {
        ll a;
        ll b;
        scanf("%lld%lld",&a,&b);
        ll cnt=min(a/h,b/w);
        ans+=cnt;
    }
    printf("%lld\n",ans);
   return 0;
}


Measured memory_bytes: 256
#pragma GCC optimize("Ofast")
#include <bits/stdc++.h>
//#include <conio.h>
using namespace std;
 
typedef long long int ll;
typedef pair<ll,ll> pll;
 
#define rep(i,n)	for(ll i=0;i<(n);i++)
#define SZ(x) ((ll)x.size())
#define pb push_back
#define pf push_front
#define popb pop_back
#define popf pop_front
#define F first
#define S second
#define int ll
#define IOS ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
// const ll MOD = INT_MAX;
const double PI = acos(-1);
 
void openfile(){
	freopen("in.txt", "r", stdin);
	freopen("out.txt", "w", stdout);
}
const int N = 23;
const int MOD = 1e9+7;
int dp[1 << N];
int a[N][N];

void add(int& a,int b){
	a += b;
	if(a > MOD)	a -= MOD;
}
 
 
signed main(){
	IOS
	int n;	cin >> n;
	rep(i,n){
		rep(j,n)	cin >> a[i][j];
	}
	dp[0] = 1;
	rep(mask,(1 << n) - 1){
		int i = __builtin_popcount(mask);
		rep(j,n){
			if(a[i][j] && !(mask & (1 << j)))
			add(dp[mask ^ (1 << j)], dp[mask]);
		}
	}
	cout << dp[(1 << n) - 1] << endl;
 
}

Measured memory_bytes: 18688