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

#define rep(i, n) for (int i = 0; i < (int)n; i++)
#define reps(i, n) for (int i = 1; i <= (int)n; i++)
#define vi vector<int>

#define ll long long
#define vl vector<ll>
#define vll vector<vl>
#define pb push_back

const int INF = 1e9;

int main() {
	int a[200010];
	int b[200010];
	int n, k;
	cin >> n >> k;
	reps(i, n) cin >> a[i];
	a[0]=0;

	rep(times, k)
	{
		reps(i, n+1) b[i]=0;
		reps(i, n)
		{
			b[max(1, i-a[i])]++;
			b[min(n+1, a[i]+i+1)]--;
		}
		bool maji=true;
		bool ze=true;
		reps(i, n) 
		{
			a[i]=b[i]+a[i-1];
			if(a[i]!=n) maji=false;
			if(a[i]) ze=false;
		}
		if(maji)
		{
			rep(i, n-1) cout << n << ' ';
			cout << n << endl;
			return 0;
		}
		if(ze)
		{
			rep(i, n-1) cout << '0' << ' ';
			cout << '0' << endl;
			return 0;
		}
	}
	reps(i, n-1) cout << a[i] << ' ';
	cout << a[n] << endl;
	return 0;
}

Measured memory_bytes: 5144
from collections import deque
def main():
    N,M = map(int,input().split(" "))
    request = []
    for i in range(M):
        a,b = map(int,input().split(" "))
        request.append((b,a))
    request.sort()
    request = deque(request)
    ans = [request.popleft()]
    for i in range(M-1):
        x = request[i][1]
        if x >= ans[-1][0]:
            ans.append(request[i])
    print(len(ans))
if __name__ == "__main__":
    main()

Measured memory_bytes: 17632
#include <iostream>
#include <sstream>
#include <cstdio>
#include <cmath>
#include <cstring>
#include <cctype>
#include <string>
#include <vector>
#include <list>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <algorithm>
#include <functional>
#include <iomanip>
using namespace std;

string to_string(string s) {
  return '"' + s + '"';
}

string to_string(const char* s) {
  return to_string((string) s);
}

string to_string(bool b) {
  return (b ? "true" : "false");
}

template <typename A, typename B>
string to_string(pair<A, B> p) {
  return "(" + to_string(p.first) + ", " + to_string(p.second) + ")";
}

template <typename A>
string to_string(A v) {
  bool first = true;
  string res = "{";
  for (const auto &x : v) {
    if (!first) {
      res += ", ";
    }
    first = false;
    res += to_string(x);
  }
  res += "}";
  return res;
}

void debug_out() { cerr << endl; }

template <typename Head, typename... Tail>
void debug_out(Head H, Tail... T) {
  cerr << " " << to_string(H);
  debug_out(T...);
}

#ifndef ONLINE_JUDGE
#define show(...) cerr << "[" << #__VA_ARGS__ << "] :", debug_out(__VA_ARGS__)
#else
#define show(...) 42
#endif


#define f first
#define s second
#define endl "\n"
#define pb push_back
#define  oo 0x3f3f3f3f
#define limit 1000000007
#define two pair<int,int>
#define int long long int
#define mod(x,m) ((x%m+m)%m)
#define all(v) v.begin(),v.end()
#define max3(x,y,z) max(x,max(y,z))
#define min3(x,y,z) min(x,min(y,z))
#define fori(x,n) for(int i = x; i < n; i++)
#define forj(y,m) for(int j = y; j < m; j++)
#define fork(z,p) for(int k = z; k < p; k++)
#define fastio std::ios::sync_with_stdio(false)
#define watch(x) cout << (#x) << " is " << (x) << "\n"
#define input_from_file  freopen("input.txt", "r", stdin);

int dp[3005][6005];

signed main(){
  //input_from_file;
  memset(dp,0,sizeof dp);
  int n,t; cin>>n>>t;
  vector<two> p(n);
  for(int i=0;i<n;i++) cin>>p[i].f>>p[i].s;
  sort(all(p));
  vector<int> w(n+1);
  vector<int> val(n+1);
  fori(1,n+1) w[i] = p[i-1].f, val[i] = p[i-1].s;
  int ans = 0;
  for(int i=1;i<=n;i++)
  for(int j=1;j<=6000;j++){
    dp[i][j] = dp[i-1][j];
    if(j-w[i] >= 0 && j-w[i] < t) dp[i][j] = max(dp[i][j],dp[i-1][j-w[i]]+val[i]);
    ans = max(dp[i][j],ans);
  }
  cout<<ans<<endl;
}


Measured memory_bytes: 141312
N = int(input())
a = [[0 for _ in range(3)] for _ in range(N)]
for i in range(N):
    t = list(map(int, input().split()))
    for j in range(3):
        a[i][j] = t[j]

dp = [[0 for _ in range(3)] for _ in range(N+1)]

for i in range(N):
    for j in range(3):
        for k in range(3):
            if j == k:
                continue
            dp[i+1][k] = max(dp[i+1][k], dp[i][j] + a[i][k])
#print(dp)


answer = 0
for j in range(3):
    answer = max(answer, dp[N][j])

print(answer)

Measured memory_bytes: 71644
#! -*- coding:utf-8 -*-

while True:
	n = int(raw_input())
	if n == 0: break
	
	ans = 0
	while n > 1:
		if n % 2 == 0: n = n / 2;
		else: n = n * 3 + 1
		ans += 1
	print ans

Measured memory_bytes: 4196
#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  vector<int> P(N);
  for (int i = 0; i < N; i++) {
    cin >> P.at(i);
  }
  
  int count = 0;
  int m = P.at(0);
  for (int i = 0; i < N; i++) {
    m = min(m, P.at(i));
    if (m >= P.at(i)) {
      count++;
    }
  }
  cout << count << endl;
}

Measured memory_bytes: 1024
import java.util.Scanner;

/**
 * AtCoder Beginner Contest 131<br>
 * A - Security<br>
 * <br>
 * https://atcoder.jp/contests/abc131/tasks/abc131_a<br>
 */
public class Main {

    public static void main(String[] args) {
        try (Scanner sc = new Scanner(System.in)) {
            String[] input = sc.nextLine().split("");

            Result r = renzokuNum(input);
            switch (r) {
                case Good:
                    System.out.println("Good");
                    break;
           
                default:
                    System.out.println("Bad");
                    break;
            }
        }
    }

    private static Result renzokuNum(String[] input) {

        for (int i = 0; i < input.length - 1; i++) {
            if (input[i].equals(input[i + 1])) {
                return Result.Bad;
            }
        }
        return Result.Good;
    }

    enum Result {
        Good,
        Bad,
    }
}

Measured memory_bytes: 22100
#include<iostream>
#include<string>
#include<vector>
#include<numeric>
#include<math.h>
#include<algorithm>
#include<iomanip>
#include<list>
#include<bitset>
#include<sstream>
using namespace std;

int main() {

	int N, M;
	cin >> N >> M;

	vector<int> ball(N, 1);
	vector<bool> red(N, false);
	red[0] = true;

	int x, y;

	for (int i = 0; i < M; i++) {
		cin >> x >> y;
		x--;
		y--;
		if (red[x] == true) {
			if (ball[x] == 1) {
				red[x] = false;
			}
			red[y] = true;
		}
		ball[x] -= 1;
		ball[y] += 1;
	}

	int ans = 0;

	for (int i = 0; i < N; i++) {
		if (red[i] == true) {
			ans += 1;
		}
	}

	cout << ans << endl;

	return 0;
}

Measured memory_bytes: 3728
#include<iostream>
using namespace std;
int main(void)
{
	int i,n,a[100];
	
	cin >> n;

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

	for(i-=1 ; i>0 ; i--){
		cout << a[i] << " ";
	}

	cout << a[0] << endl;

	return 0;
}

Measured memory_bytes: 1160
a = gets.to_i
b = gets.to_i
c = gets.to_i
x = gets.to_i

ans = 0
0.upto(a) do |ai|
  0.upto(b) do |bi|
    0.upto(c) do |ci|
      ans += 1 if ai*500 + bi*100 + ci*50 == x
    end
  end
end

puts ans

Measured memory_bytes: 1788
import java.util.Scanner;
public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        String W[] = new String[N];
        boolean ans = true;
        for(int i = 0; i < N; i++){
            W[i] = sc.next();
        }
        for(int i = 1; i < N; i++){
            if(!(W[i-1].charAt(W[i-1].length()-1) == W[i].charAt(0))){
                ans = false;
                break;
            }
            for(int j = 0; j < i; j++){
                if(W[i].equals(W[j])){
                    ans= false;
                    break;
                }
            }
        }
        if(ans == true){
            System.out.println("Yes");
        }else{
            System.out.println("No");
        }
    }
}

Measured memory_bytes: 35872
n, k = map(int, input().split())
a = list(map(int, input().split()))
mod = 10 ** 9 + 7

f = [0] * (k + 1)
f[0] = 1
for i in range(n):
    for j in range(1, k+1):
        f[j] = (f[j] + f[j - 1]) % mod # 1/(1-x):累積和
    for j in range(k, a[i], -1): # 1-x^(a[i]+1) a[i]+1次したの項を引く
        f[j] = (f[j] - f[j - a[i] - 1]) % mod
print(f[-1])

Measured memory_bytes: 67544
#pragma GCC optimize("O2")
#include <bits/stdc++.h>
using namespace std;
// #define MOD  998244353
#define ll long long
const double PI = atan(1.0) * 4;
// const ll INF = (int)1e9 ;
const int di[4] = { -1, 0, 1, 0} ;
const int dj[4] = {0, -1, 0, 1} ;
const ll INF = (ll)2e18 + 50;
const int maximum  = numeric_limits<int>::min();
const int minimum  = numeric_limits<int>::max();

ll power(ll a , ll e) {
	ll res = 1LL ;
	while (e > 0) {
		if (e % 2 == 1) res = res * a;
		a =  a * a  ;
		e /= 2 ;
	}
	return res ;
}
bool isBalanced(const string &exp)
{
	// Initialising Variables
	bool flag = true;
	int count = 0;

	// Traversing the Expression
	for (int i = 0; i < exp.length(); i++) {

		if (exp[i] == '(') {
			count++;
		}
		else {
			count--;
		}
		if (count < 0) {
			flag = false;
			break;
		}
	}
	if (count != 0) {
		flag = false;
	}

	return flag;
}
bool sortbysec(const pair<pair<int, int>, int> &a,
               const pair<pair<int, int>, int> &b)
{
	return (a.second < b.second);
}

void uniformly_distribute_k_numbers_in_a_square_grid(int n , int k ) {
	int p = 0 , q = 0 ;
	vector<vector<int>> a(n, vector<int>(n)) ;
	for (int i = 1 ; i <= k ; ++i ) {
		a[p][q] = 1 ;
		p = p + 1 ;
		q = (q + 1) % n ;
		if (p == n) {
			p = 0  ;
			q = (q + 1) % n ;

		}
	}
}




int main() {
	ios::sync_with_stdio(0);
	cin.tie(0);
#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif
	// int t ;
	// cin >> t ;
	// while (t--) {
	int n ;
	int c0 = 0 , c1 = 0 , c2 = 0 , c3 = 0 ;
	cin >> n ;
	vector<string> s(n) ;
	for (int i = 0 ; i < n ; i++) {
		cin >> s[i] ;
		if (s[i] == "AC") c0++ ;
		else if (s[i] == "WA") c1++ ;
		else if (s[i] == "TLE") c2++ ;
		else c3++ ;
	}
	cout << "AC x"  << " " << c0 << "\n";
	cout << "WA x"  << " " << c1 << "\n";
	cout << "TLE x"  << " " << c2 << "\n";
	cout << "RE x"  << " " << c3 << "\n";


	// }







	return 0 ;
}


Measured memory_bytes: 6368
#include<set>
#include<map>
#include<stack>
#include<cmath>
#include<cstdio>
#include<queue>
#include<vector>
#include<climits>
#include<cstring>
#include<iostream>
#include<algorithm>
#define LL long long
using namespace std;
int read(){
	int f=1,x=0;
	char c=getchar();
	while(c<'0'||'9'<c){if(c=='-')f=-1;c=getchar();}
	while('0'<=c&&c<='9'){x=x*10+c-'0';c=getchar();}
	return f*x;
}
#define MAXN 100
#define INF 0x3f3f3f3f
int main(){
	int a=read(),b=read();
	printf("%d\n",a-b+1);
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define rep(i,n)  FOR(i,0,n)
#define req(i,n) for(int i = 1;i <=n;i++)
#define pai 3.14159265358979323846
const int INF = 1001001001;
typedef long long ll;
int A[3][3], N;
bool punched[3][3];
bool ok[3][3];
using Graph = vector<vector<int>>;
vector<vector<int>> field;
vector<bool> seen;

const int MOD = 1000000007;
typedef pair<int,int> P;

//最大公約数
int gcd(int a,int b){
	if (a%b == 0){
		return b;
	}
	else{
		return gcd(b,a%b);
	}

}

//最小公倍数
int lcm(int a,int b){
	return a /gcd(a,b) * b;
}

//素数判定
bool is_prime(long long N) {
    if (N == 1) return false;
    for (long long i = 2; i * i <= N; ++i) {
        if (N % i == 0) return false;
    }
    return true;
}

// 素因数分解
vector<pair<long long, long long> > prime_factorize(long long n) {
    vector<pair<long long, long long> > res;
    for (long long p = 2; p * p <= n; ++p) {
        if (n % p != 0) continue;
        int num = 0;
        while (n % p == 0) { ++num; n /= p; }
        res.push_back(make_pair(p, num));
    }
    if (n != 1) res.push_back(make_pair(n, 1));
    return res;
}



  


int main() {
 int n;
 cin >> n;
 map <ll,int> cnt;
 ll x;
 for (int i= 1;i <= 100;i++){
   for (int j = 1;j <= 100;j++){
    for (int k= 1;k <= 100;k++){
        x = i*i + j * j + k * k + i*j + j*k+k*i;
       cnt[x]++;
     }
   }
 }
 for (int i = 1;i <= n;i++){
   cout << cnt[i] << endl;
 }
}




Measured memory_bytes: 6008
#define _USE_MATH_DEFINES
#include <iostream>
#include <string>
#include <utility>
#include <stack>
#include <vector>
#include <queue>
#include <algorithm>
#include <map>
#include <climits>
#include <set>
#include <cmath>
#include <numeric>
#include <iomanip>

using namespace std;
long long A[100000];
long long cum_sum_A[100000];
int main(){
  int N;
  long long M;
  int V;
  int P;
  cin >> N >> M >> V >> P;
  for(int i = 0; i < N; i++){
    cin >> A[i];
  }
  sort(A, A + N);

  cum_sum_A[0] = A[0];
  for(int i = 1; i < N; i++){
    cum_sum_A[i] = A[i] + cum_sum_A[i - 1];
  }
  long long rank_p = A[N - P];
  int start_ind;
  int ans = P;
  
  for(int i = N - P; i >= 0; i--){
    if(A[i] != rank_p){
      ans += (N - P - i - 1);
      start_ind = i;
      break;
    }
  }

  int rank_p_num = 0;
  int last_rank_p = 0;
  for(int i = 0; i < N; i++){
    if(A[i] == rank_p){
      rank_p_num ++;
    }
  }
  for(int i = N - 1; i >= 0; i --){
    if(A[i] == rank_p){
      last_rank_p = i;
      break;
    }
  }
  int sequence_begin = -1;
  for(int i = start_ind; i >= 0; i--){
    //cout << i << " " << ans << endl;
    if(i == 0 || A[i - 1] != A[i]){
      if(sequence_begin < 0){
        sequence_begin = i;
      }
      long long diff = rank_p - A[i];
      if(diff > M){
        break;
      }
      long long spill = (V - (i + 1) - (P - 1)) * M;
      //cout << i << " spill: " << spill << endl;
      long long spill_range_sum = cum_sum_A[last_rank_p] - cum_sum_A[i];
      long long spill_range = last_rank_p - i;
      long long tmp = spill + spill_range_sum;
      
      if(spill <= 0){
        ans += (sequence_begin - i + 1);
        sequence_begin = -1;
        continue;
      }

      if(tmp % spill_range == 0){
        if(tmp / spill_range <= A[i] + M){
          ans += (sequence_begin - i + 1);
        } else {
          break;
        }
      } else {
        if(tmp / spill_range + 1 <= A[i] + M){
          ans += (sequence_begin - i + 1);
        } else {
          break;
        }
      }
      sequence_begin = -1;
    } else {
      if(sequence_begin < 0){
        sequence_begin = i;
      }
    }
  }
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 1792
package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
)

const (
	initialBufSize = 1024
	maxBufSize     = 1e6
)

var (
	scanner = bufio.NewScanner(os.Stdin)
	// writer  = bufio.NewWriterSize(os.Stdout, 1000000)
)

func main() {
	scanner.Split(bufio.ScanWords)
	// scanner.Buffer(make([]byte, initialBufSize), maxBufSize)
	// defer writer.Flush()
	n := scanInt()
	sm := make(map[string]bool, n)
	ans := 0
	for i := 0; i < n; i++ {
		s := scanString()
		_, ok := sm[s]
		if !ok {
			ans++
		}
		sm[s] = true
	}

	fmt.Println(ans)
}

func scanInt() int {
	i, _ := strconv.Atoi(scanString())
	return i
}

func scanInts(size int) []int {
	ints := make([]int, size)
	for i := 0; i < size; i++ {
		ints[i] = scanInt()
	}
	return ints
}

func scanFloat64() float64 {
	f, _ := strconv.ParseFloat(scanString(), 64)
	return f
}

func scanFloat64s(size int) []float64 {
	f := make([]float64, size)
	for i := 0; i < size; i++ {
		f[i] = scanFloat64()
	}
	return f
}

func scanString() string {
	scanner.Scan()
	return scanner.Text()
}

func scanStrings(size int) []string {
	s := make([]string, size)
	for i := 0; i < size; i++ {
		s[i] = scanString()
	}
	return s
}


Measured memory_bytes: 10928
#include <bits/stdc++.h>
using namespace std;
long long int k[101][100001];
int main(void)
{
	int n;
	long long int w;
	long long int weight[101];
	long long int value[101];
	cin >> n>>w;
	for (int i = 0; i < n; ++i)
	{
		cin >> weight[i]>>value[i];
	}

	for (int i = 0; i <=n; ++i)
	{
		for (int j = 0; j <=w; ++j)
		{
			if(i==0||j==0)
			{
				k[i][j]=0;
			}
			else if(weight[i-1]>j)
			{
				k[i][j]=k[i-1][j];
			}
			else
			{
				k[i][j]=max(value[i-1]+k[i-1][j-weight[i-1]],k[i-1][j]);
			}
		}
	}
	printf("%lld\n",k[n][w] );
}

Measured memory_bytes: 79104
#include<bits/stdc++.h>
using namespace std;
#define inf INT_MAX
#define INF LLONG_MAX
#define ll long long
#define ull unsigned long long
#define M (int)(1e9+7)
#define P pair<int,int>
#define FOR(i,m,n) for(int i=(int)m;i<(int)n;i++)
#define RFOR(i,m,n) for(int i=(int)m;i>=(int)n;i--)
#define rep(i,n) FOR(i,0,n)
#define rrep(i,n) RFOR(i,n,0)
#define all(a) a.begin(),a.end()
const int vx[4] = {0,1,0,-1};
const int vy[4] = {1,0,-1,0};
#define F first
#define S second
#define PB push_back
#define EB emplace_back
#define int ll
#define vi vector<int>
#define IP pair<int,P>
#define PI pair<P,int>
#define PP pair<P,P>
#define Yes(f){cout<<(f?"Yes":"No")<<endl;}
#define YES(f){cout<<(f?"YES":"NO")<<endl;}


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

    int n,m;
    cin>>n>>m;

    int s=0;
    vi a(n);
    rep(i,n){
        cin>>a[i];
        s+=a[i];
    }

    int cnt=0;
    rep(i,n){
        cnt+=(a[i]*4*m>=s);
    }

    Yes(cnt>=m);


}

Measured memory_bytes: 256
# Author: cr4zjh0bp
# Created: Sun Mar 29 05:26:08 UTC 2020
import sys
 
stdin = sys.stdin
inf = 1 << 60
mod = 1000000007
 
ni      = lambda: int(ns())
nin     = lambda y: [ni() for _ in range(y)]
na      = lambda: list(map(int, stdin.readline().split()))
nan     = lambda y: [na() for _ in range(y)]
nf      = lambda: float(ns())
nfn     = lambda y: [nf() for _ in range(y)]
nfa     = lambda: list(map(float, stdin.readline().split()))
nfan    = lambda y: [nfa() for _ in range(y)]
ns      = lambda: stdin.readline().rstrip()
nsn     = lambda y: [ns() for _ in range(y)]
ncl     = lambda y: [list(ns()) for _ in range(y)]
nas     = lambda: stdin.readline().split()

n = ni()
s = ns()

def ok(p):
    k = 0
    for i in range(n):
        if s[i] == p[k]:
            k += 1
        if k == 3:
            return True
    return False

ans = 0
for i in range(1000):
    p = "{:0>3}".format(i)
    if ok(p):
        ans += 1

print(ans)

Measured memory_bytes: 39408
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <functional>
#include <numeric>
#include <stack>
#include <queue>
#include <map>
#include <set>
#include <utility>
#include <sstream>
#include <complex>
#include <fstream>
#include <bitset>
#include <time.h>

using namespace std;

typedef long long ll;
typedef pair<ll, ll> P;
typedef vector<ll> V;
typedef complex<double> Point;

#define PI acos(-1.0)
#define EPS 1e-10
const ll INF = (1LL << 31) - 1;
const ll MOD = 1e9 + 7;

#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define REP(i,N) for(int i=0;i<(N);i++)
#define ALL(s) (s).begin(),(s).end()
#define EQ(a,b) (abs((a)-(b))<EPS)
#define EQV(a,b) ( EQ((a).real(), (b).real()) && EQ((a).imag(), (b).imag()) )
#define fi first
#define se second
#define N_SIZE (1LL << 20)
#define NIL -1
#define MAX_N 100100 * 3

int a[1000100];
vector<int> b[2];

int main() {
	int n;
	cin >> n;
	REP(i, n)cin >> a[i];
	REP(i, n) {
		b[i % 2].push_back(a[i]);
	}
	if (n % 2 == 0) {
		REP(i, b[1].size()) {
			if (i == 0)cout << b[1][b[1].size() - 1 - i];
			else cout << " " << b[1][b[1].size() - 1 - i];
		}
		REP(i, b[0].size()) {
			cout << " " << b[0][i];
		}
		cout << endl;
	}
	else {
		REP(i, b[0].size()) {
			if (i == 0)cout << b[0][b[0].size() - 1 - i];
			else cout << " " << b[0][b[0].size() - 1 - i];
		}
		REP(i, b[1].size()) {
			cout << " " << b[1][i];
		}
		cout << endl;
	}
}

Measured memory_bytes: 3956
#include <stdio.h>
#include <math.h>

int main(void){
  double xp1,xp0,yp1,yp0,xp2,yp2;
  int q;
  scanf("%lf %lf %lf %lf",&xp0,&yp0,&xp1,&yp1);
  scanf("%d",&q);
  double z,k;
  for(int i=0;i<q;i++){
    scanf("%lf %lf",&xp2,&yp2);
    z=(xp1-xp0)*(yp2-yp0)-(yp1-yp0)*(xp2-xp0);
    if(z>0){
      printf("COUNTER_CLOCKWISE\n");
    }
    else if(z<0){
      printf("CLOCKWISE\n");
    }
    else{
      if(xp1==xp0){
        k=(yp1-yp0)/(yp2-yp0);
      }
      else{
        k=(xp1-xp0)/(xp2-xp0);
      }
      if(k<0){
        printf("ONLINE_BACK\n");
      }
      else if(k<1){
        printf("ONLINE_FRONT\n");
      }
      else{
        printf("ON_SEGMENT\n");
      }
    }
  }
  return 0;
}



Measured memory_bytes: 2132
using System;

namespace noteCsharp
{
    class Program
    {
        static void Main(string[] args)
        {
            while (true)
            {
                string[] inputstr = Console.ReadLine().Split(char.Parse(" "));
                if (inputstr[1] == "?")
                {
                    return;
                }
                int a = int.Parse(inputstr[0]);
                int b = int.Parse(inputstr[2]);
                if (inputstr[1] == "+")
                {
                    Console.WriteLine(a + b);
                }
                if (inputstr[1] == "-")
                {
                    Console.WriteLine(a - b);
                }
                if (inputstr[1] == "*")
                {
                    Console.WriteLine(a * b);
                }
                if (inputstr[1] == "/")
                {
                    Console.WriteLine(a / b);
                }
            }
        }
    }
}



Measured memory_bytes: 15952
nums = input().split()
a = int(nums[0])
b = int(nums[1])
c = int(nums[2])
if a <= b <= c :
    print(a,b,c)
elif a <= c <= b :
    print(a,c,b)
elif b <= a <= c :
    print(b,a,c)
elif b <= c <= a :
    print(b,c,a)
elif c <= a <= b :
    print(c,a,b)
else :
    print(c,b,a)

Measured memory_bytes: 6724
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define _overload3(_1,_2,_3,name,...) name
#define _rep(i,n) repi(i,0,n)
#define repi(i,a,b) for(ll i=ll(a);i<ll(b);++i)
#define rep(...) _overload3(__VA_ARGS__,repi,_rep,)(__VA_ARGS__)
#define inf (ll)1e9
#define mod (ll)(1e9+7)
#define d(x) cerr<<#x<<"="<<x<<endl;
#define p(x) cout<<(x)<<endl
#define ps(x) cout<<(x);
#define pk(x) cout<<(x)<<" ";
#define pfix(d,x) cout << fixed << setprecision(d) << x << endl;
#define pb push_back
#define all(v) (v).begin(), (v).end()
#define minel(v) *min_element(all(v))
#define minind(v) distance((v).begin(), min_element(all(v)))
#define maxel(v) *max_element(all(v))
#define maxind(v) distance((v).begin(), max_element(all(v)))
#define p2d(v,n,m) rep(i,n){rep(j,m){pk(v[i][j]);}p("");}
#define fi first
#define se second
template<typename A, size_t N, typename T>
void Fill(A (&array)[N], const T &val){
    std::fill( (T*)array, (T*)(array+N), val );
}
ll a[100001],b[100001],c[100001],d,n,m,x,y,z,h,w,k,sum,mi=inf,ma=-inf,ans,s,t,l,r,res,tmp,itr,p,q;
bool flag;
int dx[4]={1,0,-1,0},dy[4]={0,1,0,-1};
int dx8[8]={1,1,0,-1,-1,-1,0,1},dy8[8]={0,1,1,1,0,-1,-1,-1};
char cha;
string st;
typedef map<ll, ll> imap;
typedef pair<ll, ll> P;
typedef vector<int> VI;
typedef vector<ll> VL;
typedef vector<pair<ll,ll> > VP;
P pa;


// mod_tools
ll fact[100001]; 

ll mpow(ll x, ll y){
    //d(x)
    if(y==0) return 1;
    if(y%2==0){
        return mpow(x*x%mod,y/2)%mod;
    }
    else{
        return x*mpow(x,y-1)%mod;
    }
}

ll minv(ll x){
    // only available for mod=10^9+7
    return mpow(x,mod-2);
}

void mfact(){
    //prepare fact-array
    fact[0]=1;
    rep(i,1,100001){
        fact[i]=fact[i-1]*i%mod;
    }
}

ll combi(ll n, ll k){
    return (fact[n]*minv(fact[k])%mod)*minv(fact[n-k])%mod;
}

int main(){
    cin>>n>>k;
    mfact();
    VL av;
    rep(i,n){
        cin>>tmp;
        av.pb(tmp);
    }
    sort(all(av));
    rep(i,n){
        //a[i]がmaxの時
        //a[i]と、a[i]未満をk-1個含むような組み合わせ
        //iCk-1
        if(i>=k-1)sum=(sum+combi(i,k-1)*av[i])%mod;
        //a[i]がminのとき
        //a[i]と、a[i]未満をk-1個含むような組み合わせ
        //n-1-iCk-1
        if(n-1-i>=k-1)sum=(sum-combi(n-1-i,k-1)*av[i])%mod;
    }
    p(sum);
    return 0;
}


Measured memory_bytes: 2168
s=gets.chomp

count=0
n=s.length
n.times do |i|
    if i%2==0
        if s[i]=="1"
            count+=1
        end
    else
        if s[i]=="0"
            count+=1
        end
    end
end
ans=count
count=0
n=s.length
n.times do |i|
    if i%2==0
        if s[i]=="0"
            count+=1
        end
    else
        if s[i]=="1"
            count+=1
        end
    end
end
ans=[ans,count].min
puts ans


Measured memory_bytes: 14400
using System.Collections.Generic;
using System;

public class hello
{
    public static void Main()
    {
        while (true)
        {
            var n = long.Parse(Console.ReadLine().Trim());
            if (n == 0) break;
            Console.WriteLine(getAns(n));
        }
    }
    public static string getAns(long n)
    {
        var t = new List<long>();
        while (!(n > 0 && n < 10))
        {
            var w = n % -10;
            if (w < 0) { w += 10; t.Add(w); n = -n / 10 + 1; }
            else { t.Add(w); n = -n / 10; }
        }
        t.Add(n);
        t.Reverse();
        return string.Join("", t);
    }
}


Measured memory_bytes: 15892
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskB solver = new TaskB();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskB {
        public void solve(int testNumber, InputReader in, PrintWriter out) {
            int n = in.nextInt();
            int[] a = new int[n];
            for (int i = 0; i < n; ++i) a[i] = in.nextInt();
            int max = 0;
            for (int x : a) max = Math.max(max, x);
            int n0 = 0;
            int n1 = 0;
            for (int x : a)
                if (x == max) ++n0;
                else if (x == max - 1) ++n1;
                else {
                    out.println("No");
                    return;
                }
            if (n1 == 0) {
                if (max == n - 1) {
                    out.println("Yes");
                    return;
                }
                if (2 * max <= n) {
                    out.println("Yes");
                    return;
                }
                out.println("No");
                return;
            }
            if (n1 < max && 2 * (max - n1) <= n0) {
                out.println("Yes");
            } else {
                out.println("No");
            }
        }

    }

    static class InputReader {
        public BufferedReader reader;
        public StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

    }
}



Measured memory_bytes: 34028
N, K = map(int, input().split())

mod = 10**9+7

# i = 1, 2, ... k について最大公約数がiになる数列を数え上げる
count = [0 for _ in range(K+1)]
for i in range(K, 0, -1):
    count[i] = pow(K//i, N, mod)
    for j in range(2*i, K+1, i):
        count[i] -= count[j]

# それに数をかけて和を求める
ans = 0
for i, c in enumerate(count):
    ans += i*c % mod

print(ans % mod)


Measured memory_bytes: 73680
#include <vector>
#include <iostream>
#include <string>

using namespace std;

int main() {
  long n;
  cin >> n;
  
  vector<vector<long>> list;
  
  for (long i = 1; i * i <= n; i += 1) {
    if (n % i == 0) {
      vector<long> arr;
      arr.push_back(i);
      arr.push_back(n / i);
      list.push_back(arr);
    }
  }
  
  long result = n;
  for (long i = 0; i < list.size(); i += 1) {
    vector<long> arr = list.at(i);
    long tmp = arr.at(0) + arr.at(1) - 2;
    if (result > tmp) {
      result = tmp;
    }
  }
  
  cout << result << endl;
}

Measured memory_bytes: 512
n,m = map(int, input().split())
A = list(map(int, input().split()))
S = sum(A)
ans = 0
for i in range(len(A)):
  if A[i] >= S/(4*m):
    ans += 1
  else:
    pass
  
if ans >= m:
  print("Yes")
else:
  print("No")

Measured memory_bytes: 9088
// ######      ###      #######    #######    ##     #     #####        ###     ##### //
// #     #    #   #          #        #       # #    #    #     #      #   #     ###  //
// #     #   #     #        #         #       #  #   #   #       #    #     #    ###  //
// ######   #########      #          #       #   #  #   #           #########    #   //
// #     #  #       #     #           #       #    # #   #    ####   #       #    #   //
// #     #  #       #    #            #       #     ##   #    #  #   #       #        //
// ######   #       #   #######    #######    #      #    #####  #   #       #    #   //

// #pragma GCC optimize(2)
// #pragma GCC optimize(3)
// #pragma GCC optimize("Ofast,no-stack-protector,unroll-loops,fast-math,O3")
// #pragma GCC target("avx,avx2,fma")
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef long double lld;
#define vl vector<ll>
#define vvl vector<vector<ll>>
#define ain(a,n) for(ll i=0;i<(n);++i)	cin>>(a)[i];
#define DEBUG(x) cout << '>' << #x << ':' << x << endl;
#define loop(i,n) for(ll i=0;i<(n);++i)
#define FOR(i,a,b) for(ll i=(a);i<=(b);++i)
#define FORD(i,a,b) for(ll i=(a);i>=(b);--i)
#define cases ll T=0;cin>>T;while(T--)
#define ff first
#define ss second
#define all(v) v.begin(),v.end()
#define END "\n"
#define pb push_back
#define go(c,itr) for(auto itr=(c).begin(); itr!=(c).end(); ++itr)
#define back(c,itr) for(auto itr=(c).rbegin(); itr!=(c).rend(); ++itr)
#define PI 3.14159265359
#define inf 9e18
#define MOD 1000000007
#define MODU 998244353
#define fast ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define MAXN 1000005
#define PP pair<pair<ll,ll>,pair<pair<ll,ll>,ll>>
const string alpha = "abcdefghijklmnopqrstuvwxyz";
const ll N = 1e9;
ll binexp(ll a, ll b, ll m) {
	a %= m;
	ll res = 1;
	while (b > 0) {
		if (b & 1)
			res = res * a % m;
		a = a * a % m;
		b >>= 1;
	}
	return res;
}
void task(bool flag)
{
	if (flag)
		cout << "YES\n";
	else
		cout << "NO\n";
}
ll lcm(ll a, ll b)
{
	return ((1LL * a * b) / (__gcd(a, b)));
}

signed main() {

	fast
	// cases
	{
		ll n, k;
		cin >> n >> k;
		vl a(n);
		ain(a, n);
		sort(all(a));
		ll ans = 0;
		loop(i, k)	ans += a[i];
		cout << ans << END;

	}


// #ifndef ONLINE_JUDGE
// 	cout << "\nTime Elapsed: " << 1.0 * clock() / CLOCKS_PER_SEC << " sec\n";
// #endif
	return 0;
}

Measured memory_bytes: 3652
#pragma GCC optimize("O3")
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define int ll
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

signed main(){
		ios_base::sync_with_stdio(0);cin.tie(0);
    int N;
    cin>>N;
    cout<<360/__gcd(N,(ll)360);
}

Measured memory_bytes: 3648
#include<bits/stdc++.h>
using namespace std;
main()
{
    long long n,i,k;
    while(scanf("%lld %lld",&n,&k)==2){
        long long a[n],s=0;
        for(i=0;i<n;i++)
            scanf("%lld",&a[i]);
        sort(a,a+n);
        if(k>=n)
            printf("0\n");
        else if(k==0){
            for(i=0;i<n;i++){
                s+=a[i];
            }
            printf("%lld\n",s);
        }
        else{
            for(i=0;i<n-k;i++){
                s+=a[i];
            }
            printf("%lld\n",s);
        }
    }
}


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

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

    if(n%2){
        cout << "No\n";
    } else if(strncmp(&s[0],&s[n/2],n/2) == 0) {
        cout << "Yes\n";
    } else {
        cout << "No\n";
    }
    return 0;
}


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

int solve(vector<int>&v,int n ,int k){
    long long dp[n+2][k+2];
    
    for(int j=0;j<=k;j++){
        dp[1][j] = (j>v[1])?0:1;
    }
    for(int i=2;i<=n;i++){
        for(int j=0;j<=k;j++){
            if(j==0)
                dp[i][j] = dp[i-1][j];
            else dp[i][j] = (mod + dp[i][j-1] + dp[i-1][j] - ((j-v[i]-1 >=0)?dp[i-1][j-v[i]-1]:0))%mod;
        }
    }
    return dp[n][k];
}

int main() {
	// your code goes here
	int n , k;
	cin>>n>>k;
	vector<int> v(n+1);
	
	for(int i=1;i<=n;i++){
	    cin>>v[i];
	}
	
	cout<<solve(v,n,k);
	
	return 0;
}


Measured memory_bytes: 81644
import math
from functools import reduce
from collections import deque
import sys
sys.setrecursionlimit(10**7)

def s(generator, splitter, mapper):
    return [ mapper(s) for s in generator().split(splitter) ]

# スペース区切りの入力を読み込んで数値リストにして返します。
def get_nums_l():
    return [ int(s) for s in input().split(" ")]

# 改行区切りの入力をn行読み込んで数値リストにして返します。
def get_nums_n(n):
    return [ int(input()) for _ in range(n)]

w,h,x,y = get_nums_l()

s = (w*h) / 2
t = 1 if (x == w/2) and (y == h/2) else 0

print(s, t)

Measured memory_bytes: 38448
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
// 293206GT
#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <set>
#include <map>
#include <queue>
#include <unordered_map>
#include <unordered_set>
#include <unordered_set>
#include <stack>
#include <string>
#include<algorithm>
#include <random>
#include <bitset>
#include <chrono>

typedef long long ll;
#define int ll
using namespace std;
#define put(a) cout << (a) << '\n'
#define sqr(x) ((x) * (x))
typedef pair<int, int> pii;
typedef long double ld;
typedef pair<ld, ld> pld;
typedef unsigned long long ull;

typedef vector<int> vi;
typedef vector<pii> vpii;
#define rep(x, y, a) for (int x = (y); x < (int)(a); ++x)
#define all(a) a.begin(), a.end()
#define chkmax(a, b) a = max(a, (b))
#define chkmin(a, b) a = min(a, (b))
#define prev asasdasd
#define next aasdasda
#define left asdasdasdasd
#define right asnabsdkasdl
#define rank asdasdknlasd
#define move asdasdas
#define fname "parray"
#define fin fname".in"
#define fout fname".out"
#define files freopen(fin, "r", stdin);freopen(fout, "w", stdout);
namespace IO {

    template<class A, class B>
    ostream &operator<<(ostream &out, vector<pair<A, B>> a);

    template<class A>
    ostream &operator<<(ostream &out, vector<A> a);

    template<class A, class B>
    ostream &operator<<(ostream &out, pair<A, B> a) {
        out << a.first << " " << a.second;
        return out;
    }

    template<class A, class B>
    ostream &operator<<(ostream &out, vector<pair<A, B>> a) {
        for (pair<A, B> x: a)
            out << x.first << " " << x.second << '\n';
        return out;
    }

    template<class A>
    ostream &operator<<(ostream &out, vector<A> a) {
        for (A x: a) out << x << ' ';
        return out;
    }

    template<class A, class B>
    istream &operator>>(istream &in, pair<A, B> &a) {
        in >> a.first >> a.second;
        return in;
    }

    template<class A>
    istream &operator>>(istream &in, vector<A> &a) {
        for (A &x: a) in >> x;
        return in;
    }
}
using namespace IO;


mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

void solve() {
    int n, k;
    cin >> n >> k;
    vi a(n);
    cin >> a;
    int L = 0, R = 1e9 + 2;
    while (R - L > 1) {
        int m = (R + L) / 2;
        int k1 = 0;
        rep(i,0 , n) {
            k1 += (a[i] - 1) / m;
        }
        if (k1 <= k) R = m;
        else L = m;
    }
    put(R);
}

signed main() {
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    cout.precision(30);
//    freopen("input.txt", "r", stdin);
//    files
    int q = 1;
//    cin >> q;
    while (q--) solve();
}



Measured memory_bytes: 4460
#include <iostream>
#include <string>
#include <vector>
#include <deque>
#include <list>
#include <set>
#include <unordered_set>
#include <map>
#include <unordered_map>
#include <array>
#include <algorithm>
#include <tuple>

int main()
{
	int t, x;
	std::cin >> t >> x;
	std::cout << (t / (float)x) << "\n";
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#pragma GCC optimize("Ofast")
#pragma GCC optimize ("unroll-loops")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#define mod 1000000007
#define pb emplace_back
#define mp make_pair
#define fi first
#define sec second
typedef long long ll;
typedef long double  ld;
#define pii pair<ll,ll> 
#define vi vector< ll > 
#define vvi vector< vi > 
#define vpi vector< pii > 
#define vvpi vector< vpi > 
#define fast ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0)
#define test(t) ll t;cin>>t;while(t--)
#define mem(a,b) memset(a,b,sizeof(a))
#define inn freopen("input.txt", "r", stdin)
#define outt freopen("output.txt", "w", stdout)
#define all(arr) arr.begin(),arr.end()
#define fr(i,n) for(ll i=0;i<(n);++i)
#define rep(i,a,b) for(ll i=a;i<=b;++i)
#define per(i,a,b) for(ll i=a;i>=b;i--)
#define remin(a,b) (a=min((a),(b)))
#define remax(a,b) (a=max((a),(b)))
#ifndef ONLINE_JUDGE
#define debarr(a,n)cerr<<#a<<":";for(int i=0;i<n;i++)cerr<<a[i]<<" ";cerr<<endl;
#define debmat(mat,row,col)cerr<<#mat<<":\n";for(int i=0;i<row;i++){for(int j=0;j<col;j++)cerr<<mat[i][j]<<" ";cerr<<endl;}
#define pr(...)dbs(#__VA_ARGS__,__VA_ARGS__)
template<class S,class T>ostream &operator<<(ostream &os,const pair<S,T> &p){return os<<"("<<p.first<<","<<p.second<<")";}
template<class T>ostream &operator<<(ostream &os,const vector<T> &p){os<<"[";for(auto&it:p)os<<it<<" ";return os<<"]";}
template<class T>ostream &operator<<(ostream &os,const set<T>&p){os<<"[";for(auto&it:p)os<<it<<" ";return os<<"]";}
template<class T>ostream &operator<<(ostream &os,const multiset<T>&p){os<<"[";for(auto&it:p)os<<it<<" ";return os<<"]";}
template<class S,class T>ostream &operator<<(ostream &os,const map<S,T>&p){os<<"[";for(auto&it:p)os<<it<<" ";return os<<"]";}
template<class T>void dbs(string str,T t){cerr<<str<<":"<<t<<"\n";}
template<class T,class...S>void dbs(string str,T t,S... s){int idx=str.find(',');cerr<<str.substr(0,idx)<<":"<<t<<",";dbs(str.substr(idx+1),s...);}
#else
#define pr(...){}
#define debarr(a,n){}
#define debmat(mat,row,col){}
#endif
ll power(ll x,ll y){ll res = 1;while(y){if(y&1) res = (res*x)%mod;y=y/2,x=(x*x)%mod;}return res%mod;}
signed main()
{
    fast;
    ll n;
    cin>>n;
    ll i;
    vi a(n),b(n);

    vi temp;
    for(i=0;i<n;i++)
        cin>>a[i],temp.pb(i+1);
    for(i=0;i<n;i++)
        cin>>b[i];
    vvi arr;
    do{
        arr.pb(temp);
    }while(next_permutation(all(temp)));
    ll x,y;
    for(i=0;i<arr.size();i++)
    {
        if(arr[i]==a)
            x = i;
        if(arr[i]==b)
            y = i;
    }
    // pr(arr);
    cout<<abs(x-y);
    
}


Measured memory_bytes: 4408
//Written by Zhu Zeqi
//Come on,baby
//Hack,please
#include<cmath>
#include<math.h>
#include<ctype.h>
#include<algorithm>
#include<bitset>
#include<cassert>
#include<cctype>
#include<cerrno>
#include<cfloat>
#include<ciso646>
#include<climits>
#include<clocale>
#include<complex>
#include<csetjmp>
#include<csignal>
#include<cstdarg>
#include<cstddef>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<ctime>
#include<cwchar>
#include<cwctype>
#include<deque>
#include<exception>
#include<fstream>
#include<functional>
#include<iomanip>
#include<ios>
#include<iosfwd>
#include<iostream>
#include<istream>
#include<iterator>
#include<limits>
#include<list>
#include<locale>
#include<map>
#include<memory>
#include<new>
#include<numeric>
#include<ostream>
#include<queue>
#include<set>
#include<sstream>
#include<stack>
#include<stdexcept>
#include<streambuf>
#include<string>
#include<typeinfo>
#include<utility>
#include<valarray>
#include<vector>
#include<string.h>
#include<stdlib.h>
#include<stdio.h>
#define pb push_back
#define mp make_pair
#define F first
#define S second
#define pii pair<int,int>
#define vi vector<int>
#define MAX 100000000000000000
#define MOD 1000000007
#define PI 3.141592653589793238462
#define INF 1000000000
typedef long long ll;
using namespace std;
int siz[100005],dep[100005],p[100005];
vector<int> vec[100005];
void dfs(int pos,int fa){
	siz[pos]=1;
	for(int i=0;i<vec[pos].size();i++){
		int v=vec[pos][i];
		if(v!=fa){
			p[v]=pos;
			dep[v]=dep[pos]+1;
			dfs(v,pos);
			siz[pos]+=siz[v];
		}
	}
}
int main(){
	//freopen("input.in","r",stdin);
	//freopen("output.out","w",stdout);
	int u,v,n,i;
	scanf ("%d",&n);
	for(i=1;i<n;i++){
		scanf ("%d%d",&u,&v);
		vec[u].push_back(v);
		vec[v].push_back(u);
	}
	dep[1]=0;
	dfs(1,0);
	int stp=(dep[n]-1)/2,tar=n;
	while(stp--){
		n=p[n];
	}
	int num=siz[n];
	if(num*2>=tar){
		printf("Snuke\n");
	}
	else{
		printf("Fennec\n");
	}
	//system("pause");
	return 0;
}

Measured memory_bytes: 14720
#include<iostream>
#include<math.h>
using namespace std;
int main() {
	long double a, b, c;
	cin >> a >> b >> c;
	if (c-a-b>0&&4*a*b<(c-a-b)*(c-a-b)) {
		cout << "Yes" << endl;
	}
	else  {
		cout << "No" << endl;
	}
	return 0;
}


Measured memory_bytes: 256
//Radhe Radhe
#include<bits/stdc++.h>
#define godspeed  ios_base:: sync_with_stdio(false); cin.tie(0); cout.tie(0);

#define ll long long
#define ld long double
#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define en '\n'
#define rep(i,n)    for(ll i=0; i<n; i++)
#define rep1(i,a,b)    for(ll i=a; i<=b; i++)
#define repVect(i,n)    for(ll i=0; i<sum.size(); i++)
#define fixed cout.setf(ios::fixed);
#define Precise cout.precision(1);
#define yes cout<<"YES"<<'\n'
#define no cout<<"NO"<<'\n'
using namespace std;



int main()
{
    godspeed
    string s;
    ll ans=0;
    //  ll  t,n,i,j;
    ll i,t,n,j,k,d,x,l;
    cin>>n;
    ll a[n];
    for(i=0;i<n;i++)
    {
        cin>>a[i];
        if(i>0)
        {
            if(a[i-1]>a[i])
            {

                ans+=(a[i-1]-a[i]);
            a[i]=a[i-1];
            }
        }
    }






      cout<<ans<<endl;


    return 0;
}





Measured memory_bytes: 5212
#include<iostream>
#define ll long long
using namespace std;
int main()
{
ll   a,b,c,d;
   cin>>a>>b>>c>>d;
   ll k1=max(a,b)*max(c,d) ;
ll k2=max(a,b)*min(c,d);
ll k3=min(a,b)*max(c,d);
ll k4=min(a,b)*min(c,d);
ll res=max(max(k1,k2),max(k3,k4));

cout<<res<<'\n';

return 0;
}

Measured memory_bytes: 3580
/*
    Author:zeke
    
    pass System Test!
    GET AC!!
*/
#include <iostream>
#include <queue>
#include <vector>
#include <iostream>
#include <vector>
#include <string>
#include <cassert>
#include <algorithm>
#include <functional>
#include <cmath>
#include <queue>
#include <set>
#include <stack>
#include <deque>
#include <map>
#include <iomanip>
#include <utility>
#include <stack>
using ll = long long;
using ld = long double;
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define all(x) (x).begin(), (x).end()
#define rep3(var, min, max) for (ll(var) = (min); (var) < (max); ++(var))
#define repi3(var, min, max) for (ll(var) = (max)-1; (var) + 1 > (min); --(var))
#define Mp(a, b) make_pair((a), (b))
#define F first
#define S second
#define Icin(s) \
    ll(s);      \
    cin >> (s);
#define Scin(s) \
    ll(s);      \
    cin >> (s);
template <class T>
bool chmax(T &a, const T &b)
{
    if (a < b)
    {
        a = b;
        return 1;
    }
    return 0;
}
template <class T>
bool chmin(T &a, const T &b)
{
    if (b < a)
    {
        a = b;
        return 1;
    }
    return 0;
}
typedef pair<ll, ll> P;
typedef vector<ll> V;
typedef vector<V> VV;
typedef vector<P> VP;
ll MOD = 1e9 + 7;
ll INF = 1e18;

int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    ld n;
    cin>>n;
    ll m = n+1;
    ll f=n-1;
    ll k=n/1.08;
    m=m/1.08;
    f/=1.08;
    ll M=m;
    ll K=k;
    ll F=f;
    m*=1.08;
    k*=1.08;
    f*=1.08;
   // cout<<k<<" "<<m<<endl;
    if(k==m){
        cout<<":("<<endl;
    }else if(k==n){
        cout<<K<<endl;
    }else if(m==n){
        cout<<M<<endl;
    }else if(f==n){
        cout<<F<<endl;
    }else{
        cout<<":("<<endl;
    }
       
}


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


using namespace std;
#define ll  long long
#define ld  long double
#define endl '\n'
#define FAST ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
const ll mod = 1e9 + 7;
const double PI = 3.141592653589793238463;
const int MAXN = 2e3 + 5;
bool isPrime[MAXN];
void sevie() {
    memset(isPrime, 1, sizeof(isPrime));
    isPrime[0] = isPrime[1] = 0;
    for (ll i = 2; i * i <= MAXN; i++) {
        if (isPrime[i]) {
            for (ll j = i * 2; j <= MAXN; j += i) {
                isPrime[j] = 0;

            }
        }
    }
}
ll fastPow(ll x, ll b) {
    if (b == 0)
        return 1;
    else if (!(b & 1)) {
        return fastPow(x * x, b / 2);
    } else
        return x * fastPow(x * x, (b - 1) / 2);
}
//__builtin_popcount ();
bool isPrim(int n) {
    if (n == 1 || n == 0)
        return false;
    for (int i = 2; i * i <= n; i++) {
        if (n % i == 0)
            return false;
    }
    return true;
}



int main() {
    FAST
char a,b;
    cin>>a>>b;
    string ans1,ans2;
    for(int i=0;i<a-'0';i++)
        ans2.push_back(b);
    for(int i=0;i<b-'0';i++)
        ans1.push_back(a);
    cout<<min(ans1,ans2)<<endl;

    return 0;
}


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

a.sort(reverse=True)
if n%2 == 1:
    a.append(0)
    n += 1
ans = 0
for i in range(n//2):
    ans += a[2*i]
    ans -= a[2*i+1]
print(ans)

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

#define name ""
#define ini freopen(name".inp","r",stdin); freopen(name".out","w",stdout)
#define foe(it,c) for (__typeof(c.begin()) it = c.begin(); it != c.end(); it++)
#define long long long 
#define db double 
#define pii pair <int, int>
#define pll pair <long, long>
#define all(c) c.begin(), c.end()
#define fastio ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0)

const int INF = 1e9+7;
const int MOD = 1e9+7;
const int dx[4] = {0,0,-1,1};
const int dy[4] = {-1,1,0,0};

int main()
{
  fastio;
  int n; cin >> n;
  int res = 0; int mn = n + 1;
  for (int i = 1; i <= n; i++){
    int x; cin >> x; 
    mn = min(x, mn);
    if (mn == x) res++;
  }
  cout << res;
  return 0;
}

Measured memory_bytes: 256
#include <iostream>
using namespace std;
int main() {
	int h, w;
	while (cin >> h >> w && (h != 0 && w != 0)) {
		for (int i = 0; i < h; i++) {
			for (int j = 0; j < w; j++) {
				cout << "#";
			}
			cout << endl;
		}
		cout << endl;
	}
}

Measured memory_bytes: 1152
import java.util.*;

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

        int N = sc.nextInt();
        int M = sc.nextInt();
        
        // 部屋番号はすべて0始まりに直す
        HashMap<Integer, ArrayList<Integer>> passway = new HashMap<Integer, ArrayList<Integer>>();
        Deque<Integer> nextVisitingQueue = new ArrayDeque<>();
        Integer[] toRoom = new Integer[N];
        
        for (int i = 0; i < M; i++) {
            int A = sc.nextInt()-1;
            int B = sc.nextInt()-1;

            if (!passway.containsKey(A)) {
                passway.put(A, new ArrayList<Integer>());
            }
            if (!passway.containsKey(B)) {
                passway.put(B, new ArrayList<Integer>());
            }
            passway.get(A).add(B);
            passway.get(B).add(A);
        }

        nextVisitingQueue.add(0);
        toRoom[0] = -1;
        int visitedRoomCount = 0;

        Integer currentRoom;
        while ( (currentRoom = nextVisitingQueue.poll()) != null ){
            visitedRoomCount += 1;
            List<Integer> roomList = passway.get(currentRoom);
            for (Integer room : roomList) {
                if (toRoom[room] == null) {
                    toRoom[room] = currentRoom;
                    nextVisitingQueue.add(room);
                }
            }
        }

        if (visitedRoomCount == N) {
            System.out.println("Yes");
            for (int i = 1; i < N; i ++) {
                System.out.println(toRoom[i]+1);
            }
        } else {
            System.out.println("No");
        }
    }
}

Measured memory_bytes: 91320