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

typedef long long LL;

#define FOR(i, a, b) for (LL i = (a), i##_END_ = (b); i <= i##_END_; i++)
#define DNF(i, a, b) for (LL i = (a), i##_END_ = (b); i >= i##_END_; i--)

template <typename Tp> void in(Tp &x) {
	char ch = getchar(), f = 1; x = 0;
	while (ch != '-' && (ch < '0' || ch > '9')) ch = getchar();
	if (ch == '-') ch = getchar(), f = -1;
	while (ch >= '0' && ch <= '9') x = x * 10 + ch - '0', ch = getchar();
	x *= f;
}

template <typename Tp> void out(Tp x) {
	if (x > 9) out(x / 10);
	putchar(x % 10 + '0');
	return;
}

template <typename Tp> Tp Max(const Tp &x, const Tp &y) {return x > y ? x : y;}
template <typename Tp> Tp Min(const Tp &x, const Tp &y) {return x < y ? x : y;}
template <typename Tp> bool chkmax(Tp &x, Tp y) {return x >= y ? 0 : (x=y, 1);}
template <typename Tp> bool chkmin(Tp &x, Tp y) {return x <= y ? 0 : (x=y, 1);}

const LL MAXN = 100010;
const LL MOD = 1000000007;

LL n, A, B;
LL f[MAXN << 2], g[MAXN << 2];
LL rgtA[MAXN], rgtB[MAXN];
LL LftA[MAXN], LftB[MAXN];
LL s[MAXN];

LL abs(LL x)
{
	return x < 0 ? -x : x;
}

LL query(LL now, LL l, LL r, LL x, LL H[])
{
	LL ret = H[now];
	if (l == r) return ret;
	LL mid = (l + r) >> 1;
	if (x <= mid) return (ret + query(now << 1, l, mid, x, H)) % MOD;
	return (ret + query(now << 1 | 1, mid + 1, r, x, H)) % MOD;
}

void modify(LL now, LL l, LL r, LL x, LL y, LL H[], LL val)
{
	if (x <= l && r <= y) {
		H[now] = (H[now] + val) % MOD; return;
	}
	LL mid = (l + r) >> 1;
	if (x <= mid) modify(now << 1, l, mid, x, y, H, val);
	if (mid < y) modify(now << 1 | 1, mid + 1, r, x, y, H, val);
}

int main()
{
	in(n); in(A); in(B);

	FOR(i, 1, n) in(s[i]);

	FOR(i, 1, n) {
		rgtA[i] = Max(rgtA[i - 1], i);
		rgtB[i] = Max(rgtB[i - 1], i);
		while (rgtA[i] < n && s[rgtA[i] + 1] - s[rgtA[i]] >= A) rgtA[i]++;
		while (rgtB[i] < n && s[rgtB[i] + 1] - s[rgtB[i]] >= B) rgtB[i]++;

		LftA[i] = Max(LftA[i - 1], i);
		LftB[i] = Max(LftB[i - 1], i);
		while (LftA[i] <= n && s[LftA[i]] - s[i] < A) LftA[i]++;
		while (LftB[i] <= n && s[LftB[i]] - s[i] < B) LftB[i]++;
	}

	LftA[0] = 2;
	LftB[0] = 2;

	//modify(1, 1, n, 1, 1, f, 1);
	//modify(1, 1, n, 1, 1, g, 1);

	FOR(i, 0, n - 1) {
		LL fi, gi;
		if (i) fi = query(1, 1, n, i, f); else fi = 1;
		if (i) gi = query(1, 1, n, i, g); else gi = 1;
		if (LftB[i] - 1 <= rgtA[i + 1]) modify(1, 1, n, LftB[i] - 1, rgtA[i + 1], f, gi);
		if (LftA[i] - 1 <= rgtB[i + 1]) modify(1, 1, n, LftA[i] - 1, rgtB[i + 1], g, fi);
	}

	printf("%lld\n", (query(1, 1, n, n, f) + query(1, 1, n, n, g)) % MOD);
	
	return 0;
}


Measured memory_bytes: 9344
#include <iostream>
using namespace std;
int main(void){
  int b,r,g,c,s,t;
  while(cin>>b>>r>>g>>c>>s>>t&&!(b==0&&r==0&&g==0&&c==0&&s==0&&t==0)){
    cout<<100+g*7+c*2+r*63+b*95-(t-s)*3<<endl;
  }
  return 0;
}

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

int main(){
    int A,B; cin>>A>>B;
    int ans=0;
    ans+=max(A,B);
    if(A>B){
        A--;
    }else{
        B--;
    }
    ans+=max(A,B);
    cout<<ans<<endl;
    return 0;
}

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

int main() {
  int a, b, c, d = 0;
  cin >> a >> b >> c;
  
  if (a == 5){
    if (b == 7 && c == 5)
      d = 1;
    if (b == 5 && c == 7)
      d = 1;
  }
  
  if (a == 7){
    if (b == 5 && c == 5)
      d = 1;
  }
  
  if (d == 1)
    cout << "YES" << endl;
  else
    cout << "NO" << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef long double ld;
#define pll pair<ll,ll>
#define pb push_back
#define F first
#define S second
#define I insert
#define vll vector<ll>
#define vbl vector<bool>
#define vvll vector<vll>
#define vld vector<ld>
#define vb vector<bool>
#define vc vector<char>
#define vpll vector<pll>
#define all(x) (x).begin(), (x).end()

template<class T> ostream& operator<<(ostream &os, vector<T> V){
	os << "[ ";
	for(auto v  : V) os << v << " ";
	return os << " ]";
}
template<class T> ostream& operator<<(ostream &os, set<T> V){
	os << "[ ";
	for(auto v  : V) os << v << " ";
	return os << " ]";
}
template<class T , class R > ostream& operator<<(ostream &os, map<T , R> V){
	os << "[ ";
	for(auto v  : V) os << "(" << v.first << ":" << v.second << ")";
	return os << " ]";
}
template<class T , class R > ostream& operator<<(ostream &os, pair<T , R> V){
	return os << "(" << V.first << "," << V.second << ")";
}

#define cerr cout
#define TRACE
#ifdef TRACE
    #define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
    template <typename Arg1>
    void __f(const char* name, Arg1&& arg1){
        cerr << name << " : " << arg1 << endl;
    }
    template <typename Arg1, typename... Args>
    void __f(const char* names, Arg1&& arg1, Args&&... args){
        const char* comma = strchr(names + 1, ',');
        cerr.write(names, comma - names) << " : " << arg1<<" | ";
        __f(comma+1, args...);
    }
    clock_t clk=clock();
    #define checktime() cout<<"\nTime Elapsed : "<<float(clock()-clk)/CLOCKS_PER_SEC<<endl
#else
    #define trace(...);
    #define checktime();
#endif

const ll Mod = 1e9 + 7;
// const ll Mod = 998244353;
const ll MAXN = 1e6;

void solve(){
    ll n,m;cin>>n>>m;
    bool a[n][m];
    char c;
    for(ll i=0;i<n;i++) for(ll j=0;j<m;j++) {cin>>c;a[i][j]=(c=='.')?0:1;}

    vvll dp(n,vll(m,1e5));
    for(ll i=0;i<n;i++){
        for(ll j=0;j<m;j++){
            if(i==0&&j==0) dp[i][j]=a[i][j];
            if(i+1<n) dp[i+1][j]=min(dp[i+1][j],dp[i][j]+(ll)(a[i+1][j]&&!a[i][j]));
            if(j+1<m) dp[i][j+1]=min(dp[i][j+1],dp[i][j]+(ll)(a[i][j+1]&&!a[i][j]));
        }
    }
    cout<<dp[n-1][m-1]<<"\n";
}

int main(){
    ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
    cout<<fixed<<setprecision(25);

    ll t=1;
    // cin>>t;
    while(t--){
        solve();
    }
    return 0;
}

Measured memory_bytes: 384
#define _CRT_SECURE_NO_WARNINGS
#include<bits/stdc++.h>
#define fi first
#define se second
#define pb push_back
#define E "\n"

using namespace std;
const long long MOD = (long long)1e9 + 7;

int n, a;

int main()
{
    ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
    cin >> n;
    int nxt = 1;
    for (int i = 1; i <= n; i++) {
        cin >> a;
        if (a == nxt) {
            nxt++;
        }
    }
    if (nxt == 1) {
        cout << -1 << E;
    }
    else {
        cout << n - (nxt - 1) << E;
    }
    //system("pause");
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int main()
{
	long long n,a,ans = 0;
	cin >> n;
	for (int i = 1; i <= n; i++)
		{
			scanf("%d",&a);
			ans += a;
		}
	ans %= 2;	
	if (ans == 0) cout << "YES\n";
		else cout << "NO\n";
	return 0;	
 } 

Measured memory_bytes: 256
// practice with kaiboy
import java.io.*;
import java.util.*;

public class Main extends PrintWriter {
	Main() { super(System.out, true); }
	Scanner sc = new Scanner(System.in);
	public static void main(String[] $) {
		Main o = new Main(); o.main(); o.flush();
	}

	static final int MD = 1000000007;
	void main() {
		byte[] cc = sc.next().getBytes();
		int n = cc.length;
		long a = 0, b = 0, c = 0, k = 1;
		for (int i = 0; i < n; i++) {
			byte x = cc[i];
			if (x == 'A')
				a = (a + k) % MD;
			else if (x == 'B')
				b = (b + a) % MD;
			else if (x == 'C')
				c = (c + b) % MD;
			else {
				long a_ = (a * 3 + k) % MD;
				long b_ = (b * 3 + a) % MD;
				long c_ = (c * 3 + b) % MD;
				a = a_;
				b = b_;
				c = c_;
				k = k * 3 % MD;
			}
		}
		println(c);
	}
}


Measured memory_bytes: 39424
#include <bits/stdc++.h>
#define ll long long
#define INF 999999999
#define MOD 1000000007
#define rep(i,n) for(int i=0;i<n;i++)

using namespace std;

typedef pair<int,int>P;

const int MAX_N = 1400;

int a[MAX_N][MAX_N];
int dp[MAX_N][MAX_N];

int main()
{
	int h,w;
	cin >> h >> w;
	int ans=0;
	rep(i,h){
		rep(j,w){
			scanf("%d",&a[i][j]);
			if(a[i][j]==0){
				dp[i][j] = 1;
				ans = max(ans,dp[i][j]);
			}
		}
	}
	for(int i=1;i<h;i++){
		for(int j=1;j<w;j++){
			if(a[i][j] == 0){
				dp[i][j] = min(dp[i-1][j-1],min(dp[i-1][j],dp[i][j-1]))+1;
				ans = max(ans,dp[i][j]);
			}else{
				dp[i][j] = 0;
			}
		}
	}
	cout << ans*ans << "\n";
}

Measured memory_bytes: 18460
#include<stdio.h>

int main(void)
{
	int p[20],n,i,cout;
	
	scanf("%d",&n);
	for(i = 0; i < n; i++){
		scanf("%d",&p[i]);
	}
	cout = 0;
	
	for(i = 1; i < n-1; i++){
		if(p[i] > p[i-1] && p[i] < p[i+1]){
			cout++;
		}
		else if(p[i] < p[i-1] && p[i] > p[i+1]){
			cout++;
		}
		else{
			
		}
	}
	
	printf("%d\n",cout);
	
	return 0;
}

Measured memory_bytes: 128
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>
#include <functional>
#include <list>
#include <iomanip>
#include <iostream>
#include <numeric>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>
using namespace std;

const int maxn = 100000;
vector<int> adj[maxn];
using ll = long long;
const ll mod = 1e9 + 7;
ll dp[maxn][2];

ll go(int node, int last, int parent) {
  ll& ans = dp[node][last];
  if (ans != -1) return ans;

  ans = 1;
  for (int neighbor : adj[node]) {
    if (neighbor == parent) continue;

    ll tmp = 0;
    for (int color : {0, 1}) {
      if (color == 1 && color == last) continue;
      tmp += go(neighbor, color, node);
      ans %= mod;
    }

    ans *= tmp;
    ans %= mod;
  }
  return ans;
}

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

  for (int i = 0; i < n - 1; i++) {
    int a, b;
    cin >> a >> b;
    a--;
    b--;
    adj[a].push_back(b);
    adj[b].push_back(a);
  }

  memset(dp, -1, sizeof(dp));
  cout << ((go(0, 0, -1) + go(0, 1, -1)) % mod) << endl;

  return 0;
}


Measured memory_bytes: 15616
#include<iostream>
using namespace std;
int main(){
  int x,i;
  cin >> x;

  for(i=1;i<x+1;i++){
    if (i % 3 == 0 || i % 10 == 3) cout << " "<< i;
    
    else if((i / 10) % 10 == 3 ||(i / 100) % 10 == 3 ||(i / 1000) % 10 == 3) cout << " " << i;
  }
  cout << endl;

  return 0;
  
}

Measured memory_bytes: 1160
#include <iostream>
#define FAST ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
using namespace std;
int main() {
   // cout<<"Hello World!";
FAST
int n,m;
cin>>n>>m;
if(n==m)cout<<"Yes";
else
 cout<<"No";

   return 0;
}


Measured memory_bytes: 256
def Qb():
    n = int(input())

    l = [input() for v in range(n)]
    print(f"AC x {l.count('AC')}")
    print(f"WA x {l.count('WA')}")
    print(f"TLE x {l.count('TLE')}")
    print(f"RE x {l.count('RE')}")


if __name__ == '__main__':
    Qb()


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

int main() {
  string s;
  cin>>s;
  vector<long> a={1,0,0,0,0,0,0,0,0,0,0,0,0};
  long mod=1000000007;
  int n=s.size();
  long num=1;
  for(int k=n-1;k>=0;k--){
    vector<long> b(13,0);
    if(s.at(k)=='?'){
      for(int i=0;i<=9;i++){
        for(int j=0;j<13;j++){
          b.at((j+i*num)%13)+=a.at(j);
          b.at((j+i*num)%13)%=mod;
        }
      }
    }
    else{
      int i=(int)(s.at(k)-'0');
      for(int j=0;j<13;j++){
        b.at((j+i*num)%13)+=a.at(j);
        b.at((j+i*num)%13)%=mod;
      }
    }
    num*=10;
    num%=13;
    a=b;
  }
  cout<<a.at(5)%mod<<endl;
}


Measured memory_bytes: 512
#include<iostream>
#include <string>
#include <cstring>
#include <cmath>
#include <stdio.h>
using namespace std;
 
int main(){
    string A, B;
    cin>> A>>B;
	int length = (int)(A.length());
  	string B2 = B.substr(0,length);
    if (A==B2) cout << "Yes"<<endl;
    else cout<<"No"<<endl;
    return 0;
}

Measured memory_bytes: 3576
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define F first
#define S second
#define pii pair<int, int>
#define eb emplace_back
#define all(v) v.begin(), v.end()
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define rep3(i, l, n) for (int i = l; i < (n); ++i)
#define sz(v) (int)v.size()
const int inf = 1e9 + 7;
const ll INF = 1e18;
const int mod = 1000000007;
#define abs(x) (x >= 0 ? x : -(x))
#define lb(v, x) (int)(lower_bound(all(v), x) - v.begin())
#define ub(v, x) (int)(upper_bound(all(v), x) - v.begin())
template<typename T1, typename T2> inline bool chmin(T1 &a, T2 b) { if (a > b) { a = b; return 1; } return 0; }
template<typename T1, typename T2> inline bool chmax(T1 &a, T2 b) { if (a < b) { a = b; return 1; } return 0; }
template<typename T> T gcd(T a, T b) { if (b == 0) return a; return gcd(b, a % b); }
template<typename T> T lcm(T a, T b) { return a / gcd(a, b) * b; }
template<typename T> T pow(T a, int b) { return b ? pow(a * a, b / 2) * (b % 2 ? a : 1) : 1; }
ll modpow(ll a, int b, int _mod) { return b ? modpow(a * a % _mod, b / 2, _mod) * (b % 2 ? a : 1) % _mod : 1; }
template<class T> ostream& operator << (ostream& os, const vector<T>& vec) { for (auto &vi: vec) os << vi << " "; return os; }
template<class T, class U> ostream& operator << (ostream& os, const pair<T, U>& p) { os << p.F << " " << p.S; return os; }
template<typename T >inline istream& operator >> (istream& is, vector<T>& v) { rep(j, sz(v)) is >> v[j]; return is; }
template<class T> inline void add(T &a, int b) { a += b; if (a >= mod) a -= mod; }



void solve();

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

    int T;
    // cin >> T;
    T = 1;

    while (T--) {
        solve();
    }
}

void solve() {
  int n;
  cin >> n;
  vector<int> a(n);
  cin >> a;
  vector<int> acc(n + 1);
  rep(i, n) acc[i + 1] = acc[i] + a[i];

  int ans = inf;
  rep(i, n) {
    chmin(ans, abs(acc[n] - acc[i + 1] - acc[i + 1]));
  }
  cout << ans << endl;
}


Measured memory_bytes: 256
def isEven(x):
    if x % 2 == 0:
        return True
    return False

def checkTerm(x):
    if(x % 3 == 0 or x % 5 == 0):
        return True
    return False

N = int(input())

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

checkFlag = True

for i in range(N):
    if(isEven(a[i])):
        if(checkTerm(a[i])):
            checkFlag = True
        else:
            checkFlag = False
            break

if(checkFlag):
    print('APPROVED')
else:
    print('DENIED')

Measured memory_bytes: 3064
Q = int(input())

while Q:
    Q -= 1
    A, B = map(int, input().split())
    M = max(A, B)
    m = min(A, B)
    if M == m:
        print(2 * m - 2)
        continue
    if M == m + 1:
        print(2 * m - 2)
        continue
    last = int((M * m) ** 0.5)
    if last == (M * m) ** 0.5:
        last -= 1
    if last * (last + 1) >= M * m:
        print(last * 2 - 2)
    else:
        print(last * 2 - 1)


Measured memory_bytes: 3188
import sys
def input(): return sys.stdin.readline().strip()


def main():
    N = int(input())
    A = [0] + list(map(int, input().split()))
    ans = 0
    for i in range(1, N + 1):
        if i % 2 != 0 and A[i] % 2 != 0: ans += 1
    print(ans)


if __name__ == "__main__":
    main()


Measured memory_bytes: 61768
#include<bits/stdc++.h> //ABC 137_a 
using namespace std;
int main(){
	int A,B,ja,jn,ch,maxl,maxll;
	cin>>A>>B;
	ja=A+B;
	jn=A-B;
	ch=A*B;
	maxl=max(ja,jn);
	maxll=max(ch,maxl);
	cout<<maxll;
	return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main()
{
   map <long long int, long long int >mp;
   map <long long int, long long int >:: iterator it;
   vector<long long int >v;
   long long int n,i,j,k,c=0,x;
   cin>>n;
   while(n--)
   {
       cin>>x;
       mp[x]++;
   }
   for(it = mp.begin();it!=mp.end();it++)
   {
       if(it->second%2==1)
        c++;
   }
   cout<<c<<endl;
}


Measured memory_bytes: 6528
package main
import (
	"os"
	"fmt"
	"strings"
	"bufio"
)

func main(){
	scanner := bufio.NewScanner(os.Stdin)
	scanner.Split(bufio.ScanWords)
	var t, w string
	scanner.Scan()
	w = strings.ToLower(scanner.Text())
	cnt := 0
	for scanner.Scan(){
		t = scanner.Text()
		if t=="END_OF_TEXT"{
			fmt.Println(cnt)
		}
		if strings.ToLower(t)==w{
			cnt++
		}
	}
}


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

#define INF 1.1e9
#define LINF 1.1e18
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define REP(i, n) FOR(i, 0, n)
#define RREP(i, n) for (int i = (n) - 1; i >= 0; i--)
#define ALL(v) (v).begin(), (v).end()
#define pb push_back
#define pf push_front
#define fi first
#define se second
#define BIT(x, n) bitset<n>(x)
#define PI 3.14159265358979323846

typedef long long ll;
typedef pair< int, int > P;
typedef pair< int, P > PP;

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


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

	int n;
	cin >> n;
	int sum = 0, n_ = n;
	while(n_) sum += n_ % 10, n_ /= 10;
	cout << (n % sum == 0 ? "Yes": "No") << endl;

	return 0;
}



Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <string>
using namespace std;
using ll=long long;
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define inf 1001001001
typedef pair<int,int> P;
#define mod 1000000007



int main(){
    int x,a,b;
    cin >> x >> a >> b;
    int da=abs(x-a);
    int db=abs(x-b);
    if(da>db) cout << 'B' << endl;
    else cout << 'A' << endl;
    return 0;
}

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

int main(){
	int n,i;
	long int a=1;
	string s1,s2;
	cin >> n >> s1 >> s2;
	for(i=0; i<n; i++){
		if(s1[i] == s2[i]){
			if(i == 0){
				a *= 3;
			}else if(s1[i-1] == s2[i-1]){
				a *= 2;
			}
		}else{
			if(i == 0){
				a *= 6;
			}else if(s1[i-1] == s2[i-1]){
				a *= 2;
			}else{
				a *= 3;
			}
			i++;
		}
		a %= 1000000007;
	}
	cout << a;
	return 0;
}

Measured memory_bytes: 384
import sys
input = sys.stdin.readline

mod = 10**9+7
n, m = map(int, input().split())
x = list(map(int, input().split()))
y = list(map(int, input().split()))
f = 0
for j in range(m-1):
    f = (f + (y[j+1]-y[j])*(j+1)*(m-j-1)) % mod
ans = 0
for i in range(n-1):
    ans = (ans + (x[i+1]-x[i])*(i+1)*(n-i-1)*f) % mod
print(ans)

Measured memory_bytes: 74852
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll INF = 1LL<<60;
#define all(x) (x).begin(),(x).end()
#define REP(i,n) for(int i=0; i<(n);++i)
#define FOR(i,k,n) for(int i=(k);i<(n);++i)

const ll MOD=1000000007;

ll perm(int x, int y){
    if (y>x || x<0 || y<0)return 0;
    ll res=1;
    REP(i,y){
        res*=(ll)(x);res%=MOD;
        x--;
    }
    return res;
}

int main(){
    int N;ll K;cin>>N>>K;
    int a,b;
    vector<vector<int> > G(N);
    REP(i,N-1){
        cin>>a>>b;a--;b--;
        G[a].push_back(b);
        G[b].push_back(a);
    }
    ll res=K;
    REP(i,N){
        res*=(i?perm(K-2,G[i].size()-1):perm(K-1,G[i].size()));
      	res%=MOD;
    }
    cout<<res<<endl;
    return 0;
}

Measured memory_bytes: 7792
from sys import stdin,stdout

def main():
    line=stdin.readline()
    parts=line.split()
    a=int(parts[0])
    b=int(parts[1])
    c= int(parts[2])
    l=[a,b,c]
    l.sort()
    if l[0]==5 and l[1]==5 and l[2]==7:
        stdout.write("YES")
    else:
        stdout.write("NO")
main()

Measured memory_bytes: 9068
#include<cstdio>
#include<algorithm>
using namespace std;
typedef long long ll;

ll a,b,n,ans;

int main() {
	scanf("%lld %lld %lld",&n,&a,&b);
	ans=n/(a+b);
	n-=ans*(a+b);
	ans=ans*a;
	ans+=min(n,a);
	printf("%lld\n",ans);
	return 0;
}


Measured memory_bytes: 128
#include<iostream>
#include<iomanip>
#include<string>
#include<vector>
#include<stack>
#include<queue>
#include<deque>
#include<set>
#include<map>
#include<utility>
#include<tuple>
#include<algorithm>
#include<cmath>
#include<climits>
using namespace std;

#define rep(i,n) for(int i=0; i<(n); i++)
typedef long long ll;
const int mod=1e9+7;

class unionFind{
  vector<int> p;
public:
  unionFind(int n){
    p = vector<int>(n, -1);
  }
  int root(int x){
    if (p[x] < 0)
      return x;
    return p[x] = root(p[x]);
  }
  int size(int x){
    return -p[root(x)];
  }
  bool unite(int x, int y){
    x = root(x);
    y = root(y);
    if(x == y){
      return false;
    }
    if(size(x) < size(y))
      swap(x, y);
    p[x] += p[y];
    p[y] = x;
    return true;
  }
};

int main(){
  int n, m;
  cin >> n >> m;
  vector<pair<int, int>> a(m);
  rep(i, m) {
    cin >> a[i].first >> a[i].second;
    a[i].first--;
    a[i].second--;
  }
  unionFind uni(n);
  vector<ll> res(m);
  res[m-1] = (ll)n*(n-1)/2;
  for(int i=m-1; i>0; i--){
    ll sx = uni.size(a[i].first), sy = uni.size(a[i].second);
    if(uni.unite(a[i].first, a[i].second)){
      res[i-1] = res[i]-sx*sy;
    }
    else
      res[i-1] = res[i];
  }
  rep(i,m) cout << res[i] << endl;
  return 0;
}


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

//template
#define rep(i,a,b) for(int i=(a);i<(b);i++)
#define rrep(i,a,b) for(int i=(a);i>(b);i--)
#define ALL(v) (v).begin(),(v).end()
typedef long long int ll; typedef pair<ll, ll> P;
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; }
template<typename A,size_t N,typename T>void Fill(A(&array)[N],const T &val){fill((T*)array, (T*)(array+N), val);}
const int inf = 0x3fffffff; const ll INF = 0x3fffffffffffffff;
//template end

int mod = 1e9+7;
struct Mint {
    int val;
    Mint inv() const {
        int tmp, a = val, b = mod, x = 1, y = 0;
        while(b) tmp = a / b, a -= tmp * b, swap(a, b), x -= tmp * y, swap(x, y);
        return Mint(x);
    }
public:
    Mint() :val(0) {}
    Mint(ll x) :val(x >= 0 ? x % mod : x % mod + mod) {}
    int mtoi() { return this->val; }
    Mint pow(ll t) { Mint res = 1,b = *this; while(t){if(t&1)res *= b;b *= b;t >>= 1;}return res; }
    Mint& operator+=(const Mint& x) { if ((val += x.val) >= mod) val -= mod; return *this; }
    Mint& operator-=(const Mint& x) { if ((val += mod - x.val) >= mod) val -= mod; return *this; }
    Mint& operator*=(const Mint& x) { val = (ll)val * x.val % mod; return *this; }
    Mint& operator/=(const Mint& x) { return *this *= x.inv(); }
    bool operator==(const Mint& x) const { return val == x.val; }
    bool operator!=(const Mint& x) const { return val != x.val; }
    bool operator<(const Mint& x) const { return val < x.val; }
    bool operator<=(const Mint& x) const { return val <= x.val; }
    bool operator>(const Mint& x) const { return val > x.val; }
    bool operator>=(const Mint& x) const { return val >= x.val; }
    Mint operator+(const Mint& x) const { return Mint(*this) += x; }
    Mint operator-(const Mint& x) const { return Mint(*this) -= x; }
    Mint operator*(const Mint& x) const { return Mint(*this) *= x; }
    Mint operator/(const Mint& x) const { return Mint(*this) /= x; }
};
struct factorial {
    vector<Mint> Fact, Finv;
public:
    factorial(int maxx) {
        Fact.resize(maxx+1),Finv.resize(maxx+1); Fact[0]=Mint(1); rep(i,0,maxx)Fact[i+1]=Fact[i]*Mint(i+1);
        Finv[maxx]=Mint(1)/Fact[maxx]; rrep(i,maxx,0)Finv[i-1]=Finv[i]*Mint(i);
    }
    Mint fact(int n,bool inv=0) { if(inv) return Finv[n]; else return Fact[n]; }
    Mint nPr(int n,int r) { if(n<0||n<r||r<0) return Mint(0); else return Fact[n]*Finv[n-r]; }
    Mint nCr(int n,int r) { if(n<0||n<r||r<0) return Mint(0); else return Fact[n]*Finv[r]*Finv[n-r]; }
};

Mint dp[110][80000],ans;

int main(){
    int n,k; scanf("%d%d",&n,&k);
    vector<int> d;
    for(int i=1;i*i<=n;i++){
        d.push_back(i); d.push_back(n/i);
    }
    d.push_back(0); sort(ALL(d));
    int sz=d.size(); dp[0][0]=1;
    rep(i,0,k){
        rep(j,0,sz-1)dp[i][j+1]+=dp[i][j];
        rep(j,0,sz-1)dp[i+1][j]=dp[i][sz-j-2]*Mint(d[j+1]-d[j]);
    }
    rep(i,0,sz)ans+=dp[k][i];
    printf("%d\n",ans.mtoi());
    return 0;
}

Measured memory_bytes: 34944
#include <iostream>
#include <numeric>
#include <string> // string, to_string, stoi
#include <vector> // vector
#include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound
#include <utility> // pair, make_pair
#include <tuple> // tuple, make_tuple
#include <cstdint> // int64_t, int*_t
#include <cstdio> // printf
#include <map> // map
#include <queue> // queue, priority_queue
#include <set> // set
#include <stack> // stack
#include <deque> // deque
#include <unordered_map> // unordered_map
#include <unordered_set> // unordered_set
#include <bitset> // bitset
#include <cctype> // isupper, islower, isdigit, toupper, tolower
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)




int main() {

	int K, N;
	cin >> K >> N;
	int mmmax=0;
	
	vector<int> vec(N);
	for (int i = 0; i < N; i++) {
		cin >> vec.at(i);
	}
	for (int i = 1; i < N; i++) {
		mmmax=max(mmmax, vec.at(i)- vec.at(i-1));
	}
	mmmax = max(mmmax, K + vec.at(0) - vec.at(N - 1));
	cout << K-mmmax << endl;
}

Measured memory_bytes: 1024
import sys

sys.setrecursionlimit(10**6)
input = sys.stdin.readline

def main():
    order_F = []
    order_F = input().rstrip().split('T')
    x, y = map(int, input().split())
    vert_DP = [False] * 8001
    side_DP = [False] * 8001
    vert_DP[0] = True
    side_DP[0] = True
    vert_sum = 0
    side_sum = 0
    distance = [len(order_F[i]) for i in range(len(order_F))]
    order_len = len(order_F)
    x -= len(order_F[0])
    vert_last = 0
    side_last = 0
    for i in range(1, order_len):
        if i % 2 == 0:
            side_sum += distance[i]
            for j in reversed(range(side_last+1)):
                if side_DP[j]:
                    side_DP[j + distance[i]] = True
            side_last += distance[i]
        else:
            vert_sum += distance[i]
            for j in reversed(range(vert_last+1)):
                if vert_DP[j]:
                    vert_DP[j + distance[i]] = True
            vert_last += distance[i]
    if side_sum < x or vert_sum < y:
        print("No")
    elif (side_sum - x) % 2 == 1 or (vert_sum - y) % 2 == 1:
        print("No")
    else:
        if side_DP[(side_sum - x)//2] and vert_DP[(vert_sum - y)//2]:
            print("Yes")
        else:
            print("No")

if __name__ == "__main__":
    main()


Measured memory_bytes: 3316
import sys

ans ,flag, num = 0, 0, []
for line in sys.stdin:
    word = line[:-1]
    for j in xrange(len(word)):
        try: 
            int(word[j])
            num.append(word[j])
            flag = 1 
        except:
            if flag == 1:
                ans += int("".join(num))
                num = []
                flag = 0
            else: pass
print ans

Measured memory_bytes: 6248
#include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for(ll i=0;i<n;i++)
#define repl(i,l,r) for(ll i=(l);i<(r);i++)
#define per(i,n) for(ll i=n-1;i>=0;i--)
#define perl(i,r,l) for(ll i=r-1;i>=l;i--)
#define fi first
#define se second
#define pb push_back
#define ins insert
#define pqueue(x) priority_queue<x,vector<x>,greater<x>>
#define all(x) (x).begin(),(x).end()
#define CST(x) cout<<fixed<<setprecision(x)
#define vtpl(x,y,z) vector<tuple<x,y,z>>
#define rev(x) reverse(x);
using ll=long long;
using vl=vector<ll>;
using vvl=vector<vector<ll>>;
using pl=pair<ll,ll>;
using vpl=vector<pl>;
using vvpl=vector<vpl>;
const ll MOD=1000000007;
const ll MOD9=998244353;
const int inf=1e9+10;
const ll INF=4e18;
const ll dy[8]={1,0,-1,0,1,1,-1,-1};
const ll dx[8]={0,-1,0,1,1,-1,1,-1};
ll powmod(ll n, ll k, ll m) {
ll r=1;
 for(; k>0; k >>=1) {
   if(k&1) r=(r*n)%m;
   n=(n*n)%m;
 }
  return r;
}

ll fact(ll n) {
ll a=1;
rep(i,n) {
a=a*(n-i);
}
return a;
}

ll pow(ll a, ll b) {
ll x=1;
rep(i,b) {
x=x*a;
}
return x;
}



int main() {
ll N;
  cin >>N;
  vl d1(N);
  vl d2(N);
  rep(i,N) {
cin >>d1.at(i)>>d2.at(i);
  }
  
  ll c=0;
  rep(i,N-2) {
if((d1.at(i)==d2.at(i)) &&(d1.at(i+1)==d2.at(i+1))&&(d1.at(i+2)==d2.at(i+2))) {
c=1;
  break;
}
  }
  
  
  if(c) {
cout<<"Yes"<<endl;
  }
else {
cout<<"No"<<endl;
}

  
}
  

Measured memory_bytes: 3628
#include <queue>
#include <limits>
#include <iostream>

using namespace std;

int main()
{
	int n, MAX = numeric_limits<int>::min();

	queue<int> R;

	cin >> n;

	for (int i = 0; i < n; i++)
	{
		int temp;

		cin >> temp;

		R.push(temp);

		if (MAX < R.back() - R.front() && R.size() > 1)
		{
			MAX = R.back() - R.front();
		}

		if (R.back() < R.front())
		{
			while (R.size() > 1)
			{
				R.pop();
			}
		}
	}

	cout << MAX << endl;

	return 0;
}

Measured memory_bytes: 1808
object Main extends App {
  var s = scala.io.StdIn.readInt()
  var seqInt = Seq(s)

  def nextJudge(i: Int): Unit = {
    var nextInt = 0
    if(i % 2 == 0) {
      nextInt = i / 2
    } else {
      nextInt = 3 * i + 1
    }
    seqInt.find(_ == nextInt).fold
      {seqInt :+= nextInt
       nextJudge(nextInt)
      }
      {_=> println(seqInt.size + 1)}
  }
  nextJudge(s)
}

Measured memory_bytes: 25376
#include <iostream>
#include <string>
using namespace std;
int main()
{
	int N, K;
	string S;
	cin >> N >> S >> K;
	char target = S[K - 1];
	for(char& c : S)
	{
		if(c != target) c = '*';
	}
	cout << S << endl;
	return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define PI 3.14159265359
#define NIL (-1)
#define LL long long
using namespace std;
const int64_t MOD = 1e9 + 7;

int main() {
	string s;
	int K;
	cin >> s >> K;

	vector<string> v;

	for (int i = 0; i < s.size(); i++) {
		for (int j = 1; i + j <= s.size(); j++) {
			if (j > K) break;
			string a = s.substr(i, j);
			v.push_back(a);
		}
	}

	sort(v.begin(), v.end());
	unique(v.begin(), v.end());

	cout << v.at(K - 1) << endl;
}

Measured memory_bytes: 4280
#include <bits/stdc++.h>
using namespace std;
#define rep(i,c) for(int i=0;i<c;++i)
int main(){
 int a;
 cin >> a;
 if(a%2==0){
   cout << a/2 << endl;
 }else{
   cout << (a/2)+1 << endl;
 }
return 0;
}

Measured memory_bytes: 256
#include <algorithm>
#include <cstdio>
#include <iostream>
#include <map>
#include <cmath>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
#include <stdlib.h>
#include <stdio.h>
#include <bitset>
#include <cstring>
#include <deque>
using namespace std;
#define FOR(I,A,B) for(int I = (A); I < (B); ++I)
#define CLR(mat) memset(mat, 0, sizeof(mat))
typedef long long ll;
typedef pair<ll, ll> Pii;
const ll inf = 1e18;

struct edge{
  ll to, cost;
  edge(ll t, ll c) {
    to = t, cost = c;
  }
};
int N, M, K, S, P, Q;
vector<edge> G[100005];
ll d[100005];
void dijkstra(int s){
  priority_queue<Pii, vector<Pii>, greater<Pii> >que;
  FOR(i,1,N+1) d[i] = inf;
  d[s] = 0;
  que.push(Pii(0, s));
  while(!que.empty()){
    Pii p = que.top(); que.pop();
    ll v = p.second;
    if(d[v] < p.first) continue;
    for(auto &e : G[v]){
      if(d[e.to] > d[v] + e.cost){
        d[e.to] = d[v] + e.cost;
        que.push(Pii(d[e.to], e.to));
      }
    }
  }
}
queue<Pii> que2;
ll zonbiDist[100005];
int main()
{
  ios::sync_with_stdio(false);
  cin.tie(0);
  cin >> N >> M >> K >> S;
  cin >> P >> Q;
  FOR(i,0,N+1) zonbiDist[i] = inf;
  FOR(i,0,K) {
    int c; cin >> c;
    que2.push(Pii(c, 0));
  }
  FOR(i,0,M) {
    int a, b; cin >> a >> b;
    G[a].push_back(edge(b, 0));
    G[b].push_back(edge(a, 0));
  }
  // S??????????????¢????????????
  while(!que2.empty()) {
    Pii p = que2.front(); que2.pop();
    int c = p.first;
    ll dis = p.second;
    if(zonbiDist[c] <= dis) continue;
    zonbiDist[c] = dis;
    for(auto to : G[c]) {
      if(zonbiDist[to.to] <= dis + 1) continue;
      que2.push(Pii(to.to, dis + 1));
    }
  }
  FOR(i,1,N+1) {
    FOR(j,0,G[i].size()) {
      if(G[i][j].to == N) continue;
      if(zonbiDist[G[i][j].to] == 0) {
        G[i][j].cost = inf;
      } else if(zonbiDist[G[i][j].to] <= S) {
        G[i][j].cost = Q;
      } else {
        G[i][j].cost = P;
      }
    }
  }
  dijkstra(1);
  cout << d[N] << endl;
  return 0;
}

Measured memory_bytes: 17684
import collections
N = int(input())
A = [int(i) for i in input().split()]
count = collections.Counter(A)
ans = 0
if N%2 == 1:
  for k,v in count.items():
    if k%2 == 1 or (k != 0 and v != 2):
      break
  else:
    ans = 2**(N//2)
else:
  for k,v in count.items():
    if k%2 == 0 or v != 2:
      break
    else:
      ans = 2**(N//2)
print(ans%(10**9+7))

Measured memory_bytes: 55532
#include<iostream>
#include<algorithm>
#include<vector>
#include<queue>
#include<deque>
#include<map>
#include<set>
#include<string>
#include<sstream>
#include<cstdio>
#include<cmath>
#include<cstring>
#include<cctype>
#include<climits>
using namespace std;
#define REP(i, j) for(int i = 0; i < j; i++)
#define FOR(i, j, k) for(int i = j; i < k; i++)
#define P pair<int, int>
const int INF = INT_MAX / 2;

int n, k;
set<string> ans;

void loop(string str, vector<string> s, vector<bool> used, int cnt){
    if(cnt >= k){
        ans.insert(str);
    } else{
        REP(i, used.size()){
            if(used[i] == false){
                used[i] = true;
                loop(str + s[i], s, used, cnt + 1);
                used[i] = false;
            }
        }
    }
}


int main(){
    while(cin >>n >>k && (n || k) ){
        ans.clear();
        vector<string> s(n);
        vector<bool> used(n, false);
        REP(i, n) cin >>s[i];

        loop("", s, used, 0);
        cout <<ans.size() <<endl;
    }

    return 0;
}

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

using namespace std;
int main()
{
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
int n,s;
 cin>>n;
vector<int> v(n,0);
for(int i=0;i<n;i++)
cin>>v[i];
s=0;
for (auto i = 0; i < n-1; i++)
{
  if (v[i]==v[i+1]){
   s++;
   i++;
  }
}
cout<<s;
  return 0;
}

Measured memory_bytes: 256
#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
const int INF = (1<<30);
const ll INFLL = (1ll<<60);
const ll MOD = (ll)(1e9+7);

#define l_ength size

void mul_mod(ll& a, ll b){
	a *= b;
	a %= MOD;
}

void add_mod(ll& a, ll b){
	a = (a<MOD)?a:(a-MOD);
	b = (b<MOD)?b:(b-MOD);
	a += b;
	a = (a<MOD)?a:(a-MOD);
}

ll cnt[100100]={3ll};

int main(void){
	int n,i,a;
	ll ans = 1ll;
	cin >> n;
	for(i=0; i<n; ++i){
		cin >> a;
		mul_mod(ans,cnt[a]);
		--cnt[a]; ++cnt[a+1];
	}
	cout << ans << endl;
	return 0;
}


Measured memory_bytes: 1024
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		int n = in.nextInt();
		List<Long> a = new ArrayList<>();
		List<Long> b = new ArrayList<>();
		for (int i = 0; i < n; i++) {
			if (i % 2 == 0) {
				a.add(in.nextLong());
			} else {
				b.add(in.nextLong());
			}
		}
		StringBuilder ans = new StringBuilder();
		if (n % 2 == 0) {
			Collections.reverse(b);
			for (int i = 0; i < b.size(); i++) {
				ans.append(b.get(i));
				ans.append("\n");
			}
			for (int i = 0; i < a.size(); i++) {
				ans.append(a.get(i));
				ans.append("\n");
			}
		} else {
			Collections.reverse(a);
			for (int i = 0; i < a.size(); i++) {
				ans.append(a.get(i));
				ans.append("\n");
			}
			for (int i = 0; i < b.size(); i++) {
				ans.append(b.get(i));
				ans.append("\n");
			}
		}
		System.out.println(ans.toString());
		in.close();
	}
}

Measured memory_bytes: 97844
#include <bits/stdc++.h>
using namespace std;
#define REP(i,n) for(int i=0; i<(int)(n); i++)
#define RNG(i,from,to) for(int i=(from); i<(int)(to); i++)
#define gcd(i,j) __gcd((i), (j))
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<ll> vecll;
template<typename S, typename T> string to_string(pair<S, T> p) { return "("+to_string(p.first)+","+to_string(p.second)+")"; }
template<typename T> string to_string(T p[2]) { return "["+to_string(p[0])+","+to_string(p[1])+"]"; }
template<typename T> void println(T e){ cout << to_string(e) << endl; }
template<typename T> void println(const vector<T>& v){ cout << "[";for(const auto& e : v){ cout << to_string(e) << ","; }cout << "]";cout << endl; }
template<typename T> void println(const vector<vector<T>>& vv){ for(const auto& v : vv){ println(v); } }
template<typename Iter> void println(Iter first, Iter last){ for(auto it=first; it != last; it++){ cout << *it << " "; }; cout << endl; }
template<typename T> T mod_pow(T x, T n, const T &p) { T ret = 1; while(n > 0) { if(n & 1) (ret *= x) %= p; (x *= x) %= p; n >>= 1; } return ret; }
template<typename T> T mod_inv(T x, const T &p) { return mod_pow(x, p-2, p); }
const ll DVSR = 1e9+7;


int main(int argc, char const *argv[])
{
  string S; cin >> S;
  cout << ((S[0] == S[1] && S[1] == S[2]) ? "No" : "Yes")  << endl;
  return 0;
}


Measured memory_bytes: 256
# -*- coding: utf-8 -*-
"""
Created on Wed Aug  8 12:24:08 2018

@author: Yuki
"""

A, B, C = map(int, input().split())
min_of_int = min(min(A, B), C)
A -= min_of_int
B -= min_of_int
C -= min_of_int

max_of_int = max(A, max(B, C))
sum_of_delta = 3 * max_of_int - (A + B + C)

if sum_of_delta % 2 == 0:
    print(sum_of_delta//2)
else:
    print(sum_of_delta//2 + 2)


Measured memory_bytes: 3064
#include <bits/stdc++.h>
#define GET_MACRO(_1,_2,_3,_4,_5,NAME,...) NAME
#define pr(...) GET_MACRO(__VA_ARGS__,pr5,pr4,pr3,pr2,pr1)(__VA_ARGS__)
#define pr1(a) (#a)<<"="<<(a)
#define pr2(a,b) pr1(a)<<", "<<pr1(b)
#define pr3(a,b,c) pr2(a,b)<<", "<<pr1(c)
#define pr4(a,b,c,d) pr3(a,b,c)<<", "<<pr1(d)
#define pr5(a,b,c,d,e) pr4(a,b,c,d)<<", "<<pr1(e)
#define int long long
#define double long double
using namespace std;
const int N = 100010;
const int INF = 1LL<<55;
const int mod = (1e9)+7;
const double EPS = 1e-8;
const double PI = 6.0 * asin(0.5);
typedef pair<int,int> P;
typedef long long ll;
template<class T> T Max(T &a,T b){return a=max(a,b);}
template<class T> T Min(T &a,T b){return a=min(a,b);}
ostream& operator<<(ostream& o,P p){return o<<"("<<p.first<<","<<p.second<<")";}
istream& operator>>(istream& i,P &p){return i>>p.first>>p.second;}
ostream& operator<<(ostream& o,vector<auto> &a){int i=0;for(auto t:a)o<<(i++?" ":"")<<t;return o;}
istream& operator>>(istream& i,vector<auto> &a){for(auto &t:a)i>>t;return i;}
void prArr(auto a,string s=" "){int i=0;for(auto t:a)cout<<(i++?s:"")<<t;cout<<endl;}

int mem[1000][1000],used[1000][1000];
int dfs(int A,int B){
  if( A < 2 && B < 2) return 0; 
  if( used[A][B]++ ) return mem[A][B];
  set<int> S;
  
  for(int i=1;i*2 <= A;i++) S.insert( dfs(A - 2 * i, B + i) );
  for(int i=1;i*2 <= B;i++) S.insert( dfs(A + i, B - 2 * i ));
  
  int res = 0;
  while(S.count(res)) res++;
  return mem[A][B] = res;
}

signed main(){

  for(int A = 0;A < 30; A++){
    for(int B = 0; B < 30; B++){
      //cout<<dfs(A,B)<<" ";
      //if(dfs(A,B) == 0) cout<<pr(A,B)<<endl;
    }
    //cout<<endl;
  }

  int A,B;
  cin>>A>>B;
  
  int ans = abs(A - B) > 1;
  cout<<(ans?"Alice":"Brown")<<endl;
  
  return 0;
}


Measured memory_bytes: 256
#define _CRT_SECURE_NO_WARNINGS
#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
using namespace std;

int main() {
	int n,count=0;
	int ans = 0;
	cin >> n;
	vector<int> d(n);
	for (int i = 0; i < n; i++) {
		cin >> d[i];
	}
	for (int i = 0; i < n; i++) {
		for (int j = 0; j < n; j++) {
			if (i != j)
				ans = ans + d[i] * d[j];
		}
	}
	cout << ans/2 << endl;
	return 0;
}

Measured memory_bytes: 256
#include <cstdio>
#include <cstdlib>
#include <cassert>
#include <algorithm>
#include <functional>
#include <iostream>
#include <map>
#include <numeric>
#include <set>
#include <string>
#include <vector>
#define repi(i,a,b) for(int i=(a);i<(b);++i)
#define rep(i,a) repi(i,0,a)
#define all(a) (a).begin(), (a).end()

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

using ll = long long;

ll x, y;
ll ans = 1ll<<60;

int main()
{
  std::cin >> x >> y;

  rep( s1, 2 ) rep( s2, 2 )
  {
    if( (s2?-1:1)*x <= (s1?-1:1)*y )
      chmin( ans, (s1?-1:1)*y-(s2?-1:1)*x+s1+s2 );
  }

  std::cout << ans << std::endl;

  return 0;
}

Measured memory_bytes: 256
#include<iostream>
using namespace std;
using ll = long long;

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

	ll answer = 0;
	ll i = 100;
	ll n = 100;

	while (i < X) {
		i += n / 100;
		n = i;
		answer++;
	}

	cout << answer << endl;
}

Measured memory_bytes: 3636
#include <iostream>
#include <string>
#include <array>
#include <vector>
#include <queue>
#include <stack>
#include <list>
#include <set>
#include <map>
#include <algorithm>
#include <cmath>
#include <iomanip>

#define FOR(i, a, b) for(decltype(b) i = (a); i < (b); ++i)
#define REP(i, n) FOR(i, 0, n)

typedef long long ll;
typedef unsigned long long ull;
typedef unsigned int uint;

using namespace std;

#ifdef INPUT
#include <sstream>
stringstream input(R"(
100000 1000000000
)");
#define cin input
#endif

map<int, int> primeFactors(int n) 
{ 
	map<int, int> s;
    while (n%2 == 0) 
    { 
        ++s[2];
        n = n/2; 
    } 
    for (int i = 3; i <= sqrt(n); i = i+2) 
    { 
        while (n%i == 0) 
        { 
			++s[i];
            n = n/i; 
        } 
    } 
    if (n > 2) 
		++s[n];
	return s;
} 

ll inv_mod( ll a, ll m )
{
  ll b, x, u, q, abs_m, tmp; 

  abs_m = ( m < 0 ) ? -m : m;
  b = m; x = 1; u = 0; 
  while ( b > 0 ) {
    q = a / b; 
    tmp = u; u = x - q * u; x = tmp;
    tmp = b; b = a - q * b; a = tmp;
  }

  return ( x < 0 ) ? abs_m + x : x;
}

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

	auto s = primeFactors(m);

    const ll mod = 1000000007ll;
	ll mx = n + 64;
    vector<ll> frac(mx + 1);
    frac[0] = 1;
    REP (i, mx)
        frac[i + 1] = frac[i] * (i + 1) % mod;

    vector<ll> fraci(mx + 1);
    fraci[mx] = inv_mod(frac[mx], mod);
    for (auto i = mx; i > 0; --i)
        fraci[i - 1] = fraci[i] * i % mod;

	ll r = 1;

	for (auto i : s)
	{
		r *= frac[i.second + n - 1] * fraci[i.second] % mod * fraci[n - 1] % mod;
		r %= mod;
	}

	cout << r << endl;

	return 0;
}


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

#define NDEBUG
#ifdef DEBUG
#include "../cout11.h"
#undef NDEBUG
#endif
#include <cassert>

#ifdef DEBUG
#define debug(...) fprintf(stderr, __VA_ARGS__)
#else
#define debug(...)
#endif

typedef long long ll;
typedef long double Double;
typedef unsigned long long ull;
typedef pair<int,int> ii;
typedef pair<ll,ll> llll;
typedef pair<double,double> dd;

typedef vector<int> vi;
typedef vector<vector<int>> vvi;
typedef vector<ii> vii;
typedef vector<vector<ii>> vvii;
typedef vector<ll> vll;
typedef vector<string> vs;
typedef vector<double> vd;
typedef vector<long double> vD;

#define sz(a)  int((a).size())
#define pb  push_back
#define eb  emplace_back
#define FOR(var,from,to) for(int var=(from);var<=(to);++var)
#define rep(var,n)  for(int var=0;var<(n);++var)
#define rep1(var,n)  for(int var=1;var<=(n);++var)
#define repC2(vari,varj,n)  for(int vari=0;vari<(n)-1;++vari)for(int varj=vari+1;varj<(n);++varj)
#define ALL(c)  (c).begin(),(c).end()
#define RALL(c)  (c).rbegin(),(c).rend()
#define tr(i,c)  for(auto i=(c).begin(); i!=(c).end(); ++i)
#define found(s,e)  ((s).find(e)!=(s).end())
#define mset(arr,val)  memset(arr,val,sizeof(arr))
#define mid(x,y) ((x)+((y)-(x))/2)
#define IN(x,a,b) ((a)<=(x)&&(x)<=(b))
#define cons make_pair

#define PQ(T) priority_queue<T>
#define RPQ(T) priority_queue<T,vector<T>,greater<T>>

template<class T> inline void amin(T & a, T const & b) { a = min(a, b); }
template<class T> inline void amax(T & a, T const & b) { a = max(a, b); }

inline ll square(ll x) { return x * x; }
// ll gcd(ll a, ll b) { while(a) swap(a, b%=a); return b; }
inline ll gcd(ll a, ll b) { while(a) swap(a, b%=a); return b; }
template <typename T>
inline T mod(T a, T b) { return ((a % b) + b) % b; }


const ll MOD=1000000007LL;

ll ADD(ll x, ll y) { return (x+y) % MOD; }
ll SUB(ll x, ll y) { return (x-y+MOD) % MOD; }
ll MUL(ll x, ll y) { return x*y % MOD; }
ll POW(ll x, ll e) { ll v=1; for(; e; x=MUL(x,x), e>>=1) if (e&1) v = MUL(v,x); return v; }
ll DIV(ll x, ll y) { /*assert(y%MOD!=0);*/ return MUL(x, POW(y, MOD-2)); }
// ll comb(ll n, ll k) { ll v=1; for(ll i=1; i<=k; i++) v = DIV(MUL(v, n-i+1),i); return v; }
//

template <typename T1, typename T2>
vector<T2> accum(vector<T1>& a, T2 init) {
    int L = a.size();
    vector<T2> acc(L + 1);
    acc[0] = init;
    for (int i=0; i<L; ++i) acc[i+1] = acc[i] + a[i];
    // partial_sum(ALL(a), acc.begin()+1);
#ifdef DEBUG
    cerr << a << " -> accum -> " << acc << endl;
#endif
    return move(acc);
}


int solve(int N, int M, vi& l, vi& r) {
    vi a(N+1, 0);
    rep(i,M){
        a[ l[i] ]++;
        a[ r[i]+1 ]--;
    }
    vi b = accum(a, 0);
    int ans =0;
    rep(i, b.size()){
        if (b[i] == M) ++ans;
    }
    return ans;
}

int main() {
    int N, M; scanf("%d %d%*c", &N, &M);
    vi l(M),r(M);
    rep(i,M) {
        scanf("%d %d%*c", &l[i], &r[i]);
        l[i]--; r[i]--;
    }
    cout << solve(N,M,l,r) << endl;
    return 0;
}


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

int main()
{
	int n;
	long int d;
	int count = 0;
	long int x, y;
	cin >> n >> d;
	for (int i = 0; i < n; i++) {
		cin >> x >> y;
		if (sqrt(x * x + y * y) <= d) {
			count++;
		}
	}
	cout << count;

    return 0;
}

Measured memory_bytes: 3672
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int main(){
    ll n,m,k,ans=0;
    cin>>n>>m>>k;
    ll a[n+1]={0},b[m+1]={0};
    for(ll i=1;i<=n;i++) cin>>a[i],a[i]+=a[i-1];
    for(ll i=1;i<=m;i++) cin>>b[i],b[i]+=b[i-1];
    for(ll i=0;i<=n;i++) if(k>=a[i]) ans=max(ans,upper_bound(b+1,b+1+m,k-a[i])-b-1+i);
    cout<<ans;
}


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

#define rep(i, n) for (int i = 0; i < n; i++)

int main() {
    long long int n;
    cin >> n;
    vector<long long int> a(5);
    rep(i, 5) cin >> a[i];

    for (int i = 1; i < 5; i++){
        a[i] = min(a[i - 1], a[i]);
    }

    cout << (long long int)ceil(1.0*n / a[4]) + 4LL << endl;
}

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

int main() {
  int N;
  cin >>N;
  vector<string> vec(N);
  for(int i=0;i < N;i++){
    cin >>vec[i];
  }
  sort(vec.begin(),vec.end());
  int a =1;
  for(int i=0;i < N-1;i++){
    if(vec[i] != vec[i+1]){
      a++;
    }
  }
  
  cout << a << endl;
}

Measured memory_bytes: 9600
H=int(input())+1
A=[0]+list(map(int,input().split()))
def h(i):
 l=2*i;r,g=l+1,[i,l][l<H and A[i]<A[l]]
 if r<H and A[g]<A[r]:g=r
 if g>i:A[i],A[g]=A[g],A[i];h(g)
for i in range(H//2,0,-1):h(i)
print(' '+' '.join(map(str,A[1:])))


Measured memory_bytes: 65368
#include <bits/stdc++.h>
using namespace std;
#define repl(i,a,b) for(int i=(int)(a);i<(int)(b);i++)
#define rep(i,n) repl(i,0,n)
#define mp(a,b) make_pair((a),(b))
#define pb(a) push_back((a))
#define all(x) (x).begin(),(x).end()
#define uniq(x) sort(all(x)),(x).erase(unique(all(x)),end(x))
#define fi first
#define se second
#define dbg(x) cout<<#x" = "<<((x))<<endl
template<class T,class U> ostream& operator<<(ostream& o, const pair<T,U> &p){o<<"("<<p.fi<<","<<p.se<<")";return o;}
template<class T> ostream& operator<<(ostream& o, const vector<T> &v){o<<"[";for(T t:v){o<<t<<",";}o<<"]";return o;}

#define INF 2147483600

int n;
double sins[200005];
vector<double> iso;

double S(int x, int y){
  return (sins[x] + sins[y] + sins[n-x-y])/2.0;
}

// s以下の面積が何通りとれるか
long cnt(double s){
  long ret = 0;
  // x < y < z が何通りとれるか
  for(int x=1; x<=n/3; x++){
    if(3*x+3>n) break;
    if(S(x, (n-x-1)/2) < s){
      ret += (n-x-1)/2 - x;
      continue;
    }
    if(S(x, x+1) >s){
      continue;
    }
    int ly=x+1, ry=(n-x-1)/2; // lyは必ずs以下と保証される
    while(ry-ly>1){
      int my = (ry+ly)/2;
      if(S(x, my) > s) ry=my;
      else ly=my;
    }
    ret += ly - x;
  }
  ret = ret*n*2; // 始点n通り＊反対周り

  // 正三角形
  if(n%3==0 && s>=S(n/3,n/3)) ret+=n/3;

  // 二等辺三角形
  long ll = upper_bound(all(iso), s) - iso.begin();
  ret += ll*n;

  return ret;
}

int main(){
  long k;
  cin>>n>>k;

  const double p = atan(1)*4.0;
  rep(i,n+1) sins[i] = sin(2.0*p/n*i);

  // 2等辺三角形の面積列挙
  repl(i,1,n-1) if((n-i)%2==0){
    iso.pb(S(i,(n-i)/2));
  }
  sort(all(iso));

  double sl=0, sr=2;
  rep(_,50){
    double sm = (sl+sr)/2.0;
    if(cnt(sm) < k) sl = sm;
    else sr = sm;
  }

  printf("%.11f\n", sr);

  return 0;
}


Measured memory_bytes: 1152
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
const int INF = 1e9;
const int MOD = 1e9 + 7;

int main(){
  int N, X, T;
  cin >> N >> X >> T;
  cout << (N + X - 1) / X * T << endl;
  
}


Measured memory_bytes: 3604