akhauriyash/Code-Regression huggingface dataset:
#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 FORR(i,m,n) for(int i=(m) ; i>=(n) ; i--)

#define All(x) (x).begin(),(x).end()

typedef long long ll;
typedef unsigned long long ull;

const int INF = 1e9;

int main(){
   int x,y;cin >>x >> y;
   if(x % y == 0)cout << -1;
   else cout << x;
   return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main(){
  int N;
  int count = 0;
  int Even= 0;
  cin >> N;
  int A[N];
  for(int i=0;i<N;i++){
    cin >> A[i];
  }
  while(true){
    for(int i = 0; i<N;i++){
      if(A[i]%2==0){
        Even++;
      }
    }
    if(Even==N){
      count++;
      for(int i = 0; i<N;i++){
        A[i]/=2;
      }
      Even = 0;
    }else{
      break;
    }
  }
  cout << count;
  return 0;
}

Measured memory_bytes: 256
<?php
fscanf(STDIN, "%d %d ", $n,$k);
$arr = array_map('intval', explode(' ', trim(fgets(STDIN))));
sort($arr);
//print_r($arr);
$ans=0;
for($i=0;$i<$k;++$i){
  $ans=$ans+$arr[$i];
}
echo $ans;


Measured memory_bytes: 16264
#include <stdio.h>
int main(){
  int i ,n ,high=0 ,low=0 ,point[100]={} ,score=0;
    while( scanf( "%d" ,&n ) ){
      if( n == 0 ){
	break;
      }

      for( i=0 ; i<n ; i++ ){  // 得点の入力
	scanf( "%d" ,&point[i] );
      }

      high = point[0];
      low = point[0];

      for( i=0 ; i<n ; i++ ){
	score += point[i];

	if( point[i] > high ){    // 最高得点
	  high = point[i];
	}

	if( point[i] < low ){     // 最低得点
	  low = point[i];
	}
      }

      score -= high;
      score -= low;
      score /= n-2;

      printf( "%d\n" ,score );
      score = 0;
    }

  return 0;
}

Measured memory_bytes: 596
import std.stdio, std.conv, std.array, std.string, std.algorithm, std.container, std.range, core.stdc.stdlib, std.math, std.typecons;
T[][] combinations(T)(T[] s, in int m) {   if (!m) return [[]];   if (s.empty) return [];   return s[1 .. $].combinations(m - 1).map!(x => s[0] ~ x).array ~ s[1 .. $].combinations(m); }

void main() {
  auto size = readln.chomp.to!int;
  auto numbers = readln.split.to!(int[]);

  void solve() {
    int next = 1;
    int break_count;
    foreach(n; numbers) {
      if (next != n) {
        break_count++;
        continue;
      }
      next++;
    }

    writeln(next == 1 ? -1 : break_count);
  }

  solve();
}


Measured memory_bytes: 11408
#include <bits/stdc++.h>
using namespace std;
using ld=long double;
typedef pair<int,int> P;
ld dp[605],EPS=1e-15,ans=1e9;
template<typename T>
void chmin(T &a,T b){
  if(a>b)a=b;
}

signed main(){
  int n,m;cin>>n>>m;
  vector<int> edge[n];
  while(m--){
    int s,t;cin>>s>>t;
    edge[--s].push_back(--t);
  }
  ld ans=1e9;
  for(int i=0;i<=n;i++){
    if(edge[i].size()==1)continue;
    memset(dp,0,sizeof(dp));
    for(int j=n-1;j>=0;j--){
      if(i==j){
        ld tmp=0;int a;
        for(int p:edge[j])if(tmp<dp[p])tmp=dp[p],a=p;
        for(int p:edge[j])if(p!=a)dp[j]+=(dp[p]+1)/((ld)edge[j].size()-1);
      }
      else for(int p:edge[j])dp[j]+=(dp[p]+1)/(ld)edge[j].size();
    }
    if(dp[0]>EPS)chmin(ans,dp[0]);
  }
  cout<<fixed<<setprecision(12)<<ans<<endl;
}


Measured memory_bytes: 1408
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp> 
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
using namespace std;
#define AB_BHI_NI_DEGI ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define int long long
#define pb push_back
#define N 500009
#define inf 1e18
//int mod=1e9+7;
int mod=998244353;
#define P pair<int,int>
#define F first
#define S second
#define ll long long
#define all(v) v.begin(),v.end()

#define ordered_set tree<P, null_type,less<P>, rb_tree_tag,tree_order_statistics_node_update> 

void end(int n=-1){
	cout<<n<<"\n";exit(0);
}
int n,w;
int a[N][4];
int dp[101][N];
int W[N],V[N];
int fun(int idx,int capacity){
	if(idx>=n)return 0;
	if(capacity<=0)return 0;
	if(dp[idx][capacity]!=-1)return dp[idx][capacity];
	int ans=0;
	if(W[idx]<=capacity)ans=V[idx]+fun(idx+1,capacity-W[idx]);
	ans=max(ans,fun(idx+1,capacity));
	return dp[idx][capacity]=ans;
}

int32_t main(){
    AB_BHI_NI_DEGI
	cin>>n>>w;
	for(int i=0;i<n;i++){
		cin>>W[i]>>V[i];
	}
	memset(dp,-1,sizeof(dp));
	cout<<fun(0,w)<<"\n";
    return 0;
}

Measured memory_bytes: 398208
from collections import Counter
import sys
input = sys.stdin.readline

N, K, Q = map(int, input().split())

points = [None] * N
A = [None] * Q

for i in range(Q):
    A[i] = int(input())


counter = Counter(A)

for i in range(N):
    points[i] = K - Q + counter[i + 1]

for p in points:
    if p > 0:
        print("Yes")
    else:
        print("No")


Measured memory_bytes: 15040
#include <bits/stdc++.h>
using namespace std;
int main(){
  int a,b;
  cin >> a >> b;
  vector<int> vec(3);
  vec.at(0)=a+b;
  vec.at(1)=a-b;
  vec.at(2)=a*b;
  sort(vec.begin(),vec.end());
  cout << vec.at(2) << endl;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
const int maxs = 1e3 + 5;
const int mod = 1e9 + 7;

char a[maxs][maxs];
int h,w;
long long dp[maxs][maxs];

long long go(int n,int m)
{
    if(n == 1 && m == 1)
        return 1;
    if(dp[n][m] != -1)
        return dp[n][m];
    
    long long ways = 0;
    
    if(a[n - 1][m] == '.' && a[n][m - 1] == '.')
        ways += (go(n - 1,m) % mod + go(n,m - 1) % mod) % mod;
    else if(a[n - 1][m] == '.')
        ways+= (go(n - 1,m)) % mod;
    else if(a[n][m - 1] == '.')
        ways+= (go(n,m - 1)) % mod;
    
    return dp[n][m] = ways;
    
    
}

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    
    memset(dp,-1,sizeof dp);
    cin >> h >> w;
    
    int i,j;
    
    for(i = 1;i <= h;++i)
        for(j = 1;j <= w;++j)
            cin >> a[i][j];
    
    long long ans = go(h,w);
    
    cout << ans;
    
}

Measured memory_bytes: 12524
#include<cstdio>
#include<iostream>
#include<algorithm>
#include<vector>
#include<string>
using namespace std;
int A,B;
vector<string>ans;
void dfs(string str,int a,int b){
    if(a==A&&b==B){
        ans.push_back(str);
        return;
    }
    if(a>A||b>B)return;
    if(a>=5&&b<=3)return;
    if(b>=5&&a<=3)return;
    if(a==5&&b==5)return;
    dfs(str+"A",a+1,b);
    dfs(str+"B",a,b+1);
}
int main(){
    cin>>A>>B;
    dfs("",0,0);
    sort(ans.begin(),ans.end());
    for(int i=0;i<ans.size();i++)cout<<ans[i]<<endl;

    return 0;
}

Measured memory_bytes: 1224
# -*- coding: utf-8 -*-
import bisect
import heapq
import math
import random
import sys
from collections import Counter, defaultdict, deque
from decimal import ROUND_CEILING, ROUND_HALF_UP, Decimal
from functools import lru_cache, reduce
from itertools import combinations, combinations_with_replacement, product, permutations
from operator import add, mul, sub

sys.setrecursionlimit(10000)


def read_int():
    return int(input())


def read_int_n():
    return list(map(int, input().split()))


def read_float():
    return float(input())


def read_float_n():
    return list(map(float, input().split()))


def read_str():
    return input().strip()


def read_str_n():
    return list(map(str, input().split()))


def error_print(*args):
    print(*args, file=sys.stderr)


def mt(f):
    import time

    def wrap(*args, **kwargs):
        s = time.time()
        ret = f(*args, **kwargs)
        e = time.time()

        error_print(e - s, 'sec')
        return ret

    return wrap


@mt
def slv(X, Y):
    if abs(X-Y) > 1:
        return 'Alice'
    return 'Brown'


def main():
    X, Y = read_int_n()
    print(slv(X, Y))


if __name__ == '__main__':
    main()


Measured memory_bytes: 6724
const input = require("fs").readFileSync("/dev/stdin", "utf8")
let cin = input.split(/ |\n/), cid = 0
const next = () => cin[cid++]
const nexts = (n) => cin.slice(cid, cid+=n).map(i=>parseInt(i))

const [H1, M1, H2, M2, K] = nexts(5);
const time = H2 * 60 + M2 - (H1 * 60 + M1) - K
time > 0 ? console.log(time) : console.log(0)


Measured memory_bytes: 29648
use proconio::input;

fn main() {
    input! {
        n: u32,
        m: u32,
    }
    
    let mut ac_flag = vec![false; n as usize];
    let mut wa_count = vec![0; n as usize];
    
    for _ in 0..m {
        input! {
            p: u32,
            s: String,
        }
        let i = (p - 1) as usize;
        
        if s == "AC" {
            ac_flag[i] = true;
        } else if ac_flag[i] == false {
            // 当該問題がまだACでない場合はWAをカウントアップ
            wa_count[i] += 1;
        }
    }
    
    let mut ac = 0;
    let mut wa = 0;
    for i in 0..n as usize {
        if ac_flag[i] {     // ACになった問題だけWAをカウント
            ac += 1;
            wa += wa_count[i];
        }
    }
    
    println!("{} {}", ac, wa);
}


Measured memory_bytes: 3312
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i=0; i<(n); ++i)
#define REP(i, d, n) for(int i=(d); i<(n); ++i)
#define all(v) v.begin(), v.end()
using ll = long long;
using P = pair<int, int>;
vector<vector<ll>> graph;
vector<ll> ans;

void dfs(int v, ll cost, int pre = -1){
    ans[v] += cost;
    for(auto u : graph[v]){
        if(u == pre){
            continue;
        }
        dfs(u, ans[v], v);
    }
}

int main() {

    int n, q;
    cin >> n >> q;
    graph.resize(n);
    ans.resize(n);

    rep(i, n-1){
        int a, b;
        cin >> a >> b;
        --a; --b;
        graph[a].push_back(b);
        graph[b].push_back(a);
    }

    rep(i, q){
        int p;
        ll x;
        cin >> p >> x;
        --p;
        ans[p] += x;
    }
    dfs(0, 0);

    rep(i, n){
        cout << ans[i] << " ";
    }

    return 0;
}


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

#define int long long
#define vvi vector<vector<int>>
#define vec vector
#define pq priority_queue
#define all(v) (v).begin(), (v).end()
#define uniqueV(x) sort(x.begin(), x.end()); x.erase(unique(x.begin(), x.end()), x.end());
#define rep(i, n) for (int (i) = (0); (i) < (n); ++(i))
#define repp(i, m, n) for (int (i) = (m); (i) < (n); ++(i))
#define dbg(x) cerr << #x << ": " << x << endl;
#define dbg2(x, y) cerr<<"("<<#x<<", "<<#y<<") = "<<"("<<x<<", "<<y<<")"<<endl;
#define dbg3(x, y, z) cerr<<"("<<#x<<", "<<#y<<", "<<#z<<") = "<<"("<<x<<", "<<y<<", "<<z<<")"<<endl;
#define dbgB(value, size) cerr<<#value<<": "<<bitset<size>(value) << endl;
#define line() cerr << "---------------" << endl;

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

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

template<typename T>
void print1(T begin, T end) {
  while (begin != end) {
    cout << (*begin) << " ";
    *begin++;
  }
  cout << endl;
}

template<typename T>
void print2(T Array, int height, int width) {
  for (int i = 0; i < height; i++) {
    for (int j = 0; j < width; j++) {
      cout << " " << Array[i][j];
    }
    cout << endl;
  }
}

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

string s;
string t = "keyence";

void check1() {
  if (s == "keyence") {
    puts("YES");
    exit(0);
  }
}

void check2() {
  int first = 0;
  for (int i = s.size() - 1; i >= 0; i--) {
    if (s[i] == 'k') {
      first = i;
      break;
    }
  }

  if (s.substr(first, 7) == t)  {
    puts("YES");
    exit(0);
  }

  // int idx = 0;
  // for (int i = first; i < s.size(); i++) {
  //   if (s[i] == t[idx]) {
  //     idx++;
  //   }
  // }

  // if (idx == t.size()) {
  //   puts("YES");
  //   exit(0);
  // }
}

void check3() {
  if (s.substr(0, 7) == "keyence") {
    puts("YES");
    exit(0);
  }
}

void check4() {
  string sr = s;
  reverse(all(sr));
  string tr = t;
  reverse(all(tr));

  if (s.substr(0, 1) == "k" && sr.substr(0, 6) == "ecneye") {
    puts("YES");
    exit(0);
    return;
  }
  if (s.substr(0, 2) == "ke" && sr.substr(0, 5) == "ecney") {
    puts("YES");
    exit(0);
    return;
  }
  if (s.substr(0, 3) == "key" && sr.substr(0, 4) == "ecne") {
    puts("YES");
    exit(0);
    return;
  }
  if (s.substr(0, 4) == "keye" && sr.substr(0, 3) == "ecn") {
    puts("YES");
    exit(0);
    return;
  }
  if (s.substr(0, 5) == "keyen" && sr.substr(0, 2) == "ec") {
    puts("YES");
    exit(0);
    return;
  }
  if (s.substr(0, 6) == "keyenc" && sr.substr(0, 1) == "e") {
    puts("YES");
    exit(0);
    return;
  }
}

signed main() {
  cin >> s;

  check1();
  check2();
  check3();
  check4();

  puts("NO");

  return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<queue>
#include<stack>
#include<vector>
#include<set>
#include<map>
#include<algorithm>
#include<cstring>
#include<string>
#include<cassert>
#include<cmath>
#include<climits>
#include<iomanip>
#include<bitset>
#include<unordered_map>

using namespace std;

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


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

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

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


void solve() {
	long double a, b, c;
	cin >> a >> b >> c;

	cout << (c-a-b > 2*sqrt(a*b) ? "Yes" : "No") << en;
}

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

	solve();
	//int t; cin >> t; REP(i, t) solve();

	return 0;
}


Measured memory_bytes: 256
use proconio::{fastout, input};

#[fastout]
fn main() {
    input! {
        n: usize,
        a: [usize; n - 1],
    }

    let mut v = vec![0; n];

    for a_i in a {
        v[a_i - 1] += 1;
    }

    for v_i in v {
        println!("{}", v_i);
    }
}


Measured memory_bytes: 5448
#include<bits/stdc++.h>
using namespace std;
int main()
{
  int l,r,d;
  cin>>l>>r>>d;
  int c =0;
  for(int i=l;i<=r;i++)
  {
    if(i%d==0)
      c++;
  }
  cout<<c<<endl;
}

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

int main(){
  int n, t;
  cin >> n >> t;
  int m = 10000;
  for(int i=0; i<n; i++){
    int cn, tn;
    cin >> cn >> tn;
    if(tn<=t)m = min(m, cn);
  }
  if(m==10000)cout << "TLE";
  else cout << m;
  return 0;
}

Measured memory_bytes: 256
#include<stdio.h>
#define MAX 200000
int main() {
	int R[MAX], maxv, minv, i, n;
	scanf("%d", &n);
	for (i = 0; i < n; i++) { scanf("%d", &R[i]); }
	maxv = R[1] - R[0];
	minv = R[0];
	for (i = 1; i < n; i++) {
		maxv = (maxv > R[i] - minv ? maxv : R[i] - minv);
		minv = (minv < R[i] ? minv : R[i]);
	}
	printf("%d\n",maxv);
	return 0;
}


Measured memory_bytes: 2496
#include<bits/stdc++.h>
using namespace std;
signed main(){
  cin.tie(NULL);
  ios::sync_with_stdio(false);
  double n,a[110],sum=0;
  cin>>n;
  for(int i=1;i<=n;i++){
    cin>>a[i];
    sum+=1/a[i];
  }
  cout<<1/sum<<'\n';
  return(0);
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i,n) for(ll i = 0; i < n; i++)
int main()
{
	double A,B,H,M,arcH,arcM,arc,leng,pi,cosine,x,y;
	cin >> A >> B >> H >> M;
	arcH = H*30 + M/2;
	arcM = M*6;
	pi = 3.141592653589793;

	if(arcH>=arcM)
		arc = arcH-arcM;
	else
		arc = arcM-arcH;

	if(arc>=180)
		arc = 360-arc;

	x = pi*arc/180;
//	cout << x << " " << pi << "\n";
	cosine = cos(x);

/*	y = x*x;
	ll n = 2;
	cosine = 1;
	rep(i,18){
		if(i%2 == 0)
			cosine = cosine - y/n;
		else
			cosine = cosine + y/n;
		n = n*(n+1)*(n+2);
		y = y*x*x;
	}

	cout << cosine << " " << x << "\n" ;
*/

	leng = sqrt(A*A+B*B-2*A*B*cosine);

	cout << setprecision(10) << leng;

	cin >> A;
	
	return 0;	
}


Measured memory_bytes: 4160
#include<bits/stdc++.h>
using namespace std;
char a[100000],b[100000];
int main(){
	int l,k=0;
	cin>>a;
	l=strlen(a);
	for(int i=0;i<l;i++)
	{
		b[i]=a[l-i-1];
	}
	for(int i=0;i<l;i++)
	{
		if(b[i]=='b') b[i]='d';
		else if(b[i]=='d') b[i]='b';
		else if(b[i]=='p') b[i]='q';
		else if(b[i]=='q') b[i]='p';
	}
	for(int i=0;i<l;i++)
	{
		if(a[i]==b[i]) k++;
	}
	if(k==l) cout<<"Yes"<<endl;
	else cout<<"No"<<endl;
	return 0;
}

Measured memory_bytes: 384
#include <bits/stdc++.h>
using namespace std;
#define REP(i,a) for(int i = 0; i < (a); i++)
typedef long long ll;
typedef pair<int, int> P;
const int INF = 1e9;
const int MOD = 1e9 + 7;

int main(){
	int n,k;
    cin >> n >> k;
    if(k == 1){
        cout << 0 << endl;
    }else{
        cout << n - k << endl;
    }
}

Measured memory_bytes: 256
#include<bits/stdc++.h>  
using namespace std;  
typedef long long ll;  
const int inf = 0x3f3f3f3f;
const int N=200000+10;  
int a[N],n;
int main()   
{  
    cin>>n;
    int sum=0;
    for(int i=1;i<=n;i++)
        cin>>a[i];
    for(int i=1;i<=n+1;i++)
        sum+=abs(a[i]-a[i-1]);
    for(int i=1;i<=n;i++)
    {
        cout<<sum-abs(a[i]-a[i-1])-abs(a[i+1]-a[i])+abs(a[i+1]-a[i-1])<<endl;
    }
    return 0;  
}

Measured memory_bytes: 1664
import sys
rr = lambda: sys.stdin.readline().strip()
rri = lambda: int(rr())
rrs = lambda: [int(_) for _ in rr().split()]

N, K = rrs()
S = list(rr())

S[K-1] = S[K-1].lower()

ss = ''

for s in S:
    ss += s

print(ss)

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

typedef long long ll;
#define pb push_back

// int gcd(int a, int b) {   if (b == 0) return a; return gcd(b, a % b);  }
// int lcm(int a,int b){return a/gcd(a,b)*b;}

int main(){
    ios::sync_with_stdio(0);
    cin.tie(0);
    ll n;
    cin>>n;
    ll a[n],h=0;
    for(int i=0;i<n;i++) cin>>a[i];
    for(int i=1;i<n;i++){
        if(a[i]<a[i-1]){
            h+=(a[i-1]-a[i]);
            a[i]= a[i-1];
        }
    }
    cout<<h;
    return 0;
}


Measured memory_bytes: 5216
#include<stdio.h>
int main(void)
{
  int h,w,i,j;
  
  while(1){
    scanf("%d %d",&h,&w);
    if (h==0 && w ==0)
      break;
    else{
      for(i=0;i<=h-1;i++){
	for (j=0;j<=w-1;j++){
	  if (i==0 ||i ==h-1 ||j==0 || j==w-1){
	  printf("#");
	  }
	  
	  else {
	    printf(".");
	  }
	}
	printf("\n");
      }
      printf("\n");
    }
  }
  return 0;
}

Measured memory_bytes: 572
#include <bits/stdc++.h>
#define ll long long int
#define ld long double
#define f first
#define s second
#define pb push_back
#define eb emplace_back
#define mk make_pair
#define mt make_tuple
#define MOD 1000000007
#define fo(i,a,b) for(i=a;i<b;i++)
#define foe(i,a,b) for(i=a;i<=b;i++)
#define all(x) x.begin(), x.end()
#define vi vector<int>
#define vl vector <long long int>
#define pii pair <int,int>
#define pll pair <long long int, long long int>
#define vpii vector< pair<int,int> >
#define vpll vector < pair <long long int,long long int> >
#define boost ios::sync_with_stdio(false); cin.tie(0)
using namespace std;
const int inf = 1e9 + 5;
const ll inf64 = 1e18 + 5;

const ld eps = 1e-10;
int main()
{
	boost;
	ld a, b, c;
	cin >> a >> b >> c;
	ld x = sqrt(a);
	ld y = sqrt(b);
	ld z = 2.0 * x * y;
	ld df = c - (a + b + z);
	if(df > eps) cout << "Yes";
	else cout << "No";
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
/*#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
/*template <typename T>
using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
*/typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef pair<ll,ll> pl;
typedef pair<int,int> pii;

#define int ll
#define LOCAL 0
#define dbg(x) cout << #x << " is " << x << "\n"
#define gll(x) scanf("%d",&x)
#define gll2(x,y) scanf("%d%d",&x,&y)
#define gll3(x,y,z) scanf("%d%d%d",&x,&y,&z)
#define gllarr(arr,n) f(i,n) gll(arr[i]);
#define sz(x) ((int)x.size())
#define s(x) sort(x.begin(),x.end())
#define all(v) v.begin(),v.end()
#define rs(v) { s(v) ; r(v) ; }
#define r(v) {reverse(all(v));}
#define pb push_back
#define f(i,n) for(int i=0;i<n;i++)
#define fr(i,n) for(int i=n-1;i>=0;i--)
#define rep(i,a,b) for(int i=a;i<=b;i++)
#define repr(i,a,b) for(int i=a;i>=b;i--)

const ll mod = (ll)1e9 + 7;
const ll inf = (ll)1e16;
const ld eps = 1e-12;
const ll N = (int)1e5 + 5;
const ll LOGN = 19;
const ld PI = 3.14159265358979323846;
inline ll mul(ll a, ll b, ll m = mod) { return (ll)(a * b) % m;}
inline ll add(ll a, ll b, ll m = mod) { a += b; if(a >= m) a -= m; if(a < 0) a += m; return a;}
inline ll power(ll a, ll b, ll m = mod) { if(b == 0) return 1; if(b == 1) return (a % m); ll x = power(a, b / 2, m); x = mul(x, x, m); if(b % 2) x = mul(x, a, m); return x;}

int32_t main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    if (LOCAL) {
        freopen("C:\\Users\\Dishant\\Desktop\\Collection-DEV c++\\input.txt", "r", stdin);
        freopen("C:\\Users\\Dishant\\Desktop\\Collection-DEV c++\\output.txt", "w", stdout);
    }
    string s;
    deque<char> beg, end;
    int rev = 0;
    cin>>s;
    int q;
    cin>>q;
    while(q--) {
        int t;
        cin>>t;
        if(t == 1) {
            rev ^= 1;
        }
        else {
            int f; char c;
            cin>>f>>c;
            if(f == 1) {
                if(rev) {
                    end.push_back(c);
                }
                else {
                    beg.push_front(c);
                }
            }
            else {
                if(rev) {
                    beg.push_front(c);
                }
                else {
                    end.push_back(c);
                }
            }
        }
    }
    string ff, ss;
    for(auto &c: beg) ff += c;
    for(auto &c: end) ss += c;
    if(rev) {
        r(s);
        r(ss);
        r(ff);
        cout<<ss<<s<<ff;
    }
    else {
        cout<<ff<<s<<ss;
    }
    return 0;
}


Measured memory_bytes: 1108
/*
　　　  ∧＿∧　やあ
　　 （´・ω・｀)　　　　　/　　　　　ようこそ、バーボンハウスへ。
　　 ／∇y:::::＼　　　 [￣]　　　　　このテキーラはサービスだから、まず飲んで落ち着いて欲しい。
　　 |:⊃:|:::::|　　　|──|
￣￣￣￣￣￣￣￣￣￣￣￣￣￣￣￣￣|　うん、「また」なんだ。済まない。
￣￣￣￣￣￣￣￣￣￣￣￣￣￣￣|￣　  仏の顔もって言うしね、謝って許してもらおうとも思っていない。
￣￣￣￣￣￣￣￣￣￣￣￣￣￣／|
　　　　∇　∇　∇　∇　　　／.／|　　　でも、この提出を見たとき、君は、きっと言葉では言い表せない
　　　　┴　┴　┴　┴　／ ／　  |　　　「ときめき」みたいなものを感じてくれたと思う。
￣￣￣￣￣￣￣￣￣￣|／　　  |　　　殺伐としたコンテストの中で、そういう気持ちを忘れないで欲しい
￣￣￣￣￣￣￣￣￣￣　　　　 |　　　そう思って、この提出を投げたんだ。
　　　(⊆⊇)　(⊆⊇)　(⊆⊇)　　|
　    ||　　 ||　　||　　|　　　 じゃあ、判定を聞こうか。
　　.／|＼　／|＼ ／|＼
*/

#include <iostream>
#include <cstdlib>
#include <algorithm>
#include <array>
#include <bitset>
#include <climits>
#include <cmath>
#include <cstdio>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <string>
#include <vector>
using namespace std;
#define fst first
#define snd second
#define mp make_pair
#define ALL(obj) (obj).begin(),(obj).end()
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define RFOR(i,a,b) for(int i = (b-1);i>=a;i--)
#define REP(i,n)  FOR(i,0,n)
#define RREP(i,n) RFOR(i,0,n) 
#define SIZE(x) ((int)(x).size())
#define debug(x) cerr << #x << " -> " << x << " (line:" << __LINE__ << ")" << '\n';
#define debugpair(x, y) cerr << "(" << #x << ", " << #y << ") -> (" << x << ", " << y << ") (line:" << __LINE__ << ")" << '\n';
typedef long long lint;
typedef pair<int, int> pint;
typedef pair<lint, lint> plint;
typedef vector<lint> vec;
typedef vector<vector<lint>> matrix;
typedef priority_queue<lint> p_que;
typedef priority_queue<lint, vector<lint>, greater<lint>> p_que_rev;
const lint INF = INT_MAX;
const lint LINF = LLONG_MAX;
const lint MOD = 1000000000 + 7;
const double EPS = 1e-9;
const double PI = acos(-1);
const int di[]{0, -1, 0, 1, -1, -1, 1, 1};
const int dj[]{1, 0, -1, 0, 1, -1, -1, 1};

lint gcd(lint a, lint b) {
    lint r;
    while (b != 0) {
        r = a % b;
        a = b; 
        b = r;
    }
    return a;
}

lint lcm(lint a, lint b) {
    return (a / gcd(a, b)) * b;
}

lint power(lint x, lint n, lint mod = MOD) {
    lint ret = 1;
    while(n > 0) {
        if(n & 1){
            (ret *= x) %= mod;
        }
        (x *= x) %= mod;
        n >>= 1;
    }
    return ret;
}

vector<lint> make_power(int n, lint base){
    lint num = 1;
    vector<lint> ret;
    for (int i=0; i<=n; ++i){
        ret.push_back(num);
        num *= base;
    }
    return ret;
}

int main()
{
    cin.tie(0);
    ios_base::sync_with_stdio(false);
    int r;
    cin >> r;
    cout << r * r << endl;
    return 0;
}

Measured memory_bytes: 888
#include <bits/stdc++.h>
using namespace std;
#define ALL(x) (x).begin(),(x).end()
#define COUT(x) cout<<(x)<<"\n"
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define REP(i, n) for(int i=0;i<n;i++)
#define YES(x) cout<<(x?"YES":"NO")<<"\n"
#define Yes(x) cout<<(x?"Yes":"No")<<"\n"
#define dump(x) cout<<#x<<" = "<<(x)<<"\n"
#define endl "\n"
using G = vector<vector<int>>;
using M = map<int,int>;
using P = pair<int,int>;
using PQ = priority_queue<int>;
using PQG = priority_queue<int,vector<int>,greater<int>>;
using V = vector<int>;
using ll = long long;
using edge = struct { int to; int cost; };
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
const int INF = 1e9;
const int MOD = 1e9+7;
const ll LINF = 1e18;

int n;
vector<string> ans;

void dfs(string s = "", int m = 0) {
  if (s.size() == n) {
    ans.push_back(s); return;
  }

  for (int i = 0; i <= m; i++) {
    string ns = s + (char)('a' + i);
    int nm = i == m ? m + 1 : m;
    dfs(ns, nm);
  }
}

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

  dfs();
  sort(ALL(ans));
  REP(i,ans.size()) COUT(ans[i]);

  return 0;
}

Measured memory_bytes: 7396
a, b, c, d = map(int, input().split())

ans = -float("INF")  # 答えがマイナスになることがあるので、負の無限大を初期値にしておきます

for x in (a, b):
    for y in (c, d):
        ans = max(ans, x * y)

print(ans)

Measured memory_bytes: 9092
#include <bits/stdc++.h>
#define INF 2147483647
#define INF_LL 9223372036854775807
using namespace std;
typedef long long int ll;
typedef unsigned long long int ull;
int main() {
	int n;
	cin >> n;
	if (n == 1) {
		cout << "Hello World" << endl;
		return 0;
	}
	else {
		int A, B;
		cin >> A >> B;
		cout << A + B << endl;
		return 0;
	}
	return 0;
}

Measured memory_bytes: 768
#include<bits/stdc++.h>
//#include<ext/pb_ds/assoc_container.hpp>
//#include<ext/pb_ds/tree_policy.hpp>
//
//    #pragma GCC optimize("unroll-loops")
//    #pragma GCC optimize("Ofast")
//    #pragma GCC optimize("-O3")
//    #pragma GCC optimize("no-stack-protector")
//    #pragma GCC optimize("fast-math")

#define fi first
#define f first
#define se second
#define s second
#define vi_a vector<int>a;
#define p_b push_back
////////////////////////////////???????????????CHECK THIS OUT???????????????//////////////////////////////
#define ll long long
////////////////////////////////???????????????CHECK THIS OUT???????????????//////////////////////////////
#define ld long double
#define pll pair<ll,ll>
#define pii pair<int,int>
#define m_p make_pair
#define fast_io cin.tie(0);cout.tie(0);ios_base::sync_with_stdio(0);
#define all(x) x.begin(),x.end()
#define getfiles    ifstream cin("input.txt");ofstream cout("output.txt");
#define pw(x) (1ll << x)
#define sz(x) (ll)x.size()
#define endl "\n"
#define rall(x) x.rbegin(),x.rend()
#define len(a) (ll)a.size()
#define rep(x,l,r) for(ll x=l;x<r;x++)
//#define for(int i=0;i<n;i++) for(ll i=0;i<n;i++)
using namespace std;
//using namespace __gnu_pbds;
ld eps = (ld)1 / 1e6;
ll inf = INT_MAX, mod2 = 998244353, mod1 = 1e9 + 7;
ll sqr(ll a) { return a * a; }
ll qb(ll a) { return a * a * a; }
ll gcd(ll a, ll b) { return !a ? b : gcd(b % a, a); }
ll binpow(ll a, ll b, ll mod) { return b ? (b % 2 ? (a * (sqr(binpow(a, b / 2, mod)) % mod)) % mod : sqr(binpow(a, b / 2, mod)) % mod) : 1; }
ll binmult(ll a, ll b, ll mod) { return b ? (b % 2 ? (2 * binmult(a, b / 2, mod) + a) % mod : (2 * binmult(a, b / 2, mod)) % mod) : 0; }
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//const ll to[5]={0,4,6,7,9};
//const ll N=2*1e5+1;
const ll R=1e4;
//const ll to[7]={1,2,3,1,3,2,1};
const ll tx[4]={0,0,-1,1};
const ll ty[4]={-1,1,0,0};
const char rev_to[4]={'E','W','N','S'};
const ll N=2*1e5+4;
//set<int> lol2[26][26];
set<int>ab;
set<int>ba;
signed main(){
    fast_io;
    ll a,b;
    cin>>a>>b;
    cout<<a*b;
    return 0;
}
/*
    aa
    bb
    если WA , то чекер говно, поэтому почекай l8 строчку
    !x || !y x-проигрышная или выигрышная , y-колво таких позиций
    x==0 проигрышная
    y==0 четное проигрышных или четное выигрышных
    x==0 && y==0 четное проигрышных
*/


Measured memory_bytes: 3636
from time import time
start = time()

# 解説放送の解法

class BIT:
    '''https://tjkendev.github.io/procon-library/python/range_query/bit.html'''
    def __init__(self, n):
        self.n = n
        self.data = [0]*(n+1)
        self.el = [0]*(n+1)
    def sum(self, i):
        s = 0
        while i > 0:
            s += self.data[i]
            i -= i & -i
        return s
    def add(self, i, x):
        self.el[i] += x
        while i <= self.n:
            self.data[i] += x
            i += i & -i
    def query(self, i, j=None):
        if j is None:
            return self.el[i]
        return self.sum(j) - self.sum(i)
      
def main():
  N,Q=map(int,input().split())
  *C,=map(int,input().split())
  q = [tuple(map(int,input().split())) for _ in range(Q)]

  # 重複度を数える。
  res=[]
  tmp_dict={}
  for i in range(N):
    if tmp_dict.get(C[i]) != None:
      #(クエリの種類、l, r）
      res.append((tmp_dict[C[i]]<<40) | (Q<<20) | i)
      del tmp_dict[C[i]]
    tmp_dict[C[i]] = i

  # クエリと合わせてソート。
  X = []
  for i in range(Q):
    l,r = q[i]
    # (元のクエリの順番、l, r)
    X.append(((l-1)<<40) | (i<<20) | r-1)
    
  X.extend(res) 
  X = sorted(X)

  # 平面走査
  bit = BIT(N)
  ans=[0]*Q
  mask = (1<<20) - 1
  for l in reversed(X):
    r = l & mask
    l >>= 20
    idx = l & mask
    l >>= 20
    if idx == Q:
      bit.add(r,1)
    else:
      ans[idx] = r-l+1-bit.query(l-1,r)
      
  print(*ans)
  
if __name__=="__main__":
  main()

Measured memory_bytes: 294616
import sys
N, M = list(map(int, input().split()))
X = list(map(int, input().split()))
if M == 1:
    print(0)
    sys.exit()
X.sort()
_X = [X[i + 1] - X[i] for i in range(M - 1)]
_X.sort()
res = sum(_X)
for i in range(min(N - 1, M - 1)):
    res -= _X[M - 2 - i]
print(res)


Measured memory_bytes: 20440
#include <iostream>
#include <vector>
#include <algorithm>
#include <map>
#include <string>
#include <cmath>
#include <iomanip>
#define rep(i,n) for (int i=0; i < (n); ++i)
using namespace std;
typedef long long ll;
int main(){
    int n;
    ll ans=0;
    cin >> n;
    vector<ll> a(n);
    rep(i, n) cin >> a[i];
    for(int i=1; i<n; i++){
        if(a[i] < a[i-1]){
            ans += a[i-1] - a[i];
            a[i] = a[i-1];
        }
    }
    cout << ans << endl;
    return 0;
}

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

int N, a, qwq, now;
long long ans;

int main(){
	scanf("%d", &N);
	for(int i=1; i<=N; i++){
		scanf("%d", &qwq);
		a=log2(qwq);
		if((1<<a)<qwq){
			if(now>a)	now=a;
			else		a++;
			
		}
		if(a>now)	ans+=(long long)a-now, now=a;
		if(a<now)	now=a;
	}
	printf("%lld", ans);
	return 0;
}

Measured memory_bytes: 384
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);

		int n = sc.nextInt();
		int[] A = new int[n];
		int[] B = new int[n];
		int[] C = new int[n-1];

		for (int i = 0; i < n; i++) {
			A[i] = sc.nextInt();
		}

		for (int i = 0; i < n; i++) {
			B[i] = sc.nextInt();
		}

		for (int i = 0; i < n-1; i++) {
			C[i] = sc.nextInt();
		}

		int ans = 0;

		for (int a: A) {
			ans += B[a-1];
		}

		for (int i=0; i < n-1; i++) {
			if (A[i] + 1 == A[i+1]) {
				ans += C[A[i]-1];
			}
		}

		System.out.println(ans);



}}

Measured memory_bytes: 23764
/* {{{ */
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
    ($($r:tt)*) => {
        let s = {
            use std::io::Read;
            let mut s = String::new();
            std::io::stdin().read_to_string(&mut s).unwrap();
            s
        };
        let mut iter = s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
}

macro_rules! input_inner {
    ($iter:expr) => {};
    ($iter:expr, ) => {};
    ($iter:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($iter, $t);
        input_inner!{$iter $($r)*}
    };
}

macro_rules! read_value {
    ($iter:expr, ( $($t:tt),* )) => {
        ( $(read_value!($iter, $t)),* )
    };
    ($iter:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($iter, $t)).collect::<Vec<_>>()
    };
    ($iter:expr, chars) => {
        read_value!($iter, String).chars().collect::<Vec<char>>()
    };
    ($iter:expr, usize1) => {
        read_value!($iter, usize) - 1
    };
    ($iter:expr, $t:ty) => {
        $iter.next().unwrap().parse::<$t>().expect("Parse error")
    };
}
/* }}} */

fn main() {
    input! {
        n: usize,
        k: usize,
        h: [u64;n]
    }
    let mut h = h;
    h.sort();
    h.reverse();
    println!("{}", h.iter().skip(k).sum::<u64>());
}
/* vim:set foldmethod=marker: */


Measured memory_bytes: 9464
#include<bits/stdc++.h>
#define pb push_back
#define ll long long
using namespace std;

const int maxn = 1e6+5;

int main()
{
    ll n, k; cin >> n >> k;
    ll b = n%k;
    ll c = k-b;
    cout << min(b, c) << endl;
}


Measured memory_bytes: 256
A, B, C = map(int, input().split())

tmpM = max(A, B, C)
tmp = A + B + C
if ((3 * tmpM) - tmp) % 2 == 0:
    print(((3 * tmpM) - tmp) // 2)
else:
    print((3 * (tmpM + 1) - tmp) // 2)

Measured memory_bytes: 2940
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
using namespace std;
using ll = long long;
using P = pair<int, int>;
const int INF = 1001001001;
const ll LINF = 1001001001001001;
const int MOD = 1000000007;

template <typename T>
void print(const T &v);

int main()
{
    int n;
    cin >> n;
    int maxi;
    cin >> maxi;
    for (int i = 1; i < n; i++)
    {
        int now;
        cin >> now;
        if (maxi > now + 1)
        {
            cout << "No" << endl;
            return 0;
        }
        maxi = max(maxi, now);
    }
    cout << "Yes" << endl;
    return 0;
}

// Use For Debug
template <typename T>
void print(T const &v)
{
    for (int i = 0; i < v.size(); i++)
    {
        if (i)
            cout << ' ';
        cout << v[i];
    }
    cout << endl;
};

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

using namespace std;

int main(){
	long long int A=0,temp,N,M,largex=0,smallx=0,largey=0,smally=0,largez=0,smallz=0;
	cin >> N >> M;
	long long int x[N],y[N],z[N];
	vector<long long int> s(N);
	for(int i=0;i<N;i++){
		cin >> x[i] >> y[i] >> z[i];
	}
	for(int i=0;i<N;i++){
		s[i]=x[i]+y[i]+z[i];
	}
	sort(s.rbegin(),s.rend());
	for(int i=0;i<M;i++){
		A+=s[i];
	}
	temp=A;
	A=0;
	for(int i=0;i<N;i++){
		s[i]=x[i]+y[i]-z[i];
	}
	sort(s.rbegin(),s.rend());
	for(int i=0;i<M;i++){
		A+=s[i];
	}
	temp=max(temp,A);
	A=0;
	for(int i=0;i<N;i++){
		s[i]=x[i]-y[i]+z[i];
	}
	sort(s.rbegin(),s.rend());
	for(int i=0;i<M;i++){
		A+=s[i];
	}
	temp=max(temp,A);
	A=0;
	for(int i=0;i<N;i++){
		s[i]=x[i]-y[i]-z[i];
	}
	sort(s.rbegin(),s.rend());
	for(int i=0;i<M;i++){
		A+=s[i];
	}
	temp=max(temp,A);
	A=0;
	for(int i=0;i<N;i++){
		s[i]=0-x[i]+y[i]+z[i];
	}
	sort(s.rbegin(),s.rend());
	for(int i=0;i<M;i++){
		A+=s[i];
	}
	temp=max(temp,A);
	A=0;
	for(int i=0;i<N;i++){
		s[i]=0-x[i]+y[i]-z[i];
	}
	sort(s.rbegin(),s.rend());
	for(int i=0;i<M;i++){
		A+=s[i];
	}
	temp=max(temp,A);
	A=0;
	for(int i=0;i<N;i++){
		s[i]=0-x[i]-y[i]+z[i];
	}
	sort(s.rbegin(),s.rend());
	for(int i=0;i<M;i++){
		A+=s[i];
	}
	temp=max(temp,A);
	A=0;
	for(int i=0;i<N;i++){
		s[i]=0-x[i]-y[i]-z[i];
	}
	sort(s.rbegin(),s.rend());
	for(int i=0;i<M;i++){
		A+=s[i];
	}
	temp=max(temp,A);
	
	cout << temp << endl;
	return 0;
}

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

int main() {
  int64_t L0 = 2;
  int64_t L1 = 1;
  int64_t L2 = L0 + L1;
  int N;
  cin >> N;
  if (N == 0) {
    cout << L0 << endl;
  }
  else if (N == 1) {
    cout << L1 << endl;
  }
  else if (N == 2) {
    cout << L2 << endl;
  }
  else {
    for (int i = 0; i < N-2; i++) {
      int64_t tmp = L1 + L2;
      L1 = L2;
      L2 = tmp;
    }
    cout << L2 << endl;
  }
}

Measured memory_bytes: 256
#include<cstdio>
#include<vector>
#include<algorithm>
using namespace std;

int main(){
  while(true){
    int n,m,p[1001];
    vector<int> a;
    scanf("%d %d",&n,&m);
    if(n==0&&m==0) return 0;
    p[0] = 0;
    for(int i=0;i<n;i++) scanf("%d",p+i+1);
    n++;
    for(int i=0;i<n;i++){
      for(int j=0;j<n;j++){
        a.push_back(p[i]+p[j]);
      }
    }
    sort(a.begin(),a.end());
    a.erase(unique(a.begin(),a.end()),a.end());
    int ans = 0;
    for(int i=0;i<a.size();i++){
      int x = m - a[i];
      int j = upper_bound(a.begin(),a.end(),x) - a.begin();
      if(j!=0) ans = max(ans,a[i]+a[j-1]);
    }
    printf("%d\n",ans);
  }
}

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

int main() {
    ll A, B, C, K;
    cin >> A >> B >> C >> K;
    if (K % 2 == 0) {
        cout << A - B << endl;
    } else {
        cout << B - A << endl;
    }
}

Measured memory_bytes: 256
import java.util.*;
import java.io.*;



public class Main{

     public static void main(String []args){
            Scanner scanner = new Scanner(System.in);
            int a= scanner.nextInt();
            int b= scanner.nextInt();
            int h= scanner.nextInt();
            
             System.out.println((a+b)*h/2);
            
            
            
            
            
          //  int n= =scanner.nextInt();
         //   System.out.println();
         //   for(int i=0;i<n;i++)
     }
}

Measured memory_bytes: 35680
using System;

namespace abc072A
{
    class MainClass
    {
        public static void Main(string[] args)
        {
            string[] str = Console.ReadLine().Split();
            long A = long.Parse(str[0]);
            long B = long.Parse(str[1]);
            if (A >= B)
                Console.WriteLine(A - B);
            else
                Console.WriteLine(0);
        }
    }
}


Measured memory_bytes: 13140
import bisect
n,m=map(int, input().split())
pl=[0]*100000
yl=[0]*100000
ol=[[] for i in range(100001)]
for i in range(m):
    pl[i],yl[i] = map(int, input().split())
    ol[pl[i]].append(yl[i])
for i in range(1,n+1):
    ol[i].sort()
for i in range(m):
    print("%06d%06d" % (pl[i], bisect.bisect_right(ol[pl[i]], yl[i])))

Measured memory_bytes: 24052
n,m = map(int,input().split())
box = [0] * n
ans = 0
fal = 0
for _ in range(m):
    p,s = input().split()
    p = int(p)
    s = str(s)
    if s == "WA":
        if box[p-1] != -1:
            box[p-1] += 1
        else:
            pass
    else:
        if box[p-1] != -1:
            ans += 1
            fal += box[p-1]
            box[p-1] = -1
        else:
            pass
print(ans,fal)

Measured memory_bytes: 3828
#include <cstdio>
#include <iostream>

using namespace std;
const int N = 200000;

int n, L;
int a[N], f[N][32];

int read(void)
{
	int s = 0, w = 0; char c = getchar();
	while (c < '0' || c > '9') w |= c == '-', c = getchar();
	while (c >= '0' && c <= '9') s = s*10+c-48, c = getchar();
	return w ? -s : s;
}

int main(void)
{
	n = read();
	for (int i=1;i<=n;++i)
		a[i] = read();
	L = read();
	for (int i=1,pos=2;i<=n;++i)
	{
		while (pos <= n && a[pos] - a[i] <= L) pos ++;
		f[i][0] = pos - 1;
	}
	a[n+1] = a[n] + 1;
	for (int i=1;i<=30;++i)
	    for (int j=1;j<=n;++j)
	        f[j][i] = f[f[j][i-1]][i-1];
	int m = read();
	while (m --)
	{
		int l = read(), r = read(), cnt = 0;
		if (l > r) swap(l,r);
		for (int i=30;~i;--i) 
		{
			if (f[l][i] >= r) continue;
			cnt += 1<<i; l = f[l][i];
		} 
		printf("%d\n", cnt+1);
	}
	return 0; 
}  

Measured memory_bytes: 15488
#include <bits/stdc++.h>
using namespace std;
#include <algorithm>
 
int main() {
 
  int long long t=0,i=0,j=0,N;
  double sum=0;
  int ans=1;

  cin >> N;

  vector<string> S(N);

  for ( i = 0; i < N; i++)
  {
    cin >> S[i];
  }
  
  sort(S.begin(), S.end());

  for ( i = 1; i < N; i++)
  {
    if (S[i]!=S[i-1])
    {
      ans++;
    }
    
  }
  
  
  cout << ans << endl;
  
  return 0;
}

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

struct TResult
{
	int m;
	vector<int> G;
	int cnt;
};

void insertionSort(vector<int> &A, int g, int &cnt)
{
	for(int i = g; i < A.size(); i++){
		int v = A[i];
		int j = i - g;
		while(j >= 0 && A[j] > v){
			A[j+g] = A[j];
			j = j - g;
			cnt++;
		}
		A[j+g] = v;
	}
}

vector<int> FindShellSortNumber(int n)
{
	int g = 1;
	vector<int> G;
	while(g <= n){
		G.push_back(g);
		g = 3 * g + 1;
	}
	reverse(G.begin(), G.end());
	return G;
}

TResult shellSort(vector<int> &A)
{
	TResult Result;
	Result.cnt = 0;
	Result.G   = FindShellSortNumber(A.size());
	Result.m   = Result.G.size();
	for(int i = 0; i < Result.m; i++){
		insertionSort(A, Result.G[i], Result.cnt);
	}
	return Result;
}

vector<int> Input(int n)
{
	vector<int> A;
	A.resize(n);
	for(int i = 0; i < n; i++){
		cin >> A[i];
	}
	return A;
}

void Output(TResult Result, vector<int> A)//????????´???Result??¨A??????????????????????????§&?????????
{
	cout << Result.m << endl;
	for(int i = 0; i < Result.G.size() - 1; i++){
		cout << Result.G[i] << ' ';
	}
	cout << Result.G[Result.G.size() - 1] << endl;
	cout << Result.cnt << endl;
	for(int i = 0; i < A.size(); i++){
		cout << A[i] << endl;
	}	
}

int main()
{
	int n;
	cin >> n;
	vector<int> A = Input(n);
	TResult Result = shellSort(A);
	Output(Result, A);
	return 0;
}

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

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


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

typedef long long ll;
const int N = 2e5 + 77;
const int mod = (int)1e9 + 7;
const int inf = (int)1e9 + 77;

int main()
{
  int h, w, k, a, b, u, v;
  scanf("%d%d%d%d%d%d%d", &h, &w, &k, &a, &b, &u, &v);
  int dx[] = {1, 0, -1, 0};
  int dy[] = {0, 1, 0, -1};
  vector<string> c(h);
  vector<vector<int>> dp(h + 1, vector<int>(w + 1, inf));
  for (int i = 0; i < h; i++)
    cin >> c[i];
  queue<pair<int, int>> q;
  q.push({a, b});
  dp[a][b] = 0;
  while (q.size())
  {
    auto node = q.front();
    q.pop();
    int x = node.first;
    int y = node.second;
    int xx, yy;
    for (int i = 0; i < 4; i++)
    {
      for (int j = 1; j <= k; j++)
      {
        xx = x + dx[i] * j, yy = y + dy[i] * j;
        if (xx > 0 and xx <= h and yy > 0 and yy <= w)
        {
          if (c[xx - 1][yy - 1] == '@' || dp[xx][yy] <= dp[x][y])
            break;
          if (dp[xx][yy] > dp[x][y] + 1)
          {
            dp[xx][yy] = dp[x][y] + 1;
            q.push({xx, yy});
          }
        }
        else
          break;
      }
    }
  }
  printf("%d", dp[u][v] == inf ? -1 : dp[u][v]);
  return 0;
}

Measured memory_bytes: 14872
<?php
$A=[];
for($i=97;$i<123;$i++) $A[chr($i)]=0;

while(!feof(STDIN)){
	$S=trim(fgets(STDIN));
	foreach(str_split($S) as $c){
		$n=ord($c);
		if(64<$n && $n<91) ++$A[chr($n+32)];
		elseif(96<$n && $n<123) ++$A[$c];
	}
}

for($i=97;$i<123;$i++){
	$c=chr($i);
	echo $c,' : ',$A[$c],PHP_EOL;
}

Measured memory_bytes: 15552
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        
        Scanner sc = new Scanner(System.in);
        
        String s = sc.next();
        String t = sc.next();
        
        if(t.substring(0, t.length()-1).equals(s)){
            System.out.println("Yes");
        }else{
            System.out.println("No");
        }
    }
}

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

int main() {
  string n;
  cin >> n;
  for(char c:n){
    cout << (char)('1' + '9' - c);
  }
  
  
  return 0;
}


Measured memory_bytes: 256
from collections import defaultdict
N, Q = map(int, input().split())

neighbor = defaultdict(list)
counter = [0] * N

for i in range(N-1):
    a, b = map(int, input().split())
    neighbor[a-1].append(b-1)
    neighbor[b-1].append(a-1)

for i in range(Q):
    p, x = map(int, input().split())
    counter[p-1] += x

def propagate():
    stack = [(0, None)]
    while stack:
        node, parent = stack.pop()
        for c in neighbor[node]:
            if c != parent:
                counter[c] += counter[node]
                stack.append((c, node))

propagate()
print(*counter)


Measured memory_bytes: 121816
#include<set>
#include<map>
#include<cmath>
#include<queue>
#include<bitset>
#include<string>
#include<cstdio>
#include<cctype>
#include<cassert>
#include<cstdlib>
#include<cstring>
#include<sstream>
#include<iostream>
#include<algorithm>

#define For(i,x,y) for (int i=x;i<y;i++)
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define lf else if

#define dprintf(...) fprintf(stderr,__VA_ARGS__)
using namespace std;

typedef long long ll;
typedef double db;
typedef pair<int,int> pii;
typedef vector<int> Vi;

int IN(){
	int c,f,x;
	while (!isdigit(c=getchar())&&c!='-');c=='-'?(f=1,x=0):(f=0,x=c-'0');
	while (isdigit(c=getchar())) x=(x<<1)+(x<<3)+c-'0';return !f?x:-x;
}

const int N=2000+19;

int stk[N],ans[N];
int A,B,n,top,x;
char s[N];

int main(){
	A=IN(),B=IN();
	n=A+B;
	if (A<=B){
		puts("Impossible");
		fflush(stdout);
		return 0;
	}
	For(i,0,n){
		if (top==0){
			stk[++top]=i;
		} else{
			printf("? %d %d\n",stk[top],i);
			fflush(stdout);
			scanf("%s",s);
			if (s[0]=='Y') stk[++top]=i;else top--;
		}
	}
	x=stk[top];
	For(i,0,n){
		printf("? %d %d\n",x,i);
		fflush(stdout);
		scanf("%s",s);
		ans[i]=(s[0]=='Y');
	}
	printf("! ");
	For(i,0,n) printf("%d",ans[i]);
	puts("");
	fflush(stdout);
}

Measured memory_bytes: 724