akhauriyash/Code-Regression huggingface dataset:
#include "bits/stdc++.h"
#include <iostream>
#include <string.h>
#include <stdio.h>
#include <map>
#include <vector>
#include <math.h>
#include <algorithm>
#include <queue>
#include <set>
#include <tuple>
using namespace std;

#define FOR(i,init,a) for(int i=init; i<a; i++)
#define rep(i,a) FOR(i,0,a)
#define rrep(i,a) for(int i=a; i>=0; i--)
#define rep1(i,a) for(int i=1; i<=a; i++)
#define cout1(a) cout << a << endl;
#define cout2(a,b) cout << a << " " << b << endl;
#define cout3(a,b,c) cout << a << " " << b << " " << c << endl;
#define cout4(a,b,c,d) cout << a << " " << b << " " << c << " " << d << endl;
#define mem(a,n) memset( a, n, sizeof(a))
#define all(a) a.begin(),a.end()
#define chmin(a,b) a=min(a,b);
#define chmax(a,b) a=max(a,b);

typedef long long ll;
typedef long double ld;
typedef pair<int,int> pii;
typedef vector<int> V;
typedef vector<V> VV;
typedef vector<VV> VVV;
const int INF = 1e9;
const int MOD = 1e9+7;
const ll LLINF = 1e18;
static const double pi = 3.141592653589793;

ll nums[100009];

void no(){
    cout1(-1)
    exit(0);
}

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    
    int N;
    cin>>N;
    
    rep(i,N) cin>>nums[i];
    reverse(nums,nums+N);
    ll mn=2,mx=2;
    
    rep(i,N){
        ll x=nums[i];
        ll n=(ll)ceil(1.*mn/x)*x;
        if(!(n>=mn&&n<=mx)) no();
        mn=n,mx=(ll)(mx/x+1)*x-1;
    }
    cout2(mn,mx)
}

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

int64_t max(int64_t x,int64_t y){
  if(x>y)return x;
  else{
    return y;
  }
  
}

int main(){
  int64_t a,b,c,d;
  cin>>a>>b>>c>>d;
  if((a<=0&&0<=b)||(c<=0&&0<=d)){
  cout<<max(0,max(a*c,max(a*d,max(b*c,b*d))))<<endl;
  }
  else{
  cout<<max(a*c,max(a*d,max(b*c,b*d)));
}
}
  

Measured memory_bytes: 3624
import sys
input = sys.stdin.buffer.readline

#sys.setrecursionlimit(10**9)
#from functools import lru_cache

def RD(): return input().rstrip().decode()
def II(): return int(input())
def FI(): return int(input())
def MI(): return map(int,input().split())
def MF(): return map(float,input().split())
def LI(): return list(map(int,input().split()))
def LF(): return list(map(float,input().split()))
def TI(): return tuple(map(int,input().split()))
# rstrip().decode()



def main():
	n=II()
	A=LI()


	A.sort()

	a=A[0]
	b=A[-1]

	ans="No"

	if b-a==0:
		if n==a+1 or n>=a*2:
			ans="Yes"

	elif b-a==1:
		aa=A.count(a)
		if a>=aa and 2*a-aa+2<=n:
			ans="Yes"




	print(ans)




















if __name__ == "__main__":
	main()


Measured memory_bytes: 19152
def gcd(a, b):
  while b:
    a, b = b, a % b
  return a

A, B, C, D = map(int, input().split())
L = C * D // gcd(C, D)
c = B // C - (A - 1) // C
d = B // D - (A - 1) // D
l = B // L - (A - 1) // L

print(B - A + 1 - c - d + l)

Measured memory_bytes: 3060
#include <bits/stdc++.h>
using namespace std;
#define _GLIBCXX_DEBUG
#define rep(i, n) for (int64_t i = 0; i < (int64_t)(n); i++)
using vi = vector<int64_t>;
using vvi = vector<vi>;
using ll = int64_t;
using P = pair<ll,ll>;
ll INF = 1000000007;
// ll INF = 9223372036854775807;
// ll INF = 998244353;


int main() {
    // fasten cin
    cin.tie(0);
    ios::sync_with_stdio(false);
    // implement
    ll n;
    cin >> n;
    vi a(n);
    rep(i,n) cin >> a.at(i);
    // 奇数の数が奇数個だとだめ, それ以外はOK
    ll odd = 0;
    rep(i,n) if(a.at(i)%2==1) odd++;
    string res = "YES";
    if(odd%2==1) res = "NO";
    cout << res << endl;
}

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

int main(){
  ll h,w;
  cin >> h >> w;
  if(h == 1 || w == 1) cout << 1 << endl;
  else if(h*w % 2 == 0) cout << h*w/2 << endl;
  else cout << (h*w+1)/2 << endl; 
  return 0;
}


Measured memory_bytes: 256
#include <algorithm>
#include <cassert>
#include <climits>
#include <cmath>
#include <iostream>
#include <map>
#include <queue>
#include <string>
#include <vector>

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef vector<int> VI;
typedef vector<ll> VL;
typedef pair<int, int> ipair;
typedef tuple<int, int, int> ituple;

const int INF = INT_MAX;
// const ll INF = LLONG_MAX;
// const int MOD = ((int)1e9 + 7);
// const ld EPS = (1e-10);
#define PI acosl(-1)
#define MAX_N (100000 + 2)
VI e[MAX_N];
int n, m;
int dp[MAX_N];

int rec(int node){
  if (dp[node] != INF){
    return dp[node];
  }

  int ans = 0;
  for (int i = 0; i < e[node].size(); i++){
    ans = max(ans, rec(e[node][i]) + 1);
  }
  dp[node] = ans;
  // printf("rec(%d) = %d\n", node, dp[node]);

  return dp[node];
}

void exec(){
  int x, y;
  cin >> n >> m;

  for (int i = 0; i < n; i++){
    dp[i] = INF;
  }

  for (int i = 0; i < m; i++){
    cin >> x >> y;
    x--;
    y--;
    e[y].push_back(x);
  }

  int ans = 0;
  for (int i = 0; i < n; i++){
    ans = max(ans, rec(i));
  }

  cout << ans << endl;

}

void solve(){
  int t = 1;
  // scanf("%d", &t);
  for (int i = 0; i < t; i++){
    exec();
  }
}

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


Measured memory_bytes: 10624
#include <bits/stdc++.h>
#include <math.h>
#include <cmath>

using namespace std;
using ll =long long;
using vi = vector<int>; 
using vvi = vector<vi>; 
using vl = vector<ll>; 
using vvl = vector<vl>; 
using vs = vector<string>;
using vvs = vector<vs>; 
using vc = vector<char>;
using vvc = vector<vc>; 
using vb = vector<bool>;
using vvb = vector<vb>; 
const int INF =100100100;
#define rep(i,n) ;for( int i =0; i < n ; i ++)
#define all(a) a.begin(),a.end()
#define pb(a) push_back(a)
#define pd(a) printf("%.10f\n",a)
#define mem(a) memset(a,0,sizeof(a))
#define f(i,a,b) for(int i=a;i<b;i++)
#define pri(a)  printf("%.14lf\n",a);
#define sz(a) ((int)a.size())
#define MOD 1000000007
bool is_int_lround(double x){
  return std::lround(x)==x;
}

ll keta(ll x){
  ll n=0;
  while(x>0){
    x /=10 ;
    n ++;
  }
  return n;
}

ll conbi(int n,int m){
  
  cin>>n>>m;
  vector<ll> a(100);
  a[0] =1;
  for(int i=0;i<14;i++){
    a[i+1]=a[i]*(i+1);
  }
  return a[n] /(a[m] *a[n-m]);
}

long long modpow(long long a, long long n, long long mod) {
    long long res = 1;//繰り返し二乗法
    while (n > 0) {
        if (n & 1) res = res * a % mod;
        a = a * a % mod;
        n >>= 1;
    }
    return res;
}
ll kaijoMOD(ll x){
  ll z=1;
  if(x==0){
    return 1;
  }
  while(x>0){
    z *=x;
    z %=MOD;
    x--;
  }
  return z;
}
ll div_num(ll n){
  vl div(n+1,1);
  for(ll i=2;i*i<=n;i++){ 
    while(n%i==0){
      n /=i;
      div[i]++;
    }
  }
  if(n!=1)div[n]++;
  ll num=1;
  for(ll i=0;i<=n;i++){
    num*=div[i];
  }
  return num;
}
vector<ll> divisor(ll n) {
  vector<ll> ret;
  for(ll i = 1; i * i <= n; i++) {
    if(n % i == 0) {
      ret.push_back(i);
      if(i * i != n) ret.push_back(n / i);
    }
  }
  sort(begin(ret), end(ret));
  return (ret);
}

int keta_wa(int x){
  int tot=0;
  while(x>0){
    tot +=x%10;
    x/=10;
  }
  return tot;
}
long long lopow(ll a, long long n) {
    long long res = 1;
    while (n > 0) {
        if (n & 1) res = res * a ;
        a = a * a ;
        n >>= 1;
    }
    return res;
}

        
//vc alp ={'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'};
//vc Alp ={'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'};
//cout<<""<<endl;
void dfs(ll d , ll v, vl &A){
  if(d==11)return;
  A.pb(v);
  ll add=v%10;
  for(ll i=-1;i<=1;i++){
    if(add+i>=0 &&add+i<=9){
      dfs(d+1,v*10+add+i, A);
    }
  }
}
int main(){
ll K;cin>>K;
  vl ans;
  for(int j=1;j<=9;j++){
    dfs(1,j,ans);
  }
  sort(all(ans));
  cout<<ans[K-1]<<endl;
  
}


Measured memory_bytes: 5440
//inlclude前用define 
#define _USE_MATH_DEFINES

//include
#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<cmath>
#include<type_traits>
#include<numeric>
//#include<deque>
#include<iomanip>
#include<set>
#include<tuple>
#include<map>
#include<limits>

using namespace std;

//typedef
typedef vector<int> VI;
typedef vector<string> VS;
typedef vector<char> VC;
typedef long long int ll;

//define
#define INF 1e9 
#define NUM 1000000007
#define all(x) begin(x), end(x)
#define rep(i,n) for(int i=0;i<(int)(n);i++)

int main(){
 int n,m;
 cin>>n>>m;
 VI s(m);
 VC c(m);
 rep(i,m){
   cin>>s[i]>>c[i];
 }
 int lim=pow(10,n);
 int min=pow(10,n-1)-1;
 string st;
 bool flag;
 for(int i=min;i<lim;i++){
   st=to_string(i);
   flag=true;
   //cout<<st<<endl;
   rep(j,m){
     if(st[s[j]-1]!=c[j]) flag=false;
   }
   if(flag && n==st.length()){
     cout<<st<<endl;
     return 0;
   }
 }
 cout<<-1<<endl;
}


Measured memory_bytes: 256
#!/usr/bin/python3
# Copyright (C) 2017 Sayutin Dmitry.
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; version 3
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; If not, see <http://www.gnu.org/licenses/>.

def main():
    s = input().strip()
    print(s[0:-len("FESTIVAL")])

main()


Measured memory_bytes: 2940
#include<stdio.h>
int main()
{
    long long a,b,c;
    scanf("%lld %lld %lld",&a,&b,&c);
    if((a+b<=a+c)&&(b+c>=a+b) )
    {
        printf("%lld",a+b);
    }
    else if((a+c<=a+b)&&(a+c<=b+c) )
    {
        printf("%lld",a+c);
    }
    else if((b+c<=a+b)&&(a+c>=b+c))
    {
        printf("%lld",b+c);
    }
    return 0;
}

Measured memory_bytes: 128
#include<bits/stdc++.h>
using namespace std;
int main(){
  int a;
  cin >> a;
  vector<pair<pair<string,int>,int>> A(a);
  for(int i=0;i<a;i++){
    
    cin >> A.at(i).first.first >> A.at(i).first.second;
    A.at(i).first.second *= -1;
    A.at(i).second = i+1;
  }
  sort(A.begin(),A.end());
  for(int i=0;i<a;i++){
    cout << A.at(i).second << endl;
  }
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <map>
#include <cstring>
#include <climits>
using namespace std;

typedef long long ll;

class Edge{
public:
  ll to, cap, rev;
  Edge(){}
  Edge(ll to, ll cap, ll rev) :
    to(to), cap(cap), rev(rev) {}
};

vector<Edge> G[1000];
bool used[1000];

void add_edge(ll from, ll to, ll cap){
  G[from].push_back(Edge(to, cap, G[to].size()));
  G[to].push_back(Edge(from, 0, G[from].size() - 1));
}

ll dfs(ll v, ll t, ll f){
  if(v == t) return f;
  used[v] = true;

  for(ll i = 0; i < G[v].size(); i++){
    Edge &e = G[v][i];
    if(!used[e.to] && e.cap > 0){
      ll d = dfs(e.to, t, min(f, e.cap));
      if(d > 0){
        e.cap -= d;
        G[e.to][e.rev].cap += d;
        return d;
      }
    }
  }

  return 0;
}

ll max_flow(ll s, ll t){
  ll flow = 0;

  while(true){
    memset(used, 0, sizeof(used));
    ll f = dfs(s, t, LONG_LONG_MAX);
    if(f == 0) return flow;
    flow += f;
  }
}

int main(){
  ll n, w;
  map<string,int> week;

  week["Sunday"] = 0;
  week["Monday"] = 1;
  week["Tuesday"] = 2;
  week["Wednesday"] = 3;
  week["Thursday"] = 4;
  week["Friday"] = 5;
  week["Saturday"] = 6;

  while(cin >> n >> w, n || w){
    for(ll i = 0; i < 1000; i++){
      G[i].clear();
    }

    for(ll i = 0; i < 7; i++){
      add_edge(0, i + 1, w);
    }

    ll sum = 0;

    for(ll i = 0; i < n; i++){
      ll tn, cn;
      cin >> tn >> cn;
      add_edge(i + 8, n + 8, tn);
      sum += tn;

      for(ll j = 0; j < cn; j++){
        string s;
        cin >> s;
        ll from = week[s] + 1;
        add_edge(from, i + 8, w);
      }
    }

    ll flow = max_flow(0, n + 8);

    if(flow == sum){
      cout << "Yes" << endl;
    }
    else{
      cout << "No" << endl;
    }
  }
}

Measured memory_bytes: 1356
#include <algorithm>
#include <bitset>
#include <cassert>
#include <cctype>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstring>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <string>
#include <tuple>
#include <vector>
#define rep(i, n) for (int i = 0; i < (int)(n); ++i)
//#define cerr if(false) cerr
#ifdef DEBUG
#define show(...) cerr << #__VA_ARGS__ << " = ", debug(__VA_ARGS__);
#else
#define show(...) 42
#endif
using namespace std;
using ll = long long;
using pii = pair<int, int>;
template <typename T, typename S>
ostream& operator<<(ostream& os, pair<T, S> a) {
    os << '(' << a.first << ',' << a.second << ')';
    return os;
}
template <typename T>
ostream& operator<<(ostream& os, vector<T> v) {
    for (auto x : v) os << x << ' ';
    return os;
}
void debug() {
    cerr << '\n';
}
template <typename H, typename... T>
void debug(H a, T... b) {
    cerr << a;
    if (sizeof...(b)) cerr << ", ";
    debug(b...);
}
int main(){
    ll a, v;
    ll b, w;
    ll t;
    cin >> a >> v;
    cin >> b >> w;
    cin >> t;
    bool flag = false;
    if(v > w and (v - w) * t >= abs(a - b)){
        flag = true;
    }
    if(!flag){
        cout << "NO" << endl;
    }else{
        cout << "YES" << endl;
    }
}


Measured memory_bytes: 3632
#include <stdio.h>

int main(){
	
	int n, m;
	scanf("%d %d", &n, &m);
	int total = n+m;
	int e = 1, o = 1;
	
	for(int i = 2 ; i < n ; i++){
		e+=i;
	}
	for(int i = 2 ; i < m ; i++){
		o+=i;
	}
	
	if(n == 1 || n == 0){
		e = 0;
	}
	if(m == 1 || m == 0){
		o = 0;
	}
	
	printf("%d", e + o);
	
	return 0;
}

Measured memory_bytes: 1732
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, tan, asin, acos, atan, radians, degrees, log2
from itertools import accumulate, permutations, combinations, combinations_with_replacement, product, groupby
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left, insort, insort_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10**9 + 7
#from decimal import *
 
N = INT()


if N%2 or N == 0:
	print(0)
else:
	ans = 0
	for i in range(1, int(log2(N)/log2(5))+1):
		ans += N //(5**i*2)
	print(ans)


Measured memory_bytes: 5716
#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() {
  ll x;
  cin >> x;
  ll m = 100;
  // int i = 0;
  for (ll i = 0; 1; i++) {
    m *= 1.01;
    if (m >= x) {
      cout << i + 1 << endl;
      break;
    }
  }

  return 0;
}

Measured memory_bytes: 3636
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
    ($($r:tt)*) => {
        let s = {
            use std::io::Read;
            let mut s = String::new();
            std::io::stdin().read_to_string(&mut s).unwrap();
            s
        };
        let mut iter = s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
}

macro_rules! input_inner {
    ($iter:expr) => {};
    ($iter:expr, ) => {};

    ($iter:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($iter, $t);
        input_inner!{$iter $($r)*}
    };
}

macro_rules! read_value {
    ($iter:expr, ( $($t:tt),* )) => {
        ( $(read_value!($iter, $t)),* )
    };

    ($iter:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($iter, $t)).collect::<Vec<_>>()
    };

    ($iter:expr, chars) => {
        read_value!($iter, String).chars().collect::<Vec<char>>()
    };

    ($iter:expr, usize1) => {
        read_value!($iter, usize) - 1
    };

    ($iter:expr, $t:ty) => {
        $iter.next().unwrap().parse::<$t>().expect("Parse error")
    };
}

#[allow(unused_imports)]
use std::{i32, i64, u32, u64, usize, f64};
#[allow(unused_imports)]
use std::cmp::{max, min, Ordering};
#[allow(unused_imports)]
use std::collections::{VecDeque, HashMap, BTreeMap, HashSet, BTreeSet};
#[allow(unused_imports)]
use std::io::{stdout, Write, BufWriter};
#[allow(unused_imports)]
use std::mem::{swap};

fn main() {
    input!{
        n: usize,
        m: usize,
        ss: [(i32, i32); n],
        ps: [(i32, i32); m],
    }
    let out = stdout();
    let mut out = BufWriter::new(out.lock());

    for (sx, sy) in ss {
        let mut min = i32::MAX;
        let mut ans = 0usize;
        for (i, &(px, py)) in ps.iter().enumerate() {
            let mdist = (sx - px).abs() + (sy - py).abs();
            if mdist < min {
                min = mdist;
                ans = i + 1;
            }
        }
        writeln!(out, "{}", ans).unwrap();
    }
}


Measured memory_bytes: 4352
#line 2 "header.hpp"

//%snippet.set('header')%
//%snippet.fold()%
#ifndef HEADER_H
#define HEADER_H

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

// varibable settings
const long long INF = 1e18;
template <class T> constexpr T inf = numeric_limits<T>::max() / 2.1;

#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 _rrep(i, n) rrepi(i, 0, n)
#define rrepi(i, a, b) for (ll i = (ll)((b)-1); i >= (ll)(a); --i)
#define r_rep(...) _overload3(__VA_ARGS__, rrepi, _rrep, )(__VA_ARGS__)
#define each(i, a) for (auto &&i : a)
#define all(x) (x).begin(), (x).end()
#define sz(x) ((int)(x).size())
#define pb(a) push_back(a)
#define mp(a, b) make_pair(a, b)
#define mt(...) make_tuple(__VA_ARGS__)
#define ub upper_bound
#define lb lower_bound
#define lpos(A, x) (lower_bound(all(A), x) - A.begin())
#define upos(A, x) (upper_bound(all(A), x) - A.begin())
template <class T> inline void chmax(T &a, const T &b) { if ((a) < (b)) (a) = (b); }
template <class T> inline void chmin(T &a, const T &b) { if ((a) > (b)) (a) = (b); }
template <typename X, typename T> auto make_table(X x, T a) { return vector<T>(x, a); }
template <typename X, typename Y, typename Z, typename... Zs> auto make_table(X x, Y y, Z z, Zs... zs) { auto cont = make_table(y, z, zs...); return vector<decltype(cont)>(x, cont); }

#define cdiv(a, b) (((a) + (b)-1) / (b))
#define is_in(x, a, b) ((a) <= (x) && (x) < (b))
#define uni(x) sort(all(x)); x.erase(unique(all(x)), x.end())
#define slice(l, r) substr(l, r - l)

typedef long long ll;
typedef long double ld;
using vl = vector<ll>;
using vvl = vector<vl>;
using pll = pair<ll, ll>;

template <typename T>
using PQ = priority_queue<T, vector<T>, greater<T>>;
void check_input() { assert(cin.eof() == 0); int tmp; cin >> tmp; assert(cin.eof() == 1); }

#if defined(PCM) || defined(LOCAL)
#else
#define dump(...) ;
#define dump_1d(...) ;
#define dump_2d(...) ;
#define cerrendl ;
#endif

#endif /* HEADER_H */
//%snippet.end()%
#line 2 "solve.cpp"
template<class T=ll> using vec = vector<T>;
struct Fast { Fast() { std::cin.tie(0); ios::sync_with_stdio(false); } } fast;


int solve() {
    string s;cin>>s;

    if (s.find("RRR") != string::npos){
        cout << 3 << endl;
    }
    else if (s.find("RR") != string::npos){
        cout << 2 << endl;
    }
    else if (s.find("R") != string::npos){
        cout << 1 << endl;
    }
    else{
        cout << 0 << endl;
    }

    return 0; 
}


int main(){/*{{{*/
    solve();
    check_input();
    return 0;
}/*}}}*/


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

using namespace std;

#define ll long long




void solve() {

	int n;
	cin >> n;

	int arr[n];
	for(int i = 0; i < n; i++) {
		cin >> arr[i];
	}
	ll sum = 0;
	for(int i = 0; i < n; i++) {
		for(int j = i + 1; j < n; j++) {
			sum += arr[i] * arr[j];
		}
	}
	cout << sum << "\n";

	




	
}

int main() {

	ios_base::sync_with_stdio(0);
	cin.tie(NULL);
	solve();

	return 0;
}

Measured memory_bytes: 3616
#include <iostream>
#include <sstream>
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <ctime>
#include <vector>
#include <string>
#include <map>
#include <set>
#include <deque>
#include <queue>
#include <stack>
#include <functional>
#include <algorithm>

using namespace std;

#define rep(i,j) REP((i), 0, (j))
#define REP(i,j,k) for(int i=(j);(i)<(k);++i)
#define BW(a,x,b) ((a)<=(x)&&(x)<=(b))
#define ALL(v) (v).begin(), (v).end()
#define LENGTHOF(x) (sizeof(x) / sizeof(*(x)))
#define AFILL(a, b) fill((int*)a, (int*)(a + LENGTHOF(a)), b)
#define SQ(x) ((x)*(x))
#define Mod(x, mod) (((x)+(mod)%(mod))
#define MP make_pair
#define PB push_back
#define Fi first
#define Se second
#define INF (1<<29)
#define EPS 1e-10
#define MOD 1000000007

typedef pair<int, int> pi;
typedef pair<int, pi> pii;
typedef vector<int> vi;
typedef queue<int> qi;
typedef long long ll;

int H, W;
ll L;
char c[128][128];
int dist[4][128][128]; // N E S W
int dy[]={-1,0,1,0}, dx[]={0,1,0,-1};

int convert(char ch){ return ch=='N'?0:ch=='E'?1:ch=='S'?2:3; }
char reconvert(int n){ return n==0?'N':n==1?'E':n==2?'S':'W'; }

void solve(int sy, int sx, int sd){
  int y=sy,x=sx,dir=sd;
  dist[dir][y][x] = 0;
  for(int step=1;;step++){
    int nd = dir;
    int ny = y+dy[nd], nx = x+dx[nd];
    while(ny<0||ny>=H||nx<0||nx>=W||c[ny][nx]=='#'){
      nd = (nd+1)%4;
      ny = y+dy[nd], nx = x+dx[nd];
    }

    if(dist[nd][ny][nx]!=-1){
      ll l = L-dist[nd][ny][nx];
      l %= (dist[dir][y][x] - dist[nd][ny][nx] + 1);
      rep(i,4) rep(j,128) rep(k,128){
	if(dist[i][j][k] != l + dist[nd][ny][nx]) continue;
	printf("%d %d %c\n", j+1, k+1, reconvert(i));
	return;
      }
    }
    y = ny, x = nx, dir = nd;
    dist[dir][y][x] = step;
    if(step==L){
      printf("%d %d %c\n", y+1, x+1, reconvert(dir));
      return;
    }    
  }
}

int main(){
  while(scanf("%d%d%lld", &H,&W, &L) && H+W+L){
    int sy, sx, sd;
    memset(dist, -1, sizeof(dist));
    rep(i,H){
      scanf("%s", c[i]);
      rep(j,W){
	if(c[i][j]=='#'||c[i][j]=='.') continue;
	sy = i; sx = j;
	sd = convert(c[i][j]);
	c[i][j] = '.';
      }
    }
    
    //int y = sy, x = sx, dir = sd;
    //    for(int step=0;;step++){
    //    }
    solve(sy, sx, sd);
    /*    rep(i, 4){
      rep(j, H){
	rep(k, W) printf("%d ", dist[i][j][k]); puts("");
      }
      puts("");
      }*/
  }
  return 0;
}

Measured memory_bytes: 1472
using System;

namespace abc049_a
{
    class Program
    {
        static void Main(string[] args)
        {
            string c = Console.ReadLine();
            if(c == "a" || c == "i" || c == "u" || c == "e" || c == "o" )
            {
                Console.WriteLine("vowel");
            }
            else
            {
                Console.WriteLine("consonant");
            }
        }
    }
}

Measured memory_bytes: 2648
#include<iostream>
#include<string>
#include<cstring>
#include<cstdlib>
using namespace std;

int main()
{
  string s;
  char *c;
  int i, score, ace;
  while (getline(cin,s)) {
    if (s[0]=='0') break;
    score = 0;
    ace = 0;
    c = strtok((char*)s.c_str(), " ");
    while (c != NULL) {
      if (atoi(c) > 9) score += 10;
      else score += atoi(c);
      if (atoi(c) == 1) ace++;
      c = strtok(NULL, " ");
    }
    while (ace--) {
      if (score + 10 > 21) break;
      score += 10;
    }
    if (score > 21) score = 0;
    cout<<score<<endl;
  }
}

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

long long int ans;
int main(){
	int n;
	char s[2][55];
	cin>>n;
	for(int i = 0; i < 2; i++){
		for(int j = 0; j < n; j++){
			cin>>s[i][j];
		}
	}
	if(s[0][0] != s[1][0]){
		ans = 6;
		for(int i = 2; i < n; i++){
			if(s[0][i] != s[1][i] && s[0][i - 1] != s[1][i - 1]){
				ans = ((ans)*(3))%1000000007;
				i++;
			}
			else if(s[0][i] == s[1][i] && s[0][i - 1] == s[1][i - 1]){
				ans = ((ans) * 2)%1000000007;
			}
			else if(s[0][i] != s[1][i] && s[0][i - 1] == s[1][i - 1]){
				ans = ((ans) * 2)%1000000007;
				i++;
			}
		}
	}
	else if(s[0][0] == s[1][0]){
		ans = 3;
		for(int i = 1; i < n; i++){
			if(s[0][i] != s[1][i] && s[0][i - 1] != s[1][i - 1]){
				ans = ((ans)*(3))%1000000007;
				i++;
			}
			else if(s[0][i] == s[1][i] && s[0][i - 1] == s[1][i - 1]){
				ans = ((ans) * 2)%1000000007;
			}
			else if(s[0][i] != s[1][i] && s[0][i - 1] == s[1][i - 1]){
				ans = ((ans) * 2)%1000000007;
				i++;
			}
		}
	}
	cout<<ans;
}

Measured memory_bytes: 256
import java.util.*;

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

        int count = 1;
        long money = 100;
        while (true) {
            money *= 1.01;
            if (money >= X) {
                System.out.println(count);
                return;
            }
            count++;
        }
    }
}

Measured memory_bytes: 35744
/*----------------by syr----------------*/
/*

         iii                  ii
     rBQBBBBBBE       BBR iBBBBQBBL     XBBBBBBQBBBBB
   iBBQJ    7BBB      BBsSBBr   BBQ      i      cBBB
  rBBU       iBBw     BBBQi     HBBi           KBBi
  BBH         BB5    iBBB       isL          wBB5
 GBB         iBBi    6BB                   iBBB
 BBQ         BQB     BBD                  QBBi
 BBB        BQB     iQBi                1BBv
 sBBg     wBBB      QBB               iBBB
  7BBBBBBBBBi       BBR              wBBBBBBBBBBBBB
     irvi           ii               ii    i i iii
                i5U
               BBB
               BB7
              1BB
      iPBBBBBKBBR    JBR1       rQBO   BR  UBQP  iBBQi
    7BBBGs7sXBBBi     QBBr     gBBE   rBB BB2BB7HBZQBB
   QBBi      sBQ       BBB   iBBB     SQBBR  BBBB  cBQ
  gBQ        BBg        BBB KBBi      MBBH   BBB   BBs
 iBBv       iBBi         QBBBL        BBR   pBB   iBB
 pBB        BBB         iBBBB        iBB    BBL   KBB
 MBB       BBBR        BBB JBBi      DBR   iBQ    BBL
 GBB     7BBBB2      PBBH   BBBi     BQr   DBB   iBB
  BQBXwgBBP BB7    1BBB      BBQ7   1BB    BBc   BBB
   2BBBBw   BB    EBBS        QBBi  HBa   iBB    BB7
*/
#include<bits/stdc++.h>

using namespace std;

#define PH push
#define MP make_pair
#define PB push_back
#define fst first
#define snd second
#define FOR(i, x, y) for(int i = (x); i < (y); ++i)
#define REP(i, x, y) for(int i = (x); i <= (y); ++i)
#define x0 x0123456789
#define y0 y0123456789
#define x1 x1234567890
#define y1 y1234567890
#define x2 x2345678901
#define y2 y2345678901
typedef double db;
typedef long long ll;
typedef long double ldb;
typedef unsigned long long ull;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;

const int INF = 1e9 + 7;
const int maxn = 6005;

int n, cnta, cntb;
int toOrd[maxn], aPos[maxn], bPos[maxn];
string s;
string dp[maxn];

string getStr(const vector<int> &vec){
	string ret = "";
	FOR(i, 0, vec.size())
		ret += s[vec[i] - 1];
	return ret;
}

int main(){
	cin >> n >> s;
	REP(i, 1, n << 1){
		if(s[i - 1] == 'a'){
			toOrd[i] = cnta;
			aPos[cnta] = i;
			cnta++;
		}
		else{
			toOrd[i] = cntb;
			bPos[cntb] = i;
			cntb++;
		}
	}
	//REP(i, 1, n << 1)
		//cout << toOrd[i] << " ";
	cout << endl;
	for(int i = n - 1; i >= 0; --i){
		int ap = aPos[i], bp = bPos[i];
		if(ap < bp){
			int mx = i;
			FOR(j, ap + 1, bp){
				mx = max(mx, toOrd[j]);
			}
			dp[i] = dp[mx + 1];
			dp[i] = "ab" + dp[i];
		}
		else{
			int mx = i;
			for(; mx + 1 < n && aPos[mx] > bPos[mx + 1]; ++mx);
			//cout << "i = " << i << "mx = " << mx << endl;
			REP(j, 1, n << 1) if(toOrd[j] >= i && toOrd[j] <= mx)
				dp[i] += s[j - 1];
			dp[i] += dp[mx + 1];
		}
		dp[i] = max(dp[i], dp[i + 1]);
	}
	//FOR(i, 0, n)
		//cout << dp[i] << endl;
	cout << dp[0] << endl;
	return 0;
}



Measured memory_bytes: 14720
#pragma GCC optimize("O3")
#include <bits/stdc++.h>
// #include <ext/pb_ds/assoc_container.hpp>
// using namespace __gnu_pbds;
// gp_hash_table<int, int> mapka;

using namespace std;
#define PB push_back
#define MP make_pair
#define LL long long
#define int LL
#define FOR(i,a,b) for(int i = (a); i <= (b); i++)
#define RE(i,n) FOR(i,1,n)
#define REP(i,n) FOR(i,0,(int)(n)-1)
#define R(i,n) REP(i,n)
#define VI vector<int>
#define PII pair<int,int>
#define LD long double
#define FI first
#define SE second
#define st FI
#define nd SE
#define ALL(x) (x).begin(), (x).end()
#define SZ(x) ((int)(x).size())

template<class C> void mini(C &a4, C b4) { a4 = min(a4, b4); }
template<class C> void maxi(C &a4, C b4) { a4 = max(a4, b4); }

template<class TH> void _dbg(const char *sdbg, TH h){ cerr<<sdbg<<'='<<h<<endl; }
template<class TH, class... TA> void _dbg(const char *sdbg, TH h, TA... a) {
  while(*sdbg!=',')cerr<<*sdbg++;
  cerr<<'='<<h<<','; _dbg(sdbg+1, a...);
}

template<class T> ostream &operator<<(ostream& os, vector<T> V) {
  os << "["; for (auto vv : V) os << vv << ","; return os << "]";
}
template<class L, class R> ostream &operator<<(ostream &os, pair<L,R> P) {
  return os << "(" << P.st << "," << P.nd << ")";
}

#ifdef LOCAL
#define debug(...) _dbg(#__VA_ARGS__, __VA_ARGS__)
#else
#define debug(...) (__VA_ARGS__)
#define cerr if(0)cout
#endif

int32_t main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout << fixed << setprecision(11);
  cerr << fixed << setprecision(6);
  int k;
  cin >> k;
  if(k <= 500){
    cout << k << "\n";
    R(i,k){
      R(j,k)
        cout << i + 1 << " ";
      cout << "\n";
    }
  }else{
    int n = 500;
    cout << n << "\n";
    R(_,n){
      R(j,n){
        int i = (j + _) % 500;
        if(i < k - 500){
          if(j & 1){
            cout << i + 1 << " ";
          }else{
            cout << i + 501 << " ";
          }
        }else{
          cout << i + 1 << " ";
        }
      }
      cout << "\n";
    }
  }
}


Measured memory_bytes: 1152
#include<iostream>
#include<cmath>
#include<vector>
#include<set>
#include<algorithm>
#include<tuple>
#include<utility>
#include<cctype>
#include<climits>
#include<map>
#include<queue>
#include<functional>
#include <ios>
#include <iomanip>

using namespace std;
template<class T> void chmax(T& a, T b) {if(a < b){a=b;}}
template<class T> void chmin(T& a, T b) {if(a > b){a=b;}}

#define REP(i,a,n) for(int i=a;i<n;++i)
#define RUP(a,b) ((a+b-1)/(b))
#define ENT "\n"
#define REV(v) reverse(v.begin(),v.end())
#define SRTV(v) sort(v.begin(),v.end())
#define SRTAG(a,n) sort(a,a+n,greater<>())
#define MOD 1000000007

typedef long long ll;
typedef tuple<int,int,bool> Tb;
typedef tuple<ll,ll,ll> Tl;

int atcoder(){
    //入力
    ll h,w;
    cin >> h >> w;
    string s[h];
    REP(i,0,h){
        cin >> s[i];
    }
    REP(i,0,h) REP(j,0,2) cout << s[i] << ENT;
    return 0;
}

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


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

using namespace std;
#define ll long long
#define ull unsigned long long
#define pb push_back
#define lin "\n"
#define fast_io ios_base::sync_with_stdio(0), cin.tie(NULL), cout.tie(0)

void solve() {
    long double a, b, c, d;
    cin >> a >> b >> c >> d;
    cout.precision(0);
    cout << fixed << max(a * c, max(a * d, max(b * c, b * d))) << lin;
}

int main() {
    fast_io;
    int t = 1;
//    cin >> t;
//    scanf("%d",&t);
    int c = 1;
    while (t--) {
//        printf("Case %lld: ",c);
//        cout<<"Case "<<c<<": ";
        solve();
        c++;
    }
}

Measured memory_bytes: 3816
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace AtCoder.Abc
{
    class A_157_DuplexPrinting
    {
        public static void Main(string[] args)
        {
            var sw = new System.IO.StreamWriter(Console.OpenStandardOutput()) { AutoFlush = false };
            Console.SetOut(sw);
            // 整数の入力
            long n = long.Parse(Console.ReadLine());
            long result = (n / 2) + (n % 2);

            Console.WriteLine(result);

            Console.Out.Flush();
        }
    }
}


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

int main()
{
  int n;
  cin >> n;
  int h[n];
  for (int i = 0; i < n; ++i)
  {
    cin >> h[i];
  }
  int max = h[0], ans = 1;

  for (int i = 1; i < n; ++i)
  {
    if (max <= h[i])
    {
      ans++;
      max = h[i];
    }
  }
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<vector>
#include<set>
#include<tuple>
#include<algorithm>
#include<cmath>
#include<string>
#include<stack>
#include<map>
#include<queue>
#include<iomanip>
#include<numeric>
#define INF 1e9
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define all(a) (a).begin(),(a).end()
using ll = long long;
using namespace std;
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; }
template<typename T1, typename T2> ostream& operator<<(ostream& s, const pair<T1, T2>& p) {return s << "(" << p.first << ", " << p.second << ")";}
template<typename T> ostream& operator<<(ostream& s, const vector<T>& v) {
  int len = v.size();
  for (int i = 0; i < len; ++i) {
    s << v[i]; if (i < len - 1) s << "\t";
  }
  return s;
}

template<typename T> ostream& operator<<(ostream& s, const vector< vector<T> >& vv) {
  int len = vv.size();
  for (int i = 0; i < len; ++i) {
  s << vv[i] << endl;
  }
  return s;
}

int A,B;
signed main(){
  std::ios::sync_with_stdio(false);
  std::cin.tie(0);
  cin >> A >> B;
  if(A > 8 || B > 8){
    cout << ":(" << endl;
  }
  else{
    cout << "Yay!" << endl;
  }

  return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <stdio.h>
 
using namespace std;
 
#define int long long
#define rep(i, a, b) for (int i = (a); i < (b); ++i)
#define trav(i, a) for (auto &i: (a))
#define sz(x) (int)(x).size()
#define all(v) v.begin(), v.end()
#define fr(i, a, b) for (int i = (a); i <= (b); ++i)

void solve();

signed main () {
    clock_t beg = clock();
    cout << fixed << setprecision(15);
    ios_base::sync_with_stdio(false);
    cin.tie(0); cout.tie(0);
    int t = 1; 
    // cin >> t;    
    int tt = t;
    while (t--) { 
        solve();
    }
    cerr << "\nExecution time: " << (clock() - beg) / 1000 << '\n';
    return 0;
}
const int M = 1e9 + 7;
const int K = 1e5 + 1;
int n, k;
int cnt[K] = {0};
int exp (int a, int b) {
    if (!b)
        return 1;
    int ans = exp(a, b/2);
    ans = (ans * ans) % M;
    if (b & 1)
        ans = (ans * a) % M;
    return ans;
}
void solve() {
    cin >> n >> k;
    for (int i = 1; i <= k; ++i) {
        cnt[i] = exp(k / i, n);
    }
    for (int i = k; i >= 1; --i) {
        for (int j = i + i; j <= k; j += i) {
            cnt[i] += (M - cnt[j]) % M;
            cnt[i] %= M;
        }
    }
    int ans = 0;
    for (int i = 1; i <= k; ++i) {
        ans += (i * cnt[i]) % M;
        ans %= M;
    }
    cout << ans;
}      


Measured memory_bytes: 4424
#include <bits/stdc++.h>
using namespace std;
int64_t divceil(int64_t a, int64_t b) {
    return a / b + (a % b ? 1 : 0);
}
int main() {
    #ifdef DEBUG
    std::ifstream in("/home/share/inputf.in");
    std::cin.rdbuf(in.rdbuf());
    #endif
    vector<int> X(5), Y(5);
    int ans = 1e8;
    for (int i = 0; i < 5; i++) {
        cin >> X[i];
    }
    for(int i = 0; i < 5; i++) {
        int tmp = 0;
        for(int j = 0; j < 5; j++) {
            if(i == j) tmp += X[j];
            else tmp += divceil(X[j], 10) * 10;
        }
        ans = min(ans, tmp);
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <cmath>
#include <climits>
#include <algorithm>
#include <vector>
#include <unordered_map>
#include <unordered_set>
#include <stack>
#include <list>
#include <map>
#include <set>
#include <stack>
#include <queue>
#include <string.h>
#include <iomanip>
#include <ctype.h>

#define ll          long long int
#define ull         unsigned long long int
#define pb          push_back
#define pii         pair<int,int>
#define F           first
#define S           second
#define vi          vector<int>
#define vli          vector<ll>
#define vii         vector<pii>
#define mi          map<int,int>
#define mii         map<pii,int>
#define M_PI        3.14159265358979323846
#define mp          make_pair
#define sz(x)       (int)x.size()
//#define hell        1000000007
#define matrix      vector<vector<ll>>
#define forn(i,a,b)  for(int i=a;i<b;i++)
#define eps 0.0000000001
#define all(a)      (a).begin(),(a).end()
const long long INF = (long long) 1e7+1;
const long long mod = (long long) 100000000 ;
const long long hell = (long long) 1000000007;

using namespace std;
#include <stdio.h>

ll power(ll x,ll y)
{
  ll res=1;
  while(y>0){
    if(y%2) res=(x%mod*res%mod)%mod;
    x=(x%mod*x%mod)%mod;
    y=y/2;
  }
  return res;
}

ll modinv(ll x){
  return power(x,mod-2);
}

void solve();


void fastIO() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
}

int main(){
   fastIO();
   int test;
   //cin>>test;
   test=1;
   
   while(test--)
   solve();
}
//void sieve();
ll pw(ll k,ll x);
ll gcd(ll x,ll y);

/*
  For freq or prime factors

for(auto pri:prime){
  while(k%pri==0){
    pcnt[pri]++;
    k/=pri;
  }
}*/
// gcd of strings
/*
string getgcd(string s1,string s2){
    
    while(true){
        if(s1.length()<s2.length()){
            swap(s1,s2);
            continue;
        }
        if(s2.empty())
        return s1;
        
        if(s1.substr(0,s2.length())!=s2)
        return "";
        
        s1=s1.substr(s2.length());
    }
}
*/
/*
// for user defined DS hashmap and set
 
struct hash_pair{
      size_t operator()(const pair<int,pair<int,int>>& p) const{
          auto hash1=hash<int>()(p.F) ;
          auto hash2=hash<int>()(p.S.F) ;
          auto hash3=hash<int>()(p.S.S) ;
          return (hash1^hash2)^hash3;
      }  
};
struct pair_hash
{
	template <class T1, class T2>
	std::size_t operator () (std::pair<T1, T2> const &pair) const
	{
		std::size_t h1 = std::hash<T1>()(pair.first);
		std::size_t h2 = std::hash<T2>()(pair.second);

		return h1 ^ h2;
	}
};
*/

void solve(){
    ll a,b,c;
    cin>>a>>b>>c;
    ll f=c-(a+b);
    if(f<=0){
        cout<<"No";
        return;
    }
    ll x=4*a*b;
    f=f*f;
    if(x<f)
    cout<<"Yes";
    else
    cout<<"No";
}    


///Before submit=>
///    *check for integer overflow,array bounds
///    *check for n=1

ll gcd(ll a,ll b)
{
    while( b != 0)
	{
		ll  t = b;
		b= a %t;
		a = t;
	}
	return a;
}


ll pw(ll k,ll x){
  if(x==0)
  return 1;
  if(x&1)
  return ((pw(k,x-1))*k);
  else
  return ((pw(k,x/2))*(pw(k,x/2)));
}





Measured memory_bytes: 256
#include <stdio.h>

int f(int  x, int   y)
{
	return ((x + y) % 10);;
}

int main(void)
{
	char str[11];
	int a[10];
	
	while(scanf("%s", str) != EOF) {
		int i, j;
		
		for(i = 0; i < 10; i++) {
			a[i] = str[i] - '0';
		}
		for(i = 1; i < 10; i++) {
			for(j = 0; j < 10 - i; j++) {
				a[j] = f(a[j], a[j + 1]);
			}
		}
		printf("%d\n", a[0]);
	}
	
	return 0;
}


Measured memory_bytes: 540
N,K,C= map(int,input().split())
S = input()

dp = [0]*(N+1)
dpr = [0]*(N+1)
for i in range(1,N+1):
    if S[i-1] == 'o':
        p = max(i-C-1,0)
        if dp[i-1] < dp[p] + 1:
            dp[i] = dp[p] + 1
            dpr[i] = i + C
            continue
    dp[i] = dp[i-1]
    dpr[i] = dpr[i-1]

rdp = [0]*(N+2)

for i in range(N,-1,-1):
    if S[i-1] == 'o':
        rdp[i] = max(rdp[i+1],rdp[min(N+1,i+C+1)]+1)
    else:
        rdp[i] = rdp[i+1]

ans = []
for i in range(1,N+1):
    if dp[i-1] + rdp[max(i+1,min(dpr[i-1]+1,N+1))] < K:
        ans.append(i)

for a in ans:
    print(a)

    





Measured memory_bytes: 58976
#include <bits/stdc++.h>
#define SZ(X) ((int)(X).size())
#define ALL(X) (X).begin(), (X).end()
#define REP(I, N) for (int I = 0; I < (N); ++I)
#define REPP(I, A, B) for (int I = (A); I < (B); ++I)
#define RI(X) scanf("%d", &(X))
#define RII(X, Y) scanf("%d%d", &(X), &(Y))
#define RIII(X, Y, Z) scanf("%d%d%d", &(X), &(Y), &(Z))
#define DRI(X) int (X); scanf("%d", &X)
#define DRII(X, Y) int X, Y; scanf("%d%d", &X, &Y)
#define DRIII(X, Y, Z) int X, Y, Z; scanf("%d%d%d", &X, &Y, &Z)
#define RS(X) scanf("%s", (X))
#define CASET int ___T, case_n = 1; scanf("%d ", &___T); while (___T-- > 0)
#define MP make_pair
#define PB push_back
#define MS0(X) memset((X), 0, sizeof((X)))
#define MS1(X) memset((X), -1, sizeof((X)))
#define LEN(X) strlen(X)
#define PII pair<int,int>
#define VI vector<int>
#define VPII vector<pair<int,int> >
#define PLL pair<long long,long long>
#define VPLL vector<pair<long long,long long> >
#define F first
#define S second
typedef long long LL;
using namespace std;
const int MOD = 1e9+7;
const int INF = 1e9+5;
const int SIZE = 1e6+10;
template <class T>
void maa(T& x,T y){
    if(x<y)x=y;
}
template <class T>
void mii(T& x,T y){
    if(x>y)x=y;
}
VPII p[SIZE];
struct Union_Find{
    int d[SIZE],num[SIZE];
    void init(int n){
        REP(i,n)d[i]=i,num[i]=1;
    }
    int find(int x){
        return (x!=d[x])?(d[x]=find(d[x])):x;
    }
    bool uu(int x,int y){
        x=find(x);
        y=find(y);
        if(x==y)return 0;
        if(num[x]>num[y])swap(x,y);
        num[y]+=num[x];
        d[x]=y;
        return 1;
    }
}U;
LL fac[SIZE],inv[SIZE];
LL mypow(LL x,LL y){
    LL res=1;
    while(y){
        if(y&1)res=res*x%MOD;
        y>>=1;
        x=x*x%MOD;
    }
    return res;
}
LL C(int x,int y){
    if(y<0||y>x)return 0;
    return fac[x]*inv[y]%MOD*inv[x-y]%MOD;
}
void build(){
    assert(MOD>=SIZE);
    fac[0]=1;
    REPP(i,1,SIZE)fac[i]=fac[i-1]*i%MOD;
    inv[SIZE-1]=mypow(fac[SIZE-1],MOD-2);
    for(int i=SIZE-2;i>=0;i--)inv[i]=inv[i+1]*(i+1)%MOD;
}
int c[SIZE],w[SIZE];
int main(){
    build();
    DRIII(N,X,Y);
    U.init(N);
    VPII mi(N,MP(INF,0));
    REP(i,N){
        RII(c[i],w[i]);
        c[i]--;
        p[c[i]].PB(MP(w[i],i));
        mii(mi[c[i]],MP(w[i],i));
    }
    REP(i,N){
        sort(ALL(p[i]));
        REPP(j,1,SZ(p[i])){
            if(p[i][j].F+p[i][0].F<=X)U.uu(p[i][j].S,p[i][0].S);
        }
    }
    sort(ALL(mi));
    REP(i,min(SZ(mi),2)){
        if(mi[i].F>=Y)continue;
        REP(j,N){
            if(c[mi[i].S]!=c[j]&&mi[i].F+w[j]<=Y)U.uu(mi[i].S,j);
        }
    }
    map<PII,int>cnt;
    LL an=1;
    REP(i,N){
        if(U.find(i)==i){
            an=an*fac[U.num[i]]%MOD;
        }
        cnt[MP(U.find(i),c[i])]++;
    }
    for(map<PII,int>::iterator it=cnt.begin();it!=cnt.end();it++){
        an=an*inv[it->S]%MOD;
    }
    cout<<an<<endl;
    return 0;
}


Measured memory_bytes: 68096
#include <iostream>
using namespace std;
int main(){
	int n1,n2;
	bool g = false;
	while(cin >> n1 >> n2){
		if(!(n1&&n2)) break;
		if(g) cout << endl;
		g = true;
		bool f = false;
		for(int year=n1; year<=n2; year++){
			if(year%400==0 || (year%4==0&& year%100!=0) ){
				f = true;
				cout << year << endl;
			}
		}
		if(!f) cout << "NA" << endl;
		
	}
	return 0;
}

Measured memory_bytes: 0
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		
		int n = Integer.parseInt(sc.next());
		int m = Integer.parseInt(sc.next());
		
		char [][]a = new char[n][n];
		char [][]b = new char[m][m];
		
		for(int i = 0 ; i < n ;i++) {
			String s = sc.next();
			for(int j = 0 ; j < n ;j++) {
				a[i][j] = s.charAt(j);
			}
		}
		
		for(int i = 0 ; i < m ;i++) {
			String s = sc.next();
			for(int j = 0 ; j < m ;j++) {
				b[i][j] = s.charAt(j);
			}
		}
		boolean flag = false;
		for(int i = 0 ; i < n-m+1 ;i++) {
			for(int j = 0 ; j < n-m+1 ;j++) {
				if(a[i][j] == b[0][0]) {
					boolean f1 = true;
				f:	for(int y = i ; y < m + i ;y++) {
						for(int x = j ; x < m + j;x++) {
							if(a[y][x] != b[y-i][x-j]) {
								f1 = false;
							}
						}
					}
					if(!flag) {
					flag = f1;
					}
				}
			}
		}
		
		
		if(flag) {
			System.out.println("Yes");
		}
		else {
			System.out.println("No");
		}
		
		

	}

}


Measured memory_bytes: 23764
#include<bits/stdc++.h>
using namespace std;
#define fastio() ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define ll long long int
#define f first
#define s second
#define mp make_pair
#define pb push_back
#define M 1000000007
#define inf 1e9
#define pi 3.1415926536
#define mod 1000000007
#define fr(i,a,b,in) for(int i=a;i<b;i+=in)
#define frn(i,a,b,dc) for(int i=a;i>=b;i-=dc)
#define test(t) int t; cin>>t; while(t--)
int main()
{
	fastio();
	ll x,k,d;
	cin>>x>>k>>d;
	x=abs(x);
	ll dif=abs(x-0);
	ll q=dif/d;
	if(q>=k){
		cout<<x-(k*d)<<endl;
		// else cout<<x+(k*d)<<endl;
	}
	else{
		// if(x>0){
		x=x-(q*d);
		k-=q;
		if(k%2==0) cout<<x<<endl;
		else cout<<abs(x-d)<<endl;
		// }
		// else{
		// 	x=x+(q*d);
		// 	k-=q;
		// 	if(k%2==0) cout<<x<<endl;
		// 	else cout<<x+d<<endl;
		// }
	}
}

Measured memory_bytes: 3648
#include<stdio.h>
int main(void){
  int n,i,F[45];
  F[0]=F[1]=1;
  scanf("%d",&n);
  for(i=2;i<=n;i++)
    F[i]=F[i-1]+F[i-2];
  printf("%d\n",F[n]);
  return 0;
}

Measured memory_bytes: 596
#include<iostream>
using namespace std;
int main(){
	int n;
  cin>>n;
  int cnt=0;
  for(int i=0;i<n;i++){
  	int a;
    cin>>a;
    if(i%2==0&&a%2!=0)cnt++;
  }
  cout<<cnt<<endl;
	}
  

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

bool tsurai(long long s, long long id, long long d, long long k) {
    return (id+s-1)/k > d+s-2;
}

int main() {
    long long N, k;
    scanf("%lld %lld", &N, &k);

    long long d=1, id=0;

    for (long long i=1; i<N; ++i) {
        id += d;
    #if 0
        while (id / k > d-1) {
            ++d;
            ++id;
        }
    #endif

//        printf("id = %lld, d = %lld, k = %lld\n", id, d, k);
        long long lb=0, ub=2e18;
        while (ub-lb > 1) {
            long long mid=(lb+ub)>>1;
            (tsurai(mid, id, d, k)? lb:ub) = mid;
        }

//        printf("%lld\n", lb);
        d += lb;
        id += lb;
    }

    printf("%lld\n", id);
    return 0;
}

Measured memory_bytes: 3228
A,B,C,D,E,F=map(int,input().split())

water=set()
for a in range(0,F+1,100*A):
  for b in range(0,F+1,100*B):
    if a+b<=F: water.add(a+b)
water=sorted(list(water))

suger=set()
for c in range(0,F+1,C):
  for d in range(0,F+1,D):
    if c+d<=F: suger.add(c+d)
suger=sorted(list(suger))

ans,answater,anssuger=0,0,0
for w in water:
  for s in suger:
    if (w//100)*E<s or w+s>F: break
    if w+s!=0:
      if ans<=(100*s)/(w+s):
        answater,anssuger=w+s,s
        ans=(100*s)/(w+s)
print(answater,anssuger)

Measured memory_bytes: 3188
def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)

    return divisors


n = int(input())
a = make_divisors(n)
b = []

if len(a) % 2 == 0:
    for i in range(0,len(a),2):
        sum = a[i] + a[i+1]
        b.append(sum)
else:
    b.append(a[len(a)-1]*2)
    for i in range(0,len(a)-1,2):
        sum = a[i] + a[i+1]
        b.append(sum)

b.sort()
print(b[0]-2)


Measured memory_bytes: 3424
#include<iostream>
#include<string>
#include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;
int a=1;
int main(void){
        for(;;){

        int n,q=0;

        cin>>n;
        if(n==0){
            //cout<<endl;
            break;
        }
        if(a==1);
        else cout<<endl;
        int w[20],l[20],d[20];
        int p[20];

        char team[20][40];


        for(int i=0;i<n;i++){
            scanf("%s%d%d%d",team[i],&w[i],&l[i],&d[i]);
            p[i]=w[i]*3+d[i];
        }
        for(int i=3*n;i>=0;i--){
            for(int j=0;j<n;j++){
                if(p[j]==i){
                    cout<<team[j]<<","<<p[j]<<endl;
                    q++,a++;
                }
            }

        }


        }
	return 0;
}

Measured memory_bytes: 1248
n = int(input())
key = []
for i in range(n):
  flag = True
  s, p = map(str, input().split())
  for j in range(len(key)):
    if key[j][0] == s:
      key[j][1].append([int(p), i+1])
      flag = False
      break
  if flag:
    key.append([s, [[int(p), i+1]]])
key.sort()
for i in range(len(key)):
  key[i][1].sort(reverse=True)
  for j in range(len(key[i][1])):
    print(key[i][1][j][1])

Measured memory_bytes: 3064