akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>

using namespace std;

using ll = long long;
using P = pair<ll, ll>;
using Graph = vector<vector<ll>>;
#define rep(i, n) for(ll i=0;i<(ll)(n);i++)
#define rep2(i, m, n) for(ll i=m;i<(ll)(n);i++)
#define rrep(i, n, m) for(ll i=n;i>=(ll)(m);i--)
const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};
const int ddx[8] = {0, 1, 1, 1, 0, -1, -1, -1};
const int ddy[8] = {1, 1, 0, -1, -1, -1, 0, 1};
const ll MOD = 1000000007;
const ll INF = 1000000000000000000L;
#ifdef __DEBUG

/**
 * For DEBUG
 * https://github.com/ta7uw/cpp-pyprint
 */
#include "cpp-pyprint/pyprint.h"

#endif

ll dp[1005][1005];

void Main() {
    int H, W;
    cin >> H >> W;
    vector<string> grid(H);
    rep(i, H) cin >> grid[i];

    dp[0][0] = 1;
    rep(i, H) {
        rep(j, W) {
            if (i + 1 < H && grid[i + 1][j] != '#') {
                dp[i + 1][j] += dp[i][j];
                dp[i + 1][j] %= MOD;
            }
            if (j + 1 < W && grid[i][j + 1] != '#') {
                dp[i][j + 1] += dp[i][j];
                dp[i][j + 1] %= MOD;
            }
        }
    }
    cout << dp[H - 1][W - 1] % MOD << '\n';
}

int main() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(15);
    Main();
    return 0;
}


Measured memory_bytes: 9216
#include<stdio.h>
int main(){
  int N,M,x[1001],i,sum,ans;
  double P;
  while(1){
    sum=0;
    ans=0;
    scanf("%d%d%lf",&N,&M,&P);
    if(N==0&&M==0&&P==0)break;
    P=(100-P)*0.01;
    for(i=0;i<N;i++){
      scanf("%d",&x[i]);
      sum=sum+x[i];
    }
    sum=sum*100;

    if(x[M-1]==0)printf("0\n");
    else{  ans=(sum*P)/x[M-1];
    printf("%d\n",ans);
    }
  }
  return 0;
}

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

using namespace std;

template <class T>inline T updmax(T& a, T b) {return a = max(a, b);}
template <class T>inline T updmin(T& a, T b) {return a = min(a, b);}

class Solution {
public:
	void dfs(vector<vector<int>> &ans, int level, vector<int> m){
		if(m.size() <= 1)return;
		int n = m.size();
		for(int i=0; i < n; i++){
			for(int j=i+1; j < n; j+=2){
				ans[m[i]][m[j]-m[i]-1] = level+1;
			}
		}
		vector<int> v1, v2;
		for(int i=0; i < n; i+=2)v1.emplace_back(m[i]);
		for(int i=1; i < n; i+=2)v2.emplace_back(m[i]);
		dfs(ans,level+1, v1);
		dfs(ans,level+1, v2);
	}
	void solve() {
		int n;
		cin >> n;
		vector<vector<int>> ans(n-1);
		for(int i=0; i < n-1; i++)ans[i] = vector<int>(n-1-i);
		vector<int> v(n);
		for(int i=0; i < n; i++)v[i] = i;
		dfs(ans, 0, v);
		for(int i=0; i < n-1; i++){
			for(int j=0; j < n-1-i; j++){
				cout << ans[i][j] << " ";
			}
			cout << "\n";
		}
		return;
	};
};

int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(nullptr);
	Solution solution;
	solution.solve();
	return 0;
}

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

const int N = 1e5 + 10, M = 31;
int n, ans, x, mark[M];

int main() {
	ios::sync_with_stdio(0);
	cin.tie(0);
	
	cin >> n;
	for (int i = 0; i < n; i++) {
		int y, cnt = 0;
		cin >> y;
		x ^= y;
		
		while (y % 2 == 0) {
			cnt++;
			y /= 2;
		}
		mark[++cnt]++;
	}
	
	for (int i = M - 1; i >= 0; i--)
		if (x & (1LL << i)) {
			if (!mark[i + 1])
				return cout << -1, 0;
			x = ~x;
			ans++;
		}
	cout << ans;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int maxn = 5100+10;
const ll inf = 1e9+7;
int vis[maxn],sum,t,x;
int main() {
    ios::sync_with_stdio(0);
    int n,k;
    cin>>n>>k;
    for(int i=1;i<=k;i++){
        cin>>t;
        while(t--){
            cin>>x;
            vis[x]=1;
        }
    }
    for(int i=1;i<=n;i++){
        if(vis[i]==0)
            sum++;
    }
    cout<<sum;
    return 0;
}


Measured memory_bytes: 3628
#include<iostream>
#include<algorithm>
#include<cmath>
#include<cstring>
#include<string>
#include<map>
#include<set>
#include<queue>
#include<cstdio>
#include<fstream>
#include<vector>
#include<stack>

using namespace std;
#define ll long long
#define mem(i,j) memset(i,j,sizeof i)
#define up(i,j,k) for(int i=j;i<k;i++)
#define uup(i,j,k) for(int i=j;i>=k;i--)
#define mod(x) (x)%mod
#define sfi(i) scanf("%d",&i)
#define sfs(i) scanf("%s",i)
#define sfc(i) scanf("%c",&i)
#define sfl(i) scanf("%lld",&i)
#define sfd(i) scanf("%lf",&i)
#define sff(i) scanf("%f",&i)
#define wt(a) cout<<"This is:"<<a<<endl
#define sf() cout<<"This is a flag"<<endl

const int N = 1010;
const ll llinf = 0x7fffffffffffffff;
const int inf = 0x3f3f3f3f;
const int mod = 1e9 + 7;
const double eps = 1e-8;
const int MAX = 1e5 + 5;

int arr[MAX];
int main()
{
	int n;
	sfi(n);
	up(i, 1, n+1)
	{
		sfi(arr[i]);
	}
	int sum = 0;
	arr[0] = 0;
	up(i, 0, n)
	{
		sum += abs(arr[i] - arr[i + 1]);
	}
	sum += abs(arr[n]);
	int ss = sum;
	up(i, 1, n + 1)
	{
		int tt = arr[i];
		if (i != n)
		{
			sum -= (abs(arr[i] - arr[i - 1]) + abs(arr[i] - arr[i + 1]));
			sum += abs(arr[i - 1] - arr[i + 1]);
		}
		else
		{
			sum -= (abs(arr[n]) + abs(arr[n - 1] - arr[n]));
			sum += abs(arr[n-1]);
		}
		printf("%d\n", sum);
		sum = ss;
	}
	return 0;
}

Measured memory_bytes: 1664
#include<iostream>
#include<cstring>
using namespace std;
int main(){
  int n;
  char s[1010];
  cin >> s;
  n=strlen(s);
  for(int i=0;i<n;i++){
    if(s[i]=='A'){
      s[i]='X';
    }
    else if(s[i]=='B'){
      s[i]='Y';
    }
    else if(s[i]=='C'){
      s[i]='Z';
    }
    else{
      s[i]-=3;
    }
  }
  cout << s << endl;
}

Measured memory_bytes: 1140
#include<iostream>
#include<string>
#include<algorithm>
#include<map>
#include<set>
#include<utility>
#include<vector>
#include<cmath>
#include<cstring>
#include<cstdio>
#include<time.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 mp make_pair
#define all(in) in.begin(),in.end()
const double PI=acos(-1);
const double EPS=1e-10;
using namespace std;
typedef long long ll;
typedef vector<int> vi;
int main(){
	int in;
	while(cin>>in){
		in%=39;
		if(in==0)in=39;
		printf("3C%02d\n",in);
	}
}

Measured memory_bytes: 1160
#include<bits/stdc++.h>
using namespace std;
int main() {
  int n,i;
  cin>>n;
  vector<int> d(n);
  for(i=0;i<n;i++) cin>>d.at(i);
  sort(d.begin(),d.end());
  cout<<d.at(n/2)-d.at(n/2-1)<<endl;
}

Measured memory_bytes: 640
import java.util.Scanner;

public class Main{
    Main(){
    Scanner sc = new Scanner(System.in);
    int n, t, s, cnt;
    int[] a;
 
    while(sc.hasNext()){
        n = sc.nextInt();
 
        a = new int[n];
        for(int i = 0; i < n; ++i)
        a[i] = sc.nextInt();
 
        cnt = 0;
        for(int i = 0; i < n; ++i){
        t = i;
        for(int j = i; j < n; ++j)
            if(a[j] < a[t]) t = j;
 
        if(a[t] != a[i]){
            s = a[i];
            a[i] = a[t];
            a[t] = s;
            ++cnt;
        }
        }
 
        for(int i = 0; i < n-1; ++i)
        System.out.printf("%d ", a[i]);
        System.out.println(a[n-1]);
        System.out.println(cnt);
    }
    }
 
    public static void main(String[] args){
    new Main();
    }
}


Measured memory_bytes: 26528
#include<bits/stdc++.h>
using namespace std;
#define REP(i,n) for((i)=0;(i)<(int)(n);(i)++)
typedef long long ll;
typedef pair<ll, ll> P;
const int MOD = 1000000007;



int main(){
    int n, sum = 0;
    cin >> n;
    vector<int> a(n + 2);
    a[0] = a[n + 1] = 0;
    for (int i = 1; i <= n; i++){
        cin >> a[i];
        sum += abs(a[i] - a[i - 1]);
    }
    sum += abs(a[n + 1] - a[n]);

    for (int i = 1; i <= n; i++){
        cout << sum - (abs(a[i] - a[i -1]) + abs(a[i + 1] - a[i])) + abs(a[i + 1] - a[i - 1]) << endl;
    }
    
    return 0;
}

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

    using namespace std;

    int main() {
      int n, t, ans = 0;
      cin >> n;
      int nowmin = 100000000;
      for (int i = 1; i <= n; ++ i) {
      	cin >> t;
        if (t <= nowmin) ++ ans;
        nowmin = min(nowmin, t);
      }
      cout << ans;
    }


Measured memory_bytes: 256
#include<stdio.h>
int main(void)
{
	int a,s,d,f,g,i,j;
	while(scanf("%d",&a)!=EOF){
		s=0;
		for(i=0;i<=9;i++){
			for(j=0;j<=9;j++){
				for(f=0;f<=9;f++){
					for(g=0;g<=9;g++){
						if(a==i+j+f+g){
							s++;
						}
					}
				}
			}
		}
		printf("%d\n",s);
	}
	return 0;
}

Measured memory_bytes: 1024
#include<bits/stdc++.h>
using namespace std;
#define int         long long
#define ull 	    unsigned long long
#define ll 	    long long
#define N	    100005
#define M 	    1000000007
#define pb 	    push_back
#define p_q 	    priority_queue
#define pii         pair<ll,ll>
#define vi          vector<ll>
#define vii         vector<pii>
#define mi          map<ll,ll>
#define mii         map<pii,ll>
#define all(a)      (a).begin(),(a).end()
#define sz(x)       (ll)x.size()
#define endl        '\n'
#define gcd(a,b)    __gcd((a),(b))
#define lcm(a,b)    ((a)*(b)) / gcd((a),(b))
#define ios	    ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define mp 	    make_pair
#define lb 	    lower_bound
#define ub	    upper_bound
#define F           first
#define S           second
#define rep(i, begin, end) for (__typeof(end) i = (begin) - ((begin) > (end)); i != (end) - ((begin) > (end)); i += 1 - 2 * ((begin) > (end)))
#define ini(a,n,b)	for(ll int i=0;i<n;i++) a[i]=0;
#define cset(a)		__builtin_popcountll(a)
#define hell 		(ull)1e9
#define re 		resize


signed main(void)
{ios
	int TESTS=1;
	//cin>>TESTS;
	while(TESTS--)
	{
		int h,w;
		cin>>h>>w;
		char arr[h+1][w+1];
		rep(i,1,h+1) rep(j,1,w+1) cin>>arr[i][j];
		int dp[h+1][w+1];
		dp[1][1]=0;
		bool ok=1;
		rep(i,2,h+1)
		{
			if(arr[i][1]=='#') ok=0;
			if(ok) dp[i][1]=1;
			else dp[i][1]=0;
		}
		ok=1;
		rep(i,2,w+1)
		{
			if(arr[1][i]=='#') ok=0;
			if(ok) dp[1][i]=1;
			else dp[1][i]=0;	
		}

		rep(i,2,h+1)
		{
			rep(j,2,w+1)
			{
				if(arr[i][j]=='#') dp[i][j]=0;
				else dp[i][j]=(dp[i-1][j]+dp[i][j-1])%M;
			}
		}
		cout<<dp[h][w];
	}
	
}

Measured memory_bytes: 9088
#include <iostream>
#include <iomanip>
#include <cmath>
using namespace std;

constexpr double eps = 1e-8;

int main() {
    double a, b, c, d, e, f;
    while(cin >> a >> b >> c >> d >> e >> f) {
        double x = (c*e - b*f) / (a*e - b*d);
        double y = (c - a*x) / b;
        if(fabs(x) < eps) {
            x = 0;
        }
        if(fabs(y) < eps) {
            y = 0;
        }
        cout << fixed << setprecision(3) << x << " " << y << endl;
    }
}


Measured memory_bytes: 3280
s = input()

for i in range(len(s)-2):
    if s[i]==s[i+1] or s[i]==s[i+2]:
        print(i+1,end=' ')
        print(i+3)
        exit()
if s[-2]==s[-1]:
    print(len(s)-1,end=' ')
    print(len(s))
    exit()
print('-1 -1')

Measured memory_bytes: 39280
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		int b = sc.nextInt();
		int c = sc.nextInt();
		int k = sc.nextInt();
		for(int i = 0 ; i < k ; i++) {
			if(b <= a) {
				b *= 2;
				}
			else
				c *= 2;
		}
		if(c > b && b > a) {
		System.out.println("Yes");
		}
		else
			System.out.println("No");

	}
}



Measured memory_bytes: 35600
#include<iostream>
using namespace std;
int main()
{
	string a[3] = {"Sunny", "Cloudy", "Rainy"};
	string s;
	cin >> s;
	for(int i = 0; i < 3; ++i) {
		if(a[i] == s) {
			cout << a[(i + 1) % 3];
			break;
		}
	}
  
return 0;
}

Measured memory_bytes: 3580
#include <iostream>
#include <vector>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <algorithm>
#include <functional>
#include <list>
#include <numeric>
#include <math.h>
#include <cstdlib>
#include <queue>
#include <iterator>
#include <limits>
#include <string>
#include <sstream>
#include <iomanip>
#include <bitset>
#include <mutex>
#include <condition_variable>
#include <atomic>
#include <stack>
#include <memory>
#include <deque>
#include <string_view>
#include <random>
#include <chrono>
#include <cstring>

using namespace std;

static int my_speed_up = []() { ios_base::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr); return 0; }();
using ll = long long; using ull = unsigned long long;
template<class T> using v = vector<T>;
template<class T> using vv = vector<vector<T>>;
template<class T> using vvv = vector<vector<vector<T>>>;
template<class T> using vvvv = vector<vector<vector<vector<T>>>>;
template<class T1, class T2> using um = unordered_map<T1, T2>;
template<class T> using us = unordered_set<T>;
using pii = pair<int,int>;
#define print_line cout << "[" << setw(3) << __LINE__ << "]  ";
#define for_b(i, b) for (int i = 0; i < (b); ++i)
#define for_ab(i, a, b) for (int i = a; i < (b); ++i)
#define what_is(x) { print_line cout << #x << " = " << x << endl; }
template<class T, class ... Ts> void what_are_2(T const& arg, Ts const&...args) { cout << arg; if constexpr (sizeof...(args) > 0) { cout << ", "; what_are_2(args...); } }
#define what_are(...) { print_line what_are_2(__VA_ARGS__); cout << endl; }
#define hit { print_line cout << "hit!" << endl; }
#define pad(x) for_b(i, x) cout << "  ";
#define show_1d(___x) { print_line cout << #___x << " = "; for (auto ___num : ___x) cout << ___num << ", "; cout << endl;} 
#define show_2d(___x) { print_line cout << #___x << endl; for (auto ___row : ___x) { for (auto ___num : ___row) cout << ___num << ", "; cout << endl; }}
#define show_3d(___x) { print_line cout << #___x << endl; for (auto ___row : ___x) { for (auto ___row2 : ___row) { for (auto ___num : ___row2) cout << ___num << ", "; cout << endl; }cout << endl; }}

vv<int> d4 = {{1,0},{-1,0},{0,1},{0,-1}};
vv<int> d8 = {{1,0},{-1,0},{0,1},{0,-1},{1,1},{1,-1},{-1,1},{-1,-1}};
bool is_valid_pos(size_t w, size_t h, int x, int y) {
    return x >= 0 && x < static_cast<int>(w) && y >= 0 && y < static_cast<int>(h);
}

// ⣿⣿⣟⣽⣿⣿⣿⣿⣟⣵⣿⣿⣿⡿⣳⣫⣾⣿⣿⠟⠻⣿⣿⣿⢻⣿⣿⣿⣿⣷⡽⣿
// ⣿⣟⣾⡿⣿⣿⢟⣽⣿⣿⣿⣿⣫⡾⣵⣿⣿⣿⠃⠄⠄⠘⢿⣿⣾⣿⣿⣿⢿⣿⣿⡜
// ⡿⣼⡟⣾⣿⢫⣿⣿⣿⣿⡿⣳⣿⣱⣿⣿⣿⡋⠄⠄⠄⠄⠄⠛⠛⠋⠁⠄⠄⣿⢸⣿
// ⢳⣟⣼⡿⣳⣿⣿⣿⣿⡿⣹⡿⣃⣿⣿⣿⢳⠁⠄⠄⠄⢀⣀⠄⠄⠄⠄⠄⢀⣿⢿⣿
// ⡟⣼⣿⣱⣿⡿⣿⣿⣿⢡⣫⣾⢸⢿⣿⡟⣿⣶⡶⢰⣿⣿⣿⢷⠄⠄⠄⠄⢼⣿⣸⣿
// ⣽⣿⢣⣿⡟⣽⣿⣿⠃⣲⣿⣿⣸⣷⡻⡇⣿⣿⢇⣿⣿⣿⣏⣎⣸⣦⣠⡞⣾⢧⣿⣿
// ⣿⡏⣿⡿⢰⣿⣿⡏⣼⣿⣿⡏⠙⣿⣿⣤⡿⣿⢸⣿⣿⢟⡞⣰⣿⣿⡟⣹⢯⣿⣿⣿
// ⡿⢹⣿⠇⣿⣿⣿⣸⣿⣿⣿⣿⣦⡈⠻⣿⣿⣮⣿⣿⣯⣏⣼⣿⠿⠏⣰⡅⢸⣿⣿⣿
// ⡀⣼⣿⢰⣿⣿⣇⣿⣿⡿⠛⠛⠛⠛⠄⣘⣿⣿⣿⣿⣿⣿⣶⣿⠿⠛⢾⡇⢸⣿⣿⣿
// ⠄⣿⡟⢸⣿⣿⢻⣿⣿⣷⣶⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⡋⠉⣠⣴⣾⣿⡇⣸⣿⣿⡏
// ⠄⣿⡇⢸⣿⣿⢸⢻⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣄⠘⢿⣿⠏⠄⣿⣿⣿⣹
// ⠄⢻⡇⢸⣿⣿⠸⣿⣿⣿⣿⣿⣿⠿⠿⢿⣿⣿⣿⣿⣿⣿⣿⣦⣼⠃⠄⢰⣿⣿⢯⣿
// ⠄⢸⣿⢸⣿⣿⡄⠙⢿⣿⣿⡿⠁⠄⠄⠄⠄⠉⣿⣿⣿⣿⣿⣿⡏⠄⢀⣾⣿⢯⣿⣿
// ⣾⣸⣿⠄⣿⣿⡇⠄⠄⠙⢿⣀⠄⠄⠄⠄⠄⣰⣿⣿⣿⣿⣿⠟⠄⠄⣼⡿⢫⣻⣿⣿
// ⣿⣿⣿⠄⢸⣿⣿⠄⠄⠄⠄⠙⠿⣷⣶⣤⣴⣿⠿⠿⠛⠉⠄⠄ ⢸⣿⣿⣿⣿⠃⠄⢀⣴




int main()
{
    int i;
    cin >> i;
    
    cout << (i ^ 1) << endl;
    return 0;
}


Measured memory_bytes: 3656
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import accumulate, permutations, combinations, product
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

N, M = MAP()
sc = [LIST() for _ in range(M)]

if N == 1 and M == 0:
  print(0)
  exit()
  
cnt = [-1]*N

for i in range(M):
  if cnt[sc[i][0]-1] == -1:
    cnt[sc[i][0]-1] = sc[i][1]
    
  if cnt[sc[i][0]-1] != -1 and cnt[sc[i][0]-1] != sc[i][1]:
    print(-1)
    exit()

if cnt[0] == -1:
  cnt[0] = 1

for i in range(1, N):
  if cnt[i] == -1:
    cnt[i] = 0
    
if cnt[0] == 0 and N > 1:
  print(-1)
  exit()

for i in range(N):
  print(cnt[i], end="")
print()

Measured memory_bytes: 5192
mod = 10**9+7

n = int(input())
a = [[int(x) for x in input().split()] for _ in range(n)]

dp = [-1 for __ in range(1 << n)]
dp[0] = 1


def dfs(bit, i):
    if dp[bit] != -1:
        return dp[bit]
    else:
        tmp = 0
        for j in range(n):
            if bit & (1 << j) and a[i][j]:
                tmp += dfs(bit ^ (1 << j), i+1)
    dp[bit] = tmp % mod
    return dp[bit]


print(dfs(2**n-1, 0))

Measured memory_bytes: 123624
#include <cstdlib>
#include <cmath>
#include <climits>
#include <cfloat>
#include <map>
#include <set>
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <sstream>
#include <complex>
#include <stack>
#include <queue>
#include <cstdio>
#include <cstring>
#include <iterator>
#include <bitset>
#include <unordered_set>
#include <unordered_map>
#include <fstream>
#include <iomanip>
#include <cassert>
#include <utility>
#include <memory>
#include <functional>
#include <deque>
#include <cctype>
#include <ctime>
#include <numeric>
#include <list>
#include <iomanip>

#if __cplusplus >= 201103L
#include <array>
#include <tuple>
#include <initializer_list>
#include <forward_list>

#define cauto const auto&
#else

#endif

using namespace std;


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

typedef vector<int> vint;
typedef vector<vector<int> > vvint;
typedef vector<long long> vll;
typedef vector<vector<long long> > vvll;

#define VV(T) vector<vector< T > >

template <class T>
void initvv(vector<vector<T> > &v, int a, int b, const T &t = T()){
    v.assign(a, vector<T>(b, t));
}

template <class F, class T>
void convert(const F &f, T &t){
    stringstream ss;
    ss << f;
    ss >> t;
}

#define GET_MACRO(_1, _2, _3, NAME, ...) NAME
#define _rep(i,n) _rep2((i),0,(n))
#define _rep2(i,a,b) for(int i=(a);i<(b);++i)
#define rep(...) GET_MACRO(__VA_ARGS__, _rep2, _rep)(__VA_ARGS__)
#define ALL(v) (v).begin(),(v).end()
#define PB push_back
#define fi first
#define se second
#define mkp make_pair
#define DEBUG
#ifdef DEBUG
#define dump(x)  cout << #x << " = " << (x) << endl;
#define debug(x) cout << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;
#else
#define dump(x) 
#define debug(x) 
#endif

#define MOD 1000000007LL
#define EPS 1e-8
#define INF 0x3f3f3f3f
#define INFL 0x3f3f3f3f3f3f3f3fLL
#define maxs(x,y) x=max(x,y)
#define mins(x,y) x=min(x,y)

void mainmain(){
	ll n;
	cin>>n;
	for(ll i=1; i<=n; i++){
		if(i*(i+1)/2>=n){
			while(n){
				if(i<=n){
					n-=i;
					cout<<i<<endl;
				}
				i--;
			}
			return;
		}
	}
}


signed main() {
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout<<fixed<<setprecision(20);
    mainmain();
}

Measured memory_bytes: 256
/*
▄███████▀▀▀▀▀▀███████▄
░▐████▀▒ЗАПУСКАЕМ▒▀██████▄
░███▀▒▒▒▒▒ДЯДЮ▒▒▒▒▒▒▀█████
░▐██▒▒▒▒▒▒БОГДАНА▒▒▒▒▒████▌
░▐█▌▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒████▌
░░█▒▄▀▀▀▀▀▄▒▒▄▀▀▀▀▀▄▒▐███▌
░░░▐░░░▄▄░░▌▐░░░▄▄░░▌▐███▌
░▄▀▌░░░▀▀░░▌▐░░░▀▀░░▌▒▀▒█▌
░▌▒▀▄░░░░▄▀▒▒▀▄░░░▄▀▒▒▄▀▒▌
░▀▄▐▒▀▀▀▀▒▒▒▒▒▒▀▀▀▒▒▒▒▒▒█
░░░▀▌▒▄██▄▄▄▄████▄▒▒▒▒█▀
░░░░▄██████████████▒▒▐▌
░░░▀███▀▀████▀█████▀▒▌
░░░░░▌▒▒▒▄▒▒▒▄▒▒▒▒▒▒▐
░░░░░▌▒▒▒▒▀▀▀▒▒▒▒▒▒▒▐
*/
#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
typedef long double ld;
typedef vector<int> vi;
typedef pair<int, int> pii;
typedef pair<long long, long long> pll;
#define zhfs main
#define mp(a, b) make_pair(a, b)
#define fi first
#define se second
#define re return
#define forn(i, n) for (int i = 1; i <= n; i++)
int zhfs()
{
#ifdef LOCAL
	freopen("input.txt", "r", stdin);
#endif
	ll x, y;
	cin >> x >> y;
	if (abs(x - y) <= 1)
	{
		printf("Brown\n");
	}
	else
	{
		printf("Alice\n");
	}
}



Measured memory_bytes: 256
#include <cstdio>

using namespace std;

int main() {
    int a, b, c;
    
    scanf("%d %d %d", &a, &b, &c);
    
    if (c - a - b > 0 && (long long)(c - a - b) * (c - a - b) - (long long)a * b * 4 > 0) {
        puts("Yes");
    } else {
        puts("No");
    }
    
    return 0;
}


Measured memory_bytes: 128
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define REP(i,n) FOR(i,0,n)
#define FOR(i,a,b) for(ll i=a;i<b;i++)
#define PB push_back
typedef vector<ll> vi;
typedef vector<vector<ll>> vvi;
const ll INF = (1ll << 60);
typedef pair<ll,ll> pii;

ll smallestWindow(vi v,ll x){
  ll N=v.size();
  vi sum(N+1); sum[0]=0;
  REP(i,N) sum[i+1]=sum[i]+v[i];
  ll ans=INF;
  REP(i,N){
    if(sum.back()-sum[i]<x) continue;
    ll window=distance(sum.begin()+i,lower_bound(sum.begin(),sum.end(),sum[i]+x));
    ans=min(ans,window);
  }
  return (ans==INF)?0:ans;
}

int main(){
  ll N,S; cin>>N>>S;
  vi a(N); REP(i,N) cin>>a[i];
  cout<<smallestWindow(a,S)<<endl;
}

Measured memory_bytes: 5248
#include<iostream>
using namespace std;
int main()
{
    // 整数の入力
    int a;
    cin >> a;
    // スペース区切りの整数の入力
    int b,c;
    cin >> b >> c;
if(a*b<c){
cout<<a*b;
}else{
  cout<<c;
}
  
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <numeric>
#include <map>
#include <iomanip>
#include <limits.h>

using namespace std;    
typedef long long ll;
typedef pair<ll, ll> pll;
#define all(x) (x).begin(),(x).end()
#define rall(x) (x).rbegin(),(x).rend()
const bool DEBUG = true;

int main(){

    ll n, m;
    cin >> n >> m;

    vector<ll> v(m);
    for(int i = 0; i < m; i++) cin >> v[i];

    ll sum = accumulate(all(v), 0ll);
    if(sum > n ) cout << -1 << endl;
    else cout << n - sum << endl;


    return 0;
}

Measured memory_bytes: 3684
#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <cmath>
#include <map>
#include <queue>
#include <iomanip>
#include <set>
#include <tuple>
#define mkp make_pair
#define mkt make_tuple
#define rep(i,n) for(int i = 0; i < (n); ++i)
using namespace std;
typedef long long ll;
const ll MOD=1e9+7;
template<class T> void chmin(T &a,const T &b){if(a>b) a=b;}
template<class T> void chmax(T &a,const T &b){if(a<b) a=b;}

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

  vector<int> A(4);
  rep(i,4) cin>>A[i];
  sort(A.begin(),A.end());

  cout<<abs(A[0]+A[3]-(A[1]+A[2]))<<endl;

  return 0;
}



Measured memory_bytes: 3220
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;

namespace MyProject
{
    class Program
    {
        static void Main(string[] args)
        {
#if Local
            var sw = new Stopwatch();
            sw.Start();
            Console.SetIn(new StreamReader("input.in"));
#endif

            var solver = new Solver();
            solver.Solve();
#if Local
            Console.WriteLine($"{sw.ElapsedMilliseconds}ms");
#endif
        }
    }

    class Solver
    {
        public void Solve()
        {
            var N = int.Parse(Console.ReadLine());
            var answer = this.Judge(N);
            Console.WriteLine(answer);
        }

        private string Judge(int N)
        {
            foreach (var i in Enumerable.Range(1, 9))
            {
                foreach (var j in Enumerable.Range(1, 9))
                {
                    if (i * j == N)
                    {
                        return "Yes";
                    }
                }
            }

            return "No";
        }
    }
}


Measured memory_bytes: 13268
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int N, temp, count = 0;
  vector<int> a;
  cin >> N;
  
  for (int i = 0; i < N; i++) {
    cin >> temp;
    a.push_back(temp);
  }
  
  int i = 0;
  while (1) {
    for (i = 0; i < N; i++) {
      if (a.at(i) % 2 == 1)
        break;
      
      a.at(i) /= 2;
    }
    if (i != N)
      break;
    
    count++;
  }
  
  cout << count << endl;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define ll long long int 
 
const ll mod = 1E9 + 7;

int main(){
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	long double d, t, s; cin>>d>>t>>s;
	double ans = d/s;
	if(ans<=t) cout<<"Yes";
	else cout<<"No";
	
}


Measured memory_bytes: 3716
using System;

class ABC_140_C
{
    static void Main(string[] args)
    {
        int N = int.Parse(Console.ReadLine());
        string[] input = Console.ReadLine().Split(' ');
        int[] B = new int[N-1];
        for (int i = 0; i < N-1; i++)
        {
            B[i] = int.Parse(input[i]);
        }

        int[] A = new int[N];
        A[0] = B[0];
        A[N-1] = B[N-2];
        for (int i = 1; i < N-1; i++)
        {
            int B1 = B[i-1];
            int B2 = B[i];

            A[i] = Math.Min(B1, B2);
        }

        int ans = 0;
        for (int i = 0; i < N; i++)
        {
            ans += A[i];
        }

        Console.WriteLine(ans);
    }
}


Measured memory_bytes: 11092
#include<bits/stdc++.h>
using namespace std;
 
template <class T1, class T2>
ostream& operator << (ostream& out, const pair <T1, T2> p)
{
	out << '(' << p.first << ',' << p.second << ')';
	return out;
}
 
template <class T1, class T2>
istream& operator >> (istream& in, pair<T1, T2> &p)
{
	in >> p.first >> p.second;
	return in;
}
 
template <class T>
istream& operator >> (istream& in, vector<T> &v)
{
	for (T &x : v)
		in >> x;
	return in;
}
 
template <class T>
ostream& operator << (ostream& out, const vector<vector<T> > &v)
{
	for (const vector<T> &x : v)
		out << x << '\n';
	return out;
}
 
template <class T>
ostream& operator << (ostream& out, const vector<T> &v)
{
	for (const T &x : v)
		out << x << ' ';
	return out;
}
 
 
#define ll long long
#define lf long double
#define pb push_back
#define mp make_pair
#define F first
#define S second
typedef pair <ll,ll > ii;
typedef vector <ll> vi;
typedef vector <ii> vii;
typedef vector <bool> vb;
typedef vector <vector <ll> > vv;
typedef vector <vector <vector<ll> > > vvv;
typedef vector <string> vs;
typedef vector <lf> vf;
#define sz(x) (ll)(x).size()
#define tr1(x) cerr << #x << ": " << x << nl
#define tr2(x, y) cerr << #x << ": " << x << " | " << #y << ": " << y << nl
#define tr3(x,y,z) cerr<<#x<<": "<<x<<" | "<<#y<<": "<<y<<" | "<<#z<<": "<<z<<nl
#define tr4(x,y,z,w) cerr<<#x<<": "<<x<<" | "<<#y<<": "<<y<<" | "<<#z<<": "<<z<<" | "<<#w<<": "<<w<<nl
#define trv(a) cerr<<#a<<": ";for(ll zz=0;zz<sz(a);zz++) cerr<<a[zz]<<" ";cerr<<nl
#define trset(s) cerr<<#s<<": ";for(auto &i:s) cerr<<i<<" ";cerr<<nl
#define epsilon 0.000000001L
#define inf 9999999999999999ll// ~ 10^16
#define nl endl
#define all(x) x.begin(), x.end()
#define r_all(x) x.rbegin(), x.rend()
#define fast()  ios_base::sync_with_stdio(false);cin.tie(NULL)
#define mod 1000000007ll
#define modulo 998244353ll
ll power(ll a,ll b){return b?power(a*a%mod,b/2)*(b%2?a:1)%mod:1;}

int main() 
{
    fast();
    ll n,m,k;
    cin>>n>>m>>k;
    vi a(n),b(m);
    cin>>a>>b;

    for(ll i=1;i<m;i++)
        b[i]+=b[i-1];

    ll ans=0;

    ll sum0=0;
    for(ll i=-1;i<n;i++)
    {
        if(i>=0)
            sum0+=a[i];
        ll sum1=k-sum0;
        if(sum1<0)
            break;
        ll ind=upper_bound(all(b),sum1)-b.begin();
        ans=max(ans,i+1+ind);
    }
    cout<<ans<<nl;
}


Measured memory_bytes: 6372
import java.util.Scanner;

public class Main
{
    public static void main(String[] args)
    {
        Scanner sc = new Scanner(System.in);
        int data[][][] = new int[4][3][10];
        int n,b,f,r,v;

        n = sc.nextInt();
        for(int i=0; i<n; i++)
        {
            b=sc.nextInt(); f=sc.nextInt(); r=sc.nextInt(); v=sc.nextInt();
            data[b-1][f-1][r-1]+=v;
        }

        for(int i=0; i<4; i++)
        {
            for(int k=0; k<3; k++)
            {
                for(int m=0; m<10; m++)
                {
                    System.out.printf(" %d",data[i][k][m]);
                }
                //System.out.printf("%d\n",data[i][k][9]);
                System.out.printf("\n");
            }
            if(i<3) System.out.println("####################");
        }

        sc.close();
    }
}


Measured memory_bytes: 29956
#include<bits/stdc++.h>
#define rep(i,N) for(ll (i)=0;(i)<(N);(i)++)
#define chmax(x,y) x=max(x,y)
#define chmin(x,y) x=min(x,y)
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
const int mod = 1000000007;
const int INF = 1001001001;

int main() {
  int n;
  cin >> n;
  vector<int> xd(n), yd(n);
  rep(i, n) {
    int x, y;
    cin >> x >> y;
    xd[i] = x + y;
    yd[i] = x - y;
  }

  sort(xd.begin(), xd.end());
  sort(yd.begin(), yd.end());
  int ans = max(xd.back() - xd[0], yd.back() - yd[0]);
  cout << ans << endl;
  
}

Measured memory_bytes: 4776
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<(n);i++)
using ll=long long;
const ll MOD=1000000007;



int main() {
    int X,Y,A,B,C;
    cin>>X>>Y>>A>>B>>C;
    vector<int> p(A),q(B),r(C);
    rep(i,A){
        cin>>p.at(i);
    }
    rep(i,B){
        cin>>q.at(i);
    }
    rep(i,C){
        cin>>r.at(i);
    }
    sort(p.begin(),p.end());
    reverse(p.begin(),p.end());
    sort(q.begin(),q.end());
    reverse(q.begin(),q.end());
    sort(r.begin(),r.end());
    reverse(r.begin(),r.end());
    vector<int> red(X),green(Y);
    ll ans=0;
    rep(i,X){
        red.at(i)=p.at(i);
        ans+=red.at(i);
    }
    rep(i,Y){
        green.at(i)=q.at(i);
        ans+=green.at(i);
    }
    int rp=X-1,gp=Y-1;
    rep(i,C){//r.at(i)をどれかと交換
        if(rp==-1){
            if(gp==-1){break;}
            else{
                if(r.at(i)>green.at(gp)){
                    ans+=r.at(i)-green.at(gp);
                    gp--;
                }
            }
        }
        else if(gp==-1){
            if(r.at(i)>red.at(rp)){
                ans+=r.at(i)-red.at(rp);
                rp--;
            }
        }
        else{
            if(red.at(rp)>green.at(gp)){
                if(r.at(i)>green.at(gp)){
                    ans+=r.at(i)-green.at(gp);
                    gp--;
                }
            }
            else{
                if(r.at(i)>red.at(rp)){
                    ans+=r.at(i)-red.at(rp);
                    rp--;
                }
            }
        }
    }
    cout<<ans<<endl;
}

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

using namespace std;

using I = long long;
static constexpr size_t L = 2;
static constexpr I bs[L] = {1007, 2009};
static constexpr I ms[L] = {1000000007, 1000000009};
struct RollingHash {
    using T = pair<I, I>;

    vector<I> hs[L], pws[L];

    RollingHash(const string &s) {
        size_t n = s.size();
        for(size_t i=0; i<L; i++) {
            hs[i].assign(n+1, 0);
            pws[i].assign(n+1, 0);
            pws[i][0] = 1;
            for(size_t j=0; j<n; j++) {
                pws[i][j+1] = (pws[i][j]*bs[i]) % ms[i];
                hs[i][j+1] = (hs[i][j]*bs[i] + s[j]) % ms[i];
            }
        }
    }

    // [l, r)
    inline T hash(size_t l, size_t r) const {
        return {
            (((hs[0][r] - hs[0][l] * pws[0][r-l]) % ms[0]) + ms[0]) % ms[0],
            (((hs[1][r] - hs[1][l] * pws[1][r-l]) % ms[1]) + ms[1]) % ms[1],
        };
    }
};

int main(void) {
    long n;
    cin >> n;
    string s;
    cin >> s;

    RollingHash rh(s);

    long ok = 0, ng = n;
    while(ng - ok > 1) {
        long m = (ok+ng)/2;

        set<RollingHash::T> ss;
        queue<RollingHash::T> q;
        for(int i=0; i<m; i++)
            q.push(rh.hash(i, i+m));
        for(int i=m; i+m<=n; i++) {
            ss.insert(q.front()); q.pop();
            auto h = rh.hash(i, i+m);
            if(ss.count(h))
                goto ok;
            q.push(h);
        }
        ng = m;
        continue;
ok:
        ok = m;
    }

    cout << ok << endl;
}


Measured memory_bytes: 768
# coding:utf-8

import sys
# from collections import Counter, defaultdict

INF = float('inf')
MOD = 10 ** 9 + 7

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def S(): return input()


N = LI()
for i in [1,7,9,4]:
    if i not in N:
        print('NO')
        exit()

print('YES')


Measured memory_bytes: 3316
#include <stdio.h>
#include <math.h>
#include <string.h>

typedef long l;
// typedef long long ll;

int main(void){
//typeofdefをしたときに同じ変数lとかを使うとバグるっぽい？ 
  l i, j;
  l length;
  l r, L;//RLの境目のRLのインデックス
  l n_r, n_l;
  int f;//flag 1でL発見 2でR発見
  char str[(int)pow(10, 5)];

  scanf("%s", str);
  length=strlen(str);

  // printf("%ld\n", length);

  l num[length];//子供の人数
  memset(num, 0, sizeof(num));

  for(i=0; i<length; ){
    //RになってLになってRになるのを検知
    n_r=0;
    n_l=0;
    f=0;
    for(j=i; ;j++){
      // printf("%ld\n", j)
      if(str[j]=='R'){
        // printf("str[%ld]=R\n", j);
        if(f==0){
          n_r++;
        }else if(f==1){
          //jは次のi
          i=j;
          break;
        }
      }else if(str[j]=='L'){
        // printf("str[%ld]=L\n", j);
        if(f==0){
          r=j-1;
          L=j;
        }
        f=1;
        n_l++;
        if(j==length-1){
          i=j;
          break;
        }
      }
    }
    //子供の数の処理
    if((n_r+n_l)%2==0){
      num[r]=(n_r+n_l)/2;
      num[L]=(n_r+n_l)/2;
    }else{
      if(n_r%2==0){
        //n_r偶数、n_l奇数
        num[r]=(n_r/2)+(n_l/2);
        num[L]=(n_r/2)+(n_l/2)+1;
      }else{
        num[r]=(n_r/2)+(n_l/2)+1;
        num[L]=(n_r/2)+(n_l/2);
      }
    }
    if(j==length-1){
      break;
    }
  }

  for(i=0; i<length; i++){
    if(i!=length-1) printf("%ld ", num[i]);
    else printf("%ld\n", num[i]);
  }

  return 0;
}


Measured memory_bytes: 1280
#include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<n;i++)
#define repA(a,i,n) for(int i=a;i<n;i++)
#define trav(a,x)for(auto &a: x)
#define fll(a) memset(a,-1,sizeof(a));
#define mp make_pair
#define pb push_back
#define all(x) x.begin(),x.end()
#define fst first
#define sec second
#define itr(it,x) for(auto it=x.begin();it!=x.end();it++)
typedef long long ll;
typedef long double ld;
typedef pair<int,int>pii;
typedef vector<int>vi;
typedef map<int,int>ma;
#define fastio ios_base::sync_with_stdio(false); cin.tie(NULL);
void fopen()
{
    freopen("input.txt","r",stdin);
    freopen("output.txt","w",stdout);   
}
int main()
{
    fastio;
  //  fopen();
    ll n,m,v,p;
    cin>>n>>m>>v>>p;
    ll a[n];
    rep(i,n) cin>>a[i];
    sort(a,a+n,greater<int>());
    int i=p,j=n+1;
    while(j-i>1)
    {
        int mid=(i+j)/2;
        ll w=a[mid-1]+m,s=(p-1)*m;
        repA(p-1,i,n)
        {
            s+=min(m,w-a[i]);
        }
        if(s>=m*v && w>=a[p-1]) i=mid;
        else j=mid;
    }
    cout<<i<<endl;


}

Measured memory_bytes: 1024
import java.util.Scanner;
public class Main {
    public static void main(String[] args) {
        StringBuilder count=new StringBuilder();
        Scanner sc=new Scanner(System.in);
        int n=sc.nextInt();
        for (int i=1;i<=n;i++){
            int x=i;
            if (x%3==0){
                count.append(" "+i);
                continue;}
            do{
                if(x%10==3){
                    count.append(" "+i);
                    break;}
                x/=10;
            }while(x!=0);
        }
        System.out.println(count);
    }
}

Measured memory_bytes: 23092
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)

from decimal import Decimal

a, b = map(float, readline().split())
a = Decimal(str(a))
b = Decimal(str(b))
print(int(a * b))


Measured memory_bytes: 10128
/*
             ██████  ██████
             ██   ██ ██   ██
 Author ->   ██████  ██   ██
             ██      ██   ██
             ██      ██████
 
    nik is love.
    nik is motivation.
    Use modulus operator very carefully.Watch for overflows.
*/
#include<bits/stdc++.h>
#define mp                    make_pair
#define pb                    push_back
#define ll                    long long
#define ss                       second
#define ff                        first
#define fr(i,a,b)   for(ll i=a;i<b;i++)
#define f(i,n)                fr(i,0,n)
#define rf(i,b,a) for(ll i=b-1;i>=a;i--)
#define r(i,n)                rf(i,n,0)
#define inf                   1000000007
#define eps                   0.000000001
#define sz(a)                int((a).size())
#define all(c)               (c).begin(),(c).end()
#define tr(c,i)              for(typeof(c).begin() i = (c).begin(); i != (c).end(); i++)
#define present(c,x)         ((c).find(x) != (c).end())
#define cpresent(c,x)        (find(all(c),x) != (c).end())
#define pi                   pair<int,int>
#define pll                  pair < ll , ll >
#define endl                 '\n'
#define PI                   3.141592653589793238462643383279502884197169399375105820974944592307816406286
using namespace std;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
typedef vector< int > vi;
typedef vector< vi > vvi;
int dx[8]={1,-1,0,0,-1,-1,1,1};
int dy[8]={0,0,-1,1,-1,1,-1,1};
vector<int> adj[200010],dis1(300010,-1),vis(300010,0),dis(300010,-1);
int myrandom (int i) { return std::rand()%i;}
ll solve(ll a)
{
    if(a==1)
        return 1;
    else
        return 1+2*solve(a/2);
}
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    //ifstream fin;
    //ofstream fout;
    //fin.open("input.txt");
    //fout.open("output.txt");
    ll h;
    cin>>h;
    cout<<solve(h)<<endl;
}


Measured memory_bytes: 8448
#include <bits/stdc++.h>
using namespace std;
 
int main(){
	int a,b,c,k;
	cin>>a>>b>>c>>k;
	int ops = 0;
	while(b<=a){
		b = b*2;
		ops++;
	}
	while(c<=b){
		c = c*2;
		ops++;
	}
	if(ops<=k){
		cout<<"Yes"<<endl;
	}
	else{
		cout<<"No"<<endl;
	}
}

Measured memory_bytes: 3620
#include <bits/stdc++.h>
#define INF 1000000000
#define LINF 1000000000000000000
#define MOD 1000000007
#define mod 1000007
#define INF63 1061109567
#define INF127 9187201950435737471
#define UINF 18446744073709551615
#define F first
#define S second
#define ll long long
using namespace std;
ll a,b,n;
int main(){
	cin>>a>>b>>n;
	cout<<(a*min(b-1,n))/b-a*(min(b-1,n)/b)<<endl;
	return 0;
}

Measured memory_bytes: 3640
#include <bits/stdc++.h>
#include <chrono>
#define watch(x) cout << (#x) << " is " << (x) << endl
#define eps 1e-9
#define f first
#define s second

typedef long long ll;

using namespace std;

int main()

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

    int n, a, b;

    cin >> n >> a >> b;

    if (n == 1) cout << "Hello World";
    else cout << a+b;

    return 0;
}


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

#define rep(l, r) for (int i = (l); i < (r); i++)

typedef long long ll;
 
using namespace std;

void solve() {
    int n;
    cin >> n;

    string s;
    set<string> s_set;
    rep(0, n) {
        cin >> s;
        s_set.insert(s);
    }

    cout << s_set.size() << endl;
}

int main() {
    solve();

    return 0;
}


Measured memory_bytes: 19148
#include <bits/stdc++.h>
#define REP(i,n) for(int i=0;i<(n);++i)
using namespace std;
typedef long long LL;

int main() {
  int N;
  cin >> N;
  vector<LL> A(N);
  REP(i, N) {
    cin >> A[i];
  }
  if(N % 2 == 0) {
    vector<LL> sum(N+2, 0LL);
    REP(i, N) {
      sum[i+2] = A[i] + sum[i];
    }
    LL ret = sum[N];
    for(int i=0; i<N; i+=2) {
      LL tret = sum[N+1] + sum[i] - sum[i+1];
      ret = max(ret, tret);
    }
    cout << ret << endl;
  } else {
    LL evensum = 0;
    for(int i =0; i<N; i+=2) {
      evensum += A[i];
    }
    int c_even = (N+1)/2;
    vector<LL> D(c_even);
    for(int i=0; i<c_even; ++i) {
      if(i == 0) {
        D[i] = A[0];
      } else {
        D[i] = D[i-1] + A[i*2] - A[i*2-1];
      }
    }
    vector<LL> minD(c_even), maxD(c_even);
    maxD[0] = 0;
    for(int i=1; i<c_even; ++i) {
      maxD[i] = max(D[i]-A[i*2], maxD[i-1]);
    }
    minD[c_even-1] = D[c_even-1];
    for(int i=c_even-2; i>=0; --i) {
      minD[i] = min(D[i], minD[i+1]);
    }
    LL tmin = numeric_limits<LL>::max();
    REP(i, c_even) {
      LL t = minD[i] - maxD[i];
      tmin = min(t, tmin);
    }
    cout << evensum - tmin << endl;
  }
}

Measured memory_bytes: 7220
#include <stdio.h>
#include <iostream>
#include <queue>
#include <cstdio>
#include <stack>
#include <algorithm>
#include <cmath>
#include <cstring>
#include <string.h>
#include <limits.h>
#include <map>
#include <string>
#include <bitset>
#include <vector>
using namespace std;

int main() {
    long long ans=0;
    long long n,k;
    cin>>n>>k;
    for(long long i=k;i<=n+1;i++)
        ans=(ans+(n-i+1)*i+1)%1000000007;
    printf("%lld\n",ans);
    return 0;
}


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

int main(){
  long long W,H,x,y;
  cin >> W >> H >> x >> y;//平行な方向に切る.
  printf("%.10lf\n",(double)W * H / 2);
  if(W - x == x && H - y == y)cout << 1 << endl;
  else cout << 0 << endl;


  return 0;
}


Measured memory_bytes: 256
var input = require('fs').readFileSync('/dev/stdin', 'utf8');
var arr = input.trim().split("\n");
var n=arr.shift()-0;
var a=arr.shift().split(" ").map(Number);
var q=arr.shift()-0;
var s="";
for(var i=0;i<q;i++){
   var [b,e,k]=arr[i].split(" ").map(Number);
   var cnt = 0;
   for(var j=b;j<e;j++){
      if(a[j]==k)cnt++;
   }
   s+=cnt+"\n";
}
console.log(s.trim());


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

int f(int x) {
  return x*x;
}

int main() {
  int d;
  while(cin >> d) {
    int S = 0;
    for(int x = d; x <= 600-d; x += d) {
      S += f(x) * d;
    }
    cout << S << endl;
  }
  return 0;
}

Measured memory_bytes: 1160
#include<iostream>
#include<string>
#include<vector>
#include<utility>
#include<queue>
#include<algorithm>
#include<cmath>
#include<cstdio>
#include<cstring>
#include<cstdlib>
#include<complex>
#define INF 2147483647
#define llINF 9223372036854775807
#define pb push_back
#define mp make_pair 
#define F first
#define S second
#define ll long long

using namespace std;
int main(){
  int n;cin>>n;
  int minus=0;int plus=0;
  int now;cin>>now;ll ans=0;
  for(int i=1;i<n;i++){
    int a;cin>>a;
    if(now<a&&plus==minus){plus=1;}
    else if(now>a&&plus==minus){minus=1;}
    if(plus==1&&now>a){plus=0;ans++;}
    else if(minus==1&&now<a){minus=0;ans++;}
    now=a;
  }
  cout<<ans+1<<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)
typedef long long ll;

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


    ll j,minValue=10e15;
    for(j=1;j*j<=pow(10,12);j++){
        if(n%j==0){
            ll i=n/j;
            minValue = min(minValue,i+j-2);
        }        

    }

    cout << minValue << endl;

    return 0;
}


Measured memory_bytes: 256
package main

import (
	"fmt"
	"sort"
)

func main() {
	var n int
	fmt.Scan(&n)
	if n%2 != 0 {
		fmt.Println(0)
		return
	}
	ds := make([]int, n)
	for i := 0; i < n; i++ {
		fmt.Scan(&ds[i])
	}
	sort.Sort(sort.IntSlice(ds))
	if ds[n/2] == ds[n/2-1] {
		fmt.Println(0)
		return
	} else {
		fmt.Println(ds[n/2] - ds[n/2-1])
	}

}


Measured memory_bytes: 5504
#include <bits/stdc++.h>
#define rep(i, s, n) for (int i = (s); i < (int)(n); i++)
#define all(x) (x).begin(),(x).end()
#define debug(x) cout<<#x<<": "<<x<<endl
using namespace std;
using ll = long long;
const ll MOD = 1e9+7;
const ll LINF = LLONG_MAX;
const int INF = INT_MAX;
const double PI=acos(-1);
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }

int main(){
	ll a,b,c,d; cin >> a >> b >> c >> d;
	ll ans = max(a * c, max(a * d, max(b * c, b * d)));
	cout << ans << endl;
}

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

string s;

int main () {
	cin >> s;
	for (char c = 'a'; c <= 'z'; c++){
		if (s.find(c) == -1){
			cout << c;
			return 0;
		}
	}
	cout << "None";
}

Measured memory_bytes: 3712
#include<iostream>
#include<stdio.h>
#include<algorithm>
#include<math.h>
#include<bits/stdc++.h>
#include<stack>
#include<queue>
#include<list>
#include<vector>
#include<bitset>
// #include<unordered_map> 
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
// #include "boost/algorithm/string.hpp"
#define fio ios_base::sync_with_stdio(false)
#define mod 1000000007
#define mod1 mod
#define mod2 100000009
#define li long long int
#define ll int
#define readi(x) scanf("%d",&x)
#define  reads(x)  scanf("%s", x)
#define readl(x) scanf("%I64d",&x)
#define rep(i,n) for(i=0;i<n;i++)
#define revp(i,n) for(i=(n-1);i>=0;i--)
#define myrep1(i,a,b) for(i=a;i<=b;i++)
#define myrep2(i,a,b) for(i=b;i>=a;i--)
#define pb push_back
#define mp make_pair
#define fi first
#define sec second
#define MAXN 1000000000000000000
#define MINN -1000000000000000000
#define pii pair<ll,ll> 
#define pdd pair<double,double>
#define pic pair<int,char>
#define N 200100
#define lgn 20
#define ddouble long double
#define minus minu
#define PI 3.1415926535
#define lgn 20


// #define INTMAX 200000000

// using namespace boost;
// #define si short int

using namespace std;
using namespace __gnu_pbds;             
// typedef priority_queue<ll, vector<ll> > max_pq;
// typedef priority_queue<pii, vector<pii> , greater<pii >  > min_pq;
ll toint(const string &s) {stringstream ss; ss << s; ll x; ss >> x; return x;}
string tostring ( ll number ){stringstream ss; ss<< number; return ss.str();}

// typedef priority_queue<pair < ll , pair < pii , ll > >  , vector<pair < ll , pair < pii , ll > >  > ,greater<pair < ll , pair < pii , ll > >  > > min_pq;

typedef tree< ll, null_type, less<ll>, rb_tree_tag, tree_order_statistics_node_update > OST;
typedef priority_queue< pii , vector<pii> > max_pq;
typedef priority_queue<pii, vector<pii> , greater <pii>  > min_pq;



int main()
{
    ios::sync_with_stdio(false);
    cin.tie(NULL);
    ll n;
    ll ans = 0;
    cin >> n;
    ll cnt = 0;
    while(n--)
    {
        ll l,r;
        cin >> l >> r;
        ans += (r-l+1);
    }
    cout << ans;












}                       

Measured memory_bytes: 256
#include <iostream>
#include<algorithm>
#include<string>
#include <cmath>
#include <vector>
#include <map>
#include <cstdio>
#include <iomanip>
#include<set>
#include <numeric>
#pragma region Macros
#define int long long
#define double long double
constexpr int MOD = 1000000007;
constexpr double PI = 3.14159265358979323846;
#define rep(i,n) for(int i=0;i<n;i++)
#define rrep(i,n) for(int i=n-1;i>=0;i--)
#define REP(i,n) for(int i=1;i<=n;i++)
#define LAST(x) x[x.size()-1]
#define ALL(x) (x).begin(),(x).end()
#define swap(a,b) (a += b,b = a - b,a -= b)
#define DIVCEIL(a,b) ((a+b-1)/b)
//int CHMAX

int intpow(int a, int n) {
	// a^nのint ver
	rep(i, n - 1)
		a *= a;
	return a;
}
int MODPOW(int a, int n, int mod) {
	// a^n mod
	int ans = 1;
	while (n > 0) {
		if (n & 1)
			ans = ans * a % mod;
		a = a * a % mod;
		n >>= 1;
	}
	return ans;
}
int FACT(int a) {
	if (a == 0)
		return 1;
	else
		return a * FACT(a - 1);
}
int MODFACT(int a, int mod) {
	if (a == 0)
		return 1;
	else
		return (a * FACT(a - 1)) % mod;
}
int nPr(int n, int r) {
	int s = n - r + 1;
	int sum = 1;
	for (int i = s; i <= n; i++)
		sum *= i;
	return sum;
}
int MODnPr(int n, int r, int mod) {
	int s = n - r + 1;
	int sum = 1;
	for (int i = s; i <= n; i++) {
		sum *= i;
		sum = sum % MOD;
	}
	return sum;
}
//int nCr(int n, int r)
int nCr2(int n, int r) {
	return FACT(n) / (FACT(r) * FACT(n - r));
}
int GCD(int a, int b)
{
	if (a < b)
		swap(a, b);
	if (b == 0)
		return a;
	if (a % b == 0)
		return b;
	return GCD(b, a % b);
}
int LCM(int a, int b)
{
	return  a * b / GCD(a, b);
}
int NUMOFDIV(int n) {
	//約数の数（だっけ？）
	int ans = 0;
	REP(i, n) {
		if (n % i == 0)
			ans++;
	}
	return ans;
}
int CEIL1(int n) {
	//1桁目切り上げ
	return (n + 9) / 10 * 10;
}
int DIGIT(int n, int k) {
	//nのk桁目
	rep(i, k - 1)
		n /= 10;
	return n % 10;
}
int DIGITSUM(int n) {
	int sum = 0, dig;
	while (n) {
		dig = n % 10;
		sum += dig;
		n /= 10;
	}
	return sum;
}
int DIVTIME(int n, int k) {
	//nをkで何回割れるか的な
	int div = 0;
	while (n % k == 0) {
		div++;
		n /= k;
	}
	return div;
}
int binary(int n) {
	//10進数→2進数
	int ans = 0;
	for (int i = 0; n > 0; i++) {
		ans += n % 2 * intpow(10, i);
		n /= 2;
	}
	return ans;
}
double LOG(int a, int b) {
	return log(b) / log(a);
}
inline bool BETWEEN(int x, int min, int max) {
	if (min <= x && x <= max)
		return true;
	else
		return false;
}
inline bool between(int x, int min, int max) {
	if (min < x && x < max)
		return true;
	else
		return false;
}
inline bool PRIMEOR(int x) {
	if (x == 1)
		return false;
	if (x == 2)
		return true;
	if (x % 2 == 0)
		return false;
	double sqrtx = sqrt(x);
	for (int i = 3; i <= sqrtx; i += 2) {
		if (x % i == 0)
			return false;
	}
	return true;
}
bool SQRTOR(int n) {
	if (sqrt(n) == (int)sqrt(n))
		return true;
	else
		return false;
}
// 順位付け
using namespace std;
#pragma endregion

signed main() {
	int N;
	cin >> N;
	vector <int> a(N);
	rep(i, N) {
		cin >> a[i];
	}
	int gcd = a[0];
	REP(i, N - 1) {
		gcd = GCD(gcd, a[i]);
	}
	cout << gcd;

}

Measured memory_bytes: 1024