akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
typedef long long ll;
const ll INF = 1e9;
const ll MOD = 1e9+7;
const ll LINF = 1e18;
using namespace std;

#define dump(x)  cout << #x << " = " << (x) << endl;
#define YES(n) cout << ((n) ? "YES" : "NO"  ) << endl
#define Yes(n) cout << ((n) ? "Yes" : "No"  ) << endl
#define POSSIBLE(n) cout << ((n) ? "POSSIBLE" : "IMPOSSIBLE"  ) << endl
#define Possible(n) cout << ((n) ? "Possible" : "Impossible"  ) << endl
#define possible(n) cout << ((n) ? "possible" : "impossible"  ) << endl

#define SANKOU(n,a,b) cout << ((n) ? (#a) : (#b) ) << endl

#define FOR(i,a,b) for(ll i=(a);i<(b);++i)
#define REP(i,n) for(ll i=0;i<(n);++i)
#define REPR(i,n) for(ll i=n;i>=0;i--)

#define FOREACH(x,a) for(auto&& (x) : (a) )

#define WFA(d,v) REP(k,v)REP(i,v)REP(j,v)d[i][j]=min(d[i][j],d[i][k]+d[k][j])

#define SCOUT(x) cout<<(x)<<" "
#define ENDL cout<<endl

#define VECCIN(x) for(auto&youso_: (x) )cin>>youso_
#define VECIN2(x,y) REP(i,x.size())cin>>x[i]>>y[i]
#define VECCOUT(x) if(1){for(auto tt=x.begin();tt!=x.end();tt++){if(tt!=x.begin())cout<<" ";cout<<(*tt);}cout<<endl;}

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

#define EXIST(n,x) (find(ALL(n),x)!=n.end())
#define UNIQUE(obj) sort(ALL( obj )); obj.erase(unique(ALL(obj)),obj.end())
#define EN(x) if(1){cout<<#x<<endl;return 0;}
#define COUT(x) cout<<(x)<<endl
void CINT(){}
template <class Head,class... Tail>
void CINT(Head&& head,Tail&&... tail){
    cin>>head;
    CINT(move(tail)...);
}
#define CIN(...) ll __VA_ARGS__;CINT(__VA_ARGS__)
#define LCIN(...) ll __VA_ARGS__;CINT(__VA_ARGS__)
#define SCIN(...) string __VA_ARGS__;CINT(__VA_ARGS__)

template <class T = ll>
T IN(){T x;cin>>x;return (x);}

template <class Head>
void VT(Head head){}
template <class Head,class Seco,class... Tail>
void VT(Head&& head,Seco&& seco,Tail&&... tail){
    seco.resize(head);
    VT(head,move(tail)...);
}
void VT2(){}
template <class Head,class... Tail>
void VT2(Head&& head,Tail&&... tail){
  VECCIN(head);
  VT2(move(tail)...);
}

template <class Head>
void VT3(Head&& head){}
template <class Head,class Seco,class... Tail>
void VT3(Head&& head,Seco&& seco,Tail&&... tail){
  seco[head]=IN();
  VT3(head,move(tail)...);
}

#define VC1(n,...) V __VA_ARGS__;VT(n,__VA_ARGS__);VT2(__VA_ARGS__); //aaabbbccc
#define VC2(n,...) V __VA_ARGS__;VT(n,__VA_ARGS__);REP(i,n)VT3(i,__VA_ARGS__); //abcabcabc

// #include <boost/multiprecision/cpp_ll.hpp>
// using namespace boost::multiprecision; // cpp_ll

#define P pair<ll,ll>
#define V vector<ll>
#define M map<ll,ll>
#define S set<ll>

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

ll gcd(ll m,ll n){
  if(0==n)return m;
  return gcd(n,m%n);
}

ll lcm(ll m,ll n){
  ll g=gcd(m,n);
  return (m/g*n);
}


int main(){
    LCIN(n,m);SCIN(s,t);
    if(s[0] != t[0])EN(-1);
    ll lc = lcm(n, m);
    ll gc = gcd(n, m);
    M mm;
    REP(i,n){
        ll pos = i * lc / n;
        mm[ll(pos)] = ll(s[i]);
    }
    REP(i,m){
        ll pos = i * lc / m;
        if(mm[ll(pos)] && mm[ll(pos)] != t[i])
            EN(-1);
    }

    COUT(lc);

}


Measured memory_bytes: 10880
N,M = map(int,input().split())

path = [[] for i in range(N)]

for _ in range(M):
	a,b = map(int,input().split())
	path[a-1].append(b-1)
	path[b-1].append(a-1)
vis = [0 for i in range(N)]
cnt = 0

def dfs(now,depth):
	global cnt
	if depth == N: cnt+=1
	for new in path[now]:
		if vis[new] == 0:
			vis[new] = 1
			dfs(new,depth+1)
			vis[new] = 0

vis[0] = 1
dfs(0,1)
print(cnt)


Measured memory_bytes: 9012
#include <bits/stdc++.h>
#include <ratio>
using namespace std;
#define len(_x) (sizeof((_x)) / sizeof(_x)[0])
#define ll long long
#define fastIO  ios_base::sync_with_stdio(false); cin.tie(0); 
#define iT(_t,_x) _t _x;std::cin >> _x;  
#define iInt(_x) int _x;in(_x); 
#define ill(_x) ll _x;in(_x); 
template<typename T> void in(T &x) { x = 0; bool neg = false; register T c = getchar(); if (c == '-')neg = true, c = getchar(); while ((c < 48) || (c > 57))c = getchar(); for (; c < 48 || c > 57; c = getchar()); for (; c > 47 && c < 58; c = getchar())x = (x << 3) + (x << 1) + (c & 15); if (neg) x *= -1; }

int a[100000] = {};
int main() {
	fastIO
	iInt(n);
	bool pos = false;
	int sum = 0;
	for (int i = 1; i < n + 1; ++i)
	{
		iInt(x);
		if (pos) {
			sum++; if(x==i-1)pos = true;
		else pos = false; continue;
		
		}
		if(x==i)
		{
			pos = true;
		}
		if (i == n&&pos)sum++;
	}
	std::cout <<sum;
		

}


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

const double PI = 4.0 * atan(1.0);

int main() {
    float a, b, h, m; cin >> a >> b >> h >> m;
    double ra = 0.5 * m + 30.0 * h;
    double rb = m * 6.0;
    double angle = abs(ra - rb);
    if (angle > 180.0) {
        angle = 360.0 - angle;
    }
    double coss = 2.0 * a * b * cos(angle * PI / 180.0);
    double res = sqrt(pow(a, 2.0) + pow(b, 2.0) - coss);
    cout << fixed;
    cout << setprecision(12) << res << endl;
    return 0;
}


Measured memory_bytes: 4288
#include <stdio.h>

#define BUILDING_NUM 4
#define FLOAR_NUM 3
#define ROOM_NUM 10

// １フロア１０部屋、３階建ての公舎４棟について、
// 入退去操作を行いその後の入居状況を表示する
int main()
{
	int aiResidents[BUILDING_NUM][FLOAR_NUM][ROOM_NUM] = { 0 };	// ○棟△階□号室の入居人数
	int iOperationNum;	// 入退去操作の回数
	int iBuilding;		// 棟
	int iFloar;			// 階
	int iRoomNumber;	// 部屋番号
	int iAddResidenet;	// 入居人数
	int iCount;
	int iCountBuilding, iCountFloar, iCountRoomNumber;

	// 入力：入退去操作の回数
	scanf("%d", &iOperationNum);

	// 入退去操作を指定回数行う
	for (iCount = 0; iCount < iOperationNum; iCount++)
	{
		// 入力：b棟f階のr番目の部屋にv人が追加で入居
		scanf(" %d %d %d %d", &iBuilding, &iFloar, &iRoomNumber, &iAddResidenet);

		// 指定された棟・部屋の人員をiAddResident人増加させる
		aiResidents[iBuilding-1][iFloar-1][iRoomNumber-1] += iAddResidenet;
	}

	// 出力：各棟の入居状況
	for (iCountBuilding = 0; iCountBuilding < BUILDING_NUM; iCountBuilding++)
	{
		for (iCountFloar = 0; iCountFloar < FLOAR_NUM; iCountFloar++)
		{
			for (iCountRoomNumber = 0; iCountRoomNumber < ROOM_NUM; iCountRoomNumber++)
			{
				printf(" %d", aiResidents[iCountBuilding][iCountFloar][iCountRoomNumber]);
			}
			printf("\n");
		}
		if (iCountBuilding != BUILDING_NUM - 1)
		{
			for (iCountRoomNumber = 0; iCountRoomNumber < ROOM_NUM; iCountRoomNumber++)
			{
				printf("##");
			}
			printf("\n");
		}
	}
}


Measured memory_bytes: 2044
#include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i = 0; i < (n) ; i++)
constexpr auto INF = 2147483647;
typedef long long ll;

int main(){
  int a, b, c, x, y, ans;
  int a_n, b_n, c_n;
  a_n = b_n = c_n = 0;
  cin >> a >> b >> c >> x >> y;
  if(a+b > c*2){
    c_n = min(x,y);
    x -= c_n;
    y -= c_n;
    c_n *= 2;
    if(a > 2*c && x>0){
      c_n += x*2;
      x = 0;
    }else if(b > c*2 && y>0){
      c_n += y*2;
      y = 0;
    }
  }
  a_n = x;
  b_n = y;
  
  ans = a_n*a + b_n*b + c_n*c;
  cout << ans << endl;

  return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <fstream>
#include <set>
#include <map>
#include <string>
#include <vector>
#include <bitset>
#include <algorithm>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <cassert>
#include <queue>

#define mp make_pair
#define pb push_back


typedef long long ll;
typedef long double ld;

using namespace std;

const int MX = 120000;

int n;
int a[MX];
int b[MX];
vector<int> go[MX];

set<pair<int, int> > ss;
set<pair<int, int> > sst;
set<pair<int, int> > ss2;
set<pair<int, int> > ss2t;

vector<pair<int, int> > ed;
vector<int> vv;
map<pair<int, int>, int> mm;

void ex() {
	//if (n != 3)
	//	assert(false);
	cout << -1 << "\n";
	exit(0);
}

int main() {
	cin >> n;
	for (int i = 0; i < n; ++i)
		cin >> a[i] >> b[i];
	if (a[0] != 0 || b[1] != 0)
		ex();
	for (int i = 0; i < n; ++i) {
		go[a[i]].push_back(i);
	}
	if ((int)go[0].size() != 1)
		ex();
	ss.insert(make_pair(b[0], 0));
	ss2.insert(make_pair(b[0], 0));
	for (int i = 0; i < n; ++i)
		mm[make_pair(a[i], b[i])] = 1;
	for (int i = 1; i < n; ++i) {
		sst.clear();
		ss2t.clear();
		for (int j: go[i]) {
			auto it = ss.lower_bound(make_pair(b[j] + 1, 0));
			ss2t.insert(make_pair(b[j], j));
			if (it != ss.end() && it->first == b[j] + 1) {
				ed.push_back(make_pair(j, it->second));
				ss.erase(it);
				sst.insert(make_pair(b[j], j));
			}
			else {
				auto it = ss2.lower_bound(make_pair(b[j] - 1, 0));
				if (it != ss2.end() && it->first <= b[j] + 1) {
					if (it->first != b[j] - 1)
						sst.insert(make_pair(b[j], j));
					ed.push_back(make_pair(j, it->second));
				}
				else {
					ex();
				}
			}
		}
		for (auto j: ss)
			vv.push_back(j.second);
		swap(ss, sst);
		swap(ss2, ss2t);
	}
	for (int j: vv) {
		if (j == 1)
			continue;
		int fl = 0;
		for (int d = -1; d <= 1; ++d) {
			if (mm.count(make_pair(a[j] + d, b[j] - 1))) {
				fl = 1;
				ed.push_back(make_pair(mm[make_pair(a[j] + d, b[j] - 1)], j));
				break;
			}
		}
		if (!fl) {
			ex();
		}
	}
	cout << ed.size() << "\n";
	/*for (auto j: ed) {
		cout << j.first + 1 << " " << j.second + 1 << "\n";
	}*/
	return 0;
}




Measured memory_bytes: 15604
n, k = map(int, input().split())
x = list(map(int, input().split()))
ans = float("inf")

for i in range(n-k+1):
	count = 0	
	left = x[i]
	right = x[i+k-1]
	
	if left < 0 and right >= 0:
		a = abs(left)*2 + right 
		b = right*2 + abs(left)
		count = min(a, b)
		ans = min(ans, count)
	else:
		count = max(abs(x[i]), abs(x[i+k-1]))
		ans = min(ans, count)
		
print(ans)

Measured memory_bytes: 14228
#include <iostream>
#include <cstring>
#include <cmath>
#include <algorithm>
using namespace std;
int main(void){
    // Your code here!
    int n,m,x, left = 0,right =0,i;
    cin >> n >> m >> x;
    int a;
    for(i =0;i < m;i++){
        cin >> a;
        if(a > x) right++;
        else left++;
    }
    cout << min(left,right);
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define pb push_back
#define Int int64_t
using namespace std;

int N,K;

int main()
{
    cin>>N>>K;
    vector<int64_t> A(N);
    for(auto &x:A) cin>>x;
    int64_t ans=0;
    sort(A.begin(),A.end());
    for(int i=0;i<K;++i) ans+=A[i];
    cout<<ans<<"\n";
}

Measured memory_bytes: 3568
#include<cstdio>
#include<algorithm>
using namespace std;

int main() {
	int a, b, c;
	while (~scanf("%d%d%d", &a, &b, &c)) {
		if (a > b) swap(a, b);
		else if (a > c) swap(a, c);
		if (b > c) swap(b, c);
		if (a > b) swap(a, b);
		printf("%d %d %d\n", a, b, c);
	}
	return 0;
}

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

int main() {
	string s;
	cin >> s;
	vector<bool> a(s.size());
	for(int i = 0; i < s.size(); i++){
		if(s.at(i) == 'A' || s.at(i) == 'C' || s.at(i) == 'G' || s.at(i) == 'T'){
			a.at(i) = true;
		}
		else{
			a.at(i) = false;
		}
	}
	int counter = 0;
	int maximum = 0;
	for(int i = 0; i < a.size(); i++){
		if(i != a.size() - 1){
			if(a.at(i)){
				counter++;
			}
			else{
				maximum = max(maximum, counter);
				counter = 0;
			}
		}
		else{
			if(a.at(i)){
				counter++;
				maximum = max(maximum, counter);
			}
			else{
				maximum = max(maximum, counter);
			}
		}
	}
	cout << maximum << endl;
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define ll long long
#define pii pair<int,int>
using namespace std;

int main() {
	ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
	#ifdef LOCAL
//		freopen("in1.txt", "r", stdin);
//		freopen("in1.txt", "w", stdout);
	#endif
	ll n, d;
	cin >> n >> d;
	d = d*d;
	int cnt = 0;
	for (int i=0; i<n; i++) {
		ll x, y;
		cin >> x >> y;
		x = x*x;
		y = y*y;
		if (x+y <= d) cnt++;
	}
	cout << cnt << '\n';
}

Measured memory_bytes: 3648
#include <bits/stdc++.h>
#define eps 1e-7
#define SIZE 1000100
#define rep(i, a, b) for (long long i = a; i <= b; ++i)
#define pi acos(-1.0)
#define mp make_pair
#define ll long long
using namespace std;
void io() { ios::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr); }
int n, m, k, t;

int main() {
    int h,w,a,b;
    cin>>h>>w>>a>>b;
    int p1=h-b;
    int p2=a;
    for(int i=1;i<=p1;i++){
        for(int j=1;j<=p2;j++)
            printf("1");
        for(int j=p2+1;j<=w;j++)
            printf("0");
        printf("\n");
    }
    for(int i=p1+1;i<=h;i++){
        for(int j=1;j<=p2;j++)
            printf("0");
        for(int j=p2+1;j<=w;j++)
            printf("1");
        printf("\n");
    }
}


Measured memory_bytes: 1280
#include <iostream>
#include <algorithm>
using namespace std;
int main() {
    int N;
    cin >> N;
    int a[N];
    for(int i=0;i<N;i++){
        cin >> a[i];
    }
    int score_a=0, score_b=0;
    sort(a,a+N);
    for(int i=0;i<N;i=i+2){
        score_b +=a[i];
    }
    for(int i=1;i<N;i=i+2){
        score_a +=a[i];
    }
    cout <<abs(score_a -score_b) <<"\n";
    return 0;
}

Measured memory_bytes: 256
#pragma GCC optimize("O3")
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;

template<typename T> inline void fastin(T &num) {
  T c;
  num = 0;
  c = getchar_unlocked();
  for (; (c > 47 && c < 58); c = getchar_unlocked()) num = (num << 3) + (num << 1) + c - 48;
}

template<typename T> void fastout(T &n) {
  T N = n, rev, count = 0;
  rev = N;
  if (N == 0) { 
    putchar_unlocked('0');
    putchar_unlocked('\n');
    return;
  }
  while ((rev % 10) == 0) { 
    ++count; rev /= 10;
  }
  rev = 0;
  while (N != 0) { 
    rev = (rev << 3) + (rev << 1) + N % 10;
    N /= 10;
  }
  while (rev != 0) { 
    putchar_unlocked(rev % 10 + '0');
    rev /= 10;
  }
  while (count--) putchar_unlocked('0');
  putchar_unlocked('\n');
}

int main(){
    int N; fastin(N);
    vector<int> v(N);
    for (int i = 0; i < N; ++i) {
        fastin(v[i]); v[i] -= (i + 1);
    }
    sort(v.begin(), v.end());
    
    int b = v[N / 2];

    int64_t answer = 0;
    for (int i = 0; i < N; ++i) {
        answer += abs(v[i] - b);
    }
    
    fastout(answer);

    return 0;
}


Measured memory_bytes: 1024
n,m = map(int,input().split())
heightlist = list(map(int,input().split()))
#heightlistの[i]がi-1の展望台の高さ
rinsetulist = []
for _ in range(n):
    rinsetulist.append([])

for _ in range(m):
    a,b = map(int,input().split())
    rinsetulist[a-1].append(heightlist[b-1])
    rinsetulist[b-1].append(heightlist[a-1])
#print(rinsetulist)

count = 0
for i in range(n):
    if rinsetulist[i] == []:
        count += 1
    elif heightlist[i] > max(rinsetulist[i]):
        count += 1

print(count)

Measured memory_bytes: 22988
#include<stdio.h>

int vote(int v,int n,int *g){
  int i=0;
  while(1){
    if(g[i]<=v){
      return i;
    }
    i++;
  }
}

int judge(int n,int *r){
  int tmp=r[0];
  int a=1;
  int i;
  for(i=1;i<n;i++){
    if(r[i]>tmp){
      a=i+1;
      tmp=r[i];
    }
  }
  return a;
}

void doit(int n,int m){
  int games[n];
  int rslt[n];
  int ans;
  int i;
  
  for(i=0;i<n;i++){
    scanf("%d",&games[i]);
    rslt[i]=0;
  }

  for(i=0;i<m;i++){
    int voter;
    int vg;
    scanf("%d",&voter);
    vg=vote(voter,n,games);
    rslt[vg]++;
  }
  ans=judge(n,rslt);

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

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

  doit(n,m);
  return 0;
}

Measured memory_bytes: 604
#include "bits/stdc++.h"
#include <cmath>

#define fi first
#define se second
#define all(x) x.begin(), x.end()
using namespace std;
using ull = unsigned long long;
using ll = long long;

struct __INIT {
    __INIT() {
        cin.tie(nullptr);
        ios::sync_with_stdio(false);
        cout << fixed << setprecision(15);
    }
} __init;

int main() {
    int N;
    cin >> N;
    vector<ll> A(N);
    vector<ll> B(N);
    for(int i = 0; i < N; i++) cin >> A[i] >> B[i];
    ll sum = 0;
    for(int i = N - 1; i >= 0; i--){
        A[i] += sum;
        if(A[i] % B[i] == 0) continue;
        else sum += (A[i] / B[i] + 1) * B[i] - A[i];
    }
    cout << sum << endl;
}

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

#define endl "\n"
#define INF (int) 9e18
#define HELL (int) (1e9 + 7)
#define int long long
#define double long double
#define uint unsigned long long
#define deb(x) cerr << #x << " => " << x << "\n"
#define deba(x) cerr << #x << "\n"; for (auto a : x) cerr << a << " "; cerr << "\n";
#define debm(x) cerr << #x << "\n"; for (auto a : x){for(auto b : a) cerr << b << " "; cerr << "\n";}
#define getMat(x, n, m, val) vector<vector<int>> x(n, vector<int> (m, val))
#define fastio ios_base :: sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr);
#define pout cout << fixed << setprecision(10)
int fastpow(int a, int b, int m) {
    int res = 1; a %= m; while (b > 0) { if (b & 1) res = (res * a) % m;
    a = (a * a) % m; b >>= 1; } return res;}
#define inv(a) fastpow(a, HELL - 2, HELL)

int32_t main() { fastio;
    int n, m;
    cin >> n >> m;
    int arr[n], sum = 0;
    for (int i = 0; i < n; i++) {
    	cin >> arr[i];
    	sum += arr[i];
    }
    int count = 0;
    for (int i = 0; i < n; i++) {
    	if (sum <= (4 * m * arr[i])) {
    		count++;
    	}
    }
    if (count >= m) {
    	cout << "Yes" << endl;
    } else {
    	cout << "No" << endl;
    }
    return 0;
}


Measured memory_bytes: 256
import heapq
n= int(input())
a=[int(i) for i in input().split()]
heap1=[]
heap2=[]
a_max=[]
b_max=[]
s=0
for i in range(n):
    heapq.heappush(heap1, a[i])
    s+=a[i]
a_max.append(s)
for i in range(n):
    heapq.heappush(heap1,a[n+i])
    mini=heapq.heappop(heap1)
    s=s+a[n+i]-mini
    a_max.append(s)
s=0
for i in range(n):
    heapq.heappush(heap2,-a[2*n+i])
    s=s-a[2*n+i]
b_max.append(s)    
for i in range(n):
    heapq.heappush(heap2,-a[2*n-1-i])
    mini=heapq.heappop(heap2)
    s=s-a[2*n-1-i]-mini
    b_max.append(s)
ans=a_max[0]+b_max[len(b_max)-1]
for i in range(n+1):
    res=a_max[i]+b_max[-(i+1)]
    ans=max(ans, res)
print(ans)

Measured memory_bytes: 38148
/*
 * atcoder/abc130/a.cpp
 */

// C++ 14
#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <cstring> // memset
#include <cassert>

using namespace std;

#define ll long long

#define loop(__x, __start, __end) for(int __x = __start; __x < __end; __x++)
template <class T> bool chmin(T &a, T b) { if (a > b) {a = b; return true; } return false; }
template <class T> bool chmax(T &a, T b) { if (a < b) {a = b; return true; } return false; }

ll a, b;

void input() {
  cin >> a >> b;
}

void solve() {
  if (a >= 13) cout << b << endl;
  else if (a <= 5) cout << 0 << endl;
  else cout << b/2 << endl;
}

int main() {
  // cout.precision(15);
  input();
  solve();
  return 0;
}


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

int main(void){
    int n, d1, d2, cnt;
    
    cnt = 0;
    
    cin >> n;
    
    for (int i = 0; i < n; i++){
        cin >> d1 >> d2;
        if (d1 == d2){
            cnt++;
        }
        else {
            cnt = 0;
        }
        
        if (cnt == 3) break;
    }
    
    if (cnt == 3) cout << "Yes" << endl;
    else cout << "No" << endl;
    
    return 0;
}


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

int main()
{
	double n;
	cin >> n;
	double sum = 0;

	vector<double> a(n);
	for (int i = 0; i < n; i++)
	{
		cin >> a.at(i);
		sum += 1 / a.at(i);
	}

	cout << 1 / sum << endl;
}


Measured memory_bytes: 256
#![allow(unused_imports)]
// use itertools::Itertools;
use proconio::{input, marker::*};

fn main() {
    input! {
        n: usize,
        a: usize,
        b: usize
    };
    let range = a..=b;
    println!(
        "{}",
        (1..=n)
            .filter(|&i| {
                let mut sum = 0;
                let mut j = i;
                while j > 0 {
                    sum += j % 10;
                    j /= 10;
                }
                range.contains(&sum)
            })
            .sum::<usize>()
    );
}


Measured memory_bytes: 2136
#include <bits/stdc++.h>
#define ll long long
#define double long double
#define rep(i,n) for(int i=0;i<(n);i++)
#define REP(i,n) for(int i=1;i<=(n);i++)
#define mod (ll)(1e9+7)
#define inf (ll)(3e18+7)
#define pi (double) acos(-1)
#define P pair<int,int>
#define PiP pair<int,pair<int,int>>
#define all(x) x.begin(),x.end()
#define rall(x) x.rbegin(),x.rend()
using namespace std;

int main() {
    int n;
    cin >> n;
    vector<int> a(n-1), cnt(n+1, 0);
    rep(i, n-1){
        cin >> a[i];
        a[i]--;
        cnt[a[i]]++;
    }
    rep(i, n){
        cout << cnt[i] << endl;
    }
}  

Measured memory_bytes: 4840
/*
 *  Created on: 29 / 4 / 2020
 *  Author:     Eslam Waheed
 */
#include <bits/stdc++.h>
//#include <bits/BIGINT.h>
using namespace std;

#define _CRT_SECURE_NO_WARNINGS
#define __USE_MINGW_ANSI_STDIO
#define Eslam__Waheed ios_base::sync_with_stdio(false);cout.tie(NULL);cin.tie(NULL);

#define ll   long long
#define ull  unsigned ll
#define dd   double
#define ld   long dd
#define ss   string

#define pb      push_back
#define all(c)  c.begin(), c.end()
#define rall(c) c.rbegin(), c.rend()
#define stp(n)  cout << fixed << setprecision(n)
#define iq(v)   v.resize(unique(v.begin(),v.end())-v.begin())
#define sz(s)   (ll)(s.size())
#define endl    '\n'

#define loop(i,m,n)  for(int i=m;i<n;i++)

ll gcd(ll a, ll b) { return !b ? abs(a) : gcd(b, a % b); }
ll lcm(ll a, ll b) { return abs(a / gcd(a, b)) * b; }

//const ll mod = 1e9 + 7;
//__int128
/*
 you can ^_^ (•‿•)

( إن الله وملائكته يصلون على النبي يا أيها الذين آمنوا صلوا عليه وسلموا تسليما )
*/
int main()
{
    //stp(20);
    Eslam__Waheed
        ll n; cin >> n;
    ll ans = 0;
    for (int i = 1; i <= n; i++)
    {
        for (int u = 1; u <= n; u++)
        {
            for (int j = 1; j <= n; j++)
            {
                ans += gcd(i, gcd(u, j));
            }
        }
    }
    cout << ans;
}

Measured memory_bytes: 3580
using System;
using System.Collections;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;

namespace AtCoder
{
	public class ABC
	{
		static readonly int mod = 1000000007;  // 10^9+7

		static void Main(string[] args)
		{
			Console.SetOut(new StreamWriter(Console.OpenStandardOutput()) { AutoFlush = false });


			//string s = Console.ReadLine();
			int n = int.Parse(Console.ReadLine());
			//long x = long.Parse(Console.ReadLine());
			//int[] vs = Console.ReadLine().Split().Select(int.Parse).ToArray();
			//long[] a = Console.ReadLine().Split().Select(long.Parse).ToArray();
			if (n % 2 == 0) {
				Console.WriteLine(n);
			} else {
				Console.WriteLine(n * 2);
			}


			Console.Out.Flush();
		}
	}
}


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

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

using namespace std;

typedef long long ll;
const ll INF = 1LL<<60;

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

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


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

    int c[3][3] = {0};
    for(int i = 0; i < 3; i++){
        for(int j = 0; j < 3; j++){
            cin >> c[i][j];
        }
    }

    int d1, d2, d3;
    int e1, e2, e3;
    d1 = c[0][1] - c[0][0];
    d2 = c[1][1] - c[1][0];
    d3 = c[2][1] - c[2][0];
    e1 = c[0][2] - c[0][1];
    e2 = c[1][2] - c[1][1];
    e3 = c[2][2] - c[2][1];

    if((d1==d2) && (d2==d3) && (e1==e2) && (e2==e3)){
        cout << "Yes" << endl;
    }else{
        cout << "No" << endl;
    }


    return 0;
}



Measured memory_bytes: 256
#include <bits/stdc++.h>
//#include <boost/multiprecision/cpp_int.hpp>
using namespace std;
//using namespace boost::multiprecision;
typedef long long int ll;
typedef long double ld;
#define PI 3.141592653589793
#define MOD 1000000007
#define ALL(obj) (obj).begin(),(obj).end()
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;}
const ll INF = 1LL << 60;

//四方向への移動ベクトル
const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};

struct edge{//グラフに使うヤツ
    ll from,to,cost;
};

typedef vector<vector<edge> > G;
ll gcd(ll a,ll b){
    if (a%b==0)return(b);
    else return(gcd(b,a%b));
}

int main() {
    ll d,t,s;
    cin >> d >> t >> s;
    if (d<=t*s){
        cout << "Yes" << endl;
    }else{
        cout << "No" << endl;
    }
    return 0;
}


Measured memory_bytes: 3616
using System;
using System.Collections.Generic;
using System.Collections;
using System.Collections.Specialized;
using System.Linq;
using System.Text;
using System.IO;
using System.Reflection;
using static System.Math;
using System.Numerics;
static class Program{
	const int mod=(int)1e9+7;
	static void Main(){
		Sc sc=new Sc();
		var n=sc.I;
		var s=sc.S;
		if(n%2==1){
			Console.WriteLine("No");
			return;
		}
		for(int i = 0;i<n/2;i++) {
			if(s[i]!=s[i+n/2]){
				Console.WriteLine("No");
				return;
			}
		}
		Console.WriteLine("Yes");
	}
}

public class Sc{
	public int I{get{return int.Parse(Console.ReadLine());}}
	public long L{get{return long.Parse(Console.ReadLine());}}
	public double D{get{return double.Parse(Console.ReadLine());}}
	public string S{get{return Console.ReadLine();}}
	public int[] Ia{get{return Array.ConvertAll(Console.ReadLine().Split(),int.Parse);}}
	public long[] La{get{return Array.ConvertAll(Console.ReadLine().Split(),long.Parse);}}
	public double[] Da{get{return Array.ConvertAll(Console.ReadLine().Split(),double.Parse);}}
	public string[] Sa{get{return Console.ReadLine().Split();}}
	public object[] Oa{get{return Console.ReadLine().Split();}}
	public int[] Ia2{get{return Array.ConvertAll(("0 "+Console.ReadLine()+" 0").Split(),int.Parse);}}
	public int[] Ia3(int a){return Array.ConvertAll((a.ToString()+" "+Console.ReadLine()).Split(),int.Parse);}
	public int[] Ia3(bool a,int b,bool c,int d){return Array.ConvertAll(((a?b.ToString()+" ":"")+Console.ReadLine()+(c?" "+d.ToString():"")).Split(),int.Parse);}
	public long[] La2{get{return Array.ConvertAll(("0 "+Console.ReadLine()+" 0").Split(),long.Parse);}}
	public long[] La3(int a){return Array.ConvertAll((a.ToString()+" "+Console.ReadLine()).Split(),long.Parse);}
	public long[] La3(bool a,int b,bool c,int d){return Array.ConvertAll(((a?b.ToString()+" ":"")+Console.ReadLine()+(c?" "+d.ToString():"")).Split(),long.Parse);}
	public T[] Arr<T>(int n,Func<T> f){var a=new T[n];for(int i=0;i<n;i++){a[i]=f();}return a;}
	public T[] Arr<T>(int n,Func<int,T> f){var a=new T[n];for(int i=0;i<n;i++){a[i]=f(i);}return a;}
	public T[] Arr<T>(int n,Func<string[],T> f){var a=new T[n];for(int i=0;i<n;i++){a[i]=f(Console.ReadLine().Split());}return a;}
	public T[] Arr<T>(int n,Func<int,string[],T> f){var a=new T[n];for(int i=0;i<n;i++){a[i]=f(i,Console.ReadLine().Split());}return a;}
}

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

#define rep(i, n) for(int i = 0; i < (n); i++)
#define repp(i, l, r) for(int i = (l); i < (r); i++)
#define per(i, n) for(int i = ((n)-1); i >= 0; i--)
#define perr(i, l, r) for(int i = ((r)-1); i >= (l); i--)
#define all(x) (x).begin(),(x).end()
#define MOD 1000000007
#define IINF 1000000000
#define LINF 1000000000000000000
#define SP <<" "<<
#define CYES cout<<"Yes"<<endl
#define CNO cout<<"No"<<endl
#define CFS cin.tie(0);ios::sync_with_stdio(false)

typedef long long LL;
typedef long double LD;

int main(){
  int n,m,k;
  cin >> n >> m >> k;
  vector<vector<int>> v(n,vector<int>(k));
  vector<int> d(m);
  vector<int> td(n,-1);
  rep(i,m){
    cin >> d[i];
    d[i]--;
    td[d[i]]=i;
  }
  rep(i,n){
    rep(j,k){
      cin >> v[i][j];
      v[i][j]--;
    }
  }
  vector<vector<int>> e(1<<m);
  vector<int> dp(1<<m,0);
  rep(j,k){
    dp[0]=0;
    e[0].push_back(0);
    repp(i,1,1<<m){
      rep(x,m){
        if(i&(1<<x)){
          if(td[v[d[x]][j]]!=-1) dp[i]=dp[i-(1<<x)]|(1<<td[v[d[x]][j]]);
          else dp[i]=dp[i-(1<<x)];
          break;
        }
      }
      e[i].push_back(dp[i]);
    }
  }
  vector<int> dist(1<<m,IINF);
  queue<int> q;
  q.push((1<<m)-1);
  dist[(1<<m)-1]=0;
  while(!q.empty()){
    int now = q.front();
    q.pop();
    rep(i,k){
      if(dist[e[now][i]]!=IINF) continue;
      dist[e[now][i]]=dist[now]+1;
      q.push(e[now][i]);
    }
  }
  cout << dist[0] << endl;
  return 0;
}



Measured memory_bytes: 39308
package main

import (
    "fmt"
)

const mod = 1000000007

func main() {
    scanInt()
    letter_count := make(map[byte]int)
    S := scanString()
    for i := 0; i < len(S); i++ {
        letter_count[S[i]]++
    }
    result := 1
    for _, count := range letter_count {
        result *= (count + 1)
        result %= mod
    }
    result += 1000000006
    result %= mod
    fmt.Println(result)
}

func scanInt() (num int) {
    fmt.Scan(&num)
    return
}

func scanInts(len int) (nums []int) {
    var num int
    for i := 0; i < len; i++ {
        fmt.Scan(&num)
        nums = append(nums, num)
    }
    return
}

func scanString() (str string) {
    fmt.Scan(&str)
    return
}

func scanStrings(len int) (strs []string) {
    var str string
    for i := 0; i < len; i++ {
        fmt.Scan(&str)
        strs = append(strs, str)
    }
    return
}

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

#define ll long long
#define int ll
#define pii pair<int, int>
#define pb push_back
#define INF 1e18
#define REP(i, n) for (int i=0; i<n; i++)
#define FOR(i, a, b) for (int i=a; i<b; i++)
#define REPD(i, n) for (int i=n-1; i>=0; i--)
#define FORD(i, a, b) for (int i=a; i>=b; i--)
#define vi vector<int>
#define all(v) v.begin(), v.end()
#define print(x) cout << x << endl
#define debug(x) cout << #x << " = "<< x << endl

const double PI=3.141592653589793238462643383279502884197169399375105820974944;

using namespace std;

void solve() {
    int N;
    cin >> N;
    unordered_map<string, int> T;
    bool ok = true;
    string pw;
    cin >> pw;
    T[pw] = 1;
    REP(i, N-1) {
        string w;
        cin >> w;
        if (T[w] != 0) {
            ok = false;
        } else {
            T[w] = 1;
            if (pw[pw.length()-1] != w[0]) {
                ok = false;
            }
        }
        pw = w;
    }
    if (ok) {
        print("Yes");
    } else {
        print("No");
    }
}

signed main() {
    solve();
}


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

long gcd(long a, long b);

int main() {
    long n, temp, ans;
    cin >> n;
    cin >> ans;
    rep(i, n - 1) {
        cin >> temp;
        ans = gcd(max(ans, temp), min(ans, temp));
    }
    cout << ans << endl;
}

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

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
const int MAXN = 200010;
int main() {
	int n;
	cin >> n;
	int a[MAXN];
	vector<vector<int> > num(MAXN);
	for(int i = 1; i <= n; i++){
		cin >> a[i];
		num[a[i]].push_back(i);
	}
	int cnt = 1;
	if(num[1].size() == 0){
		cout << -1 << endl;
	}
	else{
		int now = num[1][0];
		for(int i = 2; i <= n; i++){
			if(num[i].size() == 0)
				break;
			else{
				bool flag = 0;
				for(int j = 0; j < num[i].size();j++){
					if(num[i][j] > now){
						flag = 1;
						cnt ++;
						now = num[i][j];
						break;
					}
				}
				if(flag == 0)
					break;
		    }
		}
		cout << n - cnt << endl;
	}
	
    return 0;
}

Measured memory_bytes: 11904
#include <cstdio>
#include <cstring>
#include <algorithm>
using namespace std;
int N,c1[128],c2[128],Ans,Ret;
char s[105];
inline void check(int L,int R,int c[]){
	for (char ch='a';ch<='z';++ch) c[ch]=0;
	for (int i=L;i<=R;++i) ++c[s[i]];
}
inline int count(){
	Ret=0;
	for (char ch='a';ch<='z';++ch)
		if (c1[ch]&&c2[ch]) ++Ret;
	return Ret;
}
int main(){
	scanf("%d%s",&N,s+1);
	for (int i=1;i<N;++i)
		Ans=max(Ans,(check(1,i,c1),check(i+1,N,c2),count()));
	printf("%d",Ans);
	return 0;
}

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

int main()
{
  int64_t n;
  cin >> n;
  
  int64_t a[n];
  for(int i = 0; i < n; i++){
    cin >> a[i];
  }
  
  int64_t zero = 0;
  for(int i = 0; i < n; i++){
    if(a[i] == 0){
      zero++;
    }
  }//for
  if(zero > 0){
    cout << 0 << endl;
    return 0;
  }
  
  int64_t sum = 1;
  for(int i = 0; i < n; i++){
    if(a[i] <= 1000000000000000000/sum){
      sum *= a[i];
    }else{
      cout << -1 << endl;
      return 0;
    }
  }//for
  
  cout << sum << endl;
}

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

const int N = 3001;
int g[N][N];
int64_t dp[N][N][4];
int R, C, K;

int64_t go(int x, int y, int cnt) {
    if (x == R || y == C) return 0;
    if (dp[x][y][cnt] != -1) return dp[x][y][cnt];
    if (cnt < 3) {
        return dp[x][y][cnt] = max({go(x, y + 1, cnt + 1) + g[x][y], go(x + 1, y, 0) + g[x][y], go(x, y + 1, cnt), go(x + 1, y, 0)});
    } else {
        return dp[x][y][cnt] = max(go(x, y + 1, cnt), go(x + 1, y, 0));
    }
}

int32_t main()
{
    ios::sync_with_stdio(false), cin.tie(nullptr);
    cin >> R >> C >> K;
    for (int i = 0; i < K; i++) {
        int x, y, v; cin >> x >> y >> v;
        x--, y--;
        g[x][y] = v;
    }
    memset(dp, -1, sizeof dp);
    cout << go(0, 0, 0);

    return 0;
}

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

int main(){
    string S;
    cin >> S;
    ll s[S.size()];
    for (int i = 0; i < S.size(); i++)
    {
        s[i] = (ll) S[i] - '0';
        cerr<< s[i] << endl;
    }
    
    ll ans = 0;
    for (int bit = 0; bit < (1<<(S.size() - 1)); bit++)
    {
        ll sum = 0;
        int k = 0;
        for (int i = 0; i < S.size() - 1; i++)
        {
            if (bit & (1<< i))
            {
                for (int j = k; j <= i; j++)
                {
                    sum += s[j] * pow(10, i - j);
                }
                k = i + 1;
                
            }
            
        }
        for (int j = k ; j < S.size(); j++)
        {
            sum += s[j] * pow(10, S.size() - 1 - j);
        }
        ans += sum;
    }
    
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 512
#include <stdio.h>
#include <stdlib.h>

static int cnt = 0;
int *a, temp, n;

void trace(int a[], int n) {
	int i;

	for (i = 1; i <= n; i++) {
		if (i > 1) {
			printf(" ");
		}
		printf("%d", a[i]);
	}
	printf("\n%d\n", cnt);

}

void swap(int *x, int *y) {
	int tmp;

	tmp = *x;
	*x = *y;
	*y = tmp;
	cnt++;
}

void SelectionSort(void) {
	int i, j, mini;

	for (i = 1; i < n; i++) {
		mini = i;
		for (j = i; j <= n; j++) {
			if (a[j] < a[mini]) {
				mini = j;
			}
		}
		if (a[i] > a[mini]) {
			swap(&a[i], &a[mini]);
		}
	}

}

int main(void) {
	int i;

	scanf("%d", &n);
	a = (int *) malloc(sizeof(int) * (n + 1));

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

	SelectionSort();

	trace(a, n);

	return 0;
}

Measured memory_bytes: 604
import sys
mod = pow(10, 9) + 7
sys.setrecursionlimit(pow(10, 8))

def power(x, y):
    if   y == 0     : return 1
    elif y == 1     : return x % mod
    elif y % 2 == 0 : return power(x, y//2)**2 % mod
    else            : return power(x, (y-1)//2)**2 * x % mod
    
def mul(a, b):
    return ((a % mod) * (b % mod)) % mod

def div(a, b):
    return mul(a, power(b, mod-2))

import sys
input = sys.stdin.readline


N = int(input())

d2 = [1]
inverse = [0, 1]
for _ in range(N):
    d2.append(2*d2[-1]%mod)
for i in range( 2,  10):
    inverse.append( ( -inverse[mod % i] * (mod//i) ) % mod )

G = [[] for _ in range(N+1)]
for v in range(N-1):
    a, b = map(int, input().split())
    G[a].append(b)
    G[b].append(a)

v2i = [0 for _ in range(N+1)]
def itt(v, p):
    cn = 0
    ms = []
    for u in G[v]:
        if u == p:
            continue
        un = itt(u, v)
        ms.append(un)
        cn += un
    if p != None:
        ms.append(N-1-cn)
    v2i[v] = ms
    return cn+1
itt(1, None)
r = 0
for v in range(1, N+1):
    ff = v2i[v]
    for f in ff:
        r += d2[f] - 1 % mod
r = N*d2[N-1]-N-r
for _ in range(N):
    r = r*500000004 % mod
print(r)


Measured memory_bytes: 194704
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**9)
 
def dfs(now, prev):
    ans[now]+=(h[now]+ans[prev])
    # 今いる頂点から行ける頂点を順に next に入れてループ
    for next in g[now]:
      	if next == prev:
        	continue
      	else:
          dfs(next, now)
 
#木構造の取り込み 
n, q = map(int, input().split())
g = [[] for _ in range(n)]
for i in range(n-1):
    u, v = map(int, input().split())
    u -= 1
    v -= 1
    g[u].append(v)
    g[v].append(u)

#操作の取り込み
h=[0]*n
for i in range(q):
    u, v = map(int, input().split())
    u -= 1
    h[u]+=v

#初期のカウンター
ans=[0]*n

#DFSでカウンターを動かす
dfs(0,0)
 
print(' '.join(map(str, ans)))


Measured memory_bytes: 237728
#include <iostream>
#include <stdio.h>
#include <math.h>
using namespace std;

struct point{double x,y;};

void koch(int n,point a,point b){
    if(n==0)return;
    point s,t,u;
    double th=M_PI*60.0/180.0;
    
    s.x=(2.0*a.x+1.0*b.x)/3.0;
    s.y=(2.0*a.y+1.0*b.y)/3.0;
    t.x=(1.0*a.x+2.0*b.x)/3.0;
    t.y=(1.0*a.y+2.0*b.y)/3.0;
    u.x=(t.x-s.x)*cos(th)-(t.y-s.y)*sin(th)+s.x;
    u.y=(t.x-s.x)*sin(th)+(t.y-s.y)*cos(th)+s.y;
    
    koch(n-1, a, s);
    printf("%.8f %.8f\n",s.x,s.y);
    koch(n-1, s, u);
    printf("%.8f %.8f\n",u.x,u.y);
    koch(n-1, u, t);
    printf("%.8f %.8f\n",t.x,t.y);
    koch(n-1, t, b);
}

int main(){
    point a,b;
    int n;
    cin>>n;
    a.x=0;
    a.y=0;
    b.x=100;
    b.y=0;
    printf("%.8f %.8f\n",a.x,a.y);
    koch(n,a,b);
    printf("%.8f %.8f\n",b.x,b.y);
    return 0;
}

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

const long long MAX = 10000000;  // TLEならば小さくする
const long long MOD = 1000000007;
long long fac[MAX], finv[MAX], inv[MAX];

// テーブルを作る前処理
void COMinit() {
	fac[0] = fac[1] = 1;
	finv[0] = finv[1] = 1;
	inv[1] = 1;
	for (long long i = 2; i < MAX; i++) {
		fac[i] = fac[i - 1] * i % MOD;
		inv[i] = MOD - inv[MOD % i] * (MOD / i) % MOD;
		finv[i] = finv[i - 1] * inv[i] % MOD;
	}
}

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

// 重複組み合わせ計算
// n 種類のものから重複を許して r 個選ぶ場合の数
// r 個のものを n グループに(0個を許して)割り当てる場合の数
// n - 1 個の仕切りと r 個の玉を一列に並べる場合の数
long long H(long long n, long long r) {
	return COM(n + r - 1, r);
}

int main() {
	
	ll n, k; cin >> n >> k;
	ll red = n - k;
	COMinit(); // 前処理
	for (ll i = 1; i <= k; i++) {
		ll x = H(i, k - i);
		ll y = H(i + 1, red - (i - 1));
		ll ans = x * y;
		ans %= MOD;
		cout << ans << endl;
	}
	return 0;
}

Measured memory_bytes: 237940
#include <stdio.h>
int main(){
	
	int x,y,r,w,h;
	scanf("%d %d %d %d %d",&w,&h,&x,&y,&r);
	
	if(y <= h-r && y >= r && x <= w-r && x >= r)
	printf("Yes\n");
	else{
		printf("No\n");}
	return 0;
}

Measured memory_bytes: 584
#import sys 
#input = sys.stdin.readline

N,K = map(int,input().split())
h = list(map(int,input().split()))

dp = [0] * 100010

dp[0] = 0
dp[1] = abs(h[1]-h[0])
for i in range(2,min(K,N)):
    Minimum = dp[i-1]+abs(h[i]-h[i-1])
    for j in range(2,i+1):
        Minimum = min(dp[i-j]+abs(h[i]-h[i-j]),Minimum)
    dp[i] = Minimum
if N > K:
    if K == 1:
        for i in range(K,N):
            Minimum = dp[i-1]+abs(h[i]-h[i-1])
            dp[i] = Minimum
        
    else:
        for i in range(K,N):
            Minimum = dp[i-1]+abs(h[i]-h[i-1])
            for (j,k) in zip(dp[i-K:i-1],h[i-K:i-1]):
                Minimum = min(j+abs(h[i]-k),Minimum)
            dp[i] = Minimum
        
print(dp[N-1])

Measured memory_bytes: 54248
class Facts:
    def __init__(self, mod=10**9+7, n_max=1):
        self.mod     = mod
        self.n_max   = n_max
        self.fact    = [1, 1]
        self.inv     = [0, 1]
        self.factinv = [1, 1]
        if 1 < n_max:
            self.setup_table(n_max)
 
    def cmb(self, n, r):
        if r < 0 or n < r:
            return 0
        if self.n_max < n:
            self.setup_table(n)
        return self.fact[n] * (self.factinv[r] * self.factinv[n-r] % self.mod) % self.mod
 
    def setup_table(self, t):
        for i in range(self.n_max+1,t+1):
            self.fact.append( self.fact[-1] * i % self.mod )
            self.inv.append( -self.inv[self.mod % i] * (self.mod // i) % self.mod )
            self.factinv.append( self.factinv[-1] * self.inv[-1] % self.mod )
        self.n_max = t

# ABC167 E 2020/5/11
MOD = 998244353
 
n, m, k = map(int, input().split())
ans = 0
f = Facts(MOD)

for x in range(k + 1):
    t = (m * pow(m - 1, n - 1 - x, MOD)) % MOD
    ans += f.cmb(n - 1, x) * t % MOD
ans %= MOD

print(ans)

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

using namespace std;

typedef long long ll;
typedef pair<ll, ll> pii;
typedef vector<ll> vi;
typedef vector<vi> vvi;
typedef vector<pii> vpii;
const ll INF = (1ll << 60);

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

  vector<vector<pii>> G(K);
  for (ll i = 1; i < K; i++) {
    G[i].emplace_back(i * 10 % K, 0);
    G[i].emplace_back((i + 1) % K, 1);
  }

  vi dist(K, INF);
  dist[1] = 1;
  deque<ll> q;
  q.push_back(1);
  while (q.size()) {
    ll fr = q.front();
    q.pop_front();
    for (pii p : G[fr]) {
      if (dist[p.first] > dist[fr] + p.second) {
        dist[p.first] = dist[fr] + p.second;
        if (p.second == 0) {
          q.push_front(p.first);
        } else {
          q.push_back(p.first);
        }
      }
    }
  }
  cout << dist[0] << endl;
}

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

using namespace std;

int len(int x) {
  int r = 0;
  while (x) {
    ++r;
    x /= 10;
  }
  return r;
}

int f(int x) {
  while (x >= 10) {
    x /= 10;
  }
  return x;
}

int l(int x) {
  return x % 10;
}

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

  int n;
  cin >> n;
  int N = len(n);
  long long ans = 0;
  for (int a = 1; a <= n; ++a) {
    int ln = len(a);
    if (l(a) == 0) {
      continue;
    }
    long long tt = 1;
    if (f(a) == l(a)) {
      ++ans;
    }
    for (int t = 2; t < N; ++t) {
      ans += tt;
      tt *= 10;
    }
    int T = tt * l(a) * 10 + f(a);
    if (T > n) {
      continue;
    }
    if (f(T) < f(n)) {
      ans += tt;
    } else {
      int nn = n;
      while (l(nn) != l(T)) {
        --nn;
      }
      nn %= tt * 10;
      nn /= 10;
      ans += nn + 1;
    }
  }
  cout << ans;

  return 0;
}


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

typedef long long ll;
typedef long double ld;


int main()
{
	ios::sync_with_stdio(false);
	cin.tie(0);cout.tie(0);
	
	ll a,b,k;
	cin>>a>>b>>k;
	
	ll g=__gcd(a,b);
	ll c=0;
	ll d=0,e=0;
	for(ll i=1;i*i<=g;i++)
	{
		if(g%i==0)
		{
			c++;
			if(i*i!=g) c++;
		}
	}
	ll ara[c];
	for(ll i=1;i*i<=g;i++)
	{
		if(g%i==0)
		{
			ara[d]=g/i;
			d++;
			if(i*i!=g)
			{
			ara[c-1]=i;
			c--;
			}
		}
	}
	cout<<ara[k-1];
	
	
	
			
	return 0;
}



Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define ll long long int
int main(){
    ll a;
    cin>>a;
    ll arr[a];
    for (int i=0; i<a-1; i++) cin>>arr[i];
    ll ans[a];
    for (int i=0; i<a-2; i++) ans[i]=min(arr[i], arr[i+1]);
    ll sum=arr[0]+arr[a-2];
    for (int i=0; i<a-2; i++) sum+=ans[i];
    cout<<sum<<endl;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int D,G;
main(){
  cin>>D>>G;
  vector<int>p(D+1),c(D+1),perm;
  for(int i=1;i<=D;++i){
    cin>>p[i]>>c[i];
    perm.push_back(i);
  }
  int min_solved=0x3f3f3f3f;
  do{
    int rest=G;
    int n_solved=0;
    for(int j=0;j<perm.size();++j){
      int i=perm[j];
      if(rest<=100*i*p[i]){
        const int ceilDiv=(rest+100*i-1)/(100*i);
        n_solved+=ceilDiv;
        rest-=100*i*ceilDiv;
        break;
      }else{
        n_solved+=p[i];
        rest-=100*i*p[i]+c[i];
      }
      if(rest<=0)break;
    }
    min_solved=min(min_solved,n_solved);
  }while(next_permutation(perm.begin(),perm.end()));
  cout<<min_solved<<endl;
}


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


#define int  long long
#define rep(i,a,b)    for(int i=a;i<b;i++)
#define repn(i,a,b)   for(int i=a;i>=b;i--)
#define F first
#define S second
#define sz(x) ((int)x.size())
#define pii pair<int,int>
#define vi vector<int>
#define vii vector<pii>
#define pb push_back
#define pf push_front
#define eb emplace_back //FASTER THAN PUSH BACK!
#define mp  make_pair
#define all(v) (v).begin(), (v).end()
#define mod 1000000007
#define mi multiset<int>
#define mii multiset<pii>
#define what_is(x) cerr << #x << " is " << x <<"\n";
#define sortA(v) sort(v.begin(), v.end())
#define sortD(v) sort(v.begin(), v.end(), greater<int>())
// ordered_set adds two new functions to set - (set).find_by_order([kth element based on zero indexing]) and order_of_key()
// order_of_key returns number of elements less that parameter. If element exists, that order is its index
// #define ordered_set tree<ll, null_type, less<ll>, rb_tree_tag, tree_order_statistics_node_update>


// using namespace __gnu_pbds;
using namespace std;


int modp(int a,int n)
{
    if(n==0) return 1;
    if(n==1) return a;
    int res=modp(a,n/2);
    if(n%2==0) return (res*res);
    else return (a*res*res);
}



void solve()
{
    int t,n,m,i,k,l,u,v,j,s,pos,sum=0,flag=0,count=0;
    string S,T,U;
    int a,b,c;
    cin>>n;
    vector<vector<int>> dp(n+1,vi(3,0));
    rep(i,0,n)
    {
        cin>>a>>b>>c;
        dp[i+1][0]=max(dp[i][1],dp[i][2])+a;
        dp[i+1][1]=max(dp[i][0],dp[i][2])+b;
        dp[i+1][2]=max(dp[i][0],dp[i][1])+c;
    }
    cout<<max({dp[n][0],dp[n][1],dp[n][2]});
}



signed main()
{

    ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
    int t;
    // cin>>t;
    // while(t--)
    {
        solve();
        cout<<"\n";
    }
    return 0;
}


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

using namespace std;

int main(){
    int a,b,c;
    cin >> a >> b >> c;
    if(b!=c&&(a==b||a==c))cout << "Yes\n";
    else if(b==c&&a!=b&&a!=c) cout << "Yes\n";
    else cout << "No\n";
    return 0;
} 

Measured memory_bytes: 256
def examA():
    L = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
    K = I()

    ans = L[K-1]
    print(ans)
    return

def examB():
    H, W = LI()

    ans = H*W//2 + (H*W)%2
    print(ans)
    return

def examC():
    a,b,c = LI()
    if c-(a+b)<=0:
        print("No")
        return
    judge = (c-a-b)**2-4*a*b
    if judge>0:
        print("Yes")
    else:
        print("No")
    return

def examD():
    ans = 0
    print(ans)
    return

def examE():
    ans = 0
    print(ans)
    return

def examF():
    ans = 0
    print(ans)
    return

import sys,bisect,itertools,heapq,math,random
from copy import deepcopy
from heapq import heappop,heappush,heapify
from collections import Counter,defaultdict,deque
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))
def LSI(): return list(map(str,sys.stdin.readline().split()))
def LS(): return sys.stdin.readline().split()
def SI(): return sys.stdin.readline().strip()
global mod,mod2,inf,alphabet,_ep
mod = 10**9 + 7
mod2 = 998244353
inf = 10**18
_ep = 10**(-12)
alphabet = [chr(ord('a') + i) for i in range(26)]

sys.setrecursionlimit(10**6)

if __name__ == '__main__':
    examC()

"""

"""

Measured memory_bytes: 4848