akhauriyash/Code-Regression huggingface dataset:
import std.stdio;
import std.string;
import std.array;
import std.conv;
import std.algorithm;

void main(){
    int[] change;
    while(true){
        int input = readln().chomp().to!int();
        if(input != 0){ change ~= 1000 - input; }else{ break; }
    }
    foreach(int i; change){
        int count = 0;
        while(i - 500 >= 0){
            i -= 500; count++;
        }
        while(i - 100 >= 0){
            i -= 100; count++;
        }
        while(i - 50 >= 0){
            i -= 50; count++;
        }
        while(i - 10 >= 0){
            i -= 10; count++;
        }
        while(i - 5 >= 0){
            i -= 5; count++;
        }
        while(i - 1 >= 0){
            i -= 1; count++;
        }
        writeln(count);
    }
}

Measured memory_bytes: 964
#!/usr/bin/env python3
import sys


def solve(N: int, K: int):
    if K > (N * (N-1) / 2) - (N - 1):
        print(-1)
    else:
        elapsed = ((N - 1) * (N - 2) // 2) - K
        print(elapsed + (N - 1))

        for i in range(2, N+1):
            print('%d %d' % (1, i))

        left_header = 2
        right_header = 3
        for i in range(elapsed):
            print('%d %d' % (left_header, right_header))
            right_header += 1
            if right_header == N+1:
                left_header += 1
                right_header = left_header + 1

    return


# Generated by 1.1.4 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    K = int(next(tokens))  # type: int
    solve(N, K)


if __name__ == '__main__':
    main()


Measured memory_bytes: 3332
#include <cstdio>
#include <vector>
#include <utility>
#include <algorithm>
#include <cmath>
using namespace std;

static inline void p(int x) { printf("%d\n", x); }

int main()
{
	int n, cnt = 0;
	scanf("%d", &n);

	vector<int> A(n), G;
	for (int &x: A)
		scanf("%d", &x);

	for (int i = 1, x = 1; x <= n; x = pow(4,i)+3*pow(2,i-1)+1, i++)
		G.push_back(x);
	reverse(G.begin(), G.end());

	for (int g: G)
		for (auto b = A.begin(), i = b + g, e = A.end(); i != e; i++) {
			int v = *i;
			auto j = i - g;
			for(; j >= b && *j > v; j -= g)
				*(j + g) = *j, cnt++;
			*(j + g) = v;
		}

	p(G.size());
	for (int &x: G)
		printf("%s%d", (&x == &G[0] ? "" : " "), x);
	puts("");
	p(cnt);
	for (int x: A)
		p(x);
}


Measured memory_bytes: 6308
n, m = map(int, input().split())
denq = []
for _ in range(m):
    ks = tuple(map(lambda x: int(x)-1, input().split()))
    denq.append(set(ks[1:]))
P = tuple(map(int, input().split()))

ans = 0
for i in range(2**n):
    kk = [0] * m
    for j in range(n):
        # スイッチjがonの場合
        if (i>>j)&1:
            for idq, dq in enumerate(denq):
                # すべての電球に対して
                # スイッチjが電球に紐付けられていれば、onをカウント
                if j in dq:
                    kk[idq] += 1

    for idq in range(m):
        if P[idq] != kk[idq]%2:
            break
    else:
        ans += 1
print(ans)


Measured memory_bytes: 73664
#include<cstdio>
using namespace std;

int A, B;

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

	if (A <= B) {
		for (int i = 0; i < B; i++) {
			printf("%d", A);
		}
		printf("\n");
	}
	else {
		for (int i = 0; i < A; i++) {
			printf("%d", B);
		}
		printf("\n");
	}
}

Measured memory_bytes: 128
#include <iostream>
#include <cmath>
#include <string>
#include <vector>
#include <algorithm>
using namespace std;

int main() {
    long long a,b,c;
    cin >> a >> b >> c;
    if((a*b*c) % 2 == 0) cout << 0 << endl;
    else cout << min(a*b, min(b*c, c*a)) << endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
using namespace std;
int main(){
  int n;
  cin >> n;
  string s,t;
  cin >> s >> t;
  for(int i=0;i<n;i++){
    int m = n + i;
    bool flag = true;
    for(int j=i;j<n;j++)
      if(s[j]!=t[j-i]){flag = false; break;}
    if(flag){cout << m << endl; return 0;}
  }
  cout << 2*n << endl;
  return 0;
}
    

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i, a, n) for(int i = a; i < n; i++)
#define repr(i, a, b) for(int i = a; i >= b; i--)
#define int long long
#define all(a) a.begin(), a.end()
#define chmax(x, y) x = max(x, y)
#define chmin(x, y) x = min(x, y)
using namespace std;
typedef pair<int, int> P;
const int mod = 1000000007;
const int INF = 1e15;

signed main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    int n;
    cin >> n;
    if(n == 1){
        cout << "Hello World" << endl;
    }else{
        int a, b;
        cin >> a >> b;
        cout << a + b << endl;
    }
}

Measured memory_bytes: 256
using System;
using System.Linq;

namespace AtCoderMake.ABC165
{
    class ABC165B
    {
        static void Main(string[] args)
        {
            var x =  long.Parse(Console.ReadLine());
            long money = 100;
            int year = 0;
            while (x > money)
            {
                var plus = money * 0.01;
                money += (long)plus;
                year++;
            }
            Console.WriteLine(year);
        }
    }
}

Measured memory_bytes: 27540
fn main() {
    let (r, w) = (std::io::stdin(), std::io::stdout());
    let mut sc = IO::new(r.lock(), w.lock());
    let n: usize = sc.read();
    let k: usize = sc.read();
    let mut a: Vec<usize> = sc.vec(n);
    a.sort();

    if is_required(0, &a, k) {
        println!("0");
    } else {
        let mut required = n;
        let mut non_required = 0;
        while required - non_required > 1 {
            let m = (required + non_required) / 2;
            if is_required(m, &a, k) {
                required = m;
            } else {
                non_required = m;
            }
        }
        println!("{}", non_required + 1);
    }
}

fn is_required(id: usize, a: &Vec<usize>, k: usize) -> bool {
    if a[id] >= k {
        return true;
    }
    let mut dp = vec![false; k + 1];
    dp[0] = true;
    for (i, &a) in a.iter().enumerate() {
        if i == id || a >= k {
            continue;
        }
        for from in (0..(k - a + 1)).rev() {
            dp[from + a] |= dp[from];
        }
    }
    ((k - a[id])..k).any(|i| dp[i])
}

pub struct IO<R, W: std::io::Write>(R, std::io::BufWriter<W>);

impl<R: std::io::Read, W: std::io::Write> IO<R, W> {
    pub fn new(r: R, w: W) -> IO<R, W> {
        IO(r, std::io::BufWriter::new(w))
    }
    pub fn write<S: std::ops::Deref<Target = str>>(&mut self, s: S) {
        use std::io::Write;
        self.1.write(s.as_bytes()).unwrap();
    }
    pub fn read<T: std::str::FromStr>(&mut self) -> T {
        use std::io::Read;
        let buf = self
            .0
            .by_ref()
            .bytes()
            .map(|b| b.unwrap())
            .skip_while(|&b| b == b' ' || b == b'\n' || b == b'\r' || b == b'\t')
            .take_while(|&b| b != b' ' && b != b'\n' && b != b'\r' && b != b'\t')
            .collect::<Vec<_>>();
        unsafe { std::str::from_utf8_unchecked(&buf) }
            .parse()
            .ok()
            .expect("Parse error.")
    }
    pub fn vec<T: std::str::FromStr>(&mut self, n: usize) -> Vec<T> {
        (0..n).map(|_| self.read()).collect()
    }
    pub fn chars(&mut self) -> Vec<char> {
        self.read::<String>().chars().collect()
    }
}


Measured memory_bytes: 4352
#include<bits/stdc++.h>
using namespace std;
pair<int,int> pii;
vector<int> vec;
bool jud(int n);
int ans;
int main()
{
  int x,ans;
  cin>>x;
  ans=x;
  while(!jud(ans)){
    ans++;
  }

  cout<<ans<<'\n';
  return 0;
}
bool jud(int n){
  if(n<=1)return false;
  
  double s=sqrt(n);
  
  for(int i=2; i<s; i++){
    if(n%i==0)return false;
  }
  
  return true;
}


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

using namespace std;

const long long mod = 1e9 + 7;

int main()
{
  int n; cin >> n;
  string s; cin >> s;
  
  vector < long long > cnt(30, 0);
  
  for (int i = 0; i < n; i++) cnt[s[i] - 'a']++;
  
  long long ans = 1;
  
  for (int i = 0; i <= 26; i++)
  {
    if (cnt[i] > 0) ans *= (cnt[i] + 1);
    ans %= mod;
  }
  
  cout << ans - 1;
  return 0;
}

Measured memory_bytes: 512
#include <bits/stdc++.h>
#include <vector>
#include <string>
#include <stdio.h>
#include <cstdlib>
#include <iostream>
#include <cstdlib>
using namespace std;
using ll = long long;
#define pi 3.1415926535897932384626433832795028841971693993

int main()
{   int r;
    float circum;
	cin>>r;
	circum=2*pi*r;
	printf("%.7f\n",circum);
    return 0;
}


Measured memory_bytes: 3760
/*二分探索*/
#include <stdio.h>
#define N 100000
#define Q 50000
int main(){
  int s[N], t[Q], n, q, i, count=0;
  int left, right, mid;

  scanf("%d", &n);

  for (i=0; i<n; i++){
    scanf("%d", &s[i]);
  }
  
  scanf("%d", &q);
  
  for (i=0; i<q; i++){
    scanf("%d", &t[i]);
    /*探索*/
    left = 0;
    right =n;
    while (left < right){
      mid = (left + right)/2;
      if (s[mid] == t[i]){
	count++;
	break;
      }
      else if (t[i] < s[mid])
	right = mid;
      else
	left = mid + 1;
    }
    
  }

  printf("%d\n", count);

  return 0;
}



Measured memory_bytes: 2272
#include<cstdio>
#include<cstring>
#include<iostream>
using namespace std;
const int maxn=(1e5)+50;
int N,H[maxn];
int main(){
	scanf("%d",&N);
	for(int i=1;i<=N;i++)scanf("%d",&H[i]);
	H[1]--;
	for(int i=2;i<=N;i++){
		if(H[i]<H[i-1]){
			printf("No\n");
			return 0;
		}
		if(H[i]-1>=H[i-1])H[i]--;
	}
	printf("Yes\n");
	return 0;
}

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

using namespace std;

#define li int64_t
#define mod (li)(1e9+7)
const int MX1=1e5+5;

string s,a;

void solve(){
	cin>>s>>a;
	int n=s.length();
	int m=a.length();
	int idx=-1;
	for(int i=0;i<n;i++){
		int j=i+m,k,p;
		if(j>n) break;
		for(k=i,p=0;k<j;k++,p++){
			if(s[k]==a[p] or s[k]=='?'){
			}else{
				break;
			}
		}
		if(k==j){
			idx=i;
		}
	}
	if(idx==-1){
		cout<<"UNRESTORABLE";
	}else{
		for(int i=0;i<n;i++){
			if(s[i]=='?'){
				s[i]='a';
			}
		}
		int i=idx,j=idx+m;
		for(int k=i,p=0;k<j;k++,p++){
			s[k]=a[p];
		}
		cout<<s;
	}
}

int main(){
	ios_base::sync_with_stdio(0);
	#ifndef ONLINE_JUDGE
	#endif
	int t=1;
	//cin>>t;
	while(t--){
		solve();
	}
	return 0;
}

Measured memory_bytes: 256
using System;
using System.Collections.Generic;
using System.Linq;
using static System.Console;
using static System.Math;

class MainClass : Scanner
{
    static void Main()
    {
        int N = RInt();
        var dic = new Dictionary<string, int>();
        for (int i = 0; i < N; i++)
        {
            var r = Console.ReadLine().Split();
            dic.Add(r[0], int.Parse(r[1]));
        }
        string X = RString();

        int ans = dic.Values.Sum();
        foreach (var item in dic)
        {
            if (item.Key == X)
            {
                ans -= item.Value;
                break;
            }
            ans -= item.Value;
        }
        WriteLine(ans);
    }
}



class Scanner
{
    public static string RString() => Console.ReadLine();
    public static int RInt() => ReadTuple<int>();
    public static long RLong() => ReadTuple<long>();
    public static double RDouble() => ReadTuple<double>();

    public static string[] RStrings() => Console.ReadLine().Split();
    public static int[] RInts() => Array.ConvertAll(Console.ReadLine().Split(), int.Parse);
    public static long[] RLongs() => Array.ConvertAll(Console.ReadLine().Split(), long.Parse);
    public static double[] RDoubles() => Array.ConvertAll(Console.ReadLine().Split(), double.Parse);
    public static int[] RInts(Func<string, int> func) => Console.ReadLine().Split().Select(func).ToArray();
    public static long[] RLongs(Func<string, long> func) => Console.ReadLine().Split().Select(func).ToArray();
    public static double[] RDoubles(Func<string, double> func) => Console.ReadLine().Split().Select(func).ToArray();
    //public static string[] RStrings(Func<string, string> func) => Console.ReadLine().Split().Select(func).ToArray();

    public static T1 ReadTuple<T1>()
    {
        var r = RString();
        var r1 = (T1)Convert.ChangeType(r, typeof(T1));
        return r1;
    }
    public static (T1, T2) ReadTuple<T1, T2>()
    {
        var r = RStrings();
        var r1 = (T1)Convert.ChangeType(r[0], typeof(T1));
        var r2 = (T2)Convert.ChangeType(r[1], typeof(T2));
        return (r1, r2);
    }
    public static (T1, T2, T3) ReadTuple<T1, T2, T3>()
    {
        var r = RStrings();
        var r1 = (T1)Convert.ChangeType(r[0], typeof(T1));
        var r2 = (T2)Convert.ChangeType(r[1], typeof(T2));
        var r3 = (T3)Convert.ChangeType(r[2], typeof(T3));
        return (r1, r2, r3);
    }
    public static (T1, T2, T3, T4) ReadTuple<T1, T2, T3, T4>()
    {
        var r = RStrings();
        var r1 = (T1)Convert.ChangeType(r[0], typeof(T1));
        var r2 = (T2)Convert.ChangeType(r[1], typeof(T2));
        var r3 = (T3)Convert.ChangeType(r[2], typeof(T3));
        var r4 = (T4)Convert.ChangeType(r[3], typeof(T4));
        return (r1, r2, r3, r4);
    }
}


Measured memory_bytes: 28348
N, A, B = map(int, input().split())

if (B - A) % 2 == 0:
    print ((B - A) // 2)
    exit()

tmp1 = A - 1
b = B - tmp1
tmp1 += (b - 1) // 2

tmp2 = N - B
a = A + tmp2
tmp2 += (N - a) // 2

print (min(tmp1, tmp2) + 1)

Measured memory_bytes: 3064
package main

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

var (
	readString func() string
	stdout     *bufio.Writer
)

func init() {
	readString = newReadString(os.Stdin)
	stdout = bufio.NewWriter(os.Stdout)
}

func newReadString(ior io.Reader) func() string {
	r := bufio.NewScanner(ior)
	r.Buffer(make([]byte, 1024), int(1e+11))
	r.Split(bufio.ScanWords)

	return func() string {
		if !r.Scan() {
			panic("Scan failed")
		}
		return r.Text()
	}
}

func readInt() int {
	return int(readInt64())
}

func readInt64() int64 {
	i, err := strconv.ParseInt(readString(), 0, 64)
	if err != nil {
		panic(err.Error())
	}
	return i
}

func readIntSlice(n int) []int {
	b := make([]int, n)
	for i := 0; i < n; i++ {
		b[i] = readInt()
	}
	return b
}

func readLengthAndSlice() (int, []int) {
	n := readInt()
	return n, readIntSlice(n)
}

func printf(f string, args ...interface{}) (int, error) {
	return fmt.Fprintf(stdout, f, args...)
}

func println(args ...interface{}) (int, error) {
	return fmt.Fprintln(stdout, args...)
}

func eprintln(args ...interface{}) (int, error) {
	return fmt.Fprintln(os.Stderr, args...)
}

// readString() string
// readInt() int
// readIntSlice(n int) []int
// readLengthAndSlice() []int

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

func main() {
	defer stdout.Flush()

	pmax := 100010
	p := NewPrimes(pmax)
	isPrime := func(x int) bool {
		return p.IsPrime(x)
	}
	a := make([]int, pmax)
	for i := range a {
		if i%2 == 1 && isPrime(i) && isPrime((i+1)/2) {
			a[i] = 1
		}
	}
	sum := cumulativeSum(a)

	Q := readInt()
	for i := 0; i < Q; i++ {
		l := readInt()
		r := readInt()
		println(sum(l, r+1))
	}
}

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

type Primes []bool

func NewPrimes(n int) Primes {
	m := n + 1
	p := make([]bool, m)
	for i := 3; i < m; i += 2 {
		p[i] = true
	}
	p[2] = true
	for i := 3; i*i < m; i += 2 {
		if !p[i] {
			continue
		}
		for j := i + i; j < m; j += i {
			p[j] = false
		}
	}

	return p
}

func (ps Primes) IsPrime(x int) bool {
	return ps[x]
}

// cumlativeSum returns a function func(i, j int) int64 which returns
// the sum of a[i:j]
func cumulativeSum(a []int) func(int, int) int64 {
	n := len(a)
	b := make([]int64, n+1)
	for i := 0; i < n; i++ {
		b[i+1] = int64(a[i]) + b[i]
	}
	return func(i, j int) int64 {
		return b[j] - b[i]
	}
}


Measured memory_bytes: 4992
#include<bits/stdc++.h>
//#define int long long
#define FOR(i, a, b) for (int i = a; i < b; ++i)
#define rep(N) for (int i = 0; i < N; ++i)
#define Rep(a, b) for (int i = a; i < b; ++i)
#define For(i, N) for (int i = 0; i < N; ++i)
#define all(v) v.begin(), v.end()
#define rev(v) v.rbegin(), v.rend()
#define mi(N) int N; cin >> N;
#define ms(s) string s; cin >> s;
#define md(d) double d; cin >> d;
#define mv(v, N) vi v(N); rep(N)cin >> v[i];
#define mod 1000000007

using namespace std;
using ll = long long;
using vi = vector<int>;
using vvi = vector<vector<int>>;
using vll = vector<ll>;
using vb = vector<bool>;
using vvb = vector<vector<bool>>;
using vs = vector<string>;
using pii = pair<int, int>;
using pis = pair<int, string>;
using msi = map<string, int>;

template<typename T>
void say(T s) {
	cout << s << "\n";
}

template<typename T>
void say(vector<T> s) {
	auto itr = s.begin();
	cout << *(itr++);
	while (itr != s.end()) {
		cout << " " << *(itr++);
	}
	cout << "\n";
}

template<typename T>
void say(vector<T> s, char r) {
	auto itr = s.begin();
	cout << *(itr++);
	while (itr != s.end()) {
		cout << r << *(itr++);
	}
	cout << "\n";
}

void yn(bool b) {
	if (b)say("yes");
	else say("no");
}

void Yn(bool b) {
	if (b)say("Yes");
	else say("No");
}

void YN(bool b) {
	if (b)say("YES");
	else say("NO");
}

void Yay(bool b) {
	if (b)say("Yay!");
	else say(":(");
}

template<typename T>
void maxi(T& a, T b) {
	a = max(a, b);
}

template<typename T>
void mini(T& a, T b) {
	a = min(a, b);
}

void exact_say(double x) {
	cout << setprecision(numeric_limits<double>::max_digits10) << x << endl;
}

template<typename T>
vector<vector<T>> fill_vector(int h, int w, T val) {
	vector<vector<T>> ret;
	vector<T> v(w, val);
	rep(h)ret.push_back(v);
	return ret;
}

//2数の最大公約数を返す．
int gcd(int a, int b) {
	if (a < b)swap(a, b);
	int r;
	while (b != 0) {
		r = a % b;
		a = b;
		b = r;
	}
	return a;
}

signed main() {
	mi(n);
	mv(a, n);
	vi left_gcd(n);
	vi right_gcd(n);
	left_gcd[0] = a[0];
	right_gcd[n - 1] = a[n - 1];
	Rep(1, n) {
		left_gcd[i] = gcd(left_gcd[i - 1], a[i]);
	}
	for (int i = n - 2; i >= 0; --i) {
		right_gcd[i] = gcd(right_gcd[i + 1], a[i]);
	}
	int ans = max(right_gcd[1], left_gcd[n - 2]);
	Rep(1, n - 1) {
		maxi(ans, gcd(left_gcd[i - 1], right_gcd[i + 1]));
	}
	say(ans);
}

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

#define rep(i,m,n) for(int (i)=(int)(m);i<(int)(n);++i)
#define rep2(i,m,n) for(int (i)=(int)(n)-1;i>=(int)(m);--i)
#define REP(i,n) rep(i,0,n)
#define REP2(i,n) rep2(i,0,n)
#define FOR(i,c) for(decltype((c).begin())i=(c).begin();i!=(c).end();++i)
#define all(hoge) (hoge).begin(),(hoge).end()
#define en '\n'
using ll = long long;
using ull = unsigned long long;
template <class T> using vec = vector<T>;
template <class T> using vvec = vector<vec<T>>;
typedef pair<ll, ll> P;
constexpr long long INF = 1LL << 60;
constexpr int INF_INT = 1 << 25;
//constexpr long long MOD = (ll) 1e9 + 7;
constexpr long long MOD = 998244353LL;
using ld=long double;
static const ld pi = 3.141592653589793L;
typedef vector<ll> Array;
typedef vector<Array> Matrix;


template<class T> inline bool chmin(T& a, T b) {
    if (a > b) {
        a = b;
        return true;
    }
    return false;
}
template<class T> inline bool chmax(T& a, T b) {
    if (a < b) {
        a = b;
        return true;
    }
    return false;
}

struct Edge {
	ll to, rev;
    long double cap;
	Edge(ll _to, long double _cap, ll _rev) {
	to = _to; cap = _cap; rev = _rev;
	}
};
using Edges = vector<Edge>;
using Graph = vector<Edges>;

void add_edge(Graph& G, ll from, ll to, long double cap, bool revFlag, long double revCap) {
	G[from].push_back(Edge(to, cap, (ll)G[to].size()));
	if (revFlag)G[to].push_back(Edge(from, revCap, (ll)G[from].size() - 1));
}

//素因数分解
void factoring(ll n, map<ll, ll>& mp) {
 	for (ll i = 2; i * i <= n; i++) {
  		while (n % i == 0) {
   			mp[i]++;
   			n /= i;
  		}
 	}
 	if (n != 1) mp[n]++;
}

void solve(){
    ll n;
    cin>>n;
    map<ll,ll> mp,mp2;
    factoring(n,mp);
    
    rep(i,1,42) mp2[i*(i+1)/2]=i;

    ll ans=0;
    for(auto i:mp){
        auto it = mp2.upper_bound(i.second);
        it--;
        ans+=it->second;
    }
    cout<<ans<<en;
}

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
	
	solve();
	//ll t;cin>>t;REP(i,t) solve();

    return 0;
}


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

int main(){
  int n, m;
  int dp[21][50001];
  vector<int> c;

  //??\???
  cin >> n >> m;
  for(int i = 0; i < m; i++){
    int tmp;
    cin >> tmp;
    c.push_back(tmp);
  }
  sort(c.begin(), c.end());

  //dp?????????
  memset(dp, 0, sizeof(dp));
  for(int i = 0; i <= n; i++) dp[0][i] = i;

  //???????¨?????????§?§£???
  for(int i = 1; i < m; i++){
    for(int j = 0; j <= n; j++){
      if(j-c[i] >= 0) dp[i][j] = min(dp[i-1][j], dp[i][j-c[i]]+1);
      else dp[i][j] = dp[i-1][j];
    }
  }

  cout << dp[m-1][n] << endl;

  return 0;
}

Measured memory_bytes: 5324
#include<iostream>
#include <bits/stdc++.h>
#include<string>
#include<algorithm>
using namespace std;
typedef pair<int,int> P;


int main(){
    int N,M,tmp;
    cin >> N >> M;
    vector<int> H,ans;
    for(int i = 0; i<N;i++){
        cin >> tmp;
        H.push_back(tmp);
        ans.push_back(1);
    } 
    vector<int> A,B;
    int tmpa,tmpb;
    for(int i =0; i <M; i++){
        cin >> tmpa >> tmpb;
        if(H[tmpa-1] >= H[tmpb-1]){
            ans[tmpb-1]=0;
        }
        if(H[tmpb-1] >= H[tmpa-1]){
            ans[tmpa-1]=0;
        }
    }
    int sum =0;
    for(int i=0;i<N;++i){
        sum += ans[i];
    }
    cout << sum << endl;

    return 0;
}

Measured memory_bytes: 4320
#include<stdio.h>

int main(void) {
  int N,K;
  scanf("%d %d",&N,&K);

  int x[N];
  for(int i=0;i<N;i++) scanf("%d",&x[i]);

  int min=1000000000;
  for(int i=0;i<N-K+1;i++) {
    int xl,xr;
    xl = x[i];
    xr = x[i+K-1];
    if(xr<=0) {
      if(-xl<min) min=-xl;
    }
    else if(xl>=0) {
      if(xr<min) min=xr;
    }
    else {
      if(-xl>xr) {
	if(2*xr-xl<min) min=2*xr-xl;
      }
      else {
	if(xr-2*xl<min) min=xr-2*xl;
      }
    }
  }
  printf("%d",min);
  return(0);
}
      


Measured memory_bytes: 512
#include <iostream>
using namespace std;
int main(){
    string a,b;
    getline(cin,a);
    getline(cin,b);
    int totalChanges = 0;
    for(int i=0;i<a.length();i++){
        if(a[i]!=b[i]){
            totalChanges++;
        }
    }
    cout<<totalChanges<<endl;
}

Measured memory_bytes: 3920
#include <bits/stdc++.h>
using namespace std;
#define FOR(i, j, k) for(int i=j; i<=k; i++)
#define FFOR(i, j, k) for(int i=j; i<k; i++)
#define DFOR(i, j, k) for(int i=j; i>=k; i--)
#define bug(x) cerr<<#x<<" = "<<x<<'\n'
#define pb push_back
#define mp make_pair
typedef long long ll;
typedef long double ld;
template <typename T> inline void read(T &x){
    char c;
    bool nega=0;
    while((!isdigit(c=getchar()))&&(c!='-'));
    if(c=='-'){
        nega=1;
        c=getchar();
    }
    x=c-48;
    while(isdigit(c=getchar())) x=x*10+c-48;
    if(nega) x=-x;
}
template <typename T> inline void writep(T x){
    if(x>9) writep(x/10);
    putchar(x%10+48);
}
template <typename T> inline void write(T x){
    if(x<0){
        putchar('-');
        x=-x;
    }
    writep(x);
}
template <typename T> inline void writeln(T x){
    write(x);
    putchar('\n');
}
#define taskname "B"
int a, b, c, d;
int main(){
    #ifdef Megumin
        if(fopen(taskname".inp", "r"))
            freopen(taskname".inp", "r", stdin);
    #endif // Megumin
    cin>>a>>b>>c>>d;
    a=max(a, c);
    b=min(b, d);
    cout<<max(b-a, 0);
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <iterator>
#include <algorithm>
#include <string>
#include <map>
#include <list>
using namespace std;

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

  int a[m];
  for(int i = 0; i < m; ++i){
    cin >> a[i];
  }

  int resl=0,resr=0;
  for(int i = 0; i < x; ++i){
    for(int j = 0; j < m; ++j){
      if(a[j]==i){
        resl++;
      }
    }
  }

  for(int i = x; i < n; ++i){
    for(int j = 0; j < m; ++j){
      if(a[j]==i){
        resr++;
      }
    }
  }
  cout << min(resl,resr) << endl;
}



Measured memory_bytes: 3552
#include <stdio.h>

void sortmin(int x[8]){
  int i,j,t;
  for(i=0;i<7;i++){
    for(j=7;j>i;j--){
      if(x[j-1]>x[j]){
	t=x[j];\
	x[j]=x[j-1];
	x[j-1]=t;
      }
    }
  }
  return;
}
int main(void){
  int n,state=0;
  int i,j;
  char str[10];
  int max[8],min[8],num[8];
  scanf("%d",&n);
  for(i=0;i<n;i++){
    scanf("%s",&*str);
    for(j=0;j<8;j++){
      min[j]=str[j]-48;
      //printf("%d",min[j]);
    }
    sortmin(min);
    for(j=0;j<8;j++){
      max[j]=min[7-j];
    }
    for(j=7;j>=0;j--){
      num[j]=max[j]-min[j];
      if(num[j]<0){
	num[j]+=10;
	max[j-1]--;
      }
    }
    state=0;
    for(j=0;j<7;j++){
      if(state==0){
	if(num[j]!=0){
	  state++;
	  printf("%d",num[j]);
	}
      }else{
	printf("%d",num[j]);
      }
    }
      printf("%d\n",num[7]);
  }
  return 0;
}

Measured memory_bytes: 596
#include <iostream>
#include <vector>
#include <string>
#include <map>
#include <set>
#include <stack>
#include <queue>
#include <cmath>
#include <algorithm>
#include <utility>
#include <functional>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;
const int MOD = 1000000007;
const double EPS = 1e-9;


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

  string a,s,c;
  cin>>a>>s>>c;
  cout<< a[0]  << s[0] << c[0] << endl;

  return 0;
}


Measured memory_bytes: 256
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            StringBuilder sb = new StringBuilder();

            int n = int.Parse(Console.ReadLine());

            for (int i = 0; i < n; i++)
            {
                int[] input = Array.ConvertAll(Console.ReadLine().Split(' '), int.Parse);
                Array.Sort(input);

                int a = input[0];
                int b = input[1];
                int c = input[2];

                sb.AppendLine(a * a + b * b == c * c ? "YES" : "NO");
            }
            Console.Write(sb);
        }
    }
}

Measured memory_bytes: 9144
#include <algorithm>
#include <iostream>
#include <iomanip>
#include <cstring>
#include <string>
#include <vector>
#include <random>
#include <bitset>
#include <queue>
#include <cmath>
#include <unordered_map>
#define rep(i,n) for (int i=0; i<n;++i)
#define rep_down(i,n) for (int i=n-1; i>=0;--i)
#define ALL(a)  (a).begin(),(a).end()
typedef long long ll;
using namespace std;
const ll MOD = 1000000007LL;
const int INF = 1000000007;
int H, W;
unordered_map<char, int> Ump;


bool calc1(){ // H＊W%4==0
  for (auto it=Ump.begin(); it !=Ump.end(); ++it){
    int cnt = it->second;
    if (cnt%4==0) continue;
    else return false;
  }
  return true;
}

bool calc2(int cnt_2){ // H＊W%4!=0 && H＊W%2==0

  for (auto it=Ump.begin(); it !=Ump.end(); ++it){
    int cnt = it->second;
    if (cnt%4==0) continue;
    if (cnt%2==1) return false;
    cnt_2--;
    if (cnt_2 < 0) return false;
  }
  return true;
}

bool calc3(int cnt_2){ // H＊W%2!=0
  int cnt_1 = 1;
  for (auto it=Ump.begin(); it !=Ump.end(); ++it){
    int cnt = it->second;
    if (cnt%4==0) continue;
    if (cnt%2==1) cnt_1--;
    else cnt_2--;
    if (cnt_1 < 0 || cnt_2 < 0) return false;
  }
  return true;
}

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

  cin >> H >> W;
  char a;
  rep(i, H){
    rep(j, W){
      cin >> a;
      Ump[a]+=1;
    }
  }

  bool flag =  false;
  int cnt_2 = 0;
  if (H%2==0 && W%2==0){
    flag = calc1();
  } else if ((H*W)%2==0){
    if (W%2==1) cnt_2 = H/2;
    else cnt_2 = W/2;
    flag = calc2(cnt_2);
  } else {
    cnt_2 = (H-1)/2 + (W-1)/2;
    flag = calc3(cnt_2);
  }
  string ans = flag?"Yes":"No";
  cout << ans << "\n";
  return 0;
}

Measured memory_bytes: 512
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
const ll INF=1LL<<60;
const int inf=1<<30;
const int mod=1e9+7;
const int MOD=998244353;
int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n,d,x;cin >> n >> d >> x;
    int ans=0;
    for(int i=0;i<n;i++){
        int a;cin >> a;
        ans+=(d-1)/a+1;
    }
    cout << ans+x << endl;
}

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

using namespace std;
typedef long long ll;

int main(){
	ll k;
	cin>>k;
	ll sum = 0;
	ll res;
	for(ll i=1;i<=k;i++){
		for(ll j=1;j<=k;j++){
			for(ll s=1;s<=k;s++){
				res = __gcd(i,j);
				res = __gcd(res,s);
				//cout<<res<<"--";
				sum += res;
			}
		}
	}
	//cout<<endl;
	cout<<sum<<endl;
	return 0;
} 

Measured memory_bytes: 3636
#include<bits/stdc++.h>
//g++ -std=c++11 

using namespace std;
typedef long long ll;

#define rep(i,n) for (long long i = 0; i < (n); ++i)
#define DIV 1000000007 //10^9+7

int main(){
	string S;
	cin >> S;
	if(S == "Sunny") {
		cout << "Cloudy" << endl;
	} else if (S == "Cloudy") {
		cout << "Rainy" << endl;
	} else {
		cout << "Sunny" << endl;
	}
}


Measured memory_bytes: 3596
#include<bits/stdc++.h>
#define ll long long int
#define ss second
#define ff first
#define pb push_back
#define all(v) v.begin(),v.end()
#define unik(v)  v.erase(unique(v.begin(),v.end()),v.end())
using namespace std;
typedef pair<int, int> pii;
const ll mod = 998244353;
const int sz = 100 + 3, inf = 1e9 + 10;

int main()
{
	ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
	int a, b, c;
	cin >> a >> b >> c;
	swap(a, b);
	swap(a, c);
	cout << a << ' ' << b << ' ' << c << '\n';




	return 0;
}

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

int main()
{
	std::string S;
	int answer = 0;

	std::cin >> S;

	if (S == "SUN")
	{
		answer = 7;
	}
	else if (S == "MON")
	{
		answer = 6;
	}
	else if (S == "TUE")
	{
		answer = 5;
	}
	else if (S == "WED")
	{
		answer = 4;
	}
	else if (S == "THU")
	{
		answer = 3;
	}
	else if (S == "FRI")
	{
		answer = 2;
	}
	else if (S == "SAT")
	{
		answer = 1;
	}

	std::cout << answer << std::endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <algorithm>
using namespace std;
typedef long long ll;
const double rate = 380000.0;

int main()
{
  int n;
  cin >> n;
  double tmp = 0;
  for (int i = 0; i < n; i++)
  {
    double x;
    string u;
    cin >> x >> u;
    if (u=="JPY"){
      tmp += x;
    } else if (u=="BTC"){
      tmp += rate * x;
    } else {
      cout << "BAD INPUT" << endl;
      return -1;
    }
  }
  
  printf("%.8f",tmp);
  
  return 0;
}

Measured memory_bytes: 256
#include <stdio.h>

int main(){
  int x;
  scanf("%d",&x);
  int primes[15] = {2,3,5,7,11,13,17,19,23,29,31,37,41,43,47};
  int exp[15] = {};
  for (int i=0;i<15;i++){
    int temp = x / primes[i];
    while (temp != 0){
      exp[i] = exp[i] + temp;
      temp = temp / primes[i];
    }
  }
  int b75=0,b25=0,b15=0,b5=0,b3=0;
  for (int i=0;i<15;i++){
    if (exp[i] >= 74)
      b75++;
    if (exp[i] >= 24)
      b25++;
    if (exp[i] >= 14)
      b15++;
    if (exp[i] >= 4)
      b5++;
    if (exp[i] >= 2)
      b3++;
  }
  int ret = b75 + b25*(b3-1) + b15*(b5-1) + (b5*(b5-1)*(b3-2))/2;
  printf("%d\n",ret);
  return 0;
}


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

using ll = long long;
using Pi = pair<int, int>;
using Pl = pair<ll, ll>;
using vint = vector<int>;
using vvint = vector<vint>;
using vvvint = vector<vvint>;
using vdouble = vector<double>;
using vvdouble = vector<vdouble>;
using vvvdouble = vector<vvdouble>;
using vll = vector<ll>;
using vvll = vector<vll>;
using vvvll = vector<vvll>;
using uint = unsigned int;
using ull = unsigned long long;

template<typename T> using uset = unordered_set<T>;
template<typename T1, typename T2> using umap = unordered_map<T1, T2>;

constexpr int INF = (1 << 30) - 1;
constexpr ll LLINF = 1LL << 60;
constexpr int dy[] = {1, 0, -1, 0, 1, -1, -1, 1};
constexpr int dx[] = {0, 1, 0, -1, 1, 1, -1, -1};
constexpr char el = '\n';
constexpr int mod = 1000000007;
constexpr int mod2 = 998244353;
template<typename T> T gcd(T a, T b) { return (b ? gcd(b, a % b) : a); }
template<typename T> T lcm(T a, T b) { return (a / gcd(a, b) * b); }
template<typename T1, typename T2>
inline bool chmin(T1 &a, T2 b) { return (a > b && (a = b, true)); }
template<typename T1, typename T2>
inline bool chmax(T1 &a, T2 b) { return (a < b && (a = b, true)); }
template<typename T>
bool isin(T y, T x, T h, T w) { return (0 <= y && 0 <= x && y < h && x < w); }
template<typename T>
bool isin1(T y, T x, T h, T w) { return (0 < y && 0 < x && y <= h && x <= w); }

template<typename T>
ostream& operator <<(ostream &os, vector<T> &v) {
	os << v[0];
	for (int i = 1; i < v.size(); i++) os << " " << v[i];
	return (os);
}

template<typename T>
istream& operator >>(istream &is, vector<T> &v) {
	for (auto &u : v) is >> u;
	return (is);
}

template<typename T1, typename T2>
istream& operator >>(istream &is, pair<T1, T2> &p) {
	return (is >> p.first >> p.second);
}


void Main() {
	int N, M; cin >> N >> M;
	vint H(N); cin >> H;
	vvint G(N); 
	for (int i = 0; i < M; i++) {
		int A, B; cin >> A >> B; --A, --B;
		G[A].push_back(B);
		G[B].push_back(A);
	}
	
	int cnt = 0;
	for (int u = 0; u < N; u++) {
		int flag = 1;
		for (auto &v : G[u]) {
			if (H[v] >= H[u]) {
				flag = 0;
			}
		}
		cnt += flag;
	}
	cout << cnt << endl;
}

int main() {
	cin.tie(0);
	ios::sync_with_stdio(0);
	cout << fixed << setprecision(20);
	Main();
	return (0);
}


Measured memory_bytes: 8744
#include <iostream>
#include <string.h>
#include <algorithm>
#include <array>
#include <vector>
#include <cmath>

using namespace std;

int main( void ) {

    int N, T, A, H;
    cin >> N;
    cin >> T >> A;

    double ans, Max, tmp;
    Max = numeric_limits<double>::max();

    for ( int i = 0; i < N; i++ ) {
        cin >> H;

        tmp = fabs(A - (T - H * 0.006));
        
        if ( Max > tmp ) {
            Max = tmp;
            ans = i + 1;
        }
    }

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

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

#define fill(a,val) memset(a, (val), sizeof a)
#define pb emplace_back
#define scantype int
#define lli long long int
#define N 100003

lli MOD  = 1000000007;
lli inf = 1e15;

void scan(scantype &x);
lli powermod(lli _a,lli _b,lli _m){lli _r=1;while(_b){if(_b%2==1)_r=(_r*_a)%_m;_b/=2;_a=(_a*_a)%_m;}return _r;}
lli string_to_number(string s){lli x=0; stringstream convert(s); convert>>x; return x;}
lli add(lli a,lli b){lli x = (a+b)%MOD; return x; }
lli mul(lli a,lli b){lli x = (a*b)%MOD; return x; }
lli sub(lli a,lli b){lli x = (a-b+MOD)%MOD; return x; }
lli div(lli a,lli b){lli x = a;lli y = powermod(b,MOD-2,MOD);lli res = (x*y)%MOD;return res;}

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

  int mid = n;

  if(n==2)
  {
       if(x!=mid)
       {
              cout<<"No";
              return 0;
       }
  }
  int a[2*n+3];
  fill(a,0);

  if(x==1 || x==2*n-1)
  {
         cout<<"No";
         return 0;
  }

  a[mid] = x;

  int curr = x;

  for(int i=mid+1;i<=(2*n-1);i++)
  {
         curr = curr + 1;
         if(curr>(2*n)-1)curr=1;
         a[i] = curr;
  }
  for(int i=1;i<n;i++)
  {
         curr = curr + 1;
         if(curr>(2*n)-1)curr=1;
         a[i]=curr;
  }
  cout<<"Yes"<<endl;
  for(int i=1;i<=2*n-1;i++)
       printf("%d\n",a[i]);

  return 0;
}









void scan(scantype &x)
{
    register int c = getchar(); //for negative/positive
    x = 0;
    int neg = 0;
    for(;((c<48 || c>57) && c != '-');c = getchar());
    if(c=='-') {neg=1;c=getchar();}
    for(;c>47 && c<58;c = getchar()) {x = (x<<1) + (x<<3) + c - 48;}
    if(neg) x=-x;
}


Measured memory_bytes: 2304
#include <vector>
#include <iostream>
#include <utility>
#include <algorithm>
#include <string>
#include <deque>
#include <queue>
#include <tuple>
#include <queue>
#include <functional>
#include <cmath>
#include <iomanip>
#include <map>
#include <set>
#include <numeric>
#include <unordered_map>
#include <unordered_set>
#include <complex>
#include <iterator>
#include <array>
#include <memory>
#include <stack>
#define vi vector<int>
#define vvi vector<vector<int> >
#define ll long long int
#define vl vector<ll>
#define vvl vector<vector<ll>>
#define vb vector<bool>
#define vc vector<char>
#define vs vector<string>
#define ld long double
#define INF 1e9
#define EPS 0.0000000001
#define rep(i,n) for(int i=0;i<n;i++)
#define loop(i,s,n) for(int i=s;i<n;i++)
#define all(in) in.begin(), in.end()
template<class T, class S> void cmin(T &a, const S &b) { if (a > b)a = b; }
template<class T, class S> void cmax(T &a, const S &b) { if (a < b)a = b; }
#define MAX 32768+10000
using namespace std;
typedef pair<int, int> pii;
typedef pair<double,double>pdd;
typedef pair<ll,ll>pll;
int main(){
    int n;
    vector<bool>Primecheck(MAX+1,true);
    vector<int>Primenumber(MAX+1,0); //Primearray
    int Primecounter =0;                  //Primearray counter;
    for(int i = 2; i<MAX+1;i++){
        if(Primecheck[i]){
            for(int j = 2;i*j<MAX;j++)
                Primecheck[i*j] = false;//?´???°??????Primearray???????´??????????????????°?????¨???false???
            Primenumber[Primecounter] = i;
            Primecounter++;
        }
    }
    while(cin>>n,n){
        int ans=0;
        for(int i=0; i<Primecounter;i++){
            if(Primenumber[i]>n)break;
            for(int j=i; j<Primecounter;j++){
                if(Primenumber[j]>n)break;
                if(Primenumber[i]+Primenumber[j]==n)
                    ans++;
            }
        }
        cout<<ans<<endl;
        ans=0;
    }
}

Measured memory_bytes: 2992
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0; i<n; ++i)
 
using namespace std;
using ll = long long;
 
int main() {
    cin.tie(nullptr); ios::sync_with_stdio(false);
    double a, b;
    cin >> a >> b;
    cout << ceil((b-1)/(a-1)) << endl;
}


Measured memory_bytes: 3752
/*                         _
                        _ooOoo_
                       o8888888o
                       88" . "88
                       (| -_- |)
                       O\  =  /O
                    ____/`---'\____
                  .'  \\|     |//  `.
                 /  \\|||  :  |||//  \
                /  _||||| -:- |||||_  \
                |   | \\\  -  /'| |   |
                | \_|  `\`---'//  |_/ |
                \  .-\__ `-. -'__/-.  /
              ___`. .'  /--.--\  `. .'___
           ."" '<  `.___\_<|>_/___.' _> \"".
          | | :  `- \`. ;`. _/; .'/ /  .' ; |
          \  \ `-.   \_\_`. _.'_/_/  -' _.' /
===========`-.`___`-.__\ \___  /__.-'_.'_.-'================

                  Please give me AC.
*/

#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <numeric>
#include <string>
#include <sstream>
#include <complex>
#include <vector>
#include <list>
#include <queue>
#include <deque>
#include <stack>
#include <unordered_map>
#include <unordered_set>

using namespace std;

using int64 = long long;
using uint64 = unsigned long long;
using vi = vector<int>;
using vl = vector<int64>;
using pii = pair<int, int>;
using pll = pair<int64, int64>;

#define rep(i, n) for (int i = 0; i < (int)(n); ++i)
#define all(v) (v).begin(), (v).end()
#define print(x) cout << (x) << '\n'
#define debug(x) cerr << #x << ": " << (x) << '\n'
#define dbg(v) for (size_t _ = 0; _ < v.size(); ++_){cerr << #v << "[" << _ << "] : " << v[_] << '\n';}
// constant
const int INF = (1<<30) - 1;
const int64 INF64 = (1LL<<62) - 1;

int64 mod = pow(10, 9) + 7;
int64 ans;

void P(int64 n, int64 m) {
    rep(i, m) ans = (ans * (n - i)) % mod;
}

int main(){
    cout << fixed << setprecision(15);
    ios::sync_with_stdio(false);
    cin.tie(nullptr);

    int64 n, k;
//    scanf("%lld %lld", &n, &k);
    cin >> n >> k;
    vector<vector<int>> adj(n);
    rep(i, n - 1) {
        int a, b;
        // scanf("%d %d", &a, &b);
        cin >> a >> b;
        a--; b--;
        adj[a].push_back(b);
        adj[b].push_back(a);
    }

    ans = k;
    stack<int> dfs;
    vector<bool> visited(n, false);
    dfs.push(0);
    int depth = 0;
    while(!dfs.empty()) {
        int x = dfs.top();
        dfs.pop();
        visited[x] = true;
        int cdepth = depth;

        int64 m = 0;
        for (auto v : adj[x]) {
            if (!visited[v]) {
                m++;
                dfs.push(v);
                depth++;
            } else {
                depth--;
            }
        }
        P(k - 1 - (cdepth == 0 ? 0 : 1), m);
        cerr << '\n';
    }


    cout << ans << '\n';

    return 0;
}



Measured memory_bytes: 6520
/*-----------Author: Araz Jabrayilov---------*/
/*------------@araz17----(~~)#5371-----------*/

#include <bits/stdc++.h>

#define ll long long
#define endl '\n'

using namespace std;

//int a[105]];


int main()
{
    ios_base :: sync_with_stdio(0);
    cin.tie(0), cout.tie(0);
    int x = 0; 
    int y = 0; 
    int z = 0; 
  	cin >> x >> y >> z;
  	cout << z << " " << x << " " << y;
    return 0;
}


Measured memory_bytes: 256
import java.util.Scanner;

public class Main {
	private static boolean inc3(int n) {
		while (n > 0) {
			if (n % 10 == 3) return true;
			n /= 10;
		}
		return false;
	}
	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		int n = scanner.nextInt();
		for (int i = 1; i <= n; ++i) {
			if (i % 3 == 0 || inc3(i)) System.out.printf(" %d", i);
		}
		System.out.println();
	}
}



Measured memory_bytes: 39392
//Created by Kira

#include<bits/stdc++.h>
using namespace std;

#define IOS cin.sync_with_stdio(0);cin.tie(0); cout.tie(0);
#define all(x) x.begin(), x.end()
#define sz(x) (int)x.size()
#define pii pair<int,int> 
#define pb push_back
#define vi vector<int> 
using ll = long long;

const int mod = 1e9 + 7;

ll pwr(ll a, ll b);
    



int main(){
   IOS

    int r; cin>>r;
    cout<<fixed<<setprecision(6)<<(2.0*3.14*r)<<"\n";







}

ll pwr(ll a, ll b){
   a %= mod;	//Remove mod if not required
   ll res = 1;
   while(b > 0){
    if(b&1)
        res = res * a % mod;
        a = a * a % mod;
    b >>= 1;
    }

    return res;
}



Measured memory_bytes: 3800
// Problem : C - Step
// Contest : AtCoder - AtCoder Beginner Contest 176
// URL : https://atcoder.jp/contests/abc176/tasks/abc176_c
// Memory Limit : 1024 MB
// Time Limit : 2000 ms
// Powered by CP Editor (https://github.com/cpeditor/cpeditor)

/*ヽ｀、ヽ｀｀、ヽ｀ヽ｀、、ヽ ｀ヽ 、ヽ｀🌙｀ヽヽ｀ヽ、ヽ｀
ヽ｀、ヽ｀｀、ヽ 、｀｀、 ｀、ヽ｀ 、｀ ヽ｀ヽ、ヽ ｀、ヽ｀｀、
ヽ、｀｀、｀、ヽ｀｀、 、ヽヽ｀、｀、、ヽヽ、｀｀、 、 ヽ｀、
ヽ｀｀、 ヽ｀ヽ｀、、ヽ ｀ヽ 、 🚶ヽ｀｀｀｀ヽヽヽ｀、、ヽ｀、、ヽ*/
#include <bits/stdc++.h> 
#pragma GCC optimize ("O3")
#pragma GCC target ("sse4")
 
#include <bits/stdc++.h>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/assoc_container.hpp>
 
 
using namespace std;
using namespace __gnu_pbds;
 
typedef long long   ll;
typedef long double ld;
typedef complex< ld > cd;
 
typedef pair<int, int> pi;
typedef pair<ll, ll>   pl;
typedef pair<ld, ld>   pd;
 
typedef vector< int > vi;
typedef vector< ld >  vd;
typedef vector< ll >  vl;
typedef vector< pi >  vpi;
typedef vector< pl >  vpl;
typedef vector< cd >  vcd;
 
#define l00p(i, a, b) for (int i=a; i<(b); i++)
#define loop(i, a)    for (int i=0; i<(a); i++)
#define rep1(i, a, b) for (int i = (b)-1; i >= a; i--)
#define rep(i, a)     for (int i = (a)-1; i >= 0; i--)
#define trav(a, x)    for (auto& a : x)
#define uid(a, b)     uniform_int_distribution<int>(a, b)(rng)

#define sz(x) (int)(x).size()
#define mp make_pair
#define pb push_back
#define f  first
#define s  second
#define lb lower_bound
#define ub upper_bound
#define all(x) x.begin(), x.end()
#define ins insert
//#define MOD 998244353
 
template<class T> bool ckmin(T& a, const T& b) { return b < a ? a = b, 1 : 0; }
template<class T> bool ckmax(T& a, const T& b) { return a < b ? a = b, 1 : 0; }

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

const ld pii=3.14159265359; 
const int MOD = 1000000007;
const char nl = '\n';
const ll INF = 1e18;
const int MX = 100001; //check the limits, dummy

int main() {
	ios_base::sync_with_stdio(0); cin.tie(0); 
	int n;
	cin>>n;
	vi a(n);
	ll ans=0;
	loop(i,n)
	cin>>a[i];
	l00p(i,1,n)
	{
		if(a[i]<a[i-1])
		{
			ans+=a[i-1]-a[i];
			a[i]=a[i-1];
		}
	}
	cout<<ans<<nl;
	return 0;
}
// read the question correctly (ll vs int)
// template by bqi343

Measured memory_bytes: 4024
using System;

public class Program
{
    public static void Main(string[] args)
    {
        int i = 0;

        while (true)
        {
            string input = Console.ReadLine();
            int x = int.Parse(input);

            i++;
            if (x == 0) break;

            Console.WriteLine("Case {0}: {1}", i, x);
        }
    }
}

Measured memory_bytes: 5772
#include<bits/stdc++.h>
using namespace std;
int N,M;
vector<long> A(100002);
int binary(int s,long c){
	int x=s-1,y=N+1;
	int temp;
	while(y-x>1){
		temp=(x+y)/2;
		if(A[temp]<c){
			x=temp;
		}else{
			y=temp;
		}
	}return x;
}
int main(){
	cin>>N>>M;
	A[0]=0;A[N+1]=1e+10;
	long sum=0;
	for(int i=1;i<=N;i++){
		cin>>A[i];
		sum+=A[i];
	}sort(A.begin(),A.begin()+N+2);
	vector<pair<long,int>> C(M);
	for(int i=0;i<M;i++){
		cin>>C[i].second>>C[i].first;
    }sort(C.begin(),C.end());
    reverse(C.begin(),C.end());
    
    int v;
    int b;long c;int s=1;
    for(int i=0;i<M;i++){ 
        b=C[i].second;
        c=C[i].first;
		v=binary(s,c);
        for(int j=s;j<=min(v,b+s-1);j++){
		    sum+=c-A[j];
            A[j]=c;
	    }s=min(v,b+s-1)+1;
        /*for(int k=0;k<=N+1;k++){
            cout<<A[k]<<" ";
        }cout<<endl;*/
	}cout<<sum<<endl;
}

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

int compare_int(const void *a, const void *b){
    return *(int*)a - *(int*)b;
}

int main(){
    int a[3];
    for(int i=0;i<3;i++){
        cin >> a[i];
    }
    qsort(a,3,sizeof(int),compare_int);
    if(a[0]==5&&a[1]==5&&a[2]==7){
        cout << "YES" << endl;
        return 0;
    }
    cout << "NO" << endl;
    return 0;
}

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

int main(){
  int a,count=0;
  cin >> a;
  count = count + a%10;
  a=a-a%10;
  a=a/10;
  count = count + a%10;
  a=a-a%10;
  a=a/10;
  count = count + a%10;
  cout << count << endl;
}

Measured memory_bytes: 3600
#include <iostream>
#include <cstdlib>

using namespace std;
int main() {
    int i, j, h, w;
    char p;
    bool canvas[60][60]; // [row][col]
    cin >> h >> w;
    for(i=0; i<=h+1; i++) {
        for(j=0; j<=w+1; j++) {
            canvas[i][j] = false;
        }
    }
    
    for(i=1; i<=h; i++) {
        for(j=1; j<=w; j++) {
            cin >> p;
            if(p == '#') canvas[i][j] = true;
            else canvas[i][j] = false;
        }
    }
    
    for(i=1; i<=h; i++) {
        for(j=1; j<=w; j++) {
            if(canvas[i][j]) {
                if(!canvas[i-1][j] && !canvas[i+1][j] && !canvas[i][j-1] && !canvas[i][j+1]) {
                    cout << "No" << endl;
                    return 0;
                }
            }
        }
    }
    
    cout << "Yes" << endl;
}

Measured memory_bytes: 256