akhauriyash/Code-Regression huggingface dataset:
#include<iostream>
#include<string.h>
#include<ctype.h>
#include<string>
#include<math.h>
#include<iomanip>
#include<algorithm>
#include<vector>
#include<stack>
#include<queue>
#define pi 3.141592653589
#define rep(i,a,n) for(int i=a;i<n;i++)
#define INF 1e9
#define LINF 1e17
#define ll long long
#define MOD (int)(1e9+7)
#define pii pair<int,int>
using namespace std;


int main() {

	string n;

	cin >> n;
	if (n[0] == n[1] && n[1] == n[2])cout << "Yes" << endl;
	else if (n[3] == n[1] && n[1] == n[2])cout << "Yes" << endl;
	else cout << "No" << endl;
	
	return 0;
}

Measured memory_bytes: 256
#include <iostream>
using namespace std;
int main(void){
    double n=100000;
    int a;
    cin>>a;
    for(int i=0; i<a; i++){
        n*=1.05;
        n=(int)(n+999)/1000*1000;
        
    }
    cout<<(int)n<<endl;
}



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

# define pb push_back
# define fr first
# define sc second
# define mk make_pair

using namespace std;

const long long linf = 1e18 + 7;
const int inf = 1e9 + 7;
const int N = 1e6 + 5;

typedef long long ll;

int n, pref[N];

int main(){
      cin >> n;

      for(int i = 1; i <= n; i ++){
            int l, r;
            scanf("%d %d", &l, &r);
            pref[l] ++;
            pref[r + 1] --;
      }

      for(int i = 1; i <= 1e5; i ++)
            pref[i] += pref[i - 1];

      int ans = 0;

      for(int i = 1; i <= 1e5; i ++){
            if(pref[i]) ans ++;
      }

      cout << ans << endl;
}


Measured memory_bytes: 640
h,w,m=map(int,input().split())
HH=[]
WW=[]
HW=set()
lh=[0]*(h+1)
lw=[0]*(w+1)
for _ in range(m):
    h1,w1=map(int,input().split())
    lh[h1]+=1
    lw[w1]+=1
    HW.add((h1,w1))
lhmax=max(lh)
lwmax=max(lw)
maxh=[]
maxw=[]
for i in range(1,h+1):
    if lh[i]==lhmax:
        maxh.append(i)
for i in range(1,w+1):
    if lw[i]==lwmax:
        maxw.append(i)

if len(maxh)*len(maxw)>m:
    print(lhmax+lwmax)
else:
    flag=True
    for i in maxh:
        for j in maxw:
            if (i,j) not in HW:
                flag=False
                break
    if flag==True:
        print(lhmax+lwmax-1)
    else:
        print(lhmax+lwmax)

Measured memory_bytes: 166544
//#include<bits/stdc++.h>
#include<iostream>
#include<vector>
#include<algorithm>
#include<cmath>
#include<set>
#include<queue>
#include<deque>
#include<map>
#include<stack>
#include<bitset>
#include<list>
#include<cassert>
#include<numeric>
#include<iomanip>
 
using namespace std;

const long long N = 1e5;
long long ps[N];
long long a[N];
long long n;

bool isval(long long k)
{
	long long sum = ps[k + 1];
	for (long long i = k + 1; i < n; i++)
	{
		if (sum * 2 < a[i])
		{
			return false;
		}
		sum += a[i];
	}
	return true;
}

long long bsearch()
{
	long long up = n;
	long long down = -1;
	while (up - down > 1)
	{
		long long md = (up + down) / 2;
		if (isval(md))
		{
			up = md;
		}
		else
		{
			down = md;
		}
	}
	return up;
}

int main() 
{
	cin >> n;
	for (long long i = 0; i < n; i++)
	{
		cin >> a[i];
	}
	sort(a, a + n);
	for (long long i = 1; i <= n; i++)
	{
		ps[i] = ps[i - 1] + a[i - 1];
	}
	long long tmp = bsearch();
	cout << n - tmp << endl;

}

 

Measured memory_bytes: 1792
#include <iostream>
#include <string>
#include <vector>
#include <math.h>
#include <stdio.h>
#include <algorithm>
#include <cmath>
#include <cstdlib>
#include <stack>
#include <istream>
#include <map>
#include <set>
#include <queue>
#define rep0(i,n) for (int i = 0; i <= (n); ++i)
#define rep1(i,n) for (int i = 1; i <= (n); ++i)
#define REP(a,b) for (int i = a; i <= (b); ++i) 
#define mREP(a,b) for (int i = a; i == (b); --i) 
typedef long long ll;
using namespace std;
int main() {
cin.tie(0);
ios::sync_with_stdio(false);
/*
	　　　  　 ,ﾍ／L──- 、
	　　　   　Lﾆ)r_」=＝= ｲ
	　　 　,ﾍ、i ﾉノλﾉﾊﾉﾍ
	　　   ,'　｀(ﾊﾘ ﾟ ヮﾟﾉi)　',
	　　 .i　　 >〈(つ,i!と)　　i
	　　  vﾍγk´_/___i,ゝﾍノ
	　　　　　 ｀ﾞr_,ｨ_ｧﾞ´
*/
int a, b,n;
cin >> n >> b;
int count = 0;
a = 1;
rep0(i, n - 1) {
	if (a * 2 > a + b) {
		a += b;
	}
	else {
		a *= 2;
	}
}
cout << a << endl;
return 0;
}


Measured memory_bytes: 256
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <climits>
#include <cfloat>
#include <ctime>
#include <cassert>
#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 CLEAR(arr, val) memset(arr, val, sizeof(arr))

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

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

const double EPS = 1e-8;
const double PI = acos(-1.0);
const int dx[] = { 0, 1, 0, -1 };
const int dy[] = { 1, 0, -1, 0 };
bool valid_pos(int x, int y, int w, int h) { return 0 <= x && x < w && 0 <= y && y < h; }



int ck(const vector<int>& v, int k)
{
	int res = 0;
	for (int i = 0; i + k <= v.size(); ++i)
	{
		int s = 1;
		for (int j = 0; j < k; ++j)
			s *= v[i + j];
		max_swap(res, s);
	}
	return res;
}
int main()
{
	ios::sync_with_stdio(false);

	int n, k;
	while (cin >> n >> k, n)
	{
		vector<int> v(n);
		for (int i = 0; i < n; ++i)
			cin >> v[i];

		int ori = ck(v, k);
		int res = -1;
		for (int i = 0; i < n; ++i)
		{
			for (int j = i + 1; j < n; ++j)
			{
				vector<int> u = v;
				swap(u[i], u[j]);

				max_swap(res, ck(u, k) - ori);
			}
		}
		cout << res << endl;
	}
}

Measured memory_bytes: 0
#include <bits/stdc++.h>
    #include <ext/pb_ds/assoc_container.hpp>
    #include <ext/pb_ds/tree_policy.hpp>
    #include <ext/pb_ds/detail/standard_policies.hpp>
    using namespace std;
    using namespace __gnu_pbds;
    #define ll long long
    #define int long long
    #define pb push_back
    #define For(i,n) for(ll  i=0;i<n;i++)
    #define fast ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL) ;clock_t clk = clock();
    #define f(a,b,c) for(ll a=b;a<c;a++)
    #define mod 1000000007
    #define ld long double
    #define read(t) ll t;cin>>t;
    #define all(x) x.begin(),x.end()
    #define fi first
    #define se second
    #define pii pair<ll,ll>
    #define what_is(x) cerr << #x << " is " << x << endl;
    #define time cerr << "Time (in ms): " << double(clock() - clk) * 1000.0 / CLOCKS_PER_SEC << '\n';
    const double pi=3.14159265358979323846264;
    typedef tree<long long,null_type,less<long long>,rb_tree_tag,tree_order_statistics_node_update> ordered_set;
    typedef tree<long long,null_type,greater<long long>,rb_tree_tag,tree_order_statistics_node_update> ordered_set1;

/**********************************************************************************************************************/



signed main()/*question galat mat padhna yr*/
{
    fast;   
    string a,b;
    cin>>a>>b;
    if(a.substr(0,a.length())==b.substr(0,a.length()))
    {
        cout<<"Yes"<<endl;
    }
    else cout<<"No"<<endl;
}   

Measured memory_bytes: 3640
#include <iostream>
using namespace std;
int main(void){
    int n,x,i,j,cards[4][13] = {{0}};
    char ch;
    cin >> n;
    for(i=0;i<n;i++){
        cin >> ch >> x;
        if(ch=='S'){
            cards[0][x-1]=1;
        }else if(ch=='H'){
            cards[1][x-1]=1;
        }else if(ch=='C'){
            cards[2][x-1]=1;
        }else if(ch=='D'){
            cards[3][x-1]=1; 
        }
    }
    for(i=0;i<4;i++){
        for(j=0;j<13;j++){
            if(cards[i][j]==0){
                if(i==0){
                    cout << "S"<< " " <<j+1;
                    cout << endl;
                }else if(i==1){
                    cout << "H" << " " << j+1;
                    cout << endl;
                }else if(i==2){
                    cout << "C" << " " << j+1;
                    cout << endl;
                }else if(i==3){
                    cout << "D" << " " << j+1;
                    cout << endl;
                }
            }
        }
    }
}


Measured memory_bytes: 3084
/**
 *    author:  tourist
 *    created: 12.01.2020 10:08:26       
**/
#include <bits/stdc++.h>

using namespace std;

class matching {
 public:
  vector<vector<int>> g;
  vector<int> pa;
  vector<int> pb;
  vector<int> was;
  int n, m;
  int res;
  int iter;

  matching(int _n, int _m) : n(_n), m(_m) {
    assert(0 <= n && 0 <= m);
    pa = vector<int>(n, -1);
    pb = vector<int>(m, -1);
    was = vector<int>(n, 0);
    g.resize(n);
    res = 0;
    iter = 0;
  }

  void add(int from, int to) {
    assert(0 <= from && from < n && 0 <= to && to < m);
    g[from].push_back(to);
  }

  bool dfs(int v) {
    was[v] = iter;
    for (int u : g[v]) {
      if (pb[u] == -1) {
        pa[v] = u;
        pb[u] = v;
        return true;
      }
    }
    for (int u : g[v]) {
      if (was[pb[u]] != iter && dfs(pb[u])) {
        pa[v] = u;
        pb[u] = v;
        return true;
      }
    }
    return false;
  }

  int solve() {
    while (true) {
      iter++;
      int add = 0;
      for (int i = 0; i < n; i++) {
        if (pa[i] == -1 && dfs(i)) {
          add++;
        }
      }
      if (add == 0) {
        break;
      }
      res += add;
    }
    return res;
  }

  int run_one(int v) {
    if (pa[v] != -1) {
      return 0;
    }
    iter++;
    return (int) dfs(v);
  }
};

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n;
  cin >> n;
  vector<int> a(n), b(n), c(n), d(n);
  for (int i = 0; i < n; i++) {
    cin >> a[i] >> b[i];
  }
  for (int i = 0; i < n; i++) {
    cin >> c[i] >> d[i];
  }
  matching mat(n, n);
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      if (a[i] < c[j] && b[i] < d[j]) {
        mat.add(i, j);
      }
    }
  }
  cout << mat.solve() << '\n';
  return 0;
}


Measured memory_bytes: 256
N, M =list(map(int, input().split()))
ks_list = [list(map(int, input().split())) for _ in range(M)]
p_list = list(map(int, input().split()))
cnt = 0
for i in range(2**N):
    cond = bin(i)[2:].zfill(N)
    tmp = 1
    # cond = 11010: スイッチ1,2,4がON
    for j, ks in enumerate(ks_list):
        p = 0
        s_list = ks[1:]
        for s in s_list:
            p += int(cond[s-1])
        if (p%2 != p_list[j]):
            tmp = 0
            break
    if (tmp == 1):
        cnt += 1
print(cnt)


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

// THINGS TO REMEMBER
// ENDL is slow, '\n' is fast
// Clear everything (including graphs) between test cases
// use anti-anti-hash: https://codeforces.com/blog/entry/62393
// pb-ds: https://codeforces.com/blog/entry/11080
// check when to use LLONG_MAX/LLONG_MIN vs INT_MAX or INT_MIN
// You frequently suffer from confirmation bias - you trust your initial solution and miss simple things. 
// When you hit a roadblock, remember to rethink the solution ground up, not just try hacky fixes

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

    string s;
    cin>>s;

    for(int i=0;i<s.length();i++){
    	if(s[i]=='?')s[i]='D';
    }
    cout<<s<<endl;
}

Measured memory_bytes: 3740
/*
  ∧,,∧
( 'ω' )つ ＜WA,またお前か！！　
（m9 ＼ 　　
　 ＼　 ＼
　 　 ) ) ＼
　 ／／ ＼ ＼
　 (＿） 　 (＿)
*/

#include <bits/stdc++.h>
using namespace std;

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

typedef long long LL;
typedef long double LD;

bool compare_by_a(pair<int, int> a, pair<int, int> b) {
    if(a.first != b.first){
        return a.first < b.first;
    }else{
        return a.second < a.second;
    }
}

bool compare_by_b(pair<int, int> a, pair<int, int> b) {
    if(a.second != b.second){
        return a.second < b.second;
    }else{
        return a.first < b.first;
    }
}

int main()
{
    //入力
    int N, M;
    cin >> N >> M;
    vector<int> coor(M, 0); //各座標を格納
    for (int i = 0; i < M; i++)
        cin >> coor[i];

    //処理
    int temp, cnt, ans;
    vector<pair<int, int>> ivl(M - 1, {0, 0});  //各座標の間隔とインデックスを格納
    vector<int> copy(M-1, 0);             //ivl.firstのコピー
    vector<int> split(M - 1, 0);                //コマが移動しない所を決定
    vector<int> len(N, 0);                      //各コマの動く距離を格納

    sort(all(coor));

    for (int i = 0; i < M-1; i++) {
        ivl[i].first = coor[i+1] - coor[i];
        ivl[i].second = i;
    }

    for (int i = 0; i < M-1; i++)
        copy[i] = ivl[i].first;

    sort(all(ivl), compare_by_a);   //ivlを間隔の大きさでソート

    if (N >= M) {   //NがM以上のときは0を返して終了
        cout << 0 << endl;
        return 0;
    } else {
        for (int i = 1; i <= N-1; i++) { //N-1回の分割を行う
            split[ivl[M-1-i].second] = 1;
        }

        temp, cnt = 0;
        for (int j = 0; j < M-1; j++) {
            if (split[j]) {
                len[cnt++] = temp;
                temp = 0;
            } else {
                temp += copy[j];
            }
        }
        len[N-1] = temp;

        ans = 0;
        for (int i = 0; i < N; i++)
            ans += len[i];

        cout << ans << endl;
        return 0;
    }
}


Measured memory_bytes: 2560
from collections import deque

n, q = map(int, input().split())
ab = [[] for _ in range(n)]
px = [0 for _ in range(n)]
for i in range(n - 1):
    a, b = map(int, input().split())
    ab[a - 1].append(b - 1)
    ab[b - 1].append(a - 1)
for i in range(q):
    p, x = map(int, input().split())
    px[p - 1] += x

ans = px
queue = deque([(0, 0)])
while len(queue) > 0:
    prev, a = queue.pop()
    for c in ab[a]:
        if c != prev:
            ans[c] += ans[a]
            queue.append((a, c))

print(*ans)


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

/* macro */
#define rep(i,a,b) for(int i=a;i<b;i++)
#define revrep(i,a,b) for(int i = a; i > b; i--)
#define int long long
#define exist(s,e) ((s).find(e)!=(s).end())
#define all(v) (v).begin(), (v).end()
#define each(s,itr) for(auto (itr) = s.begin(); (itr) != s.end(); (itr)++)
#define sum(v) accumulate(all(v), (0LL))
#define isin(a, b, c) (b <= a && a <= c)
#define println cout << "\n";
#define sz(v) (int)v.size()


/* alias */
template<class T> using vec = vector<T>;
typedef vector<int> vi;
typedef pair<int, int> pi;
typedef tuple<int, int, int> ti;
typedef map<int, int> mi;
typedef set<int> si;


/* constant */
const int inf = 1LL << 62;
const int mod = 1e9 + 7;
const int dx[8]={1,0,-1,0,-1,1,-1,1};
const int dy[8]={0,1,0,-1,-1,-1,1,1};
const string alphabet = "abcdefghijklmnopqrstuvwxyz";

/* io_method */
int input(){int tmp;cin >> tmp;return tmp;}
string raw_input(){string tmp;cin >> tmp;return tmp;}
template<class T> void printx(T n){cout << n;}
template<class T, class U> void printx(pair<T, U> p){cout << "(" << p.first << "," << p.second << ")";}
template<class T, class U, class V> void printx(tuple<T, U, V> t){cout << "{" << get<0>(t) << "," << get<1>(t) <<"," << get<2>(t) << "}" << endl;}
template<class T> void printx(vector<T> v){cout << "{";rep(i,0,v.size()){printx(v[i]);if(i != v.size()-1)printx(",");}cout << "}";}
template<class T> void print(T n){printx(n);cout << endl;}
template<class T> void print(set<T> s){cout << "{";each(s, e){if(e != s.begin()) printx(",");printx(*e);}cout << "}" << endl;}
template<class T, class U> void print(map<T, U> mp){cout << "{";each(mp, e){cout << "(" << e -> first << "," << e -> second << ")";}cout << "}" << endl;}
template<class T> void printans(vec<T> v){rep(i,0,sz(v)){cout << v[i] << (i == sz(v) - 1 ? "" : " ");}cout << endl;}


/* general_method */
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
template<class T>T cut(T &a, int l, int r){return T(a.begin()+l, a.begin()+r);}

/* main */

int n, m;
void in(){
    cin >> n >> m;
}

int divide3(int a, int b){ // divide a
    if(a % 3 == 0){
        return 0;
    }else{
        return b;
    }
}

int ceil(int a, int b){
    return a / b + (a % 2 == 1);
}

int dividetate(int a, int b){
    int ans = inf;
    rep(i,1,a - 1){
        int rest = a - i;
        int ret = max({i * b, b / 2 * rest, ceil(b, 2) * rest}) - min({i * b, b / 2 * rest, ceil(b, 2) * rest});
        chmin(ans, ret);
    }
    return ans;
}


void solve(){

    int ans = inf;
    if(n == 2 && m == 2){
        print(1);
        return ;
    }


    chmin(ans, divide3(n, m));
    chmin(ans, divide3(m, n));
    chmin(ans, dividetate(n, m));
    chmin(ans, dividetate(m, n));

    print(ans);


}

signed main(){

    cin.tie(0);
    ios::sync_with_stdio(false);
    in();
    solve();
    
}

Measured memory_bytes: 256
A, B, C, K = map(int, input().split())

if K % 2 == 0:
    if A - B > 10 ** 18:
        print('Unfair')
    else:
        print(A - B)
else:
    if B - A > 10 ** 18:
        print('Unfair')
    else:
        print(B - A)

Measured memory_bytes: 2940
#include<bits/stdc++.h>
using namespace std;
#define ll int64_t
#define f first
#define sec second
#define pb push_back
#define pf push_front
#define pbb pop_back
#define vi vector<ll>
#define vii vector< pair<ll,ll> >
#define pi pair<ll,ll>
#define map map<ll,ll>
#define set set<ll>
const int mod=1e9+7;
int main(){
    
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int n;
    cin>>n;
    double p[n];
    for(int i=0;i<n;i++){
        cin>>p[i];
    }
    double dp[n+1][n+1];
    memset(dp,0.0,sizeof(dp));
    dp[0][0]=1.0;
    for(int i=1;i<=n;i++){
        for(int j=0;j<=i;j++){
            if(j==0)
            dp[i][j]=dp[i-1][j]*(1.0-p[i-1]);
            else
            dp[i][j]=dp[i-1][j]*(1.0-p[i-1])+dp[i-1][j-1]*p[i-1];
        }
    }
    double ans=0.0;
    for(int i=n/2+1;i<=n;i++){
        ans+=dp[n][i];
    }
    cout<<setprecision(12)<<ans<<endl;
}

Measured memory_bytes: 70656
#include <iostream>

using namespace std;

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

int main() {
	int temp, K;
	long long sum = 0;
	cin >> K;
	for (int a = 1; a <= K; a++) {
		for (int b = 1; b <= K; b++) {
			temp = gcd(a, b);
			for (int c = 1; c <= K; c++) {
				sum += gcd(temp, c);
			}
		}
	}
	cout << sum << endl;
	return 0;
}



Measured memory_bytes: 3636
n = int(input())
a = list(map(int, list(input().split())))

minus_num = 0

for i in range (n):
    if a[i] <= 0:
        minus_num = minus_num + 1
        a[i] = - a[i]

if minus_num % 2 == 0:
    print(sum(a))
else:
    print(sum(a) - min(a) * 2)

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

#define PI 3.1415926535897932
#define MOD 1000000007
#define INF 1e9

#define REP(i, n) for(int i = 0; i < n; i++)
#define FOR(i, start, end) for(int i = (start); i < (end); i++)
#define ALL(v) (v).begin(), (v).end()
#define BETWEEN(a, x, b) (a) <= (x) && (x) <= (b) 

using namespace std;

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


void solve()
{
    int n, k, x, y;
    cin >> n >> k >> x >> y;
    cout << min(n, k) * x + max((n-k), 0) * y << endl;;
}

int main()
{
    cin.tie(nullptr);
    ios_base::sync_with_stdio(false);
    cout << fixed << setprecision(15);
    solve();

    return 0;
}

Measured memory_bytes: 256
N=int(input())
S=input()

r=S.count('R')
g=S.count('G')
b=S.count('B')

ad=r*g*b
mi=0

for i in range(N):
    for j in range(i+1,N):
        k=j+(j-i)
        if k<N:
            if S[i] != S[j] and S[j] != S[k] and S[k] != S[i]:
                mi+=1

print(ad-mi)

Measured memory_bytes: 73744
public class Main {
    private static java.util.Scanner scanner = new java.util.Scanner(System.in);

    public static void main(String[] args) {
        long x = scanner.nextLong();
        System.out.println(x / 11 * 2 + (x % 11 == 0 ? 0 : (x % 11 + 5) / 6));
    }
}

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

#define ll long long int
#define vi vector<int>
#define vc vector<char>
#define vl vector<ll>
#define vii vector<pair<int,int>>
#define vll vector<pair<ll,ll>>
#define pb push_back
#define el '\n'
#define N 1000000007
#define re return
#define PI 3.14159265
#define take(a,n) for(int i=0;i<(n);i++) cin>>(a)[i]
#define out(a,n) for(int i=0;i<n;i++) cout<<a[i]<<" ";
#define all(a) (a).begin(),(a).end()
#define forup(i,n) for(int (i)=0;i<(n);(i)++)
#define ford(i,n) for(int (i)=(n)-1;i>=0;(i)--)
using namespace std;


ll poww(ll a,ll b)
{
  ll ans=1;
  for(int i=1;i<=b;i++)
  {
    ans*=a;
  }
  return ans;
}


int max(int a,int b,int c)
{
  if(a>=b && a>=c) return a;
  if(b>=a && b>=c) return b;
  return c;
}

ll ncr(int n,int r)
{
  ll ans=1;
  forup(i,r)
  {
    ans=(ans*(n-i)/(i+1))%N;
  }
  re ans;
}

int main()
{
  ll n,b;
  cin>>n;
  ll ans=0;
  ans=(n*(n-1))/2;

  cout<<ans;
}


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

using namespace std;

typedef long long ll;

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.precision(15);
    int a, b;
    cin >> a >> b;
    if (a * b % 2 == 1) {
        cout << "Yes\n";
    } else {
        cout << "No\n";
    }
    return 0;
}



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

template<typename T>
istream& operator >> (istream& istr, vector<T>& v){
    for(T& x: v) istr >> x;
    return istr;
}

template<typename T, typename U>
istream& operator >> (istream& istr, pair<T,U>& p){
    istr >> p.first >> p.second;
    return istr;
}

template<typename T>
ostream& operator << (ostream& ostr, vector<T>& v){
    if(!v.empty()){
        ostr << v.front();
        for(auto itr = ++v.begin(); itr != v.end(); itr++)
            // ostr << *itr;
            ostr << " " << *itr;
    }
    return ostr;
}

template<typename T, typename U>
ostream& operator << (ostream& ostr, pair<T,U>& p){
    // ostr << p.first << p.second;
    ostr << p.first << ", " << p.second;
    return ostr;
}

template<typename T>
ostream& operator << (ostream& ostr, vector<vector<T>>& vv){
    if(!vv.empty()){
        ostr << vv.front();
        for(auto itr = ++vv.begin(); itr != vv.end(); itr++)
            ostr << endl << *itr;
    }
    return ostr;
}

template<typename T, typename U>
ostream& operator << (ostream& ostr, vector<pair<T,U>>& vp){
    if(!vp.empty()){
        ostr << vp.front();
        for(auto itr = ++vp.begin(); itr != vp.end(); itr++)
            ostr << endl << *itr;
    }
    return ostr;
}

typedef long long ll;
typedef vector<ll> vll;
typedef vector<char> vc;
typedef vector<double> vd;
// vll x(n); x[i]=a;
typedef vector<vll> vvll;
typedef vector<vc> vvc;
typedef vector<vd> vvd;
// vvll x(m,vi(n)); x[i][j]=a;
typedef pair<ll,ll> pll;
typedef pair<double,double> pd;
typedef vector<pll> vpll;
typedef vector<pd> vpd;
// vpll x(n); x[i]={a,b}; x[i].first/second;

#define PI 3.1415926535897932
#define EPS 1e-12
#define INF (ll)1e12
#define REP(i,n) for(ll i=0; i<(n); i++)
#define RREP(i,n) for(ll i=(n)-1; i>=0; i--)
#define FOR(i,a,b) for(ll i=(a); i<(b); i++)
#define FORR(i,a,b) for(ll i=(b)-1; i>=(a); i--)
#define fix(x) cout << fixed << setprecision(x)
#define dump(x) cout << #x << " = " << (x) << endl
#define all(x) (x).begin(),(x).end()

template<typename T> T sum(vector<T> &v) {return accumulate(all(v), (T)0LL);}
template<typename T> void sort(vector<T> &v){sort(all(v));}
template<typename T> void rsort(vector<T> &v){sort(all(v), greater<T>());}

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

int main(){
    ll n, ans = 0;
    cin >> n;
    vll h(n), dp(n,INF);
    cin >> h;

    dp[0] = 0;
    dp[1] = abs(h[1]-h[0]);

    FOR(i,2,n){
        chmin(dp[i], dp[i-1]+abs(h[i]-h[i-1]));
        chmin(dp[i], dp[i-2]+abs(h[i]-h[i-2]));
    }
    cout << dp[n-1] << endl;
    return 0;
}


Measured memory_bytes: 1792
#include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<n;i++)
typedef long long ll;
typedef vector<int> vec;
int main(){
  string a;
  cin>>a;
  if(a[0]==a[1]&&a[1]==a[2])cout<<"No";
  else cout<<"Yes";
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <cstring>
using namespace std;
int main()
{
	int n;
	while(cin>>n,n){
		vector<int> taro,hana;
		int num[201];
		memset(num,0,sizeof(num));
		
		for(int i=0; i<n; i++){
			int a; cin>>a;
			num[a]=1;
		}
		
		for(int i=1; i<=2*n; i++){
			if( num[i] )taro.push_back(i);
			else 			hana.push_back(i);
		}
		
		int i,j,turn=1;
		int ba = 0;
		for(i=0,j=0; taro.size() && hana.size();){
			if( turn ){
				int k;
				for(k=0; k<taro.size(); k++)
					if( ba<taro[k] ){
						//printf("t:%d\n",taro[k]);
						ba = taro[k];
						break;
					}
				if( k==taro.size() )ba=0;
				else taro.erase( taro.begin()+k );
				
			}else{
				int k;
				for(k=0; k<hana.size(); k++)
					if( ba<hana[k] ){
						//printf("h:%d\n",hana[k]);
						ba = hana[k];
						break;
					}
				if( k==hana.size() )ba=0;
				else hana.erase( hana.begin()+k );
			}
			turn ^= 1;
		}

		printf("%d\n%d\n",hana.size(),taro.size());
	}
	return 0;
}

Measured memory_bytes: 0
#include <string>
#include <iostream>
using namespace std;
int main()
{
    string s;
    cin >> s;
    int len_s = s.length();
    int max_len = 0;
    for (int start = 0; start < len_s; start++)
    {
        for (int len = 1; len <= len_s; len++)
        {
            string substr = s.substr(start, len);

            int len_substr = substr.length();
            bool is_atcg = true;
            for (int i = 0; i < len_substr; i++)
            {
                char c = substr[i];
                if (c != 'A' && c != 'T' && c != 'C' && c != 'G')
                {
                    is_atcg = false;
                }
            }
            if (is_atcg)
            {
                if (max_len < len_substr)
                {
                    max_len = len_substr;
                }
            }
        }
    }
    cout << max_len << endl;
}


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

int main() {
	long long int ans = 1 ,num = 1,name[5], n = 0;
	int N;
	string s;
	for (int i = 0; i < 5;i++) {
		name[i] = 0;
	}
	cin >> N;
	for (int i = 0; i < N;i++) {
		cin >> s;
		if (s[0] == 'M') {
			name[0]++;
		}
		else if (s[0] == 'A') {
			name[1]++;
		}
		else if (s[0] == 'R') {
			name[2]++;
		}
		else if (s[0] == 'C') {
			name[3]++;
		}
		else if (s[0] == 'H') {
			name[4]++;
		}
	}

	for (int i = 0; i < 5;i++) {
		if (name[i] > 0) {
			n++;
		}
	}
	if (n < 3) {
		ans = 0;
	}
	else if(n == 3){
		for (int i = 0; i < 5; i++) {
			if (name[i] > 0) {
				ans *= name[i];
			}
		}
	}
	else if (n == 4) {
		ans = 0;
		for (int i = 0; i < 5; i++) {
			if (name[i] > 0) {
				num *= name[i];
			}
		}
		for (int i = 0; i < 5;i++) {
			if (name[i] > 0) {
				ans += num / name[i];
			}
		}
	}
	else {
		ans = 0;
		for (int i = 0; i < 3;i++) {
			for (int j = i+1; j < 4;j++) {
				for (int k = j + 1; k < 5; k++) {
					ans += name[i] * name[j] * name[k];
				}
			}
		}
	}
	
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<string>

using namespace std;

int main(){
    string s,t,u;
    int a,b;

    cin >> s >> t;
    cin >> a >> b;
    cin >> u;

    if(s == u){
        cout << a-1 << " " << b << endl;
    }else{
        cout << a << " "<< b-1 << endl;
    }

    return 0;

}

Measured memory_bytes: 256
#include <cstdio>
#include <cstring>
#include <algorithm>
 
using namespace std;
 
int main(){
  int N,X,Y;
  char x[1024],y[1024];
  int dp[1024][1024];
  scanf("%d",&N);
  while(N--){
    scanf("%s%s", x, y);
    X = strlen(x); Y = strlen(y);
    memset(dp, 0, sizeof dp);
    for(int i=0;i<X;i++){
      for(int j=0;j<Y;j++){
    if(x[i]==y[j]) dp[i+1][j+1] = dp[i][j]+1;
    else dp[i+1][j+1] = max(dp[i+1][j], dp[i][j+1]);
      }
    }
    printf("%d\n", dp[X][Y]);
  }
  return 0;
}

Measured memory_bytes: 5132
n,m=map(int,input().split())
citydic={}
for i in range(m):
    p,y=map(int,input().split())
    add=[i,p,y]
    temp=citydic.get(p,[])
    temp.append(add)
    citydic[p]=temp

#print(citydic)
def make_id(p):
    dif=6-len(str(p))
    res="".join(["0" for i in range(dif)])
    return res+str(p)

ansdic={}
for key, v in citydic.items():
    l=sorted(v,key=lambda x: x[2])
    #print(l)
    for x, templ in enumerate(l,1):
        #makeid
        citynum,p,y=templ
        id1=make_id(p)+make_id(x)
        ansdic[citynum]=id1

for i in range(m):
    print(ansdic[i])


Measured memory_bytes: 101336
s = ""
while True:
    try:
        sent = input()
    except:
        break
    s += sent
    
ch=['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r',
 's','t','u','v','w','x', 'y', 'z']

sl=s.lower()

for c in ch:
    cnt=sl.count(c)
    print("{} : {}".format(c,cnt))

Measured memory_bytes: 7420
#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <fstream>
#include <limits.h>
#include <math.h>
#include <queue>
#include <set>

using namespace std;



int main() {
	ios::sync_with_stdio(false);

	string filename = "date";

	//ifstream cin(filename + ".in");
	//ofstream cout(filename + ".out");
	
	int n;
	cin >> n;

	vector< pair<int, int> > vec(n);
	vector< int > ans(n);

	for (int i = 0; i < n; ++i) {
		cin >> vec[i].first;
		vec[i].second = i;
	}

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

	for (int i = 0; i < n; ++i) {
		if (i < n / 2) ans[vec[i].second] = vec[n / 2].first;
		else ans[vec[i].second] = vec[n / 2 - 1].first;
	}

	for (int i = 0; i < n; ++i) {
		cout << ans[i] << "\n";
	}
	
	//system("pause");
	return 0;
}

Measured memory_bytes: 4608
#include<iostream>
#include<cstring>
#include<cstdlib>
#include<string>
#include<cstdio>
using namespace std;
char a[1000001];

int main()
{
	cin>>a;
	int na=strlen(a);
	if(na%2!=0)
	{
		cout<<"No";
		return 0;
	}
	for(int i=0;i<na/2;++i)
	{
		if(a[i]=='b') a[i]='d';
		else if(a[i]=='d') a[i]='b';
		else if(a[i]=='p') a[i]='q';
		else if(a[i]=='q') a[i]='p';
	}
	int bz1=0,bz2=na-1;
	while(bz1<=bz2)
	{
		if(a[bz1]!=a[bz2])
		{
			cout<<"No";
			return 0;
		}
		bz1++;
		bz2--;
	}
	cout<<"Yes";
	return 0;
}

Measured memory_bytes: 384
n=int(input())
a=input()
b=input()
c=input()

ans=0

for i in range(n):
    if a[i]==b[i]:
        if b[i]!=c[i]:
            ans+=1
    else:
        if b[i]==c[i]:
            ans+=1
        elif a[i]==c[i]:
            ans+=1
        else:
            ans+=2

print(ans)

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

const long long mod = 1e9+7;
const int N = 1e5+5;

#define ll long long
#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define fr(i,l,m) for(int i=l;i<m;i++)

int dir[N],deg[N];
vector<pair<int,int> > adj[N];
vector<pair<int,int> > edge;
bool visited[N];

void dfs(int node)
{
    visited[node]=1;
    for(auto i:adj[node])
    {

        if(!visited[i.ff])
        {
            dfs(i.ff);
            if(deg[i.ff]&1)
            {
                int id = i.ss;
                if(edge[id].ff==node)
                {
                    deg[node]++;
                    deg[i.ff]--;
                }
                else
                {
                    deg[node]--;
                    deg[i.ff]++;
                }
                dir[id]=1;
            }
        }
    }
}

int main()
{
int n,m,u,v;
    cin>>n>>m;
    fr(i,0,m)
    {
        cin>>u>>v;
        edge.pb(mp(u,v));
        adj[u].pb(mp(v,i));
        adj[v].pb(mp(u,i));
        deg[u]++;
    }
    if(m&1)
    {
        cout<<-1<<endl;
        return 0;
    }
    bool flag=1;
      dfs(1);
    if(!flag){cout<<-1<<endl;}
    else{
    fr(i,0,m)
    {
        if(!dir[i])cout << edge[i].ff << " " << edge[i].ss << "\n";
        else cout << edge[i].ss << " " << edge[i].ff << "\n";
    }
    cout<<endl;
    }
return 0;
}

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

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

    vector<int> a(N);
    for (int i = 0; i < N; i++) {
        cin >> a.at(i);
    }

    sort(a.begin(), a.end(), greater<int>());

    int ans = 0;
    for (int i = 0; i < N; i++) {
        if (i % 2 == 0) {
            ans += a.at(i);
        } else {
            ans -= a.at(i);
        }
    }

    cout << ans << endl;
}

Measured memory_bytes: 256
N = int(input())
L=[[int(j) for j in input().split()] for i in range(N)]
from math import factorial, sqrt
from itertools import permutations
S = 0
def k(a, b):
    return sqrt((a[0] - b[0])**2 + (a[1] - b[1])**2)
for l in permutations(L):
    S += sum([k(l[i], l[i+1]) for i in range(N-1)])

print(S/factorial(N))

Measured memory_bytes: 3064
#include<stdio.h>

int main(void){
  int a,b;
  scanf("%d %d",&a,&b);
  int i;
  if(a<b){
    for(i=1;i<=b;i++){
      printf("%d",a);
    }
  }else{
    for(i=1;i<=a;i++){
      printf("%d",b);
    }
  }
  
  return 0;
}

Measured memory_bytes: 128
#include<bits/stdc++.h>
#include <array>
using namespace std;
using ULL = unsigned long long;
using UL = unsigned;
using LL = long long;
#define rep(i, n) for(UL i = 0; i < (n); i++)

template<class Ty>
using passive_queue = priority_queue<Ty, vector<Ty>, greater<Ty>>;

struct Problem {

	void Solve() {
		UL M, N; cin >> N >> M;
		UL S = 0;
		vector<UL> A(N); rep(i, N) cin >> A[i];
		sort(A.rbegin(), A.rend());
		rep(i, N) S += A[i];
		if (A[M - 1] * 4 * M < S)cout << "No" << endl;
		else cout << "Yes" << endl;
	}

	Problem();
};
int main() {
	unique_ptr<Problem> p(new Problem());
	p->Solve();
	return 0;
}
Problem::Problem() {
	cout << fixed << setprecision(10);
}


Measured memory_bytes: 256
#include <iostream>
#include <iomanip>
#include <utility>
#include <cmath>
#include <random>
#include <vector>
#include <map>
#include <set>
#include <deque>
#include <queue>
#include <stack>
#include <string>
#include <algorithm>
using namespace std;

#define rep(i,n) for(int i = 0; i<n; ++i)
#define REP(i,n) for(int i = 1; i<=n; ++i)
#define all(x) begin(x),end(x)
#define show(obj) {for(auto x:obj)cout<<x<<' ';cout<<endl;}
#define line "----------"
typedef long long ll;
typedef pair<int,int> P;
const int inf = 1001001000;
const ll INF = 1LL<<60;
const ll MOD = 1e9 + 7;

int seg_len;
int seg[1000000];

void add(int l, int r, int x){
	l += seg_len-1;
	r += seg_len-1;
	while(l<r){
		if(l % 2 == 1){seg[l] += x; ++l;}
		l /= 2;
		if(r % 2 == 1){seg[r-1] += x; --r;}
		r /= 2;
	}
}

int get(int i){
	int k = i+seg_len-1;
	int res = 0;
	while(k>0){
		res += seg[k];
		k /= 2;
	}
	return res;
}

bool check(int N){
	bool ans = true;
	rep(i,N)if(get(i) < N)ans = false;
	return ans;
}

int main(){
	int N,K; cin>>N>>K;
	seg_len = 1;
	while(seg_len <= N)seg_len *= 2;
	int a,l,r;
	rep(i,N){
		cin>>a;
		l = max(0, i-a);
		r = min(N-1, i+a)+1;
		add(l,r,1);
	}
	int cnt = 1;
	--K;
	vector<int> tmp(N);
	while(!check(N) && K>0){
		rep(i,N){
			tmp[i] = get(i);
		}
		rep(i,seg_len*2+10)seg[i] = 0;
		rep(i,N){
			int t = tmp[i];
			l = max(0, i-t);
			r = min(N-1, i+t)+1;
			add(l,r,1);
		}
		--K;
		++cnt;
	}
	rep(i,N)cout<<min(get(i), N)<<endl;
	return 0;
}

Measured memory_bytes: 6164
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <set>
#include <stack>
#include <queue>
#include <cstdio>
#include <cmath>
#include <cstring>
#include <cstdlib>

using namespace std;
typedef long long LL;
static const double EPS = 1e-9;

#define FOR(i,k,n) for (int i=(k); i<(int)(n); ++i)
#define REP(i,n) FOR(i,0,n)

int main(void){
  int n;
  while(cin>>n){
    if(n==-1) break;
    if(n==0){
      printf("0\n");
      continue;
    }
    stack<int> stk;
    while(n!=0){
      stk.push(n%4);
      n/=4;
    }
    while(!stk.empty()){
      printf("%d",stk.top());
      stk.pop();
    }
    printf("\n");
  }
  return 0;
}

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

int main() {
  int n, k;
  int h[1000010];

  cin >> n >> k;

  for (int i = 0; i < n; i++) {
    cin >> h[i];
  }

  int ans = 0;
  for (int i = 0; i < n; i++) {
    if (h[i] >= k) {
      ans++;
    }
  }
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 2304
#include <iostream>
#include <cstdio>
#include <cstring>
#include <math.h>
#include <algorithm>
using namespace std;
const int MAXSIZE = 1e5+7;
const int INF = 0x3fffffff;
struct point 
{
	double x, y;
};
typedef point Point;
int keep[MAXSIZE];
Point dots[MAXSIZE];
bool comxy(Point a, Point b){
	if(a.x != b.x)
		return a.x < b.x;
	return a.y < b.y;
}
bool cmpy(int a, int b){
	return dots[a].y < dots[b].y;
}
double distent(int a, int b){
	return sqrt((dots[a].x - dots[b].x) * (dots[a].x - dots[b].x) + (dots[a].y - dots[b].y) * (dots[a].y - dots[b].y));
}
double divSolve(int left, int right){
	double dis = INF;
	if(left == right)
		return dis;
	if(left + 1 == right)
		return distent(left, right);
	int mid = (left + right) >> 1;
	double wayf = divSolve(left, mid);
	double ways = divSolve(mid + 1, right);
	dis = min(wayf, ways);
	int k = 0;
	for(int i = left; i <= right; i++){
		if(fabs(dots[mid].x - dots[i].x) <= dis){
			keep[k++] = i;
		}
	}
	sort(keep,keep+k,cmpy);
	for(int i = 0; i < k; i++){
		for(int j = i+1; j < k && (dots[keep[j]].y - dots[keep[i]].y) < dis; j++){
			dis = min(dis, distent(keep[j],keep[i]));
		}
	}
	return dis;
}
int main(){
	int n;
	while(~scanf("%d",&n)){
		memset(keep,0,sizeof(keep));
		for(int i = 0; i < n; i++){
			scanf("%lf %lf",&dots[i].x, &dots[i].y);
		}
		sort(dots, dots+n, comxy);
		double res = divSolve(0,n-1);
		printf("%0.10lf\n", res);
	}
	return 0;
}


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

typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;

const ll mod = 1000000007;

ll inv(ll n){
	if(n == 1)return 1;
	return (mod - mod/n)*inv(mod%n)%mod;
}

int main(){
	ios::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);
	cout<<setprecision(32);

	int x, y;
	cin>>x>>y;
	if((x + y)%3){
		cout<<0<<endl;
		exit(0);
	}
	int a = y - (x + y)/3;
	int b = x - (x + y)/3;
	if(a < 0 || b < 0){
		cout<<0<<endl;
		exit(0);
	}
	ll num = 1, den = 1;
	for(int i = 1; i <= b; i++){
		(num *= (a + i)) %= mod;
		(den *= i) %= mod;
	}
	ll ans = num*inv(den)%mod;
	cout<<ans<<endl;

	return 0;
}

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

const int N = 1e5 + 7;

int n, res, k, a[N];
vector <int> ad[N];

int dfs(int v, int d) {
	int mx = d;
	for (auto u: ad[v]) {
		int t = dfs(u, d + 1);
		if (t - d == k) {
			if (v == 1)
				continue;
			res++;
			t = d;
		}
		mx = max(mx, t);
	}
	return mx;
}

int main() {
	cin >> n >> k;
	for (int i = 1; i <= n; i++) {
		cin >> a[i];
		if (i == 1) {
			if (a[i] != 1)
				a[i] = 1, res++;
		}
		else
			ad[a[i]].push_back(i);
	}
	dfs(1, 0);
	cout << res;
	return 0;
}


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

using namespace std;

typedef long long ll;

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

    int n;
    cin >> n;
    vector<int> a(n);
    for (int i = 0; i < n; i++) {
        cin >> a[i];
    }
    int ans = 1e9;

    for (int t = -100; t <= 100; t++) {
        int cur = 0;
        for (int b : a) {
            cur += (b - t) * (b - t);
        }
        ans = min(ans, cur);
    }
    cout << ans << '\n';
       
    
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int main() {
	int n, k;
	scanf("%d%d", &n, &k);
	long long ans = 0ll;
	for (int b = 1; b <= n; b++) {
		if (b <= k)
			continue;
		ans += (n / b) * (b - k);
		int tmp = n - (n / b) * b;
		if (tmp > 0 && tmp >= k)
			ans += min(tmp, tmp - k + 1);
	}
	printf("%lld", ans);
}

Measured memory_bytes: 384
//#include <bits/stdc++.h>
#include<iostream>
#include<cstdio>
#include<math.h>
using namespace std;

int main()
{
  long double a,b;
  cin>>a>>b;
  printf("%.0Lf",floor(a*b));
  //cout<<endl;
  return 0;
}

Measured memory_bytes: 3796
#include <iostream>
#include <iomanip>
#include<math.h>
#include<list>
#include <algorithm>
#include<set>
#include<vector>
#include<math.h>
#include<map>
#include<string>
#include <numeric>
#include <queue>
#include <sstream>
#include <bitset>
#include<stack>

using namespace std;
using ll = long long;
using vll = vector<long long>;
using sll = set<long long>;

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

template<typename T>
map<T, T> getPrimeFactor(T n) {
	map<T, T> res;
	for (T i = 2; i * i <= n; ++i) {
		while (n % i == 0) {
			res[i] ++;
			n /= i;
		}
	}
	if (n != 1) res[n] = 1;
	return res;
}

template<typename T>
bool IsPrimeNumber(T num)
{
	if (num <= 2) return true;
	else if (num % 2 == 0) return false;

	double sqrtNum = sqrt(num);
	for (int i = 3; i <= sqrtNum; i += 2)
	{
		if (num % i == 0)
		{
			return false;
		}
	}

	return true;
}

long long modinv(long long a, long long m) {
	long long b = m, u = 1, v = 0;
	while (b) {
		long long t = a / b;
		a -= t * b; swap(a, b);
		u -= t * v; swap(u, v);
	}
	u %= m;
	if (u < 0) u += m;
	return u;
}

#define rep(i,s,e) for(ll i=s;i<e;i++)
#define repeq(i,s,e) for(ll i=s;i<=e;i++)




int main() {
	ll N,K;
	std::cin >> N>>K;
	vll h(N);
	rep(i, 0, N) {
		std::cin >> h[i];
	}

	vll t(N, 1e9);
	t[0] = 0;
	rep(i, 0, N) {

		repeq(j, 1, K) {
			if (i + j < N) {
				t[i + j] = min(t[i + j], t[i] + abs(h[i + j] - h[i]));
			}
			else {
				break;
			}
		}
	}
	std::cout << t[N-1] << endl;

	return 0;
}


Measured memory_bytes: 1792
#include<bits/stdc++.h>
#define ll long long int
#define trace(x) cerr<<#x<<" : "<<x<<endl;
#define jaldi ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
using namespace std;

int main()
{
    jaldi
    int n,k;
    cin>>n>>k;
    vector<int> v(n);
    ll sum=0;
    for(int &x:v) cin>>x,sum+=x;
    sort(v.rbegin(),v.rend());
    ll rem=0;
    for(int i=0;i<k&&i<n;i++)
    {
        rem+=v[i];
    }
    cout<<sum-rem;
    return 0;
}

Measured memory_bytes: 1024
#include<bits/stdc++.h>
using namespace std;
 
using ll = long long;
using pll = pair<ll, ll>;
using pii = pair<int, int>;
using ull = unsigned long long;
 
#define NL '\n'
#define xx first
#define yy second
#define ins insert
#define mp make_pair
#define pb push_back
#define sz(x) x.size()
#define pi 2.0*acos(0.0)
#define _ctz(x) __builtin_ctz(x)
#define _clz(x) __builtin_clz(x)
#define _pop(x) __builtin_popcount(x)
#define all(x) (x).begin(), (x).end()
#define mem(a, b) memset(a, b, sizeof(a))
#define rep(ii,aa,bb) for(ll (ii)=ll(aa);(ii)<(ll)(bb);++(ii))
#define _fastIO() ios_base :: sync_with_stdio(0), cin.tie(0), cout.tie(0)
#define _runtime() cerr << "Time elapsed: " << 1.0 * clock() / CLOCKS_PER_SEC << " s.\n"1


const int N = 1e6+9;
int n, q, x, y, z, t;
vector<pii>parent(N);

void make_set(int v){ parent[v] = {v,0}; }

pii find_set(int v){
	if(v != parent[v].xx) {
		ll d = parent[v].yy;
		parent[v] = find_set(parent[v].xx);
		parent[v].yy += d;
	}
	return parent[v];
}

void union_set(int u, int v, ll w){
	pii du = find_set(u);
	pii dv = find_set(v);
	if(du.xx == dv.xx) return;
	if(du.yy >= w + dv.yy) {
		parent[dv.xx].xx = du.xx;
		parent[dv.xx].yy = du.yy - (w + dv.yy);
	}
	else {
		parent[du.xx].xx = dv.xx;
		parent[du.xx].yy = (w + dv.yy) - du.yy;
	}
}

int main(){
	_fastIO();
	cin >> n >> q;
	for(int i = 0; i < n; i++) make_set(i);
	for(int ix = 0; ix < q; ix++) {
		cin >> t;
		if(t == 0) {
			cin >> x >> y >> z;
			union_set(x, y, z);
		}
		else{
			cin >> x >> y;
			if(find_set(x).xx == find_set(y).xx) cout << (parent[x].yy - parent[y].yy) << NL;
			else cout << "?" << NL;
		}
	}
}





Measured memory_bytes: 11676
#include <bits/stdc++.h>
using namespace std;
#define FOR(i,a,b) for(int i=(a),i##formax=(b);i<i##formax;i++)
#define FORR(i,a,b) for(int i=(a),i##formax=(b);i>=i##formax;i--)
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define pcnt __builtin_popcount
#define sz(x) (int)(x).size()
#define maxs(x,y) x=max(x,y)
#define mins(x,y) x=min(x,y)
#define show(x) cout<<#x<<" = "<<x<<endl;
#define all(a) (a.begin()),(a.end())
#define each(it,c) for(__typeof((c).begin()) it=(c).begin();it!=(c).end();it++)
#define perm(c) sort(all(c));for(bool c##p=1;c##p;c##p=next_permutation(all(c)))
#define bitComb(a,n,k) for(int a##x,a##y,a=(1<<k)-1;a<(1<<n);a##x=a&-a,a##y=a+a##x,a=(((a&~a##y)/a##x)>>1)|a##y)
#define uniq(v) sort(all(v));v.erase(unique(all(v)), v.end())
#define bit(n) (1LL<<(n))
#define randInt(l,r) (uniform_int_distribution<ll>(l,r)(rnd))
#define randDouble(l,r) (uniform_real_distribution<double>(l,r)(rnd))
#define dout(d) printf("%.12f\n",d)

typedef long long ll;
typedef __int128_t lll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
template<class T>using V=vector<T>;
template<class T>using VV=V<V<T>>;
template<class T,class Y>ostream& operator<<(ostream& o,const pair<T,Y>& p){return o<<"("<<p.fi<<", "<<p.se<<")";}
template<typename A,size_t N,typename T>void Fill(A (&array)[N],const T&v){fill((T*)array,(T*)(array+N),v);}
lll gcd(lll a,lll b,lll &x,lll &y){if(!b){x=1;y=0;return a;}lll d=gcd(b,a%b,y,x);y-=a/b*x;return d;}
ll gcd(ll a,ll b){lll x=0,y=0;return gcd(a,b,x,y);}
ll modInv(ll a,ll m){lll x,y;gcd(a,m,x,y);return (x%m+m)%m;}
ll modPow(lll a,lll n,ll m){if(!a)return a;lll p=1;for(;n>0;n>>=1,a=a*a%m)if(n&1)p=p*a%m;return(ll)p;}
bool isPrime(ll n){if(n<2||n%2==0)return n==2;lll t=n-1,d=t/(t&-t);for(lll a:{2,325,9375,28178,450775,9780504,1795265022})if(a%n){for(t=d,a=modPow(a,t,n);t!=n-1&&a!=1&&a!=n-1;a=a*a%n,t=t*2%n);if(a!=n-1&&t%2==0)return 0;}return 1;}
V<ll>fac,rfac;void setFac(int n, int mod){fac=V<ll>(++n);fac[0]=1;rfac=fac;FOR(i,1,n)fac[i]=fac[i-1]*i%mod,rfac[i]=modInv(fac[i],mod);}
const int IINF = 1e9+6;
const ll LINF = 1e18;
const int MOD = 1e9+7;
const double PI = acos(-1);
const double EPS = 1e-10;
static random_device rd;
static mt19937 rnd(rd());

const int N = 1e5;
set<pll> s;
int n;
main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  cin >> n;
  FOR(i, 0, n){
    ll x, y;
    cin >> x >> y;
    s.insert(mp(x, y));
  }
  ll ans = n;
  each(itr1, s)each(itr2, s){
    if(itr1==itr2) continue;
    ll p=itr1->fi-itr2->fi, q=itr1->se-itr2->se, c = 0;
    each(itr3, s) c += s.find(mp(itr3->fi-p, itr3->se-q))==s.end();
    mins(ans, c);
  }
  cout << ans << endl;
}

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

typedef long long ll;

const int INF = 1e9;
const int MOD = 1e9+7;
const ll LLINF = 1e18;

#define YES(n) cout << ((n) ? "YES" : "NO"  ) << endl
#define Yes(n) cout << ((n) ? "Yes" : "No"  ) << endl
#define ANS(n) cout << (n) << endl

#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define FORR(i,a,b) for(int i=(a);i>=(b);i--)

#define ALL(obj) (obj).begin(),(obj).end()

#define pii pair<int,int>

#define pb(a) push_back(a)
#define mp make_pair

int main()
{
	int n;
	cin >> n;
	vector<ll> a(n+1,0);
	FOR(i,0,n){
		ll ai;
		cin >> ai;
		a[i+1] = a[i] + ai;
	}
	sort(ALL(a));
	ll ans = 0;
	ll cnt = 1;
	FOR(i,1,n+1){
		if(a[i] == a[i-1]){
			cnt++;
		}else{
			if(cnt >= 2)
				ans += cnt * (cnt-1) / 2;
			cnt = 1;
		}
	}
	if(cnt >= 2)ans += cnt * (cnt-1) / 2;
	ANS(ans);
	return 0;
}


Measured memory_bytes: 1792