akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
#define fi first
#define se second
#define pb push_back
#define mp make_pair
#define sz(x) ((int)(x).size())
#define endl "\n"
#define fastio ios_base::sync_with_stdio(false); cin.tie(nullptr);
#define all(x) x.begin(),x.end()
#define y1 omg
#define INF 1000000010
#define FOR(x, n) for(int x=0; x<n; x++)
#define ini(x, n) memset(x, n, sizeof(x));
#define MOD ((int)1e9 + 7)
#define atoi(x) ((x)-'0')
using namespace std;
typedef long long ll;
typedef pair<int, int> ii;
typedef pair<int, ii> iii;
typedef vector<int> vi;
typedef vector<ii> vii;
typedef vector<vi> vvi;

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

int n;

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

Measured memory_bytes: 3620
#include<bits/stdc++.h>
using namespace std;
int main(){
  int a,b,c;
  cin >>a>>b>>c;
  if(a==5||a==7&&b==5||b==7&&c==5||c==7){
    if(a+b+c==17)cout<<"YES"<<endl;
    else cout<<"NO"<<endl;
  }
  else cout<<"NO"<<endl;
  return 0;
}

Measured memory_bytes: 256
#include <stdio.h>

void bigarea(int A, int B, int C, int D)
{
	int areaA, areaB;
	areaA = A*B;
	areaB = C*D;
	if (areaA == areaB)
	{
		printf("%d\n", areaA);
	}
	else if (areaA > areaB)
	{
		printf("%d\n", areaA);
	}
	else
	{
		printf("%d\n", areaB);
	}
}

int main(void)
{
	int A, B, C, D;

	scanf("%d %d %d %d", &A, &B, &C, &D);

	bigarea(A, B, C, D);

	return 0;
}


Measured memory_bytes: 128
# -*- coding: utf-8 -*-
# Luis Yoichi Morales January 2019


K=int(raw_input())
 
s=0
tmp=1
ans=0
A=[]
bfr=0
def func(a):
    sa=str(a)
    tmp=sum(int(s) for s in sa)
    return float(a)/tmp
 
while(ans<K):
    tmp2=tmp+10**s
    tmp3=tmp+2*10**s
    if func(tmp2) > func(tmp3):
        s+=1
    else:
        print(tmp)
        tmp = tmp2
        bfr=func(tmp)
        ans+=1


Measured memory_bytes: 2568
//
//  main.cpp
//  HelloWorld
//
//  Created by purple on 2020/04/13.
//  Copyright © 2020 Purple. All rights reserved.
//

#include <iostream>
#include <algorithm>
#include <string>
#include <fstream>
#include <regex>

using namespace std;

int main(int argc, const char * argv[]) {
    // insert code here...
    std::cin.tie(nullptr);
    std::ios::sync_with_stdio(false);

    
    int n;
    
    cin >> n;
    
    int t[n],x[n],y[n];
 
    
    t[0] = 0;
    x[0] = 0;
    y[0] = 0;
    
    for(int i=1; i<n+1; i++){
        cin >> t[i] >> x[i] >> y[i];
    }
    
    int tmpx,tmpy,tmpt;
    bool abs_flg = true; //絶対値判定用
    bool tmp_flg = true; //パリティ判定用
    bool ans_flg = true;
    
    for(int i=1; i<n+1; i++){
        //絶対値判定用
        tmpx = abs(x[i] - x[i-1]);
        tmpy = abs(y[i] - y[i-1]);
        tmpt = t[i] - t[i-1];
        
        
        if((tmpx+tmpy) > tmpt)
            abs_flg = false;
        
        
        //パリティチェック
        if((tmpx+tmpy)%2 != tmpt%2)
            tmp_flg = false;

        //最終チェック
        if(abs_flg && tmp_flg)
            ans_flg = true;
        else
            ans_flg = false;
        
        abs_flg = true;
        tmp_flg = true;

    }
    
    if(ans_flg)
        cout << "Yes" << endl;
    else
        cout << "No" << endl;
    
    
    return 0;
    
}


Measured memory_bytes: 1408
#include<bits//stdc++.h>
using namespace std;
typedef long long ll;
ll l,x,y,s = 0,d,n,m;
int main() {
    cin >> n >> m;
    if (2*n >= m) {
        cout << m / 2 << endl;
    }
    else {
        cout << n + (m - 2 * n) / 4 << endl;
    }
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
struct t{int x,y,z;};
int main(){
int n;
cin>>n;
int ans=0;
vector<t> v(n);
for(int i=0;i<n;++i){
int a,b,c; cin>>a>>b>>c;
if(a>b && b>c) v[i]=(t){a,b,c};
 else if(a>c && c>b) v[i]=(t){a,c,b};
 else if(b>a && a>c) v[i]=(t){b,a,c};
 else if(b>c && c>a) v[i]=(t){b,c,a};
 else if(c>a && a>b) v[i]=(t){c,a,b};
 else if(c>b && b>a) v[i]=(t){c,b,a};
}
for(int i=0;i<n;++i)
  for(int j=n-1;j>i;--j)
    if(v[i].x>v[j].x) swap(v[i],v[j]);
for(int i=0;i<n;++i)
  for(int j=n-1;j>i;--j)
    if(v[i].x==v[j].x && v[i].y>v[j].y) swap(v[i],v[j]);
for(int i=0;i<n;++i)
  for(int j=n-1;j>i;--j)
    if(v[i].x==v[j].x && v[i].y==v[j].y && v[i].z>v[j].z) swap(v[i],v[j]);
for(int i=1;i<n;++i)
  if(v[i].x==v[i-1].x && v[i].y==v[i-1].y && v[i].z==v[i-1].z)
    ans++;
cout<<ans<<endl;
return 0;
}

Measured memory_bytes: 3120
k = gets.to_i
n = 50
result = []
for i in 0..n-1
	result.push(i)
end

kasan = k/n
amari = k%n

result = result.map { |n| n+kasan }

for i in 1..amari
	result[-i] += 1
end

puts n
puts result.join(" ")



Measured memory_bytes: 1788
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#define rep(i, n) for (int i = 0; i < (n); i++)
using namespace std;

int64_t modpow(int64_t a, int64_t n, int64_t mod) {
  int64_t ret = 1;
  while (n > 0) {
    if (n & 1) ret = ret * a % mod;
    a = a * a % mod;
    n /= 2;
  }
  return ret;
}

int main(void) {
  ios::sync_with_stdio(false);
  int N;
  cin >> N;
  map<pair<int64_t, int64_t>, pair<int, int>> memo;
  int zero = 0;
  rep(i, N) {
    int64_t x, y;
    cin >> x >> y;
    if (x == 0 && y == 0) {
      ++zero;
      continue;
    }

    int64_t g = std::gcd(x, y);
    x /= g;
    y /= g;
    if (y <= 0) {
      x = -x;
      y = -y;
    }
    if (x < 0) {
      int64_t tmp = x;
      x = y;
      y = -tmp;
      memo[{x, y}].first++;
    } else {
      memo[{x, y}].second++;
    }
  }

  const int64_t mod = 1e9 + 7;
  int64_t answer = 1;
  for (auto& group : memo) {
    int64_t s = group.second.first;
    int64_t t = group.second.second;

    int64_t now = 1;
    now = (now + modpow(2, s, mod) - 1 + mod) % mod;
    now = (now + modpow(2, t, mod) - 1 + mod) % mod;
    answer = (answer * now) % mod;
  }
  answer = (answer - 1 + mod) % mod;
  answer = (answer + zero) % mod;
  cout << answer << endl;
  return 0;
}


Measured memory_bytes: 15984
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const ll INF = 1e18;
const ll mod = 1000000007;

#define rep(i, n) for (int i = 0; i < (int)(n); i++)
template<class T> inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template<class T> inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return 1;
  }
  return 0;
}
int ctoi(char c) {
  if (c >= '0' && c <= '9') {
    return c - '0';
  }
  return 0;
}
ll factorial(ll n) {
  if (n == 1) {
    return 1;
  }
  ll ans = factorial(n-1);
  return ans*n;
}
ll gcd(ll a, ll b) {
  if (a < b) {
    ll tmp = a;
    a = b;
    b = tmp;
  }
  ll r = a%b;
  while(r != 0) {
    a = b;
    b = r;
    r = a%b;
  }
  return b;
}
ll lcm(ll a, ll b) {
  return (a/gcd(a, b))*b;
}

ll t = 0;
vector <vector <bool>> v(100, vector <bool> (100, 0));
vector <ll> color(100);
vector <ll> start(100);
vector <ll> finish(100);

void dfs(ll i) {
  color.at(i) = 1;
  t++;
  start.at(i) = t;
  rep(j, color.size()) {
    if (v.at(i).at(j) == 0) continue;
    if (color.at(j) == 0) dfs(j);
  }
  color.at(i) = 2;
  t++;
  finish.at(i) = t;
  return;
}

int main() {
  ll n;
  cin >> n;
  rep(i, n) {
    ll a, b, c;
    cin >> a >> b;
    rep(j, b) {
      cin >> c;
      if (a != c) {
        v.at(a-1).at(c-1) = 1;
      }
    }
  }
  rep(i, n) color.at(i) = 0;
  rep(i, n) {
    if (color.at(i) == 0) dfs(i);
  }
  rep(i, n) cout << i+1 << ' ' << start.at(i) << ' ' << finish.at(i) << endl;
}


Measured memory_bytes: 3172
#include <iostream>

int main(void) 
{
    int a, b, c;
    std::cin >>  a;
    std::cin >>  b;
    std::cin >>  c;
    if (a < c) {
        int t = a;
        a = c;
        c = t;
    }
    if (a < b) {
        int t = a;
        a = b;
        b = t;
    }
    if (b < c) {
        int t = b;
        b = c;
        c = t;
    }
    std::cout << c << " " << b << " " << a << std::endl;
    return 0;
}

Measured memory_bytes: 1164
#include <bits/stdc++.h>
using namespace std;
typedef long long LL;
template<class T> bool umin(T &a, T b) { return a > b ? (a = b, true) : false; }
template<class T> bool umax(T &a, T b) { return a < b ? (a = b, true) : false; }
#define ALL(x) (x).begin(), (x).end()
LL POW(LL a,LL p,LL M){ if(!p) return 1LL;LL T = POW(a,p/2,M);T = T*T%M; if(p&1) T=T*(a%M)%M; return T; }
LL SQRT(LL a) { LL b = (LL)sqrtl(((double)a)+0.5); while(b*b<a) ++b; while(b*b>a) --b; return (b*b==a)?b:-1; }
//endl
//<------------------------edits---------------------------------------------->
const LL MOD = 1e9+7;//998244353
// #define LOCAL LDD
// #define int LL

int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.precision(10);cout << fixed;
#ifdef LOCAL
  freopen("input.txt", "rt", stdin);
#endif
  int n;cin >> n;
  int x,y;cin >> x >> y;
  int arr[n];
  memset(arr,0,sizeof(arr));
  for(int i=1;i<=n;i++) for(int j=i+1;j<=n;j++){
    if(i<=x){
      if(j<=x) arr[j-i]++;
      else if(j<=y){
        arr[(x-i)+min(y-j+1,j-x)]++;
      }else{
        arr[x-i+j-y+1]++;
      }
    }else if(i<=y){
      if(j<=y){
        arr[min(j-i,i-x+y-j+1)]++;
      }else{
        arr[min(j-i,i-x+j-y+1)]++;
      }
    }else{
      arr[j-i]++;
    }
  } 
  for(int i=1;i<n;i++) cout << arr[i] << endl;
  cerr << "Time elapsed: " << 1.0 * clock() / CLOCKS_PER_SEC << " s\n";
  return 0;
}

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

int main(void){
    int N, ubuf, vbuf;
    cin >> N;
    long long res = (long long)N*(N+1)*(2*N+4)/12;
    for(int i=0; i<N-1; i++){
        cin >> ubuf >> vbuf;
        res -= (long long)min(ubuf, vbuf)*(N-max(ubuf, vbuf)+1);
    }
    cout << res << endl;
}

Measured memory_bytes: 3636
#include <bits/stdc++.h>
#include <algorithm>
using namespace std;
 
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep1(i, n) for (int i = 1; i < (int)(n); i++)
#define print(a) cout << (a) << endl; 
typedef long long ll;
const int MOD = 1000000007; 
 
int main() {
    int a, b, c;
    cin >> a >> b >> c;
    if ((a == b && b != c) || (a != b && b == c) 
        || (a == c && c != b)) {
        cout << "Yes" << endl;
    }  else cout << "No" << endl;
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <sstream>
#include <algorithm>
#include <cmath>
#include <vector>
#include <string>
#include <map>

using namespace std;

#define DEBUG(x) cerr << #x << " = " << x << endl

const double INF = 1e9;
const double EPS = 1e-8;
inline double SQ(double x) { return x * x; }
inline bool EQ(double x, double y) {
    return abs(x - y) < EPS;
}

string to_bit(int n) {
    string s;
    for(int i = 11; i >= 0; i--) {
        if(n & (1 << i)) s.push_back('1');
        else s.push_back('0');
    }
    return s;
}

vector<double> vec;
inline double D(int f, int t) {
    double l = vec[f];
    double r = vec[t];
    return sqrt(SQ(l + r) - SQ(l - r));
}

int N;
const int MAX_N = 12;
double dp[MAX_N][1 << MAX_N];

double tsp(int v, int b) {
    if(EQ(dp[v][b], -1) == false) return dp[v][b];
    if(b == (1 << N) - 1) return dp[v][b] = vec[v];

    double s = 0;
    if(b == 0) s += vec[v];

    double res = INF;
    for(int i = 0; i < N; i++) {
        if(b & (1 << i)) continue;

        if(v == i) res = min(res, s + tsp(i, b | (1 << i)));
        else res = min(res, s + D(v, i) + tsp(i, b | (1 << i)));
    }

    return dp[v][b] = res;
}

int main() {
    for(string line; getline(cin, line); ) {
        istringstream iss(line);
        double len; iss >> len;
        vec.clear();
        for(double r; iss >> r; ) {
            vec.push_back(r);
        }
        N = vec.size();
        for(int v = 0; v < N; v++) {
            for(int b = 0; b < (1 << N); b++) {
                dp[v][b] = -1;
            }
        }
        double res = INF;
        for(int i = 0; i < N; i++) {
            res = min(res, tsp(i, 0));
        }
        // DEBUG(res);
        cout << (res < len + EPS ? "OK" : "NA") << endl;
    }
}

Measured memory_bytes: 1636
use std::vec::Vec;

fn read<T: std::str::FromStr>() -> T {
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).ok();
    s.trim().parse().ok().unwrap()
}

fn read_vec<T: std::str::FromStr>() -> Vec<T> {
    read::<String>().split_whitespace().map(|e| e.parse().ok().unwrap()).collect()
}

fn main() {
    let n: usize = read();
    let p: Vec<usize> = read_vec();
    let mut v: Vec<bool> = vec![false; n];
    for i in 0..n {
      v[i] = (i+1 == p[i]);
    }

    let mut ans = 0;
    for i in 0..n {
      if v[i] && i < n - 1{
        ans += 1;
        v[i] = false;
        v[i+1] = false;
      } else if v[i] && i == n-1 {
        ans += 1;
      }
    }

    println!("{}", ans);
}


Measured memory_bytes: 4352
#include<bits/stdc++.h>
#define M 200005
using namespace std;
int n,mx,mx2,A[M];
int main(){
	scanf("%d",&n);
	for(int i=1;i<=n;i++)scanf("%d",&A[i]);
	for(int i=1;i<=n;i++){
		if(A[i]>mx){
			mx2=mx;
			mx=A[i];
		}else if(A[i]>mx2)mx2=A[i];
	}
	for(int i=1;i<=n;i++){
		if(A[i]==mx)printf("%d\n",mx2);
		else printf("%d\n",mx);
	}
	return 0;
}

Measured memory_bytes: 2432
#include <iostream>
#include <vector>
//#include <stdio.h>
#include <algorithm>
using namespace std;

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

    int i;
    vector<int> d(N);
    for(i=0;i<N;i++){
        cin >> d.at(i);
    }

    sort(d.begin(), d.end());

    int flag=0;
    for(i=0;i<N-1;i++){
        if(d.at(i)==d.at(i+1)) flag++;
    }

    cout << N - flag << endl;
}



Measured memory_bytes: 256
#include <iostream>

using namespace std;

int gcd(int a, int b) {
    if (a < 0) {
        a = -a;
    }
    if (b < 0) {
        b = -b;
    }
    if (a < b) {
        int t = a;
        a = b;
        b = t;
    }

    while (b > 0) {
        int t = a % b;
        a = b;
        b = t;
    }
    return a;
}

int main() {
    int n, x;
    cin >> n >> x;

    int d = 0;
    for (int i = 0; i < n; i++) {
        int a;
        cin >> a;
        d = gcd(d, a - x);
    }

    cout << d << endl;

    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define ll long long int
#define pb push_back
#define mp make_pair
#define mod 1000000007
#define pi 3.141592653589793
using namespace std;


int main() {
//    cout << fixed << setprecision(10);
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);

    int n, e;
    cin >> n;
    set<int> st;
    for (int i = 0; i < n; i++) {
        cin >> e;
        st.insert(e);
    }

    cout << (st.size() == n ? "YES" : "NO");

}


Measured memory_bytes: 9600
#include<iostream>
#include<vector>
#include<sstream>
#include<string>
#include<numeric>
#include <algorithm>
#include<math.h>
#include<cstdio>
#include<string.h>
#include<stdio.h>
using namespace std;
typedef long long ll;
int input(){
  int x;
  cin>>x;
  return x;
}
int abs(int x){
  if(x>=0){
    return x;
  }else{
    return -x;
  }
}
int gcd(int x, int y){
	if(x<y){
    return gcd(y,x);
  }
  if(y==0){
    return x;
  }
  return gcd(y,x%y);
}
int moji(char in)
{
    int ans = (int)in-(int)'a'+1;
    if((in < 1) || (in > 26)){
        ans = 100;
    }
    return ans;
}
int graph[51][51];
int subgraph[51][51];
int used[51];
void tansaku(int startx){
  for(int i=0;i<51;i++){
    if(subgraph[startx][i]==1){
      subgraph[startx][i]=0;
      subgraph[i][startx]=0;
      used[i]=0;
      tansaku(i);
    }
  }



}







int main() {
  int N;
  cin>>N;
  if(N==1){
    cout<<"Hello World"<<endl;
  }else{
    int A,B;
    cin>>A>>B;
    cout<<A+B<<endl;
  }


  




  
  
}

  

  



Measured memory_bytes: 256
#pragma GCC optimize("O3", "unroll-loops", "omit-frame-pointer", "inline")
#pragma GCC optimize("tree-vectorize")
#pragma GCC option("arch=native", "tune=native", "no-zero-upper")
#include <iostream>
#include <vector>
#include <algorithm>

using namespace std;
using int64 = int64_t;
#define rep(i, n) for (int i = 0; i < (int)(n); ++i)
#define all(v) (v).begin(), (v).end()

void fastin(int64 &num) {
  bool negative = false;
  int64 c;
  num = 0;
  c = getchar_unlocked();
  if (c == '-') {
    negative = true;
    c = getchar_unlocked();
  }
  for (; (c > 47 && c < 58); c = getchar_unlocked()) num = (num << 3) + (num << 1) + c - 48;
  if (negative) num *= -1;
}

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

int main(){
    int64 n, m; fastin(n); fastin(m);
    vector<int64> x(m);
    rep(i, m) fastin(x[i]);

    sort(all(x));

    vector<int64> diff(m - 1);
    rep(i, m - 1){
        diff[i] = x[i + 1] - x[i];
    }

    sort(all(diff));

    int64 ans = 0;
    int range = m - n;
    for (int i = 0; i < range; ++i){
        ans += diff[i];
    }

    fastout(ans);
    
    return 0;
}


Measured memory_bytes: 1792
#include <iostream>
#include <string>
#include <math.h>
using namespace std;

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

  for(int i=1; i<=n; i++){
    x = i;
    s = std::to_string(x);
    if(x % 3 == 0 || x % 10 ==3){
      cout << " " << i; continue;
    }
    else{
      int k=s.size();
      while(k>0){
        k=k-1;
        int j = pow(10,k);
        if( (x / j) % 10 == 3){
          cout << " " << i;
          break;
        }
      }
    }
  }
  cout << endl;

  return 0;
}

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

using namespace std;

typedef long long ll;

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

int main() {
    ll n, x;
    cin >> n >> x;

    vector<ll> vs(n);
    for (ll &v : vs) {
        cin >> v;
        v -= x;
        v = abs(v);
    }

    sort(vs.begin(), vs.end());
    ll all_gcd = vs[0];

    for (int i = 1; i < n; i++) {
        all_gcd = gcd(all_gcd, vs[i]);
    }
    cout << all_gcd << endl;   
}

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

using namespace std;

typedef unsigned long long ull;
typedef long long ll;
typedef long double ld;
//#define int ll
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<int> vi;
typedef vector<pii> vpi;
typedef vector<vi> vvi;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef vector<ld> vld;
typedef vector<vld> vvld;
typedef pair<ld, ld> pld;

#define inmin(a, b) a = min(a, (b))
#define inmax(a, b) a = max(a, (b))
#define mp(a, b) make_pair((a), (b))
#define ALL(a) a.begin(),a.end()
#define RALL(a) a.rbegin(),a.rend()
#define SZ(a) ((int)((a).size()))
#define watch(x) cerr << (#x) << " = " << (x) << endl;

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

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

template<class T>
inline ostream &operator<<(ostream &out, vector<T> &a) {
    out << "[";
    for (int i = 0; i < a.size(); i++)
        out << a[i] << vector<string>{", ", "]  "}[i + 1 == a.size()];
    return out;
}


void smain();

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

#ifdef RUS_HOME
    freopen("input.txt", "r", stdin);
    clock_t start = clock();
#else
    //    freopen("king.in", "r", stdin);
    //    freopen("king.out", "w", stdout);
#endif

    cout << setprecision(12) << fixed;
    smain();

#ifdef RUS_HOME
    cout << "\n\n\n\nTOTAL EXECUTION TIME: " << float(clock() - start) / CLOCKS_PER_SEC << endl;
#endif

    return 0;
}

void smain() {

    int n, l;
    cin >> n >> l;
    vi a(n);
    int pos = -1;
    for (int i = 0; i < n; i++) {
        cin >> a[i];
        if (i) {
            if (a[i] + a[i - 1] >= l) {
                pos = i;
            }
        }
    }
    if (pos == -1) {
        cout << "Impossible";
        return;
    }


    cout << "Possible\n";

    for (int i = 0; i < pos - 1; i++) {
        cout << i + 1 << "\n";
    }

    for (int i = n - 2; i >= pos; i--) {
        cout << i + 1 << "\n";
    }

    cout << pos << "\n";

}

Measured memory_bytes: 1280
#include <bits/stdc++.h>
using namespace std;
typedef pair<int,int> P;
typedef pair<P,int> T;
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vll;
#define pb push_back
#define mp make_pair
#define eps 1e-9
#define INF 2000000000
#define LLINF 1000000000000000ll
#define sz(x) ((int)(x).size())
#define fi first
#define sec second
#define all(x) (x).begin(),(x).end()
#define sq(x) ((x)*(x))
#define rep(i,n) for(int (i)=0;(i)<(int)(n);(i)++)
#define repn(i,a,n) for(int (i)=(a);(i)<(int)(n);(i)++)
#define EQ(a,b) (abs((a)-(b))<eps)
template<class T> void chmin(T& a,const T& b){if(a>b)a=b;}
template<class T> void chmax(T& a,const T& b){if(a<b)a=b;}
template<class T>
void dump(vector<T> &vec){
	for(int i=0;i<vec.size();i++){
		cout << vec[i];
		if(i+1<vec.size())cout << ' ';
		else cout << endl;
	}
	return;
}
int N;
int H[100100];
int dp[100100];
int main(){
	cin >> N;
	for(int i=0;i<N;i++){
		cin >> H[i];
	}
	int ans = 0;
	for(int i=N-2;i>=0;i--){
		if(H[i]<H[i+1])dp[i]=0;
		else dp[i] = dp[i+1]+1;
		ans = max(ans,dp[i]);
	}
	cout << ans << endl;
	return 0;
}


Measured memory_bytes: 1024
using System;
using System.Collections.Generic;
class Program
    {
    	static void Main(string[] args)
    	{
            string[] s1 = Console.ReadLine().Split(' ');
            int a = int.Parse(s1[0]), b = int.Parse(s1[1]);

            if (b == 1) Console.WriteLine(0);
            else Console.WriteLine(a - b);
        }
    }
    //mcs Main.cs
    //mono Main.exe

Measured memory_bytes: 11092
<?php

fscanf(STDIN, "%d %d %d", $a, $b, $x);

if ($x / $a > $a * $b / 2) {
    $theta = atan2(($a * $b - $x / $a) * 2 / $a, $a);
} else {
    $theta = atan2($b, 2 * $x / $a / $b);
}

echo $theta * 180 / pi();


Measured memory_bytes: 4856
#include <algorithm>
#include <cstdio>
#include <iostream>
#include <map>
#include <cmath>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
#include <stdlib.h>
#include <stdio.h>
#include <bitset>
#include <cstring>
using namespace std;
#define FOR(I,A,B) for(int I = (A); I < (B); ++I)
#define CLR(mat) memset(mat, 0, sizeof(mat))
typedef long long ll;
ll f(ll b, ll n) {
  if(n < b) return n;
  return f(b, n / b) + n % b;
}
int main()
{
  ios::sync_with_stdio(false);
  cin.tie(0);
  ll n, s; cin >> n >> s;
  if(n < s) {
    cout << -1 << endl;
    return 0;
  }
  if(n == s) {
    cout << n + 1 << endl;
    return 0;
  }
  ll ans = 1e15;
  for(ll b = 2; b * b <= n; b++) {
    if(f(b, n) == s) {
      cout << b << endl;
      return 0;
    }
  }
  // b > sqrt(n)の時
  for(ll p = 1; p * p < n; p++) {
    if((n-s) % p == 0) {
      ll b = (n - s) / p + 1;
      if(f(b, n) == s) ans = min(ans, b);
    }
  }
  cout << (ans == 1e15 ? -1 : ans) << endl;
  return 0;
}

Measured memory_bytes: 256
package main

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

// I/O
type Scanner struct {
	sc *bufio.Scanner
}

func NewScanner() *Scanner {
	sc := bufio.NewScanner(os.Stdin)
	sc.Split(bufio.ScanWords)
	sc.Buffer(make([]byte, 1024), int(1e+9))
	return &Scanner{sc}
}

func (s *Scanner) nextStr() string {
	s.sc.Scan()
	return s.sc.Text()
}

func (s *Scanner) nextInt() int {
	i, e := strconv.Atoi(s.nextStr())
	if e != nil {
		panic(e)
	}
	return i
}

func (s *Scanner) nextFloat() float64 {
	f, e := strconv.ParseFloat(s.nextStr(), 64)
	if e != nil {
		panic(e)
	}
	return f
}

func (s *Scanner) nextRuneSlice() []rune {
	return []rune(s.nextStr())
}

func (s *Scanner) nextIntSlice(n int) []int {
	res := make([]int, n)
	for i := 0; i < n; i++ {
		res[i] = s.nextInt()
	}
	return res
}

func (s *Scanner) nextFloatSlice(n int) []float64 {
	res := make([]float64, n)
	for i := 0; i < n; i++ {
		res[i] = s.nextFloat()
	}
	return res
}

// Arithmetic
func max(nums ...int) int {
	m := nums[0]
	for _, i := range nums {
		if m < i {
			m = i
		}
	}
	return m
}

func min(nums ...int) int {
	m := nums[0]
	for _, i := range nums {
		if m > i {
			m = i
		}
	}
	return m
}

func abs(x int) int {
	if x > 0 {
		return x
	}
	return -x
}

func pow(x, y int) int {
	res := 1
	for i := 0; i < y; i++ {
		res *= x
	}
	return res
}

// Sort
type Val struct {
	id, num int
}
type ByNum []Val

func (a ByNum) Len() int           { return len(a) }
func (a ByNum) Less(i, j int) bool { return a[i].num < a[j].num }
func (a ByNum) Swap(i, j int)      { a[i], a[j] = a[j], a[i] }

func main() {
	sc := NewScanner()
	wtr := bufio.NewWriter(os.Stdout)
	grid := make([][]int, 3)
	for i := 0; i < 3; i++ {
		grid[i] = sc.nextIntSlice(3)
	}
	A := make([]int, 3)
	B := make([]int, 3)
	ok := true
	for a1 := 0; a1 <= 100; a1++ {
		A[0] = a1
		b1 := grid[0][0] - a1
		B[0] = b1
		B[1] = grid[0][1] - a1
		B[2] = grid[0][2] - a1
		A[1] = grid[1][0] - b1
		A[2] = grid[2][0] - b1
		for ai, row := range grid {
			for bi, v := range row {
				if v != A[ai]+B[bi] {
					ok = false
				}
			}
		}
	}

	if ok {
		fmt.Fprintln(wtr, "Yes")
	} else {
		fmt.Fprintln(wtr, "No")
	}
	wtr.Flush()
}


Measured memory_bytes: 640
//
// Created by Tetsuya Shiota on 2019/03/09.
//

#include<iostream>
#include <vector>

using namespace std;


/*
 *
 * 1: 1100
 * 2: 1000
 * 3: 10100000
 * 4: 1010101000000000
 *
 */

typedef long long ll;
ll f(ll N){
    if(N <= 0)return 0;

    int flag = 0;
    if(((N+1)/2)%2 == 1){
        flag = 1;
    }

    if(N%2 == 0){
        return (N ^ flag);
    }
    return flag;
}


int f2(int N){
    vector<int> V(20);

    for(int i = 0; i<=N; i++) {
        bitset<20> B(i);
        for(int j = 0; j<20; j++){
            V[j] += B[j];
        }
    }


bitset<20> tmp(N);
    for(int i = 0; i<20; i++)cout << tmp[i] <<' ';
    cout << "### ";

    for(auto v : V){
        cout << v%2 <<' ';
    }
    cout <<endl;

   return 0;
}

int main(){
     /*
    for(int i =0; i<100; i++){
        ll ans = f2(i);
        cout << i <<' ' << ans <<endl;
    }
     return 0;


    for(int i =0; i<10; i++){
        ll ans = f(i);
        cout << i <<' ' << ans <<endl;
    }
    // */

    ll A, B;
    cin >> A >>B;

    ll resA = f(A-1), resB = f(B);
    if(A == B){
        cout << A <<endl;
    }else{
        cout << (resA^resB) <<endl;

    }

}

Measured memory_bytes: 256
#pragma GCC optimize ("O3")
#pragma GCC target ("sse4")
#pragma GCC optimize("Ofast")
//*********************************************DO IT NOW****************************************************************
#include<bits/stdc++.h> 
#include<random>
#define int long long   
#define pp pair<int,int> 
#define ss second 
#define ff first 
#define pb push_back
#define mod 1000000007
#define pi 3.14159265359
#define mk(arr,n,type)  type *arr=new type[n];
#define sl s1.length();
#define yes cout<< "YES"<<endl
#define no  cout<< "NO"<<endl
#define all(v) (v).begin(),(v).end()
#define s(v)   sort(v,v+n)
#define  mt mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
#define read(a,n) for(int i=0;i<n;i++)cin>>a[i]
#define print(a,n) for(int i=0;i<n;i++)cout<<a[i]<<" "
#define for1(i,a,n)  for(int i=0;i<n;i++)
#define rep(i, c) for(int i = 0; i < (int)c; i++)
#define set(x) cout<<fixed<<setprecision(x);
using namespace std;
//**********************************************DO IT NO****************************************************************
void fastio()
{  
  #ifndef ONLINE_JUDGE
  freopen("INPUT.txt","r",stdin);
  freopen("OUTPUT.txt","w",stdout); 
  #endif
  ios_base :: sync_with_stdio(false); 
  cin.tie(NULL) ; 
  cout.tie(NULL);
}
int dp[101][1001],ans1=1e9,dp1[1000001];
int num[10];
int a[1000000];
int l(int n)
{
    int x=0;
    while(n)
    {
        x++;
        n/=10;
    }
    return x;
}
signed main()
{   
    fastio();
    int t=1;
   // cin>>t;
    while(t--)
    {  
      int a,b,c;
      cin>>a>>b>>c;
      if(a+b>=c)
      cout<<"Yes";
      else
      cout<<"No";
    }
}
// 🍪 🍪 🍪


Measured memory_bytes: 3612
#include <iostream>
#include <string>
#include <time.h>
#include <algorithm>
#include <map>
#include <set>
#include <vector>
using namespace std;
typedef long long  ll;
static const ll INF = (ll)1 << 62;
#define rep(i,s,n)for(ll i=s;i<n;i++)
#define repe(i,s,n)for(ll i=s;i<=n;i++)

int main() {
	string s; cin >> s;
	bool f1 = false;
	bool f2 = false;
	if ((s[0] == '0' && (s[1] >= '1' && s[1] <= '9')) ||
		((s[0] == '1' && (s[1] >= '0' && s[1] <= '2')))
		)
	{
		f1 = true;
	}

	if ((s[2] == '0' && (s[3] >= '1' && s[3] <= '9')) ||
		((s[2] == '1' && (s[3] >= '0' && s[3] <= '2')))
		)
	{
		f2 = true;
	}

	if (f1 && f2) {
		cout << "AMBIGUOUS " << endl;
	}
	else if (!f1 && f2) {
		cout << "YYMM" << endl;
	}
	else if (f1 && !f2) {
		cout << "MMYY" << endl;
	}
	else if (!f1 && !f2) {
		cout << "NA " << endl;
	}

	return 0;
}

Measured memory_bytes: 256
package main

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

var sc = bufio.NewScanner(os.Stdin)

func next() string {
	sc.Scan()
	return sc.Text()
}

func nextInt() int {
	a, _ := strconv.Atoi(next())
	return a
}

func main() {
	buf := make([]byte, 1024*1024)
	sc.Buffer(buf, bufio.MaxScanTokenSize)
	sc.Split(bufio.ScanWords)

	N := nextInt()
	c := 0
	for i := 0; i < N; i++ {
		if nextInt() == nextInt() {
			c++
		} else {
			c = 0
		}
		if c == 3 {
			fmt.Println("Yes")
			return
		}
	}
	fmt.Println("No")
}


Measured memory_bytes: 1808
import math
 
a,b,C = map(int, input().split())
S = (1/2)*a*b*math.sin(math.radians(C))
L = (a**2+b**2-2*a*b*math.cos(math.radians(C)))**(1/2)+a+b
h = 2*S/a
print(S)
print(L)
print(h)


Measured memory_bytes: 5712
#include<iostream>
#include<string>
#include<vector>
#include<cmath>
#include<algorithm>
#include<functional>
#include<iomanip>
#include<queue>
#include<ciso646>
#include<random>
#include<map>
using namespace std;
typedef long long ll;
const ll MOD = 1000000007;
const ll INF = (ll)1000000007 * 1000000007;
typedef pair<int, int> P;
typedef unsigned int ui;
int main(){
	int n, m;
	vector<string>s; string t;
	cin >> n;
	for (int i = 0; i < n; i++) {
		cin >> t;
		s.push_back(t);
	}
	cin >> m;
	int now = 0;
	for (int i = 0; i < m; i++) {
		cin >> t;
		bool f = false;
		for (int j = 0; j < n; j++) {
			if (s[j] == t)f = true;
		}
		if (f) {
			if (now == 0) {
				now = 1; cout << "Opened by " << t << endl;
			}
			else {
				now = 0; cout << "Closed by " << t << endl;
			}
		}
		else cout << "Unknown " << t << endl;
	}
	return 0;
}


Measured memory_bytes: 3196
#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<functional>
#include<map>
#include<cmath>
#include<iomanip>
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }

using namespace std;

#define INF 1e20
#define min_3(a, b, c) min(a, min(b, c));
typedef long long ll;

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

  s[k - 1] = s[k - 1] + 32;

  cout << s << endl;
}


Measured memory_bytes: 256
#include <algorithm>
#include <deque>
#include <iostream>
#include <map>
#include <set>
#include <tuple>
#include <vector>
using namespace std;
typedef long long ll;
ll MEMO[200][200];

int main() {
  ll H, W;
  cin >> H >> W;
  vector<vector<char>> MAP(H, vector<char>(W, 0));
  for (int i = 0; i < H; i++) {
    for (int j = 0; j < W; j++) {
      cin >> MAP[i][j];
    }
  }
  deque<pair<ll, ll>> q;
  pair<ll, ll> pos;
  vector<vector<int>> cnt(H, vector<int>(W, 2000005));
  const int d[2][2] = {{0, 1}, {1, 0}};
  ll h, w, next_h, next_w;

  q.push_back({0, 0});
  if (MAP[0][0] == '#') {
    cnt[0][0] = 1;
  } else {
    cnt[0][0] = 0;
  }
  while (!q.empty()) {
    pos = q.front();
    q.pop_front();
    h = pos.first;
    w = pos.second;
    for (int i = 0; i < 2; i++) {
      next_h = h + d[i][0];
      next_w = w + d[i][1];
      if (H <= next_h || W <= next_w) {  // out of range
        continue;
      }
      if (MAP[next_h][next_w] == '#') {
        if (MAP[h][w] == '.') {
          cnt[next_h][next_w] = min(cnt[next_h][next_w], cnt[h][w] + 1);
        } else {
          cnt[next_h][next_w] = min(cnt[next_h][next_w], cnt[h][w]);
        }
      } else {
        cnt[next_h][next_w] = min(cnt[next_h][next_w], cnt[h][w]);
      }
      if (MEMO[next_h][next_w] == 1) {
        continue;
      }
      MEMO[next_h][next_w] = 1;
      q.push_back({next_h, next_w});
    }
  }
  cout << cnt[H - 1][W - 1] << endl;
  return 0;
}

Measured memory_bytes: 512
#!/usr/bin/env python3

import sys
sys.setrecursionlimit(300000)

MOD = 1000000007  # type: int

def calc_fraction_mod(numerator, denominator):
    '''
        returns numerator / denominator (mod MOD)
    '''
    inv = pow(denominator, MOD - 2, MOD)
    return numerator * inv % MOD

def make_facts(n):
    '''
        make factorials
        0!(=1), 1!, 2!, 3! .... n!
    '''
    fact = [1]
    for i in range(n):
        fact.append((fact[i] * (i + 1)) % MOD)
    return fact

def make_combs(n, k):
    '''
        make [C(0, k), C(1, k), C(2, k) ..... C(n, k)]
    '''
    fact = [1] * (n + 1)
    for i in range(2, n + 1):
        fact[i] = (fact[i - 1] * i) % MOD

    ret = [0] * (n + 1)
    for i in range(k, n + 1):
        a = fact[i]
        b = (fact[k] * fact[i - k]) % MOD
        ret[i] = calc_fraction_mod(a, b)
    return ret


def solve(r: "List[int]", c: "List[int]"):
    #t = make_combs_(10, 2)
    ret = 0
    x = make_combs(r[1] + c[1] + 2, r[1])
    y = make_combs(r[0] + c[1] + 2, r[0] - 1)
    for i in range(c[0], c[1] + 1):
        ret += x[r[1] + i + 1]
        ret -= y[r[0] + i]
        ret %= MOD
    print(ret)
    return ret
    return

def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    r = [int()] * (2)  # type: "List[int]"
    c = [int()] * (2)  # type: "List[int]"
    for i in range(2):
        r[i] = int(next(tokens))
        c[i] = int(next(tokens))
    solve(r, c)

if __name__ == '__main__':
    main()


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

int main() {
	int n, m, x, t, s = 0, o = 0;
	cin >> n >> m >> x;
	for (int i = 0; i < m; i++){
		cin >> t;
		//cout << t << endl;
		if (t < x){
			s++;	
		}else{
			o++;
		}
	}
	//cout << s << " " << o << endl;
	cout << s + o - max(s, o) << endl;
	return 0;
}

Measured memory_bytes: 256
h, w = map(int, input().split())
a = [list(map(int, input().split())) for _ in range(h)]
for i in range(h):
    a[i] = [aij % 2 for aij in a[i]]

cnt, ans = 0, []
for i, ai in enumerate(a):
    for j in range(w)[::(i%2)*(-2)+1]:
        if cnt == 1:
            ans.append([bi + 1, bj + 1, i + 1, j + 1])
            ai[j] += 1
        cnt = int(ai[j] == 1)
        bi, bj = i, j

print(len(ans))
for q in ans:
    print(*q)


Measured memory_bytes: 99308
#include <climits>
#include <cstring>
#include <iostream>

// dp(i, j) : minimum cost for combining interval [i, j]

using namespace std;
using ll = long long;

const int NMAX = 4e2 + 11;

int n, a[NMAX];
ll  acc[NMAX];
ll  dp[NMAX][NMAX];

inline ll sum(int l, int r) { return acc[r] - (l > 0 ? acc[l - 1] : 0); }

ll solve(void)
{
    for (int l = n - 1; l >= 0; --l)
    {
        for (int r = l; r < n; ++r)
        {
            if (l == r)
                dp[l][r] = 0;
            else
            {
                dp[l][r] = LLONG_MAX;
                for (int i = l; i <= r - 1; ++i)
                    dp[l][r] =
                        min(dp[l][r], dp[l][i] + dp[i + 1][r] + sum(l, r));
            }
        }
    }

    return dp[0][n - 1];
}

int main(void)
{
    cin >> n;
    for (int i = 0; i < n; ++i)
    {
        cin >> a[i];
        acc[i] = a[i];
        if (i != 0)
            acc[i] += acc[i - 1];
    }

    cout << solve() << endl;
    return 0;
}


Measured memory_bytes: 1536
#define _USE_MATH_DEFINES
#include <bits/stdc++.h>
#define dump(x) cout << x << endl
typedef int64_t Int;

using namespace std;
using Graph = vector<vector<Int>>;

const double pi = M_PI;
const Int MOD = 1000000007;

int main() {
    Int n, k, q;
    cin >> n >> k >> q;
    vector<int> point(n, k - q);
    int a;
    for (int i = 0; i < q; i++) {
        cin >> a;
        point[--a]++;
    }

    for (int i = 0; i < n; i++) {
        if (point[i] <= 0) {
            cout << "No\n";
        } else {
            cout << "Yes\n";
        }
    }

    return 0;
}

Measured memory_bytes: 1024
#include<stdio.h>

int main(void){

    char a,b;

    scanf("%c %c",&a,&b);

    if(a == 'H'){
        (b == 'H') ? printf("H"):printf("D");
    }else{
        (b == 'H') ? printf("D"):printf("H");
    }

    return 0;
}


Measured memory_bytes: 128
import std.algorithm;
import std.array;
import std.ascii;
import std.bigint;
import std.complex;
import std.container;
import std.conv;
import std.functional;
import std.math;
import std.range;
import std.stdio;
import std.string;
import std.typecons;

auto readInts() {
	return array(map!(to!int)(readln().strip().split()));
}
auto readInt() {
	return readInts()[0];
}
auto readLongs() {
	return array(map!(to!long)(readln().strip().split()));
}
auto readLong() {
	return readLongs()[0];
}

void readlnTo(T...)(ref T t) {
    auto s = readln().split();
    assert(s.length == t.length);
    foreach(ref ti; t) {
        ti = s[0].to!(typeof(ti));
        s = s[1..$];
    }
}

class UnionFindTree {
public:
    this(size_t n) {
        parent = iota(n).array();
        rank = new size_t[](n);
    }
    size_t find(size_t n) {
        if(n == parent[n]) {
            return n;
        } else {
            parent[n] = find(parent[n]);
            return parent[n];
        }
    }
    void unite(size_t n, size_t m) {
        auto p1 = find(n);
        auto p2 = find(m);
        if(n == m) {
            return;
        }
        if(rank[p1] < rank[p2]) {
            swap(p1, p2);
        }
        if(rank[p1] == rank[p2]) {
            ++rank[p1];
        }
        parent[p2] = p1;
    }
private:
    size_t[] parent;
    size_t[] rank;
}
unittest {
    auto uft = new UnionFindTree(10);
    foreach(i; iota(10)) {
        assert(uft.find(i) == i);
    }
    foreach(i; iota(10).filter!(a => a%3 == 0).drop(1)) {
        uft.unite(i, i-3);
    }
    foreach(i; iota(10).filter!(a => a%3 == 0)) {
        assert(uft.find(0) == uft.find(i));
    }
    foreach(i; iota(10).filter!(a => a%3 != 0)) {
        assert(uft.find(0) != uft.find(i));
    }
}

const real eps = 1e-10;

const long p = 1_000_000_000 + 7;

void main(){
    auto s = readln().chomp();
    foreach(i; iota(26)) {
        char c = (i + 'a').to!char;
        auto x = new long[](s.length+1);
        foreach(j; iota(s.length)) {
            x[j+1] = x[j] + (s[j] == c ? 2: 0) - 1;
        }
        long l = 0;
        foreach(j; iota(2, s.length+1)) {
            if(x[j] - x[l] > 0) {
                writeln(l+1, " ", j);
                return;
            }
            if(x[l] > x[j-1]) {
                l = j-1;
            }
        }
    }
    writeln(-1, " ", -1);
}



Measured memory_bytes: 4376
import sys
input = sys.stdin.readline

n,k = map(int,input().split())
a = list(map(int,input().split()))

mod = 10**9+7
li = [0]*n
li2 = [0]*n

for i in range(n):
    for j in range(n):
        if a[i] > a[j]:
            li[i] += 1
            if i < j:
                li2[i] += 1

print((sum(li2)*k+sum(li)*(k-1)*k//2)%mod)



Measured memory_bytes: 41836
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
using namespace std;
using ll = long long;
using p = pair<int,int>;
const long long INF = 1ll << 60;

int N;

int main() {
  cin >> N;
  ll ans = 0;
  for(int i = 1; i<= N+1; i++){
    for(int j = 1; j <= (N/i) + 1; j++){
      int c = N - (i * j);
      if (c > 0) {
        ans++;
      }
    }
  }

  cout << ans << endl;

	return 0;
}



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

#define rep(i, a, b) for (int i = a; i < (int)(b); ++i)
#define rrep(i, a, b) for (int i = b - 1; i >= (int)(a); --i)

using namespace std;
using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>;
using vll = vector<ll>;

constexpr int MOD = 1000000007;

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

    int h, w;
    cin >> h >> w;

    vector<vector<bool>> maze(h, vector<bool>(w, false));
    rep(i, 0, h) {
        rep(j, 0, w) {
            char c;
            cin >> c;
            if (c == '.') { maze[i][j] = true; }
        }
    }

    vector<vll> dp(h, vll(w, 0));
    dp[0][0] = 1;
    rep(i, 0, h) {
        rep(j, 0, w) {
            if (!maze[i][j]) { continue; }
            // Input to dp[i][j].
            if (i > 0 && maze[i - 1][j]) { dp[i][j] = (dp[i][j] + dp[i - 1][j]) % MOD; }
            if (j > 0 && maze[i][j - 1]) { dp[i][j] = (dp[i][j] + dp[i][j - 1]) % MOD; }
        }
    }
    cout << dp[h - 1][w - 1] << endl;
    return 0;
}

Measured memory_bytes: 8320
#include <iostream>
#include <cstring>
#include <algorithm>
#include <vector>
#include <string>
#include <math.h>
#include <stdio.h>
#include <iomanip>
#include <limits>
#include <list>
#include <queue>
#include <tuple>
#include <map>
#include <sstream>
using namespace std;
#define MOD (long long int)(1e9+7)
#define ll long long int
#define rep(i,n) for(int i=0; i<(int)(n); i++)
#define reps(i,n) for(int i=1; i<=(int)(n); i++)
#define REP(i,n) for(int i=n-1; i>=0; i--)
#define REPS(i,n) for(int i=n; i>0; i--)
#define FOR(i,a,b) for(int i=a; i<(int)(b); i++)
#define ALL(x) (x).begin(),(x).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define SORT(c) sort(ALL(x))
#define CLR(a) memset((a), 0 ,sizeof(a))
#define PB push_back
#define MP make_pair
#define SP << " " <<
const int INF = 1001001001;
const ll LINF = 100100100100100100;
const double EPS = 1e-10;
const double PI  = acos(-1.0);
typedef pair<int,int> PII;
typedef vector<int> VI;
typedef vector<VI> VVI;

template<typename A, size_t N, typename T>
void Fill(A (&array)[N], const T &val){
    std::fill( (T*)array, (T*)(array+N), val );
}

__attribute__((constructor))
void initial(){
	cin.tie(nullptr);
	ios::sync_with_stdio(false);
	cout << fixed << setprecision(15);
}


signed main(){
	string S; cin>>S;
  int n = S.size();
  VI dp(n+5);

  rep(i,n+1) dp[i] = 0;
  dp[0] = 0; // 0文字目までは1通り
  dp[1] = 1; // 1文字目までは1通り
  bool flag = false; // 1つ前のiで1文字区切りならfalse
  for(int i=2; i<=n; i++){
    if(S[i-2]!=S[i-1]||flag){ // 1つ前の文字と同じでない、もしくはtrueなら1文字が可能
      if(dp[i]<dp[i-1]+1){ // もし1文字だけの方が場合の数が大きくなるなら採用
        flag = false; dp[i]=dp[i-1]+1;
      }
    }
    if(dp[i]<=dp[i-2]+1){ // 2文字区切りも考える
      flag = true; dp[i]=dp[i-2]+1;
    }
  }
  cout << dp[n] << endl;


  return 0;
}


Measured memory_bytes: 1428
import java.util.Scanner

object Main {

  val sc = new Scanner(System.in)
  def main(args: Array[String]): Unit = {
    val a = sc.nextInt
    val b = sc.nextInt
    val k = sc.nextInt

    val d = gcd(a,b)
    val res = (1 to d).filter(d % _ == 0).reverse(k - 1)

    println(res)
  }
  def gcd(a: Int, b: Int): Int = {
    if(b == 0) a
    else {
      if(a < b) gcd(b, a)
      else gcd(b, a%b)
    }
  }
}

Measured memory_bytes: 27196
#include<iostream>
#include<vector>
#include<string>
#include<map>
#define rep(i, start, end) for (int i = (int)start; i < (int)end; ++i)
#define rrep(i, start, end) for (int i = (int)start - 1; i >= (int)end; --i)
#define all(x) (x).begin(), (x).end()
using namespace std;
using ll = long long;
template<typename T> inline bool chmax(T& a, T b) {if (a < b) {a = b; return true;} return 0;}
template<typename T> inline bool chmin(T& a, T b) {if (a > b) {a = b; return true;} return 0;}

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    int N, M;
    cin >> N >> M;
    vector<int> X(N);
    for (auto& x : X) {
        cin >> x;
    }
    vector<map<int, int>> mods(M);
    for (auto& x : X) {
        ++mods[x % M][x];
    }
    int ans = 0;
    rep(m, 0, M / 2 + 1) {
        if (m == (M - m) % M) {
            int sum = 0;
            for (auto& i : mods[m]) {
                sum += i.second;
            }
            ans += sum / 2;
        }
        else {
            int sum1 = 0, sum2 = 0;
            for (auto& i : mods[m]) {
                sum1 += i.second;
            }
            for (auto& i : mods[M - m]) {
                sum2 += i.second;
            }
            if (sum1 > sum2) {
                int cnt = 0;
                for (auto& i : mods[m]) {
                    cnt += i.second / 2;
                }
                ans += sum2;
                ans += min(cnt, (sum1 - sum2) / 2);
            }
            else {
                int cnt = 0;
                for (auto& i : mods[M - m]) {
                    cnt += i.second / 2;
                }
                ans += sum1;
                ans += min(cnt, (sum2 - sum1) / 2);
            }
        }
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 9984
//Kaori Miyazono, did I reach you ?
#include <bits/stdc++.h>
using namespace std;
typedef long long int lli;
                        
int main(){
	ios::sync_with_stdio(0);cin.tie(0);
	string s;
	cin >> s;
	string k = "";
	for(int i = 0; i < s.size(); i++){
		if ( s[i] != 'x' ) k = k + s[i];
	}
	string h = k;
	reverse(h.begin(), h.end());
	if ( h != k ){
		cout << -1;
		return 0;
	}
	int ans = 0;
	int i = 0, j = s.size() - 1;
	while(i < j){
		if ( s[i] != s[j] ){
			ans++;
			if ( s[i] == 'x' ){
				j++;
			}
			else i--;
		}
		i++;
		j--;
	}
	cout << ans;
	return 0;	
}         






Measured memory_bytes: 868
//بسم الله الرحمن الرحيم
///   ***   ---   |||		 In the name of ALLAH		|||   ---   ***   ///
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define el << endl
#define PI 3.141592653589793238
#define _test_ int t; cin >> t; while(t--)
#define optimize() ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define file() freopen("input.txt", "r", stdin); freopen("output.txt", "w", stdout)
ll gcd ( ll  a, ll b ) { return __gcd ( a, b ); }
ll lcm ( ll a, ll b ) { return a * ( b / gcd ( a, b ) ); }
int dx[]={0,0,+1,-1,+1,-1,-1,+1};
int dy[]={+1,-1,0,0,+1,-1,+1,-1};
///*......................*//* LET'S BEGIN (-_^) *//*............................///
const int mx= 2e5+123;
int n,x,t;
string s;
int sum;

void _case_()
{
    cin >> s;
    for(int i=0;i<s.size();i++)
    {
        x=s[i]-'0';
        sum+=x;
        sum%=9;
    }
    sum ? cout << "No\n" : cout << "Yes\n";
}

int main()
{

    optimize();
    //_test_
      _case_();
    return 0;

}

///////////*  N A Y E M  *///////////

Measured memory_bytes: 3724
package main

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

func main() {
	stdin := bufio.NewScanner(os.Stdin)

	stdin.Scan()
	text := stdin.Text()

	//rgb := strings.ReplaceAll(text, " ", "")
	rgb := strings.Replace(text, " ", "", -1)
	n, _ := strconv.Atoi(rgb)


	if n % 4 == 0 {
		fmt.Println("YES")
	} else {
		fmt.Println("NO")
	}
}


Measured memory_bytes: 640
#include<iostream>
using namespace std;
bool f[31];
int main() {
	for (int i = 0;i < 28;i++) {
		int n; cin >> n;
		f[n] = true;
	}
	for (int i = 1; i <= 30;i++) {
		if (!f[i]) cout << i << endl;
	}
}

Measured memory_bytes: 3076
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const  ll INF = 1e18;
const  ll MOD = 1e9 + 7;
#define all(v) v.begin(), v.end()
#define repi(i,n,init) for(ll i=init;i<(n);i++)
#define repd(i,n,init) for(ll i=(n);i>=init;i--)
#define repm(i,m) for(auto i=m.begin();i!=m.end();i++)

int main()
{
    string S;
    cin >> S;
    repi(i,S.length()-1,0){
        if(S.at(i) == 'A' && S.at(i+1) == 'C'){
            puts("Yes");
            return 0;
        }
    }
    puts("No");
    return 0;
}

Measured memory_bytes: 256
//By Vlgd
#include<bits/stdc++.h>
#define INF 20000000
using namespace std;
const int N=100;
int G[N][N],n;
int vis[N]={0},dis[N]={0};
void solve(){
	int ans=0;
	for(int i=0;i<n;i++) dis[i]=INF;
	dis[0]=0;
	while(1){
		int mv=INF,u=-1;
		for(int i=0;i<n;i++){
			if(mv>dis[i]&&!vis[i]){
				mv=dis[i];
				u=i;
			}
		}
		if(u==-1) break;
		vis[u]=1;
		ans+=dis[u];

		for(int v=0;v<n;v++){
			if(!vis[v]&&G[u][v]!=-1){
				if (dis[v]>G[u][v])	dis[v]=G[u][v];
			}
		}
	}
	printf("%d\n",ans);	
}
main(){
	scanf("%d",&n);
	for (int i=0;i<n;i++) for (int j=0;j<n;j++) scanf("%d",&G[i][j]);
	solve();
}


Measured memory_bytes: 3232
import Data.List (intercalate)

main = do
  li <- getLine
  let k:x:[] = map read $ words li
  putStrLn $ intercalate " " $ map show $
    if x - k + 1 < -10^6 then
      [-10^6 .. x+k-1]
    else if x + k - 1 > 10^6 then
      [10^6 .. x-k+1]
    else
      [x-k+1 .. x+k-1]


Measured memory_bytes: 3952