akhauriyash/Code-Regression huggingface dataset:
//#define NDEBUG
#include <cstddef>
#include <cstdint>
#include <iostream>
#include <vector>

namespace n91 {

using i8 = std::int_fast8_t;
using i32 = std::int_fast32_t;
using i64 = std::int_fast64_t;
using u8 = std::uint_fast8_t;
using u32 = std::uint_fast32_t;
using u64 = std::uint_fast64_t;
using isize = std::ptrdiff_t;
using usize = std::size_t;

constexpr usize operator"" _z(unsigned long long x) noexcept {
  return static_cast<usize>(x);
}

class rep {
  const usize f, l;

public:
  class itr {
    friend rep;
    usize i;
    constexpr itr(const usize x) noexcept : i(x) {}

  public:
    void operator++() noexcept { ++i; }
    constexpr usize operator*() const noexcept { return i; }
    constexpr bool operator!=(const itr x) const noexcept { return i != x.i; }
  };
  constexpr rep(const usize first, const usize last) noexcept
      : f(first), l(last) {}
  constexpr itr begin() const noexcept { return itr(f); }
  constexpr itr end() const noexcept { return itr(l); }
};
class revrep {
  const usize f, l;

public:
  class itr {
    friend revrep;
    usize i;
    constexpr itr(usize x) noexcept : i(x) {}

  public:
    void operator++() noexcept { --i; }
    constexpr usize operator*() const noexcept { return i; }
    constexpr bool operator!=(const itr x) const noexcept { return i != x.i; }
  };
  constexpr revrep(usize first, usize last) noexcept : f(--first), l(--last) {}
  constexpr itr begin() const noexcept { return itr(l); }
  constexpr itr end() const noexcept { return itr(f); }
};
template <class T> using vec_alias = std::vector<T>;
template <class T> auto md_vec(const usize n, const T &value) {
  return std::vector<T>(n, value);
}
template <class... Args> auto md_vec(const usize n, Args... args) {
  return std::vector<decltype(md_vec(args...))>(n, md_vec(args...));
}
template <class T> constexpr T difference(const T &a, const T &b) {
  return a < b ? b - a : a - b;
}
template <class T> T scan() {
  T ret;
  std::cin >> ret;
  return ret;
}

} // namespace n91

#include <algorithm>
#include <iostream>
#include <string>
#include <utility>


namespace n91 {

void main_() {
  const u32 a = scan<u32>();
  const std::string s = scan<std::string>();
  if (a >= static_cast<u32>(3200)) {
    std::cout << s << std::endl;
  } else {
    std::cout << "red" << std::endl;
  }
}

} // namespace n91

int main() {
  n91::main_();
  return 0;
}


Measured memory_bytes: 256
#include <algorithm>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <iomanip>
#include <iostream>
#include <string>
#include <vector>

typedef long long ll;
using namespace std;

#define mod 1000000007

int main() {
    string s = "";
    cin >> s;
    reverse(s.begin(), s.end());
    vector<ll> mod_13(13);
    vector<ll> for_copy(13);
    if (s.at(0) == '?') {
        fill(mod_13.begin(), mod_13.begin()+10, 1);
    }
    else {
        mod_13.at(s.at(0)-'0') = 1;
    }
    int mod_now = 10;
    for (int i=1; i<s.size(); i++) {
        if (s.at(i) == '?') {
            for (int j=0; j<10; j++) {
                int mod_buf = mod_now*j%13;
                int to = 0;
                for (int k=0; k<13; k++) {
                    to = k+mod_buf;
                    to %= 13;
                    for_copy.at(to) += mod_13.at(k);
                    for_copy.at(to) %= mod; 
                }
            }
            mod_13 = for_copy;
            for (int j=0; j<13; j++) mod_13.at(j) %= mod;
            fill(for_copy.begin(), for_copy.end(), 0);
        }
        else {
            int mod_buf = mod_now*(int)(s.at(i)-'0')%13;
            int to = 0;
            for (int j=0; j<13; j++) {
                to = j+mod_buf;
                to %= 13;
                for_copy.at(to) += mod_13.at(j);
                for_copy.at(to) %= mod;
            }
            mod_13 = for_copy;
            for (int j=0; j<13; j++) mod_13.at(j) %= mod;
            fill(for_copy.begin(), for_copy.end(), 0);
        }
        mod_now *= 10;
        mod_now %= 13;
    }
    cout << mod_13.at(5) << endl;
    return 0;
}


Measured memory_bytes: 512
def solve(inp):
    (X, Y) = map(int, inp.readline().strip().split(' '))

    return str(int(X + Y / 2))


def test(s):
    from io import StringIO
    print(solve(StringIO(s)))


def main():
    import sys
    result = solve(sys.stdin)
    if result:
        print(result)


if __name__ == '__main__':
    # test('')
    main()


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

ll a,b,n;
int main(){
	ios::sync_with_stdio(false);
	cin >>  a >> b >> n;
	n=min(n,b-1);
	cout << (a*n)/b-a*(n/b) << '\n';
    return 0;
}


Measured memory_bytes: 3648
let n = stdin.ReadLine() |> float

let rate = 1.08

let ans =
  let x = n / rate |> ceil
  [ let mutable y = x
    while y < (n + 1.) / rate do
      yield y
      y <- y + 1. ]
  |> (fun l ->
        match l with
        | [] -> ":("
        | x :: _ -> sprintf "%d" (int x))

ans |> stdout.WriteLine

Measured memory_bytes: 14044
#define _CRT_SECURE_NO_WARNINGS
#define _USE_MATH_DEFINES
#include <bits/stdc++.h>

#define fore(i,a,b) for(int i = a; i < (b); i++)
#define fr(i,a,b) for(int i = a; i >= b; i--)
#define fast ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0)
#define N 200005
#define FH 400005
#define inf INT32_MAX
#define MOD 1000000007LL

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


inline void solve()
{
	int n, k;
	cin >> n >> k;
	double otv = 0;
	fore(i, 0, n)
	{
		int sc = i + 1;
		int st = 0;
		while (sc < k)
		{
			sc *= 2;
			st++;
		}
		otv += 1.0 / n * pow(0.5, st);
	}
	cout << fixed << setprecision(9) << otv;
}



int main()
{
	fast;
#if defined(_DEBUG)
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif
	solve();
}

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

int main(){
  int K;
  cin >> K;
  int atk[2];
  atk[0]=atk[1]=0;
  vector<string>cmd[2];
  cmd[0].resize(K),cmd[1].resize(K);
  for(int i=0;i<2;i++){
    for(int j=0;j<K;j++){
      cin >> cmd[i][j];
    }
  }

  int winner=-1,lst=-1;

  for(int tc=0;tc<K;tc++){

    for(int i=0;i<2;i++){
      if(cmd[i][tc]=="tameru")atk[i]=min(atk[i]+1,5);
      else if(cmd[i][tc]=="kougekida"){
        if(atk[i]==0 && cmd[1-i][tc]!="kougekida"){winner=1-i;goto end;}
        if(atk[i]==5 || cmd[1-i][tc]=="tameru"){
          lst=1;
          winner=i;
          goto end;
        }
        if(cmd[i][tc]=="kougekida" && cmd[1-i][tc]=="kougekida"){
          lst=3;
          if(atk[0]==0 && atk[1]==0)break;
          if(atk[0]==atk[1]){
            atk[0]=atk[1]=0;
            break;
          }
          winner=atk[0]<atk[1]?1:0;
          goto end;
        }
        atk[i]=0;
      }
    }

  }

  end:;

  if(winner==0)cout << "Isono-kun" << endl;
  else if(winner==1)cout << "Nakajima-kun" << endl;
  else cout << "Hikiwake-kun" << endl;
  return 0;
}

Measured memory_bytes: 1224
/*Shivam Bhalla */
/* f2016941@pilani.bits-pilani.ac.in */

#include <iostream>
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <cctype>
#include <algorithm>
#include <map>
#include <vector>
#include <list>
#include <set>
#include <queue>
#include <deque>
#include <stack>
#include <iostream>
#include <string>
#include <cmath>
#include <cassert>
#include <bits/stdc++.h>
#define fast_cin() ios_base::sync_with_stdio(false); cin.tie(NULL)
using namespace std;
long long maxv = 1e9;

int main(){
	long long A,B;
	long long A1,B1;
	cin>>A>>B;
	A--;
	if(A%4==0) A1=A;
	else if(A%4==1) A1=1;
	else if(A%4==2) A1=A+1;
	else if(A%4==3) A1=0;
	if(B%4==0) B1=B;
	else if(B%4==1) B1=1;
	else if(B%4==2) B1=B+1;
	else if(B%4==3) B1=0;
	long long ans=A1^B1;
	cout<<ans;
	return 0;
}


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

int t_i, t_ip1, x_i, y_i, x_ip1, y_ip1, N, ans;

int main()
{
    scanf("%d", &N);
    while (N--)
    {
        scanf("%d %d %d", &t_ip1, &x_ip1, &y_ip1);
        int z = abs(x_ip1 - x_i) + abs(y_ip1 - y_i);
        int zz = t_ip1 - t_i;
        if (z > zz || z % 2 != zz % 2) ans = 1;
        t_i = t_ip1;
        x_i = x_ip1;
        y_i = y_ip1;
    }
    if (ans) puts("No");
    else puts("Yes");
    return 0;
}

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


auto solve(long long N){
    stringstream ss;
    ss << "000" << N;
    auto s = ss.str();
    string res(end(s) - 3, end(s));
    stringstream ss2;
    ss2 << "ABC" << res;
    return ss2.str();
}

int main(){
    long long N;
    scanf("%lld",&N);
    auto result = solve(N);
    cout << result << endl;
    return 0;
}


Measured memory_bytes: 256
using System;
using System.Collections.Generic;
using System.Linq;
using System.IO;
using System.Text;
//var input = Console.ReadLine().Split().Select(int.Parse).ToArray();
namespace AtCoderSolve
{
    class Solve
    {
        const int mod = 1000000007;
        static void Main(string[] args)
        {
            var sw = new StreamWriter(Console.OpenStandardOutput()) { AutoFlush = false };
            Console.SetOut(sw);

            var xy = Console.ReadLine().Split().Select(int.Parse).ToArray();
            int dx = xy[2] - xy[0];
            int dy = xy[3] - xy[1];
            int x3 = xy[2] - dy;
            int y3 = xy[3] + dx;
            int x4 = x3 - dx;
            int y4 = y3 - dy;

            Console.WriteLine($"{x3} {y3} {x4} {y4}");

            Console.Out.Flush();
        }
    }



    public class Calculation
    {

    }

    public class Graph
    {

    }
}
    

Measured memory_bytes: 13396
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(ll i = 0, i##_len = (n); i < i##_len; ++i)
#define rep2(i, x, n) for(ll 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};

const int mod = 1000000007;
struct mint {
  ll x;  // typedef long long ll;
  mint(ll x = 0) : x((x % mod + mod) % mod) {}
  mint operator-() const { return mint(-x); }
  mint& operator+=(const mint a) {
    if((x += a.x) >= mod) x -= mod;
    return *this;
  }
  mint& operator-=(const mint a) {
    if((x += mod - a.x) >= mod) x -= mod;
    return *this;
  }
  mint& operator*=(const mint a) {
    (x *= a.x) %= mod;
    return *this;
  }
  mint operator+(const mint a) const { return mint(*this) += a; }
  mint operator-(const mint a) const { return mint(*this) -= a; }
  mint operator*(const mint a) const { return mint(*this) *= a; }
  mint pow(ll t) const {
    if(!t) return 1;
    mint a = pow(t >> 1);
    a *= a;
    if(t & 1) a *= *this;
    return a;
  }
  // for prime mod
  mint inv() const { return pow(mod - 2); }
  mint& operator/=(const mint a) { return *this *= a.inv(); }
  mint operator/(const mint a) const { return mint(*this) /= a; }
};
istream& operator>>(istream& is, const mint& a) { return is >> a.x; }
ostream& operator<<(ostream& os, const mint& a) { return os << a.x; }
mint fact(int n) {
  if(n == 1 || n == 0) return 1;
  mint res = n;
  return res * fact(n - 1);
}

int main() {
  ll n;
  string s;
  cin >> n >> s;
  if(s[0] != 'B' || s[2 * n - 1] != 'B') {
    cout << 0 << endl;
    return 0;
  }
  mint ans = 1;
  ll cnt = 0;
  rep(i, 2 * n) {
    if(s[i] == 'B' && cnt % 2 || s[i] == 'W' && cnt % 2 == 0) {
      ans *= cnt;
      cnt--;
    } else
      cnt++;
  }
  if(cnt != 0) ans = 0;
  ans *= fact(n);
  cout << ans << endl;
}

Measured memory_bytes: 5312
#include <bits/stdc++.h>
using namespace std;
int main(){
long long n,m,x,c[20],a[20][20],ans=10000000;
  cin>>n>>m>>x;
  for(int i=0;i<n;i++){
    cin>>c[i];
	for(int j=0;j<m;j++){
		cin>>a[i][j];
	}
  }
  for(int bit=1;bit<(1<<n);bit++){
	  int e=0;
    	int d[20]={};
    for(int i=0;i<n;i++){
      if(bit & (1<<i)){
        e+=c[i];
		for(int j=0;j<m;j++){
			d[j]+=a[i][j];
		}
      }
    }
	  int f=0;
	  for(int i=0;i<m;i++){
		  if(d[i]<x){
			  f=1;
		  }
	  }
	  if(f==0){
		  if(ans>e){
			  ans=e;
		  }
    }
  }
    if(ans==10000000)
		cout<<"-1"<<endl;
	else{
		cout<<ans<<endl;
	}
  
  return(0);
}

Measured memory_bytes: 3544
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.List;
import java.util.Scanner;
import java.util.Comparator;
import java.util.ArrayList;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        MaxMinSums solver = new MaxMinSums();
        solver.solve(1, in, out);
        out.close();
    }

    static class MaxMinSums {
        public static int MOD = 1000000007;
        static long[] fac;
        static long[] finv;
        static long[] inv;

        static void comInit(int max) {
            fac = new long[max + 1];
            finv = new long[max + 1];
            inv = new long[max + 1];

            // 階乗
            fac[0] = fac[1] = 1;
            // 逆元の階乗
            finv[0] = finv[1] = 1;
            // 逆元
            inv[1] = 1;

            for (int i = 2; i <= max; i++) {
                fac[i] = fac[i - 1] * i % MOD;
                inv[i] = MOD - inv[MOD % i] * (MOD / i) % MOD;
                finv[i] = finv[i - 1] * inv[i] % MOD;
            }
        }

        static long com(int n, int k) {
            if (n < k) {
                return 0;
            }
            return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
        }

        public void solve(int testNumber, Scanner in, PrintWriter out) {
            int n = in.nextInt();
            int k = in.nextInt();
            List<Long> list = new ArrayList<>();

            comInit(1000000);

            for (int i = 0; i < n; i++) {
                list.add(in.nextLong());
            }

            list.sort(Comparator.naturalOrder());

            long ans = 0;
            for (int i = 0; i < list.size(); i++) {
                ans -= com(n - i - 1, k - 1) * list.get(i);
                ans += com(i, k - 1) * list.get(i);
                ans %= MOD;
            }
            out.println(ans);
        }

    }
}



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

using namespace std;

vector<pair<int,bool>> G[20];
//checando a solução
bool issol(bitset<15> a){
    for(int i=0;i<16;i++){
        if(a[i]==1){
            for(int j=0;j<G[i].size();j++){
               if(G[i][j].second != a[G[i][j].first]) return false; 
            }
        }
    }
    
    return true;
}

int main(){

    bitset<15>a=0;
    int n;

    cin >> n;
//lendo os dados
    for(int i=0;i<n;i++){
        int k,v1,opin;
        cin >> k;
        for(int j=0;j<k;j++){
           cin >> v1 >> opin;
           G[i].push_back(make_pair(v1-1,opin));
        }
    }
//backtracking
    int ans=0;
    for(int i=0;i<pow(2,(n));i++){
        a=i;
        int aux=0;
        if(issol(a)){
           // cout << a << endl;
            for(int j=0;j<16;j++){
                if(a[j]==true) aux++;
            }

            ans=max(aux,ans);
        }

    }
    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 256
import datetime
import calendar

m1, d1 = map(int,input().split())
m2, d2 = map(int,input().split())

def get_last_date(year, month):
  return datetime.date(year, month, calendar.monthrange(year, month)[1])

now = datetime.date(2019, m1, d1)
dat = get_last_date(2019, m1)

if now == dat:
  print(1)
else:
  print(0)


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

using namespace std;
using ll = long long;
#define rep(i,n) for(ll i=0; i<n; ++i)
#define rep1(i,n) for(ll i=1; i<=n; ++i)
#define revrep(i,n) for(ll i=n-1; i>=0; --i)
inline constexpr ll Inf = (1ULL << 62) -1;
#define fastio cin.tie(nullptr); ios_base::sync_with_stdio(false);
#define endl '\n'
template <class T> bool updmax(T& a, T b) { if (b > a) { a = b; return true;} return false;}
template <class T> bool updmin(T& a, T b) { if (b < a) { a = b; return true;} return false;}

int main() {
    fastio;
    ll N;
    cin >> N;
    string ans;
    rep(i,N)
        ans += "ACL";
    cout << ans << endl;
}


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



// Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
int main(){
    int N;
    cin >> N;
    int A[N];
    for (int i = 0; i < N; i++) {
        cin >> A[i];
    }
    map<long long, long long> Z;    // 各数字が i=0 のところにいたらどんな A[i] とみなせるか
    long long ans = 0;
    for (int i = 0; i < N; i++) {
        ans += Z[i - A[i]];
        Z[A[i] + i]++;
    }

    cout << ans << endl;
    // Failed to predict input format
    return 0;
}


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

using namespace std;

int main(int argc, char const *argv[]) {
	int n,k,sum,temp;
	std::vector<int> v;
	sum = 0;
	std::cin >> n >> k;
	for (size_t i = 0; i < n; i++) {
		std::cin >> temp;
		v.push_back(temp);
	}
	sort(v.begin(), v.end());
	reverse(v.begin(), v.end());
	for (size_t i = 0; i < k; i++) {
		sum += v[i];
	}
	std::cout << sum << '\n';
	return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define syosu(x) fixed<<setprecision(x)
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> P;
typedef pair<double,double> pdd;
typedef pair<ll,ll> pll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<double> vd;
typedef vector<vd> vvd;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef vector<string> vs;
typedef vector<P> vp;
typedef vector<vp> vvp;
typedef vector<pll> vpll;
typedef pair<int,P> pip;
typedef vector<pip> vip;
const int inf=1<<30;
const ll INF=1ll<<60;
const double pi=acos(-1);
const double eps=1e-9;
const ll mod=1e9+7;
const int dx[4]={0,1,0,-1},dy[4]={1,0,-1,0};

int n;

int main(){
	cin>>n;
	bool B=0;
	for(int i=0;i<=n;i+=4) if((n-i)%7==0) B=1;
	cout<<(B?"Yes":"No")<<endl;
}

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

int main(){
    int A[100005];
    int m;
    long long int n;
    int ans=0;
    cin >> n >> m;
    for (int i =0;i<m;i++){
        cin >> A[i];
        n -=A[i];
    }
    if(n<0){
        cout << -1 << endl;
    }else
    {
        cout << n << endl;
    }
    

    return 0;
}

Measured memory_bytes: 3676
program name
    implicit none
    integer(4):: n,a,b,c
    integer(4),allocatable:: l(:),to(:)
    integer(4):: i,j,ni,mdl
    integer(4):: gcost, al(0:2), ans
    logical:: all(0:2)


    read*, n,a,b,c
    allocate(l(n),to(n))
    do i=1,n
        read*, l(i)
    end do
    ans = 1000000000
    do i=0,4**n-1
        ni = i
        all(:) = .false.
        do j=1,n
            to(j) = mod(ni,4)
            if (to(j) < 3) all(to(j)) = .true.
            ni=ni/4
        end do
        if (.not. (all(0) .and. all(1) .and. all(2))) cycle
        gcost = 0
        al(:) = 0
        do j=1,n
            if (to(j) == 3) cycle
            if (al(to(j)) == 0) then
                al(to(j)) = l(j)
            else
                al(to(j)) = al(to(j))+l(j)
                gcost=gcost+10
            end if
        end do


        gcost=gcost+abs(al(0)-a)
        gcost=gcost+abs(al(1)-b)
        gcost=gcost+abs(al(2)-c)
        ans = min(ans,gcost)
    end do

    print*, ans

contains
subroutine swap(x,y)
    integer(4):: x,y,t
    t=x
    x=y
    y=t
end subroutine
end program name

Measured memory_bytes: 512
dic = {}
lis = []

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

A = list(map(int,input().split()))

for i in A:

    if i not in dic:
        dic[i] = 1
        lis.append(i)
    else:
        dic[i] += 1

for i in range(M):

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

    if C not in dic:
        dic[C] = B
        lis.append(C)
    else:
        dic[C] += B

lis.sort()
lis.reverse()

left = N
ans = 0

for i in lis:

    ans += i * min( dic[i] , left )
    left -= dic[i]

    if left <= 0:
        break

print (ans)


Measured memory_bytes: 92056
#include <iostream>
#include <iomanip>
#include <vector>
#include <algorithm>
#include <numeric>
#include <functional>
#include <cmath>
#include <queue>
#include <stack>
#include <string>

#define repd(i,a,b) for (int i=(a);i<(b);i++)
#define rep(i,n) repd(i,0,n)
typedef long long ll;

using namespace std;


int inputValue(){
    int a;
    cin >> a;
    return a;
};

void inputArray(int * p, int a){
    rep(i, a){
        cin >> p[i];
    }
};

void inputVector(vector<int> * p, int a){
    rep(i, a){
        int input;
        cin >> input;
        p -> push_back(input);
    }
}

template <typename T>
void output(T a, int precision) {
    if(precision > 0){
        cout << setprecision(precision)  << a << "\n";
    }
    else{
        cout << a << "\n";
    }
}

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

    int a,b;
    cin >> a >> b;
    if(b%a == 0 ){
        cout << a + b;
    }else{
        cout << b -a ;
    }
}


Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <stdlib.h>
#include <cstdlib>
using namespace std;


int main(){
	int D, T, S;
	bool judge;
	cin >> D >> T >> S;
	
	judge = (D <= T * S);
	
	cout << (judge ? "Yes" : "No") << endl;
	return 0;
}


Measured memory_bytes: 3628
#include <bits/stdc++.h>
using namespace std;
using i64 = long long;
#define rep(i,s,e) for(i64 (i) = (s);(i) < (e);(i)++)
#define all(x) x.begin(),x.end()
#define let auto const

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

  vector<vector<i64>> edge(N, vector<i64>(N));
  for(int l = 0;(1 << l) <= N; l++) {
    vector<i64> color(N);
    rep(j,0,N) {
      if(j & (1 << l)) {
        color[j] = 1;
      }
    }
    rep(i,0,N) {
      rep(j,0,N) {
        if((color[j] ^ color[i]) && edge[min(j, i)][max(j, i)] == 0) {
          edge[min(j, i)][max(j, i)] = l + 1;
        }
      }
    }
  }

  rep(i,0,N) {
    rep(j, i + 1, N) {
      cout << edge[i][j] << " \n"[j + 1 == N];
    }
  }
}



Measured memory_bytes: 2432
package main

import "fmt"

func main() {
	var n int
	fmt.Scan(&n)

	var x, y int
	fmt.Scan(&x, &y)

	var t, a int
	for i := 1; i < n; i++ {
		fmt.Scan(&t, &a)

		lb, ub := 0, 1e18/max(t, a)
		for ub-lb > 1 {
			mid := (lb + ub) / 2
			tx, ty := t*mid, a*mid
			if tx < x || ty < y {
				lb = mid
			} else {
				ub = mid
			}
		}
		x, y = t*ub, a*ub
	}

	fmt.Println(x + y)
}

func max(a, b int) int {
	if a > b {
		return a
	}
	return b
}


Measured memory_bytes: 1796
#include<iostream>
#include<algorithm>
using namespace std;
typedef long long ll;
int main()
{
  ll n,i,u,v,res;
  cin >> n;
  res=n*(n+1)*(n+2)/6;
  for(i=0;i<n-1;i++){
    cin >> u >> v;
    if(u<v)
      res-=u*(n-v+1);
    else
      res-=v*(n-u+1);
  }
  cout << res << endl;
  return 0;
}

Measured memory_bytes: 3596
#[allow(unused_imports)]
use std::cmp::{max, min};
#[allow(unused_imports)]
use std::collections::{HashMap, HashSet};
#[allow(unused_imports)]
use std::io::*;
#[allow(unused_imports)]
use std::str::*;

macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        let mut next = || { iter.next().unwrap() };
        input_inner!{next, $($r)*}
    };
    ($($r:tt)*) => {
        let stdin = std::io::stdin();
        let mut bytes = std::io::Read::bytes(std::io::BufReader::new(stdin.lock()));
        let mut next = move || -> String{
            bytes
                .by_ref()
                .map(|r|r.unwrap() as char)
                .skip_while(|c|c.is_whitespace())
                .take_while(|c|!c.is_whitespace())
                .collect()
        };
        input_inner!{next, $($r)*}
    };
}

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

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

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

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

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

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

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

#[allow(dead_code)]
fn read<T: FromStr>() -> T {
    let cin = stdin();
    let cin = cin.lock();
    let s: String = cin
        .bytes() // Bytes
        .map(|c| c.expect("failed reading char") as char)
        .skip_while(|c| c.is_whitespace()) // c が whitespace である限り skip
        .take_while(|c| !c.is_whitespace()) // c が whitespace でない限り要素を返す
        .collect();
    s.parse().ok().expect("failed parsing")
}

fn main() {
    input! {a:isize,b:isize}
    println! {"{}",max(max(a+b,a-b),a*b)}
}


Measured memory_bytes: 4352
#include <bits/stdc++.h>
#define rep(i,x,n) for(int i = x; i < (int)(n); i++)
#define rep_ll(i,x,n) for(ll i = x; i < (ll)(n); i++)
using namespace std;
typedef long long ll;
typedef unsigned long long u_ll;
typedef pair<int, int> pair_;
const long double PI = (acos(-1));
const int INF = 1001001001;
const int dx[] = {-1, 0, 1, 0}; const int dy[] = {0, -1, 0, 1};
ll mod = 1000000007;
int main(){
    int n;
    cin >> n;
    priority_queue<int> q;
    vector<int> a(n);
    rep(i, 0, n) cin >> a[i];
    sort(a.begin(), a.end());
    int aamax=1000002;
    vector<int> aa(aamax, 0);
    rep(i, 0, n){
        if(aa[a[i]]!=0){
            aa[a[i]]=2;
            continue;
        }
        for(int j=a[i]; j< aamax;j+=a[i]) aa[j]++;
    }
    int cnt=0;
    rep(i, 0, n) if(aa[a[i]]==1) cnt++; 

    cout << cnt;

    return 0;
}

Measured memory_bytes: 8004
#include<iostream>
#include<fstream>
#include<sstream>
#include<algorithm>
#include<cstdio>
#include<cctype>
#include<cassert>
#include<cmath>
#include<ctime>
#include<cstdlib>
#include<cstring>
#include<string>
#include<queue>
#include<vector>
#include<map>
#include<set>
#include<bitset>
#include<stack>
#include<iomanip>
#include<utility>
using namespace std;
#define mp make_pair
#define pb push_back
#define X first
#define Y second
#define rg register
#define il inline
#define lch(x) ((x)<<1)
#define rch(x) ((x)<<1^1)
#define eprintf(...) fprintf(stderr,__VA_ARGS__)
#define rep0(i,n) for(register int i=0;i<(n);++i)
#define rep(i,st,ed) for(register int i=(st);i<=(ed);++i)
#define per(i,ed,st) for(register int i=(ed);i>=(st);--i)
typedef long long ll;
typedef unsigned long long ull;
typedef unsigned int uint;
typedef double dbl;
typedef long double ldb;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
template<typename T> il T qmin(const T &a,const T &b){return a<b?a:b;}
template<typename T> il T qmax(const T &a,const T &b){return a>b?a:b;}
template<typename T> il void getmin(T &a,const T &b){if(a>b) a=b;}
template<typename T> il void getmax(T &a,const T &b){if(a<b) a=b;}
il void fileio(string s){
	freopen((s+".in").c_str(),"r",stdin);
	freopen((s+".out").c_str(),"w",stdout);
}

const int mod=(int)1e9+7;
const ll linf=(ll)1e17+7;
const int N=4e5+7,logN=21;

int v[N],x[N],a[N],p[N];
int len[N],mn[N][logN],mx[N][logN];
pii pos[N];
int f[N],sum[N],n;

il bool cmp(const int &i,const int &j){
	return v[i]<v[j];
}

il int qmn(const int &ul,const int &ur){
	int l=len[ur-ul+1];
	return qmin(mn[ul][l],mn[ur-(1<<l)+1][l]);
}

il int qmx(const int &ul,const int &ur){
	int l=len[ur-ul+1];
	return qmax(mx[ul][l],mx[ur-(1<<l)+1][l]);
}

int main(){
	len[1]=0;
	rep(i,2,N-1) len[i]=len[i>>1]+1;
	scanf("%d",&n);
	rep(i,1,n) scanf("%d%d",x+i,v+i),p[i]=i;
	sort(p+1,p+n+1,cmp);
	rep(i,1,n) mn[i][0]=mx[i][0]=a[i]=x[p[i]];
	for(int i=1;(1<<i)<=n;++i){
		for(int j=1;j+(1<<i)-1<=n;++j){
			mn[j][i]=qmin(mn[j][i-1],mn[j+(1<<i-1)][i-1]);
			mx[j][i]=qmax(mx[j][i-1],mx[j+(1<<i-1)][i-1]);
		}
	}
	rep(i,1,n){
		int ul=0,ur=i;
		while(ur-ul>1){
			int mid=ul+ur>>1;
			if(qmx(1,mid)>=a[i]) ur=mid;else ul=mid;
		}
		pos[i].X=ur;
		ul=i,ur=n+1;
		while(ur-ul>1){
			int mid=ul+ur>>1;
			if(qmn(mid,n)<=a[i]) ul=mid;else ur=mid;
		}
		pos[i].Y=ul;
	}
	sort(pos+1,pos+n+1);
//	rep(i,1,n) cerr<<"  "<<pos[i].X<<","<<pos[i].Y<<endl;
	if(pos[1].X!=1) return puts("0"),0;
	f[0]=sum[0]=1;
	for(int i=1,j=0;i<=n;++i){
		while(pos[j].Y<pos[i].X-1) ++j;
		f[i]=sum[i-1]-(!j?0:sum[j-1]);
		if(f[i]<0) f[i]+=mod;
		sum[i]=(sum[i-1]+f[i])%mod;
	}
	int ans=0;
	for(int i=n;i&&pos[i].Y==n;--i) ans=(ans+f[i])%mod;
	printf("%d\n",ans);
	return 0;
}

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

bool canCalc(int val1, int val2) {
  return (val1 < 10) && (val2 < 10) ? true : false;
}

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

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

vector<ll> g(ll A){
    vector<ll> ret(50,0);
    for(ll i=0; i<50; i++){
        ll b = (ll)1 << i;
        ret[i] = (A+1)/(2*b)*b + max((ll)0, (A+1)%(2*b)-b);
        cerr << A << " " << i << " " << ret[i] << endl;
    }

    return ret;
}

int main(){
    ll A, B;  cin >> A >> B;
    vector<ll> Acnt, Bcnt;
    Acnt = g(A-1);
    Bcnt = g(B);

    ll ans = 0;
    ll b = 1;
    for(int i=0; i<50; i++){
        if((Bcnt[i] - Acnt[i])%2==1){
            ans += b;
        }
        b*=2;
    }
    cout << ans << endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
 
typedef long long ll;
typedef unsigned long long ull;

#define what_is(x) cerr << #x << " is " << x << endl;

const int N = 1e5+1;

ll lcm (ll a, ll b) {
	return a/__gcd(a,b)*b;
}

ll n, ans;

int main () {
	ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
	// cout.precision(1); cout << fixed;
	cin >> n; ans = 1;
	for (int i = 0; i < n; i++) {
		ll temp; cin >> temp;
		ans = lcm(ans, temp);
	}
	cout << ans << endl;
	return 0;
}

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

ll cnt[20][20];
int mx = 18;

void addd(ll num) {
    int cnt2 = 0, cnt5 = 0;
    while (num % 2 == 0) {
        cnt2++;
        num /= 2;
        if (cnt2 == mx) break;
    }
    while (num % 5 == 0) {
        cnt5++;
        num /= 5;
        if (cnt5 == mx) break;
    }
    cnt[cnt2][cnt5]++;
}

int main() {
    int n;
    cin >> n;
    for (int i = 0; i < n; i++) {
        string s;
        cin >> s;
        ll num = 0;
        for (int j = 0; j < s.size(); j++) {
            if (s[j] == '.') {
                for (int k = 0; k < 9; k++) {
                    num = num * 10;
                    if (j+1 + k < s.size()) {
                        num += s[j+k+1] - '0';
                    }
                }
                addd(num);
                break;
            }
            num = num * 10 + (s[j] - '0');
            if (j == s.size() - 1) addd(num * 1000000000LL);
        }
    }
    ll ans = 0;
    for (int i = 0; i <= mx; i++) {
        for (int j = 0; j <= mx; j++) {
            for (int p = mx - i; p <= mx; p++) {
                for (int q = mx - j; q <= mx; q++) {
                    if (i == p && j == q) {
                        ans += cnt[i][j] * (cnt[i][j] - 1);
                    } else {
                        ans += cnt[i][j] * cnt[p][q];
                    }
                }
            }
        }
    }

    cout << ans / 2 << endl;
    return 0;
}

Measured memory_bytes: 3624
import numpy as np
from functools import reduce
N , X = map(int, input().split())
xn = np.array(list(map(int,input().split() )))
#print(xn)
xn = xn - X
#xn = xn - np.min(xn)
#print(xn)

def gcd(a, b):
    while b:
        a, b = b, a % b
    return a
  
print(abs(reduce(gcd, list(xn))))

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

namespace AtCoder
{
    class Program
    {
        static void Main(string[] args)
        {
            //[summary]A - 500 Yen Coins
            var line = ReadLine();
            int K = line[0];
            int X = line[1];

            if (500 * K >= X)
            {
                Console.WriteLine("Yes");
            }
            else
            {
                Console.WriteLine("No");
            }
        }

        static List<int> ReadLine()
        {
            var line = Console.ReadLine();
            var arr = line.Split(' ');

            return arr.Select(x => int.Parse(x)).ToList();
        }
    }
}

Measured memory_bytes: 11348
#include<stdio.h>

int main(){
  int A, B, K;
  scanf("%d %d %d", &A, &B, &K);

  int G;

  while(A != 0 && B != 0){
    if(A == 1 || B == 1) break;

    if(A >= B) A = A % B;
    else B = B % A;
  }

  if(A == 0) G = B;
  else if(B == 0) G = A;
  else G = 1;

  int i = 0;
  int j = 1;
  int L[K];
  while(i < K){
    if(G % j == 0){
      L[i] = G / j;
      i++;
    }
    j++;
  }

  printf("%d\n", L[K-1]);


  return 0;
}


Measured memory_bytes: 128
import java.util.Scanner;

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

    int n = sc.nextInt();

    boolean flag = true;
    for (int i = 0; i < n; i++) {
      int a = sc.nextInt();
      if (a % 2 == 0) {
        if (a % 3 == 0 || a % 5 == 0) {
          flag = true;
        } else {
          System.out.println("DENIED");
          return;
        }
      }
    }
    System.out.println("APPROVED");
  }
}


Measured memory_bytes: 23636
#include <cstdio>
#include <algorithm>
#define repu(i,x,y) for (int i=x; i<=y; ++i)
using namespace std;

int n,cnt[110],maxd;

int main()
{
    scanf("%d",&n);
    repu(i,1,n)
    {
        int x;
        scanf("%d",&x),++cnt[x],maxd=max(maxd,x);
    }
    repu(i,(maxd+1)/2+1,maxd)
        if (cnt[i]<2)
        {
            puts("Impossible");
            return 0;
        }
    if (n>2 && maxd<2 || ((maxd&1) && cnt[(maxd+1)/2]!=2 || !(maxd&1) && cnt[maxd/2]!=1))
    {
        puts("Impossible");
        return 0;
    }
    puts("Possible");
    return 0;
}

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

int main(){

	int a,b;
	cin >> a>>b;

	int count = 0;
	for(int i = a;i <=b;i++){
		int number = i;
		int reverse = 0;
		while (number > 0) {
		    reverse = reverse * 10 + number % 10;
		    number /= 10;
		}
		if(i == reverse){
			count ++;
		}

	}	

	cout << count <<endl;


}



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

using namespace std;

int main(){
    string N;
    cin>>N;
    int n=N.length();
    int cnt=0;
    for (int i=0; i<n; i++){
        cnt=(N[i]-'0'+cnt)%9;
    }
    if (cnt==0) cout<<"Yes";
    else cout<<"No";
}



Measured memory_bytes: 3756
l = int(input())
x = list(map(int,input().split()))

dp = [0]
dp.append(abs(x[0]-x[1]))
if l == 2:
    print(dp[1])
    exit()
else:
    for i in range(2,l):
        dp.append(min(abs(x[i-1]-x[i])+dp[i-1],abs(x[i-2]-x[i])+dp[i-2]))
            
print(dp[-1])

Measured memory_bytes: 13908
class Dice:
    def __init__(self, v1, v2, v3, v4, v5, v6):
        self.faces = [(v1, v6), (v2, v5), (v3, v4)]

    def rotate_left(self):
        (top, btm), (fnt, bck), (rgt, lft) = self.faces
        return self.__class__(top, rgt, bck, fnt, lft, btm)

    def rotate_right(self):
        (top, btm), (fnt, bck), (rgt, lft) = self.faces
        return self.__class__(top, lft, fnt, bck, rgt, btm)

    def turn_back(self):
        (top, btm), (fnt, bck), (rgt, lft) = self.faces
        return self.__class__(fnt, btm, rgt, lft, top, bck)

    def turn_front(self):
        (top, btm), (fnt, bck), (rgt, lft) = self.faces
        return self.__class__(bck, top, rgt, lft, btm, fnt)

    def turn_right(self):
        (top, btm), (fnt, bck), (rgt, lft) = self.faces
        return self.__class__(lft, fnt, top, btm, bck, rgt)

    def turn_left(self):
        (top, btm), (fnt, bck), (rgt, lft) = self.faces
        return self.__class__(rgt, fnt, btm, top, bck, lft)

    def __hash__(self):
        (top, btm), (fnt, bck), (rgt, lft) = self.faces
        return hash(frozenset((frozenset((top, btm)),
                               frozenset((fnt, bck)),
                               frozenset((rgt, lft)))))

    def __str__(self):
        return "<{}>".format(",".join([str(t) for t in self.faces]))

    def __eq__(self, other):
        def equals(d1, d2):
            return d1.faces == d2.faces

        (top, btm) = self.faces[0]
        if (top, btm) in other.faces:
            return (equals(self, other)
                    or equals(self.rotate_right(), other)
                    or equals(self.rotate_left(), other)
                    or equals(self.turn_right(), other)
                    or equals(self.turn_front(), other)
                    or equals(self.rotate_left().rotate_left(), other)
                    or equals(self.turn_back().rotate_left(), other)
                    or equals(self.turn_front().rotate_right(), other)
                    or equals(self.turn_right().rotate_left(), other)
                    or equals(self.turn_left().rotate_right(), other)
                    or equals(self.turn_right().turn_back().turn_back(),
                              other)
                    or equals(self.turn_front().turn_right().turn_right(),
                              other))
        elif (btm, top) in other.faces:
            return self.turn_front().turn_front() == other
        else:
            return False


def run():
    count = int(input())
    dices = set()

    for _ in range(count):
        dice = Dice(*[int(i) for i in input().split()])
        if dice in dices:
            print("No")
            break
        dices.add(dice)
    else:
        print("Yes")


if __name__ == '__main__':
    run()



Measured memory_bytes: 5668
//JSD
#include<iostream>
#include<vector>
#define ll long long 
using namespace std;
ll n,W;
vector<pair<ll ,ll > > vp;
ll dp[105][100005];
ll solve(ll i,ll w){
	if(dp[i][w]!=-1){
		return dp[i][w];
	}
	if(i==(n-1)){

		if(w>=vp[i].first){
			return vp[i].second;
		}
		return 0;
	}
	else{
		ll p=0;
		if(w-vp[i].first>=0){
			p=solve(i+1,w-vp[i].first)+vp[i].second;
		}

		ll q=solve(i+1,w);
		ll z=max(p,q);
		dp[i][w]=z;
	}
	return dp[i][w];
}
int main(){
	cin>>n>>W;
	for(int i=0;i<=n;i++){
		for(int j=0;j<=W;j++){
			dp[i][j]=-1;
		}
	}
	for(int i=0;i<n;i++){
		ll a,b;
		cin>>a>>b;
		vp.push_back({a,b});
	}
	cout<<solve(0,W)<<"\n";
	
	return 0;
}

Measured memory_bytes: 80128
#include<bits/stdc++.h>
#define mod 1000000007
using namespace std;
typedef long long int ll;
typedef pair<int,int> pi;
int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);

    int n;
  	cin>>n;
  	if (n==1) cout<<"Hello World";
  	else {
    	int a,b;
      cin>>a>>b;
      cout<<(a+b);
    }
}


Measured memory_bytes: 256
// ===================================
//   author: M_sea
//   website: http://m-sea-blog.com/
// ===================================
#include <algorithm>
#include <iostream>
#include <cstdlib>
#include <cstring>
#include <cstdio>
#include <vector>
#include <cmath>
#define re register
using namespace std;

inline int read() {
    int X=0,w=1; char c=getchar();
    while (c<'0'||c>'9') { if (c=='-') w=-1; c=getchar(); }
    while (c>='0'&&c<='9') X=X*10+c-'0',c=getchar();
    return X*w;
}

const int N=2000+10;

int n,k;
vector<int> E[N];

int tot;
inline void dfs(int u,int fa,int dep) {
    if (dep>k/2) ++tot;
    for (re int v:E[u])
        if (v!=fa) dfs(v,u,dep+1);
}

int main() {
    n=read(),k=read();
    for (re int i=1;i<n;++i) {
        int u=read(),v=read();
        E[u].push_back(v),E[v].push_back(u);
    }
    int ans=2e9;
    if (k&1) {
        for (re int u=1;u<=n;++u)
            for (re int v:E[u])
                tot=0,dfs(u,v,0),dfs(v,u,0),ans=min(ans,tot);
    } else {
        for (re int u=1;u<=n;++u)
            tot=0,dfs(u,0,0),ans=min(ans,tot);
    }
    printf("%d\n",ans);
    return 0;
}


Measured memory_bytes: 384
N, K = gets.chomp.split(' ').map(&:to_i)
result = 0
(N+1).times do |b|
  if b > K
    result += (b - K) * (N / b)
    if K == 0
      result += N % b - K if N % b > K
    else
      result += N % b + 1 - K if N % b > K - 1
    end
  end
end
puts result

Measured memory_bytes: 1788
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;

public class Main {

	public static void main(String[] args) throws IOException {
		//配列の作成
		int[][][] OHouse=new int [4][3][10];
		for(int z=0;z<4;z++) {
			for(int y=0;y<3;y++) {
				for(int x=0;x<10;x++) {
					OHouse[z][y][x]=0;
				}
			}
		}

		//配列の加工(入力処理)
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int n=Integer.parseInt(br.readLine());
		int count=1;

		while(n>=count) {
			StringTokenizer st=new StringTokenizer(br.readLine());
			int b=Integer.parseInt(st.nextToken());
			int f=Integer.parseInt(st.nextToken());
			int r=Integer.parseInt(st.nextToken());
			int v=Integer.parseInt(st.nextToken());
			OHouse[b-1][f-1][r-1]=OHouse[b-1][f-1][r-1]+v;
			if(OHouse[b-1][f-1][r-1]<0) {
				OHouse[b-1][f-1][r-1]=0;
			}
			count++;
		}

		//配列の出力
		for(int z=0;z<4;z++) {
			for(int y=0;y<3;y++) {
				for(int x=0;x<10;x++) {
					System.out.print(" "+OHouse[z][y][x]);
					if(x==9) {
						System.out.println("");
					}
				}
			}
			if(z<3) {
				for(int i=0;i<20;i++) {
					System.out.print("#");
					if(i==19) {
						System.out.println("");
					}
				}
			}
		}
	}

}



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

int main() {
  LL x; cin >> x;
  vector<LL> a(1000);
  for (LL i = 0; i < 1000; i ++) {
    a[i] = pow(i, 5);
  }

  for (LL i = 0; i < 1000; i ++) {
    for (LL j = 0; j < 1000; j ++) {
      if (a[i] + a[j] == x) {
        cout << i << " " << -1 * j << endl;
        return 0;
      }
      if (a[i] - a[j] == x) {
        cout << i << " " << j << endl;
        return 0;
      }
    }
  }
}


Measured memory_bytes: 4112
#include <bits/stdc++.h>
#include <algorithm>
using namespace std;
int main() {
int N; 
cin >> N; 
int A[300]; 
for (int i = 0; i < N; ++i){
cin >> A[i * 2] >> A[i * 2 + 1]; 
}
sort(A, A+N*2); 
int ans; 
for (int i = 0; i < N; ++i){
ans += A[i * 2]; 
}
cout << ans << endl; 
}

Measured memory_bytes: 256
n = int(input())
lst = list(map(int,input().split()))
l_unique = sorted(list(set(lst)))

flg = False
if len(l_unique)==1:
    x = l_unique[0]
    if x==0:
        flg = True
elif len(l_unique) == 2:
    x,y = l_unique[0], l_unique[1]
    if x==0 and n%3==0:
        num = n//3
        if lst.count(x)==num and lst.count(y)==2*num:
            flg = True
elif len(l_unique) == 3:
    x,y,z = l_unique[0], l_unique[1], l_unique[2]
    if n%3 == 0:
        num = n//3
        if lst.count(x)==num and lst.count(y)==num and lst.count(z)==num:
            if (x^y^z)==0:
                flg = True
print('Yes' if flg else 'No')

Measured memory_bytes: 14116
#include<cstdio>
#include<algorithm>
using namespace std;
const int maxn=105;
int a[maxn];
int main()
{
    int n;
    scanf("%d",&n);
    int cnt=0;
    for(int i=1;i<=n;i++)
    {
        scanf("%d",&a[i]);
        if(i%2&&a[i]%2)
            cnt++;
    }
    printf("%d\n",cnt);
    return 0;
}


Measured memory_bytes: 1732
#include<stdio.h>
//#include<math.h>

#define max(a,b) ((a>b?a:b))
#define min(a,b) ((a<b?a:b))
#define abs(a) ((a>0?a:-(a)))

int distance(int i,int j);

int N,X,Y;
int main(){
  //int dist[2000] = {0,};
  int ans[2003] = {0,};
  int i,j;

  scanf("%d%d%d",&N,&X,&Y);
  for(i=1;i<=N-1;i++){
    for(j=i+1;j<=N;j++){
      ans[distance(i,j)]++;
      //printf("%d,%d : %d\n",i,j,distance(i,j));
    }
  }
  for(i=1;i<N;i++){
    printf("%d\n",ans[i]);
  }
}
  
int distance(int i,int j){
  int l_ij,l_iXYj;

  l_ij = j - i;
  l_iXYj = abs(X-i) + 1 + abs(Y-j);

  return min(l_ij,l_iXYj);  
}

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

using namespace std;

#define int long long
const double PI = 3.14159265358979323846;
typedef vector<int> vint;
typedef pair<int, int> pint;
const int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1};
const int dy[8] = {0, 1, 0, -1, 1, 1, -1, -1};
// cout << fixed << setprecision(20);

int N, Q;
int a[220000], b[220000];
vint G[220000];
int val[220000];
int p[220000], x[220000];

void dfs(int idx, int par) {
    val[idx] += val[par];
    for (int i = 0; i < G[idx].size(); i++) {
        if (G[idx][i] == par)continue;
        dfs(G[idx][i], idx);
    }
}

signed main() {
    cin >> N >> Q;
    for (int i = 0; i < N - 1; i++) {
        cin >> a[i] >> b[i];
        G[a[i]].push_back(b[i]);
        G[b[i]].push_back(a[i]);
    }
    for (int i = 0; i < Q; i++) {
        cin >> p[i] >> x[i];
        val[p[i]] += x[i];
    }
    dfs(1, 0);
    for (int i = 1; i <= N; i++)cout << val[i] << " ";
    cout << endl;
}


Measured memory_bytes: 31488
#include <stdio.h>

int main()
{
    int s;
    scanf("%d",&s);
    for(int i=1;;i++)
    {
        if(s==1||s==2||s==4)
        {
            printf("%d\n",i+3);
            return 0;
        }
        if(s%2)s=3*s+1;
        else s=s/2;
    }
}

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

int main(){
  int N,A,B; cin >> N >> A >> B;
  int X; cin >> X;
  long long tired=0;
  for(int i=1; i<N; i++){
    int x; cin >> x;
    tired+=min<long long>((long long)(x-X)*A,B);
    X=x;
  }
  cout << tired << endl;
}

Measured memory_bytes: 384
def euclid(m, n):
    m0 = m = abs(m)
    n0 = n = abs(n)
    while n != 0:
        m, n = n, m % n
    qm = m0 // m
    lcm = qm * n0
    return lcm

# ABC070C
n = int(input())
t = [0] * n
for i in range(n):
    t[i] = int(input())
ans = 1
for i in t:
    ans = euclid(ans, i)
print(ans)


Measured memory_bytes: 3060
#include <bits/stdc++.h>
#define REP(i, n) for(int i = 0; i < n; i++)
#define REPR(i, n) for(int i = n; i >= 0; i--)
#define FOR(i, m, n) for(int i = m; i < n; i++)
#define INF 2e9
#define ALL(v) v.begin(), v.end()
using namespace std;
typedef long long ll;
int main()
{
  int X; cin >> X;
  int tmp;
  int ans = 0;
  tmp = X / 500; ans += tmp * 1000; X -= tmp * 500;
  tmp = X / 5; ans += tmp * 5; X-= tmp * 5;
  cout << ans << endl;
}

Measured memory_bytes: 3584
#include <iostream>
#include <functional>
#include <cstdio>
#include <algorithm>
#include <cmath>
#include <vector>
#include <string>
#include <set>
#include <queue>
#include <map>
#include <iomanip>
using namespace std;
#define rep(i,n) for(ll i=0;i<n;++i)
#define repi(i,n) for(ll i=n-1;i>=0;--i)
#define sll(n) scanf("%lld", &n);
#define slf(n) scanf("%lf", &n);
typedef long long ll;
typedef double lf;
static const ll max_n = 100010;
static const ll mod = 1000000007;
static const ll max_value = 100000000000100;

ll N, M;


void Main(){
    // bool is_ok = true;
    // printf("------------- V=%lld---------\n", V);
    ll K, A, B;
    sll(K);
    sll(A);
    sll(B);
    bool is_ok = false;
    for(ll i=A;i<=B;i++){
        if(i % K ==0){
            is_ok = true;
            break;
        }
    }

    if (is_ok){
        printf("OK\n");
    }else{
        printf("NG\n");
    }


    // cout<<fixed<<setprecision(10)<<num<<endl;
    // cout << num << endl;

}

int main(){
    Main();

    return 0;

}

Measured memory_bytes: 3164
N, MOD = int(input()), 10 ** 9 + 7
memo = [{} for i in range(N+1)]
def ok(last4):
    for i in range(4):
        t = list(last4)
        if i >= 1:
            t[i-1], t[i] = t[i], t[i-1]
        if ''.join(t).count('AGC') >= 1:
            return False
    return True
def dfs(cur, last3):
    if last3 in memo[cur]:
        return memo[cur][last3]
    if cur == N:
        return 1
    ret = 0
    for c in 'ACGT':
        if ok(last3 + c):
            ret = (ret + dfs(cur + 1, last3[1:] + c)) % MOD
    memo[cur][last3] = ret
    return ret
print(dfs(0, 'TTT'))

Measured memory_bytes: 48220