akhauriyash/Code-Regression huggingface dataset:
#include<iostream>
#include<cstdio>
#include<cstdlib>
#include<cmath>
#include<string>
#include<cstring>
#include<algorithm>
#include<functional>
#include<vector>
#include<map>

using namespace std;
#define endl '\n'
#define pb push_back
#define fst first
#define scd second
#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))
#define MOD (1e9 + 7)
#define ALL(x) (x).begin(), (x).end()
#define RALL(x) (x).rbegin(), (x).rend()
#define REP(i,n) for(int i = 0;i < (n);i++)
#define FOR(i,a,b) for(int i = (a);i <= (b);i++)
#define YES(n) cout << ((n) ? "YES" : "NO" ) << endl
#define Yes(n) cout << ((n) > "Yes" : "No" ) << endl


typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> P;
typedef vector<int> vi;
typedef vector<vector<int>> vii;

template <class T = int> T in() { T x; cin >> x; return (x); }
template <class T = int> void out(T x) { cout << (x) << endl; }

int gcd(int a, int b) { return b ? gcd(b, a%b) : a; }

int n, m, q, bottom, top, ans, t[510][510], cnt[510][510];

void solve() {

	cin >> n >> m >> q;

	REP(i, m) {
		t[in()][in()]++;
	}

	FOR(i, 1, n) {
		FOR(j, 1, n) {
			cnt[i][j] = cnt[i][j - 1] + t[i][j];
		}
	}

	REP(i, q) {
		cin >> bottom >> top;
		ans = 0;
		FOR(j, bottom, top) {
			ans += cnt[j][top] - cnt[j][bottom - 1];
		}
		out(ans);
	}


	return;
}

int main() {

	cin.tie(0);
	ios::sync_with_stdio(false);

	solve();

	return 0;

}

Measured memory_bytes: 2944
#include <algorithm>
#include <climits>
#include <iostream>
#include <string>
#include <utility>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <iomanip>
#include <cmath>
#include <stack>
#define rep(i,n) for (int i=0; i<(n); ++i)
using namespace std;
using ll = long long int;

template <class T> ostream &operator<<(ostream &os, vector<T> &v) {
  for (auto i = v.begin(); i != v.end(); i++) {
    os << *i << " ";
  }
  return os;
}


void solve(long long N, long long M, std::vector<long long> H, std::vector<long long> A, std::vector<long long> B){
  map<ll,vector<ll>> m;
  ll ans = 0;
  rep(i,N) {
    vector<ll> v;
    m[i] = v;
  }
  for(ll i=0; i<M; i++) {
    m[A[i]-1].push_back(H[B[i]-1]);
    m[B[i]-1].push_back(H[A[i]-1]);
  }

  for(ll i=0; i<N; i++) {
    vector<ll> &v = m[i];
    bool f = true;
    for(auto h : v) {
      f = f and (h < H[i]);
    }
    if(f) {
      ans++;
    }
  }
  std::cout << ans << std::endl;
}

int main(){
  long long N;
  scanf("%lld",&N);
  long long M;
  scanf("%lld",&M);
  std::vector<long long> H(N);
  for(int i = 0 ; i < N ; i++){
    scanf("%lld",&H[i]);
  }
  std::vector<long long> A(M);
  std::vector<long long> B(M);
  for(int i = 0 ; i < M ; i++){
    scanf("%lld",&A[i]);
    scanf("%lld",&B[i]);
  }
  solve(N, M, std::move(H), std::move(A), std::move(B));
  return 0;
}



Measured memory_bytes: 16676
/*
*          Name : chaitanya
*
*     Institute : ANITS,Visakhapatnam
*
*/
#include<cstdio>
#include<iostream>
#include<sstream>
#include<fstream>
#include<iomanip>
#include<algorithm>
#include<cmath>
#include<complex>
#include<cstring>
#include<vector>
#include<list>
#include<queue>
#include<stack>
#include<set>
#include<map>
#include<bitset>
#include<numeric>
#include<limits>
#include<climits>
#include<cfloat>
#include<functional>
#include<iterator>
#include <random>
#define inf  1000000000
#define all(x) begin(x),end(x)
#define ll long long int
#define ff first
#define ss second
#define pb push_back
const ll mod = 1000000007;
#pragma GCC optimization ("O3")
using namespace std;
const int N = 100005;
int main()
{
 
  // freopen("input.txt","r",stdin);
  // freopen("output.txt","w",stdout);
  //ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
  double n,k,ans = 0;
  cin >> n >> k;
  int tmp,cnt;
  for (int i = 1; i <= n; ++i)
  {
    tmp = i;
    cnt = 0;
    float t = 1;
    while(tmp < k)
    {
      t = t * 2;
      cnt++;
      tmp = tmp * 2;

    }
    ans += (1/t)*(1/n);
  }
  printf("%.10f\n",ans);
  return 0;
}

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

int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(0);
    
    int a, b, c, k;
    cin >> a >> b >> c >> k;
    if(a + b >= k){
        if(k <= a){
            cout << k;
        }
        else{
            cout << a;
        }
    }
    else{
        int g = a - (k - (a + b));
        cout << g;
    }

    return 0;
}

Measured memory_bytes: 3652
#include <iostream>
#include <cstdio>
#include <vector>
#include <map>
#include <set>
#include <algorithm>
#include <string>
#include <cstdlib>
#include <stack>
#include <queue>
#include <cmath>

#define rep(i,j,k) for(int i=(int)j;i<(int)k;i++)

const int INF = 100000000;

using namespace std;


int main() {
	int a, b, c;
	cin >> a >> b >> c;
	if (a <= c && c <= b)cout << "Yes" << endl;
	else cout << "No" << endl;

	return 0;
}

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


int main(void) {
  int n, m;
  cin >> n >> m;
  vector<vector<int>> v(n + 1, vector<int>());
  rep(i, m) {
    int a, b;
    cin >> a >> b;
    v[a].push_back(b);
  }

  bool ok = false;
  for (auto e: v[1]) {
    for(auto e2: v[e]) {
      if (e2 == n) {
        ok = true;
      }
    }
  }

  if (ok) {
    cout << "POSSIBLE" << endl;
  } else {
    cout << "IMPOSSIBLE" << endl;
  }
  
  return 0;
}

Measured memory_bytes: 11384
import java.util.Scanner;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int sx = sc.nextInt();
    int sy = sc.nextInt();
    int tx = sc.nextInt();
    int ty = sc.nextInt();
    sc.close();
 
    // First Forward
    for(int i = sx; i < tx; ++i) {
      System.out.print("R");
    }
    for(int i = sy; i < ty; ++i) {
      System.out.print("U");
    }
 
    // First Return
    for(int i = sx; i < tx; ++i) {
      System.out.print("L");
    }
    for(int i = sy; i < ty; ++i) {
      System.out.print("D");
    }
 
    // Second Forward
    System.out.print("D");
    for(int i = sx; i <= tx; ++i) {
      System.out.print("R");
    }
    for(int i = sy; i <= ty; ++i) {
      System.out.print("U");
    }
    System.out.print("L");
 
    // Second Return
    System.out.print("U");
    for(int i = sx; i <= tx; ++i) {
      System.out.print("L");
    }
    for(int i = sy; i <= ty; ++i) {
      System.out.print("D");
    }
    System.out.print("R\n");
 
  }
}


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

#define int             long long
#define FOR( i, m, n )  for( int (i) = (m); (i) < (n); (i)++ )
#define REP( i, n )     FOR( i, 0, n )
#define REPR( i, m )    for( int (i) = (m); (i) >= 0; (i)-- )
#define REPONE( i, n )  FOR( i, 1, n + 1 )
#define ALL( a )        (a).begin(), (a).end()
#define MP              make_pair

using namespace std;
using P = pair<int, int>;

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( a > b ) { a = b; return 1; } return 0; }

const int INF = 1e18;
const int MOD = 1e9 + 7;

signed main(){
    int a, b; cin >> a >> b;
    if( b == 1 ){
        cout << 0 << endl;
    }else if( a >= b ){
        cout << 1 << endl;
    }else{
        int ans = 1;
        int t = a;
        while( a < b ){
            a += t - 1;
            ans++;
        }
        cout << ans << endl;
    }
}


Measured memory_bytes: 256
//#include <bits/stdc++.h>
#include <iostream>
#include <fstream>
#include <vector>
#include <string>
#include <cmath>
#include <algorithm>
#include <map>
#include <iomanip>
#include <stdlib.h>
#include <queue>
#include <deque>
#include <set>
#include <stack>
#include <time.h>
 
using namespace std;
 
typedef long long ll;
typedef long double ld;
typedef pair<int, int> Pii;
typedef pair<int, ll> Pil;
typedef pair<ll, ll> Pll;
typedef pair<ll, int> Pli;

const ll nmax = 1e9 + 7;
const ll Mod = 998244353;
const double PI = 2 * asin(1);

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

  int A[M], B[M];
  for (int i = 0; i < M; i++){
    cin >> A[i] >> B[i];
    A[i]--; B[i]--;
  }
  
  vector <ll> Group(N), Count(N);
  for (int i = 0; i < N; i++){
    Group[i] = i;
    Count[i] = 1;
  }

  vector <ll> ans(M);
  for (int i = M - 2; i >= 0; i--){
    ans[i] = ans[i + 1];
    int A_now = A[i + 1], B_now = B[i + 1];

    while (A_now != Group[A_now]){
      A_now = Group[A_now];
    }
    while (B_now != Group[B_now]){
      B_now = Group[B_now];
    }
    
    if (A_now == B_now) continue;

    ans[i] += Count[A_now] * Count[B_now];
    
    Count[min(A_now, B_now)] = Count[A_now] + Count[B_now];
    Group[max(A_now, B_now)] = Group[min(A_now, B_now)]; 
  }
  
  for (int i = 0; i < M; i++){
    cout << N * (N - 1) / 2 - ans[i] << endl;
  }
  


  return 0;
}

Measured memory_bytes: 4480
//     . .. ... ..... be naame khodaa ..... .... ... .. .     \\

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

typedef long long ll;
typedef long double ld;

inline int in(){int x, y; y = scanf("%d", &x); return x;}

const int N = 120021, MOD = 1e9 + 7;

ll cnt[N];
ll pw2[N];

int main() {
	string s;
	int n = in();
	cin >> s;
	for(int i = 0; i < n; i++)
		cnt[s[i] - 'a']++;
	pw2[0] = 1;
	for(int i = 1; i <= n; i++) {
		pw2[i] = pw2[i - 1] * 2 % MOD;
	}
	ll res = pw2[n];
	res = (res - 1 + MOD)%MOD;
	int tot = n;
	ll prv = 1;
	for(int i = 0; i < N; i++) {
		if(cnt[i]) {
//			cerr << i << ": "  << res  << " -> ";
			res = (MOD + res - ( (pw2[cnt[i]] - cnt[i] - 1 + MOD)%MOD * pw2[tot - cnt[i]]%MOD * prv%MOD )%MOD)%MOD;
//			cerr << res << endl;
		}
		prv = prv * (cnt[i] + 1) % MOD;
		tot -= cnt[i];
	}
	cout << res << endl;
}



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

int main()
{
    int ht,st,ha,sa,x=-1;
    cin>>ht>>st>>ha>>sa;
    while(1)
    {
        ha-=st;
        ht-=sa;
        if(ha<=0)
        {
            x=0;
            break;
        }
        if(ht<=0)
        {
            x=1;
            break;
        }
    }
    //cout<<ht<<" "<<sa<<endl;
    if(x==0) cout<<"Yes"<<endl;
    else if(x==1) cout<<"No"<<endl;
    return 0;
}


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

int main(){
    int N, ab{}, a{}, b{}, ba{};
    cin >> N;
    vector<string> s(N);
    for(int i{}; i<N; i++){
        cin >> s.at(i);
        for(int j{}; j<s.at(i).size()-1; j++){
            if(s.at(i).at(j) == 'A' && s.at(i).at(j+1) == 'B'){
                ab ++;
            }
        }
        if(s.at(i).at(0) == 'B'){
            b ++;
            if(s.at(i).at(s.at(i).size()-1) == 'A'){
            ba ++;
        }
        }
        if(s.at(i).at(s.at(i).size()-1) == 'A'){
            a ++;
        }
    }
    int sum = min(a, b) + ab;
    if(a > 0 && a==b && a==ba) sum --;
    cout << sum << endl;
}


Measured memory_bytes: 768
import Data.Vector
import Data.Maybe

main = do
    [i, k] <- fmap read . words<$> getLine
    ns <- fromList . fmap read . words <$> getLine
    putStrLn . show $ cost k (i - 1) ns

cost :: Int -> Int -> Vector Int -> Int
cost k j ns = memo ! j
    where
        memo = fromList [cost' l ns | l <- [0..j]]
        cost' :: Int -> Vector Int -> Int
        cost' 0 ns = 0
        cost' 1 ns = abs $ ns ! 0 - ns ! 1
        cost' i ns = Prelude.minimum memo'
            where
              memo' = fromList $ catMaybes [case memo !? (i - m) of 
                                  Just x -> Just $ x + abs (ns ! (i - m) - ns ! i)
                                  Nothing -> Nothing
                                | m <- [1..k]]


Measured memory_bytes: 87420
#include<bits/stdc++.h>
using namespace std;
#define ll long long
int main()
{
  ll n;
  cin>>n;
  ll i;
  ll h[n]; ll dp[n];
  for(i=0;i<n;i++)
    cin>>h[i];
  dp[0]=0;
  dp[1]=(ll)(abs(h[1]-h[0]));
  for(i=2;i<n;i++)
  {
    dp[i]=min(dp[i-1]+(ll)abs(h[i]-h[i-1]),dp[i-2]+(ll)abs(h[i]-h[i-2]));
  }
  cout<<dp[n-1];
  return 0;
}
    


Measured memory_bytes: 1792
#include <algorithm>
#include <bits/stdc++.h>
#include <bitset>
#include <cassert>
#include <cstring>
#include <functional>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <cmath>
#include <memory>
#include <queue>
#include <set>
#include <stack>
#include <utility>
#include <vector>
using namespace std;
#define REP(i, n) for (int64_t i = 0; i < (int64_t)n; i++)
#define REP_FOR(i, a, b) for (int64_t i = (int64_t)a; i < (int64_t)b; i++)
#define REP_REV(i, a, b) for (int64_t i = (int64_t)a; i > (int64_t)b; i--)
#define FORALL(v) (v).begin(), (v).end()
#define mp(a, b) make_pair(a, b)
#define eb(x) emplace_back(x)
#define F first
#define S second
typedef long long ll;
typedef long double ld;
typedef pair<int64_t, int64_t> pii;
typedef pair<ll, ll> pll;
typedef pair<ld, ld> pdd;
typedef vector<ll> vll;
typedef vector<vll> vvll;
typedef vector<int64_t> vii;
typedef vector<vii> vvii;
const ll mod = 1e9 + 7;
const int64_t infi = 1147483600;
const ll infl = 4e18 + 5;
const char EOL = '\n';
const ll MOD = 998244353;

int main() {
    ll n;
    cin >> n;
    vector<ll> H(n,0);
    for (auto & h : H) {
        cin >> h;
    }
    ll prev = 0;
    ll res = 0;
    for (ll i = 0; i < n; ++i) {
        if (H[i] > prev) {
            res += H[i] - prev;
        }
        prev = H[i];
    }
    cout << res << endl;
}


Measured memory_bytes: 256
#include<stdio.h>
#include<stdlib.h>
#include<string.h>

int top;
int S[1000];

void push(int x){
	S[++top] = x;
}
int pop(){
	top--;
	return S[top+1];
}
int main (void){
	int a,b;
	top = 0;
	char s[100];
	while( scanf("%s",s)!= EOF){
		if( s[0] =='+'){
			a = pop();
			b = pop();
			push(a+b);
		}
		else if( s[0] =='-'){
			b = pop();
			a = pop();
			push(a-b);
		}
		else if( s[0] =='*'){
			a = pop();
			b = pop();
			push(a*b);
		}
		else{
			push(atoi(s));
		}
	}
	printf("%d\n",pop());
	
	return 0;
}
		
		
		
	
		
	


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

#define int long long
using ll = long long;
using ld = long double;
using intpair = pair<int, int>;
const int MOD = 1e9 + 7;
inline int mod (ll a, int m = MOD) { return (a % m + m) % m; }
//struct Fast {Fast(){cin.tie(0);ios::sync_with_stdio(0);}} fast;

#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define reps(i, n, m) for (int i = (int)(n); i <= (int)(m); i++)
#define ALL(obj) (obj).begin(), (obj).end()
#define rALL(obj) (obj).rbegin(), (obj).rend()
#define ceiv(a, b) ((ll)((a) + (b) - 1)/(ll)(b))

signed main() {
    int n; cin >> n;
    int ans = n % 1000;
    if(ans == 0){
        cout << 0 << endl;
    }else{
        cout << 1000 - ans << endl;
    }
}

Measured memory_bytes: 3640
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
#define REP(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)
#define REPR(i,n) for(int i=n; i>-1; --i)
#define ALL(a) (a).begin(),(a).end()
#define INIT(a,n,x); REP(i,(n)){ (a)[i]=(x); }
#define CINA(a,n); REP(i,(n)){ cin >> (a)[i]; }
#define INIT2(a,n,m,x); REP(i,(n)){ REP(j,(m)){(a)[i][j]=(x);} }
#define CINA2(a,n,m); REP(i,(n)){ REP(j,(m)){cin >> (a)[i][j];} }
#define Liny "Yes\n"
#define Linn "No\n"
#define LINY "YES\n"
#define LINN "NO\n"

#define umap unordered_map
//cout << setfill('0') << right << setw(4) << 12; // "0012"
int keta(ll x){ if(x<10){return 1;} else{return keta(x/10) + 1;}}
int keta_wa(ll x){ if(x<10){return x;} else{return keta_wa(x/10) + x%10;} }
int ctoi(char c){ return ( (c>='0' && c<='9')? c - '0': 0 );}
ll sum(ll a[],ll N){ return accumulate(a,a+N,0LL);}
ll gcd(ll a,ll b){if(a<b)swap(a,b); return b?gcd(b,a%b):a;}
ll lcm(ll a,ll b){if(a<b){swap(a,b);} return a/gcd(a,b)*b;}

int main(){
  ll N; cin >>N;
  ll a[N]; CINA(a,N);
  ll b[N]; CINA(b,N);
  ll c[N]; CINA(c,N);
  sort(a,a+N);
  sort(b,b+N);
  sort(c,c+N);
  ll ap = 0;
  ll bp = 0;
  ll cp = 0;
  ll r = 0;
  bool no = false;
  while(bp<N){
    if(ap<N){
      while(a[ap]<b[bp]){
        ++ap;
        if(ap==N){break;}
      }
    }
    while(c[cp]<=b[bp]){
      ++cp;
      if(cp==N){ no = true; break;}
    }
    //cout << ap<<bp<<cp << "\n";
    if(no){break;}
    r += (ap)*(N-cp);
    bp++;
  }
  cout << r <<"\n";
}

Measured memory_bytes: 2560
function Main(input) {
	var str = input;
	str = str.split("\n")[0];
    str = str.split(' ');
    s = Number(str[0]);
    w = Number(str[1]);
	if(s<=w){
  		console.log("unsafe");
	}else{
		console.log("safe");
	}
}
 //*おまじない
Main(require("fs").readFileSync("/dev/stdin", "utf8"));


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

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

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

def main():
  n,k=LI()
  l=LI()

  l.sort(reverse=True)

  ans=0
  for x in l:
    if k>0:
      k-=1
    else:
      ans+=x

  return ans

# main()
print(main())


Measured memory_bytes: 28796
#include <iostream>
#include <algorithm>
#include <cmath>
#include <vector>
#include <string>
#include <queue>
#include <utility>
#include <map>
#define ll long long
using namespace std;
using p = pair<ll, ll>;
ll dx[4] = {-1, 0, 1, 0};
ll dy[4] = {0, 1, 0, -1};

int main(){
    ll n, x, y;
    cin >> n >> x >> y;
    vector<vector<ll>> g(n+1);
    for(ll i = 1; i <= n-1; i++){
        g[i].push_back(i+1);
        g[i+1].push_back(i);
    }
    g[x].push_back(y);
    g[y].push_back(x);
    ll dist;
    vector<ll> ans(n+1, 0);
    for(ll i = 1; i <= n-1; i++){
        queue<ll> que;
        vector<ll> dist(n+1, -1);
        que.push(i);
        dist[i] = 0;
        while(!que.empty()){
            ll v = que.front();
            que.pop();
            for(ll nv : g[v]){
                if(dist[nv]!= -1) continue;
                dist[nv] = dist[v]+1;
                que.push(nv);
            }
        }
        for(ll j = i+1; j <= n; j++){
            ll check = dist[j];
            ans[check]++;
        }
    }
    for(ll i = 1; i <= n-1; i++)
        cout << ans[i] << endl;
    return 0;
}


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

bool solve() {
	int n;
	std::cin >> n;
	std::vector<int> a(n);
	int max = 0;
	int min = 1e9;
	for (int i = 0; i < n; i++) {
		scanf("%d", &a[i]);
		max = std::max(max, a[i]);
		min = std::min(min, a[i]);
	}

	if (max - min >= 2) {
		return false;
	}

	if (max == min) {
		return max <= n / 2 || max == n - 1;
	}

	int cnt = std::count(a.begin(), a.end(), min);
	
	return cnt + 1 <= max && max <= cnt + (n - cnt) / 2;
}

int main() {
	puts(solve() ? "Yes" : "No");
}

Measured memory_bytes: 640
import java.util.*;
 
public class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		String S = sc.next();
		int count = 0;

		for(int i=0; i<S.length(); i++){
			String str = String.valueOf(S.charAt(i));
			if(str.equals("0")){
				count++;
			}
		}

		System.out.println(Math.min(count, S.length()-count)*2);
    }
}


Measured memory_bytes: 44160
def main():
  N,P = map(int,input().split())
  S = list(map(int,list(input())))
  S=S[::-1]
  ans = 0
  if P==2:
    l = [0,2,4,6,8]
    for i,s in enumerate(S):
      if s in l:
        ans+=N-i
  elif P==5:
    l=[0,5]
    for i,s in enumerate(S):
      if s in l:
        ans+=N-i

  else:
    l = [0]*P
    a=0
    for i in range(N):
      b = pow(10,i,P)
      b *= S[i]
      b %= P
      a+=b
      a%=P
      l[a]+=1
    ans+=l[0]
    for i in l:
      ans+=i*(i-1)//2

  print(ans)
  
main()

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

using namespace std;
#define int long long
#define pb push_back
int n, q;

long long x[100005], l, y[100005][20];
vector<int> vec;

signed main() {
    cin.tie(0), ios::sync_with_stdio(0);
    cin >> n;
    for(int i = 1; i <= n; i++){
        cin >> x[i];
        vec.pb(x[i]);
    }
    vec.pb(-1);
    sort(vec.begin(), vec.end());
    cin >> l;
    cin >> q;
    for(int i = 1; i <= n; i++){
        int it = upper_bound(vec.begin(), vec.end(), x[i] + l) - vec.begin() - 1;
        y[i][0] = it;
    }
    for(int i = 1; i <= 18; i++){
        for(int j = 1;j <= n; j++)
            y[j][i] = y[y[j][i - 1]][i - 1];
    }
    while(q--){
        int a, b, sum = 0;
        cin >> a >> b;
        if(a == b){
            cout << sum << "\n";
            continue;
        }
        if(b < a)
            swap(a, b);
        for(int i = 18; i >= 0; i--){
            if(y[a][i] < b){
                a = y[a][i];
                sum += (1 << i);
            }
        }
        sum++;
        cout << sum << "\n";
    }
}


Measured memory_bytes: 18164
#include <vector>
#include <algorithm>
#include <iostream>
#include <cassert>
#include <cstdlib>
#include <cmath>
#include <cstring>
#include <cstdio>
#include <ctime>
#include <map>
#include <set>
#include <string>
#include <cassert>

#define INFLL 2000000000000000000
#define INF 2000000000
#define MOD 1000000007
#define PI acos(-1.0)

using namespace std;

typedef pair <int, int> pii;
typedef long long ll;
typedef vector <ll> vll;

int arr[100001];
int n;

int main() {
	//freopen("input.txt", "r", stdin);
	//freopen("output.txt", "w", stdout);
	cin >> n;
	int ans = 0;
	int len = 0;
	for (int i = 0; i < n; i++) {
		cin >> arr[i];
		if (arr[i] == i + 1) 
			len++;
		else {
			ans += (len + 1) / 2;
			len = 0;
		}			
	}
	ans += (len + 1) / 2;
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 640
N, K = map(int, input().split())
p = list(map(int, input().split()))
S = [0]
for i in range(N):
    S.append(S[i] + (p[i]+1)/2)
ans = 0
for i in range(N-K+1):
    tmp = S[i+K] - S[i]
    ans = max(ans, tmp)
print('{:.20f}'.format(ans))


Measured memory_bytes: 25060
package main

import (
	"fmt"
	"math"
)

func FactoredPrimeNumber(num int) map[int]int {
	return factor(num, 2)
}

func merge(m1, m2 map[int]int) map[int]int {
	ans := map[int]int{}
	for k, v := range m1 {
		ans[k] += v
	}
	for k, v := range m2 {
		ans[k] += v
	}
	return ans
}

func factor(num, pnum int) map[int]int {
	result := make(map[int]int)
	if pnum*pnum > num {
		if num != 1 {
			result[num] += 1
		}
		return result
	}

	if num%pnum == 0 {
		num /= pnum
		result[pnum]++
	} else {
		pnum++
	}
	return merge(result, factor(num, pnum))
}

func main() {
	var A, B int
	fmt.Scanf("%d %d\n", &A, &B)
	ar := FactoredPrimeNumber(A)
	br := FactoredPrimeNumber(B)
	for k, v := range br {
		if ar[k] >= v {
			continue
		}
		ar[k] = v
	}
	r := 1
	for k, v := range ar {
		r = r * int(math.Pow(float64(k), float64(v)))
	}
	fmt.Println(r)
}


Measured memory_bytes: 768
#include<bits/stdc++.h>
using namespace std;
const int N=1005;
int n,m,a,b,mp[N][N];
int main()
{
    scanf("%d%d%d%d",&n,&m,&a,&b);
    if(a>m/2||b>n/2)
    {
        printf("-1\n");return 0;
    }
    for(int i=1;i<=n;i++)
        for(int j=1;j<=m;j++)
    {
        if(i<=b)
        {
            if(j<=a) mp[i][j]=1;
            else mp[i][j]=0;
        }
        else
        {
            if(j<=a) mp[i][j]=0;
            else mp[i][j]=1;
        }
    }
    for(int i=1;i<=n;i++)
        for(int j=1;j<=m;j++)
        printf(j==m?"%d\n":"%d",mp[i][j]);
}


Measured memory_bytes: 5120
#include <iostream>
using namespace std;
int main() {
	long long n,k,a[200005],b[200005]={};
	int now=1,j=1;
	cin>>n>>k;
	for (int i=1; i<=n; i++) cin>>a[i];
	int c=0;
	for (long long i=k; i>0; i--) {
		b[now]=j;
		if (b[a[now]]!=0 && c==0) {
			i %= (b[now]-b[a[now]]+1);
          	c=1;
		}
      	if (i!=0) now=a[now];
		j++;
	}
	cout << now << endl;
	return 0;
}


Measured memory_bytes: 6692
/**
 *    author:  Taichicchi
 *    created: 21.09.2020 08:57:17
 **/

#include <bits/stdc++.h>

#include <algorithm>
#include <iostream>
#include <vector>

using namespace std;

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

struct UnionFind {
    vector<int> r;

    UnionFind(int N) { r = vector<int>(N, -1); }

    bool unite(int a, int b) {
        a = find(a);
        b = find(b);
        if (a == b) return false;
        if (r[a] > r[b]) swap(a, b);
        r[a] += r[b];
        r[b] = a;
        return true;
    }

    int find(int a) {
        if (r[a] < 0) return a;
        return r[a] = find(r[a]);
    }

    int size(int a) { return -r[find(a)]; }
};

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

    UnionFind uf(N);

    rep(i, M) {
        int A, B;
        cin >> A >> B;
        A--;
        B--;
        uf.unite(A, B);
    }

    int ans = 0;
    rep(i, N) { ans = max(ans, uf.size(i)); }
    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 4056
#include <bits/stdc++.h>
using namespace std;
using ll=long long;
using vb=vector<bool>;
using vvb=vector<vb>;
using vd=vector<double>;
using vvd=vector<vd>;
using vi=vector<int>;
using vvi=vector<vi>;
using vl=vector<ll>;
using vvl=vector<vl>;
using pll=pair<ll,ll>;
using tll=tuple<ll,ll>;
using vs=vector<string>;
#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define rep(i,n) range(i,0,n)
#define rrep(i,n) for(int i=(n)-1;i>=0;i--)
#define range(i,a,n) for(int i=(a);i<(n);i++)

#define LINF    	((ll)1ll<<60)
#define INF     	((int)1<<30)
#define EPS     	(1e-9)
#define MOD     	(1000000007ll)
#define fcout(a)	cout<<setprecision(a)<<fixed
#define fs 			first
#define sc			second
#define PI			3.1415926535897932384

int dx[]={1,0,-1,0,1,-1,-1,1},dy[]={0,1,0,-1,1,1,-1,-1};
template<class S,class T>ostream&operator<<(ostream&os,pair<S,T>p){os<<"["<<p.first<<", "<<p.second<<"]";return os;};
template<class S>auto&operator<<(ostream&os,vector<S>t){bool a=1; for(auto s:t){os<<(a?"":" ")<<s; a=0;} return os;}
void OUT(bool b){cout<<(b?"YES":"NO")<<endl;}
void Out(bool b){cout<<(b?"Yes":"No")<<endl;}
void out(bool b){cout<<(b?"yes":"no")<<endl;}
int popcnt(int x) { return __builtin_popcount(x); }
int popcnt(ll x) { return __builtin_popcountll(x); }
int clz(int x) { return 31 - __builtin_clz(x); }
int clz(ll x) { return 63 - __builtin_clzll(x); }
int ctz(int x) { return __builtin_ctz(x); }
int ctz(ll x) { return __builtin_ctzll(x); }

class compare {
public:
	bool operator()(tuple<ll, ll> a, tuple<ll, ll> b) {
		return (get<1>(a) > get<1>(b));
	}
};

ll dp[2][100001];

int main(){
	cin.tie(0);
	ios::sync_with_stdio(false);
	ll n,W;
	cin>>n>>W;
	vl w(n),v(n);
	rep(i,2)rep(j,100001)dp[i][j]=LINF;
	dp[0][0]=0;
	rep(i,n){
		cin>>w[i]>>v[i];
	}
	bool pn=false;
	rep(i,n){
		pn=!pn;
		rep(j,100001){
			if(j-v[i]>=0)dp[pn][j]=min(dp[pn][j],dp[!pn][j-v[i]]+w[i]);
			dp[pn][j]=min(dp[pn][j],dp[!pn][j]);
		}
	}
	ll ans=0;
	rep(i,100001)if(dp[pn][i]<=W)ans=i;
	cout<<ans<<endl;
}

Measured memory_bytes: 1792
import scala.annotation.tailrec
import scala.io.StdIn._
object Main extends App {


  solve()
  @tailrec def solve(): Unit = {
    val n = readInt()
    if (n == 0) return
    val vertical = readLine.trim.split(' ').map(_.toInt).filterNot(_ == 0)
    val horizontal = readLine.trim.split(' ').map(_.toInt).filterNot(_ == 0)
    if (vertical.sum != horizontal.sum) {
      println("No")
    }else {
      var v = vertical
      var h = horizontal
      var canMake = true
      while (v.nonEmpty && h.nonEmpty && canMake) {
        val hSize = h.length
        val vSize = v.length
        val vMax = v.count(_ == hSize)
        val hMax = h.count(_ == vSize)
        if ((vMax == 0 && hMax == 0) || h.exists(_ < vMax) || v.exists(_ < hMax)) canMake = false
        else {
          v = v.filterNot(i ⇒ i == hSize || i == hMax).map(_ - hMax)
          h = h.filterNot(i ⇒ i == vSize || i == vMax).map(_ - vMax)
        }
      }
      if (v.nonEmpty || h.nonEmpty || !canMake) {
        println("No")
      }else {
        println("Yes")
      }
    }
    solve()
  }
}


Measured memory_bytes: 568748
N,A,B = [ int(i) for i in input().split() ]
S = input()

passCount = 0
overseaPassCount = 1
for k,v in enumerate(S):
  if v == "c":
    print("No")
  elif v == "b":
    if passCount<A+B and overseaPassCount<=B :
      print("Yes")
      overseaPassCount += 1
      passCount += 1
    else:
      print("No")
  elif v == "a":
    if passCount<A+B :
      print("Yes")
      passCount += 1
    else:
      print("No")

  else :
    None



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

typedef long long ll;
typedef pair<int, int> ii;
const int mod = 1e9+7;
const ll INF = 1e18;
const int inf = 1e9;

void solve()
{
  string s,t; cin>>s>>t;
  map<char, char> mps,mpt;
  for (char c='a'; c<='z'; c++) {
    mps[c] = '0';
    mpt[c] = '0';
  }
  bool flg = true;
  int len = (int)(s.length());
  for (int i=0; i<len; i++) {
    if (mps[s[i]] == '0') {
      mps[s[i]] = t[i];
    }
    if (mpt[t[i]] == '0') {
      mpt[t[i]] = s[i];
    }
    if (mps[s[i]] != t[i] || mpt[t[i]] != s[i]) {
      flg = false;
      break;
    }
  }
  if (flg) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
}

int main()
{
  solve();
  return 0;
}


Measured memory_bytes: 776
#include <stdio.h>
#define N 200000

int main()
{
  int n,min,max,i;
  int r[N];

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

  max = -999999999;
  min = r[0];
  
  for(i = 1;i < n;i++)
    {
      if(max < r[i] - min) max = r[i] - min;
      if(min > r[i]) min = r[i];
    }

  printf("%d\n",max);

  return 0;
}



Measured memory_bytes: 2564
s = input()
n = len(s)
c = 0
for i in range(int((n - 1)/2)):
  if (s[i] != s[n - 1 - i]):
    c = 1
x = int((n - 1)/2)
for i in range(x):
  if (s[i] != s[x - 1 - i]):
    c = 1
if (c == 1):
  print("No")
else:
  print("Yes")
  


Measured memory_bytes: 9044
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int A = sc.nextInt();
		int B = sc.nextInt();
		String[] str = new String[5];
		int len = 0;
		int answerSum = 0;

		for (int i = 1; i <= N; i++) {
			len = String.valueOf(i).length();
			str = String.valueOf(i).split("");
			int digitSum = 0;
			for (int j = 0; j < len; j++) {
				digitSum += Integer.valueOf(str[j]);
			}
			if (A <= digitSum && digitSum <= B) answerSum += i;
		}

		System.out.println(answerSum);
	}
}


Measured memory_bytes: 34512
/*
これを入れて実行
g++ code.cpp
./a.out
 */

#include <iostream>
#include <vector>
#include <string>
#include <queue>
#include <algorithm>
#include <utility>
#include <set>
#include <map>
#include <cmath>
#include <tuple>
#include <iomanip>

using namespace std;
typedef long long ll;
typedef long double ld;

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

const long long INF = 1LL << 60;
const ll MOD = 1e9 + 7;

bool greaterSecond(const pair<int, int>& f, const pair<int, int>& s){
    return f.second > s.second;
}

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

//-----------------------ここから-----------


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

    

    while(1){
        string s = to_string(n);
        if(s[0] == s[1] && s[1] == s[2]){
            cout << n << endl;
            return 0;
        }

        n++;
    }
}



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

#define int long long
typedef long long ll;
using namespace std;
const int N = 2e5 + 10;
int n, a[N], b[N];

int32_t main() {
    ios::sync_with_stdio(0), cin.tie(0);
    cin >> n;
    for (int i = 1; i <= n; i++)cin >> a[i];
    for (int i = 1; i <= n; i++)a[i] *= 2;
    int ans = 0;
    for (int i = 1; i <= n; i++) {
        if (i & 1)ans += a[i];
        else ans -= a[i];
    }
    b[1] = ans / 2;
    for (int i = 2; i <= n; i++) {
        b[i] = a[i - 1] - b[i - 1];
    }
    for (int i = 1; i <= n; i++)cout << b[i] << " ";
    cout << endl;
}

Measured memory_bytes: 2944
import sys

def solve():
    input = sys.stdin.readline
    H, W = map(int, input().split())
    A = [[int(a) for a in input().split()] for _ in range(H)]
    Ans = []
    for h in range(H):
        for w in range(W):
            if A[h][w] % 2 == 1:
                if w < W - 1:
                    A[h][w] -= 1
                    A[h][w+1] += 1
                    Ans.append((h+1, w+1, h+1, w+2))
                else:
                    if h < H - 1:
                        A[h][w] -= 1
                        A[h+1][w] += 1
                        Ans.append((h+1, w+1, h+2, w+1))
    count = len(Ans)
    print(count)
    for i in range(count):
        print(*Ans[i], sep=" ")
    

    return 0

if __name__ == "__main__":
    solve()

Measured memory_bytes: 26532
#pragma GCC optimize("O3")
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define re register
#define pb push_back
#define fi first
#define se second
const int N=1e6+10;
const int mod7=1e9+7;
const int mod=998244353;
void read(int &a)
{
    a=0;int d=1;char ch;
    while(ch=getchar(),ch>'9'||ch<'0')
        if(ch=='-')
            d=-1;
    a=ch^48;
    while(ch=getchar(),ch>='0'&&ch<='9')
        a=(a<<3)+(a<<1)+(ch^48);
    a*=d;
}
void read(ll &a)
{
    a=0;int d=1;char ch;
    while(ch=getchar(),ch>'9'||ch<'0')
        if(ch=='-')
            d=-1;
    a=ch^48;
    while(ch=getchar(),ch>='0'&&ch<='9')
        a=(a<<3)+(a<<1)+(ch^48);
    a*=d;
}
ll a[N];
map <ll,ll> vis;
int main()
{
    int n;read(n);
    for(re ll i=1;i<=n;i++) read(a[i]);
    for(re ll i=1;i<=n;i++) vis[i+a[i]]++;
    ll ans=0;
    for(re ll i=1;i<=n;i++)
    {
        ans+=vis[i-a[i]];
        if(i-a[i]==i+a[i]) ans--;
    }
    cout<<ans<<endl;
    return 0;
}

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

int main(){
    ll n;
    cin >> n;
    ll sqn = sqrt(n);
    ll x = 1;

    for(ll i=1;i<=sqn;i++){
        if(n%i == 0){
            x = i;
        }
    }
    ll ans = x + n/x -2; 
    cout <<  ans << endl; 
    return 0;
}

Measured memory_bytes: 256
// #pragma GCC optimize("Ofast")
// #pragma GCC optimize ("unroll-loops")
// #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
 
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
 
using namespace __gnu_pbds;
using namespace std;
#define gcd(a,b) __gcd(a,b)
#define ll long long int
#define ld double
#define pi pair<ll,ll>
#define pb push_back
#define pf push_front
#define pu push
#define po pop
#define fi first
#define se second
#define mk make_pair
#define ve vector
#define lr(n) for(ll i=0;i<n;i++)
#define all(x) x.begin(),x.end()
#define be begin
#define sz(a) (ll)a.size()
#define INF 1e18
 
typedef tree <ll, null_type, less <ll>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;
// order_of_key(val): returns the number of values less than val
// find_by_order(k): returns an iterator to the kth largest element (0-based)
 
ll mod=1e9+7;
// ll gcd(ll a, ll b){
//     if(a<b) swap(a,b);
//     if(b==0) return a;
//     return gcd(b,a%b);
// }
 
// ll fun(ll x, ll y){
//     ll rem=1;
//     while(y!=0){
//         if(y%2==1){
//             rem=(rem*x)%mod;
//         }
//         x=(x*x)%mod;
//         y/=2;
//     }
//     return rem;
// }

ll n;
ll ar[3001]={0};
ll dp[3001][3001];
void fun(ll i,ll j){
	if(dp[i][j]!=-1) return;
	if(i==j){
		dp[i][j]=ar[j]-ar[i-1];
		return;
	}
	fun(i,j-1);
	fun(i+1,j);
	dp[i][j]=max(-ar[i-1]+ar[j]-dp[i+1][j], ar[j]-ar[i-1]-dp[i][j-1]);
}

int main(){
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
	cin>>n;
	lr(n){
		ll x;
		cin>>x;
		ar[i+1]=ar[i]+x;
	}
	for(ll i=0;i<=n;i++) for(ll j=0;j<=n;j++) dp[i][j]=-1;
	fun(1,n);
	cout << 2*dp[1][n]-ar[n]+ar[0] << "\n";
	return 0;
}

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

int main(){
  int n,m,q;
  cin >> n >> m >> q;
  int station[501][501];
  for(int i=0;i<501;i++) for(int j=0;j<501;j++) station[i][j] = 0;
  for(int i=0;i<m;i++){
    int l,r;
    cin >> l >> r;
    station[l][r] ++;
  }
  for(int j=1;j<=n;j++) for(int i=n-1;i>=1;i--) station[i][j] += station[i+1][j];
  for(int j=1;j<=n;j++) for(int i=1;i<=n;i++) station[j][i] += station[j][i-1];

  for(int i=0;i<q;i++){
    int p,q;
    cin >> p >> q;
    cout << station[p][q] << endl;
  }
  return 0;
}


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

int main(){
  long long int X;
  cin>>X;
  
  long long int num=100;
  int ans=0;
  for(int i=0;i<3800;i++){
    num=num*1.01;
    
    if(X<=num){
      ans=i+1;
      break;
    }
  }
    cout<<ans<<endl;


}

Measured memory_bytes: 3624
/* ABC144_B
    Stuartyg */

#include <stdio.h>
#include <string.h>
#include <math.h>
#include <stdbool.h>


int main(void){
    int num;
    int i,j; 
    scanf("%d",&num); /*入力を受け取る*/
    for (i=1;i<=9;i++){ /* for文二個で1*1～9*9まで調べる*/
        for (j=1;j<=9;j++){
            if (num==i*j){
                printf("Yes\n");
                return 0;
            }
        }
    }

    printf("No\n");
    return 0;
}


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

int main() {
  int a, b;
  cin >> a >> b;
  if(a > b){
    cout << "a > b" << endl;
  } else if(a == b){
    cout << "a == b" << endl;
  } else {
    cout << "a < b" << endl;
  }
}


Measured memory_bytes: 3132
#include <bits/stdc++.h>
#define ll long long
#define rep(X,N) for(ll X = 0; X < (N); X++)
#define PI (acos(-1.0))
#define pback push_back
#define mpair make_pair
#define MODN 1000000007
#define ALL(V) (V).begin(),(V).end()

using namespace std;

int main(){

    int n;
    cin >> n;

    vector<ll> a(1);

    rep(i,n){
        int tmp;
        cin >> tmp;

        a.pback(tmp);
    }

    vector<ll> pseudom(2);//m1を0と仮定

    for(int i = 2; i <= n + 1; i++){
        ll tmpm = a[i - 1] * 2 - pseudom[i - 1];

        pseudom.pback(tmpm);

    }

    //ここでm[n + 1]はm[1]と同値のはずだが0と仮定した分だけずれているので

    vector<ll> m;

    m.pback(pseudom[n + 1] / 2);

    for(int i = 1; i <= n; i++){
        ll tmpm = a[i] * 2 - m[i - 1];
        m.pback(tmpm);
    }

    if(true){
        rep(i,n + 1){
            cerr << pseudom[i + 1] << " ";
        }
    }

    rep(i,n){
        cout << m[i] << " ";
    }
    cout << endl;




    return 0;
}


Measured memory_bytes: 3828
import java.util.Scanner;

public class Main {
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        while(true){
            int H = sc.nextInt();
            int W = sc.nextInt();
            if(H==0 && W==0){
                break;
            }
                for(int i=0;i<H;i++){
                    for(int j=0;j<W;j++){
                        if(i%2==0){
                            if(j%2==0){
                                System.out.printf("#");
                            }else if(j%2==1){
                                System.out.printf(".");
                            }
                        }else if(i%2==1){
                            if(j%2==0){
                                System.out.printf(".");
                            }else if(j%2==1){
                                System.out.printf("#");                            }
                        }
                    }
                    System.out.println();
                    }
                    System.out.println();
            }
            sc.close();
        }
        
    }



Measured memory_bytes: 59240
#include<iostream>
using namespace std;
#define ll long long

void solve()
{
	int n;cin>>n;
	int arr[n];
	int cnt=1;
	for(int i=0;i<n;i++)
	cin>>arr[i];
	int min=arr[0];
	for(int i=1;i<n;i++)
	{
		if(arr[i]<min){
		++cnt;
		min=arr[i];
		}
	}
	cout<<cnt;
	
}
int main()
{
	solve();
}


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

using namespace std;

const int OO = 1e9;
const double EPS = 1e-9;

#define ndl cout << '\n'
#define sz(v) int(v.size())
#define pb push_back
#define mp make_pair
#define fs first
#define sc second
#define present(a, x) (a.find(x) != a.end())
#ifdef LOCAL
#define db(...) ({cout << "> Line " << __LINE__  \
		<< ": "; _db(#__VA_ARGS__, __VA_ARGS__);})
#define RNG() rng()
#else
#define db(...) true
#define RNG() true
#endif

template<class T>
void _db(const char *dbStr, T e) {
	cout << dbStr << " = " << e << endl;
}
template<class T, class... L>
void _db(const char *dbStr, T e, L... r) {
  while(*dbStr != ',') cout << *dbStr++;
  cout << " = " << e << ','; _db(dbStr + 1, r...);
}
template<class S, class T>
ostream& operator<<(ostream& o, const map<S, T>& v) {
	o << "["; int i = 0;
	for (const pair<S, T>& pr : v) o << (!i++ ? "" : ", ") << "{"
	<< pr.fs << " : " << pr.sc << "}"; return o << "]";
}
template<template <class, class...> class S, class T, class... L>
ostream& operator<<(ostream& o, const S<T, L...>& v) {
	o << "["; int i = 0;
	for (const auto& e : v) o << (!i++ ? "" : ", ") << e;
	return o << "]";
}
template<class S, class T>
ostream& operator<<(ostream& o, const pair<S, T>& pr) {
	return o << "(" << pr.fs << ", " << pr.sc << ")";
}
ostream& operator<<(ostream& o, const string& s) {
	for (const char& c : s) o << c;
	return o;
}

template<class T> using V = vector<T>;
template<class T> using VV = V<V<T>>;
template<class T> using VVV = VV<V<T>>;
using ll = long long;
using pii = pair<int, int>;
using vi = V<int>;
using vii = V<pii>;
using vvi = VV<int>;
using mii = map<int, int>;
using umii = unordered_map<int, int>;
using si = set<int>;
using usi = unordered_set<int>;





int main() {
	#ifdef LOCAL
	auto stTime = clock();
//	freopen("in.txt", "r", stdin);
	mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());
	#endif
	ios::sync_with_stdio(false);
	cout.precision(10);
	cin.tie(0);

	ll a, b, c;

	cin >> a >> b >> c;

	if (c - a - b <= 0)
		cout << "No\n";
	else {
		cout << (4ULL * a * b < (c - a - b) * (c - a - b) ? "Yes\n" : "No\n");
	}


	#ifdef LOCAL
	cout << "\n\n\nExecution time: " <<
		(clock() - stTime) * 1e3 / CLOCKS_PER_SEC << " ms" << endl;
	#endif
    return 0;
}


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

//using Graph = vector<vector<int>>;

int main()
{
    int N, M;
    cin >> N >> M;
    //    Graph g(2);
    bool start[N] = {false}, goal[N] = {false};
    for (int i = 0; i < M; i++)
    {
        int a, b;
        cin >> a >> b;
        if (a == 1)
        {
            start[b - 1] = true;
        }
        else if (b == N)
        {
            goal[a - 1] = true;
        }
    }
    for (int i = 0; i < N; i++)
    {
        if (start[i] && goal[i])
        {
            cout << "POSSIBLE" << endl;
            return 0;
        }
    }
    cout << "IMPOSSIBLE" << endl;
    /*   for (auto x : g[0])
    {
        for (auto y : g[1])
        {
            if (x == y)
            {
                cout << "POSSIBLE" << endl;
                return 0;
            }
        }
    }
    cout << "IMPOSSIBLE" << endl;*/
}

Measured memory_bytes: 640
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define tr(container, it) \
	for (auto it = container.begin(); it != container.end(); it++)
#define scontains(c,x) ((c).find(x) != (c).end())   //O(log n) 
#define contains(c,x) (find((c).begin(),(c).end(),x) != (c).end()) //O(n)
#define Ichar(_x) char _x;scanf("%c",&_x);
#define Iint(_x) int _x;scanf("%d",&_x); 
#define Ill(_x)  ll _x;scanf("%lld",&_x);
#define inc(a,b,x)(x)>a && (x)<b	
#define incE(a,b,x)(x)>=a && (x)<=b	
//freopen("input.txt", "r", stdin);freopen("output.txt", "w", stdout);

int arr[26];
char carr[26];
char carr0[26];
int main(int argc, char* argv[])
{
	string s;
	std::cin >> s;
	int i = 0,j;
	for (char c : s)
	{
		arr[c - 'a']++;  carr0[i] = c; carr[i++] = c;
	}
	if(s.size()<26)
	{
		
		for (int i = 0; i < 26; ++i)
		{
			if (arr[i] == 0) {
				std::cout << s + char(i + 'a');
				return 0;
			}
		}
	}
	else
	{
		if(next_permutation(carr, carr + 26))
		{
			for (int i = 0; i < 26; ++i)
			{
				if (carr[i] == carr0[i])std::cout << carr0[i];
				else { j = i; break;}
			}
			std::cout << carr[j];
		}
		else { std::cout << "-1"; }
		
	}

	
	
}



Measured memory_bytes: 256
#include "bits/stdc++.h"
#include <math.h>
#include <time.h>
using namespace std;
const long long mod = 1000000007;
#define dump(x)                             \
    if (dbg) {                              \
        cout << #x << " = " << (x) << endl; \
    }
bool dbg = false;
long long gcd(long long a, long long b){
   if (a % b == 0)
   {
       return(b);
   }
   else
   {
       return(gcd(b, a % b));
   }
}
long long lcm(long long a, long long b){
   return (a / gcd(a, b))* b;
}
//---------------------------------------------------------------------------------------------------
/*ここからいじる*/
//---------------------------------------------------------------------------------------------------

void solve(){
}
int main(){
    int n;
    cin >> n;
    vector<int>wn(n);
    int sum = 0;
    for(int i = 0; i < n; i++){
        cin >> wn.at(i);
        sum += wn.at(i);
    }
    int s1, s2, tmp_min;
    s1 = 0;
    s2 = sum;
    tmp_min = abs(s1 - s2);
    for(int i = 0; i < n; i++){
        s1 += wn.at(i);
        s2 -= wn.at(i);
        tmp_min = min(tmp_min, abs(s1 - s2));
    }
    cout << tmp_min << endl;
    
    return 0;
}



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

using namespace std;

typedef long long int ll;

bool fun(ll n , ll k)
{
    while(n>0)
    {
        if(n%k == 0)
            n/=k;
        else
            n-=k;

        if(n==1)
        return 1;
    }
    return 0;
}

bool check(ll n,  ll k)
{
    while(n%k==0)
    {
        n/=k;
    }
    if(n%k==1)
        return 1;
    else
        return 0;
}

bool isprime(ll n)
{
    for(int i=2 ; i<=sqrt(n) ; i++)
    {
        if(n%i==0)
            return 0;
    }
    return 1;
}
int main()
{
    ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);

    ll n;
    cin >> n;

    if(n==2)
        cout << 1 << "\n";
    else
    {
        n--;
        ll cc=0;
    /* for(int i=2 ; i<=(n+1) ; i++)
     {
         if(fun(n+1,i))
            cout << i << " ";
     }
     cout << endl;*/

     unordered_map<ll,ll> mp;
        for(int i=2 ; i<=sqrt(n) ; i++)
        {
            if(n%i == 0)
            {
                cc++;
                if(n/i != i)
                 {
                   cc++;
                  // cout << i << " " << n/i << endl;
                   mp[n/i]=1;
                 }
                 mp[i]=1;
            }
        }

        //cout << endl;

         for(int i=2 ; i<=sqrt(n+1) ; i++)
        {
            if((n+1)%i == 0)
            {

              if(check(n+1,i) && mp.find(i) == mp.end())
                cc++;
                // cout << i << " " << (n+1)/i << endl;
            }
        }
        //cout << endl;
        cout << cc+2;
    }
    return 0;
}


Measured memory_bytes: 256