akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <algorithm>
#include <utility>
#include <vector>
#include <string>
#include <queue>
#include <tuple>
#include <cmath>
#include <bitset>
#include <cctype>
#include <set>
#define _overload3(_1,_2,_3,name,...) name
#define _rep(i,n) repi(i,0,n)
#define repi(i,a,b) for(ll i=ll(a);i<ll(b);++i)
#define rep(...) _overload3(__VA_ARGS__,repi,_rep,)(__VA_ARGS__)
#define all(x) (x).begin(),(x).end()
#define PRINT(V) cout << V << "\n"
#define SORT(V) sort((V).begin(),(V).end())
#define RSORT(V) sort((V).rbegin(), (V).rend())
using namespace std;
using ll = long long;
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
template<typename T>
vector<T> table(int n, T v) { return vector<T>(n, v); }

template <class... Args>
auto table(int n, Args... args) {
    auto val = table(args...);
    return vector<decltype(val)>(n, move(val));
}
const ll INF = (1ll<<31)-1;
const ll MOD = 1000000007;
typedef pair<ll,ll> P;
const ll MAX = 200005;

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    ll n,m;
    cin >> n >> m;
    if (n == 1 && m == 1) PRINT(1);
    else if (n == 1) PRINT(m-2);
    else if (m == 1) PRINT(n-2);
    else PRINT((m-2)*(n-2));
}


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

#define pb push_back
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define forn(i, n) for (int i = 0; i < (int)(n); ++i)
#define for1(i, n) for (int i = 1; i <= (int)(n); ++i)
#define ford(i, n) for (int i = (int)(n) - 1; i >= 0; --i)
#define fore(i, a, b) for (int i = (int)(a); i <= (int)(b); ++i)

using namespace std;

typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<pii> vpi;
typedef vector<vi> vvi;
typedef long long ll;
typedef vector<ll> vll;
typedef vector<vll> vvll;
typedef pair<ll, ll> pll;
typedef long double ld;

template<class T> bool uin(T &a, T b) { return a > b ? (a = b, true) : false; }
template<class T> bool uax(T &a, T b) { return a < b ? (a = b, true) : false; }

int main() {
	int n, m; scanf("%d%d", &n, &m);
	int t = (1<<n);
	vll dp(t, -1);
	dp[0] = 0;
	forn(i, m) {
		int a, b; scanf("%d%d", &a, &b);
		int swit = 0;
		forn(j, b) {
			int input; scanf("%d", &input);
			swit |= (1 << (input - 1));
		}
		int s = (1<<n);
		while(s--) {
			if(dp[s] == -1)
				continue;
			if(dp[s|swit] < 0 || dp[s|swit] > dp[s] + a)
				dp[s|swit] = dp[s] + a;
		}
	}                            
	printf("%lld", dp[(1<<n) - 1]); 
	return 0;
}              	

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

namespace D
{
    public class Program
    {
        static void Main(string[] args)
        {
            var sw = new StreamWriter(Console.OpenStandardOutput()) { AutoFlush = false };
            Console.SetOut(sw);
            Solve();
            Console.Out.Flush();
        }

        public static void Solve()
        {
            var hw = Console.ReadLine().Trim().Split(' ').Select(int.Parse).ToArray();
            var h = hw[0];
            var w = hw[1];
            var grid = new int[h][];
            for (var i = 0; i < grid.Length; i++)
            {
                grid[i] = Console.ReadLine().Trim().Split(' ').Select(int.Parse).ToArray();
            }
            var answer = new Queue<string>();
            for (var y = 0; y < h; y++)
            {
                for (var x = 0; x < w; x++)
                {
                    if (grid[y][x] % 2 == 1)
                    {
                        if (x + 1 < w)
                        {
                            grid[y][x]--;
                            grid[y][x + 1]++;
                            answer.Enqueue($"{y + 1} {x + 1} {y + 1} {x + 2}");
                        }
                        else if (y + 1 < h)
                        {
                            grid[y][x]--;
                            grid[y + 1][x]++;
                            answer.Enqueue($"{y + 1} {x + 1} {y + 2} {x + 1}");
                        }
                    }
                }
            }
            Console.WriteLine(answer.Count());
            while (answer.Any())
            {
                Console.WriteLine(answer.Dequeue());
            }
        }
    }
}


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

int main(void){
	int m, f, r;
	while(cin >> m >> f >> r){
		if(m == -1 && f == -1 && r == -1) break;

		if(m == -1 || f == -1) printf("F\n");
		else if(m + f >= 80) cout << "A\n";
		else if(m + f < 80 && m+f >= 65) cout << "B\n";
		else if(m + f < 65 && m+f >= 50) cout << "C\n";
		else if(m + f < 50 && m+f >= 30){
			if(r >= 50) cout << "C\n";
			else cout << "D\n";
		}else if(m + f < 30) cout << "F\n";

	}

	return 0;
}

Measured memory_bytes: 1124
#include <iostream>
#include <string>
#include <iterator>
#include <unordered_set>
#include <unordered_map>
#include <algorithm>
#include <sstream> 
#include <vector>
#include <cmath>
#include <map>
#include <set>
#include <queue>
#include <iomanip>
#include <functional>
#pragma GCC optimize("O3")
using namespace std;
#define fast ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0)
#define ll long long
#define sp system("pause");
#define MOD 998244353 
#define mxN 2005
#define MXINT 1e9+5
void solve()
{
	ll n;
	cin >> n;
	string s;
	cin >> s;

	unordered_set<int> r, g, b;
	for (int i = 0; i < n; i++)
	{
		if (s[i] == 'R')
			r.insert(i);
		else if (s[i] == 'G')
			g.insert(i);
		else
			b.insert(i);
	}
	ll ans = 1;
	 ans *= r.size() * g.size() *b.size();
	for (int i : r)
	{
		for (int j : g)
		{
			if ((i + j) % 2 == 0)
			{
				int v = (i + j)/2;
				if (b.find(v) != b.end())
					ans--;
			}
		}
	}
	for (int i : r)
	{
		for (int j : b)
		{
			if ((i + j) % 2 == 0)
			{
				int v = (i + j)/2;
				if (g.find(v) != g.end())
					ans--;
			}
		}
	}
	for (int i : b)
	{
		for (int j : g)
		{
			if ((i + j) % 2 == 0)
			{
				int v = (i + j)/2;
				if (r.find(v) != r.end())
					ans--;
			}
		}
	}

	cout << ans;
}
int main()
{
	fast;
	solve();
	
	return 0;
}



Measured memory_bytes: 3724
import java.util.*
import java.io.PrintWriter

val pw = PrintWriter(System.out)
val MOD = 1000000007L
val INF = 2147483647
val LINF = 9223372036854775807L

fun main(args: Array<String>){
    solve()
    pw.flush()    
}

fun solve(){
    readLine()
    val p = nextIntList()
    var ans = 0
    var block = 0
    for (i in p.indices) {
        val index = i + 1
        if(p[i] == index){
            block++
        } else {
            ans += (block + 1) / 2
            block = 0
        }
    }
    if(block > 0) ans += (block + 1) / 2

    println(ans)
}


// Print
fun println(v: String){
    pw.println(v)
}
fun print(v: String){
    pw.print(v)
}

// Read
fun next() = readLine()!!
fun nextInt() = next().toInt()
fun nextLong() = next().toLong()
fun nextDouble() = next().toDouble()
fun nextList() = next().split(" ")
fun nextIntList() = next().split(" ").map{ it.toInt() }
fun nextLongList() = next().split(" ").map{ it.toLong() }
fun nextDoubleList() = next().split(" ").map{ it.toDouble() }
fun nextAryln(n: Int) = Array(n){ next() }
fun nextIntAryln(n: Int) = IntArray(n){ nextInt() }
fun nextLongAryln(n: Int) = LongArray(n){ nextLong() }
fun nextDoubleAryln(n: Int) = DoubleArray(n) { nextDouble() }

// Math
fun abs(n: Long) : Long = Math.abs(n)
fun abs(n: Double) : Double = Math.abs(n)
fun max(a: Long = -LINF, b: Long = -LINF, c: Long = -LINF, d: Long = -LINF, e: Long = -LINF): Long = listOf(a, b, c, d, e).max()!!.toLong()
fun min(a: Long = LINF, b: Long = LINF, c: Long = LINF, d: Long = LINF, e: Long = LINF): Long = listOf(a, b, c, d, e).min()!!.toLong()
fun prime(from: Long, to: Long = from) : List<Long>{
    return (from..to).filter{ i ->
        val max = Math.sqrt(i.toDouble()).toLong()
        (2..max).all{ j -> i % j != 0L}
    }
}
fun gcd(a: Long, b: Long) : Long = if(a % b == 0L) b else gcd(b, (a % b))
fun lcm(a: Long, b: Long) : Long = a / gcd(a, b) * b
fun modpow(a: Long, n: Long, p:Long = MOD) : Long {
    var res = 1L
    var ar = a
    var nr = n
    while(nr > 0){
        if((nr and 1) == 1L) res = res * ar % p
        ar = ar * ar % p
        nr = nr shr 1
    }
    return res
}
fun modinv(a: Long, p: Long = MOD) : Long = modpow(a, p - 2, p)
fun ncr(n: Long, r: Long) : Long {
    var a = 1L
    var b = 1L
    for (i in 1..r) {
        a = a * (n + 1 - i) % MOD
        b = b * i % MOD
    }
    return modinv(b, MOD) * a % MOD
}


Measured memory_bytes: 49952
from heapq import heappop,heappush
def main():
    N = int(input())
    S = input()
    W = []
    R = []
    ans = 0
    for i,s in enumerate(S):
        if s == 'W':
            heappush(W,i)
        else:
            heappush(R,-i)
    while (W and R):
        l = heappop(W)#小さい方から
        r = -heappop(R)#大きい方から
        if l < r:
            ans += 1#白が赤より左にあれば入れ替える
            heappush(W,r)
            heappush(R,-l)

        else:
            break#そうでなければ終了
    print(ans)



if __name__ == "__main__":
    main()

Measured memory_bytes: 17464
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<math.h>
 
#define sl(x) scanf("%ld", &x)
#define ss(x) scanf("%s", x)
#define pl(x) printf("%ld\n", x)
#define ps(x) printf("%s\n", x)
 
#define INF 100000000000
#define MOD 1000000007
 
#define MIN(a,b) (((a)<(b))?(a):(b))
#define MAX(a,b) (((a)>(b))?(a):(b))

int main() {
	long x, y;
	long ans = 0;
	
	sl(x); sl(y);
	if(x < y && x > 0 && y > 0) {
		ans = y - x;
	} else if(labs(x) < labs(y)) {
		if(x < 0) {
			x *= -1;
			ans++;
		}
		ans += labs(labs(y) - labs(x));
		x += labs(labs(y) - labs(x));
		if(x != y) ans++;
	} else {
		if(x > 0) {
			x *= -1;
			ans++;
		}
		ans += labs(labs(y) - labs(x));
		x += labs(labs(y) - labs(x));
		if(x != y) ans++;
	}
	
	pl(ans);
	
	return 0;
}

Measured memory_bytes: 128
#pragma GCC optimize("O3")

#include <bits/stdc++.h>

typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
#define F first
#define S second
#define pii pair<int,int>
#define pll pair<ll, ll>
#define vi vector<int>
#define vll vector<ll>
#define vii vector<pii>
#define read(FILE)  freopen(FILE, "r", stdin);
#define out(FILE) freopen(FILE, "w", stdout);
#define clr(x, y) memset(x,y,sizeof(x));
#define IO ios_base::sync_with_stdio(0);cin.tie(0); cout.tie(0);
#define all(x) x.begin(),x.end()
#define rep(i, m, n) for(int i=m ; i<n ; i++)
#define forr(i, m, n) for(int i=m ; i<=n ; i++)
#define endl '\n'
#define pb push_back
#define re return
const int N = 1e3 + 5;
const ll OO = 1e9 + 7;
using namespace std;

int main() {
    IO;
    ll n,m,sum=0,a[105]; cin>>n>>m;
    rep(i,0,n){
        cin>>a[i];
        sum+=a[i];
        a[i]*=(4*m);
    }
    ll cnt=0;
    rep(i,0,n){
        if(a[i]<sum)
            continue;
        cnt++;
    }
    if(cnt>=m)
        cout<<"Yes";
    else
        cout<<"No";


}


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

struct Query {
	Int q, x, s, t;
	Query(){}
};

int main() {
	Int n, q, l, r;
	cin >> n >> q >> l >> r;
	vector<Int> a(n);
	for(auto& x : a) cin >> x;
	sort(a.begin(), a.end());

	vector<Query> query(q);
	for(auto& x : query) {
		cin >> x.q >> x.x >> x.s >> x.t;
	}

	auto sim = [&](Int a) {
		for(auto& x : query) {
			if (x.q == 1) {
				if (a < x.x) continue;
				a += x.s;
				a *= x.t;
			} else {
				if (a > x.x) continue;
				a -= x.s;
				bool neg = (a < 0);
				a = abs(a);
				a /= x.t;
				if (neg) a = -a;
			}
		}
		return a;
	};

	Int lx, rx;
	// finally no less than l (max),
	//     and no more than r (min)
	{
		Int ok = n, ng = -1;
		while (ok - ng > 1) {
			Int mid = (ok + ng) / 2;
			(sim(a[mid]) >= l ? ok : ng) = mid;
		}
		lx = ok;
	}
	if (lx == n) {
		cout << 0 << endl;
		return 0;
	}

	{
		Int ok = -1, ng = n;
		while (ng - ok > 1) {
			Int mid = (ok + ng) / 2;
			(sim(a[mid]) <= r ? ok : ng) = mid;
		}
		rx = ok;
	}
	if (rx == -1) {
		cout << 0 << endl;
		return 0;
	}

	cout << rx - lx + 1 << endl;
	return 0;
}



Measured memory_bytes: 10484
N = int(input())
A = [int(input()) for _ in range(N)]

max1 = 0
max2 = 0

for a in A:
    if a > max1:
        max2 = max1
        max1 = a
    elif a > max2:
        max2 = a

for a in A:
    if a == max1:
        print(max2)
    else:
        print(max1)


Measured memory_bytes: 12520
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

public class Main {

	static List<List<edge>> graph;

	static int[] d;

	public static void main(String[] args) throws IOException {

		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		int n = Integer.parseInt(br.readLine());

		graph = new ArrayList<>();

		d = new int[n];

		for (int i = 0; i < n; i++) {
			String[] node_edge = br.readLine().split(" ");

			int k = Integer.parseInt(node_edge[1]);
			List<edge> node_edges = new ArrayList<>();
			for (int j = 0; j < k; j++) {
				node_edges.add(
						new edge(i, Integer.parseInt(node_edge[2 + j * 2]), Integer.parseInt(node_edge[3 + j * 2])));
			}
			graph.add(node_edges);
		}
		/*
		 * for(int i=0; i<graph.size(); i++){ for(edge e: graph.get(i)){
		 * System.out.println(e.from+""+e.to+""+e.cost); } }
		 */
		bell(0);

		for (int i = 0; i < d.length; i++) {
			System.out.println(i + " " + d[i]);
		}
	}

	static void bell(int sx) {

		Arrays.fill(d, Integer.MAX_VALUE / 2);
		d[sx] = 0;

		while (true) {
			boolean judge = true;
			for (int i = 0; i < graph.size(); i++) {

				List<edge> e = graph.get(i);

				for (edge now_edge : e) {

					int v = now_edge.to;
					int u = now_edge.from;
					int c = now_edge.cost;

					if (d[v] > d[u] + c) {
						d[v] = d[u] + c;

						/*
						 * System.out.println("from"+u+""+"to"+v + ""+"??????"+
						 * d[v]);
						 */
						judge = false;
					}

				}

			}
			if (judge) {
				break;
			}
		}

	}

	static class edge {

		int to;

		int from;

		int cost;

		public edge(int from, int to, int cost) {
			this.from = from;
			this.to = to;
			this.cost = cost;
		}
	}

}

Measured memory_bytes: 27568
import java.util.*
 
fun main(args: Array<String>) {
    val sc = Scanner(System.`in`)
    val a = sc.nextInt()
    val b = sc.nextInt()
 
    if (b >= 0) {
        if (a > 0) {
            println("Positive")
        } else {
            println("Zero")
        }
        return
    }
 
    val diff = Math.abs(b - a)
    if (diff % 2 == 0) {
        println("Negative")
    } else {
        println("Positive")
    }
}

Measured memory_bytes: 31400
#include<bits/stdc++.h>
#define ll long long 
#define pb push_back
#define ff first
#define ss second
#define eb emplace_back
#define vi vector<int>
#define pr pair<int,int>
#define endl "\n"
#define sz(x) (int)(x).size()
#define trace(x) cerr<<#x<<": "<<x<<" "<<endl;
#define all(c) (c).begin(), (c).end()

#define FOR(i,b) for (int i = 0; i < (b); i++)
#define FORR(i,a,b) for (int i = a; i < (b); i++)
#define FORB(i,b) for (int i = (b); i >= (0); i--)
#define FORRB(i,a,b) for (int i = (a);i>= (b); i--)
#define MAXN 3010
const int MOD =  10000007; //1e9 + 7

using namespace std;

int n,arr[MAXN];
ll dp[MAXN][MAXN][2];
bool visited[MAXN][MAXN][2];
ll solve(int i,int j,int flag){
    if(i > j) return 0;
    bool &vis = visited[i][j][flag];
    ll &res = dp[i][j][flag];
    if(vis) return res;
    vis = true;
    if(flag == 1){
        if(i == j ) res = arr[i] + solve(i+1,j,0);
        else{
            res = max(arr[i] + solve(i+1,j,0) , arr[j] + solve(i,j-1,0));
        }
    }
    else {
        if(i == j) res = -arr[i] + solve(i+1,j,1);
        else res = min(-arr[i] + solve(i+1,j,1), -arr[j] + solve(i,j-1,1));
    }
    return res ;
}
int main(){
    ios_base::sync_with_stdio(false);
    
    cin.tie(NULL);
    cout.tie(NULL);

    //freopen("addin.txt","r",stdin);
    //freopen("addout.txt","w",stdout);
    cin >> n;
    for(int i = 0;i < n;i++) cin >> arr[i];
    cout<<solve(0,n-1,1)<<endl;
    
    return 0;
}

Measured memory_bytes: 158336
use std::io::{stdin, Read, StdinLock};
use std::str::FromStr;

#[allow(dead_code)]
struct Scanner<'a> {
    cin: StdinLock<'a>,
}
#[allow(dead_code)]
impl<'a> Scanner<'a> {
    fn new(cin: StdinLock<'a>) -> Scanner<'a> {
        Scanner { cin: cin }
    }

    fn read<T: FromStr>(&mut self) -> Option<T> {
        let token = self.cin.by_ref().bytes().map(|c| c.unwrap() as char)
            .skip_while(|c| c.is_whitespace())
            .take_while(|c| !c.is_whitespace())
            .collect::<String>();
        token.parse::<T>().ok()
    }

    fn input<T: FromStr>(&mut self) -> T {
        self.read().unwrap()
    }
}

fn main() {
    let cin = stdin();
    let cin = cin.lock();
    let mut sc = Scanner::new(cin);

    let (a, b, x): (i64, i64, i64) = (sc.input(), sc.input(), sc.input());

    let num_a = if a == 0 { 0 } else { (a - 1) / x + 1 };
    let num_b = b / x + 1;

    println!("{}", num_b - num_a);

}


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

using namespace std;
using ll=int64_t;
using pii = pair<int, int>;
using pli = pair<ll, int>;
using mii = map<int, int>;
using vi=vector<int>;
using vii=vector<vi>;
using vl=vector<ll>;
using vll=vector<vl>;
using tpi=tuple<int, int, int>;

using vqi=vector <queue<int>>;


int main() {
    int a, b, c;
    cin >> a >> b >> c;
    if (a + b + c >= 22) {
        cout << "bust" << endl;

    } else {
        cout << "win" << endl;
    }
    return 0;
}


Measured memory_bytes: 256
import sys
stdin = sys.stdin
 
sys.setrecursionlimit(10**5) 
 
def li(): return map(int, stdin.readline().split())
def li_(): return map(lambda x: int(x)-1, stdin.readline().split())
def lf(): return map(float, stdin.readline().split())
def ls(): return stdin.readline().split()
def ns(): return stdin.readline().rstrip()
def lc(): return list(ns())
def ni(): return int(stdin.readline())
def nf(): return float(stdin.readline())
 
n = ni()
xyh = []
for _ in range(n):
    xyh.append(tuple(list(li())))

def search_cent(xyh:list):    
    xmax ,ymax, hmax = -1, -1, -1
    for x,y,h in xyh:
        if h > hmax:
            xmax = x
            ymax = y
            hmax = h
            
    for x_cent in range(101):
        for y_cent in range(101):
            h_cent = hmax + abs(xmax-x_cent) + abs(ymax-y_cent)
            
            # 矛盾チェック
            is_cent = True
            for x,y,h in xyh:
                hi = max(0, h_cent - abs(x-x_cent) - abs(y-y_cent))
                
                if hi != h:
                    is_cent = False
                    break

            if is_cent:
                return x_cent, y_cent, h_cent
        
xc, yc, hc = search_cent(xyh)
print(xc,yc,hc)

Measured memory_bytes: 3188
x1,y1,x2,y2 = gets.split.map(&:to_i)
x3 = x2 + y1 - y2
y3 = y2 - x1 + x2
x4 = x3 + y2 - y3
y4 = y3 - x2 + x3

puts [x3,y3,x4,y4]*' '


Measured memory_bytes: 3836
import collections
n = int(raw_input())
ais = map(int,raw_input().split())
cc = collections.Counter(ais)
s = {ai:True for ai in ais}
m = max(ais)
for a in cc:
	c = a if cc[a] > 1 else 2 * a
	while(c <= m):
		if a in s: s[c] = False
		c+= a
count = 0
for ai in s:
	if s[ai]:
		count +=1

print count

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

void swap(int& x, int& y);

void swap(int& x, int& y)
{
    int temp = x;
    x = y;
    y = temp;
}

int main(void){
    vector<int> Small;
    vector<int> Big;
    int x, y;
    
    while(1){
        std::cin >> x;
        std::cin >> y;
        if(x == 0 && y == 0)    break;
        
        if(x > y)   swap(x, y);
        
        Small.push_back(x);
        Big.push_back(y);
    }
    
    for(int i = 0; i < Small.size(); i++){
        std::cout << Small[i] << " " << Big[i] << std::endl;
    }
    
}

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

using namespace std;
using ll = long long;
using pint = pair<int, int>;

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

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

	vector<int> list;
	int no = 1;
	int ans = 0;
	for (int i = 0; i < N; ++i) {
		if (no != a[i]) {
			ans++;
		}
		else {
			no++;
		}
	}

	if (ans == N) {
		ans = -1;
	}

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

Measured memory_bytes: 4048
#include <algorithm>
#include <iostream>
#include <vector>
#include <map>
using namespace std;
typedef long long ll;

const int MAXN = 1e5 + 10;
vector<pair<int, int> > edg;
pair<ll, int> d[MAXN];
vector<int> Mat[MAXN];
int n, cnt[MAXN];
map<ll, int> mp;
bool se[MAXN];
ll dist, dt;
int num;

void dfs(int v, int di) {
	se[v] = 1, num++;
	dist += di;
	for (int i = 0; i < Mat[v].size(); i++)
		if (!se[Mat[v][i]])
			dfs(Mat[v][i], di + 1);
}

int main() {
	cin >> n;
	for (int i = 1; i <= n; i++) {
		cin >> d[i - 1].first;
		if (i == 1)
			dt = d[i - 1].first;
		mp[d[i - 1].first] = i;
		d[i - 1].second = i;
		cnt[i] = 1;
	}
	sort(d, d + n);
	reverse(d, d + n);
	for (int i = 0; i < n - 1; i++) {
		int k = cnt[d[i].second];
		if (2 * k > n || mp.find(d[i].first + k - (n - k)) == mp.end())
			return cout << -1, 0;
		cnt[mp[d[i].first + k - (n - k)]] += k;
		edg.push_back({d[i].second, mp[d[i].first + k - (n - k)]});
		Mat[mp[d[i].first + k - (n - k)]].push_back(d[i].second);
		Mat[d[i].second].push_back(mp[d[i].first + k - (n - k)]);
	}
	dfs(1, 0);
	if (dist == dt && num == n && edg.size() == n - 1) {
		for (int i = 0; i < edg.size(); i++)
			cout << edg[i].first << ' ' << edg[i].second << endl;
		return 0;
	}
	cout << -1;
}

Measured memory_bytes: 21748
#pragma comment (linker, "/STACK:256000000")
#define  _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <algorithm>
#include <utility>
#include <functional>
#include <cstring>
#include <queue>
#include <stack>
#include <math.h>
#include <iterator>
#include <vector>
#include <string>
#include <set>
#include <math.h>
#include <iostream>
#include <random>
#include<map>
#include <iomanip>
#include <time.h>
#include <stdlib.h>
#include <list>
#include <typeinfo>
#include <list>
#include <set>
#include <cassert>
#include<fstream>
#include <unordered_map>
#include <cstdlib>
#include <complex>
#include <cctype>
#include <bitset>
using namespace std;
typedef string::const_iterator State;
#define Ma_PI 3.141592653589793
#define eps 1e-5
#define LONG_INF 2000000000000000000LL
#define GOLD 1.61803398874989484820458
#define MAX_MOD 1000000007LL
#define GYAKU 500000004LL
#define MOD 998244353LL
#define seg_size 262144
#define pb push_back
#define mp make_pair
typedef long long ll;
#define REP(a,b) for(long long a = 0;a < b;++a)
#define ALL(x) (x).begin(),(x).end()
void init() {
    iostream::sync_with_stdio(false);
    cout << fixed << setprecision(20);
}

long long gcd(long long a, long long b) {
    if (b == 0) return a;
    return gcd(b, a % b);
}
void solve() {
    long long n;
    cin >> n;
    if (n % 2 == 1) {
        cout << 0 << endl;
        return;
    }
    long long cnt_two = 0;
    for (long long i = 2; i <= n; i *= 2LL) {
        cnt_two += (n / i);
    }
    long long cnt_five = 0;
    while (n >= 2 && n % 5 != 0) {
        n -= 2;
    }
    if (n < 2) {
        cout << 0 << endl;
        return;
    }
    for (long long i = 10; i <= n; i *= 5LL) {
        cnt_five += (n / i);
    }
    cout << min(cnt_two, cnt_five) << endl;
}

int main() {
    init();
    solve();
}

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

int main() {
  // Aは持っている1円玉の枚数、Nは支払いたい金額
  int A, N;

  cin >> N >> A;
  
  if (N < 1 || N > 10000) {
    cout << "error" << endl;
  }  
  else if (A < 0 || A > 1000) {
    cout << "error" << endl;
  }
  else if (N - (N / 500) * 500 <= A) {
    cout << "Yes" << endl;
  }
  else {
    cout << "No" << endl;
  }
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define ALL(obj) begin(obj), end(obj)
using namespace std;
template <class T>
vector<T> make_vec(size_t a) {
    return vector<T>(a);
}
template <class T, class... Ts>
auto make_vec(size_t a, Ts... ts) {
    return vector<decltype(make_vec<T>(ts...))>(a, make_vec<T>(ts...));
}
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;
}

using ll = long long;
using ull = unsigned long long;
const int INF = 2100100100;
const int MOD = 1e9 + 7;

/*  divisor(n)
    入力：整数 n
    出力：nのすべての約数
    計算量：O(√n)
*/
vector<long long> divisor(long long n) {
    vector<long long> ret;
    for (long long i = 1; i * i <= n; i++) {
        if (n % i == 0) {
            ret.push_back(i);
            if (i * i != n) ret.push_back(n / i);
        }
    }
    sort(ret.begin(), ret.end());
    return ret;
}

int N, M, K, Q, W, H, L, R, C, A, B, D;
string S;
vector<vector<int>> X;

int main() {
    cin >> N >> K;
    vector<ll> a(N), sum(N + 1), plu(N + 1), sub(N + 1);
    for (int i = 0; i < N; i++) {
        cin >> a.at(i);
        sum[i + 1] = sum[i] + a[i];
        plu[i + 1] = plu[i] + max(a[i], 0LL);
        sub[i + 1] = sub[i] + min(a[i], 0LL);
    }

    ll ans = sum[N];
    for (int i = 0; i <= N - K; i++) {  // white
        /* code */
        chmax(ans, plu[N] - (plu[i + K] - plu[i]));
    }
    for (int i = 0; i <= N - K; i++) {  // black
        /* code */
        chmax(ans, plu[N] + (sub[i + K] - sub[i]));
    }
    cout << ans << endl;

    return 0;
}


Measured memory_bytes: 3328
#include <iostream>
#include<string>
#include<string.h>
#include<vector>
#include<algorithm>
#include<cmath>
#include<iomanip>
#include<climits>
using namespace std;

int main()
{
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    string x;
    cin>>x;
    string x1=""; x1+=x.at(0);x1+=x.at(1);
    string x2=""; x2+=x.at(2);x2+=x.at(3);
    int a = stoi(x1);
    int b = stoi(x2);
    if(a<=12&&a>0&&(b>12||b==0)){
        cout<<"MMYY"<<endl;
    }else if(b<=12&&b>0&&(a>12||a==0)){
        cout<<"YYMM"<<endl;
    }else if(a==0&&b==0||(a>12&&b>12)||(a==0&&b>12)||b==0&&a>12){
        cout<<"NA"<<endl;
    }
    else{
        cout<<"AMBIGUOUS"<<endl;
    }
    return 0;
}

Measured memory_bytes: 256
// dile a la jardinera que traigo flores

#include <bits/stdc++.h>
#define ff first
#define ss second
#define pb push_back
#define sz(x) int(x.size())
#define all(v) (v).begin(),(v).end()
#define trace(x) cout << #x << " = " << x << endl
#define fastio ios_base::sync_with_stdio(0);cin.tie(0)
#define FER(i,a,b) for(int i = int(a); i < int(b); ++i)
#define IFR(i,a,b) for(int i = int(a); i >= int(b); i--)
using namespace std;
typedef long long ll;
typedef pair<int,int> ii;


int main(){	
	fastio;
	int n,m;cin>>n>>m;
	vector<int>d;
	for(int i=1;i*i<=m;i++)if(m%i==0){
		d.pb(i);
		d.pb(m/i);
	}
	int mx=0;
	for(int val: d)
		if(m/val>=n)mx=max(mx,val);
	cout<<mx<<endl;

	return 0;
}


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

int64_t attack(int64_t hp) {
  if (hp == 1) {
    return 1;
  }
  return 1 + 2*attack(hp/2);
}
 
int main() {
  int64_t h, min;
  cin >> h;
  min = attack(h);
  cout << min << endl;
}

Measured memory_bytes: 3572
#include <bits/stdc++.h>
#define ll long long
#define int long long
#define MOD 1000000007
#define mod 998244353
#define ff first
#define ss second
#define pb push_back
#define vi vector<int>
#define si set<int>
#define pii pair<int,int>
#define vii vector<pii>
#define vvi vector<vi>
#define vvii vector<vii>
#define vsi vector<si>
#define endl "\n"
#define rep(i, n) for(i = 0; i < (n); i++)
#define rrep(i, n) for(i = (n - 1); i >= 0; i--)
#define MAXN 200001
#define read(arr,n) for(int i=0;i<n;i++)cin>>arr[i]
using namespace std;
void solve1();

int power(int x, unsigned int y, int p)
{
    int res = 1;
    x = x % p;
    if (x == 0) return 0;
    while (y > 0)
    {
        if (y & 1)res = (res*x) % p;
        y = y>>1;
        x = (x*x) % p;
    }
    return res;
}
bool comp(pii a,pii b)
{
    return a.ss<b.ss;
}
void solve()
{
    int t;cin>>t;
    while(t--)
    {
        solve1();
    }
}
signed main()
{
    std::ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
    solve1();
    return 0;
}
void solve1()
{
    int n;cin>>n;int a,b;
    n--;int ans=0;
    for(int i=1;i<=n;i++)
    {
        ans+=n/i;
    }
    cout<<ans<<endl;
}




Measured memory_bytes: 3652
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Collections;
import java.util.StringTokenizer;

public class Main {
	static double dp[][] = new double[3001][3001];

	public static void main(String[] args) {
		FastScanner in = new FastScanner();
		int n = in.nextInt();
		double a[] = new double[n + 1];
		for (int i = 1; i <= n; i++) {
			a[i] = in.nextDouble();
		}
		for (int i = 0; i < 3001; i++) {
			for (int j = 0; j < 3001; j++) {
				dp[i][j] = -1;
			}
		}
		System.out.println(coins(a, n, (n + 1) / 2));

	}

	public static double coins(double a[], int i, int X) {
		if (X == 0)
			return 1;
		if (i == 0)
			return 0;
		if (dp[i][X] > -0.9)
			return dp[i][X];
		double val = a[i] * (coins(a, i - 1, X - 1)) + (1 - a[i]) * (coins(a, i - 1, X));
		dp[i][X] = val;
		return val;
	}

	static void sort(int[] a) {
		ArrayList<Integer> l = new ArrayList<>();
		for (int i : a)
			l.add(i);
		Collections.sort(l);
		for (int i = 0; i < a.length; i++)
			a[i] = l.get(i);
	}

	static class FastScanner {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		StringTokenizer st = new StringTokenizer("");

		String next() {
			while (!st.hasMoreTokens())
				try {
					st = new StringTokenizer(br.readLine());
				} catch (IOException e) {
					e.printStackTrace();
				}
			return st.nextToken();
		}

		int nextInt() {
			return Integer.parseInt(next());
		}

		int[] readArray(int n) {
			int[] a = new int[n];
			for (int i = 0; i < n; i++)
				a[i] = nextInt();
			return a;
		}

		long nextLong() {
			return Long.parseLong(next());
		}

		double nextDouble() {
			return Double.parseDouble(next());
		}
	}

}


Measured memory_bytes: 108140
#include <bits/stdc++.h>
#define repp(i,l,r)for(long long i=(l);i<(r);i++)
#define rep(i,n) for (long long i = 0; i < (n); ++i)
#define per(i,n) for (long long i = (n); i >= 0; --i)
const int INF = 2147483647;//int max
const long long int MOD = 1000000007;
using namespace std;
using ll = long long;
using P = pair<int,int>;
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; }


vector<pair<long long, long long> > prime_factorize(long long N) {
    vector<pair<long long, long long> > res;
    for (long long a = 2; a * a <= N; ++a) {
        if (N % a != 0) continue;
        long long ex = 0; // 指数

        // 割れる限り割り続ける
        while (N % a == 0) {
            ++ex;
            N /= a;
        }

        // その結果を push
        res.push_back({a, ex});
    }

    // 最後に残った数について
    if (N != 1) res.push_back({N, 1});
    return res;
}

//ミョ(-ω- ?)
int main() {
    ll n;
    cin >> n;
    auto v = prime_factorize(n);
    ll res = 0;
    for(auto a : v){
        ll cnt = 0;
        ll base = 1;
        while(a.second >= base){
            a.second -= base;
            base++;
            cnt++;
        }
        res += cnt;
    }
    cout << res << endl;
    return 0;
}

Measured memory_bytes: 3636
#include<bits/stdc++.h>
#define rep(i,a,b) for(int i=(a);i<=(b);i++)
#define per(i,a,b) for(int i=(a);i>=(b);i--)
#define forE(i,x) for(int i=head[x];i!=-1;i=ne[i])
using namespace std;
typedef long long i64;
typedef unsigned long long u64;
typedef unsigned u32;
typedef pair<int,int> pin;
#define mk(a,b) make_pair(a,b)
#define lowbit(x) ((x)&(-(x)))
#define sqr(a) ((a)*(a))
#define clr(a) (memset((a),0,sizeof(a)))
#define ls ((x)<<1)
#define rs (((x)<<1)|1)
#define mid (((l)+(r))>>1)
#define pb push_back
#define w1 first
#define w2 second
inline void read(int &x){
	x=0;int f=1;char ch=getchar();
	while(ch<'0'||ch>'9'){if(ch=='-')f=-1;ch=getchar();}
	while(ch>='0'&&ch<='9'){x=x*10+ch-'0';ch=getchar();}
	x*=f;
}
inline void judge(){
	freopen("in.txt","r",stdin);
	freopen("out.txt","w",stdout);
}
/******************************head*******************************/
const int maxn=200005;
namespace seg{
	int l[maxn<<3],r[maxn<<3];
	i64 maxi1[maxn<<3],maxi2[maxn<<3];
	inline void update(int x){
		maxi1[x]=min(maxi1[ls],maxi1[rs]);
		maxi2[x]=min(maxi2[ls],maxi2[rs]);
	}
	inline void build(int x,int lq,int rq){
		l[x]=lq;r[x]=rq;
		if(l[x]==r[x]){
			maxi1[x]=maxi2[x]=1e18;
			return;
		}
		int md=(lq+rq)>>1;
		build(ls,lq,md);
		build(rs,md+1,rq);
		update(x);
	}
	inline void modify1(int x,int pos,i64 v){
		if(l[x]==r[x]){
			maxi1[x]=min(maxi1[x],v);
			return;
		}int md=(l[x]+r[x])>>1;
		if(pos<=md)
			modify1(ls,pos,v);
		else
			modify1(rs,pos,v);
		update(x);
	}
	inline void modify2(int x,int pos,i64 v){
		if(l[x]==r[x]){
			maxi2[x]=min(maxi2[x],v);
			return;
		}int md=(l[x]+r[x])>>1;
		if(pos<=md)
			modify2(ls,pos,v);
		else
			modify2(rs,pos,v);
		update(x);
	}
	inline i64 query1(int x,int lq,int rq){
		if(lq<=l[x]&&r[x]<=rq)return maxi1[x];
		i64 res=1e18;
		int md=(l[x]+r[x])>>1;
		if(lq<=md)res=min(res,query1(ls,lq,rq));
		if(rq> md)res=min(res,query1(rs,lq,rq));
		return res;
	}
	inline i64 query2(int x,int lq,int rq){
		if(lq<=l[x]&&r[x]<=rq)return maxi2[x];
		i64 res=1e18;
		int md=(l[x]+r[x])>>1;
		if(lq<=md)res=min(res,query2(ls,lq,rq));
		if(rq> md)res=min(res,query2(rs,lq,rq));
		return res;
	}
}
int n,x[maxn],q,A,B;
i64 sum[maxn],f[maxn];
int main(){
	read(n);read(q);read(A);read(B);
	rep(i,1,q)read(x[i]);
	sum[1]=0;
	rep(i,2,q)sum[i]=sum[i-1]+abs(x[i]-x[i-1]);
	seg::build(1,1,n);i64 ans=1e18;
	ans=min(ans,abs(x[1]-A)+sum[q]);
	ans=min(ans,abs(x[1]-B)+sum[q]);
	seg::modify1(1,A,abs(x[1]-B)-A);
	seg::modify2(1,A,abs(x[1]-B)+A);
	seg::modify1(1,B,abs(x[1]-A)-B);
	seg::modify2(1,B,abs(x[1]-A)+B);
	rep(i,2,q){
		f[i]=sum[i-1]+x[i]+seg::query1(1,1,x[i]);
		f[i]=min(f[i],sum[i-1]+seg::query2(1,x[i]+1,n)-x[i]);
		seg::modify1(1,x[i-1],f[i]-sum[i]-x[i-1]);
		seg::modify2(1,x[i-1],f[i]-sum[i]+x[i-1]);
		ans=min(ans,f[i]+sum[q]-sum[i]);
	}
	printf("%lld\n",ans);
	return 0;
}


Measured memory_bytes: 22784
#include<bits/stdc++.h>
using namespace std;
char s1[3005],s2[3005],ans[3005];
int n,m,f[3005][3005];
pair<int,int> last[3005][3005];
int a,b;
int main()
{
	scanf("%s%s",s1+1,s2+1);
	n=strlen(s1+1),m=strlen(s2+1);
	f[0][0]=0;
	for(int i=1;i<=n;i++)
	{
		for(int j=1;j<=m;j++)
		{
			if(s1[i]==s2[j]) 
			{
				f[i][j]=f[i-1][j-1]+1;
				if(f[i][j]>f[a][b]) a=i,b=j;
				last[i][j]=make_pair(i,j);
			}
			else if(f[i-1][j]>f[i][j-1]) f[i][j]=f[i-1][j],last[i][j]=last[i-1][j];
			else f[i][j]=f[i][j-1],last[i][j]=last[i][j-1];
		}
	}
	int x=a,y=b;
	for(int i=f[a][b];i>=1;i--)
	{
		ans[i]=s1[x];
		int nx=last[x-1][y-1].first,ny=last[x-1][y-1].second;
		x=nx,y=ny;
	}
	printf("%s",ans+1);
	return 0;
}

Measured memory_bytes: 105984
#include <iostream>
#include <algorithm>
#include <utility>
#include <string>
#include <vector>
#include <set>
#include <stack>
#include <queue>
#include <map>
#include <math.h>
#include <string.h>
#include <iomanip>
#include <numeric>
#include <cstdlib>
#include <cstdint>
#include <cmath>
#include <functional>
#include <limits>
#include <cassert>

using namespace std;

/* template */

using ll = long long;

void debug_out() { std::cout << std::endl; }
 
template <typename Head, typename... Tail>
void debug_out(Head H, Tail... T) {
  cout << H << " ";
  debug_out(T...);
}

#ifdef LOCAL
#define debug(...) cout << "debug: "; debug_out(__VA_ARGS__)
#else
#define debug(...) 
#endif

#define rep(i, a, n) for (int i = (int)(a); i < (int)(n); i++)
#define rrep(i, a, n) for (int i = ((int)(n-1)); i >= (int)(a); i--)
#define Rep(i, a, n) for (long long i = (long long)(a); i< (long long)(n); i++)
#define RRep(i, a, n) for (long long i = ((long long)(n-1ll)); i>=(long long)(a); i--)
#define all(v) (v).begin(),(v).end()
#define rall(v) (v).rbegin(),(v).rend()

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

struct Edge{
    int to;
    ll weight;
    Edge(int t, ll w) : to(t), weight(w){ }
};

struct edge{
    int from;
    int to;
    ll weight;
    edge(int f,int t,ll w) : from(f), to(t), weight(w){ }
};


using Graph = vector<vector<Edge>>;
using graph = vector<vector<int>>;
using edges = vector<edge>;

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

template <class T>
T lcm(T a, T b){
    return (a*b)/gcd(a,b);
}

bool isPalindrome(string s){
    string t = s;
    reverse(all(t));
    return s==t;
}

constexpr ll LNF = __LONG_LONG_MAX__;

constexpr int INF = 1e9+7;

const double PI=3.14159265358979323846;


vector<int> dx = {-1,0,1,0,-1,1,-1,1};
vector<int> dy = {0,-1,0,1,1,-1,-1,1};

/* template */

int main(){
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    string s; cin >> s;
    int n = s.size();
    vector<int> dp(n+1,0);
    int p = 1;
    reverse(all(s));
    vector<ll> m(2019,0);
    rep(i,0,n){
        dp[i+1] = (dp[i]+(s[i]-'0')*p)%2019;
        p *= 10;
        p %=2019; 
        m[dp[i]]++;
    }
    m[dp[n]]++;
    ll ans = 0;
    rep(i,0,2019){
        ans += (m[i]-1)*m[i]/2;
    }
    cout << ans << endl;
}

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

#define rep(i, n) for (int i = (int)(0); i < (int)(n); ++i)
#define reps(i, n) for (int i = (int)(1); i <= (int)(n); ++i)
#define rrep(i, n) for (int i = ((int)(n)-1); i >= 0; i--)
#define rreps(i, n) for (int i = ((int)(n)); i > 0; i--)
#define irep(i, m, n) for (int i = (int)(m); i < (int)(n); ++i)
#define ireps(i, m, n) for (int i = (int)(m); i <= (int)(n); ++i)
#define FOR(e, c) for (auto &e : c)
#define SORT(v, n) sort(v, v + n);
#define vsort(v) sort(v.begin(), v.end());
#define rvisort(v) sort(v.begin(), v.end(), greater<int>());
#define all(v) v.begin(), v.end()
#define mp(n, m) make_pair(n, m);
#define cout(d) cout<<d<<endl;
#define coutd(d) cout<<std::setprecision(10)<<d<<endl;
#define cinline(n) getline(cin,n);
#define replace_all(s, b, a) replace(s.begin(),s.end(), b, a);
// #define int long long
#define PI (acos(-1))
#define FILL(v, n, x) fill(v, v + n, x);
#define sz(x) int(x.size())

using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>;
using vll = vector<ll>;
using vvll = vector<vll>;
using pii = pair<int, int>;
using ul = unsigned long;

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

ll GCD(ll a, ll b) { return b ? GCD(b, a%b) : a; }
ll LCM(ll a, ll b) { return a / GCD(a, b)* b; }

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

inline bool inside(int y, int x, int H, int W) {
    return (y >= 0 && x >= 0 && y < H && x < W);
}

const int INF = 1e9;
const int MOD = 1e9+7;
const ll LINF = 1e18;

signed main()
{
  cin.tie( 0 ); ios::sync_with_stdio( false );
  int h,w; cin>>h>>w;
  int n; cin>>n;
  chmax(h,w);
  cout<<(n+h-1)/h<<endl;
}

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


class Program
{
    public static long Read()
    {
        return long.Parse(Console.ReadLine());
    }

    public static long[] Reads()
    {
        return Console.ReadLine().Split().Select(long.Parse).ToArray();
    }


    public static void Main()
    {
        var sw = new StreamWriter(Console.OpenStandardOutput()) { AutoFlush = false };
        Console.SetOut(sw);

        var input = Reads();
        var t = input[0];
        var x = input[1];
        Console.WriteLine((double)t / x);


            
        Console.Out.Flush();
    }
}

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

using namespace std;

using ll = long long;

int main(int argc, const char *argv[]) {
  int n;
  cin >> n;
  vector<pair<ll, ll>> vx(n);
  for (int i = 0; i < n; ++i) {
    cin >> vx[i].first;
    vx[i].second = i;
  }

  sort(vx.begin(), vx.end(), greater<pair<ll, ll>>());

  vector<ll> ans(n);
  int mid = n / 2 - 1;
  for (int i = 0; i < n; ++i) {
    if (i <= mid) {
      ans[vx[i].second] = vx[mid + 1].first;
    } else {
      ans[vx[i].second] = vx[mid].first;
    }
  }

  for (int i = 0; i < n; ++i) {
    cout << ans[i] << '\n';
  }

  return 0;
}

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


int main() {
    int a, b;
    cin >> a >> b;
    
    if(a%3==0 || (a+b)%3==0 || b%3==0){
        cout << "Possible" << endl;
    }
    else
        cout << "Impossible" << endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define ADD(a, b) a = (a + ll(b)) % mod
#define MUL(a, b) a = (a * ll(b)) % mod
#define MAX(a, b) a = max(a, b)
#define MIN(a, b) a = min(a, b)
#define rep(i, a, b) for(int i = int(a); i < int(b); i++)
#define rer(i, a, b) for(int i = int(a) - 1; i >= int(b); i--)
#define all(a) (a).begin(), (a).end()
#define sz(v) (int)(v).size()
#define pb push_back
#define sec second
#define fst first
#define debug(fmt, ...) Debug(__LINE__, ":", fmt, ##__VA_ARGS__)
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> pi;
typedef pair<ll, ll> pl;
typedef pair<int, pi> ppi;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<vl> mat;
typedef complex<double> comp;
void Debug() {cerr << '\n'; }
template<class FIRST, class... REST>void Debug(FIRST arg, REST... rest){
	cerr<<arg<<" ";Debug(rest...);}
template<class T>ostream& operator<<(ostream& out,const vector<T>& v) {
	out<<"[";if(!v.empty()){rep(i,0,sz(v)-1)out<<v[i]<<", ";out<<v.back();}out<<"]";return out;}
template<class S, class T>ostream& operator<<(ostream& out,const pair<S, T>& v){
	out<<"("<<v.first<<", "<<v.second<<")";return out;}
const int MAX_N = 500010;
const int MAX_V = 100010;
const double eps = 1e-6;
const ll mod = 1000000007;
const int inf = (1 << 30) - 1;
const ll linf = 1LL << 60;
const double PI = 3.14159265358979323846;
mt19937 rng; //use it by rng() % mod, shuffle(all(vec), rng)
///////////////////////////////////////////////////////////////////////////////////////////////////

string S;

void solve() {
	cin >> S;
	int res = inf;
	for(char al = 'a'; al <= 'z'; al++) {
		vector<pi> vec;
		rep(i, 0, sz(S)) {
			int v = S[i] == al;
			if(i == 0 || vec.back().fst != v) vec.pb(make_pair(v, 1));
			else vec.back().sec++;
		}
		int tmp = 0;
		rep(i, 0, sz(vec)) {
			if(!vec[i].fst) MAX(tmp, vec[i].sec);
		}
		MIN(res, tmp);
	}
	cout << res << "\n";
}

uint32_t rd() {
	uint32_t res;
#ifdef __MINGW32__
	asm volatile("rdrand %0" :"=a"(res) ::"cc");
#else
	res = std::random_device()();
#endif
	return res;
}

int main() {
#ifndef LOCAL
	ios::sync_with_stdio(false);
    cin.tie(0);
#endif
    cout << fixed;
	cout.precision(20);
    cerr << fixed;
	cerr.precision(6);
	rng.seed(rd());
#ifdef LOCAL
	//freopen("in.txt", "wt", stdout); //for tester
	if(!freopen("in.txt", "rt", stdin)) return 1;
#endif	
	solve();
    cerr << "Time: " << 1.0 * clock() / CLOCKS_PER_SEC << " s.\n";
	return 0;
}



Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <set>
#include <algorithm>
#include <fstream>
#include <string>
#include <math.h>
#include <cstdlib>
#include <cstdint>
#include <istream>
#include <sstream>
#include <cctype>
#include <functional>
#include <iomanip>
#define rep(i,N) for(ll i=0;i<N;i++)
#define disp(a) cout << a << endl;
#define PI 3.1415926535897932384626433
//cout << fixed << setprecision(20) << ** << endl;
typedef long long ll;
using namespace std;
double deg2rad(double degree)
{
    return degree * PI / 180.0000000000;
}
int main()
{
	ll N,R=0,B=0;
	string S;
	cin>>N>>S;
	rep(i,N){
		if(S[i]=='R')R++;
		else B++;
	}
	if(R>B)cout<<"Yes"<<endl;
	else cout<<"No"<<endl;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define lp(i,n) for(int i=0;i<n;i++)
#define DEKAI 1000000007
#define INF (1<<28)
#define FDBST int hogehogehoge;cin>>hogehogehoge;

int main(){
	int n,k;
	cin>>n>>k;
	int a[100000];
	int sum=0;
	lp(i,n) {
		cin>>a[i];
		sum+=a[i];
	}
	int high=sum,low=0,it=sum/2;
	lp(i,30){

		int count=0,all=0;
		int stat=0;
		lp(j,n){
			if(a[j]>it){
				stat=1;
				break;
			}
			if(all+a[j]>it){
				count++;
				all=0;
			}
			all+=a[j];
		}
		if(stat==0&&count<k){
			high=it;
			it=((double)(high+low)/2)+0.5;
		}
		else{
			low=it;
			it=(double)(high+low)/2+0.5;
		}
	}
	cout<<it<<endl;
	return 0;
}



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

using namespace std;

typedef long long ll;
typedef pair<ll, ll> P;
typedef pair<int, int> Pi;
typedef vector<ll> Vec;
typedef vector<int> Vi;
typedef vector<string> Vs;
typedef vector<vector<ll>> VV;
typedef vector<vector<int>> VVi;

#define REP(i, a, b) for(ll i=(a); i<(b); i++)
#define PER(i, a, b) for(ll i=(a); i>=(b); i--)
#define rep(i, n) REP(i, 0, n)
#define per(i, n) PER(i, n, 0)
const ll INF=1e16+18;
const ll MAX=100005;
const ll MOD=1000000007;
#define Yes(n) cout << ((n) ? "Yes" : "No") << endl;
#define YES(n) cout << ((n) ? "YES" : "NO") << endl;
#define ALL(v) v.begin(), v.end()
#define pb(x) push_back(x)
#define mp(a, b) make_pair(a,b)
#define Each(a,b) for(auto &a :b)
#define REPM(i, mp) for (auto i = mp.begin(); i != mp.end(); ++i)
#define dbg(x_) cerr << #x_ << ":" << x_ << endl;
#define dbgmap(mp) cerr << #mp << ":"<<endl; for (auto i = mp.begin(); i != mp.end(); ++i) { cerr << i->first <<":"<<i->second << endl;}
#define dbgarr(n,m,arr) rep(i,n){rep(j,m){cerr<<arr[i][j]<<" ";}cerr<<endl;}
#define dbgdp(n,arr) rep(i,n){cerr<<arr[i]<<" ";}cerr<<endl;
#define sum(v) accumulate(ALL(v),0)
#define fi first
#define se second

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

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

// 2 dimentional vector
template<typename T>
ostream &operator<<(ostream &s, const vector<vector<T> > &vv) {
    int len=vv.size();
    for(int i=0; i<len; ++i) {
        s<<vv[i]<<endl;
    }
    return s;
}

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    cout<<std::setprecision(10);

    ll n,h,w;
    cin>>n>>h>>w;
    ll ans=0;
    rep(i,n){
        ll a,b;
        cin>>a>>b;
        if(a>=h&&b>=w)ans++;
    }
    cout<<ans<<endl;
    return  0;
}


Measured memory_bytes: 256
N,M=[int(_) for _ in input().split()]
PS=[input().split() for _ in range(M)]
count=[0]*(N+1)
isac=[0]*(N+1)
for p,s in PS:
 p=int(p)
 if isac[p]==1:
    continue
 if s=='AC':
  isac[p]=1
 else:
  count[p]+=1
wa=0
ac=0
for i in range(N+1):
 if isac[i]==1:
  ac+=1
  wa+=count[i]
print(ac,wa)


Measured memory_bytes: 68568
#include <bits/stdc++.h>
using namespace std;
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n) FOR(i,0,n)
#define ALL(v) begin(v),end(v)
#define fi first
#define se second
template<typename A, typename B> inline bool chmax(A &a, B b) { if (a<b) { a=b; return 1; } return 0; }
template<typename A, typename B> inline bool chmin(A &a, B b) { if (a>b) { a=b; return 1; } return 0; }
using ll = long long;
using pii = pair<int, int>;
constexpr ll INF = 1ll<<30;
constexpr ll longINF = 1ll<<60;
constexpr ll MOD = 1000000007;
constexpr bool debug = 0;
//---------------------------------//

int main() {
	int N;
	string S;
	cin >> N >> S;
	
	int ans = 0;
	REP(i, S.size() - 2) if (S.substr(i, 3) == "ABC") ++ans;
	cout << ans << endl;
	
	return 0;
}


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

int main (){

    string finding;
    int N;
    int finded_num=0;


    cin>>finding>>N;

    for(int i=0;i<N;i++){
        bool flag=false;
        string ring;
        cin >> ring;
        for(int j=0;j<ring.size();j++){
            string check;
            for(int k=0;k<finding.size();k++){
                check+=ring[(j+k)%ring.size()];
            }
            if(check==finding){
                flag=true;
            }
        }
        if(flag==true){
            finded_num++;
        }
    }

    cout<<finded_num<<endl;

    return 0;
}

Measured memory_bytes: 1208