akhauriyash/Code-Regression huggingface dataset:
import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        while(true) {
            int x = sc.nextInt();
            char op = sc.next().charAt(0);
            int y = sc.nextInt();  
            if(op == '?') break;
            switch(op) {
                case '+' :  System.out.println(x+y); break;
                case '-' :  System.out.println(x-y); break;
                case '*' :  System.out.println(x*y); break;
                case '/' :  System.out.println(x/y); break;
                default  :  break;
            }    
        }
    }
}


Measured memory_bytes: 26172
import java.io.IOException;
import java.util.Scanner;

class Main{
    public static void main(String[] args) throws IOException {
        Scanner scan = new Scanner(System.in);
        int a = scan.nextInt();
        int b = scan.nextInt();
        String text = String.format("%s %s", a * b, 2*a + 2*b);
        System.out.println(text);
    }
}

Measured memory_bytes: 17164
// #include {{{
#include <iostream>
#include <cassert>
#include <cstring>
#include <cstdlib>
#include <cstdio>
#include <cctype>
#include <cmath>
#include <ctime>
#include <queue>
#include <set>
#include <map>
#include <stack>
#include <string>
#include <bitset>
#include <vector>
#include <complex>
#include <algorithm>
using namespace std;
// }}}
// #define {{{
typedef long long ll;
typedef double db;
typedef pair<int,int> pii;
typedef vector<int> vi;
#define de(x) cout << #x << "=" << x << endl
#define rep(i,a,b) for(int i=a;i<(b);++i)
#define per(i,a,b) for(int i=(b)-1;i>=(a);--i)
#define all(x) (x).begin(),(x).end()
#define sz(x) (int)(x).size()
#define mp make_pair
#define pb push_back
#define fi first
#define se second
// }}}

const int N = 303 , P = 1e9 + 7;
inline void pp(int &x,int d){if((x+=d)>=P)x-=P;}
int n , m , f[N][N] , g[N][N];
vector<pii> limit[N];

int main(){
    cin >> n >> m;
    rep(i,0,m) {
        int l , r , x;
        cin >> l >> r >> x;
        limit[r].pb(mp(l , x));
    }
    f[0][0] = 1;
    rep(i,1,n+1) {
        rep(j,0,i+1) rep(k,0,i+1) g[j][k] = 0;
        rep(j,0,i) rep(k,0,i) if(f[j][k]) {
            pp(g[j][k] , f[j][k]);
            pp(g[j][i-1] , f[j][k]);
            pp(g[i-1][k] , f[j][k]);
        }
        rep(j,0,i+1) rep(k,0,i+1) {
            f[j][k] = g[j][k];
            for(auto e : limit[i]) {
                int l = e.fi , x = e.se;
                int t = 1 + (l <= j) + (l <= k);
                if(t != x) {
                    f[j][k] = 0;
                    break;
                }
            }
        }
    }
    int ans = 0;
    rep(i,0,n+1) rep(j,0,n+1) pp(ans , f[i][j]);
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 1024
using System;
using System.Linq;
using System.Collections.Generic;
using static System.Console;
using System.Text;
using System.IO;
using static System.Math;
using System.Numerics;

namespace AtCoder
{
    public class Program
    {
        public static void Main(string[] args)
        {
            //SetOut(new StreamWriter(OpenStandardOutput()) { AutoFlush = false });
            Solve();
            //Out.Flush();
            Read();
        }

        static void Solve()
        {
            var (T, X) = Slice2<double>();
            WriteLine(T / X);
        }


        static long Mod = 998244353;
        static public long[] Sarray() { return ReadLine().Split().Select(long.Parse).ToArray(); }
        static public List<long> Slist() { return ReadLine().Split().Select(long.Parse).ToList(); }
        static public (T1 a, T2 b) Slice<T1, T2>()
        {
            var t = ReadLine().Split();
            return (
            (T1)Convert.ChangeType(t[0], typeof(T1)),
            (T2)Convert.ChangeType(t[1], typeof(T2)));
        }
        static public (T a, T b) Slice2<T>()
        {
            var t = ReadLine().Split();
            return (
            (T)Convert.ChangeType(t[0], typeof(T)),
            (T)Convert.ChangeType(t[1], typeof(T)));
        }
        static public (T a, T b, T c) Slice3<T>()
        {
            var t = ReadLine().Split();
            return (
            (T)Convert.ChangeType(t[0], typeof(T)),
            (T)Convert.ChangeType(t[1], typeof(T)),
            (T)Convert.ChangeType(t[2], typeof(T)));
        }
        static public (T a, T b, T c, T d) Slice4<T>()
        {
            var t = ReadLine().Split();
            return (
            (T)Convert.ChangeType(t[0], typeof(T)),
            (T)Convert.ChangeType(t[1], typeof(T)),
            (T)Convert.ChangeType(t[2], typeof(T)),
            (T)Convert.ChangeType(t[3], typeof(T)));
        }
    }
}

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

int main() {
  int N;
  
  cin >> N;
  
  vector<int>B(N-1);
  
  for(int i=0;i<N-1;i++){
    cin >> B.at(i);
  }
  int A= B.at(0)+B.at(N-2);
  for(int i=0;i<N-2;i++){
    if(B.at(i)<= B.at(i+1)){
      A=A+B.at(i);
    }
    else if(B.at(i)> B.at(i+1)){
      A=A+B.at(i+1);
    }
  }
    
    cout<< A <<endl;
}
  
  
 



Measured memory_bytes: 256
// Charan Sriramula

#include<bits/stdc++.h>
using namespace std;
typedef long double ld;
typedef long long int ll;

const ll logx=30;
const ll N=1e6+5;
const ll M=1e3+5;
const ll mod=998244353;
const ll INF=1e18+5;
const double PI = 3.14159265358979323846;

#define ints(n) scanf("%d",&n)
#define intp(n) printf("%d\n",n)
#define longs(n) scanf("%intd",&n)
#define longp(n) printf("%intd\n",n)

inline ll mul(ll a, ll b,ll p){ return (a * 1ll * b) % p; }
inline ll sub(ll a, ll b,ll p){ ll c = a - b; if(c < 0) c += p; return c; }
inline ll add(ll a, ll b,ll p){ ll c = a + b; if(c > p) c -= p; return c; }

#define f first
#define s second
#define pb(x) push_back(x)
#define pf(x) push_front(x)
#define mp(x,y) make_pair(x,y)
#define GCD(a,b) __gcd((a),(b))
#define all(v) v.begin(),v.end()
#define bits(x) __builtin_popcountll(x)
#define LCM(a,b) ((a)*(b))/GCD((a),(b))
#define ms(dp,val) memset(dp,val,sizeof(dp))
#define fast ios_base::sync_with_stdio(false);cin.tie(NULL);
template<typename T> T power(T x,T y,ll m){T ans=1;while(y>0){if(y&1LL) ans=(ans*x)%m;y>>=1ll;x=(x*x)%m;}return ans%m;}

#define trace1(x)                cerr<<#x<<": "<<x<<endl
#define trace2(x, y)             cerr<<#x<<": "<<x<<" | "<<#y<<": "<<y<<endl
#define trace3(x, y, z)          cerr<<#x<<":" <<x<<" | "<<#y<<": "<<y<<" | "<<#z<<": "<<z<<endl
#define trace4(a, b, c, d)       cerr<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<endl
#define trace5(a, b, c, d, e)    cerr<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<" | "<<#e<< ": "<<e<<endl
#define trace6(a, b, c, d, e, f) cerr<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<" | "<<#e<< ": "<<e<<" | "<<#f<<": "<<f<<endl

ll n,dis[N],col[N];
vector<pair<ll,ll> > g[N];

void DFS(ll cur,ll par,ll dep)
{
  dis[cur]=dis[par]+dep;
  for(auto i:g[cur])
  {
    if(i.f==par){continue;}
    DFS(i.f,cur,i.s);
  }
}

int main()
{
  cin>>n;
  ll m=n-1;
  while(m--)
  {
    ll u,v,w;
    cin>>u>>v>>w;
    g[u].pb(mp(v,w));
    g[v].pb(mp(u,w));
  }
  DFS(1,0,0);
  col[1]=1;
  for(ll i=2;i<=n;i++)
  {
    if(dis[i]%2==0){col[i]=1;}
    else{col[i]=0;}
  }
  for(ll i=1;i<=n;i++){cout<<col[i]<<endl;}
}


Measured memory_bytes: 33792
#!/usr/bin/env python3
# Generated by https://github.com/kyuridenamida/atcoder-tools
from typing import *
import collections
import functools as fts
import itertools as its
import math
import sys

INF = float('inf')
YES = "Yes"  # type: str
NO = "No"  # type: str


def solve(D: int, T: int, S: int):
    return [NO, YES][D/S <= T]


def main():

    sys.setrecursionlimit(10 ** 6)

    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    D = int(next(tokens))  # type: int
    T = int(next(tokens))  # type: int
    S = int(next(tokens))  # type: int
    print(f'{solve(D, T, S)}')


if __name__ == '__main__':
    main()


Measured memory_bytes: 75164
#include<bits/stdc++.h>
using namespace std;
int main(){
    
    int k, n;
    cin >> k >> n;
    vector<int> A(n);
    
    for(int i = 0; i < n; i++)
        cin >> A[i]; 

    int m = max(A[0], A[0] + k - A[n-1]);
    
    for(int i = 1; i < n - 1; i++)
        m = max(m, A[i+1] - A[i]);
    
    int ans = k - m;
    
    cout << ans <<endl;
    
}

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

int main(){
    cin.tie(0);
    ios_base::sync_with_stdio(false);
    
    int n,a;
    cin>>n>>a;
    int rem=n%500;
    cout<<(rem<=a?"Yes":"No")<<endl;
    return 0;
}

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


using namespace std;
typedef long long ll;
#define REP(i,n) for(int i=0; i<int(n); i++)
#define FOR(i,m,n) for(int i=int(m); i<int(n); i++)
#define ALL(obj) (obj).begin(),(obj).end()
#define VI vector<int>
#define VLL vector<long long>
#define VVI vector<vector<int>>
#define VVLL vector<vector<long long>>
#define VC vector<char>
#define VS vector<string>
#define VVC vector<vector<char>>
#define fore(i,a) for(auto &i:a)

typedef pair <int, int> P;
template<class T> bool chmax(T &a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> bool chmin(T &a, T b) { if (a > b) { a = b; return true; } return false; }
const int  INF = 1 << 30;
const ll INFL = 1LL<<60;
const ll mod = 1000000007;		



int main() {

	int n;
	cin >> n;
	VI a(n);
	REP(i, n)cin >> a[i];

	ll ans = 0;

	int right = 0;

	int sum = 0;

	for (int left = 0; left < n; left++) {
		while (right < n && (sum^a[right]) == (sum + a[right])) {
			sum += a[right];
			right++;
		}
		ans += right - left;
		
		if (left == right)right++;
		else sum -= a[left];
	}

	
	cout << ans << endl;

}
 


Measured memory_bytes: 1024
W , H , x , y , r = map(int , input() . split())
if 0 > (x - r) or (x + r) > W or 0 > (y - r) or (y + r) > H :
     print('No')
if 0 <= (x - r) and (x + r) <= W and 0 <= (y - r) and (y + r) <= H :
     print('Yes')


Measured memory_bytes: 5596
# ANSHUL GAUTAM
# IIIT-D

from math import *
from copy import *					# ll = deepcopy(l)
from heapq import *					# heappush(hp,x)
from string import *				# alpha = ascii_lowercase
from random import *				# l.sort(key=lambda l1:l1[0]-l1[1]) => ex: sort on the basis difference
from bisect import *				# bisect_left(arr,x,start,end)  => start and end parameters are temporary
from sys import stdin				# bisect_left return leftmost position where x should be inserted to keep sorted
from sys import maxsize				# minn = -maxsize
from operator import *				# d = sorted(d.items(), key=itemgetter(1))
from itertools import *				# pre = [0] + list(accumulate(l))
from collections import Counter		# d = dict(Counter(l))
from collections import defaultdict # d = defaultdict(list)

'''

'''

def solve(l):
	n = len(l)
	

a = int(stdin.readline())
f = 1
tmpp = [0]
p = 100
for i in range(1,3761):
	aa = int(p*(1.01))
	if(aa >= a):
		print(i)
		break
	else:
		p = aa


Measured memory_bytes: 76756
n=int(input())
a=[0]+list(map(int,input().split()))
ans=0
b=[]
box=[0]*(n+1)

for i in range(n,0,-1):
    ball=0
    j=2
    while(i*j<=n):
        ball+=box[i*j]
        j+=1
    if ball%2!=a[i]:
        box[i]=1
        b.append(i)
        ans+=1

print(ans)
for bb in b:
    print(bb, end=" ")


Measured memory_bytes: 12048
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define nl "\n"
#define rep(i,n) for(ll i=0; i<(n); i++)
typedef vector<ll> vl;
typedef vector<vector<ll>> matrix;//matrix A(n, vl(m)); //n*m行列
typedef vector<string> vs;
typedef pair<ll,ll> pl;
typedef vector<pl> vp;
#define PB push_back
#define MP make_pair
#define F first
#define S second
#define sortup(V) sort(V.begin(), V.end())
#define sortdown(V) sort(V.rbegin(), V.rend())
template<class T>bool chmax(T &a, const T &b){if(a<b){a=b;return 1;}return 0;}
template<class T>bool chmin(T &a, const T &b){if(b<a){a=b;return 1;}return 0;}
#define INF ((1LL<<62)-(1LL<<31))
#define MOD 1000000007 //998244353


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

    // solution comes here

    ll N, K;
    cin >> N >> K;

    set<ll> A;
    vl cnt(200100);
    rep(i, N) {
        ll a;
        cin >> a;
        A.insert(a);
        cnt[a]++;
    }

    sortup(cnt);

    ll ans=0, k=A.size();
    rep(i, k-K) ans += cnt[200100 - k + i];
    cout << ans << nl;
}


Measured memory_bytes: 11136
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(int)n;i++)
#define rep1(i,n) for(int i=1;i<=(int)n;i++)
#define rep2(i,j,n) for(int j=i;j<n;j++)
#define rep3(i,j,n) for(int j=i;j<=n;j++)
#define rrep(i,n) for(int i=n-1;i>=0;i--)
#define sp(n) cout << fixed << setprecision(n)
typedef long long ll;
using namespace std;
int main(void){
    ll n;cin>>n;
    ll a=n-1;
    ll res=1;
    for(int i=2;i<=sqrt(a);i++){
        ll cnt=1;
        while(a%i==0){
            cnt++;
            a/=i;
        }
        res*=cnt;
    }
    if(a>=2)res*=2;
    //cout<<res<<endl;
    
    for(int i=2;i<=sqrt(n);i++){
        if(n%i!=0)continue;
        a=n;
        ll b=n,c=n/i;
        while(a%i==0)a/=i;
        while(b%c==0)b/=c;
        if(a%i==1)res++;
        if(b%i==1)res++;
        if(i==c)res--;
    }
    
    cout<<res<<endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
 
using namespace std;
 
#define MAX 15
 
int H,W,px,py,bx,by,gx,gy;
int field[MAX][MAX];
const int dx[] = {-1,0,1,0};
const int dy[] = {0,-1,0,1};
 
struct State{
    int x1,y1,x2,y2,d;
    State(int x1,int y1,int x2,int y2,int d) : 
	x1(x1),y1(y1),x2(x2),y2(y2),d(d) {}
};
 
bool Valid(int x,int y){
    if(field[y][x] == 1) return false;
    return 0 <= x && x < W && 0 <= y && y < H;
}
 
int bfs(){
    bool visited[MAX][MAX][MAX][MAX];
    memset(visited,false,sizeof(visited));
    deque<State> Q;
    Q.push_front(State(px,py,bx,by,0));
 
    while(!Q.empty()){
	State s = Q.front(); Q.pop_front();
	if(s.x2 == gx && s.y2 == gy){
	    return s.d;
	}
	if(visited[s.y1][s.x1][s.y2][s.x2]) continue;
	visited[s.y1][s.x1][s.y2][s.x2] = true;
     
	for(int i = 0 ; i < 4 ; i++){
	    int nx = s.x1 + dx[i];
	    int ny = s.y1 + dy[i];
	    if(nx == s.x2 && ny == s.y2) continue;
	    if(!Valid(nx,ny)) continue;
	    Q.push_front(State(nx,ny,s.x2,s.y2,s.d));
	}
	for(int i = 0 ; i < 4 ; i++){
	    int nx = s.x1 + dx[i];
	    int ny = s.y1 + dy[i];
	    int nnx = s.x2 + dx[i];
	    int nny = s.y2 + dy[i];
       
	    if(nx == s.x2 && ny == s.y2){
		if(Valid(nx,ny) && Valid(nnx,nny)){
		    Q.push_back(State(nx,ny,nnx,nny,s.d+1));
		}
	    }
	}
    }
    return -1;
}
 
int main(){
    while(cin >> W >> H, W){
	for(int i = 0 ; i < H ; i++){
	    for(int j = 0 ; j < W ; j++){
		cin >> field[i][j];
		if(field[i][j] == 4){
		    px = j; py = i;
		}else if(field[i][j] == 2){
		    bx = j; by = i;
		}else if(field[i][j] == 3){
		    gx = j; gy = i;
		}
	    }
	}
	cout << bfs() << endl;
    }
    return 0;
}

Measured memory_bytes: 3084
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair <int,int> P;

int main() {
  string s;
  cin>>s;
  for (int i=0; i<s.size(); i++) {
    if ((i%2)&&(s[i]=='R')||(!(i%2))&&(s[i]=='L')) {
      cout<<"No"<<endl;
      return 0;
    }
  }
  cout<<"Yes"<<endl;
  return 0;
}




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

int main() {

    long long a,b,c;
    cin >> a >> b >> c;

    long long cab = (c-a-b);

    if(cab > 0 && 4*a*b < cab * cab) cout << "Yes" << endl;
    else                             cout << "No"  << endl;
    
    return 0;
}



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

class Program
{
    void Run()
    {
        var sc = new Scanner();
        int n = sc.NextInt();
        var d = new List<Tuple<int, string, int>>();
        for (int i = 0; i < n; i++)
        {
            d.Add(Tuple.Create(i, sc.NextString(), sc.NextInt()));
        }
        foreach (var item in d.OrderBy(p => p.Item2).ThenByDescending(p => p.Item3))
            Console.WriteLine(item.Item1 + 1);
    }

    static void Main(string[] args)
    {
        new Program().Run();
    }

    static long Gcd(long a, long b)

    {
        if (a < b) return Gcd(b, a);
        if (b == 0) return a;
        return Gcd(b, a % b);
    }
}

class Scanner
{
    int index = -1;
    string[] buf;

    public Scanner()
    {
    }

    public int NextInt()
    {
        CheckNext();
        return int.Parse(buf[index++]);
    }

    public long NextLong()
    {
        CheckNext();
        return long.Parse(buf[index++]);
    }

    public double NextDouble()
    {
        CheckNext();
        return double.Parse(buf[index++]);
    }

    public string NextString()
    {
        CheckNext();
        return buf[index++];
    }

    private void CheckNext()
    {
        if (index >= 0 && index < buf.Length) return;

        buf = Console.ReadLine().Split(' ');
        index = 0;
    }
}


Measured memory_bytes: 13536
#include<bits/stdc++.h>
using namespace std;
using Int = long long;
template<typename T1,typename T2> inline void chmin(T1 &a,T2 b){if(a>b) a=b;}
template<typename T1,typename T2> inline void chmax(T1 &a,T2 b){if(a<b) a=b;}


template<typename T,T MOD = 1000000007>
struct Mint{
  static constexpr T mod = MOD;
  T v;
  Mint():v(0){}
  Mint(signed v):v(v){}
  Mint(long long t){v=t%MOD;if(v<0) v+=MOD;}

  Mint pow(long long k){
    Mint res(1),tmp(v);
    while(k){
      if(k&1) res*=tmp;
      tmp*=tmp;
      k>>=1;
    }
    return res;
  }

  static Mint add_identity(){return Mint(0);}
  static Mint mul_identity(){return Mint(1);}

  Mint inv(){return pow(MOD-2);}

  Mint& operator+=(Mint a){v+=a.v;if(v>=MOD)v-=MOD;return *this;}
  Mint& operator-=(Mint a){v+=MOD-a.v;if(v>=MOD)v-=MOD;return *this;}
  Mint& operator*=(Mint a){v=1LL*v*a.v%MOD;return *this;}
  Mint& operator/=(Mint a){return (*this)*=a.inv();}

  Mint operator+(Mint a) const{return Mint(v)+=a;};
  Mint operator-(Mint a) const{return Mint(v)-=a;};
  Mint operator*(Mint a) const{return Mint(v)*=a;};
  Mint operator/(Mint a) const{return Mint(v)/=a;};

  Mint operator-() const{return v?Mint(MOD-v):Mint(v);}

  bool operator==(const Mint a)const{return v==a.v;}
  bool operator!=(const Mint a)const{return v!=a.v;}
  bool operator <(const Mint a)const{return v <a.v;}

  // find x s.t. a^x = b
  static T log(T a,T b){
    const T sq=40000;
    unordered_map<T, T> dp;
    dp.reserve(sq);
    Mint res(1);
    for(Int r=0;r<sq;r++){
      if(!dp.count(res.v)) dp[res.v]=r;
      res*=a;
    }
    Mint p=Mint(a).inv().pow(sq);
    res=b;
    for(Int q=0;q<=MOD/sq+1;q++){
      if(dp.count(res.v)){
        T idx=q*sq+dp[res.v];
        if(idx>0) return idx;
      }
      res*=p;
    }
    assert(0);
    return T(-1);
  }

  static Mint comb(long long n,Int k){
    Mint num(1),dom(1);
    for(Int i=0;i<k;i++){
      num*=Mint(n-i);
      dom*=Mint(i+1);
    }
    return num/dom;
  }
};
template<typename T,T MOD> constexpr T Mint<T, MOD>::mod;
template<typename T,T MOD>
ostream& operator<<(ostream &os,Mint<T, MOD> m){os<<m.v;return os;}

//INSERT ABOVE HERE
signed main(){
  Int n;
  cin>>n;
  string s1,s2;
  cin>>s1>>s2;

  Int flg=1;
  for(Int i=0;i<n;i++)
    flg&=s1[i]==s2[i];

  using M = Mint<Int>;
  if(flg){
    M ans{3};
    for(Int i=1;i<n;i++) ans*=M(2);
    cout<<ans<<endl;
    return 0;
  }

  M ans;
  Int t=0,i;
  if(s1[0]==s2[0]){
    t=0;
    i=1;
    ans=M(3);
  }else{
    t=1;
    i=2;
    ans=M(6);
  }

  for(;i<n;i++){
    if(s1[i]==s2[i]){
      if(t==0) ans*=M(2);
      else ans*=M(1);
      t=0;
    }else{
      if(t==0) ans*=M(2);
      else ans*=M(3);
      t=1;
      i++;
    }
  }

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


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

using namespace std;
typedef long long ll;
#define debug(x) cerr << x << "\n"
#define all(x) (x).begin(),(x).end()
#define exist(s, e)((s).find(e) != (s).end())

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    
    string s1, s2, s3;
    cin >> s1 >> s2 >> s3;
    printf("%c%c%c\n",toupper(s1[0]),toupper(s2[0]), toupper(s3[0]));

    return 0;
}

Measured memory_bytes: 256
# -*- coding: utf-8 -*-


if __name__ == '__main__':
    S = input()
    score = _score = [0] * len(S)
    r_num = 0
    l_num = 0
    _s = None
    change_idx = None
    for i, s in enumerate(S):
        if s == 'L' and _s == 'R':
            change_idx = i
        if s == 'R' and _s == 'L':
            #計算
            if r_num == l_num or (r_num + l_num) % 2 == 0:
                score[change_idx - 1] = (r_num + l_num) / 2
                score[change_idx] = (r_num + l_num) / 2
            elif r_num % 2 == 0:
                score[change_idx - 1] = (r_num + l_num) // 2
                score[change_idx] = (r_num + l_num) // 2 + 1
            else:
                score[change_idx - 1] = (r_num + l_num) // 2 + 1
                score[change_idx] = (r_num + l_num) // 2
            #初期化
            r_num = 0
            l_num = 0
            change_idx = None
        if s == 'R':
            r_num += 1
        else:
            l_num += 1
        _s = s

    #計算
    if r_num == l_num or (r_num + l_num) % 2 == 0:
        score[change_idx - 1] = (r_num + l_num) / 2
        score[change_idx] = (r_num + l_num) / 2
    elif r_num % 2 == 0:
        score[change_idx - 1] = (r_num + l_num) // 2
        score[change_idx] = (r_num + l_num) // 2 + 1
    else:
        score[change_idx - 1] = (r_num + l_num) // 2 + 1
        score[change_idx] = (r_num + l_num) // 2

    print(' '.join(map(str, map(int, score))))


Measured memory_bytes: 12916
sum = 0
list = [[0 for x in range(3)] for y in range(3)]
for i in range(3):
    tmp = input().split()
    list[i] = tmp
    sum += int(tmp[0]) + int(tmp[1]) + int(tmp[2])

flg = True
if sum%3 ==0:
    for n in range(2):
        for m in range(2):
            if (int(list[n][m]) + int(list[n+1][m+1]))!=(int(list[n+1][m])+int(list[n][m+1])):
                flg = False
                break
    if flg:
        print('Yes')
    else:
        print('No')
else:
  print('No')


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

#undef _P
#define _P(...) (void)printf(__VA_ARGS__)
#define FOR(x,to) for(x=0;x<(to);x++)
#define FORR(x,arr) for(auto& x:arr)
#define ITR(x,c) for(__typeof(c.begin()) x=c.begin();x!=c.end();x++)
#define ALL(a) (a.begin()),(a.end())
#define ZERO(a) memset(a,0,sizeof(a))
#define MINUS(a) memset(a,0xff,sizeof(a))
//-------------------------------------------------------

ll mo=1000000007;
int N,X;
int S[202];
ll memo[201][101010];
ll fact[202];

ll comb(int P_,int Q_) {
	static const int N_=1020;
	static ll C_[N_][N_];
	
	if(C_[0][0]==0) {
		int i,j;
		FOR(i,N_) C_[i][0]=C_[i][i]=1;
		for(i=1;i<N_;i++) for(j=1;j<i;j++) C_[i][j]=(C_[i-1][j-1]+C_[i-1][j])%mo;
	}
	if(P_<0 || P_>N_ || Q_<0 || Q_>P_) return 0;
	return C_[P_][Q_];
}

ll dp(int c,int x) {
	if(c==N) return x;
	if(x<S[N-1]) return fact[N-c]*x%mo;
	if(memo[c][x]>=0) return memo[c][x];
	
	int num=0,el=0;
	int i;
	for(i=c;i<N;i++) if(S[i]>x) num++;
	
	ll ret=0;
	
	for(i=c;i<N;i++) if(S[i]<=x) {
		ret+=comb(N-c-num-1,el)*fact[el]%mo*dp(i+1,x%S[i])%mo;
		el++;
	}
	
	ret%=mo;
	ll pat=comb(N-c,num)*fact[num]%mo;
	return memo[c][x]=ret*pat%mo;
	
}

void solve() {
	int i,j,k,l,r,x,y; string s;
	
	fact[0]=1;
	for(i=1;i<=201;i++) fact[i]=fact[i-1]*i%mo;
	
	cin>>N>>X;
	FOR(i,N) cin>>S[i];
	MINUS(memo);
	sort(S,S+N);
	reverse(S,S+N);
	
	cout<<dp(0,X)<<endl;
	
	
}


int main(int argc,char** argv){
	string s;int i;
	if(argc==1) ios::sync_with_stdio(false), cin.tie(0);
	FOR(i,argc-1) s+=argv[i+1],s+='\n'; FOR(i,s.size()) ungetc(s[s.size()-1-i],stdin);
	cout.tie(0); solve(); return 0;
}


Measured memory_bytes: 167040
#include <bits/stdc++.h>
using namespace std;
#include <math.h>
#include <iomanip>
#include <cstdint>
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; }

const int INF=1001001001;
const int mod = 1000000007;

int main() {
  string s;
  cin>>s;
  int N=s.size();
  map<int,int>k;
  for(int i=0;i<N;i++){
    k[s[i]]++;
  }
  cout<<abs(k['g']-(N+1)/2)<<endl;
  return 0;
}

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

namespace atcoder
{
    class ABC_128_B
    {

        static void Main()
        {
            List<Tuple<string, int,int>> list = new List<Tuple<string,int,int>>();

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

            for(int i =1; i <= N; ++i)
            {

                string[] input = Console.ReadLine().Split(' ');
                list.Add(new Tuple<string, int,int>(input[0],int.Parse(input[1]), i));

            }

            var ans = list.OrderBy(x => x.Item1).ThenByDescending(x => x.Item2);

            foreach(var element in ans)  Console.WriteLine(element.Item3);

        }

    }
}

Measured memory_bytes: 11612
#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<map>
#include<cmath>
#include<string>
#include<bitset>
#include <sstream>
#include<queue>
#include<set>
#define rep(i,n) for(ll i=0;i<(n);++i)
using namespace std;
typedef long long ll;
typedef pair<int,ll>P;

const ll mod = 1e9+7;
const ll INF = ll(1e18)+1;
const ll MAXN = 1e6;

int main()
{
    ll n,k;
    ll count=0;
    cin>>n>>k;
    while(n>=k)
    {
        n/=k;
        count++;
    }
    cout<<count+1<<endl;
}

Measured memory_bytes: 256
r,c = map(int, input().split())
fields = []
colsum = [0]*(c+1)
for i in range(r):
    A = list(map(int, input().split()))
    row = A + [sum(A)]
    fields.append(row)
    for i,e in enumerate(row):
        colsum[i] += e
fields.append(colsum)

for i in range(r+1):
    print(*fields[i])


Measured memory_bytes: 6236
#include<bits/stdc++.h>
using namespace std;
int main(){
  int N; 
  cin >> N ;
  string s;
  cin >> s;
  int r = 0; int b = 0;
  for (int i = 0; i < N; i++){
    if (s.at(i) == 'R')
      r++;
    else b++;
  }
  if (r > b)
    cout << "Yes" << endl;
  else cout << "No" << endl;
}

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

using namespace std;

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

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

	if(a < b) cout << "a < b" << '\n';
	else if(a > b) cout << "a > b" << '\n';
	else cout << "a == b" << '\n';

	return 0;
}// br1



Measured memory_bytes: 3236
/*

*/
#include<bits/stdc++.h>

using namespace std;
#define rep(i,n) for(int i=0;i<(n);i++)
#define rep2(i,a,n) for(int i=(a);i<(n);i++)

int main(){
  cin.tie(nullptr);ios_base::sync_with_stdio(false);
  cout << fixed << setprecision(15);
  int n=1e6;
  vector<int> is_prime(n, 1);
  is_prime[0] = 0, is_prime[1] = 0;
  for (int i = 2; i < n; ++i) {
    if (!is_prime[i]) continue;
    for (int j = i*2; j < n; j += i) is_prime[j] = 0;
  }

  vector<int> a(n, 0);
  for (int i = 0; i < n; ++i) {
    if (i % 2 == 0) continue;
    if (is_prime[i] && is_prime[(i+1)/2]) a[i] = 1;
  }

  vector<int> s(n+1, 0);
  for (int i = 0; i < n; ++i) s[i+1] = s[i] + a[i];

  int q,l,r;
  cin>>q;
  rep(i,q){
    cin>>l>>r;
    ++r;
    cout<<s[r]-s[l]<<endl;
  }
}


Measured memory_bytes: 12416
#include <bits/stdc++.h>
#define pb push_back
#define ppb pop_back
#define fi first
#define se second
#define mid ((x + y) / 2)
#define left (ind * 2)
#define right (ind * 2 + 1)
#define mp make_pair
#define timer ((double)clock() / CLOCKS_PER_SEC)
#define endl "\n"
#define spc " "
#define d1(x) cerr<<#x<<":"<<x<<endl
#define d2(x, y) cerr<<#x<<":"<<x<<" "<<#y<<":"<<y<<endl
#define d3(x, y, z) cerr<<#x<<":"<<x<<" "<<#y<<":"<<y<<" "<<#z<<":"<<z<<endl
#define fast_io() ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0)
using namespace std;

typedef long long int lli;
typedef pair<int, int> ii;
typedef pair<ii, int> iii;
typedef pair<double, double> dd;

const int N = (int)(1e6 + 5);
const int LOG = (int)(20);

int col[N], n, m;

int main() {
	fast_io();
	// freopen("inp.in", "r", stdin);

	cin >> n >> m;
	for(int i = 1; i <= m; i++) {
		int a, b;
		cin >> a >> b;
		col[a]++;
		col[b]++;
	}

	for(int i = 1; i <= n; i++) {
		if(col[i] % 2 == 1){
			cout << "NO";
			return 0;
		}
	}
	cout << "YES";

}

Measured memory_bytes: 640
#include <bits/stdc++.h>
#define boost_io ios::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define int long long
#define num(a) a-'0'
#define charr(a) (a - 'A' + 1)
#define rep(i,a,b) for(int i=a;i<b;i++)
#define maxs(a,b) if(b>a)a=b
#define mins(a,b) if(b<a)a=b
#define debug(x) cerr<<"["<<#x<<":"<<x<<"] "
#define debug2(a,b) debug(a);debug(b)
#define debug3(a,b,c) debug2(a,b);debug(c)
#define gcd(a,b) __gcd(a,b)
#define lcm(a,b) (a*b)/(__gcd(a,b))
#define print(arr) for(auto it = arr.begin();it < arr.end();it ++){cout << *it << " ";}cout << ln;
#define all(a) (a).begin(), (a).end()
#define vi vector<long long>
#define v vector
#define p pair
#define pb push_back
#define mk make_pair
#define f first
#define s second
#define ln "\n"
typedef long double ld;
typedef double d;
using namespace std;
int modF=1e9+7;
int INF=1e11;

void solve(){
	int x;
	cin>>x;
	if(x==0)cout<<1<<ln;
	else cout<<0<<ln;
}

signed main(){
	boost_io;
	solve();
	return 0;
}

Measured memory_bytes: 3628
//@sakshjha
#include<bits/stdc++.h>
using namespace std;
#define ll  long long int
#define ld long double
#define IOS ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define FRE freopen("input.txt","r",stdin); freopen("output.txt","w",stdout);
#define pi 3.14159265358979
const ll MOD = 1000000007;
const ll N=200005;
ll dp[3005][3005];
char dp1[3005][3005];
int main()
{
    IOS
    string s,t;
    cin>>s>>t;
    ll n=s.size(),i,j;
    ll m=t.size();
    dp1[0][0]='u';
    if(s[0]==t[0])
    {
        dp[0][0]=1;
        dp1[0][0]='d';
    }
    for(i=1; i<n; i++)
    {
        if(t[0]==s[i])
        {
            dp[i][0]=1;
            dp1[i][0]='d';
        }
        else
        {
            dp[i][0]=dp[i-1][0];
            dp1[i][0]='u';
        }
    }
    for(i=1; i<m; i++)
    {
        if(s[0]==t[i])
        {
            dp[0][i]=1;
            dp1[0][i]='d';
        }
        else
        {
            dp[0][i]=dp[0][i-1];
            dp1[0][i]='l';
        }
    }
    for(i=1; i<n; i++)
    {
        for(j=1; j<m; j++)
        {
            if(s[i]==t[j])
            {
                dp[i][j]=dp[i-1][j-1]+1;
                dp1[i][j]='d';
            }
            else
            {
                if(dp[i-1][j]>=dp[i][j-1])
                {
                    dp[i][j]=dp[i-1][j];
                    dp1[i][j]='u';
                }
                else
                {
                    dp[i][j]=dp[i][j-1];
                    dp1[i][j]='l';
                }
            }
        }
    }
    string s1="";
    i=n-1,j=m-1;
    while(i>=0 && j>=0)
    {
        if(dp1[i][j]=='d')
        {
            s1+=s[i];
            i--;
            j--;
        }
        else if(dp1[i][j]=='u')
            i--;
        else
            j--;

    }
    reverse(s1.begin(),s1.end());
    cout<<s1;
    return 0;
}


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

using namespace std;
typedef pair<int, int>P;
typedef long long ll;
#define rep(i,n)for(ll i=0;i<n;++i)
#define exrep(i, a, b) for(ll i = a; i <= b; i++)
#define out(x) cout << x << endl
#define exout(x) printf("%.10f\n", x)
#define chmax(x, y) x = max(x, y)
#define chmin(x, y) x = min(x, y)
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()
#define pb push_back
#define re0 return 0
const double pi = acos(-1.0);
const ll MOD = 1000000007;
const ll INF = 1e16;
const ll MAX_N = 1010;
//max=({});
//条件式が真ならwhileの中身を回し続ける
//printf("%d\n", ans);

//pairの入力
//vector<pair<ll, ll>>work(n);
//rep(i, n) {
//	ll a, b;
//	cin >> a >> b;
//	work[i] = make_pair(a, b);
//for(auto p:mp)(mapの探索)
//printf("%.10f\n",なんちゃら)
//最大公約数
ll gcd(ll x, ll y) {
	return y ? gcd(y, x % y) : x;
}

ll lcm(ll x, ll y) {
	if (x == 0 || y == 0)return 0;
	return (x / gcd(x, y) * y);
}

//組み合わせの余りを求める
ll fac[MAX_N], finv[MAX_N], inv[MAX_N];
void COMinit() {
	fac[0] = fac[1] = 1;
	finv[0] = finv[1] = 1;
	inv[1] = 1;
	for (int i = 2; i < MAX_N; i++) {
		fac[i] = fac[i - 1] * i % MOD;
		inv[i] = MOD - inv[MOD % i] * (MOD / i) % MOD;
		finv[i] = finv[i - 1] * inv[i] % MOD;
	}
}

// 二項係数計算
long long COM(ll n, ll k) {
	if (n < k) return 0;
	if (n < 0 || k < 0) return 0;
	return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}

ll dx[4] = { 0,0,-1,1 };
ll dy[4] = { -1,1,0,0 };
ll dp[101010];

//union-find木について
ll par[101010];
ll rank2[101010];

void init(ll n) {
	rep(i, n) {
		par[i] = i;
		rank2[i] = 0;
	}
}

ll find(ll x) {
	if (par[x] == x) {
		return x;
	}
	else {
		return par[x] = find(par[x]);
	}
}

void unite(ll x, ll y) {
	x = find(x);
	y = find(y);
	if (x == y)return;
	if (rank2[x] < rank2[y]) {
		par[x] = y;
	}
	else {
		par[y] = x;
		if (rank2[x] == rank2[y]) {
			rank2[x]++;
		}
	}
}

long long modpow(long long a, long long n, long long mod) {
	long long res = 1;
	while (n > 0) {
		if (n & 1) res = res * a % mod;
		a = a * a % mod;
		n >>= 1;
	}
	return res;
}

char c[1010][1010];
ll root[1010][1010];
ll h, w;

//long longしか使わない
//素数は1より大きい
int main() {
	cin >> h >> w;
	ll ans = 0;
	rep(i, h) {
		rep(j, w) {
			cin >> c[i][j];
			if (c[i][j] == '.')ans++;
			root[i][j] = -1;
		}
	}
	deque<pair<ll, ll>>q;
	q.push_back(make_pair(0, 0));
	root[0][0] = 0;
	while (q.size() > 0) {
		pair<ll, ll>p = q.front();
		q.pop_front();
		ll x = p.first;
		ll y = p.second;
		rep(j, 4) {
			ll nx = x + dx[j];
			ll ny = y + dy[j];
			if (0 <= nx && nx <= h && 0 <= ny && ny <= w && root[nx][ny] == -1 && c[nx][ny] != '#') {
				root[nx][ny] = root[x][y] + 1;
				q.push_back(make_pair(nx, ny));
			}
		}
	}
	ans -= root[h - 1][w - 1];
	ans--;
	if (root[h - 1][w - 1] == -1) {
		cout << -1 << endl;
		return 0;
	}
	cout << ans << endl;
	return 0;
}


Measured memory_bytes: 2560
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
#define pb push_back
#define mp make_pair
#define rep(i,n) for(int i=0;i<(n);++i)

int main(){
	cin.tie(0);
	ios::sync_with_stdio(false);
	ll n,m;cin >> n >> m;
	if(m%n==0){
		cout << m/n << endl;
		return 0;
	}
	for(ll i=m/n;i>0;--i){
		if(m%i==0 && m>=n*i){
			cout << i << endl;
			return 0;
		}
	}
	cout << 1 << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define repr(i, n) for (int i = (n); i >= 0; --i)
#define FOR(i, m, n) for (int i = (m); i < (n); ++i)
#define FORR(i, m, n) for (int i = (m); i >= (n); --i)
#define equals(a, b) (fabs((a) - (b)) < EPS)
using namespace std;
typedef long long ll;
const ll mod = 1000000007;
const ll mod2 = 998244353;
const ll INF = 1e18;
const long double EPS = 1e-10;

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

  if (n % 4 == 1 && n < 21) {
    cout << "No" << endl;
    return 0;
  }
  if (n % 4 == 2 && n < 14) {
    cout << "No" << endl;
    return 0;
  }
  if (n % 4 == 3 && n < 7) {
    cout << "No" << endl;
    return 0;
  }
  cout << "Yes" << endl;

  
  return 0;
}

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

#define REP(i, n) for(int i = 0; i < n; i++)
#define REPR(i, n) for(int i = n; i >= 0; i--)
#define FOR(i, m, n) for(int i = m; i < n; i++)
#define ALL(obj) (obj).begin(), (obj).end()
#define INF 1e9
typedef long long ll;

const int MOD = 1e9+7;

int main() {
    int N; cin >> N;
    string s1,s2; cin >> s1 >> s2;

    vector<int> m;//0で縦、1で横
    REP(i,s1.size()-1){
        if(s1[i] != s1[i+1]){
            m.push_back(0);
        }else{
            m.push_back(1);
            i++;
        }
    }
    if(s1[N-1] == s2[N-1]) m.push_back(0);

    ll ans = 1;
    REP(i,m.size()){
        if(i==0){
            if(m[0]==0){
                ans = 3;
            }else{
                ans = 6;
            }
        }else{
            if(m[i-1]==1 && m[i]==0){
                ans *= 1;
                ans %= MOD;
            }else if(m[i-1]==1 && m[i]==1){
                ans *= 3;
                ans %= MOD;
            }else{
                ans *= 2;
                ans %= MOD;
            }
        }
    }
    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 3632
#include <iostream>
#include <vector>
#include <queue>
#include <algorithm>
#include <cmath>
#include <iomanip>
#include <map>
#include <deque>
#include <string.h>
#include <set>
using namespace std;

#define REP(i,n) for(int i = 0; i < n; i++)
#define ALL(v) v.begin(),v.end()
typedef long long ll;
typedef pair<int,int> pi;
typedef pair<ll,ll> pll;
typedef pair<string,string> pss;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<pi> vpi;
typedef vector<ll> vll;
typedef vector<vll> vvll;

double EPS = 1e-9;
int INFi = 1000000005;
long long INFll = 1000000000000000005ll;
double PI = acos(-1);
int dirx[8] = {-1,0,0,1,-1,-1,1,1};
int diry[8] = {0,1,-1,0,-1,1,-1,1};
ll MOD = 1000000007;

int N;
const int MAX_N = 200000;
int P[MAX_N];


int main(){
  cin >> N;
  REP(i, N) cin >> P[i];

  int l = 1;

  set<int> st;
  bool ne[N + 1];
  int inc[N + 1];

  REP(i, N) {
    ne[P[i]] = st.find(P[i] + 1) == st.end();
    st.insert(P[i]);
  }

  inc[N] = 1;
  for(int i = N - 1; i >= 1; i--) {
    if(ne[i]) inc[i] = inc[i + 1] + 1;
    else inc[i] = 1;
    l = max(l, inc[i]);
  }

  cout << N - l << endl;
  
  return 0;

}



Measured memory_bytes: 11392
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <math.h>
#include <vector>
#include <map>
#include <queue>
#include <utility>
#include <algorithm>
#include <string>
#include <set>
#include <random>
using namespace std;

int main() {
  string S;
  cin >> S;
  int K;
  cin >> K;
  for (int i = 0; i < K; i++) {
	  if (S[i] != '1') {
		  cout << S[i] << endl;
		  return 0;
		}
	}
  cout << S[K - 1] << endl;
  return 0;
}


Measured memory_bytes: 256
# coding: utf-8
# Your code here!

from itertools import combinations

import sys

X = []
for _ in range(5):
    X.append(int(input()))
K = int(input())
    
for a, b in combinations(X, 2):
    if abs(a - b) > K:
         print(':(')
         sys.exit()
         
print('Yay!')

Measured memory_bytes: 3060
function heron(a,b,c){
var s=(a+b+c)/2;
var S=Math.sqrt(s*(s-a)*(s-b)*(s-c));
return S;
}
var input = require('fs').readFileSync('/dev/stdin', 'utf8');
var Arr=(input.trim()).split("\n");
for(var I=0;I<Arr.length;I++){
   var arr=Arr[I].split(" ").map(Number);
   var x1=arr[0];var y1=arr[1];
   var x2=arr[2];var y2=arr[3];
   var x3=arr[4];var y3=arr[5];
   var xp=arr[6];var yp=arr[7];
   var d12=Math.sqrt(Math.pow(x2-x1,2)+Math.pow(y2-y1,2));
   var d13=Math.sqrt(Math.pow(x1-x3,2)+Math.pow(y1-y3,2));
   var d23=Math.sqrt(Math.pow(x2-x3,2)+Math.pow(y2-y3,2));
   var dp1=Math.sqrt(Math.pow(xp-x1,2)+Math.pow(yp-y1,2));
   var dp2=Math.sqrt(Math.pow(xp-x2,2)+Math.pow(yp-y2,2));
   var dp3=Math.sqrt(Math.pow(xp-x3,2)+Math.pow(yp-y3,2));
   var S123=heron(d12,d13,d23);
   var s123=heron(d12,dp1,dp2)+heron(d13,dp1,dp3)+heron(d23,dp2,dp3);
   console.log((Math.abs(S123-s123)<0.0005)?"YES":"NO");
}

Measured memory_bytes: 8700
# coding: utf-8
N,M,X,Y=map(int, input().split())
x=list(map(int, input().split()))
y=list(map(int, input().split()))

for z in range(X+1, Y+1):
    if max(x) < z <= min(y):
        print("No War")
        exit()
else:
    print("War")


Measured memory_bytes: 3060
#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <typeinfo>
#include <utility>
#include <valarray>
#include <vector>
#include <climits>

#define rep(i, m, n) for(int i=int(m);i<int(n);i++)
#define EACH(i, c) for (auto &(i): c)
#define all(c) begin(c),end(c)
#define EXIST(s, e) ((s).find(e)!=(s).end())
#define SORT(c) sort(begin(c),end(c))
#define pb emplace_back
#define MP make_pair
#define SZ(a) int((a).size())

//#define LOCAL 0
//#ifdef LOCAL
//#define DEBUG(s) cout << (s) << endl
//#define dump(x)  cerr << #x << " = " << (x) << endl
//#define BR cout << endl;
//#else
//#define DEBUG(s) do{}while(0)
//#define dump(x) do{}while(0)
//#define BR
//#endif


//改造
typedef long long int ll;
using namespace std;
#define INF (1 << 20)
#define INFl (ll)5e15
#define DEBUG 0 //デバッグする時1にしてね
#define dump(x)  cerr << #x << " = " << (x) << endl

//ここから編集する
int count(ll a,ll b){
    int ret = 0;
    while(a < b){
        a *= 2;
        ret++;
    }
    return ret;
}

int main() {
    int N;
    cin >> N;
    vector<ll> v(N),w;
    vector<pair<int, int> > ans;
    rep(i, 0, N) {
        scanf("%lld", &v[i]);
    }
    w = v;

    int minus = 0;
    int plus = 0;
    int zero = 0;
    ll max_v = v[0];
    ll max_k = 0;
    ll min_k = 0;
    ll min_v = v[0];
    rep(i, 0, N) {
        if (v[i] > 0)plus++;
        if (v[i] < 0)minus++;
        if (v[i] == 0)zero++;
//        max_v = max(max_v,v[i]);
        if (max_v < v[i]) {
            max_v = v[i];
            max_k = i;
        }
//        min_v = min(min_v,v[i]);
        if (min_v > v[i]) {
            min_v = v[i];
            min_k = i;
        }
    }

    if (plus == minus && plus == 0) {
        cout << 0 << endl;
        return 0;
    } else if(max_v <= 0){
        for (int i = N - 1; i > 0; i--) {
            ans.emplace_back(i, i - 1);
        }
    }else if(min_v >= 0){
        for (int i = 1; i < N; i++) {
            ans.emplace_back(i-1,i);
        }
    }else if(abs(max_v) > abs(min_v)){
        for (int i = 0; i < N; i++) {
            if (v[i] < 0) {
                ans.emplace_back(max_k, i);
            }
        }
        for (int i = 1; i < N; i++) {
            ans.emplace_back(i-1,i);
        }
    }else{
        for (int i = 0; i < N; i++) {
            if (v[i] > 0) {
                ans.emplace_back(min_k, i);
            }
        }
        for (int i = N - 1; i > 0; i--) {
            ans.emplace_back(i, i - 1);
        }
    }



    cout << ans.size() << endl;
    rep(i, 0, ans.size()) {
        cout << ans[i].first + 1 << " " << ans[i].second + 1 << endl;
    }


    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
 
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define endl "\n"
#define int long long

const int N=1e5+5;

int n, m;
int cache[N];
vector<int> g[N];

int dfs(int k)
{
	int &ans=cache[k];
	if(ans!=-1)
		return ans;	
	ans=0;
	for(auto &it:g[k])
		ans=max(ans, 1+dfs(it));
	return ans;
}

int32_t main()
{
	IOS;
	memset(cache, -1, sizeof(cache));
	cin>>n>>m;
	for(int i=1;i<=m;i++)
	{
		int u, v;
		cin>>u>>v;
		g[u].push_back(v);
	}
	int ans=0;
	for(int i=1;i<=n;i++)
		ans=max(ans, dfs(i));
	cout<<ans;
	return 0;
}

Measured memory_bytes: 7936
import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        while(sc.hasNext()) {
            int n = sc.nextInt();
            int p = sc.nextInt();
            if(n == 0 && p == 0) break;
            int[] a = new int[n];
            int b = p;
            int k = 0;
            int ans = 0;
            while(true) {
                if(b > 0) {
                    a[k]++;
                    b--;
                } else {
                    b += a[k];
                    a[k] = 0;
                }
                if(a[k] == p) {
                    ans = k;
                    break;
                }
                k = (k+1) % n;
            }
            System.out.println(ans);
        }
    }
}



Measured memory_bytes: 26904
num = input()
ans = [9,0,900,0,90000]
tmp = 0

if len(num)%2==0:
  tmp = sum(ans[:len(num)])
elif len(num)==1:
  tmp = num
else:
  tmp += sum(ans[:len(num)-2])
  tmp += int(num)-10**(len(num)-1)+1

print(tmp)

Measured memory_bytes: 3064
/**
 *   author: Shubham Srivastava
 *   created: 26 January 2020  21:23:32
**/
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
#define MOD 1000000007
#define INF 0x7fffffff
#define sorti(v) sort(v.begin(),v.end())
#define sortd(v) sort(v.rbegin(),v.rend())
typedef pair<ll, ll> pll;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<pii> vii;
ll parent[2000005];

int main(){
    ios_base::sync_with_stdio(false); 
    cin.tie(NULL);
    ll n,k;cin>>n>>k;
    vector <ll> arr(n);
    for(int i=0;i<n;i++)
    	cin>>arr[i];
    sort(arr.rbegin(),arr.rend());
    ll ans = 0;
    for(int i=k;i<n;i++)
    	ans += arr[i];
    cout<<ans;
return 0;
}

Measured memory_bytes: 1792
// clang-format off
#include <bits/stdc++.h>
#define int long long
#define main signed main()
#define loop(i, a, n) for (int i = (a); i < (n); i++)
#define rep(i, n) loop(i, 0, n)
#define forever for (;;)
#define all(v) (v).begin(), (v).end()
#define rall(v) (v).rbegin(), (v).rend()
#define prec(n) fixed << setprecision(n)
template<typename A> using V = std::vector<A>;
template<typename A> using F = std::function<A>;
template<typename A, typename B> using P = std::pair<A, B>;
using pii = P<int, int>;
using vi = V<int>;
using vd = V<double>;
using vs = V<std::string>;
using vpii = V<pii>;
using vvi = V<vi>;
using vvpii = V<vpii>;
constexpr int INF = sizeof(int) == sizeof(long long) ? 1000000000000000000LL : 1000000000;
constexpr int MOD = 1000000007;
constexpr double PI = 3.14159265358979;
template<typename A, typename B> bool cmin(A &a, const B &b) { return a > b ? (a = b, true) : false; }
template<typename A, typename B> bool cmax(A &a, const B &b) { return a < b ? (a = b, true) : false; }
constexpr bool odd(const int n) { return n & 1; }
constexpr bool even(const int n) { return ~n & 1; }
template<typename T> std::istream &operator>>(std::istream &is, std::vector<T> &v) { for (T &x : v) is >> x; return is; }
template<typename A, typename B> std::istream &operator>>(std::istream &is, std::pair<A, B> &p) { is >> p.first; is >> p.second; return is; }
using namespace std;
// clang-format on

main {
  int n;
  cin >> n;
  vi a(n);
  cin >> a;
  int odds = count_if(all(a), odd);
  cout << (even(odds) ? "YES" : "NO") << endl;
}


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

typedef long long ll;
typedef long double ld;

const int inf = 1e9;

int main(){
  int n;
  cin>>n;
  bool ok = false;
  while(n){
    int r = n % 10;
    n /= 10;
    if(r == 7)ok = true;
  }
  if(ok)cout<<"Yes"<<endl;
  else cout<<"No"<<endl; 
  return 0;
}




Measured memory_bytes: 3624
import java.io.*;
import java.math.*;
import java.util.*;

public class Main {
    private static boolean debug = false;
    private static boolean elapsed = false;

    private static PrintWriter _out = new PrintWriter(System.out);
    private static PrintWriter _err = new PrintWriter(System.err);

    private void solve(Scanner sc) {
        int N = sc.nextInt();
        int[] L = new int[2 * N];
        for (int i = 0; i < 2 * N; ++i) {
            L[i] = sc.nextInt();
        }

        Arrays.sort(L);

        int sum = 0;
        for (int i = 0; i < 2 * N; i += 2) {
            sum += Math.min(L[i], L[i + 1]);
        }
        _out.println(sum);
    }
    private static BigInteger C(long n, long r) {
        BigInteger res = BigInteger.ONE;
        for (long i = n; i > n - r; --i) {
            res = res.multiply(BigInteger.valueOf(i));
        }
        for (long i = r; i > 1; --i) {
            res = res.divide(BigInteger.valueOf(i));
        }
        return res;
    }
    private static BigInteger P(long n, long r) {
        BigInteger res = BigInteger.ONE;
        for (long i = n; i > n - r; --i) {
            res = res.multiply(BigInteger.valueOf(i));
        }
        return res;
    }
    /*
     * 10^10 > Integer.MAX_VALUE = 2147483647 > 10^9
     * 10^19 > Long.MAX_VALUE = 9223372036854775807L > 10^18
     */
    public static void main(String[] args) {
        long S = System.currentTimeMillis();

        Scanner sc = new Scanner(System.in);
        new Main().solve(sc);
        _out.flush();

        long G = System.currentTimeMillis();
        if (elapsed) {
            _err.println((G - S) + "ms");
        }
        _err.flush();
    }
}

Measured memory_bytes: 21840