akhauriyash/Code-Regression huggingface dataset:
/*
─────────────────────
───────────████████──
──────────███▄███████
──────────███████████
──────────███████████
──────────██████─────
──────────█████████──
█───────███████──────
██────████████████───
███──██████████──█───
███████████████──────
███████████████──────
─█████████████───────
──███████████────────
────████████─────────
─────███──██─────────
─────██────█─────────
─────█─────█─────────
─────██────██────────
─────────────────────
*/
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/detail/standard_policies.hpp>

#define int long long
#define read(a) int a; cin >> a;
#define readarr(a, n) int a[(n) + 1] = {}; fori(i, 1, (n)) {cin >> a[i];}
#define readmat(a, n, m) int a[n + 1][m + 1] = {}; fori(i, 1, n) {fori(j, 1, m) cin >> a[i][j];}
#define pb push_back
#define fi first
#define se second
#define rz resize
#define fori(i, a, b) for(int i = a; i <= b; i++)
#define ford(i, a, b) for(int i = a; i >= b; i--)
#define sort1(v) sort(v.begin(), v.end()) 
#define endl '\n'

using namespace std;
using namespace __gnu_pbds; 

typedef tree<long long,null_type,less<long long>,rb_tree_tag,tree_order_statistics_node_update> ordered_set;
typedef long long ll;
typedef long double ld;
typedef vector<int> vi;
typedef pair<int, int> pii;
typedef vector<pair <int, int>> vpi;
typedef vector < vector <int> > vvi;

const long long inf2 = (long long)1e18;
const long long mod = (long long)(1e9+7);
const long long inf1 =(long long)(1e6+1);

vvi adj; vi col, par;

void dfs (int cur, int prev = 0)
{
    int j = 1;
    for(int i : adj[cur])
    {
        if(i != prev)
        {
            if(j == col[cur]) j++;
            col[i] = j;
            j++; par[i] = cur;
            dfs(i, cur);
        }
    }
}
 
signed main() 
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);

    read(n);
    int x, y, k = 0;
    adj.rz(n+1); col.rz(n+1); par.rz(n+1);

    vpi edge;
    fori(i, 1, n-1)
    {
        cin >> x >> y;
        adj[x].pb(y);
        adj[y].pb(x);
        edge.pb({x, y});
    }

    fori(i, 1, n) k = max(k, (ll)adj[i].size());
    dfs(1);

    cout << k << endl;
    for(auto i : edge)
    {
        x = i.fi; y = i.se;
        if(par[x] == y) cout << col[x] << endl;
        else cout << col[y] << endl;
    }    
    return 0;
}

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

using namespace std;

long long calbubble(string s){
    long long ret=0,ycnt=0;
    for (int i = s.size()-1; i >= 0; --i) {
        if(s[i]=='y')++ycnt;
        else ret+=ycnt;
    }
    return ret;
}

int main(){
    string s;
    cin>>s;
    string t="";
    long long ans=0;
    bool foo=false;
    for (int i = 0; i < s.size(); ++i) {
        if(s[i]=='A')t+="x";
        else if(s[i]=='B'){
            if(i==s.size()-1)foo=true;
            else if(s[i+1]=='C'){
                t+="y";++i;
            }
            else foo=true;
        }
        else foo=true;
        if(foo){
            ans+=calbubble(t);
            t="";
            foo=false;
        }
    }
    ans+=calbubble(t);
    cout<<ans<<endl;
    return 0;
}

Measured memory_bytes: 904
#include<stdio.h>
int main()
{
	int number;
	double weight,height,BMI;
	while(scanf("%d,%lf,%lf",&number,&weight,&height)!=EOF)
	{
		BMI=weight/height/height;
		if(BMI>=25)
		{
			printf("%d\n",number);
		}
	}
	return 0;
}

Measured memory_bytes: 0
package main

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

var sc = bufio.NewScanner(os.Stdin)

const N = 8

var que, color [N]int
var dpos [2*N - 1]int
var dneg [2*N - 1]int
var X [N][N]bool

func initialize() {
	for i := 0; i < N; i++ {
		que[i] = 0
		color[i] = 0
	}
	for i := 0; i < 2*N-1; i++ {
		dpos[i] = 0
		dneg[i] = 0
	}
}
func printBoard() {
	for i := 0; i < N; i++ {
		for j := 0; j < N; j++ {
			if X[i][j] {
				if que[i] != j {
					return
				}
			}
		}
	}
	for i := 0; i < N; i++ {
		for j := 0; j < N; j++ {
			if que[i] == j {
				fmt.Print("Q")
			} else {
				fmt.Print(".")
			}
		}
		fmt.Println("")
	}
}

func putQueen(i int) {
	if i == N {
		printBoard()
		return
	}
	for j := 0; j < N; j++ {
		if color[j] == 1 ||
			dpos[i+j] == 1 ||
			dneg[i-j+N-1] == 1 {
			continue
		}
		que[i] = j
		dneg[i-j+N-1] = 1
		dpos[i+j] = dneg[i-j+N-1]
		color[j] = dpos[i+j]
		putQueen(i + 1)
		dneg[i-j+N-1] = 0
		dpos[i+j] = 0
		color[j] = 0
		que[i] = 0
	}
}
func nextInt() int {
	sc.Scan()
	i, _ := strconv.Atoi(sc.Text())
	return i
}

func main() {
	sc.Split(bufio.ScanWords)
	initialize()

	for i := 0; i < N; i++ {
		for j := 0; j < N; j++ {
			X[i][j] = false
		}
	}
	k := nextInt()
	for i := 0; i < k; i++ {
		r := nextInt()
		c := nextInt()
		X[r][c] = true
	}

	putQueen(0)
}



Measured memory_bytes: 1120
rr = lambda: input().strip()
rrm = lambda: list(map(int, rr().split()))


def query(X):
    # xor of 1...X
    r = X%4
    if r == 0: return X
    if r == 1: return 1
    if r == 2: return X+1
    return 0

def solve(A, B):
    if A == B:
        return A
    elif A == 0:
        return query(B)
    else:
        return query(B) ^ query(A-1)
    
print(solve(*rrm()))


Measured memory_bytes: 3060
#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<cmath>
using namespace std;
int main() {
  int A,B,C,X;
  cin >> A >> B >> C >> X;
  int cnt = 0;
  for (int i=0; i<=A; i++) {
    for (int j=0; j<=B; j++) {
      for (int k=0; k<=C; k++) {
        if (500*i + 100*j + 50*k == X) {
          cnt++;
        }
      }
    }
  }
  cout << cnt << endl;
}

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

//#define int long long
struct Fast {Fast(){std::cin.tie(0);ios::sync_with_stdio(false);}} fast;

/* cpp template {{{ */

/* short */
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define Fi first
#define Se second
#define ALL(v) (v).begin(), (v).end()
#define RALL(v) (v).rbegin(), (v).rend()
#define X real()
#define Y imag()

/* REPmacro */
#define REPS(i, a, n) for (ll i = (a); i < (ll)(n); ++i)
#define rep(i, n) REPS(i, 0, n)
#define REP0(i,n) for (ll i = 0; i <= (ll)(n); ++i)
#define REP1(i,n) for (ll i = 1; i <= (ll)(n); ++i)
#define RREP(i, n) REPS(i, 1, n + 1)
#define DEPS(i, a, n) for (ll i = (a); i >= (ll)(n); --i)
#define DEP(i, n) DEPS(i, n, 0)
#define EACH(i, n) for (auto&& i : n)

/* debug */
#define debug(x) cerr << x << " " << "(L:" << __LINE__ << ")" << '\n';

/* alias */
using ll = long long;
using ull = unsigned long long;
using vi = vector<int>;
using vvi = vector<vi>;
using vvvi = vector<vvi>;
using pii = pair<int, int>;
using D = double;
using P = complex<D>;
using vs = vector<string>;
template <typename T> using PQ = priority_queue<T>;
template <typename T> using minPQ = priority_queue<T, vector<T>, greater<T>>;

/* const */
const int INF = 1001001001;
const ll LINF = 1001001001001001001ll;
const int MOD = 1e9 + 7;
const D EPS = 1e-9;
const int dx[] = {0, 1, 0, -1, 1, -1, 1, -1}, dy[] = {1, 0, -1, 0, 1, -1, -1, 1};

/* func */
inline bool inside(int y, int x, int H, int W) {return y >= 0 && x >= 0 && y < H && x < W;}
inline int in() {int x; cin >> x; return x;}
inline ll IN() {ll x; cin >> x; return x;}
inline vs split(const string& t, char c) {vs v; stringstream s(t); string b; while(getline(s, b, c)) v.eb(b); return v;}
template <typename T> inline bool chmin(T& a, const T& b) {if (a > b) a = b; return a > b;}
template <typename T> inline bool chmax(T& a, const T& b) {if (a < b) a = b; return a < b;}
template <typename T, typename S> inline void print(const pair<T, S>& p) {cout << p.first << " " << p.second << endl;}
template <typename T> inline void print(const T& x) {cout << x << '\n';}
template <typename T, typename S> inline void print(const vector<pair<T, S>>& v) {for (auto&& p : v) print(p);}
template <typename T> inline void print(const vector<T>& v, string s = " ") {rep(i, v.size()) cout << v[i] << (i != (ll)v.size() - 1 ? s : "\n");}
template<typename T>
istream& operator >> (istream& is, vector<T>& vec){
  for(T& x: vec) is >> x;
  //for(int i=0; i<vec.size(); i++) is >> x[i]; とかでもいいです。
  return is;
}
template<typename T>
ostream& operator << (ostream& os, vector<T>& vec){
  for(int i=0; i<vec.size(); i++){
    os << vec[i] << ( i+1 == vec.size() ? "" : " " );
  }
  return os;
}
/* }}} */
signed main() 
{
  int n=in();
  ll ans=1;
  REP1(i,n)
  {
    ans=ans*i%MOD;
  }
  print(ans);
  return 0;
}

Measured memory_bytes: 256
#include <vector>
#include <algorithm>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <cstdio>
#include <cmath>
#include <cstring>
typedef long long int lli;
using namespace std;
priority_queue<lli> a;
priority_queue<lli> b;
priority_queue<lli> c;
lli n,m,x,y,z,A[15],B[15],C[15];

lli sol(bool w)
{
	lli res=0;
	while(a.size()!=n&&c.size()!=n){
		if(w){
			if(!a.empty()&& ( b.empty() || a.top()>b.top() ) ){
				b.push(a.top());
				a.pop();
			}
			else{
				a.push(b.top());
				b.pop();
			}
			w=false;
		}
		else{
			if(!c.empty()&& ( b.empty() || c.top()>b.top() ) ){
				b.push(c.top());
				c.pop();
			}
			else{
				c.push(b.top());
				b.pop();
			}
			w=true;
		}
		res++;
	}
	while(!a.empty()) a.pop();
	while(!c.empty()) c.pop();
	return res;
}

int main()
{
while(1){
	scanf("%lld %lld",&n,&m);
	if(n==0&&m==0) return 0;
	scanf("%lld",&x);
	for(int i=0;i<x;i++) {scanf("%lld",&A[i]); a.push(A[i]);}
	scanf("%lld",&y);
	for(int i=0;i<y;i++) {scanf("%lld",&B[i]); b.push(B[i]);}
	scanf("%lld",&z);
	for(int i=0;i<z;i++) {scanf("%lld",&C[i]); c.push(C[i]);}
	lli p=sol(1);
	for(int i=0;i<x;i++) {a.push(A[i]);}
	for(int i=0;i<y;i++) {b.push(B[i]);}
	for(int i=0;i<z;i++) {c.push(C[i]);}
	p=min(p,sol(0));
	if(p>m) p=-1;
	printf("%lld\n",p);
}
}

Measured memory_bytes: 1056
#include <iostream>
#include <sstream>
#include <fstream>
#include <string>
#include <vector>
#include <deque>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <algorithm>
#include <functional>
#include <utility>
#include <bitset>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <cstdio>

using namespace std;

static const double EPS = 1e-9;
template<class T> bool INRANGE(T x, T a, T b) { return a <= x && x <= b; }
template<class T> void amin(T &a, T v) { if (a > v) a = v; }
template<class T> void amax(T &a, T v) { if (a < v) a = v; }
int ROUND(double x) { return (int)(x + 0.5); }
bool ISINT(double x) { return fabs(ROUND(x) - x) <= EPS; }
bool ISEQUAL(double x, double y) { return fabs(x - y) <= EPS * max(1.0, max(fabs(x), fabs(y))); }
double SQSUM(double x, double y) { return x * x + y * y; }
#define PI  (acos(-1))
#define ARRAY_NUM(a) (sizeof(a)/sizeof(a[0])) 
#define NG (-1)
#define BIG ((int)1e9+10)
#define BIGLL ((ll)4e18)
#define SZ(a) ((int)(a).size())
#define SQ(a) ((a)*(a))
typedef unsigned long long ull;
typedef long long ll;

int main(void)
{
	int n;
	int k;
	cin >> n >> k;
	vector <ll> x(n);
	for (int i = 0; i < n; ++i)
	{
		cin >> x[i];
	}

	ll ans = BIGLL;
	for (int i=0;i<=n-k;i++)
	{
		int left = i;
		int right = i+k-1;

		ll dist = 0;

		if (x[left] < 0 && x[right] < 0)
		{
			dist = abs(x[left]);
		}
		else if (x[left] > 0 && x[right] > 0)
		{
			dist = abs(x[right]);
		}
		else
		{
			dist = min(2 * abs(x[left]) + abs(x[right]),
				abs(x[left]) + 2 * abs(x[right])
			);
		}


		amin(ans, dist);
	}

	cout << ans << endl;

	return 0;
}


Measured memory_bytes: 1024
#include <bits/stdc++.h>
using namespace std;
 
#define rep(i,n) for(int i=0;i<n;i++)
#define REP(i,s,n) for(int i=(s);i<(n);i++)
#define repr(i,n) for(int i=n-1;i>=0;i--)
#define REPR(i,s,n) for(int i=(s);i>=(n);i--)
#define all(a) (a).begin(),(a).end()
#define rall(a) (a).rbegin(),(a).rend()
#define Eunique(v) v.erase(unique(all(v)),v.end())
#define Eback(s) s.erase(s.end()-1,s.end())
#define pb push_back
#define pf push_front
#define mod 1000000007
#define m_p make_pair
#define DOUBLE fixed << setprecision(15)
#define OK puts("OK")
#define OK1 puts("OK1")
#define OK2 puts("OK2")
#define SIZE(s) (int)s.size()
#define Cout(n) cout<<(n)<<endl
#define INF 1000000000000000000LL

typedef vector<int> vi;
typedef vector<vi> vvi;
typedef long long ll;
typedef vector<ll> vll;
typedef vector<vll> vvll;
typedef pair<ll,ll> pll;
typedef pair<int,int> pii;
typedef vector<pair<int,int>> vpii;
typedef vector<pair<ll,ll>> vpll;
typedef vector<string> vs;
const double pi = acos(-1.0);

template<class A, class B>
ostream& operator<<(ostream& ost, const pair<A, B>&p) {
	ost << "{" << p.first << ", " << p.second << "} ";
	return ost;
}

template<class T>
ostream& operator<<(ostream& ost, const vector<T>&v) {
	ost << "{";
	for (int i = 0; i<(int)v.size(); i++) {
		if (i)ost << ", ";
		ost << v[i];
	}
	ost << "} \n";
	return ost;
}

template<class A, class B>
ostream& operator<<(ostream& ost, const map<A, B>&v) {
	ost << "{";
	for (auto p:v) {
		ost << "{" << p.first << ", " << p.second << "} ";
	}
	ost << "} ";
	return ost;
}

ll gcd(ll x, ll y) { return (y == 0) ? x : gcd(y, x % y); }
ll lcm(ll x, ll y) { return x * y / gcd(x, y); }

int main()
{
	string s;
	cin >> s;
	vector<char> c;
	rep(i,SIZE(s)){
		if(s[i]=='S') c.pb(s[i]);
		else if(s[i]=='T'){
			if(SIZE(c)==0) c.pb(s[i]);
			else if(c.back()=='T') c.pb(s[i]);
			else if(c.back()=='S') c.pop_back();
		}
	}
	cout << SIZE(c) << endl;
    return 0;
}


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

int main() {
	int a,b,c,k;
	cin >> a >> b >> c >> k;
	int m = max({a,b,c});
	int sm = a + b + c - m;
	m *= pow(2,k);
    cout << sm + m << endl;
	return 0;
}


Measured memory_bytes: 256
package main

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

//Util
func nextStr() string {
	sc.Scan()
	return sc.Text()
}

func nextInt() int {
	sc.Scan()
	i, e := strconv.Atoi(sc.Text())
	if e != nil {
		panic(e)
	}
	return i
}

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

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

func absInt(a int) int {
	if a >= 0 {
		return a
	} else {
		return -a
	}
}

func absFloat64(a float64) float64 {
	if a >= 0 {
		return a
	} else {
		return -a
	}
}

func maxFloat64(a, b float64) float64 {
	if a > b {
		return a
	} else {
		return b
	}
}

func minFloat64(a, b float64) float64 {
	if a > b {
		return b
	} else {
		return a
	}
}

func str2Int(s string) int {
	n, _ := strconv.Atoi(s)
	return n
}

func reverse(s string) string {
	runes := []rune(s)
	for i, j := 0, len(runes)-1; i < j; i, j = i+1, j-1 {
		runes[i], runes[j] = runes[j], runes[i]
	}
	return string(runes)
}

func pow(p, q int) int {
	return int(math.Pow(float64(p), float64(q)))
}

func isPrime(x int) bool {
	if x == 1 {
		return false
	}
	if x == 2 {
		return true
	}
	if x%2 == 0 {
		return false
	}

	b := true
	rootx := int(math.Sqrt(float64(x)))
	i := 3
	for i <= rootx {
		if x%i == 0 {
			b = false
			break
		}
		i += 2
	}
	return b
}

func PrimeFactors(n int) (pfs []int) {
	// Get the number of 2s that divide n
	for n%2 == 0 {
		pfs = append(pfs, 2)
		n = n / 2
	}

	// n must be odd at this point. so we can skip one element
	// (note i = i + 2)
	for i := 3; i*i <= n; i = i + 2 {
		// while i divides n, append i and divide n
		for n%i == 0 {
			pfs = append(pfs, i)
			n = n / i
		}
	}

	// This condition is to handle the case when n is a prime number
	// greater than 2
	if n > 2 {
		pfs = append(pfs, n)
	}

	return
}

//Main
const (
	initialBufSize = 10000
	maxBufSize     = 1000000
	mod            = 1e9 + 7
)

var (
	sc *bufio.Scanner = func() *bufio.Scanner {
		sc := bufio.NewScanner(os.Stdin)
		buf := make([]byte, initialBufSize)
		sc.Buffer(buf, maxBufSize)
		return sc
	}()
)

var N int

func main() {
	sc.Split(bufio.ScanWords)

	N = nextInt()
	B := make([]int, N-1)
	var ans int

	for i := 0; i < N-1; i++ {
		B[i] = nextInt()
	}

	ans += B[0] + B[len(B)-1]
	for i := 0; i < N-2; i++ {
		ans += minInt(B[i], B[i+1])
	}

	fmt.Println(ans)
}


Measured memory_bytes: 640
// フェルマーの小定理
package main

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

const (
	p = 998244353
)

var (
	fac []int
)

func mpow(x int, n int) int {
	result := 1
	for n != 0 {
		if n&1 == 1 {
			result = result * x % p
		}
		x = x * x % p
		n >>= 1
	}
	return result
}

func mcomb(n int, k int) int {
	if n == 0 && k == 0 {
		return 1
	}
	if n < k || k < 0 {
		return 0
	}
	return (fac[n] * mpow(fac[n-k], p-2) % p) * mpow(fac[k], p-2) % p
}

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

func main() {
	defer flush()

	N := readInt()
	M := readInt()
	K := readInt()

	fac = make([]int, N+1)
	fac[0] = 1
	for i := 0; i < N; i++ {
		fac[i+1] = fac[i] * (i + 1) % p
	}

	result := 0
	for i := 0; i < K+1; i++ {
		t := M * mcomb(N-1, i)
		t %= p
		t *= mpow(M-1, N-1-i)
		t %= p
		result += t
		result %= p
	}
	println(result)
}

const (
	ioBufferSize = 1 * 1024 * 1024 // 1 MB
)

var stdinScanner = func() *bufio.Scanner {
	result := bufio.NewScanner(os.Stdin)
	result.Buffer(make([]byte, ioBufferSize), ioBufferSize)
	result.Split(bufio.ScanWords)
	return result
}()

func readString() string {
	stdinScanner.Scan()
	return stdinScanner.Text()
}

func readInt() int {
	result, err := strconv.Atoi(readString())
	if err != nil {
		panic(err)
	}
	return result
}

var stdoutWriter = bufio.NewWriter(os.Stdout)

func flush() {
	stdoutWriter.Flush()
}

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

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


Measured memory_bytes: 3420
N=int(input())
S=input()
if S=='#'*N or S=='.'*N:
  print(0)
  exit()
rightB=0
for i in S:
  if i=='#':
    rightB+=1
rightW=N-rightB
leftB=0
leftW=0
ans=min(rightB,rightW)
for i in range(N):
  if S[i]=='.':
    leftW+=1
    rightW-=1
    d=rightW+leftB
    ans=min(ans,d)
  else:
    leftB+=1
    rightB-=1
    d=rightW+leftB
    ans=min(ans,d)
print(ans)

Measured memory_bytes: 3500
#include "bits/stdc++.h"
#include<vector>
#include<iostream>
#include<queue>
#include<algorithm>
#include<map>
#include<set>
#include<iomanip>
#include<assert.h>
#include<unordered_map>
#include<unordered_set>
#include<string>
#include<stack>
#include<complex>
#pragma warning(disable:4996)
using namespace std;
using ld = long double;
template<class T>
using Table = vector<vector<T>>;
const ld eps=1e-9;
	
#define WHATS(var)cout<<__LINE__<<' '<<#var<<"="<<var<<endl;
	
template<class S, class T> ostream& operator <<(ostream &os, const pair<S, T> v){
	os << "( " << v.first << ", " << v.second << ")"; return os;
}
template<class T> ostream& operator <<(ostream &os, const vector<T> &v){
	for(int i = 0; i < v.size(); i++){if(i > 0){os << " ";} os << v[i];} return os;
}
template<class T> ostream& operator <<(ostream &os, const vector<vector<T>> &v){
	for(int i = 0; i < v.size(); i++){if(i > 0){os << endl;} os << v[i];} return os;
}
template<class T> ostream& operator <<(ostream &os, const vector<set<T>> &v){
	for(int i = 0; i < v.size(); i++){if(i > 0){os << endl;} os << v[i];} return os;
}
template<class T> ostream& operator <<(ostream &os, const set<T> &v){
	int i=0;
	for(auto it:v){
		if(i > 0){os << ' ';}
		os << it;
		i++;
	} 
	return os;
}
	
using ll=long long ;



vector<int>solve(vector<int>v){
	vector<int>nums(1000000,10000000);
	vector<int>anss(v.size());
	nums[0]=0;
	//WHATS(nums)
	for(int i=0;i<v.size();++i){
		auto it=upper_bound(nums.begin(),nums.end(),v[i]);
		anss[i]=it-nums.begin();
		*it=v[i];
		//WHATS(nums)
	}
	return anss;
}
int main() {
	ios::sync_with_stdio(false);
	
	int Q;cin>>Q;
	while(Q--){
		string st;cin>>st;
		int sum=0;
		for(auto c:st){
			sum+=c-'0';
		}
		int cnt=(sum-1)/9;
		cnt+=int(st.size());
		if(cnt%2)cout<<"Audrey wins."<<endl;
		else cout<<"Fabre wins."<<endl;
	}

	return 0;
}


Measured memory_bytes: 3196
#include <iostream>
#include <string>
using namespace std;
int main()
{
	int N, ac, wa, tle, re;
	ac = 0;
	wa = 0;
	tle = 0;
	re = 0;
	string S[100000];
	cin >> N;
	for (int i = 0; i < N; i++)
		cin >> S[i];
	for (int i = 0; i < N; i ++)
			if (S[i] == "AC")
				ac += 1;
			else if (S[i] == "WA")
				wa += 1;
			else if (S[i] == "TLE")
				tle += 1;
			else if (S[i] == "RE")
				re += 1;
	cout << "AC x " << ac << "\n";
	cout << "WA x " << wa << "\n";
	cout << "TLE x " << tle << "\n";
	cout << "RE x " << re << "\n";
}

Measured memory_bytes: 6744
#include<cstdio>
#include<cmath>
#define PI acos(-1)
#define scanf_s scanf
struct Point {
	double x, y;
};
void koch(int n, Point a, Point b) {
	if (n == 0)return;
	Point s, t, u;
	double rad = PI * 60.0 / 180.0;
	s.x = (2.0*a.x + 1.0*b.x) / 3.0;
	s.y = (2.0*a.y + 1.0*b.y) / 3.0;
	t.x = (1.0*a.x + 2.0*b.x) / 3.0;
	t.y = (1.0*a.y + 2.0*b.y) / 3.0;
	u.x = (t.x - s.x)*cos(rad) - (t.y - s.y)*sin(rad) + s.x;
	u.y = (t.x - s.x)*sin(rad) + (t.y - s.y)*cos(rad) + s.y;
	koch(n - 1, a, s);
	printf("%.8f %.8f\n", s.x, s.y);
	koch(n - 1, s, u);
	printf("%.8f %.8f\n", u.x, u.y);
	koch(n - 1, u, t);
	printf("%.8f %.8f\n", t.x, t.y);
	koch(n - 1, t, b);
}
int main() {
	int n; scanf_s("%d", &n);
	Point a, b;
	a.x = 0; a.y = 0; b.x = 100; b.y = 0;
	printf("%.8f %.8f\n", a.x, a.y);
	koch(n, a, b);
	printf("%.8f %.8f\n", b.x, b.y);
	return 0;
}

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

using namespace std;
int main()
{
    int n;
    cin>>n;
    vector<double>a(n);
    for(int i=0;i<n;i++)
    {
        cin>>a[i];
    }
    sort(a.begin(),a.end());
    double maxm=a[0];
    for(int i=1;i<n;i++)
    {
        maxm=(maxm+a[i])/2;
    }
    cout<<maxm<<endl;
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i,n) for(int i = 0; i < (int)(n); i++)
#define rrep(ri,n) for(int ri = (int)(n-1); ri >= 0; ri--)
#define rep2(i,x,n) for(int i = (int)(x); i < (int)(n); i++)
#define repit(itr,x) for(auto itr = x.begin(); itr != x.end(); itr++)
#define rrepit(ritr,x) for(auto ritr = x.rbegin(); ritr != x.rend(); ritr++)
#define ALL(n) begin(n), end(n)
using ll = long long;
using namespace std;

int main(){
	int n;
	cin >> n;
	vector<int> a(n);
	rep(snip_i, n) cin >> a.at(snip_i);
	ll sum = accumulate(a.begin(), a.end(), 0LL);
	vector<ll> ans(n);

	ans.at(0) = sum;
	ll temp = 0;
	for(int i = 1; i < n; i+=2){
		temp += a.at(i);
	}
	ans.at(0) -= 2*temp;
	rep2(i, 1, n){
		ans.at(i) = 2 * a.at(i-1) - ans.at(i-1);
	}

	rep(i, n){
		if(i != 0) cout << " ";
		cout << ans.at(i);
	}
	cout << endl;
	return 0;
}

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

using namespace std;

#define lint long long
#define P pair<int, int>

int main(){
    int A, B;
    cin >> A >> B;

    if(A >= 6 && A <= 12){
        cout << B / 2 << endl;
    } else if(A < 6){
        cout << 0 << endl;
    }else {
        cout << B << endl;
    }
}



Measured memory_bytes: 256
#include <cstdio>
#include <string>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <algorithm>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <list>
#include <iterator>
#include <cassert>
#include <numeric>
#pragma warning(disable:4996) 
 
typedef long long ll;
#define MIN(a, b) ((a)>(b)? (b): (a))
#define MAX(a, b) ((a)<(b)? (b): (a))
#define LINF  9223300000000000000
#define LINF2 1223300000000000000
#define INF 2140000000
//const long long MOD = 1000000007;
const long long MOD = 998244353;

using namespace std;


void solve()
{
    int n;
    scanf("%d", &n);
    set<char> z;
    int i;
    for (i = 0; i < n; i++) {
        char str[5];
        scanf("%s", str);
        z.insert(str[0]);
    }
    if (z.size() == 3) {
        printf("Three\n");
    }
    else {
        printf("Four\n");
    }

    return;
}

int main(int argc, char* argv[])
{
#if 1
    solve();
#else
    int T;
    scanf("%d", &T);
    int t;
    for(t=0; t<T; t++) {
        //printf("Case #%d: ", t+1);
        solve();
    }
#endif
    return 0;
}



Measured memory_bytes: 256
#include<bits/stdc++.h>
#include<iostream>
#include<cstdio>
#include<cstring>
#include<algorithm>
#include<cmath>
#define ll long long
using namespace std;
const int INF=0x3f3f3f3f;
const double pi=acos(-1),eps=1e-8;
template <typename _Tp> inline void read(_Tp&x);
inline void print(__int128 x);


const int MAXN = 2e5 + 10;
int n,k;
int a[MAXN];

inline bool check(int m)
{
    int ans = 0;
    for(int i=1;i<=n;i++) {
        if (a[i] != m) ans += a[i] / m;
        if (ans > k) return 0;
    }
    return ans <= k;
}

int main()
{
    scanf("%d%d",&n,&k);
    int l = 1;
    int r = -1;
    for(int i=1;i<=n;i++) {
        scanf("%d",a + i);
        if (i == 1) {
            r = a[i];
        } else {
            
            r = max(r,a[i]);
        }
    }
    int m;
    int ans = 1;

    while (l < r) {

        m = (l + r) / 2;
        if (check(m)) {
            r = m;
            ans = m;
        } else l = m + 1;
    }
    printf("%d\n",r);
    return 0;
}

template <typename _Tp> inline void read(_Tp&x) {
	char ch;bool flag=0;x=0;
	while(ch=getchar(),!isdigit(ch)) if(ch=='-')flag=1;
	while(isdigit(ch)) x=x*10+ch-'0',ch=getchar();
	if(flag) x=-x;
}
inline void print(__int128 x) {
	if(x<0) {x=-x;putchar('-');}
	if(x>9) print(x/10);
	putchar(x%10+'0');
}


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

int main(){
	while(1){
		int h,w;
		scanf("%d %d\n", &h,&w);
		if(h==0 && w==0) break;
		for(int i=0;i<w;i++){
			printf("#");  //ブロックの1行目
		}
		printf("\n");


		for(int j=1;j<h-1;j++){
			printf("#");  //先頭
			for(int k=1;k<w-1;k++){
				printf(".");
			}
			printf("#\n");  //末尾
		}
		for(int l=0; l<w; l++){
			printf("#");
		}
		printf("\n");
		printf("\n");
	}

}


Measured memory_bytes: 2612
#include<bits/stdc++.h>
using namespace std;
int main(){
	double a,b;
	int ans=0;
	cin>>a>>b;
	for(int i=0;i<a;i++){
		double c,d;
		cin>>c>>d;
		double y=c*c+d*d;
		double x=sqrt(y);
		if(x<=b)
			ans++;
	}
	cout<<ans<<endl;
	return 0;
}

Measured memory_bytes: 3840
solve :: [Int] -> [String]
solve (x : y : xs)
  | x == 0 && y == 0 = []
  | otherwise = (replicate y '#') : (map ((++['#']) . ('#':)) (replicate (x-2) $ replicate (y-2) '.'))	++ [replicate y '#'] ++ [""]++ solve xs

main = getContents >>= mapM_ putStrLn . solve . map read . words

Measured memory_bytes: 4372
#include<iostream>
#include<algorithm>
#include<cmath>
#include<vector>
#include<queue>
#include<string>
#include<map>
#include<set>
#include<functional>
#include<list>
#include<bitset>
using namespace std;
typedef long long ll;



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

	if (n == 0) {
		cout << 0;
		return 0;
	}
	string ans = "";
	int i = 1;
	ll x = -2;
	while (n != 0) {
		if (n % x == 0) {
			ans = "0" + ans;
	//		cout << i << " " << n << endl;
		}
		else {
			ans = "1" + ans;
			n -= (x /-2);

		}
		i++;
		if (i == 44) {
			break;
		}
		x *= -2;
	}

	cout << ans;
	return 0;
}

Measured memory_bytes: 256
sa=input()
sb=input()
sc=input()
ans=0
turn="a"
while len(sa)>=0 and len(sb)>=0 and len(sc)>=0:
  if turn=="a":
    if len(sa)==0:
      print("A")
      exit()
    turn=sa[0]
    sa=sa[1:]
  elif turn=="b":
    if len(sb)==0:
      print("B")
      exit()
    turn=sb[0]
    sb=sb[1:]
  else:
    if len(sc)==0:
      print("C")
      exit()
    turn=sc[0]
    sc=sc[1:]

Measured memory_bytes: 3064
def main():
    H, W = map(int, input().split(" "))

    board = []
    for _ in range(H):
        row = list(input())
        board.append(row)

    dhs = [-1, -1, -1,  0, 0,  1, 1, 1]
    dws = [-1,  0,  1, -1, 1, -1, 0, 1]

    for i in range(H):
        for j in range(W):
            if board[i][j] == "#":
                print("#", end="")
                continue

            num_bombs = 0
            for dh, dw in zip(dhs, dws):
                new_i = i + dh
                new_j = j + dw

                if new_i < 0 or new_i >= H:
                    continue
                if new_j < 0 or new_j >= W:
                    continue

                if board[new_i][new_j] == "#":
                    num_bombs += 1
            print(num_bombs, end="")
        print()

if __name__ == '__main__':
    main()


Measured memory_bytes: 3444
/*starting with the name of almighty ALLAH*/
/*solved by RAKIB JOY*/
#include<bits/stdc++.h>
#define ll long long int
#define pb push_back
#define vc vector
#define vi vc<int>
#define vl vc<ll>
#define dbg(x) cout<<x<<endl;
#define mp(x,y) make_pair(x,y)
#define yes dbg("YES")
#define no dbg("NO")
#define tst int t;cin>>t;while(t--)
#define srt(v) sort(v.begin(),v.end());
#define rsrt(v) sort(v.begin(),v.end(),greater<int>());
#define rj ios::sync_with_stdio(false);cin.tie(0);
#define rvs(v) reverse(v.begin(),v.end());
#define F first
#define S second
using namespace std;
int main()
{
    rj
    double a,b=3.14159;
    cin>>a;
   printf("%.2lf\n",2*a*b);

    return 0;
}


Measured memory_bytes: 3792
var line; var S;
var MOD = Math.pow(10, 9) + 7;

var readline = require('readline');
var rl = readline.createInterface({
    input: process.stdin,
    output: process.stdout,
});

rl.on('line', function (x) {
    line = x;
});

rl.on('close', function () {
    S = line.split("");
    dp = Array(S.length + 1);
    
    for (var i = 0; i <= S.length; i++) {
        dp[i] = Array(3 + 1).fill(0);
    }

    for (var i = S.length; i >= 0; i--) {
        for (var j = 3; j >= 0; j--) {
            if (i === S.length) { dp[i][j] = (j === 3 ? 1 : 0); }
            else {
                dp[i][j] = dp[i + 1][j] * (S[i] === '?' ? 3 : 1);
                if (j < 3 && (S[i] === '?' || S[i] === "ABC"[j])) {
                    dp[i][j] += dp[i + 1][j + 1];
                }
                dp[i][j] %= MOD;
            }
        }
    }
    console.log(dp[0][0]);
});


Measured memory_bytes: 32688
#include <iostream>

int main(){
    std::string str;
    
    while(std::cin >> str){
        if("-" == str){
            break;
        }else{
            int len = str.length();
            int n;
            std::cin >> n;

            int count = 0;
            int buf;
            for(int i = 0; i < n; ++i){
                std::cin >> buf;
                count += buf;
            }
            str += str.substr(0, count % len);
            std:: cout << str.substr(str.length() - len, len) << std::endl;
        }
    }

    return 0;
}


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

int main(){
    int n;
    cin >> n;
    vector<int> a(n);
    for (int i = 0;i < n;i++){
        cin >> a[i];
    }
    int q;
    cin >> q;
    vector<int> b(q);
    vector<int> c(q);
    for (int i = 0;i < q;i++){
        cin >> b[i] >> c[i];
    }
    vector<int> d(q);
    for (int i = 0;i < q;i++){
        d[i] = c[i] - b[i];
    }

    sort(a.begin(), a.end());
    vector<int> k(100000);
    for (int i = 0;i < n;i++){
        k[a[i]-1]++;
    }

    long long s = 0;
    for (int i = 0; i < n; i++){
        s += a[i];
    }

    for (int i = 0; i < q; i++){
        s += k[b[i]-1] * d[i];
        cout << s << endl;
        k[c[i]-1] += k[b[i]-1];
        k[b[i]-1] = 0;
    }
}


Measured memory_bytes: 5380
#include <stdio.h>
#include <algorithm>
#define SIZE 3005
long long int dp[SIZE][SIZE], a[SIZE];

  int main(void) {
        int n;
        scanf("%d",&n);
        for(int i=1; i<=n; i++) scanf("%lld",&a[i]);

        for(int l=n; l>=1; l--) {
                for(int r=l; r<=n; r++) {
                        if(l==r) dp[l][r] = a[l];
                        else dp[l][r] = std::max(a[l]-dp[l+1][r], a[r]-dp[l][r-1]);
                }
        }

        printf("%lld", dp[1][n]);
        return 0;
  }








Measured memory_bytes: 69888
#include <cstdlib>
#include <cctype>
#include <cstring>
#include <cstdio>
#include <cmath>
#include <algorithm>
#include <vector>
#include <string>
#include <iostream>
#include <sstream>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <fstream>
#include <numeric>
#include <iomanip>
#include <bitset>
#include <list>
#include <stdexcept>
#include <functional>
#include <utility>
#include <ctime>
#include <random>
#include <cassert>
using namespace std;
typedef long long LL;
typedef unsigned long long ULL;
#define MEM(a,b) memset((a),(b),sizeof(a))
const LL INF = 1e9 + 7;
const int N = 2e5 + 10;

int main()
{
	//freopen("input.txt", "r", stdin);
	//freopen("output.txt", "w", stdout);
	int n;
	cin >> n;
	int k;
	cin >> k;
	map<int, int> mc;
	while (n--)
	{
		int x;
		cin >> x;
		mc[x]++;
	}
	vector<int> v;
	for (auto& p : mc)
	{
		v.push_back(p.second);
	}
	sort(v.rbegin(), v.rend());
	int ans = 0;
	while (v.size() > k)
	{
		ans += v.back();
		v.pop_back();
	}
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 10748
/*
LANG:C++
PROB:

*/
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <functional>
#include <iostream>
#define mp make_pair
#define mt make_tuple
#define fi first
#define se second
#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 __gnu_pbds;
using namespace std;


typedef tree<int, null_type, less<int>, rb_tree_tag,
            tree_order_statistics_node_update>
    ordered_set;

typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<pii> vpi;
typedef vector<vi> vvi;
typedef long long i64;
typedef vector<i64> vi64;
typedef vector<vi64> vvi64;
typedef pair<i64, i64> pi64;
typedef double ld;
typedef unsigned long long ui64;

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; }
const int mod=1000000007;
  i64 poww(i64 a, i64 b)
  {
    a%=mod;
    i64 res=1;
    while(b)
      {
if(b&1)res=res*a%mod;

      a=a*a%mod;
      b/=2;

      }
      return res;
  }
  i64 inv(i64 a)
  {
    return poww(a,mod-2);
  }


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

    // ifstream fin(".in");
    // ofstream fout(".in");
    i64 a,b,c;
    cin>>a>>b>>c;
a=max(a,b);
  cout<< (c+a-1)/a;
  return 0;



    return 0;
  }


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

class Procon {
  public Procon () { }
  static void Main (string[] agrs) {
    new Procon ().Do ();
  }

  Scanner cin;

  public void Do () {
    cin = new Scanner ();
    int ret = 0;
    int N = cin.nextInt ();
    int M = cin.nextInt ();
    int C = cin.nextInt ();

    int[] b = cin.arrayInt ();
    for (int i = 0; i < N; i++) {
      int x = C;
      int[] a = cin.arrayInt ();
      for (int j = 0; j < M; j++) {
        x += a[j] * b[j];
      }
      if (x > 0) {
        ret++;
      }
    }
    Console.WriteLine (ret);
  }
}

class Scanner {
  string[] s;
  int i;
  int max_i;

  public Scanner () {
    s = new string[0];
    max_i = 0;
    i = 0;
  }

  public string nextString () {
    if (i >= s.Length) {
      s = Console.ReadLine ().Split (' ');
      max_i = s.Length;
      i = 0;
      if (max_i == 0) {
        return "";
      }
      return s[i++];
    } else {
      return s[i++];
    }
  }

  public int nextInt () {
    return int.Parse (nextString ());
  }

  public long nextLong () {
    return long.Parse (nextString ());
  }

  public double nextDouble () {
    return double.Parse (nextString ());
  }

  public string[] arrayString () {
    return Console.ReadLine ().Split (' ');
  }

  public int[] arrayInt () {
    string[] str = Console.ReadLine ().Split (' ');
    int[] array = new int[str.Length];
    for (int i = 0; i < str.Length; i++) {
      array[i] = int.Parse (str[i]);
    }
    return array;
  }

  public long[] arrayLong () {
    string[] str = Console.ReadLine ().Split (' ');
    long[] array = new long[str.Length];
    for (int i = 0; i < str.Length; i++) {
      array[i] = long.Parse (str[i]);
    }
    return array;
  }

  public double[] arrayDouble () {
    string[] str = Console.ReadLine ().Split (' ');
    double[] array = new double[str.Length];
    for (int i = 0; i < str.Length; i++) {
      array[i] = double.Parse (str[i]);
    }
    return array;
  }
}

Measured memory_bytes: 13140
#include<stdio.h>

int main(void)
{
  int W, H, x, y, r;

  scanf("%d %d %d %d %d", &W, &H, &x, &y, &r);

  if(x - r >= 0 && y - r >= 0 && x + r <= W && y + r <= H) {
    printf("Yes\n");
  }else{
    printf("No\n");
  }

  return 0;
}

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

using namespace std;
typedef long long ll;

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

  int w, h, n;
  cin >> w >> h >> n;

  int grid[w][h];
  memset(grid, 0, sizeof(grid));

  for (int i = 0; i < n; ++i) {
    int x, y, a;
    cin >> x >> y >> a;

    if (a == 1) {
      for (int i = 0; i < x; ++i) 
        for (int j = 0; j < h; ++j) grid[i][j] = 1;
    } else if (a == 2) {
      for (int i = x; i < w; ++i) {
        for (int j = 0; j < h; ++j) grid[i][j] = 1;
      }
    } else if (a == 3) {
      for (int j = 0; j < y; ++j)
        for (int i = 0; i < w; ++i) grid[i][j] = 1;
    } else {
      for (int j = y; j < h; ++j)
        for (int i = 0; i < w; ++i) grid[i][j] = 1;
    }
  }

  int count = 0;
  for (int i = 0; i < w; ++i) {
    for (int j = 0; j < h; ++j) if (!grid[i][j]) count++;
  }

  cout << count << "\n";
}
	

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

using namespace std;
typedef long long ll;


ll N, M;


int main(){
	cin >> N >> M;
	
	priority_queue<int> q;
	for ( int i = 0; i < N; i++ ){
		int A;
		cin >> A;
		q.push(A);
	}
	
	for ( int j = 0; j < M; j++ ){
		int A = q.top();
		q.pop();
		A /= 2;
		q.push(A);
	}
	
	ll sum = 0;
	while ( !q.empty() ){
		sum += q.top();
		q.pop();
	}
	
	cout << sum << endl;


	return 0;
}


Measured memory_bytes: 892
#include <iostream>
#include <string>
#include <algorithm>
#include <functional>
#include <vector>
#include <utility>
#include <cstring>
#include <iomanip>
#include <numeric>
#include <cmath>
#include <queue>
#include <map>
using namespace std;
typedef long long ll;
const int INF = 1<<30; 
const int MOD = 1e9 + 7;
const int dy[] = {1, 0, -1, 0};
const int dx[] = {0, 1, 0, -1};
int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n;
    cin >> n;
    string s[] = {"sat", "sun", "mon", "tue", "wed", "thu", "fri"};
    cout << s[(n % 7 + 5) % 7] << endl;
    return 0;
}




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

#define long long long

const int N = 1e5+5;

int n, m;
char S[N], T[N];

int main() {
    scanf("%d %d", &n, &m);
    scanf("%s %s", S, T);
    long lcm = 1ll * n * m / __gcd(n, m);
    long x = lcm / n, y = lcm / m;
    long lcm2 = x * y / __gcd(x, y);
    long z1 = lcm2 / x, z2 = lcm2 / y;
    for(int i = 0; i < n; ++i) {
        if(z1 * i >= n || z2 * i >= m) break;
        if(S[z1*i] != T[z2*i]) return !printf("-1");
    }
    printf("%lld\n", lcm);
}

Measured memory_bytes: 384
/** e==m*pow(c,2) **/
#include <bits/stdc++.h>
using namespace std;
#define DEBUG 0
#define LL long long
#define int long long
#define pii pair<int, int>
#define SQR(n) (n*n)
#define pb push_back
#define endl '\n'
#define yes cout << "YES" << endl
#define no cout << "NO" << endl
#define INF 100000000000
#define PI (acos(0.0) * 2.0)
#define time_start clock_t tStart = clock()
#define time_end (double)(clock() - tStart)/CLOCKS_PER_SEC
#define maxn 100009
//#pragma GCC diagnostic warning "-std=c++11"
#define check(n, i) (int)(bool(!((n)&(1<<(i)))))
#define set(n, i) (((n)|(1<<(i))))
#define mod 1000000007
 
#define dbg(a) cout << #a << " = " << a << endl;

 
void faster(void)
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
}
 
int lcm(int a, int b)
{
    return (a*b) / __gcd(a, b);
} 
 

int i, j, ara[105], n, k;
int dp[105][100005];

int cumsum(int v, int st, int en)
{
    if(!st) return dp[v][en];
    return dp[v][en]-dp[v][st-1];
}

int fak(int x, int y)
{
    if(y>ara[x]) return 0;
    int sum=cumsum(x-1, max(0LL, y-(ara[x]-ara[x-1])), y);
    //cout<<x<<' '<<y<<' '<<ara[x]<<" ST "<<max(0LL, y-(ara[x]-ara[x-1]))<<' '<<"EN "<<y<<' '<<sum<<endl;
    return sum;
}


int32_t main()
{
    #ifdef ONPC
      freopen("in.txt", "r", stdin);
      freopen("out.txt", "w", stdout);
    #endif
    faster();
    cin >> n >> k;
    for(i=0;i<=100;i++) dp[i][0]=1;
    for(i=1;i<=n;i++) cin>>ara[i];
    for(j=1;j<=k;j++) dp[0][j] += dp[0][j-1];
    for(i=1;i<=n;i++)
    {
        ara[i]+=ara[i-1];
        for(j=1;j<=k;j++)
        {
            dp[i][j] = fak(i, j)%mod;
        }
        //cout<<i<<endl<<flush;
        //for(j=1;j<=k;j++) cout<<dp[i][j]<<' ';
            //cout<<endl;
        for(j=1;j<=k;j++) dp[i][j] += dp[i][j-1], dp[i][j]%=mod;
    }
    if(DEBUG)
    {
        for(i=0;i<=n;i++)
        {
            for(j=0;j<=k;j++) cout<<dp[i][j]<<' ';
            cout<<endl;
        }
        cout<<endl;
    }
    cout<<((dp[n][k]-dp[n][k-1])%mod+(100LL*mod))%mod<<endl;
    return 0;
}


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

#define rep(i,x,y) for(ll i=(x);i<(y);i++)
#define rrep(i,x,y) for(ll i=(ll)(y)-1;i>=(x);i--)
#define all(x) (x).begin(),(x).end()
#ifdef LOCAL
#define dump(x)  cerr << #x << " = " << (x) << endl
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl
#define dassert(...) assert(__VA_ARGS__)
#else
#define dump(x)
#define debug(x)
#define dassert(...)
#endif
//#define int long long

typedef long long ll;
const ll MOD = 1e9 + 7;
const long double EPS = 1e-8;

void solve(long long A, long long B, long long C, long long D){
    if (ceil((double)C / B) <= ceil((double)A / D)) {
        cout << "Yes" << endl;
    } else {
        cout << "No" << endl;
    }
}

signed main(){
    // ios_base::sync_with_stdio(false);
    // cin.tie(NULL);
    long long A;
    scanf("%lld",&A);
    long long B;
    scanf("%lld",&B);
    long long C;
    scanf("%lld",&C);
    long long D;
    scanf("%lld",&D);
    solve(A, B, C, D);
    return 0;
}


Measured memory_bytes: 3660
import numpy as np
N, T = map(int, input().split())
t = np.array(list(map(int, input().split())))
ends = t + T
# print('t', t)
# print('ends', ends)
# print('ends > t', ends[:-1] > t[1:])
con = ends[:-1] > t[1:]

v = 0
for i in range(N - 1):
    if con[i]:
        continue
    else:
        v += t[i + 1] - ends[i]
ans = ends[-1] - v
print(ans)


Measured memory_bytes: 34144
N = int(input())
 
def calc_h(H, x, y, cx, cy):
    return max(H - abs(x - cx) - abs(y - cy), 0)
 
data_ls = list()
for i in range(N):
    data_ls.append([int(i) for i in input().split()])
xs, ys, hs = zip(*data_ls)
Cx_candidate = list(range(min(xs), max(xs) + 1))
Cy_candidate = list(range(min(ys), max(ys) + 1))
flg = 0
for x in Cx_candidate:
    for y in Cy_candidate:
    	for i in data_ls:
            if i[2] == 0:
                continue
            h = i[2] + abs(i[0] - x) + abs(i[1] - y)
            if h < 1:
            	continue
            else:
            	break
    	for i in data_ls:
            if calc_h(h, i[0], i[1], x, y) == i[2]:
              	flg = 1
              	continue
            else:
              	flg = 0
              	break
    	if flg == 1:
        	break
    if flg == 1:
    	break
print(x, y, h)

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


int main() {
  string s;
  cin >> s;
  string t(s.rbegin(),s.rend());
  bool ans = false;
  string u = s.substr(0,(s.size()-1)/2);
  string v(u.rbegin(),u.rend());
  if(s==t && u==v) ans = true;

  if(ans) cout << "Yes" << endl;
  else cout << "No" << endl;
  return 0;
}

Measured memory_bytes: 256
def solve():
    from sys import stdin
    f_i = stdin
    
    N, K = map(int, f_i.readline().split())
    
    # Since min-heap is used, set the attribute to a negative value.
    F = [list(map(lambda x: -int(x), f_i.readline().split())) \
         for i in range(N)]
    
    D = int(f_i.readline())
    adj = [[] for i in range(N)]
    input_edge = [0] * N
    for i in range(D):
        a, b = map(int, f_i.readline().split())
        a -= 1
        b -= 1
        adj[a].append(b)
        input_edge[b] += 1
    
    E1 = tuple(map(lambda x: int(x) - 1, f_i.readline().split()))
    
    from itertools import permutations
    # {evaluation order: list of tasks with no input edges}
    M = dict(zip(permutations(range(K)), [[] for i in range(24)]))
    for i in range(N):
        if not input_edge[i]:
            f = F[i]
            for E in M:
                # [sorted attributes] + [task number]
                M[E].append([f[e] for e in E] + [i])
    
    R = int(f_i.readline())
    from heapq import heapify, heappop, heappush
    for k in M:
        heapify(M[k])
    
    ans = []
    unprocessed = [True] * N
    for i in range(R):
        E2 = tuple(map(lambda x: int(x) - 1, f_i.readline().split()))
        m = E2[0]
        E2 = E2[1:]
        tasks = M[E1]
        
        # topological sort
        while len(ans) <= m:
            while True:
                t1 = heappop(tasks)
                if unprocessed[t1[-1]]:
                    break
            tn1 = t1[-1]
            unprocessed[tn1] = False
            ans.append(str(tn1 + 1))
            for tn2 in adj[tn1]:
                input_edge[tn2] -= 1
                if not input_edge[tn2]:
                    f = F[tn2]
                    for E in M:
                        heappush(M[E], [f[e] for e in E] + [tn2])
        E1 = E2
    
    # Processing the remaining tasks
    tasks = M[E1]
    while len(ans) < N:
        while True:
            t1 = heappop(tasks)
            if unprocessed[t1[-1]]:
                break
        tn1 = t1[-1]
        ans.append(str(tn1 + 1))
        for tn2 in adj[tn1]:
            input_edge[tn2] -= 1
            if not input_edge[tn2]:
                f = F[tn2]
                heappush(tasks, [f[e] for e in E1] + [tn2])
    print('\n'.join(ans))

solve()


Measured memory_bytes: 161768
// Created by arvybhatt

#include <bits/stdc++.h>
#define fast ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define F first
#define S second
#define p_b push_back
#define m_p make_pair
#define rep(i,n) for(int i=0;i<(n);++i)
#define repA(i,a,n) for(int i=a;i<=(n);++i)
#define repD(i,a,n) for(int i=a;i>=(n);--i)

#define ll long long int
using namespace std;


ll power(ll x, ll y) { ll temp; if( y == 0) return 1; temp = power(x, y/2); if (y%2 == 0) return temp*temp; else return x*temp*temp; } 

int main()
{
	fast;
	int n;cin>>n;
	map<int,int> mp;
	for(int i=1; i<n; i++)
	{
		int x;cin>>x;
		mp[x]++;
	}
	for(int i=1; i<=n; i++)
	{
		cout<<mp[i]<<"\n";
	}

}


Measured memory_bytes: 12996
import sys
sys.setrecursionlimit(10 ** 7)
read = sys.stdin.buffer.read 
inp = sys.stdin.buffer.readline
def inpS(): return inp().rstrip().decode()
readlines = sys.stdin.buffer.readlines 

grid = [list(map(int, inp().split())) for _ in range(3)]
N = int(inp())
for _ in range(N):
  b = int(inpS())
  for i in range(3):
    for j in range(3):
      if grid[i][j] == b:
        grid[i][j] = -1
ans = "No"        
for i in range(3):
  if grid[i][0] == grid[i][1] == grid[i][2]: ans = "Yes"
  if grid[0][i] == grid[1][i] == grid[2][i]: ans = "Yes"
if grid[0][0] == grid[1][1] == grid[2][2]: ans = "Yes"
if grid[0][2] == grid[1][1] == grid[2][0]: ans = "Yes"
print(ans)  


Measured memory_bytes: 3064
using System;
 
class Program
{
  static void Main(string[] args)
  {
    string[] input = Console.ReadLine().Split(' ');
    int a = int.Parse(input[0]);
    int b = int.Parse(input[1]);
    int c = int.Parse(input[2]);
    
    if(a > b) Swap(ref a, ref b);
    if(b > c) Swap(ref b, ref c);
    
    Console.WriteLine("{0}", a + b);
  }
  
  static void Swap(ref int a, ref int b)
  {
    int tmp = a;
    a = b;
    b = tmp;
  }
  
}

Measured memory_bytes: 11092