akhauriyash/Code-Regression huggingface dataset:
#include<bits/stdc++.h>
#define rep(i,n)for(int i=0;i<(n);i++)
using namespace std;
typedef long long ll;

ll dat[400000], lazy[400000];
int n = 1;
inline void push(int k, int s) {
	if (lazy[k] == 0)return;
	dat[k] = lazy[k] * s;
	if (k < n - 1) {
		lazy[k * 2 + 1] = lazy[k];
		lazy[k * 2 + 2] = lazy[k];
	}
	lazy[k] = 0;
}
inline void upnode(int k) {
	dat[k] = dat[k * 2 + 1] + dat[k * 2 + 2];
}
inline void update(int a, int b, ll x, int k = 0, int l = 0, int r = n) {
	push(k, r - l);
	if (b <= l || r <= a)return;
	if (a <= l&&r <= b) {
		lazy[k] = x; push(k, r - l); return;
	}
	update(a, b, x, k * 2 + 1, l, (l + r) / 2);
	update(a, b, x, k * 2 + 2, (l + r) / 2, r);
	upnode(k);
}
inline ll query(int a, int b, int k = 0, int l = 0, int r = n) {
	push(k, r - l);
	if (b <= l || r <= a)return 0;
	if (a <= l&&r <= b)return dat[k];
	ll vl = query(a, b, k * 2 + 1, l, (l + r) / 2);
	ll vr = query(a, b, k * 2 + 2, (l + r) / 2, r);
	upnode(k);
	return vl + vr;
}
int main() {
	int N, q; scanf("%d%d", &N, &q);
	while (n < N)n <<= 1;
	rep(i, q) {
		int a; ll b; scanf("%d%lld", &a, &b); a--;
		int l = 0, r = a;
		while (l != r) {
			int t = (l + r) / 2;
			if (query(t, t + 1)*(a - t) - query(t + 1, a + 1) <= b)r = t;
			else l = t + 1;
		}
		b -= query(l, l + 1)*(a - l) - query(l + 1, a + 1);
		update(l, a + 1, query(l, l + 1) + b / (a - l + 1));
		update(l, l + b % (a - l + 1), query(l, l + 1) + 1);
	}
	rep(i, N)printf("%lld\n", query(i, i + 1));
}

Measured memory_bytes: 7296
#include<bits/stdc++.h>
#include <array>
using namespace std;
#define rep(i, n) for(int i = 0; i < (n); i++)
using ULL = unsigned long long;
using UL = unsigned;
using LL = long long;


struct Problem {

	void Solve() {
		ULL a, b, k;
		cin >> a >> b >> k;
		if (k <= a) { a -= k; k = 0; }
		else { k -= a; a = 0; }
		if (k <= b) { b -= k; k = 0; }
		else { k -= b; b = 0; }
		cout << a << " " << b << endl;
	}

	Problem();
};
int main() {
	unique_ptr<Problem> p(new Problem());
	p->Solve();
	return 0;
}
Problem::Problem() {
	cout << fixed << setprecision(10);
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define fastIO (cin.tie(0), cout.tie(0), ios::sync_with_stdio(false))
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define precise(i) fixed << setprecision(i)
using llint = long long int;
using namespace std;

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

    vector<int> W(n);
    int rightSum = 0;
    rep(i, n) {
        int weight;
        cin >> weight;
        W.at(i) = weight;
        rightSum += weight;
    }

    int leftSum = 0;
    int diff = 101 * 101;
    for (size_t i = 0; i < W.size(); i++) {
        leftSum += W.at(i);
        rightSum -= W.at(i);
        diff = min(diff, abs(rightSum - leftSum));
    }

    cout << diff << endl;
}


Measured memory_bytes: 3668
#include <algorithm>
#include <bitset>
#include <tuple>
#include <cstdint>
#include <cstdio>
#include <cctype>
#include <assert.h>
#include <stdlib.h>
#include <stdio.h>
#include <cassert>
#include <cfloat>
#include <climits>
#include <cmath>
#include <complex>
#include <ctime>
#include <deque>
#include <fstream>
#include <functional>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <list>
#include <limits>
#include <map>
#include <memory>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>
#define ArraySizeOf(array)     (sizeof(array) / sizeof(array[0]))
#define res(i,n) for(int i=n;;i++)
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define REP(i,n) for(int i=1;i<n;i++)
#define rev(i,n) for(int i=n-1;i>=0;i--)
#define REV(i,n) for(int i=n-1;i>0;i--)
#define req(i,n,m) for(int i=n;i<m;i++)
#define REQ(i,n,m,l) for(int i=n;i<m;i+=l) 
#define _GLIBCXX_DEBUG
int INF = 1e9 + 7;
unsigned NthDayOfWeekToDay(unsigned n, unsigned dow, unsigned dow1)
{
    unsigned day;
    if (dow < dow1) dow += 7;
    day = dow - dow1;
    day += 7 * n - 6;
    return day;
}
signed gcd(long long x, long long y) {
    if (y == 0)return x;
    return gcd(y, x % y);
}
signed lcm(long long x, long long y) {
    return x / gcd(x, y) * y;
}
unsigned DayToWeekNumber(unsigned day)
{
    return (day - 1) / 7 + 1;
}
unsigned AnotherDayOfWeek(unsigned day, unsigned day0, unsigned dow0)
{
    return (dow0 + 35 + day - day0) % 7;
}
using namespace std;
signed main() {
    int H, W; cin >> H >> W;
    vector<vector<char>>a(H+2, vector<char>(W+2,'#'));
    REP(i, H + 1) {
        string S; cin >> S;
        REP(j, W + 1)a[i][j] = S.at(j - 1);
    }
    rep(i, H + 2) {
        rep(j, W + 2)cout << a[i][j];
        cout << endl;
    }
}

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

using System.Collections;

class Program
{
    static void Main()
    {
        int N = int.Parse(Console.ReadLine());

        if (N == 1)
        {
            Console.WriteLine("Hello World");
            return;
        }

        int A = int.Parse(Console.ReadLine());
        int B = int.Parse(Console.ReadLine());

        Console.WriteLine(A + B);

    }
    
}


Measured memory_bytes: 13140
#include<stdio.h>

int main(void)
{
    int m, f, r;
    
    while (1) {
        scanf("%d %d %d", &m, &f, &r);
        
        if ( m == -1 && f == -1 && r == -1)
            break;
        if ( m == -1 || f == -1)
            printf("F\n");
        else if ( m+f >= 80)
            printf("A\n");
        else if ( m+f >= 65)
            printf("B\n");
        else if ( m+f >= 50)
            printf("C\n");
        else if ( m+f >= 30) {
            if ( r >= 50)
                printf("C\n");
            else
                printf("D\n");
        }else
            printf("F\n");
    }
    
    return 0;
}


Measured memory_bytes: 2052
import scala.math._

object Dice {
  type Dice[A] = (A, A, A, A, A, A)

  implicit class Tuple6Dice[A](self: Dice[A]) {

    def N: Dice[A] = self match {
      case (_1, _2, _3, _4, _5, _6) =>
        (_2, _6, _3, _4, _1, _5)
    }

    def E: Dice[A] = self match {
      case (_1, _2, _3, _4, _5, _6) =>
        (_4, _2, _1, _6, _5, _3)
    }

    def S: Dice[A] = self match {
      case (_1, _2, _3, _4, _5, _6) =>
        (_5, _1, _3, _4, _6, _2)
    }

    def W: Dice[A] = self match {
      case (_1, _2, _3, _4, _5, _6) =>
        (_3, _2, _6, _1, _5, _4)
    }

    def toList: List[A] = self match {
      case (_1, _2, _3, _4, _5, _6) =>
        List(_1, _2, _3, _4, _5, _6)
    }

    def run(commands: List[Char]): Dice[A] =
      commands.foldLeft(self) { (d, c) =>
        c match {
          case 'N' => d.N
          case 'E' => d.E
          case 'S' => d.S
          case 'W' => d.W
          case _   => d
        }
      }
  }
}

object Main extends App {
  val scanner = new java.util.Scanner(System.in)

  val label   = scanner.nextLine().split(" ")
  val command = scanner.nextLine()

  import Dice._

  val init = (1, 2, 3, 4, 5, 6)
  val fin  = init.run(command.toList)

  println(label(fin.toList.head-1))
}

Measured memory_bytes: 44984
#include <iostream>
#include <iomanip>
#include <map>
#include <unordered_map>
#include <list>
#include <set>
#include <unordered_set>
#include <vector>
#include <utility>
#include <algorithm>
#include <queue>
#include <stack>
#include <cstdint>
#include <cstdlib>
#include <cstdio>
#include <cstring>
#include <cmath>

#define rep(i, n) for(ll (i) = 0;(i) < (n);(i)++)
#define mp(a, b) make_pair((a),(b))
#define bs(n) ((ull)1<<(ull)n)

using namespace std;

typedef long long ll;
typedef unsigned long long ull;

constexpr ll inf = INT64_MAX / 4;
constexpr double pi = asin(1) * 2;
constexpr ll mod = 1000000007;
constexpr double eps = 0.000000001;

ll c[300000] = {0}, n, a[300000] = {0}, s = 0;

int main() {
    cin >> n;
    rep(i, n) {
        cin >> a[i];
        c[a[i]]++;
    }
    rep(i, n+1) {
        s += c[i] * (c[i] - 1);
    }
    rep(i, n) {
        ll t = (c[a[i]] - 1) * (c[a[i]] - 2) - c[a[i]] * (c[a[i]] - 1);
        cout << (s + t) / 2 << endl;
    }
}



Measured memory_bytes: 6144
#include <stdio.h>
#include <ctype.h>
 
void MCXI(char* mcxi,int num){                         //十進数をMCXI文字列に変換
  if(num>=1000){
    if(num>=2000)*(mcxi++)=(num/1000)+'0';             //千の位の値が2以上の場合　*mcxiの値が千の位の値と等しくなるまでインクリメント
    *(mcxi++)='m';                                     //千の位の値を表す数字の後ろにmを書き込み
    num%=1000;                                         //1000で割った余りをnumに更新　次のステップに進む
  }
  if(num>=100) {                                       //百の位の変換　理論は千の位と同じ
    if(num>=200)*(mcxi++)=(num/100)+'0';
    *(mcxi++)='c';
    num%=100;
  }
  if(num>=10) {                                        //十の位の変換　理論は千の位と同じ
    if(num>=20)*(mcxi++)=(num/10)+'0';
    *(mcxi++)='x';
    num%=10;
  }
  if(num>=1) {                                         //一の位の変換　理論は千の位と同じ
    if(num>=2)*(mcxi++)=(num/1)+'0';
    *(mcxi++)='i';
    num%=1;
  }
  *mcxi=0;                                             //*mcxiの値を0に初期化する
}
 
int decimal(const char* mcxi) {
  const char* nowp=mcxi;
  int num=1;
  int decimal=0;
  for(;*nowp;nowp++) {
    switch(*nowp) {
    case 'm':
      decimal+=1000*num;                               //返り値decimalに千の位の値を1000倍して加算
      num=1;                                           //numを1にリセット
      break;
    case 'c':                                          //百の位の変換　理論は千の位と同じ
      decimal+=100*num;
      num=1;
      break;
    case 'x':                                          //十の位の変換　理論は千の位と同じ
      decimal+=10*num;
      num=1;
      break;
    case 'i':                                          //一の位の変換　理論は千の位と同じ
      decimal+=1*num;
      num=1;
      break;
    default:
      if(isdigit(*nowp))num=*nowp-'0';                 //各位に前置きされた数字をnumに読み込み
    }
  }
  return decimal;                                      //変換された十進数を返り値として返す
}
 
int main(void) {
  int num,i;
  char MCXI_1[100],MCXI_2[100];
 
  struct{                                              //出力用の構造体配列
    char sum[100];
  }SUM[9999];
 
  scanf("%d",&num);                                    //先頭nを読み込み
 
  for(i=0;i<num;i++){
    scanf("%s%s",MCXI_1,MCXI_2);                       //2つのMCXI文字列を読み込み
    MCXI(SUM[i].sum,decimal(MCXI_1)+decimal(MCXI_2));  //2つのMCXI文字列をdecimal関数を使って十進数に変換
  }                                                    //MCXI関数を使ってMCXI文字列に変換　変換結果をi番目構造体配列に入れる
 
  for(i=0;i<num;i++){
    printf("%s\n", SUM[i].sum);                        //出力
  }
 
  return 0;
}

Measured memory_bytes: 784
#include <iostream>
  #include <string>
  #include <vector>
  #include <algorithm>
  #include <utility>
  #include <map>
  using namespace std;
  typedef long long ll;
  #define rep(i,n) for (int i=0;i < (int)(n);i++)
  ll mod = 1e9+7;

  ll dp[10001][101][2];
  
  int main(){
    string s;
    cin >> s;
    int n = s.size();
    int D;
    cin >> D;
    dp[0][0][0] = 1;

    rep(i,n) rep(j,D) rep(k,2){
      int nd = s[i] - '0';
      rep(d,10){
        int ni = i+1,nj = (j+d)%D,nk = k;
        if (k == 0){
          if (d > nd) continue;
          if (d < nd) nk = 1;
        }
        dp[ni][nj][nk] += dp[i][j][k];
        dp[ni][nj][nk]%=mod;
      }
    }
    ll ans = dp[n][0][0] + dp[n][0][1];
    ans-=1LL;
    if (ans < 0) ans = (ans+mod)%mod; 
    
    cout << ans << endl;
    

    return 0;
  }


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

int main() {
  int n;
  cin >> n;
  vector<int> a(n);
  rep(i, n) cin >> a[i];
  rep(i, n) --a[i];

  int ans = 0;
  rep(i, n) if (i < a[i] && a[a[i]] == i) ++ans;
  cout << ans << endl;
  return 0;
}

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

static class CodeJam
{
    static int Solve(int N, int K, string S)
    {
        int count = 0;
        for (int i = 0; i < N; ++i)
        {
            switch (S[i])
            {
            case 'L':
                if (i - 1 >= 0 && S[i - 1] == 'L') { ++count; }
                break;
            case 'R':
                if (i + 1 < N && S[i + 1] == 'R') { ++count; }
                break;
            }
        }
        return Math.Min(count + K * 2, N - 1);
    }

    static void Main(string[] args)
    {
        int[] V = Array.ConvertAll(Console.ReadLine().Split(), int.Parse);
        var S = Console.ReadLine();
        Console.WriteLine(Solve(V[0], V[1], S));
    }
}


Measured memory_bytes: 13244
// Problem : B - Count ABC
// Contest : AtCoder - AtCoder Beginner Contest 150
// URL : https://atcoder.jp/contests/abc150/tasks/abc150_b
// Memory Limit : 1024 MB
// Time Limit : 2000 ms
// Powered by CP Editor (https://github.com/cpeditor/cpeditor)

#include<bits/stdc++.h>
#include<set>
#define lli long long int
#define pb push_back
#define cio ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL)
#define rep(i,a,n) for(i=a;i<n;i++)
#define all(v) (v.begin(),v.end())
#define ppb pop_back
#define vsz v.size()
#define pi 3.141592653589793238
using namespace std;
int main()
{
	lli t=0,n,i;
	string s;
	cin>>n>>s;
	for(i=0;i<n-2;i++){
		if(s[i]=='A'&& s[i+1]=='B'&& s[i+2]=='C')
		t++;
	}
	cout<<t;
	
	return 0;
}

Measured memory_bytes: 3608
/**akshaykumar99**/
 
#include<bits/stdc++.h>
using namespace std;
 
#define f(i,x,n) for(i=x;i<n;i++)
#define pu push_back           
#define pp pop_back
#define mp(a,b) make_pair(a,b)
#define F first
#define S second
#define all(v) v.begin(),v.end()
#define rall(v) v.rbegin(),v.rend()
#define IOS() ios::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
 
const int MOD=1e9+7 ;
const long long INF=INT_MAX;
const long long LINF=LLONG_MAX;
const long long N=1e5+2;
 
typedef long long ll;
typedef long double ld;
typedef vector<ll> ivc;
typedef pair<ll,ll> ipr;

int main()
{
    IOS();
   
    int m,d,i,j,res=0,ans=0;
    cin>>m>>d;
    for(i=22 ;i<=d ;i++)
    {
      if(i%10<2)
        continue;
      res=(i/10)*(i%10);
      f(j,4,m+1)
      {
          if(res==j)
          {
            ans++;
            
          }
      }
    }

    cout<<ans;
     



  return 0;
  
}

Measured memory_bytes: 384
#include <bits/stdc++.h>
using namespace std;
#pragma region
void __print(int x) {cerr << x;}
void __print(long x) {cerr << x;}
void __print(long long x) {cerr << x;}
void __print(unsigned x) {cerr << x;}
void __print(unsigned long x) {cerr << x;}
void __print(unsigned long long x) {cerr << x;}
void __print(float x) {cerr << x;}
void __print(double x) {cerr << x;}
void __print(long double x) {cerr << x;}
void __print(char x) {cerr << '\'' << x << '\'';}
void __print(const char *x) {cerr << '\"' << x << '\"';}
void __print(const string &x) {cerr << '\"' << x << '\"';}
void __print(bool x) {cerr << (x ? "true" : "false");}

template<typename T, typename V>
void __print(const pair<T, V> &x) {cerr << '{'; __print(x.first); cerr << ','; __print(x.second); cerr << '}';}
template<typename T>
void __print(const T &x) {int f = 0; cerr << '{'; for (auto &i: x) cerr << (f++ ? "," : ""), __print(i); cerr << "}";}
void _print() {cerr << "]\n";}
template <typename T, typename... V>
void _print(T t, V... v) {__print(t); if (sizeof...(v)) cerr << ", "; _print(v...);}
#ifndef ONLINE_JUDGE
#define debug(x...) cerr << "[" << (#x) << "] = [", _print(x)
#else
#define debug(x...)
#endif
#pragma endregion
typedef long long ll;
#define forn(i, n) for (int i = 0; i < int(n); ++i)
#define sz(v) int((v).size())
#define int ll
#pragma region
#define f first
#define s second
#define mp make_pair
#define mt make_tuple
#define pb push_back
#pragma endregion

//
int MOD = 1e9+7;
int power(int a, int n)
{
    int ret = 1;
    int now = a;
    while(n)
    {
        if (n&1)ret = (ret  * now)%MOD;
        n >>= 1;
        now = (now * now)%MOD;
    }
    return ret;
}
int n;
vector<int>c;
void solve()
{
    cin>>n;
    c.resize(n);
    forn(i, n) cin>>c[i];
    sort(c.begin(), c.end());
    //
    if (n == 1)
    {
        cout << 2 * c[0] % MOD << '\n';
        return;
    }
    int p2 = power(2, 2*n-2);
    int ans = 0;
    forn(k, n)
    {
        int ad = (n-k+1) * c[k]%MOD * p2%MOD;
        ans = (ans + ad)%MOD;
    }
    cout << ans << '\n';
}

signed main()
{
    int T = 1;
    ios_base::sync_with_stdio(0); cin.tie(0);
    cout << fixed << setprecision(22);
    // cin >> T;
    for(int i=1;i<=T;++i)
    {
        //cout << "Case #" << i << ": ";
        solve();
    }
    return 0;
}


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

using ll = long long;
using ld = long double;
using vi = vector<int>;
using vll = vector<ll>;

const int INF = 1e9;
const ll INFLL = 1e18;
const int MOD = 1e9 + 7;
const int NIL = -1;

#define rep(i,n) for(int i=0; i<(n); ++i)
#define all(n) begin(n),end(n)

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; }

#define DEBUG

int main()
{
	ios::sync_with_stdio(false); cin.tie(0);
	int a, b;
	cin >> a >> b;
	int time = a + b;
	cout << (time >= 24 ? time - 24 : time) << endl;
	return 0;
}

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

using namespace std;

int main(){
  int N; cin >> N;
 int kindA[100100] = {0}; int kindB[100100] = {0};
  
  for(int i = 0; i < N; i++){ int v; cin >> v;
         if( i % 2 == 0){ kindA[v]++; }                
         else{ kindB[v]++;}}
  
    int maxa = 0;int maxa2 = 0;int maxb = 0;int maxb2 = 0; 
                             int a = 0; int b = 0;
  for(int i = 1; i <= 100000; i++){
    if(kindA[i] > maxa){ a = i;maxa2 = maxa; maxa = kindA[i];}
    else if( kindA[i] > maxa2){ maxa2 = kindA[i];}
  }
                        
  for(int j = 1; j <= 100000; j++){
    if(kindB[j] > maxb){ b = j ; maxb2 = maxb; maxb = kindB[j];}
    else if(kindB[j] > maxb2){ maxb2 = kindB[j];}}
                             
    if( a != b){ cout << N - maxa - maxb << endl;}
    else{
      cout << min( N - maxa - maxb2,N-maxa2-maxb) << endl;}
                             
                             return 0;}
                             
         
        
   
    
                              
  

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

void enumerate(const string& path, set<string>& dirs) {
    auto p = path.find_last_of('/');
    if (p == string::npos) return;
    string dirname = path.substr(0, p);
    if (!dirs.insert(dirname + '/').second) return;
    enumerate(dirname, dirs);
}

string fix(const string& path, const set<string>& dirs, const set<string>& files) {
    string par = "", sub = path;
    for (; !sub.empty();) {
        if (sub.size() >= 3u and sub.substr(0, 3) == "/..") {
            if (par.empty()) throw "not found";
            auto p = par.find_last_of('/');
            par.erase(par.begin() + p, par.end());
            sub.erase(0, 3);
        }
        else if (sub.size() >= 2u and sub.substr(0, 2) == "/.") {
            sub.erase(0, 2);
        }
        else {
            if (sub == "/") break;
            auto p = sub.substr(1).find_first_of('/');
            if (p == string::npos) { par += sub; break; }
            par += sub.substr(0, p + 1);
            sub.erase(0, p + 1);
        }
        if (sub.empty() and files.count(par)) break;
        if (!dirs.count(par + '/')) throw "not found";
    }
    if (dirs.count(par + '/') and files.count(par + "/index.html")) return par + "/index.html";
    if (!files.count(par)) throw "not found";
    return par;
}

int main() {
    for (int N, M; cin >> N >> M, N | M;) {
        set<string> dirs, files;
        while (N--) {
            string path; cin >> path;
            files.insert(path);
            enumerate(path, dirs);
        }
        while (M--) {
            string path1, path2; cin >> path1 >> path2;
            try { cout << (fix(path1, dirs, files) == fix(path2, dirs, files) ? "yes" : "no") << endl; }
            catch (char const* mes) { cout << mes << endl; }
        }
    }
    return 0;
}

Measured memory_bytes: 3216
#include <bits/stdc++.h>
typedef long long ll;
#define REP(i,n) for(int i=0;i<n;i++)
#define ALL(x) (x).begin(),(x).end()
using namespace std;

//素因数分解
vector<pair<ll,int>> factorize(ll n){
    vector<pair<ll,int>>res;
    for(ll i=2;i*i<=n;i++){
        if(n%i)continue;
        res.emplace_back(i,0);
        while (n%i == 0)
        {
        n /= i;
        res.back().second++;
        }
        
    }
    if(n != 1) res.emplace_back(n,1);
    return res;
}

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

Measured memory_bytes: 256
from sys import stdin
import sys
import math
from functools import reduce
import functools
import itertools
from collections import deque,Counter,defaultdict
from operator import mul
import copy
# ! /usr/bin/env python
# -*- coding: utf-8 -*-
import heapq
sys.setrecursionlimit(10**6)
# INF =  float("inf")
INF = 10**18
import bisect
import statistics
mod = 10**9+7
# mod = 998244353

s = input()

if s == "RRR":
    print(3)
elif s == "SRR" or s == "RRS":
    print(2)
elif s == "SSS":
    print(0)
else:
    print(1)

Measured memory_bytes: 72876
#include <bits/stdc++.h>
typedef long long ll;
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define REP(i,a) FOR(i,0,a)
	
using namespace std;
const int MAX_N=200;
const ll MOD=998244353;
ll mpw(ll n,ll m){
	ll ret=1;
	while(m){
		if (m&1){
			ret*=n;
			ret%=MOD;
		}
		n*=n;
		n%=MOD;
		m>>=1;
	}
	return ret;
}
struct vec{
	int x,y;
	vec(int x=0,int y=0):x(x),y(y){}
};
vec operator - (const vec &v1,const vec &v2){
	return vec(v1.x-v2.x,v1.y-v2.y);
}
int crs(vec v1,vec v2){
	return v1.x*v2.y-v1.y*v2.x;
}
int N;
vec P[MAX_N];
struct lin{
	vec v1,v2;
	lin(vec v1=vec(),vec v2=vec()):v1(v1),v2(v2){}
};
bool isl(vec v1,vec v2,vec v3){
	return crs(v2-v1,v3-v1)==0;
}
int main(){
	cin>>N;
	REP(i,N){
		int x,y;
		cin>>x>>y;
		P[i]=vec(x,y);
	}
	ll ans=0;
	ans=mpw(2,N)-1-N;
	ans%=MOD;
	ans+=MOD;
	ans%=MOD;
	REP(i,N){
		FOR(j,i+1,N){
			lin l(P[i],P[j]);
			int cnt=2;
			bool f=true;
			REP(k,N){
				if (k==i || k==j) continue;
				if (isl(l.v1,l.v2,P[k])){
					if(k>j){
						cnt++;
					}else{
						f=false;
					}
				}
			}
			if (f){
				ans-=((mpw(2,cnt)-cnt-1)%MOD+MOD)%MOD;
				ans+=MOD;
				ans%=MOD;
			}
		}
	}
	cout<<ans<<endl;
	return 0;
}

Measured memory_bytes: 256
import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        int b = sc.nextInt();
        int count = 1;
        int ans = 0;
        while (count < b) {
            count--;
            count+=a;
            ans++;
        }
        System.out.println(ans);

    }
}


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

int main() {
	ios::sync_with_stdio(false);
	cin.tie(0);
	string s;
	cin>>s;
	int k;
	cin>>k;
	int n = s.length();
	if(s[n - 1] != s[0]){
		ll ans = 0;
		for(int i = 0; i < n - 1; i++){
			if(s[i] != s[i + 1]){
				continue;
			}
			i++;
			ans++;
			continue;
		}
		ans *= k;
		cout<<ans<<endl;
		return 0;
	}
	int i = n - 1;
	while(i - 1 >= 0 && s[i - 1] == s[i]){
		i--;
	}
	if(i == 0){
		ll ans = n;
		ans *= k;
		ans /= 2;
		cout<<ans<<endl;
		return 0;
	}
	if((n - i) % 2 == 0){
		ll ans = 0;
		for(int i = 0; i < n - 1; i++){
			if(s[i] != s[i + 1]){
				continue;
			}
			i++;
			ans++;
			continue;
		}
		ans *= k;
		cout<<ans<<endl;
		return 0;
	}
	if(k == 1){
		ll ans = 0;
		for(int i = 0; i < n - 1; i++){
			if(s[i] != s[i + 1]){
				continue;
			}
			i++;
			ans++;
			continue;
		}
		ans *= k;
		cout<<ans<<endl;
		return 0;
	}
	int j = 0;
	while(j + 1 < n && s[j] == s[j + 1]){
		j++;
	}
	ll ans = (j + 1) / 2;
	for(int i = j + 1; i < n - 1; i++){
		if(s[i] != s[i + 1]){
			continue;
		}
		i++;
		ans++;
		continue;
	}
	ll rem = k - 1;
	rem *= (ans - (j + 1) / 2 + (j + 2) / 2);
	ans += rem;
	cout<<ans<<endl;
	return 0;
}

Measured memory_bytes: 256
# -*- coding: utf-8 -*-
# 整数の入力
import numpy as np
H, W = map(int, raw_input().split())
h, w = map(int, raw_input().split())

array = np.zeros((H,W))

for i in range(0, h):
    for j in range(0, W):
        array[i][j] += 1

for i in range(0, w):
    for j in range(0, H):
        array[j][i] += 1

count = 0
for i in range(0, H):
    for j in range(0, W):
        if array[i][j] == 0 : count += 1

print count


Measured memory_bytes: 18552
/**
     **author : _KMS_
     **created : 12-04-2020
**/
#include<bits/stdc++.h>
using namespace std;
const long long M =1e6+10,MOD=1000000007;
typedef long long ll;

int main()
{
     ios::sync_with_stdio(false);
     cin.tie(0);
     ll n;
     cin>>n;
     ll sum=0;
     for(ll i=1;i<=n;i++)
     {
      if(i%3==0||i%5==0)continue;
      else sum+=i;
     }
     cout<<sum<<"\n";
    return 0;
}

Measured memory_bytes: 3640
#include <bits/stdc++.h>
#define For(i, a, b) for(int (i)=(int)(a); (i)<(int)(b); ++(i))
#define rFor(i, a, b) for(int (i)=(int)(a)-1; (i)>=(int)(b); --(i))
#define rep(i, n) For((i), 0, (n))
#define rrep(i, n) rFor((i), (n), 0)
#define fi first
#define se second
using namespace std;
typedef long long lint;
typedef unsigned long long ulint;
typedef pair<int, int> pii;
typedef pair<lint, lint> pll;
template<class T> bool chmax(T &a, const T &b){if(a<b){a=b; return true;} return false;}
template<class T> bool chmin(T &a, const T &b){if(a>b){a=b; return true;} return false;}
template<class T> T div_floor(T a, T b){
    if(b < 0) a *= -1, b *= -1;
    return a>=0 ? a/b : (a+1)/b-1;
}
template<class T> T div_ceil(T a, T b){
    if(b < 0) a *= -1, b *= -1;
    return a>0 ? (a-1)/b+1 : a/b;
}
 
constexpr lint mod = 1e9+7;
constexpr lint INF = mod * mod;
constexpr int MAX = 200010;
 
int dx[4] = {0, 1, 0, -1};
int dy[4] = {1, 0, -1, 0};
 
int main(){
    int h, w, K, sx, sy, gx, gy;
    scanf("%d%d%d%d%d%d%d", &h, &w, &K, &sx, &sy, &gx, &gy);
    --sx; --sy; --gx; --gy;
    char c[h][w];
    rep(i, h)rep(j, w) scanf(" %c", &c[i][j]);
 
    int d[h][w];
    queue<pii> que;
    rep(i, h)rep(j, w) d[i][j] = mod;
    d[sx][sy] = 0;
    que.emplace(sx, sy);
    while(!que.empty()){
    	int x = que.front().first;
    	int y = que.front().second;
//    	cout<<x<<" "<<y<<endl;
        que.pop();
        rep(i, 4){
//        	cout<<"here";
            For(k, 1, K+1){
                int nx = x + dx[i]*k, ny = y + dy[i]*k;
//                cout<<nx<<" "<<ny<<endl;
                if(nx<0 || h<=nx || ny<0 || w<=ny || c[nx][ny] != '.' || d[nx][ny] <= d[x][y]) break;
                if(chmin(d[nx][ny], d[x][y] + 1)) que.emplace(nx, ny);
            }
        }
    }
//    	for(int i=0;i<h;i++)
//		for(int j=0;j<w;j++)
//			cout<<d[i][j]<<" ";
    printf("%d\n", d[gx][gy] < mod ? d[gx][gy] : -1);
}

Measured memory_bytes: 8992
#include <stdio.h>
/*#include <iostream>
#include <algorithm>
#include <vector>
#include <cstdio>
#include <string>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <cmath>
#include <functional>
#include <numeric>
#include <iomanip>
#define fi first
#define se second
#define fcout(n) cout<<fixed<<setprecision((n))
#define cinl(str) getline(cin,(str))
using namespace std;
bool value(int y,int x,int R,int C){return 0<=y&&y<R&&0<=x&&x<C;}
typedef pair<int,int> pii;
typedef long long ll;
typedef vector<int> vi;
typedef vector<long long > vll;
typedef vector< vi > vvi;
double pie=acos(-1);
int INF=10000009;
int dx[4] = { 0,-1,0,1 };
int dy[4] = { -1,0,1,0 };*/
int main() {
	int a,b;
	int y=0;
	int x=0;
	int i;
	while(1){
		scanf("%d %d",&a,&b);
		if(a+b==0) break;
		if(y!=0) printf("\n");
		for(i=a;i<=b;i++){
			if((i%4==0&&i%100!=0)||i%400==0){
				printf("%d\n",i);
				x++;
			}
			if(i==b&&x==0){
				printf("%s\n","NA");
			}
		}
		x=0;
		y++;
	}
	return 0;
}

Measured memory_bytes: 616
#include <iostream>
#include <cstdio>
#include <cstring>
#include <string>
#include <vector>
#include <algorithm>
#include <cmath>
#include <cstdlib>
#include <queue>
#include <stack>
#include <map>
#include <utility>
#include <set>
#include <climits>

using namespace std;

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

char s[200005];
int dp[200005];

int main() {
    scanf("%s", s);
    int n = strlen(s);
    memset(dp, 0, sizeof(dp));
    for (int i = 1; i <= n; ++i) {
        if (i > 1 && s[i - 1] == s[i - 2]) {
            dp[i] = dp[i - 2] + 1;
            if (i > 3) {
                dp[i] = max(dp[i], dp[i - 3] + 2);
            }
        } else {
            dp[i] = dp[i - 1] + 1;
        }
    }
    printf("%d\n", dp[n]);
    return 0;
}



Measured memory_bytes: 1280
import math

a,b,h,m=map(int,input().split())
w=(h/6+m/360)*math.pi
z=(m/30)*math.pi
l=(a*math.sin(w)-b*math.sin(z))**2+(a*math.cos(w)-b*math.cos(z))**2
print(l**(1/2))


Measured memory_bytes: 9496
x = input()

y = x.split(" ")

if int(y[0]) * int(y[1]) > int(y[2]) * int(y[3]):
    print(int(y[0]) * int(y[1]))
elif int(y[0]) * int(y[1]) < int(y[2]) * int(y[3]):
    print(int(y[2]) * int(y[3]))
elif int(y[0]) * int(y[1]) == int(y[2]) * int(y[3]):
    print(int(y[2]) * int(y[3]))

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

int main() {
  int n; cin >> n;
  int e = 0;
  int p = 0;
  for (int i = 0; i < n; i++) {
    int pi; cin >> pi;
    p += pi;
    e = max(e, pi);
  }
  p -= e/2;
  cout << p <<endl;
}

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

vector<int> parent; 

int find_set(int v){ 
	if(v==parent[v]){ 
		return v; 
	} 
	return parent[v]=find_set(parent[v]); 
}
void union_set(int a,int b){ 
	a=find_set(a); 
	b=find_set(b); 
	if(a!=b){ 
		parent[b]=a; 
	}
} 


int main(){ 
	 ios::sync_with_stdio(false);
   	 cin.tie(0); 
	 int N,M; 
	 cin>>N>>M;
	 vector<int>perm(N); 
	 for(int i=0;i<N;i++){ 
		int val; 
		cin>>val;
		val--; 
		perm[i]=val;

	       	parent.push_back(i); 	
	 }  
	 for(int i=0;i<M;i++){ 
		 int x,y; 
		 cin>>x>>y;
		 x--;
		 y--; 
		 union_set(x,y); 
	 }  
	 int ct=0; 
	 for(int i=0;i<N;i++){ 
		 if (find_set(i)==find_set(perm[i])){ 
			 ct++; 
		 }
	 } 
	 cout<<ct<<endl; 

		  
 	 	 

	  
    
    return 0; 
}


Measured memory_bytes: 1276
#include <stdio.h>
#include <iostream>
#include <math.h>
#include <string>
#include <vector>
#include <algorithm>
//#include <tuple>

//#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back

int main() {
  ll N;
  cin >> N;
  ll min_n = N;

  for (ll i = 1; i <= sqrt(N); i++) {
    if (N % i == 0) {
      ll j = N/i;
      min_n = min(min_n, i + j - 2);
    }
  }
  cout << min_n << endl;

}


Measured memory_bytes: 256
#![allow(non_snake_case)]
#![allow(unused_imports)]
#![allow(dead_code)]
 
use proconio::{input, fastout};
use proconio::marker::*;
use whiteread::parse_line;
use std::collections::*;
use num::*;
use num_traits::*;
use superslice::*;
use std::ops::*;
 
use itertools::Itertools;
use itertools_num::ItertoolsNum;

#[fastout]
fn solve() {
    const MOD: usize = 1_000_000_007;
    const INF: usize = std::usize::MAX;

    input!{
        h: usize, w: usize, m: usize,
        hw_vec: [(usize, usize); m],
    }

    let mut h_bomb = vec![0; h];
    let mut w_bomb = vec![0; w];

    for (hh, ww) in hw_vec.iter() {
        h_bomb[hh-1] += 1;
        w_bomb[ww-1] += 1;
    }

    let h_max = h_bomb.iter().max().unwrap();
    let w_max = w_bomb.iter().max().unwrap();

    let mut h_max_index = vec![];
    let mut w_max_index = vec![];

    for (i, hh) in h_bomb.iter().enumerate() {
        if h_max == hh { h_max_index.push(i) }
    }

    for (i, ww) in w_bomb.iter().enumerate() {
        if w_max == ww { w_max_index.push(i) }
    }

    let hw_set: HashSet<(usize, usize)> = hw_vec.into_iter().collect();

    let mut flag = false;
    for hhi in h_max_index.iter() {
        for wwi in w_max_index.iter() {
            if !hw_set.contains(&(*hhi+1, *wwi+1)) {
                flag = true;
                break;
            }
        }
    }

    if flag {
        println!("{}", h_max + w_max);
    } else {
        println!("{}", h_max + w_max - 1);
    }
    
}

fn main() {
    solve();
}


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

#define all(x) x.begin(), x.end()
#define lc (i << 1)
#define rc (i << 1 | 1)
using namespace std;
using ll = long long;
using pii = pair<int, int>;
const int MN = 2000 + 5, LN = 17, MOD = 1e9 + 7, INF = 0x3f3f3f3f;

int main() {
    ios_base::sync_with_stdio(false), cin.tie(nullptr);
    int x; cin >> x;
    for (int i = -120; i <= 120; i++) {
        for (int j = -120; j <= 120; j++) {
            int a = i * i * i * i * i, b = j * j * j * j * j;
            if (a - b == x) {
                cout << i << " " << j << '\n';
                return 0;
            }
        }
    }
    return 0;
}


Measured memory_bytes: 3648
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i = 0, i##_len = (n); i < i##_len; ++i)
#define rep2(i, x, n) for(int i = x, i##_len = (n); i < i##_len; ++i)
#define all(n) begin(n), end(n)
using ll = long long;
using P = pair<ll, ll>;
using vi = vector<int>;
using vl = vector<ll>;
using vs = vector<string>;
using vc = vector<char>;
using vb = vector<bool>;
using vd = vector<double>;
vi dir = {-1, 0, 1, 0, -1, -1, 1, 1, -1};

int main() {
  ll a, b;
  cin >> a >> b;
  if(a == 1) a = 14;
  if(b == 1) b = 14;
  if(a == b)
    cout << "Draw" << endl;
  else if(a > b)
    cout << "Alice" << endl;
  else
    cout << "Bob" << endl;
}

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

int a,b,c[5];

int main(){
    scanf("%d%d",&a,&b);
    c[a]=c[b]=1;
    for(int i=1;i<=3;++i){
        if(!c[i]){
            printf("%d\n",i);
            break;
        }
    }
    return 0;
}

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

    divisors.sort()
    return divisors
s = 0
t = d(a)
#print(t)
res = 0
for k in t:
    if k==1:
        continue
    m=k-1
    if (a//m)==(a%m):
        res+=m
print(res)

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



typedef unsigned long ul;
typedef unsigned long long ull;
typedef long long ll;
typedef vector<ll> vint;
typedef vector< vector<ll> > vvint;


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



int main() {


  cout<<fixed<<setprecision(10);

  ll r,c;cin>>r>>c;
  vvint arr(r+1, vint(c));
  rep(i,r)rep(j,c)cin>>arr[i][j];

  // yoko
  rep(i,r){
    ll sum = 0;
    rep(j,c) sum+=arr[i][j];
    arr[i].push_back(sum);
  }

  // tate
  ll total = 0;
  rep(j,c){
    ll sum = 0;
    rep(i,r) sum+=arr[i][j];
    arr[r][j] = (sum);
    total += sum;
  }

  arr[r].push_back(total);

  rep(i,r+1){
    rep(j,c){
      cout<<arr[i][j]<<" ";
    }
    cout<<arr[i].back()<<endl;
  }

  
  return 0;
}




//



Measured memory_bytes: 3200
#include <stdio.h>
#include <string.h>
int m[15][15];
int n,h,w;
void put(int i)
{
  if(w>=n) w = 0;
  else if(w<0) w = n-1;
  if(h>=n) h = 0;
  if(m[h][w] != 0) {
    h++; w--;
    put(i);
  }else{
    m[h][w] = i;
  }
}
int main()
{
  int k;
  for(;;){
    scanf("%d",&n);
    if(n == 0) break;
    memset(m,0,sizeof(m));
    h = (n+1) / 2;
    w = n / 2;
    for(k=1;k<=n*n;k++){
      put(k);
      h++;
      w++;
    }
    for(h=0;h<n;h++){
      for(w=0;w<n;w++){
	printf("%4d",m[h][w]);
      }
      printf("\n");
    }
  }
  return 0;
}

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

constexpr int mod = 1e9 + 7;

int main() {
    int n; cin >> n;
    vector<vector<int>> a(n, vector<int>(n));
    for(int i = 0; i < n; ++i) {
        for(int j = 0; j < n; ++j) {
            cin >> a[i][j];
        }
    }
    vector<vector<int>> dp(n + 1, vector<int>(1 << n));
    dp[0][0] = 1;
    for(int i = 0; i < n; ++i) {
        for(int S = 0; S < (1 << n); ++S) {
            if(dp[i][S] == 0) continue;
            for(int j = 0; j < n; ++j) {
                if(S & (1 << j) || a[i][j] == 0) continue;
                (dp[i + 1][S | (1 << j)] += dp[i][S]) %= mod;
            }
        }
    }
    cout << dp[n].back() << endl;
}


Measured memory_bytes: 188800
#include <bits/stdc++.h>
#define Int int64_t

using namespace std;

template <typename T>
vector<pair<T, int>> factorize(T n) {
	vector<pair<T, int>> ret;

	for (T p = 2; p * p <= n; ++p) {
		if (n % p != 0) { continue; }

		int num = 0;
		while (n % p == 0) {
			++num;
			n /= p;
		}
		ret.emplace_back(p, num);
	}
	if (n != 1) { ret.emplace_back(n, 1); }

	return ret;
}

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

	auto fac = factorize(N);
	Int ans = 0;
	for (auto p : fac) {
		Int x = p.second;
		for (Int i = 1; ; ++i) {
			if (x < i) { break; }
			++ans;
			x -= i;
		}
	}
	cout << ans << endl;

	return 0;
}


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

int main() {
  int N;
  cin >> N;
  int sum;
  for (int M = N; M>0; M /= 10) {
    sum += M % 10;
  }
  
  if (N % sum == 0) {
    cout << "Yes" << endl;
  }
  else {
    cout << "No" << endl;
  }
}


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

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
  	char x;
  	cin >> x;
  	if(x>='a' && x<='z')
      cout << 'a';
    else
      cout << 'A';
    return 0;
}

Measured memory_bytes: 3592
#include<iostream>
#include<vector>
#include<algorithm>
#include<string>
#define ll long long
using namespace std;

const ll mod = 1e9 + 7;

ll C[2005][2005];
ll dp[100005][13];


int main(){
    int a,K,N,ans=0;
    cin >> N >> K;
    vector<int> v(N+2,0);
    for(int i = 0; i < N; i++){
        cin >> a;
        if(a>= K)
        ans++;
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 640
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cstring>
#include <cmath>
using namespace std;
const int N=110;
double ans[N];
inline int gi() {
    int x=0,o=1;
    char ch=getchar();
    while(ch!='-'&&(ch<'0'||ch>'9')) ch=getchar();
    if(ch=='-') o=-1,ch=getchar();
    while(ch>='0'&&ch<='9') x=x*10+ch-'0',ch=getchar();
    return x*o;
}
struct Dat {
    int x,y,t;
    inline long long operator % (const Dat &A) const {return 1LL*x*A.y-1LL*y*A.x;}
    inline double dis() {return sqrt(1LL*x*x+1LL*y*y);}
    inline bool operator < (const Dat &A) const {return x==A.x?y<A.y:x<A.x;}
    inline Dat operator - (const Dat &A) const {return (Dat){x-A.x,y-A.y};}
    inline Dat operator + (const Dat &A) const {return (Dat){x+A.x,y+A.y};}
} g[N],v[N];
int main() {
    int n,tp=0;
    cin>>n;
    for(int i=1;i<=n;i++) g[i].x=gi(),g[i].y=gi(),g[i].t=i;
    sort(g+1,g+1+n);
    for(int i=1;i<=n;i++) {
	while(tp>1&&(g[i]-v[tp])%(v[tp]-v[tp-1])>=0) --tp;
	v[++tp]=g[i];
    }
    for(int i=n,j=tp;i;i--) {
	while(j<tp&&(g[i]-v[tp])%(v[tp]-v[tp-1])>=0) --tp;
	v[++tp]=g[i];
    }
    if(tp==3) ans[v[1].t]=ans[v[2].t]=0.5;
    else {
	for(int i=1;i<tp;i++) {
	    Dat A,B=v[i+1]-v[i];
	    if(i==1) A=v[i]-v[tp-1];
	    else A=v[i]-v[i-1];
	    double a=A.dis(),b=B.dis(),c=(A+B).dis();
	    ans[v[i].t]=(acos(-1.0)-acos((a*a+b*b-c*c)/2/a/b))/2/acos(-1.0);
	}
    }
    for(int i=1;i<=n;i++) printf("%.10f\n",ans[i]);
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <iomanip>
#include <cmath>
#include <queue>
#include <stack>
#include <cstdlib>
#include <map>
#include <iomanip>
#include <set>
#include <stdio.h>
#include <ctype.h>
using namespace std;
#define pie 3.141592653589793238462643383279
#define mod 1000000007
#define INF 1145141919364364
#define int long long
#define all(vec) vec.begin(),vec.end()
#define P pair<int,int>
#define S second
#define F first

int gcd(int x, int y) {
	if (y == 0)return x;
	return gcd(y, x%y);
}
int lcm(int x, int y) {
	return x / gcd(x, y)*y;
}
bool prime(int x) {
	for (int i = 2; i <= sqrt(x); i++) {
		if (x%i == 0)return false;
	}
	return true;
}
int kai(int x, int y) {
	int res = 1;
	for (int i = x - y + 1; i <= x; i++) {
		res *= i; res %= mod;
	}
	return res;
}
int mod_pow(int x, int y, int m) {
	int res = 1;
	while (y > 0) {
		if (y & 1) {
			res = res * x % m;
		}
		x = x * x % m;
		y >>= 1;
	}
	return res;
}
int comb(int x, int y) {
	if (y > x)return 0;
	return kai(x, y) * mod_pow(kai(y, y), mod - 2, mod) % mod;
}

int n;
vector<int> ans;

signed main() {
	cin >> n;
	if (n == 3)cout << 2 << " " << 5 << " " << 63 << endl;
	else if (n == 4)cout << 2 << " " << 5 << " " << 20 << " " << 63 << endl;
	else {
		int cnt = 0;
		int k = 0;
		int b = 0;
		for (int i = 1;; i++) {
			if (!(i % 2) || !(i % 3)) {
				cnt += i;
				k++;
				ans.push_back(i);
			}
			if (k == n) {
				b = i;
				break;
			}
		}
		b++;
		if (cnt % 6 == 2) {
			ans.erase(ans.begin() + 0);
			for (int i = b;; i++) {
				if (!(i % 6)) {
					ans.push_back(i);
					break;
				}
			}
		}
		if (cnt % 6 == 3) {
			ans.erase(ans.begin() + 1);
			for (int i = b;; i++) {
				if (!(i % 6)) {
					ans.push_back(i);
					break;
				}
			}
		}
		if (cnt % 6 == 5) {
			ans.erase(ans.begin() + 0);
			for (int i = b;; i++) {
				if (i % 6 == 3) {
					ans.push_back(i);
					break;
				}
			}
		}
		for (int i = 0; i < (int)ans.size(); i++)cout << ans[i] << " ";
		cout << endl;
	}
}

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

#define ll long long
#define vvi vector<vector<int>>
#define vec vector
#define pq priority_queue
#define all(v) (v).begin(), (v).end()
#define uniqueV(x) sort(x.begin(), x.end()); x.erase(unique(x.begin(), x.end()), x.end());
#define rep(i, n) for (int (i) = (0); (i) < (n); ++(i))
#define repp(i, m, n) for (int (i) = (m); (i) < (n); ++(i))
#define dbg(x) cerr << #x << ": " << x << endl;
#define dbg2(x, y) cerr<<"("<<#x<<", "<<#y<<") = "<<"("<<x<<", "<<y<<")"<<endl;
#define dbg3(x, y, z) cerr<<"("<<#x<<", "<<#y<<", "<<#z<<") = "<<"("<<x<<", "<<y<<", "<<z<<")"<<endl;
#define dbgB(value, size) cerr<<#value<<": "<<bitset<size>(value) << endl;
#define line() cerr << "---------------" << endl;

const int dx[] = {1, -1, 0, 0};
const int dy[] = {0, 0, -1, 1};
const double PI = 3.14159265358979323846;

template<class T>bool chmax(T &a, const T &b) { if (a<b) { a = b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a = b; return 1; } return 0; }

template<typename T>
void printA(vector<T> &printArray, char between = ' ') {
   int paSize = printArray.size();
   for (int i = 0; i < paSize; i++) { cerr << printArray[i] << between;}
   if (between != '\n') {cerr << endl;}
}

// ------------------------------------------------------------------------------------------

int q;
string x, y;
int dp[1111][1111];

void print() {
   for (int i = 0; i <= x.size(); i++) {
      for (int j = 0; j <= y.size(); j++) {
         cout << dp[i][j];
      }
      puts("");
   }
}

void solve() {
   for (int i = 0; i < x.size(); i++) {
      for (int j = 0; j < y.size(); j++) {
         if (x[i] == y[j]) {
            dp[i+1][j+1] = dp[i][j] + 1;
         } else {
            dp[i+1][j+1] = max(dp[i][j+1], dp[i+1][j]);
         }
      }
   }
   cout << dp[x.size()][y.size()] << endl;
}

int main() {
   cin >> q;
   while (q--) {
      fill(dp[0], dp[1111], 0);
      cin >> x >> y;
      solve();
   }

   return 0;
}


Measured memory_bytes: 7952
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <numeric>

typedef long long ll;

int main()
{
  ll N;
  std::cin >> N;
  std::vector<ll> vp(N, 0LL);
  for (auto& x : vp) std::cin >> x;

  ll ans = 0LL;
  for (ll i = 2; i < N; i++) {
    if (vp[i-2] < vp[i-1] && vp[i-1] < vp[i]) ans++;
    if (vp[i-2] > vp[i-1] && vp[i-1] > vp[i]) ans++;
  }

  std::cout << ans << std::endl;
  return 0;
}


Measured memory_bytes: 256
/*⠄⢰⣧⣼⣯⠄⣸⣠⣶⣶⣦⣾⠄⠄⠄⠄⡀⠄⢀⣿⣿⠄⠄⠄⢸⡇⠄⠄
⠄⠄⠄⣾⣿⠿⠿⠶⠿⢿⣿⣿⣿⣿⣦⣤⣄⢀⡅⢠⣾⣛⡉⠄⠄⠄⠸⢀⣿⠄
⠄⠄⢀⡋⣡⣴⣶⣶⡀⠄⠄⠙⢿⣿⣿⣿⣿⣿⣴⣿⣿⣿⢃⣤⣄⣀⣥⣿⣿⠄
⠄⠄⢸⣇⠻⣿⣿⣿⣧⣀⢀⣠⡌⢻⣿⣿⣿⣿⣿⣿⣿⣿⣿⠿⠿⠿⣿⣿⣿⠄
⠄⢀⢸⣿⣷⣤⣤⣤⣬⣙⣛⢿⣿⣿⣿⣿⣿⣿⡿⣿⣿⡍⠄⠄⢀⣤⣄⠉⠋⣰
⠄⣼⣖⣿⣿⣿⣿⣿⣿⣿⣿⣿⢿⣿⣿⣿⣿⣿⢇⣿⣿⡷⠶⠶⢿⣿⣿⠇⢀⣤
⠘⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣽⣿⣿⣿⡇⣿⣿⣿⣿⣿⣿⣷⣶⣥⣴⣿⡗
⢀⠈⢿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡟⠄
⢸⣿⣦⣌⣛⣻⣿⣿⣧⠙⠛⠛⡭⠅⠒⠦⠭⣭⡻⣿⣿⣿⣿⣿⣿⣿⣿⡿⠃⠄
⠘⣿⣿⣿⣿⣿⣿⣿⣿⡆⠄⠄⠄⠄⠄⠄⠄⠄⠹⠈⢋⣽⣿⣿⣿⣿⣵⣾⠃⠄
⠄⠘⣿⣿⣿⣿⣿⣿⣿⣿⠄⣴⣿⣶⣄⠄⣴⣶⠄⢀⣾⣿⣿⣿⣿⣿⣿⠃⠄⠄
⠄⠄⠈⠻⣿⣿⣿⣿⣿⣿⡄⢻⣿⣿⣿⠄⣿⣿⡀⣾⣿⣿⣿⣿⣛⠛⠁⠄⠄⠄
⠄⠄⠄⠄⠈⠛⢿⣿⣿⣿⠁⠞⢿⣿⣿⡄⢿⣿⡇⣸⣿⣿⠿⠛⠁⠄⠄⠄⠄⠄
⠄⠄⠄⠄⠄⠄⠄⠉⠻⣿⣿⣾⣦⡙⠻⣷⣾⣿⠃⠿⠋⠁⠄⠄⠄⠄⠄⢀⣠⣴
⣿⣿⣿⣶⣶⣮⣥⣒⠲⢮⣝⡿⣿⣿⡆⣿⡿⠃⠄⠄⠄⠄⠄⠄⠄⣠⣴⣿*/

#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/rope>
using namespace std;
using namespace __gnu_pbds;
using namespace __gnu_cxx;
#define ll long long
#define ii pair<ll,ll>
#define iii pair<ii,ll>
#define fi first
#define se second
#define endl '\n'
#define debug(x) cout << #x << " is " << x << endl;

#define rep(x,start,end) for(auto x=(start)-((start)>(end));x!=(end)-((start)>(end));((start)<(end)?x++:x--))
#define all(x) (x).begin(),(x).end()
#define sz(x) (int)(x).size()

ll MAX(ll a){return a;}
ll MIN(ll a){return a;}
template<typename... Args>
ll MAX(ll a,Args... args){return max(a,MAX(args...));}
template<typename... Args>
ll MIN(ll a,Args... args){return min(a,MIN(args...));}

#define indexed_set tree<ll,null_type,less<ll>,rb_tree_tag,tree_order_statistics_node_update>

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

int main(){
	ios::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
	
	ll a,v;
	ll b,w;
	
	ll t;
	
	cin>>a>>v>>b>>w>>t;
	
	if (v<=w) cout<<"NO"<<endl;
	else{
		//cout<<t*(v-w)<<endl;
		
		if (abs(a-b)<=t*(v-w)) cout<<"YES"<<endl;
		else cout<<"NO"<<endl;
	}
	
}


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

int main() {

	float a;
	cin >> a;
	float b;
	b = 22.0 / 7.0;
	b *= 2.0;
	a = (float)a * (float)b;
	cout << (float)a;
}

Measured memory_bytes: 3776
#include<bits/stdc++.h>
 
using namespace std;
using ll = long long;
 
ll sqint(ll num){
 
    ll l = 0;
    ll r = 1e10;
 
    while(r - l > 1){
        ll mid = (r + l) / 2;
        (mid * mid <= num ? l : r) = mid;
    }
    return l;
}
 
#define MOD 1000000007
template<int mod>
struct ModInt{
   int x;
   ModInt():x(0){}
   ModInt(long long y):x(y>=0?y%mod:(mod-(-y)%mod)%mod){}
   ModInt &operator+=(const ModInt &p){
       if((x+=p.x)>=mod)x-=mod;
       return *this;
   }
   ModInt &operator-=(const ModInt &p){
       if((x+=mod-p.x)>=mod)x-=mod;
       return *this;
   }
   ModInt &operator*=(const ModInt &p){
       x=(int)(1LL*x*p.x%mod);
       return *this;
   }
   ModInt &operator/=(const ModInt &p){
       *this*=p.inverse();
       return *this;
   }
   ModInt &operator^=(long long p){
       ModInt res = 1;
       for (; p; p >>= 1) {
           if (p & 1) res *= *this;
           *this *= *this;
       }
       return *this = res;
   }
   ModInt operator-()const{return ModInt(-x);}
   ModInt operator+(const ModInt &p)const{return ModInt(*this)+=p;}
   ModInt operator-(const ModInt &p)const{return ModInt(*this)-=p;}
   ModInt operator*(const ModInt &p)const{return ModInt(*this)*=p;}
   ModInt operator/(const ModInt &p)const{return ModInt(*this)/=p;}
   ModInt operator^(long long p)const{return ModInt(*this)^=p;}
   bool operator==(const ModInt &p)const{return x==p.x;}
   bool operator!=(const ModInt &p)const{return x!=p.x;}
   explicit operator int() const { return x; }
   ModInt operator=(const int p) {x = p; return ModInt(*this);}
   ModInt inverse()const{
       int a=x,b=mod,u=1,v=0,t;
       while(b>0){
           t=a/b;
           a-=t*b;
           std::swap(a,b);
           u-=t*v;
           std::swap(u,v);
       }
       return ModInt(u);
   }
   friend std::ostream &operator<<(std::ostream &os,const ModInt<mod> &p){
       return os<<p.x;
   }
   friend std::istream &operator>>(std::istream &is,ModInt<mod> &a){
       long long x;
       is>>x;
       a=ModInt<mod>(x);
       return (is);
   }
};
typedef ModInt<MOD> mint;
 
 
 
int main()
{
    int n, k;
    cin >> n >> k;
    int sqr = sqint(n);
    vector<unordered_map<int,mint>> dp(k + 1);
 
    vector<int> val;
    for(int i = 1; i <= sqr; i++) {
        val.push_back(i);
        val.push_back(n / i);
    }
    val.push_back(0);
    sort(val.begin(), val.end());
    val.resize(unique(val.begin(),val.end()) - val.begin());
    int m = val.size();
 
 
    for(auto i : val)dp[0][i] = 1;
 
    // cerr << m << endl;
 
    for(int i = 0; i < k; i++) {
        for(int j = 1; j < m; j++) {
 
            dp[i + 1][val[j]] += dp[i][n / val[j]] * (val[j] - val[j - 1]);
            dp[i + 1][val[j]] += dp[i + 1][val[j - 1]];
        }
    }
    cout << dp[k][n] << endl;
}

Measured memory_bytes: 303008