akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>

using namespace std;

#define REP(var, n)  for (int var = 0; var < (n); var++)
#define RREP(var, n)  for (auto var = n - 1; var != static_cast<int>(-1); var--)
#define FOR(var, a, b)  for (auto var = (a); var < (b); var++)
#define RFOR(var, a, b)  for (auto var = b - 1; var != a; var--)

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

#define all(c) begin(c),end(c)

#define D(x) do { std::cerr << x << " "; } while (0)
#define D2(x) do { std::cerr << #x << ": " << x << std::endl; } while (0)


template<typename T>
std::ostream &operator<<(std::ostream &out, const std::vector<T> &v) {
    if (!v.empty()) {
        out << '[';
        std::copy(v.begin(), v.end(), std::ostream_iterator<T>(out, ", "));
        out << "\b\b]";
    }
    return out;
}


template<typename T1, typename T2>
ostream &operator<<(ostream &os, const pair<T1, T2> &p) {
    return os << '(' << p.first << ',' << p.second << ')';
}


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

int MOD = (int) 1e9 + 7;


auto solve() {
    int N;
    cin >> N;
    vi b(N);
    for (auto &&e:b) {
        cin >> e;
        e--;
    }

    vi ans;

    REP(_t,N) {
        bool ok = false;
        RREP(i, b.size()) {
            if (b[i] == i) {
                ans.push_back(b[i] + 1);
                b.erase(b.begin() + i);
                ok = true;
                break;
            }
        }
        if (!ok) {
            cout << -1 << endl;
            return;
        }
    }

    reverse(all(ans));
    for (auto &&e:ans)
        cout << e << endl;

    return;
}


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

//    cout << (solve() ? "Heisei" : "TBD") << endl;
//    cout << (solve() ? "YES" : "NO") << endl;
//    cout << solve() << endl;
    solve();

    return 0;
}

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

using namespace std;

int main(int argc, char *argv[])
{
    

    cin.tie(0);
    ios::sync_with_stdio(false);
    
    int N;
    cin >> N;
    
    long long product = 1;
    bool overflow = false;
    
    long long MAXV = 1000000000000000000;
    
    while (N--) {
        long long A;
        cin >> A;
        
        if (A == 0) {
            product = 0;
            overflow = false;
            break;
        }
        
        if (!overflow) {
            int digits = log10(product) + log10(A);
            if (digits > 18) {
                overflow = true;
            } else if (digits == 18){
                product *= A;
                if (product > MAXV) {
                    overflow = true;
                }
            } else {
                product *= A;
            }
        }
        
        
    }
    
    if (overflow) {
        cout << "-1" << endl;
    } else {
        cout << product << endl;
    }
    
}


Measured memory_bytes: 3904
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <math.h>
#include <cstdlib>
#include <cmath>

using namespace std;

int main(){
  int N;
  cin >> N;
  vector<long long> L(N+1);
  L.at(0)=2;
  L.at(1)=1;
  for(int i=2;i<N+1;i++){
    L.at(i)=L.at(i-1)+L.at(i-2);
  }
  cout << L.at(N) << endl;

  return 0;
}


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

using namespace std;

int main(){

    string S;
    cin >> S;

    int size = S.length();
    int count = 0, count_max = 0;

    for(int i = 0; i < size; i++){
        if (S[i] == 'A' || S[i] == 'T' || S[i] == 'G' || S[i] == 'C') {
            count += 1;
            if (count >= count_max) {
                count_max = count;
            }
        }else{
            count = 0;
        }
    }
    
    cout << count_max << endl;
    return 0;
}

Measured memory_bytes: 256
// Colon
#include <cmath>
#include <iostream>
#include <algorithm>
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;

int main() {
    int A, B, H, M; cin >> A >> B >> H >> M;
    double x1 = A * sin(2*M_PI*(H*60+M)/60/12);
    double y1 = A * cos(2*M_PI*(H*60+M)/60/12);
    double x2 = B * sin(M_PI/30*M);
    double y2 = B * cos(M_PI/30*M);
    double res = sqrt(pow(x2-x1,2)+pow(y2-y1,2));
    // cout << %res << endl;
    printf("%.20f", res);
}

Measured memory_bytes: 4064
N = int(input())
a_list = list(map(int, input().split()))

negative_num = len([a for a in a_list if a < 0])
zero_num = len([a for a in a_list if a == 0])
abs_a_list = list(map(abs, a_list))

if negative_num % 2 == 0 or zero_num >= 1:
    print(sum(abs_a_list))
else:
    print(sum(abs_a_list) - 2 * min(abs_a_list))


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

int main() {
  int N;
  cin>>N;
  int64_t sum=0;
  for(int k=0;k<N;k++){
    int i=k+1;
    if(i%5!=0&&i%3!=0){
      sum+=i;
    }
  }
  cout<<sum<<endl;
}


Measured memory_bytes: 3620
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {

  public static void main(String[] args) throws IOException {
    
    try(BufferedReader br = new BufferedReader(new InputStreamReader(System.in))) {

      int n = Integer.parseInt(br.readLine());
      int[] seq = new int[n];
      for(int i=0; i!=n; i++)
        seq[i] = Integer.parseInt(br.readLine());

      int cnt = shellSort(seq, n);
      System.out.println(cnt);
      StringBuilder str = new StringBuilder(n*2);
      for (int i : seq)
        str.append(i).append("\n");
      str.setLength(str.length()-1);
      System.out.println(str);
    }
  }

  public static int shellSort(int a[], int n) {
    int cnt=0;
    int m = 0;
    int[] aG = new int[n];
    for (int i=0,d=1; d <= n; i++,d=(d*3+1)) {
      aG[i] = d; m++;
    }
    System.out.println(m);
    StringBuilder str = new StringBuilder(m*2);

    for(int i=(m-1); i!=-1; i--){
      cnt += insertionSort(a, n,aG[i]);
      str.append(aG[i]).append(" ");
    }

    str.setLength(str.length()-1);
    System.out.println(str);

    return cnt;
  }
  
  public static int insertionSort(int a[], int max, int g) {
    int cnt=0;

    for (int i=g,j=0,v=0; i < max; i++) {
      for( j=(i-g), v=a[i]; j>=0 && a[j]>v; j=j-g ) {
        a[j+g] = a[j];
        cnt++;
      }
      a[j+g] = v;
    }

    return cnt;
  }
}


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

using namespace std;
using ll =long long;
using vi = vector<int>; 
using vvi = vector<vi>; 
using vl = vector<ll>; 
using vvl = vector<vl>; 
using vs = vector<string>;
using vvs = vector<vs>; 
using vc = vector<char>;
using vvc = vector<vc>; 
using vb = vector<bool>;
using vvb = vector<vb>; 

#define rep(i,n) ;for( int i =0; i < n ; i ++)
#define all(a) a.begin(),a.end()
#define pb(a) push_back(a)
#define pd(a) printf("%.10f\n",a)
#define mem(a) memset(a,0,sizeof(a))
#define f(i,a,b) for(int i=a;i<b;i++)
#define pri(a)  printf("%.14lf\n",a);
#define sz(a) ((int)a.size())
#define MOD 1000000007
bool is_int_lround(double x){
  return std::lround(x)==x;
}
ll keta(ll x){
  ll n=0;
  while(x>0){
    x /=10 ;
    n ++;
  }
  return n;
}

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

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

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


//vc alp ={'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'};
//vc Alp ={'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'};
//cout<<""<<endl;

int main(){
  char alp;cin>>alp;
  vc alpp ={'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'};
  bool ok=false;
  rep(i,26){
    
    if(alpp[i]==alp){
      ok=true;
      break;
    }
  }
  if(ok)cout<<'a'<<endl;
  else cout<<'A'<<endl;
}


Measured memory_bytes: 3592
import sys
stdin = sys.stdin

sys.setrecursionlimit(10**5) 
 
def li(): return map(int, stdin.readline().split())
def li_(): return map(lambda x: int(x)-1, stdin.readline().split())
def lf(): return map(float, stdin.readline().split())
def ls(): return stdin.readline().split()
def ns(): return stdin.readline().rstrip()
def lc(): return list(ns())
def ni(): return int(stdin.readline())
def nf(): return float(stdin.readline())

from math import sqrt
from bisect import bisect_left, bisect_right

# 半開区間[lower, upper)の素数のリストを作成する
def make_prime_list(lower:int, upper:int) -> list:
    
    # 素数リストの初期化    
    isPrime = [True]*upper
    primeList = []
    
    # 区間内の数字が0,1のみならここで終了
    if upper <= 2:
        return primeList
    
    # 区間内の数字に2以上のものがあるとき
    isPrime[0] = False
    isPrime[1] = False
    
    # エラトステネスの篩の処理
    for n in range(2,int(sqrt(upper))+2):
        if isPrime[n]:
            res=2*n
            while res<upper:
                isPrime[res] = False
                res += n
    
    # 区間内の素数を抽出
    for n in range(lower,upper):
        if isPrime[n]:
            primeList.append(n)
        
    return primeList

q = ni()
query = [tuple(li()) for _ in range(q)]

prime_list = set(make_prime_list(2,10**5+1))

like2017 = []

for i in range(3, 10**5, 2):
    if (i in prime_list) and ((i+1)//2 in prime_list):
        like2017.append(i)
        
for l,r in query:
    print(bisect_right(like2017, r) - bisect_left(like2017, l))
    

Measured memory_bytes: 18372
#include<bits/stdc++.h>
using namespace std;
void rd(int &x){
  int k, m=0;
  x=0;
  for(;;){
    k = getchar_unlocked();
    if(k=='-'){
      m=1;
      break;
    }
    if('0'<=k&&k<='9'){
      x=k-'0';
      break;
    }
  }
  for(;;){
    k = getchar_unlocked();
    if(k<'0'||k>'9'){
      break;
    }
    x=x*10+k-'0';
  }
  if(m){
    x=-x;
  }
}
void wt_L(int x){
  char f[10];
  int m=0, s=0;
  if(x<0){
    m=1,
    x=-x;
  }
  while(x){
    f[s++]=x%10,
    x/=10;
  }
  if(!s){
    f[s++]=0;
  }
  if(m){
    putchar_unlocked('-');
  }
  while(s--){
    putchar_unlocked(f[s]+'0');
  }
}
int a[100];
int main(){
  int ans=1, i, n;
  rd(n);
  {
    int lhxun_Zi;
    for(lhxun_Zi=0;lhxun_Zi<n;lhxun_Zi++){
      rd(a[lhxun_Zi]);
    }
  }
  sort(a, a+n);
  for(i=0;i<n-1;i++){
    ans += a[i] < a[i+1];
  }
  wt_L(ans);
  putchar_unlocked('\n');
  return 0;
}
// cLay varsion 20170910-1

// --- original code ---
// int a[100];
// {
//   int n;
//   rd(n, a(n));
//   sort(a, a+n);
//   int ans = 1;
//   rep(i,n-1) ans += a[i] < a[i+1];
//   wt(ans);
// }

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <algorithm>
#include <utility>
#include <queue>
#include <string>
#include <set>
#include <bitset>
#include <unordered_map>

using namespace std;
using ll = long long;
using Pii = pair<int, int>;
using Pll = pair<ll, ll>;
template <class T>
using Vvec = vector<vector<T> >;

int main()
{
    int H, A;
    cin >> H >> A;
    if(H%A==0) cout << H / A << endl;
    else cout << H / A + 1 << endl;
}

Measured memory_bytes: 256
#include<iostream>
#include<cstdio>
#include<cmath>
#include<algorithm>
#define ll long long
#define re register
using namespace std;
struct ios{
	template <typename ty> inline ios& operator >> (ty &x)
	{
		register int f=1;x=0;register char c=getchar();
		for(;c<'0'||c>'9';c=getchar()) if(c=='-') f=-1;
		for(;c>='0'&&c<='9';c=getchar()) x=(x<<1)+(x<<3)+(c^48);
		x*=f;return *this;
	}
	template <typename ty>  inline ios& operator << (ty x)
	{
		if(x<0) x=-x,putchar('-');
		if(x>9) *this << x/10;
		putchar(x%10+48);
		return *this;
	}
	inline ios& operator << (char x){putchar(x);return *this;}
}io;
const int N = 10086;
int a;
int main()
{
	io>>a;
	io<<3*a*a;
	return 0;
}

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

typedef long long int ll;
typedef vector<int> vi;     typedef vector<ll> vl;
typedef vector<vi> vvi;     typedef vector<vl> vvl;
typedef pair<int, int>  pii;  typedef pair<ll, ll> pll;
typedef vector<pii> vii;    typedef vector<pll> vll;
typedef map<int,int> mii;
typedef vector<char> vc;
typedef vector<bool> vb;
#define endl '\n'
#define rep(i,a,n) for (int i=a;i<=n;i++)
#define per(i,a,n) for (int i=n;i>=a;i--)
#define trav(a,x) for(auto &a:x)
#define all(x) x.begin(),x.end()
#define sz(x) (ll)x.size()
#define MOD 1000000007
#define F first
#define S second
#define pb push_back
#define pf push_front
#define rb pop_back
#define rf pop_front
#define in insert
#define mp make_pair
#define fill(a,x) memset(a,x,sizeof a);
#define min3(a, b, c) min(min(a, b), c)
#define min4(a, b, c, d) min(min(a, b), min(c, d))
#define max3(a, b, c) max(max(a, b), c)
#define max4(a, b, c, d) max(max(a, b), max(c, d))
const ll INFL = 1e18;
const int INFI = 1e9;
#ifdef EVIL
	#include "../../trace.h"
#else
	#define trace(args...)
#endif

ll div_floor(const ll &a,const ll &b) { return a / b - (((a ^ b) < 0) and a % b);}
ll div_ceil(const ll &a,const ll &b) { return a / b + (((a ^ b) >= 0) and a % b);}
ll modpow(ll a, ll b, ll m = MOD){a %= m; ll res = 1; 
	while (b) {if (b & 1)res = (res * a) % m; a = (a * a) % m; b >>= 1;} return res;}
ll bpow(ll a, ll b){ll res = 1; while (b) {if (b & 1)res = res * a; a = a * a; b >>= 1;} return res;}
ll modinv(ll a, ll m = MOD) {return modpow(a, m - 2, m);}
// void graph(vvi &adj, int m) {int x, y; forn(i, m){cin>>x>>y; adj[--x].pb(--y); adj[y].pb(x);}}


int h1, m1, h2, m2, k;

void solve(){
	cin>>h1>>m1>>h2>>m2>>k;
	int ans = (h2*60+m2)-(h1*60+m1)-k;
	cout<<ans;
}

int main(){
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);
	#ifdef EVIL
		freopen("inp.txt", "r", stdin);
		freopen("out.txt", "w", stdout);
		freopen("err.txt", "w", stderr);
	#endif
	int t=1;
	// cin>>t;
	rep(q,0,t-1){
		solve();
	}
}


Measured memory_bytes: 3636
N,M=map(int,input().split())
peaks=list(map(int,input().split()))
goodpeaks=[1]*N
for i in range(M):
    a,b=map(int,input().split())
    if peaks[a-1]<peaks[b-1]:
        goodpeaks[a-1]=0
    elif peaks[a-1]>peaks[b-1]:
        goodpeaks[b-1]=0
    elif peaks[a-1]==peaks[b-1]:
        goodpeaks[a-1]=0
        goodpeaks[b-1]=0
#    print(goodpeaks)
ans=0
for h in goodpeaks:
    if h != 0:
        ans+=1

print(ans)

Measured memory_bytes: 86408
#include<iostream>
using namespace std;
int  main()
{
  int n,i,c=0;
  cin>>n;
  string s;
  cin>>s;
  for(i=0;i<n-2;i++)
  {
    if(s[i]=='A'&&s[i+1]=='B'&&s[i+2]=='C')
    {
      c++;
    }
  }
  cout<<c<<endl;
  return 0;
}

Measured memory_bytes: 256
import fractions
import sys
input = sys.stdin.readline

N,M=map(int,input().split())
a = list(map(int, input().split()))


lcm = a[0]
for i in range(1, N):
    g= fractions.gcd(lcm, a[i])
    lcm = lcm * a[i] // g


g=a[0]
for i in range(N):
    g=fractions.gcd(g,a[i])

for i in range(N):
    if (a[i]//g)%2==0:
        lcm=0
        break    
    
    
ans=0
l=lcm//2
if l:
    ans=(M//l)-(M//(l+l))
print(ans)



Measured memory_bytes: 85440
/*
!لَا أَبْرَحُ حَتَّىٰ أَبْلُغَ
فَصَبْرٌ جَمِيلٌ
*/
#define _CRT_SECURE_NO_WARNINGS
#include<bits/stdc++.h>
using namespace std;
/*#define endl                         '\n'	
#define Ceil(x,y)             ((x+y-1)/y)
#define sz(s)               (int)s.size()
#define RT(x)           return cout<<x,0;
#define mem(x,y)    memset(x,y,sizeof(x))
#define all(v) ((v).begin()), ((v).end())
#define vi                    vector<int>
#define Tesla              file();
#define fr(x,y) for(int x=0; x<(y); ++x)
#define fe(x,z,y) for(int x=z; x<(y); ++x)
const double PI = acos(-1), EPS = 1e-7;

typedef long long ll;
typedef unsigned long long ull;
const int dr[] { -1, -1, 0, 1, 1, 1, 0, -1 };
const int dc[] { 0, 1, 1, 1, 0, -1, -1, -1 };
ll gcd(ll x, ll y) { return (!y) ? x : gcd(y, x%y); }
ll lcm(ll x, ll y) { return ((x / gcd(x, y))*y); }
ll mod = 998244353;
ll power(ll x, ll y)
{
	if (y == 0)return 1;
	if (y == 1)return x;
	ll r = power(x, y / 2) % mod;
	return r%mod*r%mod*power(x, y % 2) % mod;
}
void file() {
#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif  !ONLINEJUDGE
	ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);

}*/

int main()
{
	//Tesla
		int x, y, z;
	cin >> x >> y >> z;
	cout << z << " " << x << " " << y;
		
}

Measured memory_bytes: 256
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <deque>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>

using namespace std;

typedef long long ll;

#define MOD 1000000007

int main() {
  int x;
  cin >> x;
  if (30 <= x) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
  return 0;
}

Measured memory_bytes: 3588
// 失敗するからこそ そこから立ち向かって行く強さがあってそんな強さが本当の強さだと私は思うから
// ぜったいあきらめない
#include<bits/stdc++.h>
using namespace std;

#if defined(DAIJOBU)
#include "/home/ichigo/debug.hpp"
#define deb(x...) cerr << "[" << #x << "] = ["; _print(x)
#else
#define deb(x...)
#endif
#define FIO {ios::sync_with_stdio(0);cin.tie(nullptr);cout.tie(nullptr);}
	

int main(){
	FIO
	
	// A = ab * sin(C) / 2
	// h / b = sin(C) => h = b * sin(C);
	// l = a + b + c
	// c = sqrt(a * a + b * b - 2 * a * b * cos(C))
	int a, b, C;
	cin >> a >> b >> C;
	long double pi = 2 * acos(0);
	long double area = a * b * sin(C/180.0 * pi) / 2.0;
	long double per = sqrt(a * a + b * b - 2 * a * b * cos(C/180.0 * pi)) + a + b;
	long double H = b * sin(C/180.0 * pi);
	cout << fixed << setprecision(10) << area << '\n' << per << '\n' << H << '\n';
	return 0;
}



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

using namespace std;
typedef long long ll;
typedef pair<ll,ll> P;

ll N,C;
vector<P> ch[30];
vector<P> v;
vector<ll> r;

int main(){
    cin >> N >> C;
    for(int i=0;i<N;i++){
        ll s,t,c;
        cin >> s >> t >> c;
        ch[c-1].push_back(make_pair(s,t));
    }
    for(int i=0;i<C;i++){
        if(ch[i].size()==0) continue;
        sort(ch[i].begin(),ch[i].end());
        ll s,t,ls,lt;
        ls = ch[i][0].first;
        lt = ch[i][0].second;
        for(int j=1;j<ch[i].size();j++){
            s = ch[i][j].first;
            t = ch[i][j].second;
            if(s != lt){
                v.push_back(make_pair(lt,ls));
                ls = s;
                lt = t;
            }else{
                lt = t;
            }
        }
        v.push_back(make_pair(lt,ls));
    }
    sort(v.begin(),v.end());
    for(int i=0;i<v.size();i++){
        ll s,t;
        s = v[i].second;
        t = v[i].first;
        ll ind = -1;
        ll t_max = -1;
        for(int j=0;j<r.size();j++){
            if(r[j] < s){
                if(t_max < r[j]){
                    ind = j;
                    t_max = r[j];
                }
            }
        }
        if(ind == -1) r.push_back(t);
        else r[ind] = t;
    }
    cout << r.size() << endl;
    return 0;
}

Measured memory_bytes: 4728
using System;
using System.Collections.Generic;
using System.Linq;

namespace PaizaTest
{
    class Program
    {
        static void Main(string[] args)
        {
            var XN = Console.ReadLine().Split().Select(int.Parse).ToList();
            if (XN[1] == 0)
            {
                Console.WriteLine(XN[0]);
                return;
            }
            var p = Console.ReadLine().Split().Select(int.Parse).ToList();

            var nums = new List<int>();


            for (int i = -101; i <= 202; i++)
            {
                if (p.Contains(i))
                {
                    continue;
                }

                nums.Add(i);
            }
            nums.Sort();

            var minimum = int.MaxValue;
            var result = 0;

            foreach (var num in nums)
            {
                if (minimum > Math.Abs(XN[0] - num))
                {
                    minimum = Math.Abs(XN[0] - num);
                    result = num;
                }
            }

            Console.WriteLine(result);
        }
    }
}


Measured memory_bytes: 19212
#include<cstdio>
#include<cstring>

#define MAXN 1000000
#define MOD 1000000007
char str[MAXN+5];
long long Pow[MAXN+5];
long long A[MAXN+5],C[MAXN+5],M[MAXN+5],N[MAXN+5];

int main(){
    Pow[0]=1;
    for(int i=1;i<=MAXN;i++)//初始化3的幂
        Pow[i]=Pow[i-1]*3%MOD;
    scanf("%s",str+1);
    int len=strlen(str+1);
    for(int i=1;i<=len;i++){
        A[i]=A[i-1]+(str[i]=='A');
        M[i]=M[i-1]+(str[i]=='?');
    }
    for(int i=len;i>=1;i--){
        C[i]=C[i+1]+(str[i]=='C');
        N[i]=N[i+1]+(str[i]=='?');
    }//计算前后缀和
    long long Ans=0;
    for(int i=1;i<=len;i++){
        if(str[i]=='B'||str[i]=='?'){//问号当成B
            Ans=(Ans+
                 A[i]*C[i]*Pow[M[i-1]%MOD+N[i+1]]%MOD+
                 A[i]*N[i+1]%MOD*Pow[M[i-1]+N[i+1]-1]%MOD+
                 C[i]*M[i-1]%MOD*Pow[M[i-1]+N[i+1]-1]%MOD+
                 Pow[M[i-1]+N[i+1]-2]*M[i-1]%MOD*N[i+1])%MOD;
                 //几种情况
        }
    }
    printf("%lld",Ans);
}

Measured memory_bytes: 19584
#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <string>
#include <ios>
#include <iomanip>
#include <cstdlib>
using namespace std;
int main(void){
  int a,b;
  cin >> a >> b;
  
  int c = a * 3 + b;
  
  cout << c / 2 << endl;
  
  return 0;
}

Measured memory_bytes: 256
n,m = gets.split.map(&:to_i)
a = Array.new(n,1)
b = Array.new(n,false)
b[0] = true
m.times do
    x,y = gets.split.map{|i|i.to_i-1}
    b[y] = true if b[x]
    a[x] -= 1
    a[y] += 1
    b[x] = false if a[x] == 0
end
puts b.count(true)

Measured memory_bytes: 3324
#include<cstdio>
#include<algorithm>
#include<iostream>
#include<string>
#include<cstring>
#include<vector>
#include<stack>
#include<bitset>
#include<cstdlib>
#include<cmath>
#include<set>
#include<list>
#include<deque>
#include<map>
#include<queue>
#include <fstream>
using namespace std;
typedef long long ll;
const ll INF = 0x3f3f3f3f;
const double PI = acos(-1.0);
const double eps = 1e-6;
const ll mod = 1e17+7;
const int maxn = 200005;
ll T,n,m;
int a[maxn];
int main() {
	ll minn = mod;
	cin>>n;
	ll sum1 = 0;
	ll sum2 = 0;
	for(int i =1;i<=n;i++){
		cin>>a[i];
		sum1+=a[i];
	}
	for(int i=1;i<=n;i++){
		sum2+=a[i];
		minn = min(abs(sum2-(sum1-sum2)),minn);
	}	
	cout<<minn<<endl;
    return 0;
}



Measured memory_bytes: 1152
#include <iostream>

int main()
{
	int count, a, b, tmp;

	while(std::cin>>a>>b){
		count = 0;
		tmp = a + b;
		while(tmp > 0){
			count++;
			tmp /= 10;
		}
		std::cout<<count<<std::endl;
	}
	return 0;
}

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

string s;

int main(){
    cin>>s;
    set<char> ss;
    for(int i=0;i<s.length();i++){
        ss.insert(s[i]);
    }
    if(s.length()==ss.size())cout<<"yes"<<endl;
    else cout<<"no"<<endl;
    return 0;
}

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

#define int long long

#define rep(i,s,n) for(int i = (s);i<(n);i++)
#define repe(i,s,n) for(int i = (s);i<=(n);i++)
#define rrep(i,s,n) for(int i = (n)-1;i>=(s);i--)
#define all(v) (v).begin(),(v).end()
#define pb push_back
#define fi first
#define se second
typedef long long ll;
typedef pair<int,int>pint;
typedef vector<int>vint;
const ll MOD=1000000007,INF=1e18;
int dy[]={1,0,-1,0};
int dx[]={0,1,0,-1};

int n,x,sum=0,cnt=0;
int a[100010];

signed main(){
    cin>>n>>x;
    rep(i,0,n){
        cin>>a[i];
    }
    sum=x;
    sort(a,a+n);
    rep(i,0,n){
        if(sum>=a[i]){
            sum-=a[i];
            cnt++;
        }
        if(i==n-1&&sum&&cnt==n)cnt--;
    }
    
    cout<<cnt<<endl;
    
    
    
    
    return 0;
}

Measured memory_bytes: 256
#include<bits//stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define req(i,n) for(int i = 1;i <=  n; i++)
int N, M, Q,L,R;
vector<vector<int>> p(510, vector<int>(510, 0));
int main() {
	cin >> N >> M >> Q;
	rep(i, M) { cin >> L >> R; p[L][R]++; }
	req(i, N) req(j, N) p[i][j] += p[i - 1][j];
	req(i, N) req(j, N) p[i][j] += p[i][j- 1];
	rep(i, Q) {
		cin >> L >> R;
		cout << p[R][R] + p[L - 1][L - 1] - p[L - 1][R] - p[R][L - 1] << endl;
	}
}


Measured memory_bytes: 4624
use proconio::input;

fn main() {
    input! {
        x: i64,
        n: usize,
        p: [i64; n],
    };
    let mut c = vec![true; 101 + 1];
    for &p_i in p.iter() {
        c[p_i as usize] = false;
    }
    let mut min_abs = (x + 1).abs();
    let mut ans = -1_i64;
    for i in 0..=101 {
        if c[i] {
            if (x - i as i64).abs() < min_abs {
                min_abs = (x - i as i64).abs();
                ans = i as i64;
            }
        }
    }
    println!("{}", ans);
}


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

using namespace std;

const int INF = 1 << 30;

int N, K, A[100000];
int succ[36][101010];
vector< pair< int, int > > d;
vector< int > g[100000];
int dist[100000];

void dfs(int idx)
{
  for(int to : g[idx]) {
    d[to] = {d[idx].first + 1, to};
    dfs(to);
  }
}

bool cut(int idx)
{
  int now = idx;

  if(dist[now] != -1) return (false);
  for(int i = 0; i < K - 1; i++) now = A[now];

  queue< int > que;
  dist[now] = 0;
  que.emplace(now);
  while(!que.empty()) {
    int p = que.front();
    que.pop();
    for(int to : g[p]) {
      if(dist[to] == -1) {
        dist[to] = dist[p] + 1;
        if(dist[to] < K - 1) que.push(to);
      }
    }
  }
  return (true);
}

void Calculation()
{
  cin >> N >> K;

  for(int i = 0; i < N; i++) {
    cin >> A[i];
    --A[i];
    succ[0][i] = A[i];
  }

  int ret = 0;
  if(A[0] != 0) {
    ++ret;
    A[0] = 0;
  }

  d.assign(N, {0, 0});
  for(int i = 1; i < N; i++) g[A[i]].push_back(i);
  dfs(0);
  sort(begin(d), end(d));
  reverse(begin(d), end(d));
  memset(dist, -1, sizeof(dist));
  for(int i = 0; i < N; i++) {
    if(d[i].first <= K) break;
    ret += cut(d[i].second);
  }
  cout << ret << endl;
}

int main()
{
  Calculation();
}

Measured memory_bytes: 10752
#include<stdio.h>

#define N 1000000

int calcPrime(int);

int main(){

  int prime_num[N],i,num;

  for(i=0;i<N;i++)prime_num[i]=0;

  for(i=0;i<N;i++){
    if(calcPrime(i))prime_num[i]=prime_num[i-1]+1;
    else prime_num[i]=prime_num[i-1];
  }

  while(scanf("%d",&num)!=EOF){
    printf("%d\n",prime_num[num]);
  }
  return 0;
}

int calcPrime(int num){
  int i;
  if(num<2)return 0;
  else if(num==2)return 1;
  else if(num%2==0)return 0;
  for(i=3;i*i<=num;i=i+2){
    if(num%i==0)return 0;
  }
  return 1;
}

Measured memory_bytes: 4504
#include<bits/stdc++.h>
using namespace std;
#define all(a)  (a).begin(),(a).end()
typedef long long ll;
const ll mod=1000000007;

int main() {
  ll n,a,b; cin >>n >>a>>b;
  vector<ll> x(n), cost(n,mod);
  for(ll i=0LL; i< n;++i) cin >> x[i];
  cost[0] = 0;
  for(ll i=1LL; i< n;++i) {
    cost[i] = cost[i-1] + min(b , a*(x[i]-x[i-1]));
  }
  cout << cost[n-1] << endl;
  return 0;
}


Measured memory_bytes: 1792
#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cstring>
#include<cmath>
#include<queue>
#include<map>
using namespace std;

inline int read()
{
  int x=0,f=1;char ch=getchar();
  while (!isdigit(ch)) {if (ch=='-') f=-1;ch=getchar();}
  while (isdigit(ch)) {x=(x<<1)+(x<<3)+ch-'0';ch=getchar();}
  return x*f;
}

map<long long ,int > m,mm;

int n;
long long a[200010];
long long sum[200010];
long long tmp;
long long ans;
int main()
{
  cin>>n;
  for (int i=1;i<=n;i++) scanf("%lld",&a[i]),sum[i]=sum[i-1]+a[i];
  for (int i=1;i<=n;i++) m[sum[i]]++;
  ans=m[0];
  for (int i=1;i<=n;i++)
  {
  	  tmp+=a[i];
  	  m[sum[i]]--;
  	 // if (!mm[tmp])
  	//  {
  	    ans+=m[tmp];
    // }
  }
  cout<<ans;
  return 0;
}


Measured memory_bytes: 15872
#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>;
using vi = vector<int>;
using vvi = vector<vi>;

int main() {
    int n;
    cin >> n;
    vi a(n+1);
    rep(i, n) cin >> a.at(i+1);
    vector<ll> dp(n+1);
    dp.at(0) = 1000;
    for (int k = 1; k <= n; k++) {
        dp.at(k) = 0;
        for (int i = 0; i < k-1; i++) {
            int m = 99999;
            for (int j = i+1; j < k; j++){
                m = min(m, a.at(j));
            }
            dp.at(k) = max(dp.at(k), dp.at(i)/m*a.at(k)+dp.at(i)%m);
        }
    }
    ll x = 0;
    rep(i, n+1) x = max(x, dp.at(i));
    cout << x << endl;
    return 0;
}

Measured memory_bytes: 3564
N, K = map(int, input().split())
A = [int(_) for _ in input().split()]
B = 10 ** 9 + 7
work = 0
ans1, ans2 = 0, 0
for i, p in enumerate(A):
    # A1セット中の個数
    for j in range(i + 1, N):
        if p > A[j]:
            ans1 += 1
    # A2セット目
    for q in A:
        if p > q:
            ans2 += 1

ans1 *= K
ans2 *= (K * (K - 1)) // 2
ans = ans1 + ans2
print(int(ans % B))

Measured memory_bytes: 3188
// AOJ 0260: Salary for a Plumber
// 2017.9.8 bal4u@uu
// 2017.11.12

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

int j[65003];
int f[1002];
char buf[325010], *p;

int getint()
{
	int n = 0;
	while (*p >= '0') n = (n<<3) + (n<<1) + (*p++ & 0xf);
	return n;
}

int main()
{
	int n, i, k;
    long long sum, ans, t;

	while (fgets(p=buf, 10, stdin) && *p != '0') {
		n = getint();
		fgets(p=buf, sizeof(buf), stdin);
		sum = 0, i = n; while (i--) sum += getint(), p++;
		
		memset(f, 0, sizeof(f));
		fgets(p=buf, sizeof(buf), stdin);
		i = n-1; while (i--) f[getint()]++, p++;
		for (k = 1, i = 1000; i >= 1; i--) while (f[i]) j[k++] = i, f[i]--;

        for (ans = sum*n, i = 1; i < n; i++) {
            sum += j[i];
			if ((t = sum * (n-i)) > ans) ans = t;
        }
        printf("%lld\n", ans);
	}
	return 0;
}

Measured memory_bytes: 2052
#include <stdio.h>
#include <cmath>
#include <algorithm>
#include <cfloat>
#include <stack>
#include <queue>
#include <vector>
typedef long long int ll;
#define BIG_NUM 2000000000
#define MOD 1000000007
#define EPS 0.000001
using namespace std;

enum Token{
	NONE,
	MULT,
	PLUS,
};

int length;

int left_to_right(char buf[18]){
	int ans = buf[0] - '0';

	Token token = NONE;

	for(int i = 1; i < length; i++){
		switch(buf[i]){
		case '+':
			token = PLUS;
			break;
		case '*':
			token = MULT;
			break;
		default: //??°???
			if(token == MULT){
				ans *= buf[i] - '0';
			}else if(token == PLUS){
				ans += buf[i] - '0';
			}
			break;
		}
	}

	return ans;
}

int multi_first(char buf[18]){

	int tmp;

	stack<int> NUM;
	stack<char> OP;

	NUM.push(buf[0]-'0');

	for(int i = 1; i < length; i++){
		if(buf[i] >= '0' && buf[i] <= '9'){

			if(OP.top() == '*'){
				OP.pop();
				tmp = NUM.top();
				NUM.pop();
				NUM.push(tmp*(buf[i]-'0'));
			}else{
				NUM.push(buf[i]-'0');
			}
		}else{
			OP.push(buf[i]);
		}
	}

	int ans = 0;
	while(!NUM.empty()){
		ans += NUM.top();
		NUM.pop();
	}
	return ans;
}

int main(){

	char buf[18];
	int num,rule_1,rule_2;

	scanf("%s",buf);
	scanf("%d",&num);

	for(length = 0;buf[length] != '\0'; length++);

	rule_1 = multi_first(buf);
	rule_2 = left_to_right(buf);

	if(num == rule_1 && num == rule_2){
		printf("U\n");
	}else if(num != rule_1 && num == rule_2){
		printf("L\n");
	}else if(num == rule_1 && num != rule_2){
		printf("M\n");
	}else{ //num != rule_1 && num != rule_2
		printf("I\n");
	}

	return 0;
}

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

#define each(i, c) for (auto& i : c)
#define mkp(a, b) make_pair(a, b)

typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll, ll> Pll;
const ll MOD = 1e9+7;

template<typename P, typename Q> ostream& operator << (ostream& os, pair<P, Q> p) { os << "(" << p.first << ": " << p.second << ")"; return os; }
template<typename T> ostream& operator << (ostream& os, vector<T> v) { os << "("; each (i, v) os << i << ", "; os << ")"; return os; }
template<typename K, typename V> ostream& operator << (ostream& os, map<K, V> m) { os << "{"; each (i, m) os << i << ", "; os << "}"; return os; }

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

  vector<ll> a(n);
  ll total = 0;
  for (ll i = 0; i < n; ++i) {
    cin >> a[i];
    total += a[i];
  }
  sort(a.begin(), a.end(), greater<ll>());

  double x = 1.0 / double(4*m);
  ll ok = true;
  for (ll i = 0; i < m; ++i) {
    double w = double(a[i]) / double(total);
    if (fabs(w-x) < DBL_EPSILON) continue;
    if (w < x) ok = false;
  }

  cout << (ok ? "Yes" : "No") << endl;

  return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define simplify ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define int long long
#define endl "\n"
using namespace std;

const int mod = 1e9 + 7;
int32_t main() {

    simplify
    int n, k;
    cin >> n >> k;

    vector<int>positive, negative;
    int temp;
    for(int i = 0; i < n; i++) {
        cin >> temp;
        if(temp > 0)positive.push_back(temp);
        else negative.push_back(temp);
    }
    sort(positive.rbegin(), positive.rend());
    sort(negative.begin(), negative.end());
    int ans = 1;
    int posSize = positive.size();
    int negSize = negative.size();
    int posAns, negAns;
    if(positive.size() == 0 && k % 2 == 1) {
        int si = negative.size();
        for(int i = si - 1; i >= (si - k); i--) {
            ans *= negative[i];
            ans += mod;
            ans %= mod;
        }
        if(ans < 0)ans += mod;
        //cout << ans << endl;
    } else if(k % 2 == 1) {
        ans = positive[0];
        k--;
        k /= 2;
        int posCurr, negCurr;
        posCurr = 1;
        negCurr = 0;

        while(k--) {
            posAns = negAns = INT_MIN;
            if(posCurr + 1 < posSize) {
                posAns = positive[posCurr] * positive[posCurr + 1];
            }
            if(negCurr + 1 < negSize) {
                negAns = negative[negCurr] * negative[negCurr + 1];
            }
            if(posAns < negAns && negCurr+1<negSize) {
                negAns %= mod;
                negCurr += 2;
                ans *= negAns;
                ans %= mod;

            } else if(posCurr+1<posSize){
                posCurr += 2;
                posAns %= mod;
                ans *= posAns;
                ans %= mod;
            }
            else{
                posAns=positive[posCurr]*negative[negCurr];
                ans*=posAns;
                ans+=mod*1000000000;
                ans%=mod;
            }
        }
    } else {
        ans = 1;
        k /= 2;
        int posCurr, negCurr;
        posCurr = 0;
        negCurr = 0;

        while(k--) {
            posAns = negAns = INT_MIN;
            if(posCurr + 1 < posSize) {
                posAns = positive[posCurr] * positive[posCurr + 1];
            }
            if(negCurr + 1 < negSize) {
                negAns = negative[negCurr] * negative[negCurr + 1];
            }
            if(posAns < negAns && negCurr+1<negSize) {
                negAns %= mod;
                negCurr += 2;
                ans *= negAns;
                ans %= mod;

            } else if(posCurr+1<posSize){
                posCurr += 2;
                posAns %= mod;
                ans *= posAns;
                ans %= mod;
            }
            else{
                posAns=positive[posCurr]*negative[negCurr];
                ans*=posAns;
                ans+=mod*1000000000;
                ans%=mod;
            }
            //cout << ans << " ** " << endl;
        }
    }

    cout << ans << endl;




    return 0;
}



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

int n, a[100], sumA, sumB;

int main(void) {
    cin >> n;
    for (int i = 0; i < n; i++) {
        cin >> a[i];
    }
    sort(a, a+n);
    for (int i = 0; i < n; i++) {
        sumA += a[n-1-i];
        i++;
        if (i >= n) break;
        sumB += a[n-1-i];
    }
    cout << sumA - sumB << endl;
    return 0;
}


Measured memory_bytes: 256
N, X, Y = map(int, raw_input().split())

x = X-1
y = Y-1

a = [0]*N

for i in range(N):
    for j in range(N-i-1):
        #print i, j
        p = i+j+1
        c = min(abs(p-i), abs(x-i)+1+abs(y-p))
        a[c]+=1
        #print "c=",c

for i in range(1,N):
    print a[i]


Measured memory_bytes: 2820
#include <bits/stdc++.h>
#define all(x) (x).begin(), (x).end()
using namespace std;
typedef long long ll;
const int MOD = 1e9 + 7;

int main() {
  int n;
  cin >> n;
  int x = n % 10;
  if (x == 2 || x == 4 || x == 5 || x == 7 || x == 9) {
    cout << "hon" << endl;
  } else if (x == 0 || x == 1 || x == 6 || x == 8) {
    cout << "pon" << endl;
  } else {
    cout << "bon" << endl;
  }
  return 0;
}

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

int main() {
    int l, r, d, co = 0;
    cin >> l >> r >> d;
    for (int i = l; i <= r; ++i) {
        if (i % d == 0)
            co++;
    }
    cout << co << endl;
}

Measured memory_bytes: 3616
try:
    s = []
    while True:
        l = list(map(float, input().split()))
        x = (l[2] * l[4] - l[5] * l[1]) / (l[0] * l[4] - l[3] * l[1])
        y = (l[2] - l[0] * x) / l[1]
        if x == -0 and y == -0:
            x = abs(x)
            y = abs(y)
        elif x == -0:
            x = abs(x)
        elif  y == -0:
            y = abs(y)
        else:
            pass
        
        x_2 = "{0:.3f}".format(x)
        y_2 = "{0:.3f}".format(y)
        print(str(x_2) + " " + str(y_2))
except EOFError:
    pass

Measured memory_bytes: 7304
import java.util.*;

public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int n = Integer.parseInt(sc.next());

    if(n%2==0){
      System.out.println(n*n/4);
    }else{
      System.out.println((n*n-1)/4);
    }
  }
}

Measured memory_bytes: 21716
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for (ll i=0; i<(n); ++i)
#define rep1(i,n) for (ll i=1; i<=(n); ++i)
typedef long long ll;
bool debug=false;
string yes = "Yes";
string no = "No";
const ll mod = 998244353;

int main(){
  vector<ll> v(5);
  ll k; cin >> v[0] >> v[1] >> v[2] >> v[3] >> v[4] >> k;
  rep(i,5){
    for(ll j=i+1; j<5; j++){
      if(abs(v[i]-v[j])>k){
        cout << ":(";
        return 0;
      }
    }
  }
  cout << "Yay!";
  return 0;
}


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

int N;
int main (){
    cin >> N;
    int a[9] = {0};
    for(int i=0; i<N; i++){
        int x;
        cin >> x;
        int col = x / 400;
        if ( x > 3199) {
            a[8]++; // a[3200 / 400]
        } else a[col]++;
    }
    int Min = 0;
    for(int i=0; i<8; i++){
        if( a[i] > 0) Min++;
    }
    int Max = a[8] + Min;
    cout << (Min == 0 ? 1 : Min ) << " " << Max << 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>

using namespace __gnu_pbds;
#define ordered_set tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update>

using namespace std;

#define int long long
#define endl '\n'
#define maxn 100010
const int MOD = 1000000007;
using int32 = __uint32_t;

void solve() {
    int sx, sy ,tx, ty;
    cin >> sx >> sy >> tx >> ty;

    string ans;
    for(int i = 0; i < tx - sx; i++)ans += 'R';
    for(int i = 0; i < ty - sy; i++)ans += 'U';
    for(int i = 0; i < tx - sx; i++)ans += 'L';
    for(int i = 0; i < ty - sy; i++)ans += 'D';

    ans += 'D';
    for(int i = 0; i < tx - sx + 1; i++)ans += 'R';
    for(int i = 0; i < ty - sy + 1; i++)ans += 'U';
    ans += 'L';
    ans += 'U';
    for(int i = 0; i < tx - sx + 1; i++)ans += 'L';
    for(int i = 0; i < ty - sy + 1; i++)ans += 'D';
    ans += 'R';
    cout << ans << endl;
}

int32_t main() {
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);

    int t = 1;
//    cin >> t;

    while (t--)
        solve();
    return 0;
}


Measured memory_bytes: 256
#include<iostream>
using namespace std;
int main() {
	int a, b; cin >> a >> b;
	int n; cin >> n;
	int b00l = 0;
	for (int i = 0; i < n; i++) {
		int c, d; cin >> c >> d;
		if (c < b&&a < d) {
			b00l = 1;
		}
	}
	cout << b00l << endl;
}

Measured memory_bytes: 3112
while True:
    m,f,r = list(map(int, input().split()))
    
    if (m == -1) and (f == -1) and (r == -1):
        break
    elif (m == -1 or f == -1):
        print("F")
    elif (m+f >= 80):
        print("A")
    elif (m+f >= 65) and (m+f < 80):
        print("B")
    elif (m+f >= 50) and (m+f < 65):
        print("C")
    elif (m+f >= 30) and (m+f < 50):
        if (r >= 50):
            print("C")
        else:
            print("D")
    elif (m+f < 30):
            print("F")

Measured memory_bytes: 7684
#include <bits/stdc++.h>
#define rep(i,a,b) for(int i=(a); i<(b); i++)
#define all(c) (c).begin(),(c).end()
#define rall(c) (c).rbegin(),(c).rend()
#define sort(v,n) sort(v,v+n);
#define vsort(v) sort(v.begin(),v.end());
#define ll long long
#define pb(a) push_back(a)
#define fi first
#define se second
#define inf 999999999
using namespace std;
typedef pair<int,int> p;
typedef pair<ll,ll> lp;
bool is_uruu(int y) {
        return y % 4 == 0 && (y % 100 != 0 || y % 400 == 0);
}
const ll MOD=1e9+7;
//---------------------------------------------------------------------------//

int main(){
        int n;
        string s,t;
        cin>>n;
        cin>>s;
        cin>>t;
        for(int i=0; i<n; i++) {
                if(s.substr(i,n-i)==t.substr(0,n-i)) {
                        cout<<n+i<<endl;
                        return 0;
                }
        }
        cout<<2*n<<endl;
}


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

int main(){
  int n;
  string ans = "No";
  cin>>n;
  
  for(int i=0;i<=n/4;i++){
    for(int j=0;j<=n/7;j++){
      if(n == 4*i + 7*j){
        ans = "Yes";
      }
    }
  }
  cout<<ans<<endl;
}

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

#define fst(t) std::get<0>(t)
#define snd(t) std::get<1>(t)
#define thd(t) std::get<2>(t)
#define unless(p) if(!(p))
#define until(p) while(!(p))

using ll = std::int64_t;
using P = std::tuple<int,int>;

int N;

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

    std::cin >> N;

    int cnt = 0;

    for(int n=1;n<=N;n+=2){
        int m = n, l = 1;

        for(int d=2;d<=m;++d){
            int c = 0;
            
            while(m % d == 0){
                m /= d;
                c += 1;
            }

            l *= c + 1;
        }

        if(l == 8){
            cnt += 1;
        }
    }

    std::cout << cnt << std::endl;
}


Measured memory_bytes: 256
n,a,b = map(int,input().split())

from functools import reduce
 
def nCr(n,r,DIV):
  f=lambda x,y:x*y%DIV
  X=reduce(f,range(n-r+1,n+1))
  Y=reduce(f,range(1,r+1))
  return X*pow(Y,DIV-2,DIV)%DIV

DIV = 10**9+7

ans = pow(2, n, DIV)
ans -= 1
ans -= nCr(n,a,DIV)
ans -= nCr(n,b,DIV)

print(ans%DIV)




Measured memory_bytes: 3572
#define _USE_MATH_DEFINES
#include<cstdio>
#include<iostream>
#include<vector>
#include<algorithm>
#include<queue>
#include<stack>
#include<cmath>
#include<climits>
#include<map>
#include<string>
using namespace std;

int X, Y, Fld[17][15], memo[14][15];

int DFS(int y, int x){
	if(Fld[y][x] == 1) return 0;
	if(y >= Y-1) return 1;
	if(Fld[y][x] == 2) return DFS(y+2, x);
	if(memo[y][x] != -1) return memo[y][x];
	memo[y][x] = 0;

	for(int i = -1; i <= 1; i++){
		int ny = y+1, nx = x + i;
		if( nx < 0 || X <= nx || Fld[ny][nx] == 1 || (Fld[ny][nx] == 2 && i != 0) )
			continue;
		memo[y][x] += DFS(ny, nx);
	}

	return memo[y][x];
}

int main(){
	while(cin >> X >> Y, X || Y){
		fill_n( (int*)Fld, 17*15, 0 );
		for(int i = 0; i < Y; i++){
			for(int j = 0; j < X; j++){
				cin >> Fld[i][j];
			}
		}

		int ans = 0;
		fill_n( (int*)memo, 14*15, -1 );
		for(int i = 0; i < X; i++) if(Fld[0][i] == 0) ans += DFS(0, i);
		printf("%d\n", ans);
	}
	return 0;
}

Measured memory_bytes: 1144
#include <cstdio>

using namespace std;

int main() {
  int A, B;
  int Cookies[3];
  scanf("%d%d", &A, &B);
  Cookies[0] = A;
  Cookies[1] = B;
  Cookies[2] = A + B;
  for (int i = 0; i < 3; ++i) {
    if (Cookies[i] % 3 == 0) {
      printf("Possible");
      return 0;
    }
  }
  printf("Impossible");
  return 0;
}


Measured memory_bytes: 128
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)n; ++i)
#define repi(i, a, b) for (int i = int(a); i < int(b); ++i)
#define repr(i, n) for (int i = (int)n - 1; i >= 0; --i)
#define ALL(a) (a).begin(), (a).end()
using ll = long long;
using Graph = vector<vector<int>>;
const ll MOD = 1e9 + 7;
const ll INF = 1e9;
const ll LINF = 1LL << 60;

int main() {
  double a, b, n;
  cin >> a >> b >> n;
  if (n < b) {
    cout << (int)(a * n / b) << endl;
  } else {
    cout << (int)(a * (b - 1) / b) << endl;
  }
  return 0;
}


Measured memory_bytes: 3720
#include <iostream>

int main() {
    int a, b, n = 0, m = 0;
    std::cin >> a >> b;
    while (a != 0 && b != 0) {
        if(m >= 1){
        std::cout << std::endl;
        }
        for (int i = a; i <= b; ++i) {
            if (i % 400 == 0) {
                std::cout << i << std::endl;
                n = 1;
            } else if (i % 100 != 0 && i % 4 == 0) {
                std::cout << i << std::endl;
                n = 1;
            } else  {
                continue;
            }
        }
        if (n == 0) {
            std::cout << "NA" << std::endl;
        }
        std::cin >> a >> b;
        n = 0;
        m++;
    }
    return 0;
}

Measured memory_bytes: 3068
#include <iostream>
#include <vector>
#include <map>
#include <unordered_map>
#include <set>
#include <unordered_set>
#include <stack>
#include <queue>
#include <algorithm>
#include <list>
#include <cstdio>
#include <cstdlib>
#include <climits>
#include <numeric>
#include <cmath>
#include <memory.h>
#include <algorithm>
#include <cassert>
using namespace std;

typedef long long ll;
typedef pair<int, int> pii;
typedef pair<double, int> pdi;
typedef pair<double, double> pdd;
typedef pair<ll, int> pli;
typedef vector<vector<int>> vvi;
#define mod 10000
#define PI acos(-1.0)
#define eps 1e-8
#define e 2.71828

typedef long long ll;

ll n, a, b;
vector<ll> hp;

bool check(ll s) {
    ll sum = 0;
    for (int i = 0; i < n; ++i) {
        ll tmp = hp[i] - b * s;
        tmp = max(0LL, (tmp + a - b - 1) / (a - b));
        sum += tmp;
        if (sum > s) return false;
    }
    return true;
}

int main(){
    cin >> n >> a >> b;
    hp.resize(n);
    ll sum = 0, r = 0;
    for (int i = 0; i < n; ++i) {
        scanf("%lld", &hp[i]);
        sum += hp[i];
        r += (hp[i] + a - 1) / a;
    }
    ll l = sum / (a + (n - 1) * b);

    while (l < r) {
        ll mid = l + (r - l) / 2;
        if (check(mid)) {
            r = mid;
        } else {
            l = mid + 1;
        }
    }

    cout << l;

    return 0;
}

Measured memory_bytes: 1024