akhauriyash/Code-Regression huggingface dataset:
#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cstdlib>
#include<cstring>
#include<cmath>
using namespace std;
int main()
{
	int a,b,c;
	cin>>a>>b>>c;
	if(b-a==c-b)
	cout<<"YES"<<endl;
	else	cout<<"NO"<<endl;
	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <numeric>
#include <utility>
#include <cmath>
#include <vector>
#include <queue>
#include <string>
#include <map>
#define MAX_U   10
#define MIN_U   0
#define rep(i,n) for(int i=0;i<n;i++)
#define sz(x) ((int)(x).size())
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<char> vc;
typedef vector<string> vs;
typedef queue<int> qi;
const int INF=numeric_limits<int>::infinity();
void printa(){cout<<"\n";}
template<class T, class... A>void printa(const T&first,const A&... rest){cout<<first;printa(rest...);}
template<class... A>void printa(const A&... rest){printa(rest...);}
void prints(){cout<<" ";}
template<class T, class... A>void prints(const T&first,const A&... rest){cout<<first;prints(rest...);}
template<class... A>void prints(const A&... rest){prints(rest...);}
int factorial(int x){int f=1;for(int i=1;i<x+1;i++)f=f*i;return f;}
int sigma(int x){int s;for(int i=1;i<x+1;i++)s=s+i;return s;}
int middle(int x){if(x%2==0)return x/2;else return x/2+1;}
double heron(int a,int b,int c){double s;s=(a+b+c)/2;return sqrt(s*(s-a)*(s-b)*(s-c));}
double trapezium(int a,int b,int h){return (a+b)*h/2;}
double triangle(int a,int h){return a*h/2;}
int main(void){
    cin.tie(0);
    ios::sync_with_stdio(false);
    int a,b,c;
    cin >>a>>b>>c;
    if(a==b+c)printa("Yes");
    else if(b==a+c)printa("Yes");
    else if(c==a+b)printa("Yes");
    else printa("No");
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <sstream>
#include <algorithm>
#include <string>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <stack>
#include <memory>
#include <complex>
#include <numeric>
#include <cstdio>
#include <iomanip>
#include <random>

#define REP(i,m,n) for(int i=int(m);i<int(n);i++)
#define RREP(i,m,n) for(int i=int(n)-1;i>=int(m);--i)
#define EACH(i,c) for (auto &(i): c)
#define all(c) begin(c),end(c)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort(begin(c),end(c))
#define pb emplace_back
#define MP make_pair
#define SZ(a) int((a).size())
//#define int long long

#ifdef LOCAL
#define DEBUG(s) cout << (s) << endl
#define dump(x)  cerr << #x << " = " << (x) << endl
#define BR cout << endl;
#else
#define DEBUG(s) do{}while(0)
#define dump(x) do{}while(0)
#define BR 
#endif
using namespace std;

using UI = unsigned int;
using UL = unsigned long;
using LL = long long;
using ULL = unsigned long long;
using VI = vector<int>;
using VVI = vector<VI>;
using VLL = vector<LL>;
using VVLL = vector<VLL>;
using VS = vector<string>;
using PII = pair<int,int>;
using VP = vector<PII>;
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; }

void solve() {
    LL n,k;
    cin >> n >> k;
    VLL p(n), c(n);
    REP(i,0,n) cin >> p[i];
    REP(i,0,n) --p[i];
    REP(i,0,n) cin >> c[i];
    LL ans = -(1LL<<60);
    REP(i,0,n) {
        int idx = i;
        LL sum = 0;
        // LL maxv = -1 * (1LL<<60);
        VLL ms(n);
        REP(j,0,n) {
            sum += c[p[idx]];
            idx = p[idx];
            if (j == 0) ms[j] = sum;
            else ms[j] = max(sum, ms[j-1]);
        }
        if (k <= n) {
            chmax(ans, ms[k-1]);
            continue;
        }

        int cnt = 0;
        sum = 0;
        idx = i;
        for (;;) {
            sum += c[p[idx]];
            idx = p[idx];
            ++cnt;
            if (idx == i) break;
        }
        // dump(cnt);
        if (sum < 0) {
            chmax(ans, *max_element(all(ms)));
            continue;
        }
        if (sum == 0) {
            chmax(ans, max(0LL, *max_element(all(ms))));
            continue;
        }

        LL tmp = sum * (k / cnt);
        LL rem = k % cnt;

        if (rem == 0) chmax(ans, max(tmp, tmp-sum+ms[cnt-1]));
        else chmax(ans, max(0LL, tmp) + max(0LL, ms[rem-1]));
        // dump(tmp + remv);
    }
    cout << ans << endl;
}

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

Measured memory_bytes: 3708
#include <algorithm>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <tuple>
#include <unordered_map>
#include <vector>
using namespace std;
using ll = int64_t;
#define rep(i, j, n) for (int i = j; i < (int)n; ++i)

int main() {
  int n, a, b;
  cin >> n >> a >> b;
  string s;
  cin >> s;

  int x = 0, y = 0;
  vector<string> ans(n);
  rep(i, 0, n) {
    if (s[i] == 'a' && x < a + b) {
      ++x;
      ans[i] = "Yes";
    } else if (s[i] == 'b' && x < a + b && y < b) {
      ++x;
      ++y;
      ans[i] = "Yes";
    } else
      ans[i] = "No";
  }
  rep(i, 0, n) cout << ans[i] << '\n';
  return 0;
}

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

typedef long long ll;
typedef pair<int,int> P;

#define p_ary(ary,a,b) do { cout << "["; for (int count = (a);count < (b);++count) cout << ary[count] << ((b)-1 == count ? "" : ", "); cout << "]\n"; } while(0)
#define p_map(map,it) do {cout << "{";for (auto (it) = map.begin();;++(it)) {if ((it) == map.end()) {cout << "}\n";break;}else cout << "" << (it)->first << "=>" << (it)->second << ", ";}}while(0)

int main() {
    int n,k;
    cin >> n >> k;
    vector<int> h(n);
    for (int i = 0;i < n;++i) cin >> h[i];
    sort(h.begin(),h.end());
    ll ans = 0;
    for (int i = 0;i < n-k;++i) ans += h[i];
    cout << ans << endl;
}

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

const double INF = 1000 * 1000 * 1000;
int n, m;
vector<vector<int>> g;
vector<vector<int>> rg;
vector<int> u;
vector<int> c;
vector<int> ord;
int clr = 1;

void dfs(int v)
{
    if(u[v])
    {
        return;
    }
    u[v] = true;
    for(auto i : g[v])
    {
        dfs(i);
    }
    ord.push_back(v);
}
void dfs2(int v, int clr)
{
    if(u[v])
    {
        return;
    }
    u[v] = true;
    c[v] = clr;
    for(auto i : rg[v])
    {
        dfs2(i, clr);
    }
}

int main()
{
    int a, b, c, d;
    cin >> a >> b >> c >> d;
    cout << min(a, b) + min(c, d);
}

Measured memory_bytes: 256
#include<iostream>
#include<string>
#include<vector>
#include<cmath>
#include<algorithm>
#include<cstdio>
#include<set>
#include<queue>
#include<functional>
using namespace std;

typedef long long ll;

ll cnt[6];
int main() {
  int N; cin >> N;
  string s[100010];
  ll ans = 0;

  for ( int i = 0; i < N; i++ ) {
    cin >> s[i];
    if ( s[i][0] == 'M' ) cnt[1]++;
    if ( s[i][0] == 'A' ) cnt[2]++;
    if ( s[i][0] == 'R' ) cnt[3]++;
    if ( s[i][0] == 'C' ) cnt[4]++;
    if ( s[i][0] == 'H' ) cnt[5]++;    
  }

  sort(cnt+1,cnt+6,greater<int>());
  int cnt2 = 0;
  for ( int i = 1; i <= 5; i++ ) {
    //cout << cnt[i] << endl;
    if (cnt[i] != 0 ) cnt2++;
  }
  //cout << cnt2 << endl;

  if ( cnt2 <= 2 ) cout << 0 << endl;
  else if ( cnt2 == 3 ) cout << cnt[1] * cnt[2] * cnt[3] << endl;
  else if ( cnt2 == 4 ) {
    //4C3
    for ( int i = 1; i <= 3; i++ ) {
      for ( int j = i + 1; j <= 4; j++ ) {
	for ( int k = j + 1; k <= 4; k++ ) {
	  ans += cnt[i] * cnt[j] * cnt[k];
	}
      }
    }
  
    cout << ans << endl;
  } else if( cnt2 == 5 ){
    //5C3
    for ( int i = 1; i <= 3; i++ ) {
      for ( int j = i + 1; j <= 4; j++ ) {
	for ( int k = j + 1; k <= 5; k++ ) {
	  ans += cnt[i] * cnt[j] * cnt[k];
	}
      }
    }
    cout << ans << endl;
  }
  return 0;
}


Measured memory_bytes: 6144
#include <stdio.h>

unsigned int a[101];
unsigned int b[101];

int main(void)
{
    unsigned int n;
    unsigned int i;
    long long ret = 0;

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

    a[0] = b[0];
    for (i = 0; i < (n - 2); i++) {
        if (b[i] >= b[i + 1]) {
            a[i + 1] = b[i + 1];
        } else {
            a[i + 1] = b[i];
        }
    }
    a[n - 1] = b[n - 2];

    for ( i = 0; i < n; i++) ret += a[i];

    printf("%ld", ret);

    return 0;
}

Measured memory_bytes: 128
def gcd(n,m):#n,mは正の整数、最大公約数
    if n%m==0:
        return m
    elif m%n==0:
        return n
    elif n>m:
        n=n%m
        return gcd(n,m)
    else:
        m=m%n
        return gcd(n,m)

A,B,C,D=map(int,input().split())

lcm=C*D//gcd(C,D)
a=[0]*3
b=[0]*3
a[0]=(A-1)//C #A-1以下のCの倍数の個数
a[1]=(A-1)//D
a[2]=(A-1)//lcm
b[0]=B//C
b[1]=B//D
b[2]=B//lcm

print(B-A+1-((b[0]-a[0])+(b[1]-a[1])-(b[2]-a[2])))

Measured memory_bytes: 3064
def execute(N, A):
    dst = 0
    s = sum(A)
    for v in A:
        s -= v
        dst += v * s

    return dst % (10**9+7)

if __name__ == '__main__':
    N = int(input())
    A = list(map(int, input().split()))

    print(execute(N, A))

Measured memory_bytes: 31416
#!usr/bin/env python3
from collections import defaultdict, deque
from heapq import heappush, heappop
from itertools import permutations, accumulate
import sys
import math
import bisect
def LI(): return [int(x) for x in sys.stdin.buffer.readline().split()]
def I(): return int(sys.stdin.buffer.readline())
def LS():return [list(x) for x in sys.stdin.readline().split()]
def S():
    res = list(sys.stdin.readline())
    if res[-1] == "\n":
        return res[:-1]
    return res
def IR(n):
    return [I() for i in range(n)]
def LIR(n):
    return [LI() for i in range(n)]
def SR(n):
    return [S() for i in range(n)]
def LSR(n):
    return [LS() for i in range(n)]

sys.setrecursionlimit(1000000)
mod = 1000000007

def solve():
    n = I()
    a = input()
    b = input()
    c = input()
    ans = 0
    for i in range(n):
        if a[i] == b[i] == c[i]:
            continue
        if a[i] == b[i] or b[i] == c[i] or a[i] == c[i]:
            ans += 1
        else:
            ans += 2
    print(ans)
    return

#Solve
if __name__ == "__main__":
    solve()


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

#define FOR(i,a,b)  for(ll (i)=a;(i)<(b);++(i))
#define RFOR(i,a,b) for(ll (i)=a;(i)>=(b);--(i))
#define REP(i,n)    FOR(i,0,n)
#define RREP(i,n)   RFOR(i,n,0)
#define ALL(v)      (v).begin(),(v).end()
#define BIT(n)      (1LL<<(n))
#define IN(x,l,r)   ((l)<=(x)&&(x)<=(r))
#define LEN(s)      (string(s)).length()
#define NPOS        string::npos
#define SHOW(x)     cout<<#x<<" = "<<x<<endl
#define SORT(v)     sort(ALL(v))
#define SZ(v)       (ll)(v).size()
#define UNIQ(v)     SORT(v);(v).erase(unique(ALL(v)),(v).end())
#define PERM(v)     for(bool p=1;p;p=next_permutation(ALL(v)))
#define PQ(T)       priority_queue<T,vector<T>,greater<T>>

template<class T>string join(const vector<T>& v,string d=" ")
{stringstream s;REP(i,SZ(v))s<<d<<v[i];return s.str().substr(LEN(d));}

template<class T>ostream& operator<<(ostream& s,const vector<T>& v)
{s<<"{";if(SZ(v))s<<join(v,", ");s<<"}";return s;}

template<class T>bool contain(const string& s,const T& v)
{return s.find(v)!=NPOS;}

template<class T,class U>string& replace(string& s,const T& f,const U& t)
{for(auto p=s.find(f);p!=NPOS;p=s.find(f,p+LEN(t)))s.replace(p,LEN(f),t);}

const ll INF = 1e15;
const ll MOD = 1e9+7;
const double EPS = 1e-10;

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

int main() {
    ll N; cin >> N;
    
    ll x = 800 * N;
    ll y = 200 * (N / 15);
    
    cout << x - y << endl;
    
    return 0;
}


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

bool tri(long long int a,long long int b,long long int c)
{
	if(a+b>c && b+c>a && c+a >b)return true;
	else
	{
		return false;
	}
}

int main()
{
	int n;
	cin>>n;
	long long int a[n];
	for(int i=0;i<n;i++)
	{
		cin>>a[i];
	}	
	int count = 0;
	for(int i=0;i<n-2;i++)
	{
		for(int j=i+1;j<n-1;j++)
		{
			for(int k = j+1;k<n;k++)
			{
				if(tri(a[i],a[j],a[k]) && a[i]!=a[j] && a[i]!=a[k] && a[j]!=a[k])
				{
					count++;
				}
			}
		}
	}
	cout<<count;
}

Measured memory_bytes: 3632
// abc080_b
#include<iostream>
#include<vector>
#include<string>
#include<algorithm>
#include<map>
#include<set>
#include<unordered_map>
#include<utility>
#include<cmath>
#include<random>
#include<cstring>
#include<queue>
#include<stack>
#include<bitset>
#include<cstdio>
#include<sstream>
#include<iomanip>
#include<assert.h>
#include<typeinfo>
#define loop(i,a,b) for(int i=a;i<b;i++)
#define rep(i,a) loop(i,0,a)
#define FOR(i,a) for(auto i:a)
#define pb push_back
#define all(in) in.begin(),in.end()
#define shosu(x) fixed<<setprecision(x)
#define show1d(v) rep(i,v.size())cout<<" "<<v[i];cout<<endl<<endl;
#define show2d(v) rep(i,v.size()){rep(j,v[i].size())cout<<" "<<v[i][j];cout<<endl;}cout<<endl;
using namespace std;
typedef long long ll;
typedef int Def;
typedef pair<Def,Def> pii;
typedef vector<Def> vi;
typedef vector<vi> vvi;
typedef vector<pii> vp;
typedef vector<vp> vvp;
typedef vector<string> vs;
typedef vector<double> vd;
typedef vector<vd> vvd;
typedef pair<Def,pii> pip;
typedef vector<pip>vip;
template<typename A,typename B>bool cmin(A &a,const B &b){return a>b?(a=b,true):false;}
template<typename A,typename B>bool cmax(A &a,const B &b){return a<b?(a=b,true):false;}
const double PI=acos(-1);
const double EPS=1e-9;
Def inf = sizeof(Def) == sizeof(long long) ? 2e18 : 1e9+10;
int dx[] = {0, 1, 0, -1};
int dy[] = {1, 0, -1, 0};
int func(int x){
  int xf=0;
  while(x>0) {
    xf+=x%10;
    x/=10;
  }

  return xf;
}

int main(int argc, char *argv[])
{
  int n;
  cin>>n;
  int fx=func(n);
  if(n%fx==0){
    cout<<"Yes"<<endl;
  } else {
    cout<<"No"<<endl;
  }
  return 0;
}


Measured memory_bytes: 256
#include <stdio.h>

int main(void){
  int i,x,rst;
  int coin[6]={500,100,50,10,5,1};

  while(1){
    scanf("%d",&x);
    if(!x) break;

    x = 1000 - x;
    for(i=rst=0;i<6;i++){
      rst += x / coin[i];
      x %= coin[i];
    }
    printf("%d\n",rst);
  }

  return 0;
}

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

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

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

    class Solver
    {
        public void Solve()
        {
            var input = Console.ReadLine().Split().Select(elem => int.Parse(elem)).ToArray();

            var coin = 0;
            var count = 2;
            for(int i = 0; i < count; i++)
            {
                if (input[0] > input[1])
                {
                    coin += input[0];
                    input[0]--;
                }
                else
                {
                    coin += input[1];
                    input[1]--;
                }
            }
            
            Console.WriteLine(coin.ToString());
        }
    }
}


Measured memory_bytes: 13268
#include <iostream>
#include <vector>

int main(){
    int n, a, b;
    std::cin >> n >> a >> b;

    int numerator, buf;
    std::vector<int> vec;
    for(int i = 1; i <= n; ++i){
        buf = 0;
        numerator = i;
        if(i < 10){
            buf = i;
        }else{
            while(0 != numerator){
                buf += numerator % 10;
                numerator = numerator / 10;
            }
        }
        vec.push_back(buf);
    }

    int ans = 0;
    for(int i = 0; i < n; ++i){
        // std::cout << "i = " << i + 1 << ": " << vec.at(i) << std::endl;
        if(a <= vec.at(i) && vec.at(i) <= b){
            ans += i + 1;
        }
    }

    std::cout << ans << std::endl;

    return 0;
}

Measured memory_bytes: 384
#include <bits/stdc++.h>
#include <algorithm>
#include <iostream>
#include <stdio.h>
#include <math.h>
typedef long long ll;
using namespace std;

int main() {
	ll h,w;
	cin>>h>>w;
	string s[h],ans[h];
	for(int i=0;i<h;i++){
		cin>>s[i];
		ans[i]="#"+s[i]+"#";
	}
	for(int i=0;i<w+2;i++){
		cout << "#";
	}
	cout << endl;
	for(int i=0;i<h;i++){
		cout<<ans[i]<<endl;
	}
	for(int i=0;i<w+2;i++){
		cout << "#";
	}
	cout << endl;

	return 0;
}

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

int max(int a,int b,int c)
{
if(a>=b && a>=c)
  return a;
  else if(b>=c && b>=a)
    return b;
	else
      return c;
}
int main()
{
int a,b;
  cin>>a>>b;
  cout<<max(a+b,a-b,a*b);
}


Measured memory_bytes: 256
import java.util.*;

public class Main {

    public static void main(String[] args) {
        // write your code here
        Scanner scanner = new Scanner(System.in);
        char[] n = scanner.next().toCharArray();

        long sum = 0;

        for (char v: n
             ) {
           int t = Character.getNumericValue(v);
           sum += t;
        }

        System.out.println(sum % 9 == 0 ? "Yes" : "No");
    }
}

Measured memory_bytes: 40856
#include <bits/stdc++.h>
#define REP(i,n) for (int i = 0; i < (n); i++)
#define RREP(i, s, n) for (int i = s; i < (n); i++)
#define ALL(a) a.begin(), a.end()
#define RALL(a) a.rbegin(), a.rend()
using namespace std;
using ll = long long;
typedef pair<int, int> pint;
typedef pair<ll, ll> pll;
const ll MOD = 1000000007;
const ll INF = MOD * MOD;
const int inf = (1<<29);

int main() {

    string S;
    cin >> S;

    int n = S.size();

    int cnt = 0;
    for(int i = 0; i < S.size(); i++) {
        if (S[i] == '0') cnt++;
    }

    cout << 2 * min(cnt, n - cnt) << endl;

    return 0;

    // int N = S.size();
    // // cout << N << endl;    
    
    // bool flag = false;
    // while (true) {
    //     // cout << "yeah!" << endl;
    //     if (S.empty()) {
    //         break;
    //     }   

    //     bool flag2 = false;
    //     for(int i = 0; i < S.size()-1; i++) {
    //         // cout << S[i] << S[i+1] << endl;
            
    //         if (S[i] != S[i+1]) {
    //             // cout << "yeah!" << endl;
    //             S.erase(i, 2);
    //             break;
    //         }
    //         if (i == S.size()-2) {
    //             flag = true;
    //         }
    //     }

    //     // cout << S << endl;

    //     if (flag || N == S.size()) {
    //         break;
    //     }
    // }

    // cout << N - S.size()<< endl;
    
    return 0;
}

Measured memory_bytes: 512
N, Y = map(int, input().split())
for x in range(N+1):
    for y in range(N-x+1):
        z = (Y - 10000*x - 5000*y)//1000
        if x + y + z == N:
            print(x, y, z)
            exit()
print(-1, -1, -1)


Measured memory_bytes: 2940
/*
START BY THE NAME OF ALMIGHTY ALLAH
THIS WONT BE ACCEPTED
STOP_GIVING_UP

██╗███████╗████████╗██╗ █████╗ ██╗  ██╗
██║██╔════╝╚══██╔══╝██║██╔══██╗██║ ██╔╝
██║███████╗   ██║   ██║███████║█████╔╝
██║╚════██║   ██║   ██║██╔══██║██╔═██╗
██║███████║   ██║   ██║██║  ██║██║  ██╗
╚═╝╚══════╝   ╚═╝   ╚═╝╚═╝  ╚═╝╚═╝  ╚═╝




*/
#include<bits/stdc++.h>
#define l(i,a,n)for(int i=a;i<n;i++)
#define pb push_back
#define in insert
#define mp make_pair
#define lw(v) sort(v.begin(),v.end());
#define hi(v) sort(v.begin(),v.end(),greater<long long>());
#define all(v) v.begin(),v.end()
#define filein freopen ("input.txt", "r", stdin)
#define fileout freopen ("output.txt", "w", stdout)
using namespace std;
int main()
{
    ios::sync_with_stdio(0);
    cin.tie(0);
    long long t,r=1,r1=0,r2=0,k=0,a,b,c=1,m,d=0,n,e,f=0,x=0,g,p=0,q=0,y=0,z=0;

    vector<pair<long long,long long>>v;
    vector<long long>u;
    map<string,long long>s;
    std::vector<int>::iterator it;
    string  s1,s2,s3,s4,s5,s6;
   cin>>n>>m;
   while(n>0)
   {
       n/=m;
       d++;


   }
   cout<<d<<endl;



}


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

#define ll             long long
#define LL             long long
#define pii            pair<int, int>
#define pll            pair<ll, ll>
#define pil            pair<int, ll>
#define pli            pair<ll, int>
#define vi             vector<int>
#define vl             vector<ll>
#define vii            vector<pii>
#define vll            vector<pll>
#define vil            vector<pil>
#define vli            vector<pli>
#define pb             push_back
#define ppb            pop_back
#define mp             make_pair
#define ff             first
#define ss             second
#define sz(x)          (int)x.size()
#define TN             typename
#define all(v)         v.begin(), v.end()
#define fill(a, b)     memset(a, b, sizeof(a))
#define endl           '\n'

template <TN T> T gcd(T a, T b) {return !b ? a : gcd(b, a % b);}
template <TN T> T lcm(T a, T b) {return a * (b / gcd(a, b));}
template <TN T> T sqr(T a) {return a * a;}
template <TN T> T cube(T a) {return a * a * a;}
template <TN T> inline void smin(T &a, T b) {a = a < b ? a : b;}
template <TN T> inline void smax(T &a, T b) {a = a > b ? a : b;}

template <TN T> inline void Int(T &n) {
	n = 0; int f = 1; register int ch = getchar();
	for (; !isdigit(ch); ch = getchar()) if (ch == '-') f = -1;
	for (; isdigit(ch); ch = getchar()) n = (n << 3) + (n << 1) + ch - '0';
	n = n * f;
}

#define error(args...) {vector <string> _v = split(#args, ','); err(_v.begin(), args); cout << endl;}
vector <string> split(const string &s, char c) {
	vector <string> v;
	stringstream ss(s); string x;
	while (getline(ss, x, c)) v.emplace_back(x);
	return move(v);
}
void err(vector <string> :: iterator it) {}
template <typename T, typename... Args>
void err(vector <string> :: iterator it, T a, Args... args) {
	cout << it -> substr((*it)[0] == ' ', it -> length()) << " = " << a << ", ";
	err(++it, args...);
}

inline int in() {int n; scanf("%d", &n); return n;}
inline ll Lin() {ll n; scanf("%lld", &n); return n;}
inline double Din() {double n; scanf("%lf", &n); return n;}

inline int add(int a, int b, int mod) {a += b; return a >= mod ? a - mod : a;}
inline int sub(int a, int b, int mod) {a -= b; return a < 0 ? a + mod : a;}
inline int mul(int a, int b, int mod) {return (ll)a * b % mod;}

const int N          = 2e5 + 5;
const ll  Mod        = (ll)1e9 + 7;
const int inf        = (int)2e9;
const ll  Inf        = (ll)1e18;
const int mod        = (int)1e9 + 7;


int solve() {
	int n = in(), k = in();
	vi h(n + 1);
	for (int i = 1; i <= n; i++) {
	 h[i] = in();	
	}
	vi dp(n + 1, inf);
	dp[1] = 0;
	for(int i = 1; i <= n; i++){
		for(int j = i + 1; j <= i + k; j++){
	        if(j <= n) smin(dp[j], dp[i] + abs(h[i] - h[j]));
		}
	}
	printf("%d\n", dp[n]);
	return 0;
}

int main() {
	int test = 1, tc = 0;
	//scanf("%d", &test);
	while (test--) {
		//printf("Case %d: ", ++tc);
		solve();
	}
	return 0;
}





Measured memory_bytes: 1024
#include <stdio.h>
#include <ctype.h>
#include <string.h>


int main() {
	long int X;
	int i=0;
	long long int m = 100;
	scanf("%ld", &X);
	while (1) {
		if (m >= X) {
			break;
		}
		m += m /100;
		
		i = i + 1;
	}
	printf("%d", i);
	return 0;
}


Measured memory_bytes: 1728
#include <stdio.h>
#define true 1
#define false -1
#define N 2000

int A[N],n,B[200];


int func(int i,int m){
  int res;
  if(m==0)return true;
  if(i>=n)return false;
  if(func(i+1,m)==true)res=true;
  else if(func(i+1,m-A[i])==true)res=true;
  else res=false;
    return res;
}

int  main(){
  int i,q,m,j=0;
  char s[2][4]={"yes","no"};

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

  scanf("%d",&q);
  for(i=0;i<q;i++){
    scanf("%d",&B[i]);
    if(func(0,B[i])==true)printf("%s\n",s[0]);
    else printf("%s\n",s[1]);
  }

  return 0;
}







Measured memory_bytes: 2104
mod = 10**9 + 7
def solve(n):
    s = 2*pow(9, n, mod) % mod
    d = pow(8, n, mod) % mod
    ans_inv = (s - d)%mod
    ans = (pow(10, n, mod) - ans_inv) % mod

    return ans

n = int(input())
print(solve(n))


Measured memory_bytes: 9040
n = int(input())
s = input()
s += s[0]

is_ans = False
for ans in ['SS', 'SW', 'WS', 'WW']:
    for i in range(1, n+1):
        a_0 = ans[i-1]
        a_1 = ans[i]
        if s[i] == 'o' and a_1 == 'S':
            if a_0 == 'S':
                ans += 'S'
            else:
                ans += 'W'
        elif s[i] == 'x' and a_1 == 'S':
            if a_0 == 'S':
                ans += 'W'
            else:
                ans += 'S'
        elif s[i] == 'o' and a_1 == 'W':
            if a_0 == 'S':
                ans += 'W'
            else:
                ans += 'S'
        else:
            if a_0 == 'S':
                ans += 'S'
            else:
                ans += 'W'
    if ans[-2:] == ans[:2]:
        print(ans[:-2])
        is_ans = True
        break
if not is_ans:
    print(-1)

Measured memory_bytes: 3444
# include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define pii pair<int,int>
typedef long long ll;
int n;
ll ans;
int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    cin>>n;
    for(int i=1;i<=n;i++){
        if(i%3!=0 && i%5!=0){
            ans+=i;
        }
    }
    cout<<ans<<endl;
}

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

int main() {
  	int N;
  	cin >> N;	
  
	vector<vector<int>> data(N+1, vector<int>(3));
  
 for (int i = 0; i < N; i++) {
    for (int j = 0; j < 3; j++) {
      cin >> data.at(i+1).at(j);
    }
  }
  
  bool can = true;
  for (int i = 0; i < N; ++i) {
    for (int j = 0; j < 3; j++) {
      int dt = data.at(i+1).at(0) - data.at(i).at(0);
      int dist = abs(data.at(i+1).at(1) - data.at(i).at(1)) 
        + abs(data.at(i+1).at(2) - data.at(i).at(2));
      if (dt < dist) can = false;
      if (dist % 2 != dt % 2) can = false;
    }
   }

    if (can) cout << "Yes" << endl;
    else cout << "No" << endl;
}

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

const int nax = 1e6 + 5;
int child[nax][26]; //trie
bool isEnd[nax];
int nxt=1;

int main(){
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    int n;
    cin >> n;
    vector<string> in(n);
    vector<vector<int>> path(n);
    for(int i=0;i<n;i++){
        string &s=in[i];
        cin>>s;
        reverse(s.begin(),s.end());
        int node=0;
        for(char ch : s){
            path[i].push_back(node);
            if(child[node][ch-'a'] == 0) {
                child[node][ch-'a'] = nxt++;
            }
            node=child[node][ch-'a'];
        }
        isEnd[node]=true;
    }
    
    long long answer=0;
    for(int i=0;i<n;i++ ){
        string &s=in[i];
        set<char> suffix;
        for(int j=(int)s.length()-1 ;j>=0;j--){
            int node=path[i][j];
            suffix.insert(s[j]);
            for(char ch:suffix){
                answer += isEnd[child[node][ch-'a']];
            }
        }
    }
    cout<<answer - n<<endl;
    return 0;
}


Measured memory_bytes: 112268
/**********************************JAI SAI RAM*****************************************/
//HELP IN CODEFORCES ROUND 638 DIV 2

#include<bits/stdc++.h>
using namespace std;
#define endl "\n"
typedef long long int ll;
ll P=1000000007;
ll MAX=P*(P-7);
ll MIN=-1*MAX;
const int sizes=100001;
const int BLK = 1200;

int main()
{
    ios_base::sync_with_stdio(false);
     cin.tie(0);
     ll i,j,k,l,m,n,o,p,q,r,s,t;
     cin>>n>>k;
     ll mp[100001]={0};
     for(i=0;i<k;i++)
     {
        cin>>o;
        for(j=0;j<o;j++)
        {
            cin>>l;
            mp[l]++;
        }
     }
     s=0;
     for(i=1;i<=n;i++)
     {
         if(mp[i]==0)
         s++;
     }
     cout<<s<<endl;
    return 0;
}


Measured memory_bytes: 4428
import java.util.ArrayList;
import java.util.Comparator;
import java.util.List;
import java.util.Scanner;

public class Main {

  public static void main(String[] args) {
    List<Integer> values = new ArrayList<>();
    Scanner scanner = new Scanner(System.in);
    for (int i = 0; i < 10; i++) {
      values.add(Integer.parseInt(scanner.nextLine()));
    }

    values.sort(Comparator.reverseOrder());

    for (int i = 0; i < 3; i++) {
      System.out.println(values.get(i));
    }
  }
}



Measured memory_bytes: 26340
def create_sums(ns):
    if len(ns) == 0:
        return set()

    s = create_sums(ns[1:])
    return {e + ns[0] for e in s} | s | {ns[0]}


def run_set():
    _ = int(input())  # flake8: noqa
    ns = [int(i) for i in input().split()]

    sums = create_sums(ns)
    _ = int(input())  # flake8: noqa

    for q in (int(j) for j in input().split()):
        if q in sums:
            print("yes")
        else:
            print("no")


if __name__ == '__main__':
    run_set()




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

int main(){
    long A, B, C, K;
    cin >> A >> B >> C >> K;
    long ans = 0;
    if (A >= K){
        ans += K;
    }
    else {
        ans += A;
        K -= A;
        if(B < K){
            K -= B;
            if (C >= K){
                ans -= K;
            }
        }
    }
    
    cout << ans << endl;
}




Measured memory_bytes: 3588
import sys
sys.setrecursionlimit(1000000000)
import math
from fractions import gcd
from itertools import count, permutations
from functools import lru_cache
from collections import defaultdict
from pprint import pprint
ii = lambda: int(input())
mis = lambda: map(int, input().split())
lmis = lambda: list(mis())
INF = float('inf')
N1097 = 10**9 + 7

def meg(f, ok, ng):
    while abs(ok-ng)>1:
        mid = (ok+ng)//2
        if f(mid):
            ok=mid
        else:
            ng=mid
    return ok
#

def main():
    N = ii()
    st = tuple(input().split() for _ in range(N))
    X = input()
    f = False
    ans = 0
    for s, t in st:
        if f:
            ans += int(t)
        if X==s:
            f = True
    print(ans)




main()


Measured memory_bytes: 5304
#include <iostream>
#include <string>

using namespace std;

#define ONE 1
 
int c[128];
 
void c2i(){
    c['i'] = 1;   c['x'] = 10;
    c['c'] = 100; c['m'] = 1000;
}
 
int main(){
    string s1,s2;
    int n;
     
    c2i();
     
    cin >> n;
    while(n--){
        int n1 = 0,n2 = 0,k;
        cin >> s1 >> s2;
        bool flg = false;
        for(int i = 0 ; i < s1.size() ; i++){
            if('0' <= s1[i] && s1[i] <= '9'){
                flg = true;
                k = s1[i] - '0';
                continue;
            }
            else{
                if(flg){
                    n1 += k*c[s1[i]];
                    flg = false;
                }
                else n1 += c[s1[i]];
            }
        }
 
        int l;
        for(int j = 0 ; j < s2.size() ; j++){
            if('0' <= s2[j] && s2[j] <= '9'){
                flg = true;
                l = s2[j] - '0';
                continue;
            }
            else{
                if(flg){
                    n2 += l*c[s2[j]];
                    flg = false;
                }
                else n2 += c[s2[j]];
            }
        }
         
        int sum = n1 + n2;
         
        int ans[4] = {0};
        while(sum){
            if(sum >= 1000){
                ans[0]++;
                sum -= 1000;
            }
            else if(sum >= 100){
                ans[1]++;
                sum -= 100;
            }
            else if(sum >= 10){
                ans[2]++;
                sum -= 10;
            }
            else{
                ans[3] = sum;
                sum = 0;
            }
        }
 
        char fig[4] = {'m','c','x','i'};
        for(int i = 0 ; i < 4 ; i++){
            if(ans[i] > ONE) cout << ans[i] << fig[i];
            else if(ans[i] == ONE) cout << fig[i];
        }
        cout << endl;
    }
    return 0;
}

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

int main() {
	int t,p,a,b;
	scanf("%d",&p);
	scanf("%d %d",&a,&b);
	for(int i=a;i<=b;i++) if(i%p==0) {
		printf("OK");
		return 0;
	}
	printf("NG");
	
}

Measured memory_bytes: 3728
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vl = vector<ll>;
using vvl = vector<vl>;
using vb = vector<bool>;
#define FOR(i,a,b) for(ll i = (a); i < (b); i++)
#define all(s) (s).begin(),(s).end()

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

    ll red = 0, white = 0;
    for(char c : s) {
        if(c == 'R') red++;
        else white++;
    }

    ll output = 0;
    FOR(i, 0, red) {
        char c = s[i];
        if(s[i] != 'R') output++;
    }
    cout << output << endl;

    /*ll wrongR = 0, wrongS = 0;
    
    bool hasS = false;
    for(char c : s) {
        if(hasS && c == 'R') wrongR++;
        if(c == 'W') hasS = true;
    }

    bool hasR = false;
    for(ll i = n - 1; i >= 0; i--) {
        char c = s[i];
        if(hasS && c == 'W') wrongS++;
        if(c == 'R') hasR = true;
    }

    cout << min(wrongS, wrongR) << endl;*/
}

Measured memory_bytes: 3680
#include<bits/stdc++.h>
using namespace std;
#define db(x){if(cond)cerr<<__LINE__<<" "<<#x<<" " <<x<<endl;}
#define rep(i,b)for(auto i=0;i<(b);++i)
#define fo(i,a,b)for(auto i=(a);i<=(b);++i)
#define ford(i,a,b)for(auto i=(a);i>=(b);--i)
#define vv vector
#define pb push_back
template<typename X>void MA(X&a,X b){a=max(a,b);}template<typename X>void MI(X&a,X b){a=min(a,b);}
template<typename X>void clr(X&x,int a){memset(x,a,sizeof(a));};typedef long long ll;typedef long double ld;
int cond=0,multi=0,gcj=0;
int A[(int)2e5+11];

void solve(){
  int N;cin>>N;
  rep(i,N)cin>>A[i];

  deque<int>B;
  rep(i,N){
    if(i%2==0)B.push_back(A[i]);
    else B.push_front(A[i]);
  }
  if(N%2==1)reverse(B.begin(),B.end());
  rep(i,N){
    if(i)cout<<" ";
    cout<<B[i];
  }
  cout<<"\n";

}

























































int main(int argc,char** argv){
  ios::sync_with_stdio(false),cin.tie(0),cond=argc>=2&&argv[1][0]=='q'?1<<30:0;
  cout.setf(ios::fixed),cout.precision(10);int t;if(multi||gcj)cin>>t;else t=1;
  fo(i,1,t){if(cond)cerr<<__LINE__<<" "<<i<<endl;if(gcj)cout<<"Case #"<<i<<": ";
    solve();
  }return 0;}


/*
stringstream io;
#define cin io
int init(){
  io<<1<<endl;
  int N=500000;
  io<<N<<" "<<N<<endl;
  fo(i,1,N-1)io<<i-1<<" ";io<<endl;
  fo(i,0,N-1)io<<i%2<<" ";io<<endl;
  fo(i,0,N-1)io<<(N-1-i)/2<<" ";io<<endl;

  return 0;
}
int xx=init();
*/


Measured memory_bytes: 3968
#include <bits/stdc++.h>
#include <algorithm>
#include <queue>
using namespace std;
int main(){
	int N, K; 
	cin >> N >> K; 
	int A[110] = {}; 
	for(int i = 1; i <= N; i++){
		cin >> A[i]; 
	}
	long long int dp[110][100010] = {}; // dp[i人目までに][j個配る]
	long long int DP[110][100010] = {}; // dp[i人目までに][j個以下配る]
	long long int P = 1e9 + 7; 
	dp[0][0] = 1; 
	for(int j = 0; j <= K; j++){
		DP[0][j] = 1; 
	}
	for(int i = 1; i <= N; i++){
		for(int j = 0; j <= K; j++){
			if(j <= A[i]) {dp[i][j] = DP[i-1][j];}
			else{dp[i][j] = (P + DP[i-1][j] - DP[i-1][j-A[i]-1]) % P;}
		if(j == 0) {DP[i][j] = 1;}
		else{DP[i][j] = (DP[i][j-1] + dp[i][j]) % P;}
        }
	}
	cout << dp[N][K] << endl; 
}

Measured memory_bytes: 172160
N = int(input())
happed = [list(map(int, input().split())) for _ in range(N)]
cnt = 0
for d1, d2 in happed:
    if d1 == d2:
        cnt += 1
        if cnt == 3:
            print("Yes")
            exit()
    else:
        cnt = 0
print("No")


Measured memory_bytes: 62388
#include<stdio.h>
#include<math.h>
#include<iostream>
#include<string>
#include<vector>
using namespace std;
int main() {
	int N;
	int R;
	cin >> N>>R;
	if (N < 10) {
		cout << R + 100 * (10 - N) << endl;
	}
	else {
		cout << R << endl;
	}
}

Measured memory_bytes: 3112
#include <algorithm>
#include <cstring>
#include <deque>
#include <functional>
#include <iostream>
#include <limits>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <vector>
using namespace std;
using ll = long long;
#define fst first
#define snd second

/* clang-format off */
template <class T, size_t D> struct _vec { using type = vector<typename _vec<T, D - 1>::type>; };
template <class T> struct _vec<T, 1> { using type = vector<T>; };
template <class T, size_t D> using vec = typename _vec<T, D>::type;
template <class T> vector<T> make_v(size_t size, const T& init) { return vector<T>(size, init); }
template <class... Ts> auto make_v(size_t size, Ts... rest) { return vector<decltype(make_v(rest...))>(size, make_v(rest...)); }
/* clang-format on */

int main() {
  int N;
  while (cin >> N) {
    bool found = false;
    for (int x = 0; x < 100; x++) {
      for (int y = 0; y < 100; y++) {
        if (4 * x + 7 * y == N) {
          found = true;
        }
      }
    }
    cout << (found ? "Yes" : "No") << endl;
  }
  return 0;
}


Measured memory_bytes: 256
#include <cassert>
#include <cctype>
#include <cerrno>
#include <cfloat>
#include <ciso646>
#include <climits>
#include <clocale>
#include <cmath>
#include <csetjmp>
#include <csignal>
#include <cstdarg>
#include <cstddef>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
/*
//#if __cplusplus >= 201103L
#include <ccomplex>
#include <cfenv>
#include <cinttypes>
#include <cstdbool>
#include <cstdint>
#include <ctgmath>
#include <cwchar>
#include <cwctype>
*/

// C++
#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <typeinfo>
#include <utility>
#include <valarray>
#include <vector>
/*
//#if __cplusplus >= 201103L
#include <array>
#include <chrono>
#include <condition_variable>
#include <forward_list>
#include <future>
#include <initializer_list>
#include <mutex>
#include <random>
#include <ratio>
#include <regex>
#include <scoped_allocator>
#include <system_error>
#include <thread>
#include <tuple>
#include <typeindex>
#include <type_traits>
#include <unordered_map>
#include <unordered_set>
*/
using namespace std;
#define fi first
#define se second
#define repl(i,a,b) for(int i=(int)(a);i<(int)(b);i++)
#define rep(i,n) repl(i,0,n)
#define each(itr,v) for(auto itr:v)
#define pb(s) push_back(s)
#define mmax(x,y) (x>y?x:y)
#define mmin(x,y) (x<y?x:y)
#define maxch(x,y) x=mmax(x,y)
#define minch(x,y) x=mmin(x,y)
#define mp(a,b) make_pair(a,b)
#define all(x) (x).begin(),(x).end()
#define dbg(x) cout<<#x"="<<x<<endl

#define uni(x) x.erase(unique(all(x)),x.end())
template<class T,class U>inline void chmin(T &t,U f){if(t>f)t=f;}
template<class T,class U>inline void chmax(T &t,U f){if(t<f)t=f;}
#define MAX(a, b) ((a) > (b) ? (a) : (b))
#define MIN(a, b) ((a) > (b) ? (b) : (a))

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> P;
typedef pair<P, int> PPI;

#define INF INT_MAX/3
#define MAX_N 1000
#define M_INF 1000000000
int n,m,v,i;
void solve(){
   cin.tie(0);
  ios::sync_with_stdio(false);
  cin>>n;
  std::vector<ll> v(n);
  rep(i,n) cin>>v[i];
  ll ans = v[0];
  rep(i,n) {
    ans = ans | v[i];
    // cout<<ans<<endl;
  }
  ll cnt = 0;
  // cout<<ans<<endl;
  while(true){
    if(ans % 2 == 1) break;
    else ans /=2;
    cnt++;
  }
  cout<<cnt<<endl;

}

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


Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <cstring>
#include <vector>
#include <queue>
#include <array>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <cmath>
#include <algorithm>
#include <numeric>
#include <cassert>
#include <utility>
#include <functional>

using namespace std;
using lli = long long int;
template<class T, class U> void init_n(vector<T>& v, size_t n, U x) 
{ v = vector<T>(n, x); }
template<class T> void init_n(vector<T>& v, size_t n) { init_n(v, n, T()); }
template<class T> void read_n(vector<T>& v, size_t n, size_t o = 0) 
{ v = vector<T>(n+o); for (lli i=o; i<n+o; ++i) cin >> v[i]; }
template<class T> void read_n(T a[], size_t n, size_t o = 0)
{ for (lli i=o; i<n+o; ++i) cin >> a[i]; }
template<class T> T gabs(const T& x) { return max(x, -x); }
#define abs gabs

lli n, k, h[100200], memo[100200];

lli dfs(lli x) {
  if (memo[x] >= 0) return memo[x];
  lli res = 1e18;
  for (lli d=1; d<=k; d++) {
    res = min(res, abs(h[x]-h[x+d]) +dfs(x+d));
  }
  return memo[x] = res;
}

int main() {
  cin >> n >> k;
  read_n(h, n);
  fill(&memo[0], &memo[n-1], -1);
  fill(&memo[n], &memo[n+k], 1e18);
  cout << dfs(0) << '\n';
  return 0;
}



Measured memory_bytes: 6528
n = int(input())
a = list(map(int, input().split()))
al_val = 0
bo_val = 0

while a:
    al_val += max(a)
    a.remove(max(a))
    if not a: break
    bo_val += max(a)
    a.remove(max(a))

print(al_val - bo_val)


Measured memory_bytes: 2940
//2017-10-11
//miaomiao
//
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <iostream>
#include <algorithm>

using namespace std;

#define For(i, a, b) for(int i = (a); i <= (int)(b); ++i)

int main(){
	int a, b;
	scanf("%d%d", &a, &b);

	if((a <= 0 && b >= 0) || !a || !b){
		puts("Zero"); return 0;	
	}

	if(a < 0){
		if((b-a+1) & 1) puts("Negative");
		else puts("Positive");
	}else puts("Positive");

	return 0;
}

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

int main() {
    int n, cnt = 0, ans = 0;
    cin >> n;
    rep2(i, n) {
        rep2(j, i) {
            if (i % j == 0)
                cnt++;
        }
        if (cnt == 8 && i % 2 == 1) {
            ans++;
        }
        cnt = 0;
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 3640
#include <stdio.h>
#include<string.h>

int main()
{
    int k,l=0,i;
    char s[1000];
    scanf("%d %s", &k, s);
    l=strlen(s);
    if(l<=k)
        printf("%s\n", s);
    else
    {
        for(i=0;i<k;i++)
        {
            printf("%c", s[i]);
        }
        printf("...\n");
    }
    return 0;
}


Measured memory_bytes: 1660
n=int(input())
mod=10**9+7
ans=[0]*(1000+1)
def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])

    if temp!=1:
        arr.append([temp, 1])

    if arr==[]:
        arr.append([n, 1])

    return arr

for i in range(1000+1):
  for j in factorization(i):
    ans[j[0]]+=j[1]
  if n==i:
    break
anss=1
for i in range(2,len(ans)):
  anss*=(ans[i]+1)%mod
  anss%=mod
print(anss)


Measured memory_bytes: 3064
#include<bits/stdc++.h>
#define int long long
#define F first
#define S second
#define P pair
#define FOR(i,a,b) for(int i=a;i<=b;i++)
#define V vector
#define RE return
#define ALL(a) a.begin(),a.end()
#define MP make_pair
#define PB push_back
#define PF push_front
#define FILL(a,b) memset(a,b,sizeof(a))
using namespace std;
char s[100005];
int dp[100005][2],mod=1e9+7;
signed main(){
	scanf("%s",s+1);
	int n=strlen(s+1);
	dp[0][0]=0;
	dp[0][1]=1;
	FOR(i,1,n){
		dp[i][0]=dp[i-1][0]*3%mod;
		if(s[i]=='1'){
			dp[i][1]=(dp[i-1][1]*2)%mod;
			dp[i][0]=(dp[i][0]+dp[i-1][1])%mod;
		}else dp[i][1]=dp[i-1][1];
	}
	cout<<(dp[n][0]+dp[n][1])%mod;
	RE 0;
}




Measured memory_bytes: 1920
#include<bits/stdc++.h>
#define ll long long
#define fast ios::sync_with_stdio(false); cin.tie(0);
#define f(i,s,e) for(int i=s;i<e;i++)
#define pb(x) push_back(x)
#define mp make_pair
#define mod 1000000007
#define all(x) x.begin(),x.end()
using namespace std;
int smu[100005];

int main(){
    fast;
    int n,q,x,y;
    cin>>n>>q;
    string s;
    cin>>s;
    smu[0]=0;
    f(i,1,s.size()){
        if(s[i]=='C' && s[i-1]=='A')
            smu[i+1]=1;
    }
    f(i,0,s.size()+1)
        smu[i]+=smu[i-1];
    while(q--){
        cin>>x>>y;
        cout<<smu[y]-smu[x]<<endl;
    }
}


Measured memory_bytes: 1488
import sys, bisect, math, itertools, string, queue, copy
import numpy as np
import scipy
from collections import Counter,defaultdict,deque
from itertools import permutations, combinations
from heapq import heappop, heappush
from fractions import gcd
input = sys.stdin.readline
sys.setrecursionlimit(10**8)
mod = 10**9+7
def inp(): return int(input())
def inpm(): return map(int,input().split())
def inpl(): return list(map(int, input().split()))
def inpls(): return list(input().split())
def inplm(n): return list(int(input()) for _ in range(n))
def inplL(n): return [list(input()) for _ in range(n)]
def inplT(n): return [tuple(input()) for _ in range(n)]
def inpll(n): return [list(map(int, input().split())) for _ in range(n)]
def inplls(n): return sorted([list(map(int, input().split())) for _ in range(n)])

n,a,b = inpm()

ret = (pow(2,n,mod) - 1)

modinv_table = [-1] * (max(a,b)+1)
modinv_table[1] = 1
for i in range(2, max(a,b)+1):
    modinv_table[i] = (-modinv_table[mod % i] * (mod // i)) % mod

def comb(n,r):
    x = 1
    y = 1
    for i in range(r):
        x = x*(n-i)%mod #コンビネーションの分子
        y = y*(i+1)%mod #コンビネーションの分母
    return (x * pow(y, mod-2, mod) % mod)
aa = comb(n,a)
bb = comb(n,b)

ret = (ret - aa - bb) % mod

print(ret)

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

template<typename T = double, bool is_min = true>
class ConvexHullTrick {
    using P = pair<T, T>;
    deque<P> L;

    T getY(const P &a, const T &x) {
        return a.first * x + a.second;
    }

    bool check(const P &a, const P &b, const P &c) {
        return (b.first - a.first) * (c.second - b.second) >= (b.second - a.second) * (c.first - b.first);
    }

    bool empty() const {
        return L.empty();
    }

public:
    void add_line(T a, T b) {
        if (!is_min) {
            a *= -1;
            b *= -1;
        }
        P line(a, b);
        if (!L.empty() && L.back().first == a) {
            line.second = min(line.second, L.back().second);
            L.pop_back();
        }
        while (L.size() >= 2 && check(L[L.size() - 2], L[L.size() - 1], line)) {
            L.pop_back();
        }
        L.emplace_back(line);
    }

    T query(T x) {
        assert(!empty());
        int l = -1, r = L.size() - 1;
        while (l < r - 1) {
            int m = (l + r) / 2;
            if (getY(L[m], x) >= getY(L[m + 1], x)) {
                l = m;
            } else {
                r = m;
            }
        }
        return (!is_min ? -1 : 1) * getY(L[r], x);
    }

    T query_monotone(T x) {
        assert(!empty());
        while (L.size() >= 2 && getY(L[0], x) >= getY(L[1], x)) {
            L.pop_front();
        }
        return (!is_min ? -1 : 1) * getY(L[0], x);
    }
};

int main() {
    int n;
    long long C;
    cin >> n >> C;
    vector<int> hs(n);
    for (int i = 0; i < n; i++) {
        cin >> hs[i];
    }

    vector<long long> dp(n);
    ConvexHullTrick<> cht;
    cht.add_line(-2 * hs[0], C + 1ll * hs[0] * hs[0]);
    for (int i = 1; i< n; i++) {
        long long r = cht.query(hs[i]) + 1ll * hs[i] * hs[i];
        dp[i] = r;
        cht.add_line(-2 * hs[i], C + 1ll * hs[i] * hs[i] + r);
    }

    cout << dp.back() << endl;
}


Measured memory_bytes: 5888
#include <iostream>
using namespace std;
int main(void){
  int N;
  cin >> N;
  int S = 0;
  int t = N;
  for(int i = 0; i < 10 ;i++, S += (t % 10), t /= 10) {}
  if(0 != (N % S)){
    cout << "No" << endl;
    return 0;
    
  }
  cout << "Yes" << endl;
  return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <numeric>
#include <string>
#include <vector>
#include <math.h>

using namespace std;
int func_check(int a, int b, int n)
{
	if (a + b == n)
	{
		return 1;
	}
	return 0;
}

int main(void)
{
	cin.tie(0);
	ios::sync_with_stdio(false);
	long long i, j, k;
	long long sx, sy, tx, ty;
	cin >> sx >> sy >> tx >> ty;
	long long w = tx - sx;
	long long h = ty - sy;
	string result;
	for (i = 0; i < h; i++)
		result += 'U';
	for (i = 0; i < w; i++)
		result += 'R';
	for (i = 0; i < h; i++)
		result += 'D';
	for (i = 0; i < w; i++)
		result += 'L';
	result += 'L';
	for (i = 0; i < h + 1; i++)
		result += 'U';
	for (i = 0; i < w + 1; i++)
		result += 'R';
	result += "DR";
	for (i = 0; i < h + 1; i++)
		result += 'D';
	for (i = 0; i < w + 1; i++)
		result += 'L';
	result += 'U';
	cout << result;
	return 0;
}

Measured memory_bytes: 256