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

public class Main{
    public static void main(String[] args){
        Scanner scan = new Scanner(System.in);
        String str = "";
        while(scan.hasNext()){
        	str += scan.next() + " ";
        }
        String[] nstr = str.split(" ");
        int n = nstr.length;
        double[][] point = new double[n][2];
        for(int i = 0;i < n;i++){
        	String[] s = nstr[i].split(",");
        	point[i][0] = Double.parseDouble(s[0]);
        	point[i][1] = Double.parseDouble(s[1]);
        }
        double sum = 0;
        for(int i = 1;i < n-1;i++){
        	double a = Math.sqrt((point[0][0] - point[i][0])*(point[0][0] - point[i][0])
        			+(point[0][1] - point[i][1])*(point[0][1] - point[i][1]));
        	double b = Math.sqrt((point[0][0] - point[i+1][0])*(point[0][0] - point[i+1][0])
        			+(point[0][1] - point[i+1][1])*(point[0][1] - point[i+1][1]));
        	double c = Math.sqrt((point[i][0] - point[i+1][0])*(point[i][0] - point[i+1][0])
        			+(point[i][1] - point[i+1][1])*(point[i][1] - point[i+1][1]));
        	double z = (a + b + c) / 2.0;
        	sum += Math.sqrt(z*(z-a)*(z-b)*(z-c));
        }
        System.out.printf("%.6f\n",sum);
    }
}

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

using namespace std;

#define rep(i,n) for(int i=0;i<(n);i++)
#define repa(i,a,n) for(int i=(a);i<(n);i++)
#define rrep(i,n) for(int i=n;i>=0;i--)
#define rrepa(i,a,n) for(int i=n;i>=(a);i--)
#define all(a) (a).begin(),(a).end()
#define MOD 1000000007
#define cmax(a,b) a=max(a,b)
#define cmin(a,b) a=min(a,b)
#define vc vector

typedef long long ll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef vector<double> vd;
typedef vector<vd> vvd;
typedef pair<int,int> pi;
typedef pair<ll,ll> pl;

int main(){

    int n,d;
    cin>>n>>d;
    
    int ans=0;
    rep(i,n){
        ll x,y;
        cin>>x>>y;
        if((ll)d*d >= (x*x)+(y*y))ans++;
    }

    cout<<ans<<"\n";

    return 0;

}

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

int cnt[50];
int pos[50][100002];
char str[100002];

int main(){
	
	// Init
	for(int i=0;i<50;i++){cnt[i]=0;}
	
	// Input
	cin>>str;
	for(int i=0;i<strlen(str);i++){
		pos[str[i]-'a'][cnt[str[i]-'a']++]=i;
	}

	// Solve
	for(int i='a';i<='z';i++){
		int lk=i-'a';
		for(int j=0;j<cnt[lk];j++){
			for(int k=j+1;k<cnt[lk];k++){
				int len = pos[lk][k] - pos[lk][j]+1;
				if(len/2 < k-j+1){
					cout<<pos[lk][j]+1<<" "<<pos[lk][k]+1<<endl;
					return(0);
				}
				else break;
			}
		}
	}

	cout<<"-1 -1"<<endl;
	return(0);
}

Measured memory_bytes: 8576
#include <bits/stdc++.h> 
using namespace std;
#define rep(i,n) for(ll i=0;i<n;i++)
#define all(vec) vec.begin(), vec.end()
#define tmax(x,y,z) max((x),max((y),(z)))
#define tmin(x,y,z) min((x),min((y),(z)))
typedef long long ll;ll MM = 1000000000;ll mod = MM + 7; ll MMM=9223372036854775807;//2^63 -1
ll GCD(ll x, ll y) {if (y == 0) return x;else return GCD(y, x % y);}
ll LCM(ll x, ll y) { return x / GCD(x, y) * y;}
//cout << fixed << setprecision(10);

int main(){
  ll n; cin>>n;
  for(int i=1;i<=9;i++){
  ll t=i*111; 
    if(n<=t){
      cout<<t<<endl;
      break;    
    }
    }
  }

Measured memory_bytes: 256
N = int(input())
anser = 'APPROVED'
A_list = list(map(int, input().split()))
for A in A_list:
    if A % 2 == 1:
        continue
    if A % 3 == 0:
        continue
    if A % 5 == 0:
        continue
    anser = 'DENIED'
    break
print(anser)

Measured memory_bytes: 9176
#include <bits/stdc++.h>
  using namespace std;
#define ll long long
#define fw(p) for(int w=0;w<(p);w++)
#define fx(p) for(int x=0;x<(p);x++)
#define fy(p) for(int y=0;y<(p);y++)
#define fz(p) for(int z=0;z<(p);z++)
#define fyg(p,g) for(int y=(g);y<(p);y++)
#define fzg(p,g) for(int z=(g);z<(p);z++)
#define ce(d) cout<<d<<endl;
#define vecp(p) int aa;cin>>aa;(p).push_back(aa);
#define vecpl(p) long long aa;cin>>aa;(p).push_back(aa);
#define vecps(p) string aa;cin>>aa;(p).push_back(aa);
#define vecp2(p) cin>>aa;(p).push_back(aa);
#define vecpl2(p) long long a	b;cin>>ab;(p).push_back(ab);
#define vecps2(p) string ab;cin>>ab;(p).push_back(ab);
#define set0(k,n) for(int nn=0;nn<(n);nn++){ (k).push_back(0); }
#define sorts(c) sort((c).begin(),(c).end());
#define reverses(c) reverse((c).begin(),(c).end());
#define vec(b) vector<int> (b);
#define vecl(b) vector<long long> (b);
#define vecs(b) vector<string> (b);
#define vecsize(b,size) vector<int> (b)((size));
#define pb(b,a) (b).push_back((a));
#define doublece(a,b) cout<<(a)<<' '<<(b)<<endl;
#define pairs(s) vector<pair<int,int>> (s);
#define pairsl(s) vector<pair<ll,ll>> (s);
#define pairss(s) vector<pair<string,string>> (s);
#define pairsp(s) int aa,bb;cin>>aa>>bb;(s).push_back(make_pair(aa,bb));
#define pairspl(s) ll aa,bb;cin>>aa>>bb;(s).push_back(make_pair(aa,bb));
#define pairsps(s) string aa,bb;cin>>aa>>bb;(s).push_back(make_pair(aa,bb));
#define pairsREV(s) (s).push_back(make_pair(bb,aa));
#define pairslREV(s) (s).push_back(make_pair(bb,aa));
#define pairssREV(s) (s).push_back(make_pair(bb,aa));
#define MOD 1000000007

int main() {
	
	double N,K;
	cin>>N>>K;
	double ans=0;
	
	fx(N){
		double k=1;
		int y=x+1;
		while(y<K){
			y*=2;
			k/=2;
		}
		ans+=k/N;
	}
	cout << fixed << setprecision(15) << ans << endl;
}

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

int main(void){
    int N, K;
    cin >> N >> K;
    if(K==1){
        cout << 0 << endl;   
    }else{
        cout << N-K << endl;
    }
    return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <algorithm> // sort
#include <map> // pair

#define all(x) (x).begin(),(x).end()
#define FOR(x) for(ll i = 0;i < x;++i)

using namespace std;
typedef long long ll;
int ctoi(const char c){
  switch(c){
    case '0': return 0;
    case '1': return 1;
    case '2': return 2;
    case '3': return 3;
    case '4': return 4;
    case '5': return 5;
    case '6': return 6;
    case '7': return 7;
    case '8': return 8;
    case '9': return 9;
    default : return -1;
  }
}
int main(){
  string N;
  cin>>N;

  bool YYMM = true;
  bool MMYY = true;
  int first = ctoi(N[0])*10 + ctoi(N[1]);
  int second = ctoi(N[2])*10 + ctoi(N[3]);
  if(first == 0 && second == 0){
    YYMM = MMYY = false;
    cout<<"NA";return 0;
  }
  if(first > 12 || first < 1)MMYY = false;
  if(second > 12 || second < 1)YYMM = false;
  
  if(MMYY && YYMM){
    cout<<"AMBIGUOUS";
  }else if(MMYY){
    cout<<"MMYY";
  }else if(YYMM){
    cout<<"YYMM";
  }else{
    cout<<"NA";
  }
  return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <iomanip>
#include <vector>
#include <algorithm>
#include <cstring>
#include <map>
#include <queue>
#include <cmath>
#include <complex> // complex<double> a(1.2 , 2.3);// real(): 1.2, imag()2.3
using namespace std;

#define MOD 1000000007
#define ll long long
#define ld long double
#define FOR(i,a,b) for(ll i=(ll)a;i<(ll)b;i++)
#define rep(i,n) FOR(i,0,n)
#define pb push_back
#define mp make_pair
#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define rmsame(a) sort(all(a)),a.erase(unique(all(a)), a.end())
#define rmvector(a,b) rep(i,a.size())rep(j,b.size())if(a[i]==b[j]){a.erase(a.begin()+i);i--;break;}
template<typename X> bool exist(vector<X> vec, X item){return find(all(vec), item)!=vec.end();}

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

  string s;cin >> s;
  ll a=0,b=0,c=0;
  rep(i,s.size()){
    if(s[i]=='a') a++;
    else if(s[i]=='b') b++;
    else if(s[i]=='c') c++;
  }

  vector<ll>temp;
  temp.pb(a);
  temp.pb(b);
  temp.pb(c);

  sort(all(temp));
  ll m = temp[0];
  rep(i,3)
    temp[i]-=m;

  rep(i,3){
    if(temp[i]==0) continue;
    if(temp[i]==1) continue;
    else{
      cout << "NO" << endl;
      return 0;
    }
  }

  cout << "YES" << endl;
  //cout << fixed << setprecision(16) << ans << endl;
  return 0;
}


Measured memory_bytes: 512
#include <stdio.h>


int main(){

  int a[1000],i,n,m,count,count2;

  while(1){
    scanf("%d %d",&n,&m);
    if(n == 0 && m == 0)
      break;
    for(i = 0; i < n; i++)
      a[i] = 1;
    i = 0;
    count = 0;
    count2 = 0;
    while(1){
      if(count2 == n-1)
	break;
      if(a[i] == 1)
	count++;
      if(count == m){
	a[i] = 0;
	count2++;
	count = 0;
      }
      i++;
      if(i == n)
	i = 0;
    }
  
    for(i = 0; i < n; i++){
      if(a[i] == 1)
	printf("%d\n",i+1);
    }
  }
  return 0;
}

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

int main() {
	int A, B, C; cin >> A >> B >> C;
	int start = A%B;
	
	if(start == C){
	cout << "YES" << endl;
	return 0;
	}
	
	for( int i = A*2; ; i += A){
		i %= B;
		if( i == start ) break;
		if(i == C){
			cout << "YES" << endl;
			return 0;
		}
	}
	cout << "NO" << endl;
}

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

int n, l, x[200000], y[200000];

bool M(int z){
	f(i, 1, l + 1)y[i] = x[i] > z;
	if (y[n] == y[n - 1] || y[n] == y[n + 1])return y[n];
	int i = n - 1;
	while (i > 1 && y[i] != y[i - 1])--i;
	if (i == 1)i = -100;
	pair<int, int> d = make_pair(n - i, y[i]);
	i = n + 1;
	while (i < l && y[i] != y[i + 1])++i;
	if (i == l)i = l + 100;
	if (i - n < d.first)d = make_pair(i - n, y[i]);
	if (d.first <= n - 1)return d.second;
	return (n - 1) & 1 ^ y[n];
}

int main(){
	scanf("%d", &n);
	l = (n << 1) - 1;
	f(i, 1, l + 1)scanf("%d", x + i);
	int l = 1, r = ::l;
	while (r > l){
		int m = l + r >> 1;
		if (M(m))l = m + 1;
		else r = m;
	}
	printf("%d\n", l);
}


Measured memory_bytes: 1792
#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <cmath>

using namespace std;
using lint = long long;


int main(){
    float n,sum=0;
    cin>>n;
    for (int i=0; i<n; i++) {
        float x;
        string u;
        cin>>x>>u;
        if (u=="BTC") {
            sum += 380000*x;
        }else{
            sum += x;
        }
    }
    cout<<sum<<endl;
    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define rep(i, n) for (ll i = 0; i < (ll)(n); ++i)
#define repk(i,k,n) for (ll i = k; i < (ll)(n); ++i)
#define MAX 500000001000000000
#define MOD 1000000007
typedef long long  ll;

using namespace std;

ll ans,cnt;

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

	ll N,x;
	cin >> N >> x;

	vector<ll> a(N);
	rep(i, N) {
		cin >> a[i];
		if (a[i] > x) {
			ans += a[i] - x;
			a[i] = x;
		}
	}

	for (ll i = 1; i <= N - 1; i++) {
		if (a[i - 1] + a[i] > x) {
			ans += (a[i - 1] + a[i]) - x;
			a[i] = x - a[i - 1];
		}
	}

	cout << ans << endl;

	return 0;
}

Measured memory_bytes: 1024
D=int(input())
C=list(map(int,input().split()))
S=[list(map(int,input().split())) for i in range(D)]
T=[int(input()) for i in range(D)]
result=0
last=[0 for i in range(26)]

for i in range(D):
    t=T[i]-1
    last[t]=-1
    result+=S[i][t]
    for j in range(26):
        last[j]+=1
        result-=last[j]*C[j]
    print(result)

Measured memory_bytes: 9368
#if __has_include("noamoa_atcoder_lib.h")
#include "noamoa_atcoder_lib.h"
#else
#define _USE_MATH_DEFINES
#include <bits/stdc++.h>
#define endl '\n'
#define all(x) (x).begin(),(x).end()
namespace atcoder {
	using namespace std;
	using ll = long long;
	using intv = vector<int>;
	using charv = vector<char>;
	using boolv = vector<bool>;
	using floatv = vector<float>;
	using doublev = vector<double>;
	using stringv = vector<string>;

	constexpr ll MOD  = 1000000007;
	constexpr ll MOD9 = 1000000009;

	template<typename T>
	void sort(vector<T>& v){
		sort(all(v));
	}
	template<typename T>
	void sortInv(vector<T>& v){
		sort(all(v), greater<T>());
	}

	template<typename T>
	T sum(const vector<T>& v){
		T ret = 0;
		for(const auto& e : v) ret += e;
		return ret;
	}

	template<typename T>
	inline vector<T>& operator+=(vector<T>& v, const T& e){
		v.push_back(e);
		return v;
	}

	template<typename T>
	void in(vector<T>& v){
		for(auto& e : v) cin >> e;
	}

	template<typename T>
	istream& operator>>(istream &stream, vector<T>& v){
		for(auto& e : v) stream >> e;
		return stream;
	}

	template<typename T>
	void out(const vector<T>& v){
		for(const auto& e : v) cout << e << ' ';
		cout << endl;
	}

	template<typename T>
	void outln(const vector<T>& v){
		for(const auto& e : v) cout << e << endl;
	}

	void init(){
		cin.tie(nullptr);
		ios::sync_with_stdio(false);
		cout << fixed << setprecision(15);
	}
}
using namespace atcoder;
#endif

int main(){
	init();

	ll X;
	cin>>X;
	ll a=100;
	ll ans=0;
	while(true){
		a*=1.01;
		ans++;
		if(a>=X){
			cout<<ans;return 0;
		} 
	}
}

Measured memory_bytes: 3608
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <numeric>

using namespace std;

int main(){
  int N,K,X,Y;
  cin >> N >> K >> X >> Y;
  if(N<=K) cout << N*X << endl;
  else cout << K*X+(N-K)*Y << endl;
}

Measured memory_bytes: 256
//
//  main.cpp
//  test130
//
//  Created by 黒田浩揮 on 2019/06/16.
//  Copyright © 2019 黒田浩揮. All rights reserved.
//
//
//  main.cpp
//  new
//
//  Created by 黒田浩揮 on 2019/06/09.
//  Copyright © 2019 黒田浩揮. All rights reserved.
//

// C++ includes used for precompiling -*- C++ -*-

// Copyright (C) 2003-2013 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library.  This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.

// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.

// Under Section 7 of GPL version 3, you are granted additional
// permissions described in the GCC Runtime Library Exception, version
// 3.1, as published by the Free Software Foundation.

// You should have received a copy of the GNU General Public License and
// a copy of the GCC Runtime Library Exception along with this program;
// see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
// <http://www.gnu.org/licenses/>.

/** @file stdc++.h
 *  This is an implementation file for a precompiled header.
 */

// 17.4.1.2 Headers

// C
#ifndef _GLIBCXX_NO_ASSERT
#include <cassert>
#endif
#include <cctype>
#include <cerrno>
#include <cfloat>
#include <ciso646>
#include <climits>
#include <clocale>
#include <cmath>
#include <csetjmp>
#include <csignal>
#include <cstdarg>
#include <cstddef>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>

#if __cplusplus >= 201103L
#include <ccomplex>
#include <cfenv>
#include <cinttypes>
#include <cstdbool>
#include <cstdint>
#include <ctgmath>
#include <cwchar>
#include <cwctype>
#endif

// C++
#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>

#if __cplusplus >= 201103L
#include <array>
#include <atomic>
#include <chrono>
#include <condition_variable>
#include <forward_list>
#include <future>
#include <initializer_list>
#include <mutex>
#include <random>
#include <ratio>
#include <regex>
#include <scoped_allocator>
#include <system_error>
#include <thread>
#include <tuple>
#include <typeindex>
#include <type_traits>
#include <unordered_map>
#include <unordered_set>
#endif


using namespace std;
int n,b,c;
int main(){
    cin>>n>>b>>c;
    n-=b;
    
    c-=n;
    if (c<0) {
        c=0;
    }
    cout<<c<<endl;
}





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

using namespace std;

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

int main() {
  int N, M, X;
  cin >> N >> M >> X;
  vector<int> C(N);
  vector<vector<int>> A(N, vector<int>(M));
  for (int i = 0; i < N; i++) {
    cin >> C[i];
    for (int j = 0; j < M; j++) {
      cin >> A[i][j];
    }
  }
  const int inf = 1e9 + 10;
  int ans = inf;
  for (int bits = 0; bits < (1 << N); bits++) {
    int a = 0;
    vector<int> B(M);
    for (int i = 0; i < N; i++) {
      if (bits & (1 << i)) {
        a += C[i];
        for (int j = 0; j < M; j++) {
          B[j] += A[i][j];
        }
      }
    }
    bool ok = true;
    for (auto b : B) {
      if (b < X) {
        ok = false;
        break;
      }
    }
    if (ok) {
      chmin(ans, a);
    }
  }
  if (ans == inf) ans = -1;
  cout << ans << endl;

  return 0;
}
/* vim:set fdm=marker: */


Measured memory_bytes: 3632
#include<bits/stdc++.h>
using namespace std;
int main(){
  int k, s, cnt = 0;
  cin >> k >> s;
  for(int i=0;i<=k;i++)
    for(int j=0;j<=k;j++)
      if(s-i-j <= k && s-i-j >= 0) cnt++;
  cout << cnt << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
vector <string> v;
vector<int> x;
string s;
string ans = "Left";
int main(){
  float a,b;
  int ans;
  cin >> a>>b;

  if((int)(a+b)/2 == (a+b)/2) ans = (a+b)/2;
  else ans = (a+b)/2 + 1;

  cout <<ans<<endl;

  return 0;
}


Measured memory_bytes: 256
N = int(input())
Alist = list(map(int, input().split()))

MOD = 1000000007

Alist = Alist[::-1]

mod = 0

ans = 0
for n in range(N-1):
    mod += (Alist[n]%MOD)
    mod = mod % MOD
    ans += (Alist[n+1] * mod)%MOD

print(ans%MOD)

Measured memory_bytes: 105040
#include<bits/stdc++.h>
using namespace std;
#define int long long
#define rep(i,n) for(int i=0;i<(n);++i)
string S;
vector<int> W;
int ans[100000+10]={};
#define ALL(W) (W).begin(),(W).end()

signed main(){
  cin >> S;
  rep(i,S.size()-1) if(S[i]=='R' && S[i+1]=='L') W.push_back(i+1);
  //rep(i,W.size()) cout << W[i] << " " << endl;
  //cout << S.size() << endl;
  rep(i,S.size()){
    int k;
    if(S[i]=='R'){
      auto key=lower_bound(ALL(W),i);
      k=W[key-W.begin()];
    }
    else{
      auto key=lower_bound(ALL(W),i);
      if(W[key-W.begin()]==i) k=W[key-W.begin()];
      else k=W[key-W.begin()-1];
    }
  //  cout << k << endl;
    if(abs(k-i)%2==0) ans[k]++;
    else ans[k-1]++;
  }
  rep(i,S.size()-1){
    cout << ans[i] << " ";
  }
  cout << ans[S.size()-1] << endl;
  return 0;
}


Measured memory_bytes: 1912
#include <bits/stdc++.h>
#define be(v) (v).begin(),(v).end()
#define pb(q) push_back(q)
typedef long long ll;
using namespace std;

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n,a,b,c,d;
    cin>>n>>a>>b;
    c=min(a,b);
    d=(max(n,a+b))-n;
    cout << c<<" "<<d<<endl;
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i,n) repi(i,0,n)
#define repi(i,a,b) for(int i=(int)a;i<(int)b;++i)
int main(){
    int x;cin>>x;
    vector<int> v;
    v.emplace_back(1);
    repi(i,2,40){
        int a=i;
        while(a*i<=x){
            a*=i;
            v.emplace_back(a);
        }
    }
    sort(v.begin(),v.end());
    cout<<v[v.size()-1]<<endl;
    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
 
using namespace std;
 
//container util
//------------------------------------------
#define REP(i,n) for(int (i)=0;(i)<(n);(i)++)
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
 
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define REACH(i,c) for(typeof((c).end()) i=(c).end(); i!=(c).begin(); --i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
 
#define SORT(c) sort((c).begin(),(c).end())
#define RSORT(c) sort((c).begin(),(c).end(),greater<int>())
 
#define PB(a) push_back(a)
#define PF(a) pop_front(a)

#define MP(a,b) make_pair(a,b)
 
#define FS first
#define SE second
 
#define ALL(x) (x).begin(),(x).end()
#define MAX_EL(c) *max_element((c).begin(),(c).end())
#define MIN_EL(c) *min_element((c).begin(),(c).end())
//typedef
//------------------------------------------
typedef vector<int> VI;
typedef vector<long long> VL;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef long long LL;
typedef string str;
 
//constant
//--------------------------------------------
const double EPS = 1e-10;
const double PI  = acos(-1.0);
//debug
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;
 
//grobal var
//------------------------------------------
const int MAX = 2*10e5+2;


int main(){
// magic spell------------------------------
  cin.tie(0);
  ios::sync_with_stdio(false);
//------------------------------------------
  int A,P;
  while(cin >> A >> P){
    cout << (3*A+P)/2 << endl;
  }
  return 0;
}

Measured memory_bytes: 256
n, m = map(int, input().split())
s = [list(map(int, input().split())) for _ in range(m)]

max_l, min_r = 0, float("inf")
for i in range(m):
  max_l = max(s[i][0], max_l)
  min_r = min(s[i][1], min_r)
  
print(max(min_r - max_l + 1, 0))

Measured memory_bytes: 26964
import java.util.Arrays;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int k = sc.nextInt();
        int[] p = new int[n];
        for (int i=0;i<n;i++){
            p[i]=sc.nextInt();
        }
        Arrays.sort(p);
        int sum=0;
        for (int i=0;i<k;i++){
            sum+=p[i];
        }
        System.out.println(sum);
    }
}

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

int main() {
	string S;
	cin >> S;
	int cnt = 0;
	for (int i = 0; i < S.length(); i++) {
		for (int j = i + 1; j < S.length(); j++) {
			if (S[i] == S[j]) {
				cnt++;
			}
		}
	}
	cout << (cnt == 2 ? "Yes" : "No") << endl;
}


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

#define um unordered_map
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define sc static_cast

#define has(a, b) (a.find(b) != a.end())
#define all(x) (x).begin(), (x).end()
#define maxval(t) numeric_limits<t>::max()
#define minval(t) numeric_limits<t>::min()
#define imin(a,b) a = min(a,b)
#define imax(a,b) a = max(a,b)
#define fora(i, n) for(int i = 0; i < n; i++)
#define forb(i, n) for(int i = 1; i <= n; i++)
#define forc(a, b) for(const auto &a : b)
#define ford(i, l, r) for(int i = l; i <= r; i++)
#define fore(i, n) for(int i = n-1; i >= 0; --i)
#define pvec(v) copy(all(v), ostream_iterator<decltype(v)::value_type>(cout, " "))

#define dbgs(x) #x << " = " << x
#define dbgs2(x, y) dbgs(x) << ", " << dbgs(y)
#define dbgs3(x, y, z) dbgs2(x, y) << ", " << dbgs(z)
#define dbgs4(w, x, y, z) dbgs3(w, x, y) << ", " << dbgs(z)

typedef long long ll;
typedef long double ld;

typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<vi> vii;
typedef vector<vll> vlll;
typedef um<int,int> umii;

ll gcd(ll a, ll b) { return b == 0 ? a : gcd(b, a % b); }

void display (const vector<vector<int> >& vy) {  
    fora(i, (int) vy.size()) {
        fora(j, (int) vy[i].size()) cout << vy[i][j] << " ";
        cout << endl;
    }
}

ll power(ll a, ll n) {
     if (n == 0) return 1;
     ll x = power(a, floor(n/2));
     if (n & 1) return a*x*x;
     else return x*x;
}

int main() {
    ios_base::sync_with_stdio(0);
    cin.tie(NULL);   
    int n; cin >> n;
    vi v(n);
    vi u(n);
    fora(i,n) {
        int t;
    cin >> t;
    v[i] = t;
    u[i] = t;
    }
    sort(v.begin(), v.end());
    fora(i, n) {
        if (v[n-1] == u[i]) cout << v[n-2] << endl;
        else cout << v[n-1] << endl;
    }
    cout << "\n";
    return 0;
}



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

bool comp(pair<pair<string, int>, int> a, pair<pair<string, int>, int> b) {
    pair<string, int> af = a.first;
    pair<string, int> bf = b.first;
    if (af.first != bf.first) {
        return af.first < bf.first;
    } else {
        return af.second > bf.second;
    }
}

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    int N;
    cin >> N;
    vector<pair<pair<string, int>, int> > restaurants;
    for (int i = 0; i < N; ++i) {
        string s;
        int p;
        cin >> s >> p;
        restaurants.push_back(make_pair(make_pair(s, p), i + 1));
    }
    sort(restaurants.begin(), restaurants.end(), comp);
    for (int i = 0; i < N; ++i) {
        cout << restaurants.at(i).second << endl;
    }

    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
//#include <boost/multiprecision/cpp_int.hpp>
//#include <ext/pb_ds/assoc_container.hpp>
//#include <ext/pb_ds/tree_policy.hpp>
#pragma GCC optimize("O3")
#define REP(i,n) for(int i=0;i<n;i++)
#define REPP(i,n) for(int i=1;i<=n;i++)
#define ALL(obj) (obj).begin(), (obj).end()
#define EPS (1e-9)
#define INF (1e17)
#define PI (acos(-1))
//const double PI = acos(-1);
//const double EPS = 1e-15;
//long long INF=(long long)1E17;
#define i_7 (long long)(1e9+7)
//#define i_7 998'244'353
long mod(long a){
    long long c=a%i_7;
    if(c>=0)return c;
    return c+i_7;
}
long long po(long a, long b){
    if(b==0){
        return 1;
    }
    
    long long z = po(a,b/2);
    z = mod(z*z);
    if(b%2!=0){
        z = mod(a*z);
    }
    return z;
}
 
bool prime_(int n){
  if(n==1){
    return false;
  }else if(n==2){
    return true;
  }else{
    for(int i=2;i<=std::sqrt(n);i++){
      if(n%i==0){
        return false;
      }
    }
    return true;
  }
}
 
long long gcd_(long long a, long long b){
  if(a<b){
    std::swap(a,b);
  }
  if(a%b==0){
    return b;
  }else{
    return gcd_(b,a%b);
  }
}
 
long long lcm_(long long x, long long y){
  return (x/gcd_(x,y))*y;
}
 
//using namespace std;
//using namespace boost::multiprecision;
//using namespace __gnu_pbds;

int main(){
  using namespace std;
  int n;
  cin>>n;
  int d[n][2];
  REP(i, n) REP(j, 2) cin>>d[i][j];
  
  bool ok = false;
  REP(i, n - 2){
    if(d[i][0] == d[i][1] && d[i + 1][0] == d[i + 1][1] && d[i + 2][0] == d[i + 2][1]){
      ok = true;
    }
  }
  if(ok){
    cout << "Yes" << endl;
  }else{
    cout << "No" << endl;
  }
  return 0;
}


Measured memory_bytes: 3676
#include<cstdio>
#include<vector>
#include<cstring>
#include<stack>
#include<iostream>
using namespace std;
int visited[100000]; int n;
vector<int> G[100000];

//void dfs_visit(int u)
//{
//  if(visited[u] == 1) return;
//  visited[u] = 1;
//  for(int i=0; i<G[u].size(); i++)
//  {
//    int v = G[u][i];
//    if(visited[v] == 0)
//      dfs_visit(v);
//  }
//}
//void dfs(int u, int v)
//{
//  memset(visited, 0, sizeof(n)*n);
//  dfs_visit(u);
//  if(visited[u] == visited[v])
//    printf("yes\n");
//  else printf("no\n");
//}  果然超时了哦。属实是弟弟行为哦~不过好歹能用哈哈哈。
void dfs_visit(int u, int id)
{
  if(visited[u] != 0) return;
  visited[u] = id;
  stack<int> s;//  诶~有意思。用stack来实现DFS一次把下层节点全压栈与一次压下层的一个节点仅仅是子节点的访问顺序颠倒了。
  s.push(u);
  while(!s.empty())
  {
    int v = s.top(); s.pop();
    for(int i=0; i<G[v].size(); i++)
    {
      int x = G[v][i];
      if(visited[x] == 0)
      {
        s.push(x);
        visited[x] = id;
      }
    }
  }
}
void dfs(int u)
{
  memset(visited, 0, sizeof(n)*n);
  int id = 1;// use id to denotes different circle so that all nodes can be visited by one bfs.
  for(int i=0; i<n; i++)
  {
    if(visited[i] == 0)
      dfs_visit(i, id++); // first circle id = 1, then 2 and so on ...
  }
}

int main()
{
  int m, q, u, v;
  scanf("%d%d",&n, &m);
  for(int i=0; i<m; i++)
  {
    scanf("%d%d", &u, &v);
    G[u].push_back(v);
    G[v].push_back(u);
  }
  scanf("%d", &q);
  dfs(0);
  for(int i=0; i<q; i++)
  {
    scanf("%d%d", &u, &v);
    if(visited[u] == visited[v])  printf("yes\n");
    else printf("no\n");
  }


  return 0;
}



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

using namespace std;

typedef unsigned long long ull;
typedef long long ll;
typedef pair<int, int> ii;
typedef vector<ii> vii;
typedef vector<int> vi;
typedef vector<ll> vll;

#define PI (2*acos(0.0))
#define eps 1e-9
#define pcase cout<<"Case "<<++cs<<":"
#define pb push_back
#define endl "\n"
#define watch(x) cout << (#x) << " is " << (x) << endl;
#define show(v) for(int fi = 0; fi < v.size(); fi++) cout << v[fi] << " "; cout << endl;
#define showpair(v) for(int fi = 0; fi < v.size(); fi++) cout << v[fi].first << " " << v[fi].second << endl;
#define mp make_pair
#define ff first
#define ss second
#define fu cout << "lol" << endl;
#define precision(n) cout << fixed << setprecision(n);
#define lb lower_bound
#define up upper_bound
#define vscan for(i = 0;i<n;i++){cin>>in; v.pb(in);}
#define all(a) a.begin(), a.end()
#define min3(a,b,c) min(a,min(b,c))
#define max3(a,b,c) max(a,max(b,c))
#define mem(a,val) memset(a,val,sizeof(a))
#define loop(i,n) for(i = 0; i < n; i++)
#define TC() ull T; cin>>T; while(T--)
#define IN(x) {scanf("%d",&x);}
#define LL(x) {scanf("%lld",&x);}
#define CC(x) {scanf("%c",&x);}
#define pfl(x) printf("%d\n",x)
#define pfll(x) printf("%lld\n",x)
#define newl puts("")
#define space printf(" ")
#define MOD 1000000007

pair<int, ii> dp[3005][3005];

int main()
{
    int i = 0, j = 0, cs = 0, in;
    string a, b;
    cin >> a >> b;
    int row = 0, col = 0, val = 0;
    for(i = 1; i <= a.size(); i++){
        for(j = 1; j <= b.size(); j++){
            if(a[i-1] == b[j-1]){
                dp[i][j].ff = dp[i-1][j-1].ff + 1;
                ii p = {i-1,j-1};
                dp[i][j].ss = p;
            }
            else if(dp[i-1][j].ff >= dp[i][j-1].ff){
                dp[i][j].ff = dp[i-1][j].ff;
                ii p = {i-1, j};
                dp[i][j].ss = p;
            }
            else{
                dp[i][j].ff = dp[i][j-1].ff;
                ii p = {i, j-1};
                dp[i][j].ss = p;
            }
        }
    }
    string ans;
    row = a.size(); col = b.size();
    while(row != 0 && col != 0){
        if(dp[row][col].ss == mp(row-1,col-1)) ans.pb(b[col-1]);
        int r = row;
        row = dp[row][col].ss.ff;
        col = dp[r][col].ss.ss;
    }
    reverse(all(ans));
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 105984
import java.io.BufferedReader;
import java.io.InputStreamReader;

public class Main {

	public static void main(String[] args) throws Exception {
		// TODO ?????????????????????????????????????????????
		BufferedReader br =
				new BufferedReader(
						new InputStreamReader(System.in) );

		int n = Integer.parseInt( br.readLine() );
		String[] temp;

//		int[] S = new int[n];
		int[] S = new int[n+1];
		temp = br.readLine().split(" ");
		for (int i=0; i < n; i++) {
			S[i] = Integer.parseInt(temp[i]);
		}

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

		int[] T = new int[q];
		temp = br.readLine().split(" ");
		for (int i=0; i < q; i++) {
			T[i] = Integer.parseInt(temp[i]);
		}

		int count = 0;
		for (int i=0; i < T.length; i++) {
			S[n] = T[i]; // bannpei
//			for (int j=0; j < S.length; j++) {
//				if (T[i] == S[j]) {
//					count++;
//					break;
//				}
//			}
			int j = 0;
			while (true) {
				if (T[i] == S[j]) {
					if (j != n) count++;
					break;
				}
				j++;
			}
		}

		System.out.println(count);
	}

}

Measured memory_bytes: 27532
x, n = map(int,input().split())
if n == 0:
    ans = x
else:
    p = list(map(int,input().split()))
    i = 0
    while True:
        if not(x - i in p):
            ans = x - i
            break
        if not(x + i in p):
            ans = x + i
            break
        i += 1
print(ans)
        

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

int main(void){
    long long l, r;
    cin >> l >> r;

    int mod_min = 2018;

    r = min(r, l + 2019);

    for(long long i = l; i < r; i++){
        for(long long j = i + 1; j <= r; j++){
            int mod = (i * j) % 2019;

            mod_min = min(mod_min, mod);
        }
    }

    printf("%d\n",mod_min);
    return 0;

}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using ll=long long;
using vb=vector<bool>;
using vvb=vector<vb>;
using vd=vector<double>;
using vvd=vector<vd>;
using vi=vector<int>;
using vvi=vector<vi>;
using vl=vector<ll>;
using vvl=vector<vl>;
using pll=pair<ll,ll>;
using tll=tuple<ll,ll>;
using tlll=tuple<ll,ll,ll>;
using vs=vector<string>;
#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define rep(i,n) range(i,0,n)
#define rrep(i,n) for(ll i=(n)-1;i>=0;i--)
#define range(i,a,n) for(ll i=(a);i<(n);i++)
#define LINF ((ll)1ll<<60)
#define INF ((int)1<<30)
#define EPS (1e-9)
#define MOD (1000000007ll)
#define fcout(a) cout<<setprecision(a)<<fixed
#define fs first
#define sc second
#define PI (3.1415926535897932384)

int dx[]={1,0,-1,0,1,-1,-1,1},dy[]={0,1,0,-1,1,1,-1,-1};
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;}
template<class S>S sum(vector<S>&a){return accumulate(all(a),S());}
template<class S>S max(vector<S>&a){return *max_element(all(a));}
template<class S>S min(vector<S>&a){return *min_element(all(a));}
ll max(int a,ll b){return max((ll)a,b);} ll max(ll a,int b){return max(a,(ll)b);}

template<class T>void puta(T&&t){cout<<t<<"\n";}
template<class H,class...T>void puta(H&&h,T&&...t){cout<<h<<' ';puta(t...);}
template<class S,class T>void tf(bool b,S t,T f){if(b)puta(t);else puta(f);}
void YN(bool b){tf(b,"YES","NO");}
void Yn(bool b){tf(b,"Yes","No");}
void yn(bool b){tf(b,"yes","no");}
template<class S,class T>ostream&operator<<(ostream&os,pair<S,T>p){os<<"["<<p.first<<", "<<p.second<<"]";return os;};
template<class S>auto&operator<<(ostream&os,vector<S>t){bool a=1;for(auto s:t){os<<(a?"":" ")<<s;a=0;}return os;}
template<class S>auto&operator>>(istream&is,vector<S>&t){for(S&a:t)cin>>a;return is;}

/*他のライブラリを入れる場所*/

int main(){
	cin.tie(0);
	ios::sync_with_stdio(false);
	string s;
	while(cin>>s,s!="0"){
		int n=s.size();
		vvl dp(n+1,vl(11,0));
		
		ll ans=0;
		rep(i,n){
			if(s[i]!='0')dp[i+1][s[i]-'0']=1;
			rep(j,11){
				dp[i+1][(j*10+s[i]-'0')%11]+=dp[i][j];
			}
			ans+=dp[i+1][0];
		}
		puta(ans);
	}
	return 0;
}


Measured memory_bytes: 12436
use v5.18; # strict say state
use warnings;
use List::Util qw(reduce first max min sum0);

chomp (my $n = <STDIN>);
chomp (my $s = <STDIN>);
my @s = split '', $s;
my $MOD = 1e9 + 7;
my %h;
$h{$_}++ for @s;
my $ans = 1;
for my $value (values %h) {
  $ans *= $value + 1;
  $ans %= $MOD;
}
say --$ans;

Measured memory_bytes: 14336
#include <iostream>
#include <cstdio>
#include <cstring>

using namespace std;

const int N = 100000;
int q;
bool a[N + 5];
bool b[N + 5];
int c[N + 5];

int main()
{
    scanf("%d", &q);
    a[0] = a[1] = true;
    for(int i = 2; i <= N; i++)
    {
        if(a[i]) continue;
        for(int j = i * 2; j <= N; j += i)
        {
            a[j] = true;
        }
    }
    for(int i = 2; i <= N; i++)
    {
        if(!a[i] && !a[(i + 1) / 2]) b[i] = true;
        c[i] = b[i] + c[i - 1];
        //printf("%d\n", c[i]);
    }

    for(int i = 0; i < q; i++)
    {
        int l, r;
        scanf("%d%d", &l, &r);
        printf("%d\n", c[r] - c[l - 1]);
    }
    return 0;
}


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

int k;
ll val[10000005];
ll ko[11];

int main(void){
	scanf("%d",&k);
	if(k%2==0){
		printf("-1\n");
		return 0;
	}
	ll sum=k;
	int dig=0;
	int mx=0;
	while(sum>0){
		ko[dig]=sum%10LL;
		val[dig]=sum%10LL;
		dig++;
		sum/=10LL;
	}
	mx=dig-1;
	int cur=0;
	while((cur-1)!=mx){
		if(cur>=1000000){
			printf("-1\n");
			return 0;
		}
		int cc=0;
		while(val[cur]!=7){
			cc++;
			if(cc>=20){
				printf("-1\n");
				return 0;
			}
			for(int i=0;i<dig;i++){
				val[cur+i]+=ko[i];
				mx=max(cur+i,mx);
			}
			for(int i=0;i<dig;i++){
				if(val[cur+i]>=10){
					val[cur+i+1]++;
					val[cur+i]-=10;
					mx=max(cur+i+1,mx);
				}
			}
			int j=cur+dig;
			while(val[j]>=10){
				val[j+1]++;
				val[j]-=10;
				mx=max(j+1,mx);
				j++;
			}
		}
		cur++;
	}
	printf("%lld\n",mx+1);
	return 0;
}


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

int main(){
    int n,m;
    cin >> n >> m;
       int a[m+1];
    int b[m+1];
     for(int i = 0; i < m; i++)cin >> a[i];
    if(n == m || n > m){
        cout << 0 << endl;
        return 0;
    }
    else{

    sort(a,a+m);
    memset(b,0,sizeof b);
    //int mx = 0;

    // cout << endl;
    // b[0] = a[1]-a[0];
    for(int i = 1; i < m; i++){
        b[i] = abs(a[i] - a[i-1]);
        //cout << b[i] << " ";
    }
    sort(b,b+(m));
   // cout << endl;

   // for(int i = 0; i < m; i++)cout << b[i] << " ";
    int ans = 0;
    for(int i = 1; i <= m-n; i++){
        ans += b[i];
    }
    cout << ans << endl;


    }
    return 0;
}



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

using namespace std;
typedef long long LL;
typedef double DB;
const LL MOD = 1e9+7;
const LL NMAX = 1e6+7;
const string NAME = "test";

int main()
{
    ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
    //freopen((NAME + ".inp").c_str(), "r", stdin);
    //freopen((NAME + ".out").c_str(), "w", stdout);
    int n; cin >> n;
    int a, b, c;
    a = (n / 100) % 10;
    b = (n / 10) % 10;
    c = (n / 1) % 10;
    if(a != b) {
        if(a < b) a++;
        cout << a << a << a;
        return 0;
    }
    if(b != c) {
        if(b < c) a++;
        cout << a << a << a;
        return 0;
    }
    cout << a << a << a;
    return 0;
}


Measured memory_bytes: 256
using System; 
class Multiplication2
    {
        static void Main()
        {
            var n = int.Parse(Console.ReadLine());
            String[] a = Console.ReadLine().Split();
            ulong sum = 1;
            for (int i = 0; i < n; i++)
            {
                if (ulong.Parse(a[i]) == 0)
                {
                    Console.WriteLine(0);
                    return;
                }
            }


            try
            {
                for (int i = 0; i < n; i++)
                {
                    checked
                    {
                        sum *= ulong.Parse(a[i]);
                    }
                }
            }
            catch (OverflowException)
            {
                Console.WriteLine(-1);
                return;
            }
            if (sum > 1000000000000000000) Console.WriteLine(-1);
            else Console.WriteLine(sum);
        }
    }

Measured memory_bytes: 40896
use std::io::*;
use std::str::FromStr;
fn read<T: FromStr>() -> T {
    let stdin = stdin();
    let stdin = stdin.lock();
    let token: String = stdin
        .bytes()
        .map(|c| c.expect("failed to read char") as char) 
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect();
    token.parse().ok().expect("failed to parse token")
}
fn main(){
    let mut v: Vec<i64> = Vec::new();
    for i in 0..3 {
        let k: i64=read();
        v.push(k);
    }
    v.sort();
    if(v[0]==5&&v[1]==5&&v[2]==7){
        println!("YES");
    }else{
        println!("NO");
    }
}

Measured memory_bytes: 2108
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define REP(i, n) for(ll i=0; i<(ll)n; i++)
#define REPR(i, n) for(ll i=(ll)n-1; i>=0; i--)
#define FOR(i, m, n) for(ll i=(ll)m; i<(ll)n; i++)
#define FORR(i, m, n) for(ll i=(ll)m-1; i>=(ll)n; i--)
#define ALL(x) (x).begin(), (x).end()
#define ASC(v) sort(ALL(v));
#define DESC(v) sort(ALL(v), greater<int>());
#define UNIQ(a) sort(ALL(a));(a).resize(unique(ALL(a)) - a.begin());
#define PRINTD(x, d) cout << fixed << setprecision(d) << x << "\n";
#define DEBUG(x) cout<<#x<<": "<<x<<"\n"
const double PI = acos(-1);
ll lcm(ll a, ll b) { return a / __gcd(a, b) * b; }
bool isprime(int x){ int i; if(x<2)return 0; else if(x==2) return 1; if(x%2==0) return 0; for(i=3; i*i<=x; i+=2) if(x%i==0) return 0; return 1; }
int digsum(int n) { int r=0; while(n>0) { r+=n%10; n/=10; } return r; }
vector<string> split(string s, char p){vector<string>v;stringstream m(s);string b;while(getline(m,b,p))v.push_back(b);return v;}
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 (a>b) { a = b; return 1; } return 0; }
struct nya{ nya(){ cin.tie(0); ios::sync_with_stdio(false); } }nyan;


int main(){
    ll A, B;
    cin >> A >> B;
    string S;
    cin >> S;
    vector<string> V = split(S, '-');
    if (V.size()!=2) cout << "No\n";
    else if (V[0].size()!=A||V[1].size()!=B) cout << "No\n";
    else cout << "Yes\n";
}


Measured memory_bytes: 256
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import accumulate, permutations, combinations, product, groupby
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

K, N = MAP()
A = LIST()
diff = abs(K - A[-1] + A[0])
d = abs(K - A[-1] + A[0])
if N == 2:
  print(min(d, A[1] - A[0]))
  exit()
for i in range(1, N):
  d += abs(A[i] - A[i-1])
  diff = max(diff, abs(A[i] - A[i-1]))
print(d - diff)

Measured memory_bytes: 27236
#include <iostream>
#include <cstdio>
#include <string>
#include <vector>
#include <algorithm>
#include <math.h>
#include <queue>
#include <set>
#include <stack>
#include <set>
#include <tuple>

using namespace std;
typedef vector<int>VI;
typedef long long LL;

#define IOSWORK ios::sync_with_stdio(0); cin.tie(0)
#define FOR(x, b, e) for(int x = b; x<= (e); x++)
#define FORD(x, b, e) for(int x = b; x>= (e); x--)
#define REP(x, n) for(int x = 0; x<(n); ++x)
#define ALL(c) (c).begin(), (c).end()
#define SIZE(x) ((int)(x).size())
#define VAR(v, n) typeof(n) v = (n)
#define FOREACH(i, c) for(VAR(i, (c).begin()); i != (c).end(); ++i)
#define SCAN_INT(n) scanf("%i",&n)
#define SCAN_P_INT(n,m) scanf("%i %i",&n,&m)
#define PRINT_P_INT(n,m) printf("%i %i\n",n,m);
#define PRINT_INT(n) printf("%i\n",n)

#define PB push_back
#define ST first
#define ND second
#define INF 1000000000


#define MAXSIZE
int n;
int suma = 0;
int main(){
    SCAN_INT(n);
    while(n--){
        int temp1,temp2;
        SCAN_P_INT(temp1,temp2);
        suma+=temp2-temp1+1;
    }

    PRINT_INT(suma);
    return 0;
}


Measured memory_bytes: 256
from collections import deque as D

n, q = map(int, input().split())
dq = D()
for i in range(n):
    p, t = map(str, input().split())
    dq.append([p, int(t)])
total = 0


while dq:
    pt = dq.popleft()
    if pt[1]<=q:
        total += pt[1]
        print(pt[0], total)
    else:
        total += q
        dq.append([pt[0],pt[1]-q])


Measured memory_bytes: 13300
#include <iostream>
#include <iomanip>
#include <string>
#include <cmath>
#include <algorithm>
#include <vector>
#include <set>
#include <map>
#include <unordered_map>
#include <unordered_set>
#include <list>
#include <stack>
#include <queue>

#define FOR(i, b, e) for(ll i = (ll)(b); i < (ll)(e); ++i)
#define RFOR(i, b, e) for(ll i = (ll)(e-1); i >= (ll)(b); --i)
#define REP(i, n) FOR(i, 0, n)
#define RREP(i, n) RFOR(i, 0, n)
#define REPC(x,c) for(const auto& x:(c))
#define VS vector<string>
#define VL vector<long long>
#define VI vector<int>
#define VVI vector<vector<int>>
#define VVL vector<vector<ll>>
#define ALL(x) (x).begin(),(x).end()
#define SORT(x) sort(ALL(x))
#define RSORT(x) sort((x).rbegin(),(x).rend())
#define PAIR pair<ll,ll>
#define UNIQUE(v) v.erase( unique(v.begin(), v.end()), v.end() );

using  ll = long long;
constexpr ll MOD = 1000000007;
using std::cout;
using std::endl;
using std::cin;
using std::sort;
using std::pair;
using std::string;
using std::stack;
using std::queue;
using std::vector;
using std::list;
using std::map;
using std::unordered_map;
using std::multimap;
using std::unordered_multimap;
using std::set;
using std::unordered_set;
using std::multiset;

ll gcd(ll a, ll b) { return b ? gcd(b, a%b) : a; }
ll lcm(ll a, ll b) { return a / gcd(a, b) * b; }
ll pow(ll a, ll b) {
	ll ans = 1;
	while (b > 0) {
		if (b % 2 == 1) {
			ans *= a;
			ans %= MOD;
		}
		b /= 2;
		a *= a;
		a %= MOD;
	}
	return ans;
}
ll comb(ll a, ll b) {
	if (a - b < b) { return comb(a, a - b); }
	static unordered_map<ll, ll> memo;

	ll c = 1;
	FOR(i, a - b + 1, a + 1) {
		c *= i;
		c %= MOD;
	}
	if (memo.find(b) == memo.end()) {
		ll k = 1;
		FOR(i, 2, b + 1) {
			k *= i;
			k %= MOD;
		}
		memo[b] = pow(k, MOD - 2);
	}
	c *= memo[b];
	return c % MOD;
}
multiset<ll> prime_decomposition(ll n) {
	ll i = 2;
	multiset<ll> table{};
	while (i * i <= n) {
		while (n % i == 0) {
			n /= i;
			table.emplace(i);
		}
		++i;
	}
	if (n > 1) {
		table.emplace(n);
		return table;
	}
	return table;
}
/*
-- bit --
REP(i, (1 << n)) {
	REP(j, n) {
		cout << (1 & (i >> j));
	}
	cout << endl;
}
*/

int main() {
	ll n;
	cin >> n;
	vector<char> key{ 'M' ,'A' ,'R' ,'C' ,'H' };

	VL v(5, 0);
	REP(i, n) {
		string s;
		cin >> s;
		REP(j, 5) {
			if (s[0] == key[j]) {
				++v[j];
			}
		}
	}
	cout << 
		v[0] * v[1] * v[2] +
		v[0] * v[1] * v[3] +
		v[0] * v[1] * v[4] +
		v[0] * v[2] * v[3] +
		v[0] * v[2] * v[4] +
		v[0] * v[3] * v[4] +
		v[1] * v[2] * v[3] +
		v[1] * v[2] * v[4] +
		v[1] * v[3] * v[4] +
		v[2] * v[3] * v[4]
		<< endl;

}	

Measured memory_bytes: 256
import sys
input = sys.stdin.readline
from collections import Counter, deque

INF = float('inf')

""" Input
S = input()
N = int(input())
A = list(map(int, input().split()))
D = [int(input()) for _ in range(N)]
"""

def main():
    X, Y, Z = map(int, input().split())
    X, Y = Y, X
    X, Z = Z, X
    print(X, Y, Z)


if __name__ == '__main__':
    main()


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

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

	long N;
	cin >> N;

	long long A;
	multiset<long> m;
	for (long i = 0; i < N; i++) {
		cin >> A;

		auto it = m.lower_bound(A);
		if (it != m.begin()) {
			m.erase(prev(it));
		}

		m.insert(A);
	}

	cout << m.size() << endl;

	return 0;
}


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

class Problem {
    public static void Main() {
        var nm = Console.ReadLine().Split().Select(int.Parse).ToArray();
        
        var a = new int[nm[0], nm[1]];
        for (var i = 0; i < a.GetLength(0); i++) {
            var data = Console.ReadLine().Split().Select(int.Parse).ToArray();
            for (var j = 0; j < a.GetLength(1); j++)
                a[i, j] = data[j];
        }
        
        var b = new int[nm[1]];
        for (var i = 0; i < b.Length; i++)
            b[i] = int.Parse(Console.ReadLine());
        
        var r = new int[nm[0]];
        for (var i = 0; i < a.GetLength(0); i++)
            for (var j = 0; j < a.GetLength(1); j++)
                r[i] += a[i, j] * b[j];
        
        for (var i = 0; i < r.Length; i++)
            Console.WriteLine(r[i]);
    }
}


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

void My_Replace(map<int,int> *mp,int B,int C,int N,ll *sum){
    
    int kazu = (*mp)[B];
    int diff = C - B;
    (*mp)[B] = 0;
    (*mp)[C] += kazu;
    
    *sum += (diff*kazu);
    cout << *sum << endl;
    
}
int main(){
  
   int N,Q,A,B,C;
   cin >> N;
   ll sum = 0;
   map<int,int> mp;
   for(int i=0;i<N;i++){
       cin >> A;
       if(mp.count(A) == 0) mp[A] = 1;
       else mp[A]++;
       
       sum+= A; 
       
   }
   
   cin >> Q;
   
   for(int i=0;i<Q;i++){
       cin >> B >> C;
       My_Replace(&mp,B,C,N,&sum);
   }
   
}

Measured memory_bytes: 8000