akhauriyash/Code-Regression huggingface dataset:
/*
Author : Chandan Agrawal
College : Poornima College of Engg. jaipur, Raj
Mail : chandanagrawal23@gmail.com


" when you are not practicing someone else is ,
 and the day u meet them u will lose "

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

#define fastio ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define MAX 1000050

#define ll long long
#define ld long double
#define lli long long int

#define pb push_back
#define INF 1000000000000
#define mod 1000000007

// trignometric function always give value in Radians only
#define PI acos(-1) //3.1415926535897932384626433832795028
#define dsin(degree) sin(degree*(PI/180.0))
#define dcos(degree) cos(degree*(PI/180.0))
#define dtan(degree) tan(degree*(PI/180.0))

#define rsin(radian) sin(radian)
#define rcos(radian) cos(radian)
#define rtan(radian) tan(radian)

#define mem0(a) memset(a,0,sizeof(a))
#define mem1(a) memset(a,-1,sizeof(a))
#define memf(a) memset(a,false,sizeof(a))

#define loop(i,n)  for (lli i = 0; i < n; i++)
#define FOR(i,a,b) for (lli i = a; i < b; i++)

#define all(v) v.begin(),v.end()
#define rall(v) v.rbegin(),v.rend()
#define makeuniq(v) v.resize(unique(all(v)) - v.begin()); //only uniq element in vector after this
#define sz(x) int(x.size())
#define F first
#define S second

#define mii map<lli,lli>

#define pii pair<lli,lli>

#define vi vector<lli>
#define vvi vector<vi>
#define vpi vector<pii>
#define vbool vector<bool>

#define seti set<lli>

#define gcd(a,b) __gcd((a),(b))
#define lcm(a,b) (a/gcd(a,b))*b
#define abs(x) ((x < 0)?-(x):x)

#define endl '\n'

template <typename Head>
void print(Head&& head)
{
    cout<<head<<endl;
}
template <typename Head, typename... Tail>
void print(Head&& head, Tail... tail)
{
    cout<<head<<" ";
    print(tail...);
}

#define scanarr(a,n) for(lli i=0;i<n;i++)    cin>>a[i];
#define scanvec(a,n) for(lli i=0;i<n;i++){ lli x ; cin>>x; a.pb(x);}

#define printarr(a,n) for(lli i=0;i<n;i++)   cout<<a[i]<<" "; cout<<endl;
#define printvec(vec) for(auto xt : vec) cout<<xt<<" ";    cout<<"\n";

#define FD(N) fixed<<setprecision(N)

#define deb(x) cout<<#x<<" "<<x<<endl;

/*
1D vector -  vi dp(n,value);
2D vector -  vvi dp(n,vi(n,value));
*/

// chandan1,2
void chandan1(){int y=1;return;}
void chandan2(){
        loop(i,10){
        lli x=1;
    }
    return(chandan1());
}

lli cntdiv[MAX];
void euler_phi(){ //euler totient function
FOR(i,1,MAX)
    cntdiv[i] = 1;
for (lli p=2; p<MAX; p++)
    for (lli i = p; i<MAX; i += p)
            cntdiv[i]++;
}

int main(){
fastio
lli t=1;
//cin>>t;
euler_phi();
lli dp[MAX]={0};
FOR(i,1,MAX)
    dp[i] = dp[i-1]+cntdiv[i];
chandan2();
while(t--) {
    lli n;
    cin>>n;
    print(dp[n-1]);
  }
return 0;
}



Measured memory_bytes: 19276
def henkan(num):
    if num<=26:
        return chr(64+num)
    elif num%26==0:
        return henkan(num//26-1)+chr(90)
    else:
        return henkan(num//26)+chr(64+num%26)
      
num=int(input())
ans=henkan(num)
print(ans.lower())

Measured memory_bytes: 9112
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <math.h>
using namespace std;

int T;
int A, B, C, D, N;
int k;

int main() {
	register int i;
	scanf("%d", &T);
	while(T--) {
		scanf("%d%d%d%d", &A, &B, &C, &D); N = A + B;
		k = (max(A, B) - 1) / (min(A, B) + 1) + 1;
		int l = 0, r = N + 1;
		while(l < r) {
			int mid = (l + r) >> 1;
			int a = A - mid / (k + 1) * k - mid % (k + 1);
			int b = B - mid / (k + 1);
			if(b <= 1ll * a * k) l = mid + 1;
			else r = mid;
		}
		int a = A - l / (k + 1) * k - l % (k + 1);
		int b = B - l / (k + 1);
		r = l + b - a * k + 1;
		for(i = C; i <= min(D, l); ++i) {
			if(i % (k + 1)) printf("A");
			else printf("B");
		}
		for(i = max(C, l + 1); i <= D; ++i) {
			if((i - r) % (k + 1)) printf("B");
			else printf("A");
		}
		puts("");
	}
	return 0;
}

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

int main() {
    string S;
	cin>>S;
	int hug=0;
	
	for(int i=0;i<S.size()/2;i++){
		if(S.at(i)!=S.at(S.size()-1-i)){
			hug++;
			
		}
	}
	cout<<hug<<endl;
	return 0;
}

Measured memory_bytes: 256
import java.util.Scanner;
public class Main {
	public static void main(String[] args) {
		Scanner stdin = new Scanner(System.in);
		String a,b;
		a = stdin.next();
		switch(a) {
		case "A" :System.out.print("T");break;
		case "T" :System.out.print("A");break;
		case "C" :System.out.print("G");break;
		case "G" :System.out.print("C");break;
		}
	}
}

Measured memory_bytes: 21460
#include <iostream>
#include <vector>
#include <algorithm>
#include <set>

#define REP(i,a,b) for(int i=int(a);i<int(b);i++)

using namespace std;

typedef long long int lli;

int main () {
    int n, m;
    cin >> n >> m;
    vector<int> e(m, 0);
    REP (i, 0, m) cin >> e[i];
    set<int> used;
    for (int i = e.size() - 1; i >= 0; i--) {
        if (used.count(e[i]) == 0) {
            used.insert(e[i]);
            cout << e[i] << endl;
        }
    }
    REP (i, 1, n + 1) {
        if (used.count(i) == 0) {
            cout << i << endl;
        }
    }
    return 0;
}

Measured memory_bytes: 7856
N, X = map(int, input().split())

a, p = [1], [1]
for i in range(N):
    a.append(a[i] * 2 + 3)
    p.append(p[i] * 2 + 1)


def f(N, X):
    if N == 0:
        return 1
    
    if X == 1:
        return 0

    if X <= 1 + a[N-1]:
        return f(N-1, X-1)

    if X == 2 + a[N-1]:
        return p[N-1] + 1

    if X <= 2 + 2 * a[N-1]:
        return p[N-1] + 1 + f(N-1, X-2-a[N-1])

    if X == 3 + 2 * a[N-1]:
        return 2 * p[N-1] + 1


print(f(N, X))


Measured memory_bytes: 3064
#include<stdio.h>
int main(void){
  char a,b;
  scanf("%c %c",&a,&b);
  if(a=='H'){
    if(b=='H'){
      printf("H\n");
    }else{
      printf("D\n");
    }
  }
  else{
   if(a=='D'){
     if(b=='H'){
       printf("D\n");
     }
     else{
       printf("H\n");
     }
   }
  }
}


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

int main() {
  int H, N;
  int A;
  int total = 0;

  cin >> H >> N;

  while (N--) {
    cin >> A;
    total += A;
  }

  if (H - total <= 0) {
    cout << "Yes";
  }
  else {
    cout << "No";
  }

  return 0;

}

Measured memory_bytes: 256
#include <iostream>
#include <math.h>
#include <algorithm>
#include <string>
#include <string.h>
#include <queue>
#include <vector>
#include <set>
using namespace std;
int main() {
	int N,ans=1009000;
	string S;
	cin>>N>>S;
	vector<int>a(N,0);
	vector<int>b(N,0);
	for(int i=0;i<N;i++){
		if(i!=N-1){
			a[i+1]=a[i];
		if(S[i]=='W')a[i+1]++;
			}
	}
	for(int i=N-1;i>=0;i--){
		if(i!=0){
			b[i-1]=b[i];
		if(S[i]=='E')b[i-1]++;
			}
	}
	for(int i=0;i<N;i++)
	{
		ans=min(ans,a[i]+b[i]);
	}
	cout<<ans;
}


Measured memory_bytes: 2948
#include<iostream>
#include<vector>
#include<cstdio>
#include<string>
#include<algorithm>

using namespace std;

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

    int ans = 1;
    for (int A=1; A*A<=M; A++)
    {
        if (M%A != 0) continue;

        int B = M/A;

        if((long)A*N <= M) ans = max(ans, A);
        if((long)B*N <= M) ans = max(ans, B);
        // if(A*N <= M) ans = max(ans, A);
        // if(B*N <= M) ans = max(ans, B);
    }
    cout << ans << endl;
}

Measured memory_bytes: 256
using System;

namespace ITP1_8_C
{
    class Program
    {
        static void Main(string[] args)
        {
            int[] alphaet = new int[26];
            while (true)
            {
                var input = Console.ReadLine();
                if (input == null || input.Length == 0) break;
                foreach (int i in input)
                    for(int j = 65; j < 91; j++)
                        if (i == j || i == (j + 32))
                        {
                            alphaet[j - 65]++;
                            break;
                        }              
            }
            for (int i = 97; i < 123; i++)
                Console.WriteLine((char)i + " : " + alphaet[i - 97]);
        }
    }
}

Measured memory_bytes: 9088
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>

using namespace __gnu_pbds;
using namespace std;

typedef long long ll;
typedef long double ld;
typedef tree<ll,null_type,less<ll>,rb_tree_tag, tree_order_statistics_node_update> ordered_set;

#define int ll
#define endl "\n"
#define all( x ) x.begin(), x.end()
#define fast ios::sync_with_stdio(0);cin.tie(0);

typedef unsigned long long ull;

const int inf = 1e9 + 5;
const long double PI = 3.141592653589793;

void solve(){
  int x;
  cin >> x;
  cout << (x / 500) * 1000 + ((x % 500) / 5) * 5 << endl;
  return;
}  
signed main(){
  fast;
  int t;
  t = 1;
  //cin>>t;
  while(t--){
    solve();
  }
}

Measured memory_bytes: 3632
#include <bits/stdc++.h>
#define F(i,a,b) for(ll i=a;i<=(b);++i)
#define dF(i,a,b) for(int i=a;i>=(b);--i)
#define inf 0x3f3f3f3f
#define infll 0x3f3f3f3f3f3f3f3f
#define pb push_back
#define maxnkp make_pair
#define fi first
#define se second
#define eps 1e-7
#define PI acos(-1.0)
using namespace std;
typedef long long ll;
const int mods = 1e9+7;
const int maxn = 1e5+10;
const int N = 1e5+10;
const int E = 1e6+10; 

int n;
string s,t;

int main(){
	cin>>s>>t;
	n = s.size();
	int m = t.size();
	int ans = inf;
	F(i,0,n-m){
		int res = 0;
		F(j,i,i+m-1){
			
			if(s[j]!=t[j-i]) res++; 
		}
		ans = min(res,ans); 
	}
	cout<<ans<<endl;
}

Measured memory_bytes: 3584
#include <iostream>
#include <string.h>
#include <algorithm>
#include <array>
#include <vector>
#include <cmath>
#include <set>
 
using namespace std;
 
int main( void ) {
    
    int N;
    cin >> N;

    for ( int i = 1; i < 10; i++ ) {
        for ( int j = 1; j < 10; j++) {
            if ( i * j == N ) {
                cout << "Yes" << endl;
                return 0;
            }
        }
    }

    cout << "No" << endl;

    return 0;
}

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

#define Online 1
// #define multitest 1
#define Debug 1
void ControlIO();
void TimerStart();
void TimerStop();
#ifdef Debug
#define db(...) ZZ(#__VA_ARGS__, __VA_ARGS__);
template <typename Arg1>
void ZZ(const char *name, Arg1 &&arg1)
{
	std::cerr << name << " = " << arg1 << endl;
}
template <typename Arg1, typename... Args>
void ZZ(const char *names, Arg1 &&arg1, Args &&... args)
{
	const char *comma = strchr(names + 1, ',');
	std::cerr.write(names, comma - names) << " = " << arg1;
	ZZ(comma, args...);
}
#else
#define db(...)
#endif
typedef long long ll;
typedef long double ld;
#define f first
#define s second
#define pb push_back
const long long mod = 1000000007;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

void solve()
{
	string s;
	cin >> s;
	int win = 15 - s.size();;
	for(auto x:s)
		win += (x=='o');
	if(win>=8) cout << "YES";
	else cout << "NO";
}

int main()
{
	ControlIO();
	int t = 1;
#ifdef multitest
	cin >> t;
#endif
	TimerStart();
	while (t--)
		solve();
	TimerStop();
	return 0;
}

void ControlIO()
{
	ios_base::sync_with_stdio(0);
	cin.tie(0);
#ifndef Online
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif
}

auto TimeStart = chrono::steady_clock::now();
auto TimeEnd = chrono::steady_clock::now();

void TimerStart()
{
#ifndef Online
	TimeStart = chrono::steady_clock::now();
#endif
}

void TimerStop()
{
#ifndef Online
	TimeEnd = chrono::steady_clock::now();
	auto ElapsedTime = TimeEnd - TimeStart;
	cout << "\n\nTime elapsed: " << chrono::duration<double>(ElapsedTime).count() << " seconds.\n";
#endif
}

Measured memory_bytes: 256
#include <iostream>
#include <iomanip>
#include <string>
#include <stack>
#include <vector>
#include <complex>
#include <math.h>
#include <stdio.h>
#include <algorithm>
#include <utility>
#include <functional>
#include <iterator>
#include <map>
#include <set>
#include <queue>
#include <list>
#include <regex>
#include <limits>
#include <time.h>
#include <cstdint>
#include <unordered_map>
#include <unordered_set>
#include <bitset>
#include <limits.h>
using namespace std;
using pii  = pair<int,int>;
using ll=long long;
using ld=long double;
#define pb push_back
#define mp make_pair
#define sc second
#define fr first
#define stpr setprecision
#define cYES cout<<"YES"<<endl
#define cNO cout<<"NO"<<endl
#define cYes cout<<"Yes"<<endl
#define cNo cout<<"No"<<endl
#define rep(i,n) for(ll i=0;i<(n);++i)
#define Rep(i,a,b) for(ll i=(a);i<(b);++i)
#define rrep(i,n) for(ll i=n-1;i>=0;i--)
#define rRep(i,a,b) for(ll i=a;i>=b;i--)
#define crep(i) for(char i='a';i<='z';++i)
#define psortsecond(A,N) sort(A,A+N,[](const pii &a, const pii &b){return a.second<b.second;});
#define ALL(x) (x).begin(),(x).end()
#define debug(v) cout<<#v<<":";for(auto x:v){cout<<x<<' ';}cout<<endl;
#define endl '\n'
int ctoi(const char c){
  if('0' <= c && c <= '9') return (c-'0');
  return -1;
}
ll gcd(ll a,ll b){return (b == 0 ? a : gcd(b, a%b));}
ll lcm(ll a,ll b){return a*b/gcd(a,b);}
constexpr ll MOD=1000000007;
constexpr ll INF=1000000011;
constexpr ll MOD2=998244353;
constexpr ll LINF = 1001002003004005006ll;
constexpr ld EPS=10e-8;
template <class T, class U> inline bool chmax(T& lhs, const U& rhs) { if (lhs < rhs) { lhs = rhs; return 1; } return 0; }
template <class T, class U> inline bool chmin(T& lhs, const U& rhs) { if (lhs > rhs) { lhs = rhs; return 1; } return 0; }
template<typename T> istream& operator>>(istream& is,vector<T>& v){for(auto&& x:v)is >> x;return is;}
template<typename T,typename U> istream& operator>>(istream& is, pair<T,U>& p){ is >> p.first; is >> p.second; return is;}
template<typename T,typename U> ostream& operator>>(ostream& os, const pair<T,U>& p){ os << p.first << ' ' << p.second; return os;}
template<class T> ostream& operator<<(ostream& os, vector<T>& v){
  for(auto i=begin(v); i != end(v); ++i){
    if(i !=begin(v)) os << ' ';
    os << *i;
  }
  return os;
}

map<ll,ll> M;

int main(){
  ll N;
  cin >> N;
  rep(i,N){
    ll X;
    cin >> X;
    M[X]++;
  }
  ll ANS=0;
  for(auto P : M){
    if(P.fr<=P.sc){
      ANS+=P.sc-P.fr;
    }
    else{
      ANS+=P.sc;
    }
  }
  cout << ANS << endl;
} 


Measured memory_bytes: 9456
N, M = map(int, input().split())
G = [set() for i in range(N + 1)]

for i in range(M):
    a, b = map(int, input().split())
    G[a].add(b)
    G[b].add(a)

for a in G[1]:
    if a in G[N]:
        print("POSSIBLE")
        exit()

print("IMPOSSIBLE")


Measured memory_bytes: 103372
#include <bits/stdc++.h>
using namespace std;
int main()
{
	int n, k; cin >> n >> k;
	int arr[n+1];
	for (int i = 1; i <= n; i++)
	    cin >> arr[i];
	int A[n+2];
	int count = 0; bool f = true;
	while (count < k && f)
	{
	    memset(A, 0, sizeof(A));
	    for (int i = 1; i <= n; i++)
	    {
	        A[max(i - arr[i], 1)]++;
	        A[min(n+1, i + arr[i] + 1)]--;
	    }
	    f = false;
	    arr[1] = A[1];
	    if (arr[1] != n)
	        f = true;
	    for (int i = 2; i <= n; i++)
	    {
	        arr[i] = A[i] + arr[i-1];
	        if (arr[i] != n)
	            f = true;
	    }
	    count++;
	}
	cout << arr[1];
	for (int i = 2; i <= n; i++)
	    cout << " " << arr[i];
	cout << '\n';
	
    return 0;
}

Measured memory_bytes: 5056
#include<iostream>
#include<vector>
#include<cstdio>
#include<string>
#include<cmath>
#include<math.h>
#include<algorithm>
#include<string.h>
#include <iomanip>
#include <sstream>
using namespace std;

int main() {
  string s;

  cin >> s;

  if(s == "Sunny"){
    cout << "Cloudy" << endl;
  }else if(s == "Cloudy"){
    cout << "Rainy" << endl;
  }else if(s == "Rainy"){
    cout << "Sunny" << endl;
  }
}


Measured memory_bytes: 256
mod = int(1e9 + 7)
h, w = map(int, input().split())
MAP = ['#' * w] + ['#' + input() for _ in range(h)]
dp = [[0] * (w + 1) for _ in range(h + 1)]
dp[0][1] = 1
for i in range(1, h + 1):
    for j in range(1, w + 1):
        if MAP[i][j] == '.':
            dp[i][j] = (dp[i - 1][j] + dp[i][j - 1]) % mod
print(dp[h][w])


Measured memory_bytes: 43620
#include <iostream>
#include <vector>
//#include <string>
#include <algorithm>
//#include <math.h>
//#include <queue>
//#include <stack>
//#include <iomanip>

// sometimes used
//#include <set>
//#include <map>
//#include <numeric>
//#include <list>
//#include <deque>
//#include <unordered_map>

//typedef long long LL;
//typedef long double LD;
using namespace std;
 
//#define MOD 1000000007
//#define MAX 100100
//#define NIL -1

int main() {
    int x;
    int n;
    int min=100;
    int ans;
    bool is_ok;
    cin >> x >> n;
    vector<int> p(n);
    for(int i=0; i<n; i++){
        cin >> p[i];
    }
    for(int i=0; i<=110; i++){
        is_ok=true;
        for(int j=0; j<n; j++){
            if(i==p[j]){
                is_ok=false;
                break;
            }
        }
        if(is_ok==true){
            if(min>abs(i-x)){
                min=abs(i-x);
                ans=i;
            }
        }
    }

    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 3616
#include <stdio.h>

int linearSearch(int A[],int n,int key)
{
  int i;
  for(i=0;i<n;i++)
    {
      if(A[i]==key)
	{
	  return 1;
	}
    }
  return 0;
}

int main ()
{
  int i,n,n2,A[10000],key,judge=0;

  scanf("%d",&n);
    for(i=0;i<n;i++){
      scanf("%d",&A[i]);
    }
  
    scanf("%d",&n2);
      for(i=0;i<n2;i++){
	scanf("%d",&key);
      
     
    if(linearSearch(A,n,key))
      {
	judge++;
      }
      }
    printf("%d\n",judge);
    return 0;
}

Measured memory_bytes: 636
#include <iostream>
#include <fstream>
#include <string>
#include <vector>
#include <map>
#include <set>
#include <unordered_map>
#include <unordered_set>
#include <queue>
#include <stack>
#include <array>
#include <deque>
#include <algorithm>
#include <utility>
#include <cstdint>
#include <functional>
#include <iomanip>
#include <numeric>
#include <cassert>
#include <bitset>
#include <list>
#include <cmath>
using namespace std;

int main() {
	string S;
	cin >> S;
	int n = 0;
	int w = 0;
	int s = 0;
	int e = 0;
	for (int i = 0; i < S.length(); ++i) {
		if (S[i] == 'N') {
			n++;
		} else if (S[i] == 'W') {
			w++;
		} else if (S[i] == 'S') {
			s++;
		} else if (S[i] == 'E') {
			e++;
		}
	}
	bool yes = true;
	if ((n == 0 && s != 0) || (n != 0 && s == 0)) {
		yes = false;
	}
	if ((e == 0 && w != 0) || (e != 0 && w == 0)) {
		yes = false;
	}
	if (yes) {
		cout  << "Yes" << endl;
	} else {
		cout << "No" << endl;
	}

	return 0;
}

Measured memory_bytes: 256
#include <iostream>

using namespace std;

int main()
{
	int move;
	int totaltime = 0;
	int min;
	int sec;
	int i;
	
	for (i = 0; i < 4; i++){
		cin >> move;
		totaltime += move;
	}
	
	min = totaltime / 60;
	sec = totaltime % 60;
	
	cout << min << "\n" << sec << endl;
	
	return (0);
}

Measured memory_bytes: 3092
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0; i<(n); i++)
#define all(n) begin(n),end(n)
using ll = long long;
using P = pair<int,int>;

int main() {
    int n;
    cin >> n;
    vector<string> s(n);
    rep(i,n) cin >> s[i];
    ll m = 0, a = 0, r = 0, c = 0, h = 0;
    rep(i,n) {
        if(s[i][0]=='M') ++m;
        if(s[i][0]=='A') ++a;
        if(s[i][0]=='R') ++r;
        if(s[i][0]=='C') ++c;
        if(s[i][0]=='H') ++h;
    }
    ll ans = 0;
    vector<ll> name(5);
    name[0] = m, name[1] = a, name[2] = r, name[3] = c, name[4] = h;
    rep(i,5){
        for(int j = i+1; j < 5; ++j){
            for(int k = j+1; k < 5; ++k){
                ans+=name[i]*name[j]*name[k];
            }
        }
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 6380
import sys
IS = lambda: sys.stdin.readline().rstrip()
II = lambda: int(IS())
MII = lambda: list(map(int, IS().split()))

def main():
    n = II(); a = II(); b = II()
    c = II(); d = II(); e = II()
    minv = min([a,b,c,d,e])
    t = n//minv
    if n%minv != 0: t += 1
    print(4+t)


if __name__ == '__main__':
    main()


Measured memory_bytes: 3064
#include<bits/stdc++.h>
using namespace std;
int main(void){
  long long W, H, x, y;
  cin >> W >> H >> x >> y;
  cout << fixed << setprecision(20) << W * H / 2.0 << " ";
  if(2 * x == W && 2 * y == H) cout << 1 << endl;
  else cout << 0 << endl;
  return 0;
}


Measured memory_bytes: 256
#include<stdio.h>
int main()
{
    char a;
    while(1){
    int b=0;
    while(1){
    scanf("%c", &a);
    if(a=='0'&&b==0)return 0;
    if(a=='\n')break;
    b += (a-'0');
    }
    printf("%d\n", b);
    }
    return 0;
}

Measured memory_bytes: 536
#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
template<typename T> bool chmax(T &a,T b){if(a<b){a=b;return true;}return false;}
template<typename T> bool chmin(T &a,T b){if(a>b){a=b;return true;}return false;}
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define all(vec) vec.begin(),vec.end()
typedef long long ll;
typedef pair<ll,ll> pll;
typedef pair<int,int> pii;
typedef tuple<ll,ll,ll> tlll;
typedef tuple<int,int,int> tiii;
const ll mod=1e9+7;
const int inf=1<<30;

int main(){
  string s,t; cin >> s >> t;
  bool f=1;
  rep(i,s.size()){
    if(s[i]!=t[i]) f=0;
  }
  if(f) cout << "Yes" << endl;
  else cout << "No" << endl;
}

Measured memory_bytes: 3632
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools

sys.setrecursionlimit(10**7)
inf = 10**20
eps = 1.0 / 10**10
mod = 10**9+7
dd = [(-1,0),(0,1),(1,0),(0,-1)]
ddn = [(-1,0),(-1,1),(0,1),(1,1),(1,0),(1,-1),(0,-1),(-1,-1)]

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()
def pf(s): return print(s, flush=True)


def main():
    n,k = LI()
    if (n+1) // 2 >= k:
        return 'YES'

    return 'NO'



print(main())




Measured memory_bytes: 7364
#include <bits/stdc++.h>
using namespace std;
#include <ext/pb_ds/assoc_container.hpp> 
#include <ext/pb_ds/tree_policy.hpp> 
using namespace __gnu_pbds; 
#define ordered_set tree<int,null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update> 
#define ordered_set_pair tree<pair<int,int>,null_type,less<pair<int,int>>, rb_tree_tag,tree_order_statistics_node_update> 
#define ordered_set_mutiset tree<int,null_type,less_equal<int>, rb_tree_tag,tree_order_statistics_node_update>
typedef long long int ll;
typedef long double ld;
typedef unsigned long long int ull;
typedef pair<int,int> pi; 
#define PI 3.1415926535897932384
#define FOR(i,vv,n) for(ll i=vv;i<n;i++)
#define FORR(i,n,vv) for(ll i=n-1;i>=vv;i--)
#define ve vector 
#define maxind(v) (max_element(v.begin(),v.end())-v.begin())
#define minind(v) (min_element(v.begin(),v.end())-v.begin())
#define maxe(v) *max_element(v.begin(),v.end())
#define mine(v) *min_element(v.begin(),v.end())
#define pb push_back
#define pf push_front
#define ppb pop_back
#define ppf pop_front
#define eb emplace_back
#define FAST ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define mp make_pair
#define M 1000000007ll
#define INF 1000000000000000000ll
#define PRECISE cout.precision(18);
#define all(v) v.begin(),v.end()
#define BS(v,n) binary_search(all(v),n)
#define srt(v) sort(v.begin(),v.end())
#define rsrt(v) sort(all(v),greater <ll>())
#define uni(v) v.resize(unique(all(v))-v.begin())
#define F first
#define S second
#define GET(i,p) get<p>(i)



int main(){

	#ifndef ONLINE_JUDGE
    // for getting input from input.txt	
    freopen("input.txt", "r", stdin);
    // for writing output to output.txt
    freopen("output.txt", "w", stdout);
	 #endif

    FAST
	//PRECISE


ll n,m;
cin>>n>>m;
ve <ll> v(n);
ll lcm=1;
ll ans=0;
FOR(i,0,n){
cin>>v[i];v[i]/=2;
if(ans!=-1)
lcm=(lcm*v[i])/(__gcd(lcm,v[i]));
if(lcm>m){
	ans=-1;
}
}
if(ans!=-1){
	FOR(i,0,n)
	if((lcm/v[i])%2==0)ans=-1;
}
if(ans==-1)ans=0;
else{
ll z1=m/lcm;
ans=z1/2+z1%2;}

cout<<ans;


// ll n;
// cin>>n;
// ve <ll> v(n);
// FOR(i,0,n)cin>>v[i];
// srt(v);

// ve <ll> fa(3*n);
// fa[0]=1;
// //fa[1]=2;
// FOR(i,1,3*n){
// fa[i]=2ll*fa[i-1];
// fa[i]%=M;
// }
// ll ans=0;
// ll c=1;
// FOR(i,0,n){
// 	ll k=n-i;
// 	ans+=(fa[2*k-2]*(k-1)+fa[2*k-1])%M*v[i]%M*c%M;
// 	c=c*2;
// 	c%=M;
// }
// cout<<ans;









return 0;
 }


Measured memory_bytes: 3988
#include <iostream>
#include <vector>
#include <algorithm>
#include <numeric>
using namespace std;

vector<vector<int>> select(int i, int n){
    if (i < 0) {
        return {{}};
    }
    else {
        vector<vector<int>> ans;
        vector<vector<int>> before = select(i-1, n);
        for (auto select_vec: before) {
            ans.push_back(select_vec);
            select_vec.push_back(i);
            ans.push_back(select_vec);
        }
        return ans;   
    }
}

bool understand(vector<int> select_vec, vector<vector<int>>A, int M, int X){
    vector<long> understand_sum(M);
    for (auto selected : select_vec){
        for (int i = 0; i < M; i++){
            understand_sum.at(i) += A.at(selected).at(i);
        }
    }
    return count_if(understand_sum.begin(), understand_sum.end(), [X](int s) {return s >= X;}) == M;
}

long cost(vector<int> select_vec, vector<int> C){
    long ans = 0;
    for (auto selected : select_vec){
        ans += C.at(selected);
    }
    return ans;
}

int main(){
    int N, M, X;
    cin >> N >> M >> X;
    vector<int> C(N);
    vector<vector<int>> A(N);
    for (int i = 0; i < N; i++){
        cin >> C[i];
        int a;
        for (int j = 0; j < M; j++){
            cin >> a;
            A[i].push_back(a);
        }
    }
    vector<vector<int>> select_combination = select(N-1, N-1); 

    bool flag = false;
    long min_cost = accumulate(C.begin(), C.end(), 0);
    for (auto select_vec : select_combination){
        if (understand(select_vec, A, M, X)){
            flag = true;
            min_cost = min(min_cost, cost(select_vec, C));
        } 
    }
    if (!flag) min_cost = -1;
    cout << min_cost << endl;
}

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

int main() {
  int N, K;
  cin >> N >> K;
  string S;
  cin >> S;

  int cnt = 0;
  for (int i = 0; i < N; i++) {
    if (i == 0) {
      if (S.at(i) == 'R' && S.at(i + 1) == 'R') cnt++;
    } else if (i == N - 1) {
      if (S.at(i) == 'L' && S.at(i - 1) == 'L') cnt++;
    } else {
      if (S.at(i) == 'R' && S.at(i + 1) == 'R') cnt++;
      if (S.at(i) == 'L' && S.at(i - 1) == 'L') cnt++;
    }
  }

  cout << min(cnt + 2 * K, N - 1) << "\n";
}

Measured memory_bytes: 512
# -*- coding: utf-8 -*-
N, K, S = map(int, input().split(' '))

lim = 10 ** 9
if S == lim:
    ret = [S for _ in range(K)] + [1 for _ in range(N-K)]
    print(*ret)

else:
    ret = [S for _ in range(K)] + [lim for _ in range(N-K)]
    print(*ret)


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

using ll = long long;
#define debug(x) cerr << #x << ": " << x << endl;
#define line() cerr << "---------------" << endl;

int W, H;
char board[30][30];
bool visited[30][30];

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

void dfs(int x, int y) {
   for (int i = 0; i < 4; i++) {
      int nx = x + dx[i], ny = y + dy[i];
      if (nx < 0 || nx >= H || ny < 0 || ny >= W) continue;
      if (board[nx][ny] == '#') continue;
      if (visited[nx][ny]) continue;
      visited[nx][ny] = true;
      dfs(nx, ny);
   }
}

int main() {
   while (cin >> W >> H, W || H) {
      memset(visited, false, sizeof(visited));
      int sx = 0, sy = 0;
      for (int i = 0; i < H; i++) {
         for (int j = 0; j < W; j++) {
            cin >> board[i][j];
            if (board[i][j] == '@') {
               sx = i, sy = j;
            }
         }
      }

      visited[sx][sy] = true;
      dfs(sx, sy);
      
      int cnt = 0;
      for (int i = 0; i < H; i++) {
         for (int j = 0; j < W; j++) {
            if (visited[i][j]) cnt++;
         }
      }
      cout << cnt << endl;
   }

   return 0;
}


Measured memory_bytes: 3096
#include <iostream>
#include <iomanip>
#include <ios> 
#include <vector>
#include <string>
#include <algorithm>
#include <functional>
#include <queue>
#include <stack>
#include <set>
#include <cmath>
#include <bitset>
#include <map>
#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define rep1(i,n) for(int i=1;i<=(int)(n);i++)

using namespace std;
typedef long long int lli;
const int MAX=1e5+5;

int ct[MAX];

int main(){
	int N;
	cin>>N;
	rep(i,N){
		int a;
		cin>>a;
		ct[a]++;
	}
	int kd=0;
	int ev=0;
	
	rep1(i,1e5){
		if(ct[i]>0)kd++;
		if(ct[i]>0&&ct[i]%2==0)ev++;
	}
	cout<<kd-(ev%2);
}

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

int main() {
	string s;
	cin >> s;
	s[3] = '8';
	cout << s;
	return 0;
}
/*
31536000のコメント解説欄
ここテンプレで用意してるから、A問題とかだとこの先空欄の危険あり

単純に、4文字目を7から8に書き換えれば良いので8で上書きすればおｋ
*/

Measured memory_bytes: 256
# import math
# import statistics
# a=input()
#b,c=int(input()),int(input())
# c=[]
# for i in a:
#     c.append(i)
#e1,e2,e3 = map(int,input().split())
#f = list(map(int,input().split()))
#g = [input() for _ in range(a)]
# h = []
# for i in range(e1):
#     h.append(list(map(int,input().split())))

a = int(input())
b = int(input())
h = int(input())
print(int((a+b)*h/2))

Measured memory_bytes: 9096
#include<cstdio>
#include<algorithm>
#include<cstring>
#include<iostream>
#include<vector>
#include<set>
#include<map>
#include<bitset>
#include<cmath>
#include<string>

#define ls (t<<1)
#define rs ((t<<1)+1)
#define mid ((l+r)>>1)
#define fi first
#define se second
#define mk make_pair
#define pb push_back

#define N 100005
#define M 200005
#define seed 23333

using namespace std;
int i,j,m,n,p,k,a[N],b[N],cnt,sum;
map<int,int>mp;
map<int,int>::iterator it;
int lowbit(int x)
{
		return x&-x;
}
int main()
{
	scanf("%d",&n);
	for (i=1;i<=n;++i) scanf("%d",&a[i]),mp[lowbit(a[i])*2-1]=1,sum^=a[i];
	for (i=30;i>=0;--i)
		if (sum&(1<<i))
	{
			for (it=mp.begin();it!=mp.end();++it)
				if ((it->fi<(1<<(i+1)))&&((it->fi)&(1<<i)))
				{
						sum^=it->fi;
						++cnt;
						break;
				}
			if (sum&(1<<i)) break;
	}
	if (i<0) printf("%d\n",cnt);
	else puts("-1");
}


Measured memory_bytes: 640
// Vicfred
// https://atcoder.jp/contests/abc165/tasks/abc165_c
#include <algorithm>
#include <iostream>
#include <vector>
#include <queue>

using namespace std;

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

    vector<int> a(q);
    vector<int> b(q);
    vector<int> c(q);
    vector<int> d(q);

    for(int i = 0; i < q; i++)
        cin >> a[i] >> b[i] >> c[i] >> d[i];

    queue<vector<int>> A;
    for(int i = 1; i <= m; ++i)
        A.push({i});

    while(A.front().size() != n) {
        auto item = A.front();
        A.pop();
        int size = item.size();
        for(int i = item[size-1]; i <= m; i++) {
            item.push_back(i);
            A.push(item);
            item.pop_back();
        }
    }

    long long maxima = 0LL;

    while(!A.empty()) {
        long long local = 0LL;

        auto item = A.front();
        A.pop();

        for(int i = 0; i < q; i++)
            if((item[b[i]-1] - item[a[i]-1]) == c[i])
                local += d[i];

        maxima = max(maxima, local);
    }

    cout << maxima << endl;

    return 0;
}



Measured memory_bytes: 9488
#include <stdio.h>

#define MAX 100

int a[MAX];
int count = 0;

void magic(int x, int y, int px)
{
    if(x + 1 != y) {
        a[px] ++;
    }
    else {
        a[px] += 2;
    }
    
    count++;
    
    return;
}

int main(void)
{
    int i;
    int n;
    
    scanf("%d\n", &n);
    
    for(i = 0; i < n; i++) {
        if(i == 0) {
            scanf("%d", &a[i]);
        }
        else {
            scanf(" %d", &a[i]);
        }
    }
    
    for(i = 0; i < n - 1; i ++) {
        if(a[i] == a[i + 1]) {
            magic(a[i + 1], a[i + 2], i + 1);
        }
    }
    
    printf("%d\n", count);
    return 0;
}


Measured memory_bytes: 128
package main

import (
	"fmt"
)

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

func max(a, b int) int {
	if a > b {
		return a
	}
	return b
}

func main() {
	var N int
	fmt.Scan(&N)
	A := make([]int, N)
	for i := 0; i < N; i++ {
		var a int
		fmt.Scan(&a)
		A[i] = a
	}
	L := make([]int, N)
	R := make([]int, N)
	L[0] = A[0]
	R[N-1] = A[N-1]
	for i := 1; i < N; i++ {
		L[i] = gcd(L[i-1], A[i])
		R[N-1-i] = gcd(R[N-i], A[N-1-i])
	}

	ans := 1
	for i := 1; i < N-1; i++ {
		ans = max(ans, gcd(L[i-1], R[i+1]))
	}
	ans = max(ans, L[N-2])
	ans = max(ans, R[1])

	fmt.Println(ans)
}


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

int digitSum(int n) {
    int res = 0;
    while(n) res += n % 10, n /= 10;
    return res;
}

int main() {
    int N, A, B;
    cin >> N >> A >> B;
    int ans = 0;
    for(int i = 1; i <= N; ++i) {
        int n = digitSum(i);
        if(A <= n && n <= B) ans += i;
    }
    cout << ans << '\n';
    return 0;
}


Measured memory_bytes: 256
#include <cstdio>
#define repi(i,a,b) for(int i=(a);i<(b);++i)
#define rep(i,a) repi(i,0,a)
#define all(a) (a).begin(), (a).end()

int N, A, B;

int main()
{
  scanf( "%d%d%d", &N, &A, &B );

  bool turn = false;
  for( ;; )
  {
    if( !turn )
    {
      if( B-A == 1 && A == 0 )
        break;

      if( B-A-1 > 0 )
        ++A;
      else
        --A;
    }
    else
    {
      if( B-A == 1 && B == N )
        break;

      if( B-A-1 > 0 )
        --B;
      else
        ++B;
    }

    turn ^= true;
  }

  puts( B-A==1&&A==0&&B==N ? "Draw" : turn ? "Alice" : "Borys" );
  
  return 0;
}

Measured memory_bytes: 128
/* monkukui 競技プログラミング用のテンプレート  (ここから) */
#include <iostream>
#include <cstdio>
#include <string>
#include <cstring>
#include <deque>
#include <list>
#include <queue>
#include <stack>
#include <vector>
#include <utility>
#include <algorithm>
#include <map>
#include <set>
#include <complex>
#include <cmath>
#include <limits>
#include <climits>
#include <ctime>
#include <cassert>
#include <numeric>
#include <functional>
#include <bitset>

using namespace std;
using lint = long long int;
using ll = long long int;
using lnt = long long int;
using graph = vector<vector<int>>;
using wgraph = vector<vector<pair<int, long long int>>>;
long long int INF = 1001001001001001LL;
int inf = 100100100;
long long int MOD = 1000000007LL;
double PI = 3.1415926535897932;
long long int di[] = {-1, 0, 1, 0, -1, 1, 1, -1};
long long int dj[] = {0, 1, 0, -1, 1, 1, -1, -1};

template<typename T1,typename T2> inline void chmin(T1 &a,T2 b){if(a>b) a=b;}
template<typename T1,typename T2> inline void chmax(T1 &a,T2 b){if(a<b) a=b;}
inline void yes(){ cout << "yes" << endl; }
inline void Yes(){ cout << "Yes" << endl; }
inline void YES(){ cout << "YES" << endl; }
inline void no(){ cout << "no" << endl; }
inline void No(){ cout << "No" << endl; }
inline void NO(){ cout << "NO" << endl; }
inline void possible(){ cout << "possible" << endl; }
inline void Possible(){ cout << "Possible" << endl; }
inline void POSSIBLE(){ cout << "POSSIBLE" << endl; }
inline void impossible(){ cout << "impossible" << endl; }
inline void Impossible(){ cout << "Impossible" << endl; }
inline void IMPOSSIBLE(){ cout << "IMPOSSIBLE" << endl; }

#define rep(i,n) for(int i = 0; i < (n); i++)
#define rrep(i,n) for(int i = 1; i <= (n); i++)
#define drep(i,n) for(int i = (n)-1; i >= 0; i--)
#define srep(i,s,t) for(int i = s; i < t; i++)
#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define pb push_back

/* monkukui 競技プログラミング用のテンプレート (ここまで)*/

int a[20][20];
int n;

lint dfs(lint S, vector<lint> &dp) {
  if(dp[S] != -INF) return  dp[S];

  // 切らない, つまりこれを一つのグループとする.
  lint tmp = 0;
  for(int i = 0; i < n; i++) {
    for(int j = i + 1; j < n; j++) {
      if(((1 << i) & S) and ((1 << j) & S)) {
        tmp += a[i][j];
      }
    }
  }
  lint ret = tmp;
  for(int T = (S - 1) & S; T > 0; T = (T - 1) & S) {
    ret = max(ret, dfs(T, dp) + dfs(S ^ T, dp));
  }
  
  dp[S] = ret;
  return ret;
}

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

  
  vector<lint> dp((1 << n), -INF);
  
  dp[0] = 0;
  for(int i = 0; i < n; i++) dp[(1 << i)] = 0;
  
  lint bit = (1 << n) - 1;
  cout << dfs(bit, dp) << endl;
   
  return 0;
}


Measured memory_bytes: 768
#include <iostream>
#include <algorithm>
#include <deque>
 
using namespace std;
 
int main(){
  int c[9];
  cin 
    >> c[0]
    >> c[1]
    >> c[2]
    >> c[3]
    >> c[4]
    >> c[5]
    >> c[6]
    >> c[7]
    >> c[8];
  if(
    (c[4]-c[3] == c[1]-c[0] && c[7]-c[6] == c[1]-c[0]) &&
    (c[5]-c[3] == c[2]-c[0] && c[8]-c[6] == c[2]-c[0])
    ){
    cout << "Yes";
  }else{
    cout << "No";
  }
  cout << endl;
}

Measured memory_bytes: 256
#include <iostream>

static int n, q, value;

void exhaustiveSearch (int i, int sum, int *A, bool *flag) {

  if (*flag) {
    return;
  }

  if (sum == value) {
    *flag = true;
  }

  if (i == n) {
    return;
  }

  exhaustiveSearch (i+1, sum, A, flag);
  exhaustiveSearch (i+1, sum+A[i], A, flag);

}

int main () {

  scanf("%d", &n);

  int A[n];

  for (int i = 0; i < n; i++) {
    scanf("%d", &A[i]);
  }

  scanf("%d", &q);

  int Q[q];

  for (int i = 0; i < q; i++) {
    scanf("%d", &Q[i]);
  }


  for (int i = 0; i < q; i++) {
    value = Q[i];
    bool flag = false;
    exhaustiveSearch(0, 0, A, &flag);

    if (flag) {
      printf("yes\n");
    } else {
      printf("no\n");
    }

  }

}

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

int main() {
    int n,k,temp,min;
    cin>>n>>k;
    int h[n],dp[n];
    for(int i=0;i<n;i++){
        cin>>h[i];
    }
    dp[0]=0;
    for(int i=1;i<n;i++){
        dp[i]=0;
        min=INT_MAX;
        for(int j=1;j<=k;j++){
            if((i-j)<0)
                break;
            temp=dp[i-j]+abs(h[i]-h[i-j]);
            if(temp<min)
                min=temp;
        }
        dp[i]=min;
    }
    cout<<dp[n-1]<<endl;
}

Measured memory_bytes: 1024
def gcd(x,y):
    while y>0:
        x,y = y,x%y
    return x
A,B,C,D = map(int,input().split())
E = (C//gcd(C,D))*D
c1 = B//C
d1 = B//D
e1 = B//E
y = B-(c1+d1-e1)
c2 = (A-1)//C
d2 = (A-1)//D
e2 = (A-1)//E
x = (A-1)-(c2+d2-e2)
print(y-x)

Measured memory_bytes: 38384
#pragma warning (disable:4996)
#include <algorithm>
#include <iostream>
#include <iomanip>
#include <cstring>
#include <string>
#include <cstdio>
#include <cmath>
#define inf 0X7f7f7f7f
#define MS_I(x) memset(x,-inf,sizeof(x))
#define MS(x) memset(x,0,sizeof(x))
#define MSI(x) memset(x,inf,sizeof(x))
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
using namespace std;

int main()
{
	int a, b;
	scanf("%d %d", &a, &b);
	cout << a + b / 2;
	return 0;
}

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

int main() {
  int n,k;
  cin>>n>>k;
  int p[n];
  for(int i=0; i<n; i++) cin>>p[i];

  sort(p, p+n);

  int ans = 0;
  for(int i=0; i<k; i++) ans+=p[i];

  cout<<ans<<endl;

  return 0;
}

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

#define int long long

signed main() {
  cin.tie(0);
  ios_base::sync_with_stdio(0);
  cout << fixed << setprecision(12);

  int N;
  cin >> N;

  using p = pair<int, int>;
  using P = pair<int, p>;
  vector<P> v;
  for ( int i = 0; i < N; i++ ) {
    int x, l;
    cin >> x >> l;
    v.push_back(P(x+l-1, p(-x, l)));    
  }

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

  int r = -1e15;
  int cnt = 0;
  for ( int i = 0; i < N; i++ ) {
    int x = -v[i].second.first;
    int l = v[i].second.second;
    if ( x-l > r ) {
      r = v[i].first;
      cnt++;
    }
  }

  cout << cnt << endl;
  
  return 0;
}


Measured memory_bytes: 4724
#include <bits/stdc++.h>
#define endl '\n'
#define pb push_back
#define mp make_pair
#define cont continue  
#define MOD 998244353
#define rep(i, n) for(int i = 0 ; i < (n) ; i++)
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef vector<int> vi;
typedef vector<ll> vl;
const ll INF = 1e17;
const double pi = 3.141592653589793;

int T;

int main() {
  cin.tie(NULL);
  ios_base::sync_with_stdio(false);
  long double A;
  long double B;

  cin >> A >> B;

  cout << (ll)(A * B) << endl;
  return 0;
}

Measured memory_bytes: 3764
import sys
input = sys.stdin.readline
import math
def main():
    N = int(input())
    n = int(math.sqrt(N)) + 1
    ans = [0]*10001
    for x in range(1,n):
        for y in range(1,n):
            for z in range(1,n):
                v = x**2 + y**2 + z**2 + x*y + y*z + z*x
                if v <= 10000:
                    ans[v] += 1 
    for i in range(1,N+1):
        print(ans[i])

if __name__ == '__main__':
    main()

Measured memory_bytes: 9132
#include <stdio.h>

int main()
{
	int a,b;
	double aa,bb,d;

	scanf("%d %d",&a,&b);
	aa = 1.0*a;
	bb = 1.0*b;
	d = aa / bb;
	printf("%d %d %f\n",a/b,a%b,d);

	return 0;
}

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

using namespace std;

typedef long long ll;

ll nck(ll n, ll k){
    ll ans = 1;
    for(ll i=1; i<=k; i++)
        ans = ans*(n-i+1)/i;
    return ans;
}
int main() {
    ios::sync_with_stdio(0);
    cin.tie(0);
    string s;
    cin >> s;
    int n=s.length()-1;
    string sss=s;
    reverse(sss.begin(), sss.end());
    if(s == sss){
        string s1 = s.substr(0, n/2), s2 = sss.substr(0, n/2);
        string S1 = s1, S2 = s2;
        reverse(S1.begin(), S1.end());
        reverse(S2.begin(), S2.end());
        if(S1==s1&&S2==s2) cout << "Yes";
        else cout << "No";
    }
    else cout << "No";
    return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll mod = 1e9 + 7;
#define pb push_back
#define pf push_front
#define pob pop_back
#define pof pop_front
#define mp make_pair
#define mt make_tuple
#define lb lower_bound
#define ub upper_bound
#define fi first
#define sc second
#define IOS ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);

const ll MAXN = 3 * 1e5 + 5;
ll n, ans;
ll pre[65][MAXN];	// bit 1

int main()
{
	scanf("%lld", &n);
	
	for(ll i = 1; i <= n; i++){
		ll inp; scanf("%lld", &inp);
		
		for(ll j = 0; j < 60; j++){
			pre[j][i] = pre[j][i - 1];
			if((1LL << j) & inp) pre[j][i]++;
		}
		if(i > 1){
			for(ll j = 0; j < 60; j++){		
				if((1LL << j) & inp){
					ans = (ans + ( ((1LL << j) % mod) * (i - 1 - pre[j][i - 1]) ) % mod) % mod;
				}
				else {
					ans = (ans + ( ((1LL << j) % mod) * pre[j][i - 1] ) % mod) % mod;
				}
			}
		}
	}
	printf("%lld\n", ans);
}

Measured memory_bytes: 144340
#include<iostream>
#include<vector>
#include<utility>
#include<algorithm>
#include<string>
#include<cstdio>
#include<queue>
#include<functional>
#include<tuple>
#include<iomanip>
#include<stack>
#include<cmath>
#define ll long long
using namespace std;
ll gcd(ll a, ll b) { return b == 0 ? a : gcd(b, a%b); }
int main() {
	ll a, b; cin >> a >> b;
	if (a < b) swap(a, b);
	cout << a * b / gcd(a, b) << endl;
	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <algorithm>

using namespace std;
typedef long long ll;

int main(){
    int a, b, c;
    cin >> a >> b >>c;

    if(b / a > c){
        cout << c << endl;
    }else{
        cout << b/a << endl;
    }
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i=0; i<(n); ++i)
#define y_n(ans) cout<<(ans?"Yes":"No")<<endl;

int main() {
    int n;
    cin >> n;
    vector<long long> l(n);
    for (int i = 0; i < n; ++i) {
        cin >> l[i];
    }
    long long ans = 0;
    for (int i = 0; i < n; ++i) {
        for (int j = i + 1; j < n; ++j) {
            if (l[i] == l[j]) continue;
            for (int k = j + 1; k < n; ++k) {
                if (l[i] == l[k] || l[j] == l[k]) continue;
                int a = l[i];
                int b = l[j];
                int c = l[k];
                if (a+b > c && b+c > a && c+a > b) ans++;
            }
        }
    }
    cout << ans << endl;
}

Measured memory_bytes: 3632
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> l_l;
typedef pair<int, int> i_i;
template<class T>
inline bool chmax(T &a, T b) {
    if(a < b) {
        a = b;
        return true;
    }
    return false;
}

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

#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))
//const ll mod = 1000000007;

int main() {
    //cout.precision(10);
    cin.tie(0);
    ios::sync_with_stdio(false);
    string s;
    cin >> s;
    int l = 0;
    while(s[l] != 'A') l++;
    int r = s.size() - 1;
    while(s[r] != 'Z') r--;
    cout << r-l+1 << endl;
    return 0;
}


Measured memory_bytes: 720
import java.util.HashSet;
import java.util.Scanner;
import java.util.Set;

public class Main {

	static int count = 0;

	public static void main(String[] args) throws Exception {

		Scanner sc = new Scanner(System.in);
		int n  = sc.nextInt();

		Set<String> set = new HashSet<String>();

		for(int i = 0; i < n; i++) {
			String order = sc.next();
			String str = sc.next();

			if(order.equals("insert")) {
				set.add(str);
			} else {
				System.out.println(set.contains(str) ? "yes" : "no");
			}
		}
	}
}


Measured memory_bytes: 208600
#include <bits/stdc++.h>
#define FOR(i, a, b) for (int i = a; i < b; i++)
#define mFOR(i, a, b) for (int i = a; i > b; i--)
#define MP make_pair
#define PB push_back
using namespace std;

typedef long long ll;

int main()
{
    int n;
    double x[10] = {}, res = 0;
    string s[10] = {};
    cin >> n;
    FOR(i, 0, n)
    {
        cin >> x[i] >> s[i];
        if (s[i] == "BTC")
            res += 380000.0 * x[i];
        else
            res += x[i];
    }
    cout << res << "\n";

    return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<algorithm>
#include<string>
#include<vector>
#include<cstdlib>
#include<queue>
#include<set>
#include<cstdio>

using namespace std;

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

typedef vector<int> vec;
typedef vector<vec> mat;

const ll mod = 1000000007;

int main(){
    ll n;
    cin >> n;
    ll ans = 100100100100100100;
    for (ll i = 1; i * i <= n; i++){
        if(n % i == 0){
            ans = min(ans, (i - 1) + (n / i) - 1);
        }
    }
    cout << ans << endl;

}

Measured memory_bytes: 3640
#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<bitset>
#include<set>
#include<map>
#include<stack>
#include<queue>
#include<deque>
#include<list>
#include<iomanip>
#include<cmath>
#include<cstring>
#include<functional>
#include<cstdio>
#include<cstdlib>
#include<unordered_map>
#include<unordered_set>
using namespace std;

#define repr(i, a, b) for (int i = (int)(a); i < (int)(b); i++)
#define rep(i, n) repr(i, 0, n)
#define INF 2e9
#define MOD 1000000007
//#define MOD 998244353
#define LINF (long long)4e18
#define jck 3.141592
#define PI acos(-1.0);

const double EPS = 1e-10;

using ll = long long;
using Pi = pair<int,int>;
using Pl = pair<ll,ll>;



int main(){
    int N; cin >> N;
    vector<int> p(N);
    rep(i,N) cin >> p[i],p[i]--;
    vector<int> a(N),b(N);
    a[0] = 1;
    rep(i,N-1){
        a[i+1] = a[i]+20000;
    }
    b[N-1] = 1;
    for(int i = N-1; i >= 1; i--){
        b[i-1] = b[i]+20000;
    }
    int now = 0;
    rep(i,N){
        b[p[i]] += now;
        now++;
    }
    rep(i,N) cout << a[i] << " ";
    cout << endl;
    rep(i,N) cout << b[i] << " ";
    cout << endl;
}



Measured memory_bytes: 896
import java.math.BigInteger;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Scanner;
 

//result = Math.pow(num1, num3)
//StringBuffer str = new StringBuffer(hoge1);
//String hoge2 = str.reverse().toString();
//map.containsKey(A)
//Map<String, Integer> map = new HashMap<String, Integer>(n);
//ArrayList<String> cc = new ArrayList<>(n);

public class Main {
	private static Scanner sc = new Scanner(System.in);
	static void p(String ans) {System.out.println(ans);};
	static void p(int ans) {System.out.println(ans);};
	static void p(long ans) {System.out.println(ans);};
	static void p(double ans) {System.out.println(ans);};
	//static String eikomoji[]={"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"};
	
	
	public static void main(String[] args) {
	long H=sc.nextLong();
	long ans=0;
	long bb=1; 
	while(H!=0) {
	if(H>1) {
		ans=ans+bb;
		bb=bb*2;
		H=H/2;
	}else if(H==1){
		ans=ans+bb;
		H=0;
	}
	}
	p(ans);
 }
}


Measured memory_bytes: 22612