akhauriyash/Code-Regression huggingface dataset:
#include<bits/stdc++.h>
//#include <ext/pb_ds/assoc_container.hpp> 
//#include <ext/pb_ds/tree_policy.hpp>
//#include <functional> // for less
//using namespace __gnu_pbds;
using namespace std;
typedef long long  L;

#define max_(x, y) (((x) > (y)) ? (x) : (y))
#define min_(x, y) (((x) < (y)) ? (x) : (y))
#define ___ ios_base::sync_with_stdio(false);cin.tie(NULL);
#define Mx 200001
#define inf 1e15
const L MOD = 1e9+7;
const double pi = 2 * acos (0.0);

/*------------------------------Graph Moves----------------------------*/
//const int fx[]={+1,-1,+0,+0};
//const int fy[]={+0,+0,+1,-1};
//const int fx[]={+0,+0,+1,-1,-1,+1,-1,+1};   // Kings Move
//const int fy[]={-1,+1,+0,+0,+1,+1,-1,-1};  // Kings Move
//const int fx[]={-2, -2, -1, -1,  1,  1,  2,  2};  // Knights Move
//const int fy[]={-1,  1, -2,  2, -2,  2, -1,  1}; // Knights Move
/*---------------------------------------------------------------------*/


//typedef tree<L,null_type,less<L>,rb_tree_tag,tree_order_statistics_node_update> ordered_set;

L a1,a2,a3,a,b,b1,b2,b3,c,c1,c2,c3,d,d1,d2,d3,d4,d5,e1,e2,e3,f,h,k,l,m,n,m1,m2,n1,n2,o,p,p1,p2,p3,p4,
q,q1,q2,q3,q4,r,s,t,u,v,x,y,z,sum,mx=-inf,mn=inf,flg,flg1,flg2,id1,id2,id3,id4,lim;

int main()
{
    scanf("%lld",&n);
    while(n){
        if(n%10==7){
            printf("Yes\n");
            return 0;
        }
        n=n/10;
    }
    printf("No\n");
    return 0;
}

/// empty() lld lld push_back() top() pop() insert() upper_bound() lower_bound() memset() max() min() scanf continue


Measured memory_bytes: 3668
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(int)n;i++)
#define rep1(i,n) for(int i=1;i<=(int)n;i++)
#define sp(n) cout << fixed << setprecision(n)
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
typedef long long ll;
using namespace std;
int main(void){
    ll h,w;cin>>h>>w;
    if(h>w)swap(h,w);
    ll res=(h-2)*(w-2);
    if(h==1&&w==1){
        cout<<1<<endl;
        return 0;
    }else if(h==1){
        cout<<w-2<<endl;
        return 0;
    }
    cout<<res<<endl;
}

Measured memory_bytes: 3644
using System;

	public class Class1
	{
		public static void Main()
		{   
			int i=1;
			for(int j=0;j<10000;j++)
			{
				int data=int.Parse(Console.ReadLine());
				if(data==0)
			{
				break;
			
			}
			else {
				Console.WriteLine("Case {0}: {1}",i,data);
				i++;
			      }
			}
			
		}
	}

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

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

  for (int i = 0; i < N; i++) {
    int l,r;
    cin >> l >> r;
    x += r - l + 1;
  }
  cout << x << endl;
}
    

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define fs first
#define sc second
#define pb push_back
#define mp make_pair
#define eb emplace_back
#define ALL(A) A.begin(),A.end()
#define RALL(A) A.rbegin(),A.rend()
typedef long long LL;
typedef pair<LL,LL> P;
const LL mod=998244353;
const LL LINF=1LL<<60;
const int INF=1<<30;
int dx[]={1,0,-1,0};
int dy[]={0,1,0,-1};


int main(){
    string s;cin >> s;
    LL k;cin >> k;
    bool f = true;
    for (int i = 1; i < s.length(); i++) {
        if(s[i] != s[i-1]) f = false;
    }
    string t = s;
    t += s;
    LL c = 0;
    LL a = 0;
    for (int i = 1; i < t.length(); i++) {
        if(t[i] == t[i-1]){
            if(i>=s.length()) a++;
            c++;
            t[i] = '.';
        }
    }
    if(f){
        if(k%2==0){
            cout << c * k / 2 << endl;
        }
        else{
            LL p = 0;
            for (int i = 1; i < s.length(); i++) {
                if(s[i] == s[i-1]){
                    p++;
                    s[i] = '.';
                }
            }
            cout << c * (k - 1) / 2 + p << endl;
        }
    }
    else{
        if(k==1){
            LL p = 0;
            for (int i = 1; i < s.length(); i++) {
                if(s[i] == s[i-1]){
                    p++;
                    s[i] = '.';
                }
            }
            cout << p << endl;
        }
        else{
            cout << c + a * (k - 2) << endl;
        }
    }
    return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<vector>
#include<string>
#include<algorithm>	
#include<map>
#include<set>
#include<utility>
#include<cmath>
#include<cstring>
#include<queue>
#include<stack>
#include<cstdio>
#include<sstream>
#include<iomanip>
#include<assert.h>
#define loop(i,a,b) for(int i=a;i<b;i++) 
#define rep(i,a) loop(i,0,a)
#define pb push_back
#define all(in) in.begin(),in.end()
#define shosu(x) fixed<<setprecision(x)
using namespace std;
//kaewasuretyuui
typedef long long ll;
typedef int Def;
typedef pair<Def,Def> pii;
typedef vector<Def> vi;
typedef vector<vi> vvi;
typedef vector<pii> vp;
typedef vector<vp> vvp;
typedef vector<string> vs;
typedef vector<double> vd;
typedef vector<vd> vvd;
typedef pair<Def,pii> pip;
typedef vector<pip>vip;
//#define mt make_tuple
//typedef tuple<double,int,double> tp;
//typedef vector<tp> vt;
template<typename A,typename B>bool cmin(A &a,const B &b){return a>b?(a=b,true):false;}
template<typename A,typename B>bool cmax(A &a,const B &b){return a<b?(a=b,true):false;}
const double PI=acos(-1);
const double EPS=1e-7;
Def inf=sizeof(Def)==sizeof(long long)?2e18:1e9;
int dx[]={0,1,0,-1};
int dy[]={1,0,-1,0};
int MOD;
int main(){
	int n,m;
	cin>>n>>m;
	vs in(n);
	rep(i,n)cin>>in[i];
	int out=0;
	while(1){
		bool h=false;
		rep(i,n)rep(j,m)if(in[i][j]=='.'){
			vi find(26,-1);
			rep(k,4){
				int x=i,y=j;
				while(0<=x&&x<n&&0<=y&&y<m&&in[x][y]=='.')x+=dx[k],y+=dy[k];
				if(0<=x&&x<n&&0<=y&&y<m){
					int t=in[x][y]-'A';
					if(find[t]==-1)find[t]=x*m+y;
					else{
						h=true;
						out+=2;
						in[x][y]='.';
						in[find[t]/m][find[t]%m]='.';
						find[t]=-1;
					}
				}
			}
		}
		if(!h)break;
	}
	cout<<out<<endl;
}

Measured memory_bytes: 3292
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, srt, end) for (long long i = (srt); i < (long long)(end); i++)

int main(){
    string s;
    cin >> s;
    ll n = s.size();
    ll b = 0;
    rep(i, 0, n){
        if(s[i] == '1') b++;
    }
    cout << min(n-b, b)*2 << endl;
    return 0;
}

Measured memory_bytes: 512
#include <iostream>
#include <cmath>
#include <vector>
#include <map>
#include <iomanip>
#include <algorithm>
#include <sstream>
#include <string>
#include <math.h>
#include <set>
#include <deque>
using namespace std;
typedef long long ll;
const int mod = 1000000007;

int main() {
    ios::sync_with_stdio(false);
    double a, b;
    cin >> a >> b;
	cout << round((a + b) / 2); 
}

Measured memory_bytes: 3740
# coding: utf-8
# Your code here!

N,A,B,C = map(int, input().split())

list = [int(input()) for i in range(N)]

def dfs(cur, a, b, c) : 
    if cur == N : 
        return abs(a-A)+abs(b-B)+abs(c-C)-30 if min(a, b, c) > 0 else 10000
    ret0 = dfs(cur+1, a, b, c)
    ret1 = dfs(cur+1, a+list[cur], b, c) +10
    ret2 = dfs(cur+1, a, b+list[cur], c) +10
    ret3 = dfs(cur+1, a, b, c+list[cur]) +10
    return min(ret0, ret1, ret2, ret3)
    
print(dfs(0, 0, 0, 0))

Measured memory_bytes: 3064
#include <bits/stdc++.h>
using namespace std;
#define Rep(i,n) for(int i=0;i<(int)(n);i++)
#define For(i,n1,n2) for(int i=(int)(n1);i<(int)(n2);i++)
#define REP(i,n) for(ll i=0;i<(ll)(n);i++)
#define RREP(i,n) for(ll i=((ll)(n)-1);i>=0;i--)
#define FOR(i,n1,n2) for(ll i=(ll)(n1);i<(ll)(n2);i++)
#define RFOR(i,n1,n2) for(ll i=((ll)(n1)-1);i>=(ll)(n2);i--)
#define all(a)  (a).begin(),(a).end()
#define SORT(a) sort((a).begin(),(a).end())
#define oorret 0
#define oor(x) [&](){try{x;} catch(const out_of_range& oor){return oorret;} return x;}()
#define IOS cin.tie(0),ios::sync_with_stdio(false)
typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll, ll> P;
template<typename T1, typename T2> inline bool chmin(T1& a, T2 b) { if (a > b) { a = b; return 1; }return 0; }
template<typename T1, typename T2> inline bool chmax(T1& a, T2 b) { if (a < b) { a = b; return 1; }return 0; }
template<class Type>struct is_vector : std::false_type {};
template<class ValueType, class Alloc>struct is_vector<std::vector<ValueType, Alloc>> : std::true_type {};
template <typename T> inline ostream& operator << (ostream& out, const vector<T>& v) {
	if (v.empty())return out;
	constexpr bool is_vector_v = is_vector<T>::value;
	if (is_vector_v)for (auto itr = v.begin(); itr != v.end();)out << (*itr), out << ((++itr != v.end()) ? "\n" : "");
	else for (auto itr = v.begin(); itr != v.end();)out << (*itr), out << ((++itr != v.end()) ? " " : "");
	return out;
}
inline void put() {}
template<class T> inline void put(const T& first) { std::cout << first << "\n"; }
template<class T, class... N> inline void put(const T& first, const N& ... rest) { std::cout << first << " "; put(rest...); }
inline void putn() {}
template<class T, class... N> inline void putn(const T& first, const N& ... rest) { std::cout << first << "\n"; putn(rest...); }

int main() {
	IOS;
	ll w, h;
	cin >> w >> h;
	vector<ll> p(w), q(h);
	priority_queue<P, vector<P>, greater<P>> pq;
	REP(i, w) {
		cin >> p[i];
		pq.push(P(p[i], i));
	}
	REP(i, h) {
		cin >> q[i];
		pq.push(P(q[i], i + w));
	}
	ll res = 0;
	ll ch = h + 1, cw = w + 1;
	while (!pq.empty()) {
		P p = pq.top();
		pq.pop();
		if (p.second < w) {
			res += p.first * ch;
			cw--;
		} else {
			res += p.first * cw;
			ch--;
		}
	}
	put(res);
	return 0;
}

Measured memory_bytes: 8048
<?php
    $N = intval(trim(fgets(STDIN)));
    $d_array = array_map('intval',explode(" ",trim(fgets(STDIN))));
    $sum=0;
    for($i=0;$i<count($d_array)-1;$i++){
        for($j=$i+1;$j<count($d_array);$j++){
            $heal = $d_array[$i]*$d_array[$j];
            $sum+=$heal;
        }
    }
    
    echo $sum;
    

?>

Measured memory_bytes: 15996
#include <bits/stdc++.h>
#define REP(i, n) for (int i = 0; i < n; ++i)
#define REPR(i, n) for (int i = n - 1; i >= 0; --i)
#define FOR(i, a, b) for (int i = a; i < b; ++i)
#define FORR(i, a, b) for (int i = b - 1; i >= a; --i)
#define SORT(v) sort(v.begin(), v.end())
#define SORTR(v) sort(v.rbegin(), v.rend())
#define REV(v) reverse(v.begin(), v.end())
#define ITER(itr, v) for (auto itr = v.begin(); itr != v.end(); ++itr)
#define LB(v, x) (lower_bound(v.begin(), v.end(), x) - v.begin())
#define UB(v, x) (upper_bound(v.begin(), v.end(), x) - v.begin())
#define SZ(v) (int)v.size()
using namespace std;
using ll = long long;
using P = pair<int, int>;

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

    int N;
    cin >> N;
    vector<P> res;
    if (N % 2 == 1) {
        int S = N * (N - 1) / 2;
        FOR(i, 1, N) {
            FOR(j, i + 1, N + 1) {
                if (i + j != N) {
                    res.emplace_back(i, j);
                }
            }
        }
    } else {
        int S = (N + 1) * (N / 2 - 1);
        FOR(i, 1, N) {
            FOR(j, i + 1, N + 1) {
                if (i + j != N + 1) {
                    res.emplace_back(i, j);
                }
            }
        }
    }
    cout << res.size() << endl;
    for (auto &p : res) {
        int i, j;
        tie(i, j) = p;
        cout << i << " " << j << endl;
    }

    return 0;
}


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

int main()
{
    int K, X;
    cin >> K >> X;
    int begin = X - K + 1;
    int end = X + K;
    for (int i = begin; i < end; i++)
    {
        cout << i << " ";
    }
    cout << endl;
}


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

#define loop(i,N) for(ll (i)=0; (i)<(N);++(i))
#define OMAZINAI cin.tie(0); ios::sync_with_stdio(false);
#define INF (1LL<<61)
typedef long long int ll;
ll cnt[200], s[200], K, N;
string S;

int main() {
	OMAZINAI;
	cin >> S >> K;
	auto gosentyou = [](int i) {
		return i == 1 ? 1 : INF;
	};
	for (char c : S) {
		s[N++] = c - '0';
	}
	ll cnt = 0, i = 0;
	do {
		cnt += gosentyou(s[i++]);
	} while (cnt < K);
	cout << s[i - 1] << endl;
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<int> vi;
const ll M = 1e9+7;
const int MN = 200100;
inline ll mul(ll a, ll b) {return (a*b)%M;}
vi fr[MN];
int v[MN];
ll dp[MN];
ll ds(int id) {
	if(id == 0) return 1;
	if(dp[id] != -1) return dp[id];
	int val = v[id];
	int pos = lower_bound(fr[val].begin(),fr[val].end(),id)-fr[val].begin();
	ll tot = ds(id-1);
	if(pos > 0) {
		tot += ds(fr[val][pos-1]);
		tot %= M;
	}
	return dp[id] = tot;
}
int main() {
	int n;
	memset(dp,-1,sizeof(dp));
	ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
	cin >> n;
	int la = -1;
	int id = 0;
	while(n--) {
		int t;
		cin >> t;
		if(t != la && la > 0) {
			v[id] = la;
			fr[la].push_back(id++);
		}
		la = t;
	}
	v[id] = la;
	fr[la].push_back(id++);
	//cout << "SIZE " << id << '\n';
	cout << ds(id-1) << '\n';
}


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

#define LL long long
const int maxn = 400;
struct Node {
    int x, y;
    int num;
};
bool operator<(const Node &a, const Node &b) {
    return a.num < b.num;
}
int n, m, d, num, cnt, q, l, r;
LL sum[maxn * maxn];
Node node[maxn * maxn];

int main() {
    #ifdef LOCAL
        freopen("test.txt", "r", stdin);
//    freopen("out.txt", "w", stdout);
    #endif // LOCAL
    ios::sync_with_stdio(false);

    while(scanf("%d%d%d", &n, &m, &d) != EOF) {
        cnt = 1;
        for(int i = 1; i <= n; ++i) {
            for(int j = 1; j <= m; ++j) {
                scanf("%d", &num);
                sum[cnt] = 0;
                node[cnt].x = i;
                node[cnt].y = j;
                node[cnt++].num = num;
            }
        }
        sort(node + 1, node + cnt);
        for(int i = 1 + d; i < cnt; ++i) {
            sum[i] = abs(node[i - d].x - node[i].x) + abs(node[i - d].y - node[i].y) + sum[i - d];
//            printf("sum[%d] = %d\n", i, sum[i]);
        }
        scanf("%d", &q);
        while(q--) {
            scanf("%d%d", &l, &r);
            printf("%lld\n", sum[r] - sum[l]);
        }
    }

    return 0;
}


Measured memory_bytes: 2944
import java.util.Scanner;

public class Main {

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

		int k = sc.nextInt();
		int s = sc.nextInt();

		int count = 0;

		for(int i = 0; i <= k; i++){
			for(int j = 0; j <= k ; j++){
				if(s - i - j >= 0 && s - i - j <= k){
					count++;
				}
			}
		}

		System.out.println(count);
    }
}

Measured memory_bytes: 21716
/* Author : Harshit Jain a.k.a. iharshit009 */
#include <bits/stdc++.h>
#define vi               vector<int>
#define pb(x)            push_back(x)
#define all(x)           x.begin(), x.end()
#define sortall(x)       sort(all(x))
#define sortrev(x)       sort(all(x), greater<int>())
#define debug(x)         cout << '>' << #x << ':' << x << endl;
#define int              long long
#define ld               long double
#define endl 			 "\n";
#define mp 				 make_pair
#define pii 			 <int, int>
#define lb 				 lower_bound
#define ub				 upper_bound
#define len(a)           int((a).size())
#define prec(n)          fixed<<setprecision(n)
#define cnt(n)           __builtin_popcountll(n)
#define pi               pair<int, int>
const int mod = 1000000007;
using namespace std;
using namespace std::chrono;
// const int N = 1e5 + 5; 
// int n;
// int a[N];



int32_t main(){
auto start = high_resolution_clock::now(); // starting clock
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
#ifndef ONLINE_JUDGE
freopen("input.txt", "r", stdin);
freopen("output.txt", "w", stdout);
#endif
int t;
t = 1;
// cin >>t;
while(t--){


int a,b,c,d;
cin >> a>>b>>c>>d;
cout << max({a*c,a*d,b*c,b*d});






}
auto stop = high_resolution_clock::now(); // stop clock
auto duration = duration_cast<microseconds>(stop - start);  // printing duration
cerr << "Time taken by function: " << duration.count() << " milliseconds" << endl; 
return 0;
}

Measured memory_bytes: 3660
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <iostream>
#include <string>
#include <vector>
#include <map>
#include <set>
#include <stack>
#include <list>
#include <queue>
#include <deque>
#include <algorithm>
#include <numeric>
#include <utility>
#include <complex>
#include <functional>
#include <climits>

using namespace std;

int main() {
    int A[3];
    for(int i=0; i<3; i++) {
        cin >> A[i];
    }
    sort(A, A+3);
    cout << A[2]*10+A[1]+A[0] << endl;
}

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

#define rep(i, n) for (int i = 0; i < n; ++i)
#define all(x) (x).begin(),(x).end()
#define endl "\n"

using ll = long long;
using P = pair<int,int>;
using mp =  map<int,int>;

const int MOD = 1e9 + 7;

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

    int d;
    cin >> d;

    if(d == 25) cout << "Christmas" << endl;
    if(d == 24) cout << "Christmas Eve" << endl;
    if(d == 23) cout << "Christmas Eve Eve" << endl;
    if(d == 22) cout << "Christmas Eve Eve Eve" << endl;

    return 0;
}


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

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

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

    if(a == b){
        cout << c;
    }else if(a == c) {
        cout << b;
    }else{
        cout << a;
    }
}

Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <algorithm>
#include <array>
#include <vector>
#include <utility>
#include <bitset>
#include <queue>
#include <unordered_map>
#include <unordered_set>

using namespace std;

using ll = long long;
using p = pair<ll, ll>;

void bit_add(vector<ll>& bit_count, ll a) {
    bitset<20> bs(a);
    for (ll i = 0; i < 20; i++) {
        if (bs[i]) {
            bit_count[i]++;
        }
    }
}

void bit_sub(vector<ll>& bit_count, ll a) {
    bitset<20> bs(a);
    for (ll i = 0; i < 20; i++) {
        if (bs[i]) {
            bit_count[i]--;
        }
    }
}

bool check(vector<ll> bit_count) {
    for (auto b : bit_count) {
        if (b > 1) {
            return false;
        }
    }

    return true;
}

void view(vector<ll> bit_count) {
    for (auto b : bit_count) {
        cout << b << " ";
    }
    cout << endl;
}

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

    ll N;
    cin >> N;

    vector<ll> A(N);
    for (auto&& a : A) {
        cin >> a;
    }

    ll ans = 1;
    ll l = 0, r = 1;
    vector<ll> bit_count(20, 0);
    bit_add(bit_count, A[0]);

    while (r < N) {
        bit_add(bit_count, A[r]);

        while (l < r && !check(bit_count)) {
            bit_sub(bit_count, A[l]);
            l++;
        }

        ans += r - l + 1;

        r++;
    }

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



Measured memory_bytes: 1792
#include <stdio.h>

int main(){
    int n;
    int a[100];
    int i;
    int max = 0;
    int min = 1000;

    scanf("%d",&n);

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

    for(i = 0;i < n;i++){
        if(a[i] > max) max = a[i];
        if(a[i] < min) min = a[i];
    }

    printf("%d",max - min);

    return 0;
}

Measured memory_bytes: 128
import java.math.BigDecimal;
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {

        Scanner scan = new Scanner(System.in);

        String to = scan.nextLine();

        BigDecimal money = new BigDecimal(100);

        BigDecimal moneyTo = new BigDecimal(to);

        BigDecimal moneyMax = new BigDecimal(1000000000000000000L);

        int i = 1;

        while (money.compareTo(moneyMax) == -1) {

            money = money.multiply(new BigDecimal(1.01));
            money = money.setScale(0, BigDecimal.ROUND_DOWN);
            if (money.compareTo(moneyTo) >= 0) {
                break;
            }
            i++;
        }

        System.out.println(i);
    }
}


Measured memory_bytes: 42712
#include<bits/stdc++.h>
#define rep(i, n) for(int i=0; i<n; i++)
#define repo(i, n) for(int i=1; i<=n; i++)
#define INF 1001001001
#define INFll 100100100100100
// debug用
#define PrintVec(x) for (auto elementPrintVec: x) { cout << elementPrintVec << " "; } cout << endl;

using namespace std;
using ull = unsigned long long;
using ll = long long;
using P = pair<int, int>;
const int mod = 1000000007;

ll attack(ll hp){
  if(hp==1){
    return 1;
  } else{
    return 2*attack(hp/2)+1;
  }
}

int main(){
  ll h;
  cin >> h;
  cout << attack(h) << endl;
  return 0;
}


Measured memory_bytes: 3612
#include <stdio.h>

int main(){
    char a, b;
    scanf("%c %c", &a, &b);
    if(a == 'H'){
        printf("%c", b);
    }else{
        if(b == 'H'){
            printf("%c", a);
        }else{
            a = 'H';
            printf("%c", a);
        }
    }
    return 0;
}

Measured memory_bytes: 128
import sys
readline = sys.stdin.readline

N,M = map(int,readline().split())
B = [1] * N
possible = {0}
for i in range(M):
  x,y = map(int,readline().split())
  x,y = x - 1,y - 1
  B[x] -= 1
  B[y] += 1
  if x in possible:
    possible.add(y)
  if x in possible and B[x] == 0:
    possible.remove(x)

print(len(possible))

Measured memory_bytes: 12652
n = int(input())
ls_t = list(map(int, input().split()))
m = int(input())
ls_px = [[int(_) for _ in input().split()] for _ in range(m)]

time = sum(ls_t)

for i in range(m):
    p = ls_px[i][0] - 1
    x = ls_px[i][1]
    print(time - ls_t[p] + x)

Measured memory_bytes: 3060
#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>
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

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

ll dp[100010][2];

int main(){
    string s; cin >> s;
    int n = s.size();
    dp[0][0] = 1;
    rep(i,n){
        if(s[i] == '1'){
            dp[i+1][0] += dp[i][0]*2;
            dp[i+1][0] %= MOD;
            dp[i+1][1] += dp[i][0];
            dp[i+1][1] += dp[i][1]*3;
            dp[i+1][1] %= MOD;
        }
        else{
            dp[i+1][0] += dp[i][0];
            dp[i+1][1] += dp[i][1]*3;
            dp[i+1][1] %= MOD;
        }
    }
    ll ans = dp[n][0]+dp[n][1];
    ans %= MOD;
    cout << ans << endl; 


}


Measured memory_bytes: 2048
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>

using namespace std;

int main() {
	int n;
	cin >> n;
	vector<int> a(n), b(n), c(n);
	vector<int> dp1(n, 0), dp2(n, 0), dp3(n, 0);
	for (int i = 0; i < n; ++i) {
		cin >> a[i] >> b[i] >> c[i];
	}
	dp1[0] = a[0];
	dp2[0] = b[0];
	dp3[0] = c[0];
	for (int i = 1; i < n; ++i) {
		dp1[i] = max(dp2[i - 1], dp3[i - 1]) + a[i];
		dp2[i] = max(dp1[i - 1], dp3[i - 1]) + b[i];
		dp3[i] = max(dp2[i - 1], dp1[i - 1]) + c[i];
	}
	cout << max(dp1[n - 1], max(dp2[n - 1], dp3[n - 1])) << endl;
	cin >> n;

}

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

int main() {
    int h, w;
    while (1) {
        cin >> h >> w;
        if (h == 0 && w == 0) break;

        for (int i = 0; i < h; i++) {
            for (int j = 0; j < w; j++) {
                if (i == 0 || i == h - 1) cout << "#";
                else if (j == 0 || j == w - 1) cout << "#";
                else cout << ".";
            }
            cout << endl;
        }
        cout << endl;
    }

    return 0;
}


Measured memory_bytes: 3104
#include <set>
#include <string>
#include <iostream>
#include <algorithm>

using namespace std;

int main()
{
    string S; int n;
    
    scanf("%d", &n);
    
    while(n--)
    {
        cin >> S;
        
        set<string> T;
        
        for(int j = 1; j < S.size(); j++)
        {
            string A = S.substr(0, j);
            string B = S.substr(j, S.size() - j);
            
            string C = A; reverse(C.begin(), C.end());
            string D = B; reverse(D.begin(), D.end());
            
            T.insert(A + B);
            T.insert(B + A);
            T.insert(A + D);
            T.insert(D + A);
            T.insert(C + B);
            T.insert(B + C);
            T.insert(C + D);
            T.insert(D + C);
        }
        
        printf("%d\n", T.size());
    }
    
    return 0;
}

Measured memory_bytes: 3384
import java.util.*;

public class Main{
    static int n;
    static long m;
    static int v;
    static int p;
    static long[] a;
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        
        n = Integer.parseInt(sc.next());
        m = Long.parseLong(sc.next());
        v = Integer.parseInt(sc.next());
        p = Integer.parseInt(sc.next());
        a = new long[n];
        for(int i=0; i<n; i++){
            a[i] = Long.parseLong(sc.next());
        }
        
        Arrays.sort(a);
        //reverse
        for(int i=0; i<n/2; i++){
            long tmp = a[n-i-1];
            a[n-i-1] = a[i];
            a[i] = tmp;
        }
        
        int ok = 0;
        int ng = n;
        for(int i=0; i<20; i++){
            int mid = (ok+ng)/2;
            if(check(mid)){
                ok = mid;
            }else{
                ng = mid;
            }
        }
        
        System.out.println(ok+1);
    }
    
    public static boolean check(int x){
        if(a[x]+m < a[p-1]){
            return false;
        }
        long sum = 0;
        for(int i=0; i<n; i++){
            if(i<p-1 || x<=i){
                sum+=m;
            }else{
                sum+=Math.max(a[x]+m-a[i], 0);
            }
        }
        
        return sum >= m*v;
    }
}


Measured memory_bytes: 50148
from fractions import gcd

N=int(input())
A=sorted(map(int, input().split()))

def divs(p):
	div=set()
	for n in range(1, int(p**0.5)+1):
		if p % n == 0:
			div.add(n)
			div.add(p // n)
	return div


for d in sorted(divs(A[0]) | divs(A[1]), reverse=True):
	if sum([0 if a % d == 0 else 1 for a in A]) < 2:
		break

print(d)


Measured memory_bytes: 123124
#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <cassert>
#include <utility>
#include <queue>
using namespace std;

const int INF = 1 << 29;

int N, M, H, K, S, T, P;

struct edge {
    int to;
    int cost, company;
    edge() {}
    edge(int t, int a, int c) : to(t), cost(a), company(c) {}
};

struct state {
    int pos, cost;
    state(int pos, int cost) : pos(pos), cost(cost) {}
    bool operator < (const state& o) const {
        return cost > o.cost;
    }
};

vector<vector<edge>> graph;
int passports[1 << 8];

int solve(){
    int NN = (H+1)*N;

    vector<int> min_cost(NN, INF);

    priority_queue<state> pq;

    int ans = INF;

    for (int n = 0; n < (1 << K); ++n) {
        if (passports[n] == INF) continue;

        fill(min_cost.begin(), min_cost.end(), INF);
        min_cost[S] = passports[n];
        pq.emplace(S, passports[n]);

        while (!pq.empty()) {
            state st = pq.top(); pq.pop();
            if (st.cost > min_cost[st.pos]) continue;
            for (edge e : graph[st.pos]) {
                int cost = ((n & (1 << e.company)) != 0) ? 0 : e.cost;
                if (st.cost + cost < min_cost[e.to]) {
                    min_cost[e.to] = st.cost + cost;
                    pq.emplace(e.to, min_cost[e.to]);
                }
            }
        }

        for (int i = 0; i <= H; ++i)
            ans = min(ans, min_cost[T + i*N]);
    }

    return (ans == INF) ? -1 : ans;
}

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

    while(1){
        cin >> N >> M >> H >> K;
        if(N == 0 && M == 0 && H == 0 && K == 0)
            break;

        graph.clear();
        graph.resize((H+1)*N);
        fill(passports, passports+(1<<K), INF);
        passports[0] = 0;

        for (int i = 0; i < M; ++i) {
            int a, b, c, h, r;
            cin >> a >> b >> c >> h >> r;
            --a; --b; --r;
            for (int j = 0; j + h <= H; ++j) {
                graph[a+N*j].emplace_back(b+N*(j+h), c, r);
                graph[b+N*j].emplace_back(a+N*(j+h), c, r);
            }
        }

        cin >> S >> T >> P;
        --S; --T;

        for (int i = 0; i < P; ++i) {
            int l, d; cin >> l >> d;
            int idx = 0;
            for (int j = 0; j < l; ++j) {
                int k; cin >> k; --k;
                idx |= (1 << k);
            }
            passports[idx] = min(passports[idx], d);
        }

        for (int i = 1; i < (1 << K); ++i) {
            for (int j = 1; j < i; ++j) {
                int k = i | j;
                passports[k] = min(passports[k], passports[i] + passports[j]);
            }
        }

        cout << solve() << endl;
    }
}



Measured memory_bytes: 3644
#pragma GCC optimize "O3"

#define F first
#define S second
#define ALL(x) x.begin(), x.end()

#include<bits/stdc++.h>

using namespace std;

typedef long long LL;
typedef pair<int, int> PII;

constexpr int N = 100000;

int k;
LL a[N];

int main() {
  scanf("%d", &k);
  for(int i = 0; i < k; ++i)
    scanf("%lld", a + i);
  if(a[k-1] != 2) {
    puts("-1");
    return 0;
  }
  LL lb = 2, rb = 2;
  for(int i = k-1; i >= 1; --i) {
    assert(lb % a[i] == 0);
    assert(rb % a[i] == 0);
    lb = (lb / a[i]) * a[i] - 1;
    rb = (rb / a[i]) * a[i] + a[i] - 1;
    lb += (a[i-1] - (lb % a[i-1]));
    rb -= (rb % a[i-1]);
    //cerr << lb << " " << rb << endl;
    //assert(lb <= rb);
    if(lb > rb) {
      puts("-1");
      return 0;
    }
  }
  printf("%lld %lld\n", lb, rb + a[0] - 1);
}


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

#define debug(x) cout <<"DEBUG"<<" "<< #x << ":" << x << '\n'

//↓0-originか1-originでn回繰り返し
#define rep(i,n) for(int i = 0; i < ((int)(n)); i++)   //0-indexed昇順
#define rep1(i,n) for(int i = 1; i <= ((int)(n)); i++) //1-indexed昇順
#define rrep(i,n) for(int i = ((int)(n)-1); i >= 0; i--)  //0-indexed降順
#define rrep1(i,n) for(int i = ((int)(n)); i >= 1; i--)   //1-indexed降順
#define all(x) (x).begin(),(x).end()

typedef long long ll;
typedef long double ld;
typedef vector<int> vi;
typedef vector<vi> vii; //2次元配列
typedef vector<ll> vll;
typedef pair<int, int> PII;

template<typename T>
using vec = vector<T>;

template<class T,class U> inline bool chmax(T &a, const U &b){if(a<b){a=b;return 1;}return 0;}
template<class T,class U> inline bool chmin(T &a, const U &b){if(a>b){a=b;return 1;}return 0;}

const ld PI = acos(-1.0L);
const ll infll = (1LL<<62)-1;
const int inf = (1<<30)-1;
const int mod = 1000000007;
//const int mod = 998244353;


/*FUNCs=================================================*/


/*MAIN==================================================*/
signed main(){
    cin.tie(nullptr);
    ios::sync_with_stdio(false);   //cin cout 高速化
    //cout << fixed << setprecision(10);


    //これ、区間スケジューリングに見えるんですよね
    int n,m; cin >> n >> m;
    vec<PII> ab;
    int a,b;
    rep(i,m) {
        cin >> a >> b;
        ab.emplace_back(b,a);
    }
    sort(all(ab));

    int cnt = 0, t = 0;
    for(int i = 0; i < ab.size(); ++i) {
        if(t <= ab[i].second) {
            ++cnt;
            t = ab[i].first;
        }
    }
    cout << cnt << '\n';
}

Measured memory_bytes: 1400
n,k = map(int,input().split())
p = list(map(int,input().split()))
c = list(map(int,input().split()))
p = [i-1 for i in p]


groups = []
is_appear = [False]*n
group_size = [0]*n
for i in range(n):
    if is_appear[i]:
        continue
    group = []
    group.append(i)
    is_appear[i] = True
    j = p[i]
    while j != i:
        group.append(j)
        is_appear[j] = True
        j = p[j]
        
    groups.append(group)
    
    for i in group:
        group_size[i] = len(group)


cycle_score = [0]*n
for g in groups:
    score = 0
    for i in range(len(g)):
        score += c[g[i]]
    
    for i in g:
        cycle_score[i] = score

best = -float('inf')        
for i in range(n):
    score = 0
    best_i = -float('inf')
    cyc_num = k//group_size[i]
    if cycle_score[i]>0 and cyc_num>=1:
        remain = k-group_size[i]*(cyc_num-1)
        score += cycle_score[i]*(cyc_num-1)
        
    elif cycle_score[i]<=0:
        remain = group_size[i]
    elif cyc_num<1:
        remain = k
    
    j = i
    for _ in range(remain):
        j = p[j]
        score += c[j]
        best_i = max(best_i,score)
    best = max(best,best_i)
    
print(best)

Measured memory_bytes: 74908
#include<stdio.h>


int main()
{
	int W,H,x,y,r;

	scanf("%d %d %d %d %d",&W,&H,&x,&y,&r);
	if(x+r<=W && 0<=x-r){
		if(y+r<=H&&0<=y-r){
			printf("Yes\n");
		}else 
			printf("No\n");
	}else printf("No\n");

	return 0;
}


Measured memory_bytes: 2108
#include <bits/stdc++.h>
#define MAX_N 10000
#define INF 1e9

using namespace std;

typedef int long long ll;
typedef int long l;
typedef pair<int, int> Pii;
const ll MOD = 1000000007;


int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n, x;
    while (1) {
        cin >> n >> x;
        if (n == 0 && x == 0)
            break;
        int ans = 0;
        for (int i = 1; i < n + 1; i++) {
            for (int j = i + 1; j < n + 1; j++) {
                if (j < x - i - j && x - i - j < n + 1) {
                    ans++;
                    }
            }
        }
        cout << ans << '\n';
    }


    return 0;
}


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

int main() {
  char c;
  cin >> c;

  // ここにプログラムを追記
  if (c == 'a' || c == 'i' || c == 'u' || c == 'e' || c == 'o') {
    cout << "vowel" << endl;
  }
  else {
    cout << "consonant" << endl;
  }
}


Measured memory_bytes: 256
n, c = list(map(int, input().split()))
tv = []
for i in range(n):
    x, y, z = list(map(int, input().split()))
    tv.append([x, y, z])
channels = [[0 for _ in range(max(tv, key=lambda lst: lst[1])[1] + 1)] for _ in range(c + 1)]
for program in tv:
    start = program[0]
    end = program[1]
    channel = program[2]
    for time in range(start, end+1):
        channels[channel][time] = 1
res = 0
for time in range(len(channels[0])):
    now = 0
    for channel in range(c+1):
        now += channels[channel][time]
    if res < now:
        res = now
print(res)

Measured memory_bytes: 44560
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <cmath>
#include <stdio.h>
#include <queue>
#include <stack>
#include <climits>
#include <map>
#include <set>

using namespace std;

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

const ll mod = 1000000007;
const int inf = 1e9;
const long long INF = 1LL << 60;

int dp[100010];

int main()
{
    int n;
    cin >> n;
    vector<int> a;
    vector<int> b;
    for(int i = 6; i < 100000; i *= 6){
        a.push_back(i);
    }
    for(int i = 9; i < 100000; i *= 9){
        b.push_back(i);
    }
    for(int i = 0; i < 100010; i++){
        dp[i] = i;
    }

    for(int i = 0; i <= n; i++){
        for(int j = 0; j < a.size(); j++){
            if(i >= a[j]){
                dp[i] = min(dp[i],dp[i-a[j]] + 1);
            }else{
                dp[i+1] = dp[i] + 1;
            }
        }
        for(int j = 0; j < b.size(); j++){
            if(i >= b[j]){
                dp[i] = min(dp[i],dp[i-b[j]] + 1);
            }else{
                dp[i+1] = dp[i] + 1;
            }
        }
    }
    cout << dp[n];
}

Measured memory_bytes: 640
#include<iostream>
#include<algorithm>
#include<vector>
#include<numeric>
#include<string>
#include<cmath>
using namespace std;

int main(){
	int n; cin >> n;
	int n1 = n;
	vector<int> di(0);
	int flag = 1;
	for (int i=2;i<sqrt(n)+1;i++){
		while (n % i == 0){
			n = n / i;
			di.push_back(i);
			flag = 1;
		}
	}
	if (n != 1) di.push_back(n);
	cout << n1 << ": ";
	for (int i=0;i<di.size();i++){
		if (i != di.size()-1) cout << di[i] << " ";
		else cout << di[i] << endl;
	}

	return 0;
}




Measured memory_bytes: 3160
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll INF = 1e9;
const ll mod = 1e9+7;
typedef pair<int,int> P;
#define rep(i,N) for(int i=0;i<N;i++)
#define rep2(i,m,N) for(int i=m;i<N;i++)
#define mm(n,m) memset(n,m,sizeof(n))

vector< ll> divisor(ll n) {
  vector< ll> ret;
  for(ll i = 1; i * i <= n; i++) {
    if(n % i == 0) {
      ret.push_back(i);
      if(i * i != n) ret.push_back(n / i);
    }
  }
  sort(begin(ret), end(ret));
  return (ret);
}

int main(){
    ll a,b,tmp;
    cin>>a>>b;
    ll bb = b;
    if(a<b){
        tmp = a;
        a = b;
        b = tmp;
    }
    ll r = a % b;
    while(r!=0){
        a = b;
        b = r;
        r = a % b;
    }
   // cout<<b<<endl;


    //vector<ll> x(b + 1);
    ll num = b; // 素因数分解する変数num 
    ll ans = 0;
	for (ll i = 2; i <= sqrt(bb); i++) {
		while (num%i == 0) {
            ans++;
            while(num%i==0)num/=i;
		}
	}
    //if(bb%a==0)ans++;
    //cout<<num<<endl;
    if(num>1)ans++;
    cout<<ans+1<<endl;
}

Measured memory_bytes: 256
#include <float.h>
#include <limits.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <math.h>

#define P 1000000007

int comp(const void *a, const void *b){return *(int*)a-*(int*)b;}
int compw(const void *a, const void *b){return (*(int*)a>*(int*)b)-(*(int*)a<*(int*)b);}
int compr(const void *a, const void *b){return *(int*)b-*(int*)a;}

uint32_t nextpint(void){ char c=getchar(); while(c<'0'||'9'<c) c=getchar(); uint32_t x=0; while('0'<=c && c<='9'){ x=x*10+c-'0'; c=getchar(); } return x; }
uint32_t nextstr(char *s){ char c=getchar(); while(c==' '||c=='\n') c=getchar(); uint32_t len=0; while(c!=' '&&c!='\n'){ *s++=c; len++; c=getchar(); } *s='\0'; return len; }

inline int max2(const int a, const int b){return a>b?a:b;}
inline int min2(const int a, const int b){return a>b?b:a;}
inline int dif2(const int a, const int b){return a>b?a-b:b-a;}

char s[4];
int main(void){
	int n=nextstr(s);
	if(n==3){
		char t=s[0]; s[0]=s[2]; s[2]=t;
	}
	puts(s);
}


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

using lli = long long int;

template <class T>ostream &operator<<(ostream &o,const vector<T>&v)
{o<<"{";for(int i=0;i<(int)v.size();i++)o<<(i>0?", ":"")<<v[i];o<<"}";return o;}

template <class T>ostream &operator<<(ostream &o,const pair<T, T>&p)
{o<<"("<<p.first<<", "<<p.second<<")";return o;}

int main(void){
    lli n, k, r, s, p;
    string t;
    cin >> n >> k >> r >> s >> p >> t;
    lli sec = 0;
    lli score = 0;
    for(int i = 0; i < k; i++){
        for(int j = i; j < n; j += k){
            if(j + k < n && t[j+k] == t[j]){
                sec++;
                continue;
            }else{
                sec++;
                lli num = (sec+1)/2;
                lli point;
                if(t[j] == 'r'){
                    point = p;
                }else if(t[j] == 's'){
                    point = r;
                }else{
                    point = s;
                }
                score += point*num;
                sec = 0;
            }
        }
    }
    cout << score << endl;
    return 0;
}


Measured memory_bytes: 512
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int main(){
 int n,k;
 cin>>n>>k;
 string s;
 cin>>s;
 int prev=-1;
 vector<int> v;
 vector<int> a(n);
 a[0]=(s[0]=='1');
 for(int i=1;i<n;i++){
  if(s[i]=='1') a[i]=a[i-1]+1;
 }
 vector<int> b(n);
 b[n-1]=(s[n-1]=='1');
 for(int i=n-2;i>=0;i--){
  if(s[i]=='1') b[i]+=b[i+1]+1;
 }
 vector<int> st,en;
 s+='1';
 for(int i=0;i<=n;i++){
  if(s[i]=='1'){
   int cur=i-prev-1;
   if(cur) {v.push_back(cur);st.push_back(prev+1);en.push_back(i-1);}
   prev=i;
  }
 }
 if(v.size()==0){
  cout<<n<<endl;
  return 0;
 }
 k=min(k,(int)v.size());
 int cur=b[0];
 for(int i=0;i<k;i++) {
  cur+=v[i];
  if(en[i]!=n-1) cur+=b[en[i]+1];  
 }
 int ans=cur;
 for(int i=1;i<v.size()&&i+k-1<v.size();i++){
  int t1=v[i-1];
  if(st[i-1]) t1+=a[st[i-1]-1];
  int t2=v[k+i-1];
  if(en[i+k-1]!=n-1) t2+=b[en[i+k-1]+1];
  cur=cur+t2-t1;
  ans=max(ans,cur);
 }
 cout<<ans<<endl;
 return 0;
}

Measured memory_bytes: 2040
def main():
    N =int(input())
    A =list(map(int,input().split()))
    if 0 in A:
        print(0)
        return
    prod = 1
    for a in A:
        prod *= a
        if prod > 1000000000000000000:
            print(-1)
            return
    print(prod)
main()

Measured memory_bytes: 21464
#include<bits/stdc++.h>
using namespace std;
using ll=long long;
ll v[300000],r[300000],l[300000];
int main(){
  int n;
  cin>>n;
  for(int i=1;i<=n;++i){
    cin>>v[i];
    r[min(200000LL,i+v[i])]++;
    l[max(0LL,i-v[i])]++;
  }
  ll ans=0;
  for(int i=1;i<=n;++i){
    ans+=r[i]*l[i];
  }
  cout<<ans;
}

Measured memory_bytes: 8312
#include <bits/stdc++.h>
#define ALL(a) (a).begin(), (a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define pb push_back
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define rep(i, n) FOR(i, 0, n)
#define ll long long
using namespace std;

const ll P = 1000000007;
int gcd(int a, int b) { return b != 0 ? gcd(b, a % b) : a; }
int lcm(int a, int b) { return a / gcd(a, b) * b; }

int main()
{
  cout << fixed << setprecision(10);
  double T,X;
  cin >> T >> X;
  cout << T/X << endl;
  return 0;
}


Measured memory_bytes: 256
import java.util.*;

class Main{

    void solve(){
	Scanner sc = new Scanner(System.in);

	while(true){
	    int n = sc.nextInt();
	    if(n==0) break;

	    int m = sc.nextInt();
	    char[] c = sc.next().toCharArray();

	    int cnt = 0;
	    int ans = 0;
	    for(int i=0; i<c.length; i++){
		if(i+1<c.length && c[i]=='I' && c[i+1]=='O'){
		    cnt++;
		    //System.out.println("cnt "+cnt+" i "+i);
		    i++;
		}else if(c[i]=='I'){
		    //System.out.println("cnt "+cnt+" i "+i+" ans "+ans);
		    if(cnt-n+1>0) ans += cnt-n+1;
		    cnt = 0;
		}else if(c[i]=='O'){
		    //System.out.println("cnt "+cnt+" i "+i+" ans "+ans);
		    if(cnt-n>0) ans += cnt-n;
		    cnt = 0;
		}
	    }

	    System.out.println(ans);
	}
    }

    public static void main(String[] args){
	new Main().solve();
    }
}

Measured memory_bytes: 32656
#include <functional>
#include <iostream>
#include <vector>
#include <set>
#include <algorithm>
#include <queue>
#include <string>
#include <cstring>
#include <math.h>
using namespace std;


int main() {
   int n;
   string m,l;
  
   cin >> n >> m >> l;
   
   for(int i = 0;i<n;i++){
     
     if(i!=n-1){
        cout << m[i] << l[i];
     }else{
       cout << m[i] << l[i] << endl;

     }
   }
   
   
  return 0;
}


Measured memory_bytes: 3600
import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String S = sc.next();
        int w = sc.nextInt();

        for (int i = 0; i < S.length(); i++) {
            if (i % w == 0) {
                System.out.print(S.charAt(i));
            }
        }
        System.out.println();
    }
}


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

int main() {
  long N;
  cin >> N;
  map<long, long> map;
  for(long i=0; i<N; i++){
    long a;
    cin >> a;
    map[a]++;
  }

  long long ans = 0;
  for(auto pair : map){
    if(pair.first < pair.second){
      ans += pair.second - pair.first;
    }else if(pair.first > pair.second){
      ans += pair.second;
    }
  }

  cout << ans << endl;
}

Measured memory_bytes: 6272
import java.util.*;

public class Main {
	static int gcd(int x,int y) {
		if (x<y)gcd(y,x);
		if (x%y==0)return y;
		return gcd(y,x%y);
	}
	public static void main(String[] args)  {
		Scanner scan = new Scanner(System.in);
		int n=Integer.parseInt(scan.next());
		int[] a=new int[n];
		for (int i=0;i<n;++i) {
			a[i]=Integer.parseInt(scan.next());
		}
		int ans=a[0];
		for (int i=1;i<n;++i) {
			ans=gcd(ans,a[i]);
		}
		
		System.out.print(ans);
}
}
//end


Measured memory_bytes: 48612
#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
using namespace std;

int main() {
	int H,A;
	cin>>H>>A;
	int sum=0,cnt=0;
	while(true){
		sum+=A;
		cnt+=1;
		if(sum>=H) break;
	}
	cout<<cnt<<endl;
}

Measured memory_bytes: 384
#include <stdio.h>
int main()
{
	int arrrr[10],i,j,t;
	for(i=0;i<10;i++)
        scanf("%d",&arrrr[i]);
    for(j=0;j<10;j++)
        for(i=0;i<10-j;i++)
            if(arrrr[i]<arrrr[i+1])
            {
                t=arrrr[i];
                arrrr[i]=arrrr[i+1];
                arrrr[i+1]=t;
            }
    for(i=0;i<3;i++)
    printf("%d\n",arrrr[i]);
	return 0;
}

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

int main()
{
   ll n;
   string res;
   cin >> n;

   while(n)
   {
       res += char(--n % 26 + 'a');
       n /= 26;
   }

   reverse(res.begin(), res.end());

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

Measured memory_bytes: 3628
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <queue>
#include <cmath>
#include <climits>
#include <iomanip>
#include <set>
#include <map>
using namespace std;
typedef long long ll;
int main(){
  ll n,k;
  cin >> n >> k;
  vector<pair<ll,ll>> a(n);
  for(int i = 0;i < n;i++){
    ll p,q;
    cin >> p >> q;
    a[i] = make_pair(p,q);
  }
  sort(a.begin(),a.end());
  /*for(int i = 0;i < n;i++){
    cout << a[i].first << " " << a[i].second << endl;
  }*/
  ll now = 0;
  for(int i = 0;i < n;i++){
    now += a[i].second;
    if(now >= k){
      cout << a[i].first << endl;
      return 0;
    }
  }
}

Measured memory_bytes: 1792
#include<cstdio> 
#include<cctype>
#include<iostream>
#include<cstring>
#include<algorithm>
#define LL long long 
using namespace std;
const int N = 2e5 + 3;
int n;
LL a[N];
LL ans = 0x3f3f3f3f;
LL sum[N];
LL dp[N][3];
inline int read(){
	int v = 0,c = 1;char ch = getchar();
	while(!isdigit(ch)){
		if(ch == '-') c = -1;
		ch = getchar();	
	}
	while(isdigit(ch)){
		v = v * 10 + ch - 48;
		ch = getchar();	
	}
	return v * c;	
}
inline bool check(){
	for(int i = 1; i <= n;++i)
	if(a[i] != 0) return false;
	return true;
}
// dp[i][0] ：还未选奇数区间，dp[i][1] : 已经选择完，dp[i][2]正在选 
int main(){
	memset(dp,0x3f,sizeof(dp));
	n = read();
	for(int i = 1;i <= n;++i) a[i] = read(),sum[i] = sum[i - 1] + a[i];
	dp[0][0] = dp[0][1] = dp[0][2] = 0;
	if(check()){
		cout << "0" << endl;
		return 0;	
	}
	for(int i = 1;i <= n;++i){
		int k1,k2;
		if(a[i] & 1) k1 = 1,k2 = 0;
		else k1 = 0,k2 = 1;
		if(a[i] == 0) k1 = 2,k2 = 1;
		dp[i][0] = min(dp[i - 1][0] + k1,min(dp[i][0],sum[i - 1] + k1));
		dp[i][2] = min(min(dp[i - 1][2] + k2,sum[i - 1] + k2),min(dp[i - 1][0] + k2,
		dp[i][2]));
		dp[i][1] = min(min(dp[i - 1][1],dp[i - 1][2]) + k1,min(dp[i][1],sum[i - 1] + k1));
		ans = min(ans,min(dp[i][1],min(dp[i][0],dp[i][2])) + sum[n] - sum[i]);
	}
	cout << ans;
	return 0;
}

Measured memory_bytes: 8064
Q, H, S, D = map(int, input().split())
N = int(input())

if N%2:
    if D < 2*min(Q*4, H*2, S):
        print(N//2*D+min(Q*4, H*2, S))
    else:
        print(N*min(Q*4, H*2, S))
else:
    print(N*min(Q*8, H*4, S*2, D)//2)

Measured memory_bytes: 3064
#define _USE_MATH_DEFINES
#include <bits/stdc++.h>
using namespace std;
#define FOR(i,m,n) for(int i=(m);i<(n);++i)
#define REP(i,n) FOR(i,0,n)
#define ALL(v) (v).begin(),(v).end()
using ll = long long;
const int INF = 0x3f3f3f3f;
const ll LINF = 0x3f3f3f3f3f3f3f3fLL;
const double EPS = 1e-8;
const int MOD = 1000000007;
// const int MOD = 998244353;
const int dy[] = {1, 0, -1, 0}, dx[] = {0, -1, 0, 1};
const int dy8[] = {1, 1, 0, -1, -1, -1, 0, 1}, dx8[] = {0, -1, -1, -1, 0, 1, 1, 1};
template <typename T, typename U> inline bool chmax(T &a, U b) { return a < b ? (a = b, true) : false; }
template <typename T, typename U> inline bool chmin(T &a, U b) { return a > b ? (a = b, true) : false; }
struct IOSetup {
  IOSetup() {
    cin.tie(nullptr);
    ios_base::sync_with_stdio(false);
    cout << fixed << setprecision(20);
  }
} iosetup;

int main() {
  int x, n; cin >> x >> n;
  vector<int> p(n); REP(i, n) cin >> p[i];
  for (int diff = 0; ; ++diff) {
    if (count(ALL(p), x - diff) == 0) {
      cout << x - diff << '\n';
      return 0;
    }
    if (count(ALL(p), x + diff) == 0) {
      cout << x + diff << '\n';
      return 0;
    }
  }
}


Measured memory_bytes: 3648