akhauriyash/Code-Regression huggingface dataset:
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Scanner;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author Twinkle Twinkle Little Star
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        BBounding solver = new BBounding();
        solver.solve(1, in, out);
        out.close();
    }

    static class BBounding {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            long n = in.nextLong(), x = in.nextLong();
            long count = 1, sum = 0;
            for (long i = 1; i <= n; i++) {
                long y = in.nextLong();
                sum += y;
                if (sum <= x) count++;
            }
            out.println(count);

        }

    }
}



Measured memory_bytes: 22740
#include <iostream>
#include <vector>
#include <algorithm>
#include <stdio.h>
#include <math.h>
#include <string>
#include <cctype>
#include <map>

using namespace std;

const int mod = 1000000007;
#define ARRAY_LENGTH(array) (sizeof(array) / sizeof(array[0]))
#define ll long long

int main()
{
    char c;
    cin >> c;

    cout << (char)(c+1) << endl;
    return 0;
}

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

using namespace std;

#define YES cout << "YES" << endl;
#define NO  cout << "NO"  << endl;
#define Yes cout << "Yes" << endl;
#define No  cout << "No"  << endl;
 
#define INF INT_MAX
#define MOD 1000000007
#define PI  acos(-1)

using ll  = long long;
using ull = unsigned long long;
using Pii = pair<int, int>;
using Pll = pair<ll, ll>;

#define rep(i, n) for (ll i = 0; i < (n); i++)
#define rrep(i, n) for (ll i = (n)-1; i >= 0; i--)

int main(int argc, char *argv[])
{
    cin.tie(0);
    ios::sync_with_stdio(false);

    ll N;
    cin >> N;

    vector<double> A(N);
    rep (i, N) {
        cin >> A[i];
    }

    double tmp = 0;
    rep (i, N) {
        tmp += double(1)/A[i];
    }

    cout << setprecision(15) << double(1)/tmp << endl;
    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main() {
    int n;
    cin >> n;
    set<int>st;
    while (n--) {
        int a;
        cin >> a;
        if (st.count(a)) {
            st.erase(st.find(a));
        }
        else
            st.insert(a);
    }
    cout << st.size() << endl;
}

Measured memory_bytes: 8232
#include <iostream>
#include <numeric>
#include <string>
#include <algorithm>
#include <vector>
#include <math.h>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <utility>
using namespace std;
#define INF 100000000
#define REP(i, n) for(int (i)=0; (i)<(n); (i)++)
#define rep(i, n) for(int (i)=1; (i)<=(n); (i)++)
typedef pair<int, int> P;
typedef long long ll;

int main(){
    ll n, k;
    cin >> n >> k;
    
    if(k % 2 == 1){
        cout << (n / k) * (n / k) * (n / k) << endl;
    }else{
        cout << (n / k) * (n / k) * (n / k) + ((n + k / 2) / k) * ((n + k / 2) / k) * ((n + k / 2) / k) << endl;
    }
    return 0;
}

Measured memory_bytes: 256
#include <algorithm>
#include <bitset>
#include <cassert>
#include <cmath>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <unordered_map>
#include <vector>
#include <string.h>
#include <set>

using namespace std;

#define COUT(x) cout << #x << " = " << (x) << " (L" << __LINE__ << ")" << endl

template<class T> void printvec(const vector<T>& v) {
  for (auto x : v) { cout << x << " "; }
  cout << endl;
}
template<class T> void printtree(const vector< vector<T> >& tree) {
  for (long long i = 0; i < tree.size(); ++i) {
    cout << i + 1 << ": "; printvec(tree[i]);
  }
}
template<class T, class U> void printmap(const map<T, U>& mp) {
  for (auto x : mp) { cout << x.first << "=>" << x.second << endl; }
}

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

#define rep(i, n) for(ll i = 0; i < n; ++i)
#define all(s) s.begin(), s.end()
#define sz(x) (ll)(x).size()
#define fr first
#define sc second
#define mp make_pair
#define pb push_back
#define eb emplace_back

typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll, ll> P;
typedef tuple<ll, ll, ll> triple;
typedef double D;
typedef vector<ll> vl;
typedef vector<P> vp;

const ll INF = 1e15;
const ll MOD = 1000000007;  // 1e9 + 7

// SlideMin
// res[i] .. min value in [i-m+1,i]
template<typename T>
vector<T> slide_min(const vector<T> &v, int k)
{
  deque< int > deq;
  vector< T > ret;
  for(int i = 0; i < v.size(); i++) {
    while(!deq.empty() && v[deq.back()] >= v[i]) {
      deq.pop_back();
    }
    deq.push_back(i);
    if(i - k + 1 >= 0) {
      ret.emplace_back(v[deq.front()]);
      if(deq.front() == i - k + 1) deq.pop_front();
    }
  }
  return ret;
}

int main(int argc, char** argv) {
  cin.tie(NULL);
  cout.tie(NULL);
  ios_base::sync_with_stdio(false);
  //cout << setprecision(10) << fixed;

  ll n,m,k;
  cin >> n >> m >> k;
  vector<ll> a(n);
  rep(i,n) {
    cin >> a[i];
  }
  // dp[i][j] .. maximum value when consider element j as position i.
  // dp[i][j] = i*a[j] + max_k dp[i-1][k] (j-M <= k <= j-1)
  vector<vector<ll>> dp(k,vector<ll>(n));
  rep(i,n) {
    dp[0][i] = a[i];
  }

  for (int i = 1; i < k; ++i) { // at position j. 0-indexed
    vector<ll> dp2(n+m-1, INF); // dp2[j+m-1] .. dp[i-1][j]. dp2 contains m-1 elements as offset.
    rep(j,n) {
      dp2[j+m-1] = -dp[i-1][j];  // minus value of dp[j-1] for calculating max value
    }
    vector<ll> p = slide_min(dp2, m); // p[i] .. min value of dp2 in [i-m+1, i]
    rep(j,n) {
      if (j < i) { continue; } // j must be equal or larger than i.
      chmax(dp[i][j], (i+1)*a[j] - p[j-1]);
    }
  }

  ll ans = 0;
  rep(i,n) {
    chmax(ans, dp[k-1][i]);
  }
  cout << ans << endl;
}


Measured memory_bytes: 239684
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <queue>
#include <iostream>
#include <string>
#include <cmath>
#include <vector>
#include <set>
#include <map>
#include <bitset>
#include <stack>
using namespace std;

#define REP(i,n) for ( int i=1; i<=int(n); i++ )  
#define MP make_pair
#define PB push_back
#define SZ(x) (int((x).size()))
#define ALL(x) (x).begin(), (x).end()
#define X first
#define Y second
template<typename T> inline bool chkmin(T &a, const T &b) { return a > b ? a = b, 1 : 0; }
template<typename T> inline bool chkmax(T &a, const T &b) { return a < b ? a = b, 1 : 0; }

typedef long long LL;
typedef pair<LL, int> pii;
typedef long double LD;
const int INF = 0x3f3f3f3f;

template <class T>  
inline bool RD(T &ret) {  
        char c; int sgn;  
        if (c = getchar(), c == EOF) return 0;  
        while (c != '-' && (c<'0' || c>'9')) c = getchar();  
        sgn = (c == '-') ? -1 : 1 , ret = (c == '-') ? 0 : (c - '0');  
        while (c = getchar(), c >= '0'&&c <= '9') ret = ret * 10 + (c - '0');  
        ret *= sgn;  
        return 1;  
}  
template <class T>  
inline void PT(T x) {  
        if (x < 0) putchar('-') ,x = -x;  
        if (x > 9) PT(x / 10);  
        putchar(x % 10 + '0');  
}

const int N = 1e5 + 100;
LL a[N], b[N];
LL ans;
int main() {
	int n;
	cin >> n;
	for(int i = 1; i <= n; i ++) {
		scanf("%lld %lld", &a[i], &b[i]);	
	}
	for(int i = n; i >= 1; i --) {
		a[i] += ans;
		if(a[i] == 0) continue;
		ans += ((a[i] - 1) / b[i] + 1) * b[i] - a[i];
	}
	printf("%lld\n", ans);
}


Measured memory_bytes: 1920
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i,n) for(int i=0; (i)<(n); ++(i))
#define reps(i,s,n) for(int i=(s); (i)<(n); ++(i))
#define maxi(v) distance(v.begin(), max_element(v.begin(), v.end()))
#define mini(v) distance(v.begin(), min_element(v.begin(), v.end()))
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
ll gcd(ll x, ll y){
  if(y==0) return x;
  else return gcd(y, x%y);
  }
int main(){
    string s; cin >> s;
    int cnt=0, max=0, n=s.size();
    rep(i,n){
        if(s[i]=='A'||s[i]=='T'||s[i]=='C'||s[i]=='G') cnt++;
        else {chmax(max, cnt); cnt=0;}
    }
    chmax(max,cnt);
    cout << max;
    return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <stack>
#include <map>
#include <queue>
#include <numeric>
#include <climits>
#include <iterator>
#include <bitset>
#include <functional>
using namespace std;
const constexpr int INF = 1e9;
int N, K, C;
int graph[51][51];
string s;
struct Node{
    int from, to, cost;
};

int a[7], b[7];
void solve(){
    for(int i=0; i<=14; ++i){
        if(N-7*i<0) break;
        if((N-7*i)%4==0){
            cout << "Yes" << endl;
            return ;
        }
    }
    cout << "No" << endl;
}
int main() {
    cin >> N;
    solve();
	return 0;
}

Measured memory_bytes: 256
#[allow(unused_imports)]
use proconio::marker::{Bytes, Chars, Usize1};
use proconio::{fastout, input};
#[fastout]
fn main() {
    input! {
        n: usize,
        s: Chars,
        t: Chars,
    }
    for i in 0..n {
        if s[i..] == t[..n - i] {
            println!("{}", i + n);
            return;
        }
    }
    println!("{}", n * 2);
}


Measured memory_bytes: 2148
#include <iostream>
#include <vector>

using namespace std;

int main() {
    int N, L;
    string tmp;
    vector<string> vector1;
    cin >> N >> L;
    for (int i = 0; i < N; ++i) {
        cin >> tmp;
        vector1.push_back(tmp);
    }
    sort(vector1.begin(), vector1.end());
    for (int j = 0; j < vector1.size(); ++j) {
        cout << vector1[j];
    }
    return 0;
}

Measured memory_bytes: 380
n = gets
a1 = 0
b1 = 0
c1 = 0
d1 = 0

a2 = 0
b2 = 0
c2 = 0
d2 = 0
until n.nil?
    x = n.split(" ")
    s = x[0].to_f
    t = x[1].to_f
    
    if s >= 1.1
        a1 += 1
    elsif s >= 0.6
        b1 += 1
    elsif s >= 0.2
        c1 += 1
    elsif s < 0.2
        d1 += 1
    end

    if t  >= 1.1
        a2 += 1
    elsif t >= 0.6
        b2 += 1
    elsif t >= 0.2
        c2 += 1
    elsif t < 0.2
        d2 += 1
    end

    n = gets
end
puts "#{a1} #{a2}"
puts "#{b1} #{b2}"
puts "#{c1} #{c2}"
puts "#{d1} #{d2}"


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

using namespace std;

int main()
{
    ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
    int T[2];
    for (int i=0;i<2;i++)
        cin>>T[i];
    if (T[0]-2*T[1]>0)
        cout<<T[0]-2*T[1];
    else
        cout<<0;


    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
 
int main() {
double W,H,x,y;
  cin >> W>>H>>x>>y;
  double A=W*H/(double)2;
  if(W/2==x&&H/2==y){
    cout<<A<<" "<<1<<endl;
  }else{cout<<A<<" " <<0<<endl;}
  
  
  
}

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

int main()
{
	ll n; cin>>n;
	ll pos[100005];
	for(ll i=1;i<=n;i++){
		ll x; cin>>x; pos[x]=i;
	}

	multiset<ll> s; ll f=0;

	s.insert(0); s.insert(0); s.insert(n+1); s.insert(n+1);

	for(ll i=n;i>0;i--)
	{
		s.insert(pos[i]);
		auto it = s.find(pos[i]);

		it--; ll a,b,c,d;
		b = *it; it--; a = *it; it++; it++; it++; c = *it; it++; d = *it;
		ll ans = 0;
		ans += (b-a)*(c-pos[i]);
		ans += (pos[i]-b)*(d-c);
		f += ans*i;
	}

	cout<<f<<endl;
}

Measured memory_bytes: 5760
#include <bits/stdc++.h>
#define f first
#define s second
using namespace std;
typedef pair<int,int> P;
typedef pair<P,int> PP;
PP A[1001];

int main(){
  int n;
  while(cin>>n,n){
    for(int i=0;i<n;i++)cin>>A[i].f.s>>A[i].f.f>>A[i].s;
    sort(A,A+n);
    
    int dp[2][367][367]={},b=0;
    for(int i=0;i<n;i++){
      int l=A[i].f.s,r=A[i].f.f+1,c=A[i].s;
      for(int j=366;j>=0;j--)
	for(int k=366;k>=0;k--){
	  dp[!b][j][k]=max(dp[!b][j][k],dp[b][j][k]);
	  if(j<=l)dp[!b][r][k]=max(dp[!b][r][k],dp[b][j][k]+c);
	  if(k<=l)dp[!b][j][r]=max(dp[!b][j][r],dp[b][j][k]+c);
	}
      b=!b;
    }
    int ans=0;  
    for(int i=0;i<=366;i++)
      for(int j=0;j<=366;j++) ans=max(ans,dp[b][i][j]);
    cout <<ans<<endl;
  }
  return 0;
}

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

int main(){
  ll n;cin >> n;
  vector<ll> a(n+1);
  for(ll i=1;i<=n;++i) cin >> a.at(i);

  vector<ll> cnt(n+1);
  ll ans = 0;
  for(ll i=n;i>=1;--i){
    ll sum = 0;
    for(ll j=i;j<=n;j+=i){
      sum += cnt.at(j);
    }
    if( sum%2 != a.at(i) ){
      cnt.at(i) = 1;
      ++ans;
    }
  }

  cout << ans << endl;
  if( ans == 0 ) return 0;
  for(ll i=1;i<=n;++i){
    if( cnt.at(i) == 1 ){
      cout << i;
      if( i != n ) cout << " ";
    }
  }
  cout << endl;

  return 0;
}


Measured memory_bytes: 6228
#include <bits/stdc++.h>
typedef long long int ll;
typedef long double ld;
using namespace std;
const long long int INF = 1e18;
const long long int mod = 1e9+7;

typedef pair<ll, ll> pairs;
typedef vector<pairs> p;

struct Edge{
    ll to, weight;
    Edge(ll t, ll w) : to(t), weight(w){}
};
using graph = vector<vector<ll>>;
using Graph = vector<vector<Edge>>;


ll gcd(ll a,ll b){
    if(b == 0){
        return a;
    }else{
        return gcd(b, a%b);
    }
}

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

ll keta(ll N){
    int tmp{};
    while( N > 0 ){
        tmp += ( N % 10 );
        N /= 10;
    }
    N = tmp;
    return N;
}

// 回文
bool kai(string S){
    bool flag = true;
    for(ll i=0;i<S.size()/2;++i){
        if(S[i] != S[S.size()-i-1]){
            flag = false;
            break;
        }
    }
    return flag;
}
// ---------------------------------------------

int main(){
    ll a, b;
    cin>>a>>b;
    cout<<a*b<<endl;
}

Measured memory_bytes: 3552
Uses math;
var a,b,c:longint;
begin
	read(a,b);
	for a:=a to b do begin
		if (a mod 10 = floor(a/10000)) and (floor(a/10)mod 10 = floor(a/1000)mod 10) then c:=c+1;
	end;
	write(c)
end.


Measured memory_bytes: 128
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for (int i = 0;i<n;i++)
double tow(int n){
    if(n == 1)return 1;
    return ((double)n)*tow(n-1);
}

int main(){
int n;
cin >> n;
double sum = 0;
int a[n], b[n];
rep(i,n)cin>>a[i]>>b[i];
rep(i,n){
    rep(j,i){
        sum += tow(n-1)*sqrt((a[i]-a[j])*(a[i]-a[j])+(b[i]-b[j])*(b[i]-b[j]));
    }
    for(int j = i+1;j<n;j++){
        sum += tow(n-1)*sqrt((a[i]-a[j])*(a[i]-a[j])+(b[i]-b[j])*(b[i]-b[j]));
    }
}
printf("%.10f\n", sum/tow(n));


}

Measured memory_bytes: 256
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <climits>
#include <cfloat>
#include <map>
#include <utility>
#include <set>
#include <iostream>
#include <memory>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <sstream>
#include <complex>
#include <stack>
#include <queue>
#include <iomanip>
#include <array>
#include <numeric>
#include <regex>
#include <bitset>
#include <deque>

using namespace std;
typedef long long ll;
typedef pair<int, int> p_ii;

const int INF = 1e9;
const double PI = acos(-1.0);
const ll MOD = 1e9 + 7;



int main() {
    string s;
    cin>>s;
    int n = s.size();

    for (int i = 0; i < n; i++) {
        if(s[i]=='1')s[i]='9';
        else if(s[i]=='9')s[i]='1';
    }

    cout<<s<<endl;

    return 0;
}

Measured memory_bytes: 256
import sys

input = lambda: sys.stdin.readline().rstrip()


def solve():
    N, M = map(int, input().split())
    card = [0 for _ in range(N + 1)]

    for _ in range(M):
        l, r = map(int, input().split())
        l, r = l - 1, r - 1
        card[l] += 1
        card[r + 1] -= 1

    for i in range(N):
        card[i + 1] += card[i]

    # print(card)
    print(card.count(M))


if __name__ == '__main__':
    solve()


Measured memory_bytes: 7080
#![allow(non_snake_case)]
#![allow(unused_imports)]

use proconio::{input, fastout};
use proconio::marker::*;
use whiteread::parse_line;
use std::collections::*;
use num::*;
use superslice::*;

use itertools::Itertools;
use itertools_num::ItertoolsNum;

#[fastout]
fn main() {
    input!{
        a: usize, b: usize, k: usize,
    }
    let a_upper = if b < a + k { b } else { a + k };
    let b_lower = if b + 1 - a < k { a } else { b + 1 - k};
    let a_set = (a..a_upper).collect::<BTreeSet<usize>>();
    let b_set = (b_lower..=b).collect::<BTreeSet<usize>>();
    for s in a_set.union(&b_set).into_iter() { 
        println!("{}", s);
    }
    dbg!(b_set);
}


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

typedef unsigned long long ull;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<double, double> pdd;
//typedef vector<vector<ll>> Graph;

const ll mod = 1e9 + 7;
//const ll mod = 998244353;

#define REP(i,n) for(ll i=0;i<(ll)n;i++)
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define spa << " " <<
#define fi first
#define se second

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

template<class S, class T> ostream& operator << (ostream& os, const pair<S, T> v){
os << "(" << v.first << ", " << v.second << ")"; return os;
}
template<class T> ostream& operator << (ostream& os, const vector<T> v){
for(int i = 0; i < (int)v.size(); i++){if(i > 0){os << " ";} os << v[i];} return os;
}
template<class T> ostream& operator << (ostream& os, const vector<vector<T>> v){
for(int i = 0; i < (int)v.size(); i++){if(i > 0){os << endl;} os << v[i];} return os;
}

template<typename T> void debug(vector<vector<T>>&v,ll h,ll w){for(ll i=0;i<h;i++)
{cerr<<v[i][0];for(ll j=1;j<w;j++)cerr spa v[i][j];cerr<<endl;}};
template<typename T> void debug(vector<T>&v,ll n){if(n!=0)cerr<<v[0];
for(ll i=1;i<n;i++)cerr spa v[i];
cerr<<endl;};

string num2bit(ll num, ll len){
    string bit = "";
    REP(i, len){
    bit += char('0'+(num>>i & 1));
    }
    return bit;
}

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

    ll N;
    cin >> N;
    vector<ll> A(N), B(N);
    REP(i, N) cin >> A[i];
    REP(i, N) cin >> B[i];

    priority_queue<pll> pq;
    REP(i, N) if(B[i]>A[i]) pq.push({B[i], i});

    ll cnt = 0;
    while(!pq.empty()){
        //cout << B << endl;
        pll p = pq.top();pq.pop();
        ll idx = p.second;
        ll left = B[(idx+1)%N];
        ll right = B[(idx-1+N)%N];
        ll waru = left+right;

        ll r1 = (B[idx] - A[idx])/waru;
        ll r2 = (B[idx] - left - right + waru)/waru;
        ll r = min(r1, r2);

        B[idx] -= r * waru;
        cnt += r;

        if(B[idx] < A[idx]){
            cout << -1 << endl;
            return 0;
        }else if(B[idx] > A[idx] and r != 0){
            pq.push({B[idx], idx});
        }
    }

    bool flag = true;
    REP(i, N) if(B[i] != A[i]) flag = false;


    cout << (flag ? cnt : -1) << endl;

    return 0;
}

Measured memory_bytes: 10552
#include<iostream>
#include<string>
#include<algorithm>
#include<cmath>
using namespace std;
int main() {
	int a, b, c = 0, d, e;
	cin >> a;
	int test[201] = { 0 };
	for (int h = 0; h < a * 2; h++) {
		cin >> b;
		test[h] = b;
	}
	for (int s = 0; s < a * 2 - 1; s++) {
		for (int t = s + 1; t < a * 2; t++) {
			if (test[t] > test[s]) {
				int xyz = test[t];
				test[t] = test[s];
				test[s] = xyz;
			}
		}
	}
	for (int j = 1; j <= a * 2; j = j + 2) {
		c += test[j];
	}
	cout << c << endl;
	cin >> e;
}

Measured memory_bytes: 256
program sample
    implicit none
  
    integer(8) :: i,j,m,n
    integer(8),allocatable :: x(:),y(:)
  
    read(*,*) n
    if (mod(n,1000)==0)then
        wrITe(*,*)0
    else
    write(*,*) (n/1000+1)*1000-n
    end if
  
    stop
end program sample
  



Measured memory_bytes: 2856
#include <iostream>

using namespace std;

int main()
{int a,b,m;
cin>>a>>b;
m=a+b;
if(b%3==0&&b!=0){cout<<"Possible";}
else if(a%3==0&&a!=0){cout<<"Possible";}
else if(m%3==0&&m!=0){cout<<"Possible";}
    else cout<<"Impossible";
    return 0;
}


Measured memory_bytes: 256
import itertools

n = int(input())
p = tuple(map(int, input().split()))
q = tuple(map(int, input().split()))

l = [i for i in range(1, n+1)]
count = 0
pcount = -1
qcount = -1
for v in itertools.permutations(l, n):
  count += 1
  if v == p:
    pcount = count
  if v == q:
    qcount = count
  if pcount != -1 and qcount != -1:
    break

print(abs(pcount-qcount))

Measured memory_bytes: 3064
#pragma GCC optimize("Ofast")
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<n;i++)
#define cinf(n,x) for(int i=0;i<(n);i++)cin>>x[i];
#define ft first
#define sc second
#define pb push_back
#define lb lower_bound
#define ub upper_bound
#define all(v) (v).begin(),(v).end()
#define LB(a,x) lb(all(a),x)-a.begin()
#define UB(a,x) ub(all(a),x)-a.begin()
#define mod 1000000007
#define FS fixed<<setprecision(15)
using namespace std;
typedef long long ll;
template<class T> using V=vector<T>;
using Graph = vector<vector<int>>;
using P=pair<ll,ll>;
typedef unsigned long long ull;
typedef long double ldouble;
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; }

const ll INF=1000000000000000000;
const double pi=2*acos(0.0);
//abc169b

int main(){
    cin.tie(0);ios::sync_with_stdio(false);
    ll n;
    cin>>n;
    V<ll> a(n);
    cinf(n,a);
    sort(all(a));
    ll cnt=1;
    bool ok=1;
    ll ans=1;
    bool kk=0;
    rep(i,n){
        if(a[i]==0){
            kk=1;
            ok=1;
        }
    }
    if(!kk){
    rep(i,n){
        
        ll pr=ans;
        ll now=INF/ans;
        //if(INF%ans!=0) now++;
        //ans=(ans*a[i])%INF;
        if(a[i]>now){
            ok=0;
            break;
        }
        ans*=a[i];
        //if(ans>INF) ok=0;
    }}
    if(kk) ans=0;
    if(!ok) ans=-1;
    cout<<ans<<endl;
}
//ペナルティ出しても焦らない　ACできると信じろ！！！
//どうしてもわからないときはサンプルで実験　何か見えてくるかも
//頭で考えてダメなら紙におこせ！！
/*
V,P(大文字)使用不可
乗算などの際にオーバーフローに注意せよ！
(適切にmodをとれ　にぶたんで途中で切り上げろ)
制約をよく読め！
{
    ・全探索できるなら全探索しろ
    ・異常な制約ならそこに注目
}
stringの計算量(扱い)注意
コーナー注意！(特に数値が小さいものについては要検証)
N行出力のときは'¥n'
グリッド上では行先が範囲内におさまるかif文で確認(RE注意)
if文ではちゃんと比較演算子==を使え('='でもエラー出ない)
配列(vector)の大きさが0か1以上かで場合分けせよ(RE注意)
(vector<int> a(m)でm==0というものはできない)
modはなるべく最後に取れ！
doubleを扱うときには(abs)ではなく'fabs'!!!
*/

Measured memory_bytes: 3988
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);

		int a = sc.nextInt();

		int ac_cnt = 0;
		int wa_cnt = 0;
		int tle_cnt = 0;
		int re_cnt = 0;

		for (int i = 0; i < a; i++) {
			String b = sc.next();
			if (b.contentEquals("AC")) {
				ac_cnt++;
			} else if (b.contentEquals("WA")) {
				wa_cnt++;
			} else if (b.contentEquals("TLE")) {
				tle_cnt++;
			} else if (b.contentEquals("RE")) {
				re_cnt++;
			}
		}

		System.out.println("AC x " + ac_cnt);
		System.out.println("WA x " + wa_cnt);
		System.out.println("TLE x " + tle_cnt);
		System.out.println("RE x " + re_cnt);
	}
}


Measured memory_bytes: 58348
//A.cpp
#include <iostream>
#include <string>
#include <algorithm>
#include <set>
#include <map>
#include <vector>
#include <queue>
#include <stack>
#include <math.h>
#define rep(i,n) for(int i = 0; i < (n); ++i)
using namespace std;
typedef long long ll;
ll gcd(ll a,ll b){return b!=0?gcd(b,a%b):a;}
ll lcm(ll a,ll b){return a*b/gcd(a,b);}
const ll mod=1e9+7;


int main(){
  ll n;
  cin >> n;
  ll a[n];
  ll cnt = 0;
  ll b;
  rep(i,n){
    cin >> b;
    a[i] = abs(b);
    if(b < 0) cnt++;
  }
  sort(a,a+n);
  ll ans = 0;
  if(cnt%2==0){
    rep(i,n) ans += a[i];
  }else{
    rep(i,n) ans += a[i];
    ans -= 2 * a[0];
  }
  printf("%lld\n", ans);

  return 0;
}


Measured memory_bytes: 1024
import java.util.*;
import java.io.*;
import static java.util.Arrays.*;
import static java.lang.Math.*;

public class Main {

    static final Scanner in = new Scanner(System.in);
    static final PrintWriter out = new PrintWriter(System.out,false);

    static void solve() {
    	ptr = 0;
    	String[][] s = new String[101][];
        while (in.hasNext()) {
        	s[ptr] = in.next().split(",");
        	ptr++;
        }

        str = copyOf(s,ptr);
        dp = new int[ptr][1000];
        for (int i=0; i<ptr; i++) fill(dp[i],-1);
        out.println(rec(0,0));
    }

    static String[][] str;
    static int ptr;
    static int[][] dp;

    static int rec(int x, int depth) {
    	if (dp[depth][x] != -1) return dp[depth][x];
    	if (depth == ptr-1) return Integer.parseInt(str[depth][x]);
    	int max = -1;
    	if (depth < ptr/2) {
    		max = max(max,rec(x,depth+1));
    		max = max(max,rec(x+1,depth+1));
    	}else {
    		if (x != 0) max = max(max,rec(x-1,depth+1));
    		if (x < str[depth].length-1) max = max(max,rec(x,depth+1));
    	}
    	return dp[depth][x] = max + Integer.parseInt(str[depth][x]);
    }

    public static void main(String[] args) {
        long start = System.currentTimeMillis();

        solve();
        out.flush();

        long end = System.currentTimeMillis();
        //trace(end-start + "ms");
        in.close();
        out.close();
    }

    static void trace(Object... o) { System.out.println(Arrays.deepToString(o));}
}

Measured memory_bytes: 28508
#include<iostream>
#include<vector>
#include<algorithm>
#include<iomanip>
#include<utility>
#include<iomanip>
#include<map>
#include<cmath>
#include<cstdio>
#define rep(i,n) for(int i=0; i<(n); ++i)
using namespace std;
using ll =long long;
using P = pair<int,int>;

int main(){
    int n; cin >> n;
    vector<double> v(n);
    rep(i,n) cin >> v[i];

    while(n>1){
        sort(v.begin(),v.end());
        reverse(v.begin(),v.end());
        double memo=(v[n-1]+v[n-2])/2;
        v[n-2]=memo;
        v.pop_back();
        n--;
    }
    cout << v[0] << endl;
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define _GLIBCXX_DEBUG
#define rep2(i, m, n) for(int i=int(m); i<int(n); i++)
#define rep(i, n) rep2(i, 0, n)
#define all(a) a.begin(), a.end()
using ll = long long;
using ld = long double;
using V = vector<int>;
using Vll = vector<ll>;
using Vld = vector<ld>;
using VV = vector<V>;
using VVll = vector<Vll>;
using VVld = vector<Vld>;
using VVVld = vector<VVld>;
using P = pair<int, int>;
using Pll = pair<ll, ll>;
using Pld = pair<ld, ld>;
const int INF = 1<<30;
const ll INFll = 1ll<<62;
const ld EPS = 1e-10;
const int MOD = int(1e9)+7;
template<typename T> inline bool chmin(T& a, T b) {if(a>b) {a=b; return true;} return false;}
template<typename T> inline bool chmax(T& a, T b) {if(a<b) {a=b; return true;} return false;}


template<typename T>
struct BIT {
  int n; vector<T> d;
  BIT(int n=0) : n(n), d(n+1) {}
  void add(int i, T a=1) {
    for (i++; i <= n; i += i & -i) chmax(d[i], a);
  }
  // sum [0, i)
  T sum(int i) {
    if (i == 0) return 0;
    T x = 0;
    for (; i > 0; i -= i & -i) chmax(x, d[i]);
    return x;
  }
};


int main() {
  int n; cin >> n;
  V h(n);
  Vll a(n);
  rep(i, n) cin >> h[i];
  rep(i, n) cin >> a[i];

  BIT<ll> dp(n+1);

  rep(i, n) dp.add(h[i], dp.sum(h[i]) + a[i]);
  
  ll ans = dp.sum(n+1);
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 4096
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int,int>;
#define enld '\n'
#define rep(i,n) for(int i=0; i<(n); i++)
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#pragma GCC optimize("Ofast")
constexpr ll INF = 1e18;
constexpr int inf = 1e9;
constexpr ll mod = 1000000007;
constexpr ll mod2 = 998244353;
const double PI = 3.1415926535897932384626433832795028841971;
const int dx[6] = {1, 0, -1, 0,1,1};
const int dy[6] = {0, 1, 0, -1,1,-1};
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
// ---------------------------------------------------------------------------


int main(){
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    int N,M;
    cin >> N >> M;
    vector<int> H(N);
    for(int i=0; i<N; i++){
        cin >> H[i];
    }
    vector<vector<int>> G(N);
    for(int i=0; i<M; i++){
        int a,b;
        cin >> a >> b;
        a--;b--;
        G[a].push_back(b);
        G[b].push_back(a);
    }
    int ans = 0;
    for(int i=0; i<N; i++){
        bool can = true;
        for(int nv:G[i]){
            if(H[i]<=H[nv]){
                can = false;
            }
        }
        if(can) ans++;
    }
    cout << ans << enld;
    return 0;
}


Measured memory_bytes: 8744
#include <stdio.h>

int main() {
  
  int a,b,c,count;
  
  while(scanf("%d %d",&a,&b)!=EOF) {
    
    count=1;

    c=a+b;
    while(c>=10) {
      c=c/10;
      
      count++;
    }
    
    printf("%d\n",count);
  }
  
  return 0;
}

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

int main() {
	int h, w;
	
	while (cin >> h >> w) {
		if (h == 0 and w == 0) break;
		
		for (int i = 0; i < h; i++) {
			
			for (int j = 0; j < w; j++) {
				if ((i + j) & 1) {
					cout << '.';
				} else {
					cout << '#';
				}
			}
			
			cout << endl;
		}
		
		cout << endl;
	}
	
	return 0;
}


Measured memory_bytes: 3088
#include <iostream>
#include <string>
#include <math.h>
#include <algorithm>
#include <vector>
#include <set>
#include <map>
using namespace std;

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

int main(){
    ll N;
    cin >> N;
    vector<ll> sum;
    ll lim = (ll)sqrt(N);
    for(int i = 1; i <= lim; i++){
        ll a = i;
        ll b = 0;
        if(N % a == 0){
            b = N / a;
            sum.push_back((a-1) + (b-1));
        }
    }
    sort(sum.begin(), sum.end());
    cout << sum[0] << endl;
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <stdio.h>
#include <cmath>
#include <cctype>

using namespace std;

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

    int temp = n * (n - 1);
    temp += m * (m - 1);
    ans = temp / 2;

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

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define int long long
using namespace std;
#define deb(x) cout<<#x<<" = "<<x<<"\n";

signed main()
{
	//freopen("input.txt", "r", stdin);
	
	int n; cin>>n;
	int k; cin>>k;
	int cnt = 0;
	while(n--)
	{
		int x; cin>>x;
		cnt += x>=k;
	}
	cout<<cnt<<"\n";
}

Measured memory_bytes: 256
import java.util.Scanner;

public class Main{
    public static void main(String[] args){
        Scanner scanner = new Scanner(System.in);
        int a = scanner.nextInt();
        int b = scanner.nextInt();
        int c = scanner.nextInt();
        if (a <= c && c <= b){
            System.out.println("Yes");
        }else {
            System.out.println("No");
        }
    }
}


Measured memory_bytes: 23124
#include<iostream>
#include<algorithm>

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

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

    int sum = 0;
    bool can = false;
    int i = 0;
    while(true) {
        int cake_price = i * 4;
        if (cake_price > N) break;
        int j = 0;
        while(true) {
            int donuts_price = j * 7;
            int sum = cake_price + donuts_price;
            if (sum == N) can = true;
            if (sum >= N) break;
            ++j;
        }
        if (can) break;
        ++i;    
    }    

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


Measured memory_bytes: 256
#include <stdio.h>
int main()
{   int n,a,b,c,d;
scanf("%d",&n);
d=n%10;
n/=10;
c=n%10;
n/=10;
b=n%10;
n/=10;
a=n;
 if(a+b+c+d==7){
     printf("%d+%d+%d+%d=7",a,b,c,d);
 }else if(a-b+c+d==7){
     printf("%d-%d+%d+%d=7",a,b,c,d);
 }else if(a-b-c+d==7){
     printf("%d-%d-%d+%d=7",a,b,c,d);
 }else if(a-b-c-d==7){
     printf("%d-%d-%d-%d=7",a,b,c,d);
 }else if(a-b+c-d==7){
     printf("%d-%d+%d-%d=7",a,b,c,d);
 }else if(a+b-c+d==7){
     printf("%d+%d-%d+%d=7",a,b,c,d);
 }else if(a+b-c-d==7){
     printf("%d+%d-%d-%d=7",a,b,c,d);
 }else if(a+b+c-d==7){
     printf("%d+%d+%d-%d=7",a,b,c,d);
 }return 0;
}


Measured memory_bytes: 128
N=int(input())
F=[[int(i) for i in input().split()] for j in range(N)]
P=[[int(i) for i in input().split()] for j in range(N)]
print(max([(sum([P[shop][sum([i*j for i,j in zip([i>>k & 1 for k in range(10)],F[shop])])] for shop in range(N)])) for i in range(1,1024)]))

Measured memory_bytes: 3064
#include <cstdio>
#include <sstream>
#include <cstdlib>
#include <cctype>
#include <cmath>
#include <algorithm>
#include <set>
#include <queue>
#include <stack>
#include <list>
#include <iostream>
#include <fstream>
#include <numeric>
#include <string>
#include <vector>
#include <cstring>
#include <map>
#include <iterator>
#include <iomanip>
#include <unordered_map>

using namespace std;


int main()
{

    ios_base::sync_with_stdio(false);
    cin.tie(NULL);

    int d,n;
    cin>>d>>n;
    int i=1;
    while(n-1)
    {
        n--;
        i++;
        if(i==100)
            i++;

    }
    int ans=i;
    while(d--)
        ans*=100;
    cout<<ans;
    
}


Measured memory_bytes: 256
#include <algorithm>
#define _USE_MATH_DEFINES
#include <cmath>
#include <iostream>
#include <string>
#include <vector>
#include <stdio.h>
#include<list>
#include<map>
#include<utility>
#include<tuple>
#include<numeric>
#include<set>

#define rep(i,n) for(int i=0;i<(int)n;i++)
#define all(a) (a).begin(),a.end()
using namespace std;

int main()
{
	int a, b, c;
	cin >> a >> b >> c;
	if (a + b >= c)cout << "Yes" << endl;
	else cout << "No" << endl;
}



Measured memory_bytes: 256
#include<iostream>
#include<cassert>
#include<stdexcept>
#include<utility>
#include<functional>
#include<numeric>
#include<cmath>
#include<algorithm>
#include<cstdio>
#include<cstdlib>
#include<array>
#include<stack>
#include<queue>
#include<deque>
#include<vector>
#include<complex>
#include<set>
#include<map>
#include<unordered_map>
#include<unordered_set>
#include<string>
#include<bitset>
using namespace std;
using ll=long long;

int main(){
    int a,b;
    cin>>a>>b;
    cout<<max({a+b,a-b,a*b})<<endl;
    return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#define rep(i,a,b) for(int i=a;i<b;i++)
#define rrep(i,a,b) for(int i=a;i>=b;i--)
#define fore(i,a) for(auto &i:a)
#define all(x) (x).begin(),(x).end()
//#pragma GCC optimize ("-O3")
using namespace std; void _main(); int main() { cin.tie(0); ios::sync_with_stdio(false); _main(); }
typedef long long ll; const int inf = INT_MAX / 2; const ll infl = 1LL << 60;
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; }
//---------------------------------------------------------------------------------------------------
/*---------------------------------------------------------------------------------------------------
　　　　　　　　　　　 ∧＿∧
　　　　　 ∧＿∧ 　（´<_｀ ）　 Welcome to My Coding Space!
　　　　 （ ´_ゝ`）　/　 ⌒i     @hamayanhamayan0
　　　　／　　　＼　 　  |　|
　　　 /　　 /￣￣￣￣/　　|
　 ＿_(__ﾆつ/　    ＿/ .| .|＿＿＿＿
　 　　　＼/＿＿＿＿/　（u　⊃
---------------------------------------------------------------------------------------------------*/














ll H;
//---------------------------------------------------------------------------------------------------
void _main() {
	cin >> H;

	ll cnt = 1, ans = 0;
	while (1 < H) {
		ans += cnt;
		H /= 2;
		cnt *= 2;
	}
	ans += cnt;

	cout << ans << endl;
}







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

import math
List= []
daburi = []
m = M
i = 2
num = 1
while m > 1:
    if m%i == 0:
        m //= i
        if i in List:
            if num == 1:
                daburi.append(2)
            else:
                daburi[-1] += 1
            num += 1
        else:
            num = 1
        List.append(i)
        i -= 1
    i += 1
    if i > math.sqrt(m) and m > 1:
        if List.count(m) == 1:
            daburi.append(2)
        elif List.count(m) > 1:
            daburi[-1] += 1
        List.append(m)
        m = 0

c = N**(len(List)-sum(daburi))

for k in range(len(daburi)):
    c *= (math.factorial(daburi[k]+N-1)//math.factorial(daburi[k])//math.factorial(N-1))

ans = (int(c))%(10**9+7)
print(ans)

Measured memory_bytes: 4432
#include <iostream> // cout, endl, cin
#include <iomanip>
#include <string>        // string, to_string, stoi
#include <vector>        // vector
#include <algorithm>     // min, max, swap, sort, reverse, lower_bound, upper_bound
#include <utility>       // pair, make_pair
#include <tuple>         // tuple, make_tuple
#include <cstdint>       // int64_t, int*_t
#include <cstdio>        // printf
#include <map>           // map
#include <queue>         // queue, priority_queue
#include <set>           // set
#include <stack>         // stack
#include <deque>         // deque
#include <unordered_map> // unordered_map
#include <unordered_set> // unordered_set
#include <bitset>        // bitset
#include <cctype>        // isupper, islower, isdigit, toupper, tolower
#include <math.h>
#include <numeric>
using namespace std;
#define _GLIBCXX_DEBUG
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep2(i, s, n) for (int i = (s); i < (int)(n); i++)
const int INF = 1001001001;
const int BG = 1000000007;

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

    int st, ed;

    rep(i, s.size())
    {
        if (s[i] == 'A')
        {
            st = i;
            break;
        }
    }
    for (int i = s.size() - 1; i >= 0; i--)
    {
        if (s[i] == 'Z')
        {
            ed = i;
            break;
        }
    }
    cout << ed - st + 1 << endl;
}


Measured memory_bytes: 640
/*  ex6_2
    Rikuta  */

#include <stdio.h>
//ヘッダファイルのインクルード
#include <string.h>
//最大の長さの定義
#define LIM 101

int main(void){

    //単語をいれる配列の準備
    char word[LIM];

    //単語の読み込み
    scanf("%s",&word);

    //単語の1番目と長さから2引いたものと単語の最後の文字の出力
    printf("%c%d%c\n",word[0],(int)strlen(word)-2,word[strlen(word)-1]);
    
    return 0;
}

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

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

/* cpp template {{{ */

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

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

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

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

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

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

signed main() 
{
  int n=in();
  print(n*800-200*(n/15));
  return 0;
}

Measured memory_bytes: 256
#pragma region includes, macros
#include <iostream>
#include <algorithm>
#include <functional>
#include <string>
#include <vector>
#include <set>
#include <queue>
#include <stack>
#include <numeric>
#include <bitset>
#include <map>
#include <set>
#include <list>
#include <unordered_set>
#include <unordered_map>
#include <stdlib.h>

using namespace std;
 
typedef int64_t i64;
typedef pair<i64, i64> P;

template<class T>
const T INF = numeric_limits<T>::max();
template<class T>
const T SINF = numeric_limits<T>::max() / 10;
static const i64 MOD = 1000000007;

//int dx[4] = {0,1,0,-1}, dy[4] = {-1,0,1,0};
//int dx[5] = {-1,0,0,0,1}, dy[5] = {0,-1,0,1,0};
//int dx[8] = {-1,0,1,1,1,0,-1,-1}, dy[8] = {1,1,1,0,-1,-1,-1,0};
//int dx[9] = {-1,0,1,1,1,0,-1,-1,0}, dy[9] = {1,1,1,0,-1,-1,-1,0,0};

struct edge {
	i64 from, to, cost;
	edge(i64 to, i64 cost) : from(-1), to(to), cost(cost) {}
	edge(i64 src, i64 to, i64 cost) : from(src), to(to), cost(cost) {}
};

template<typename T>
vector<T> make_v(size_t a){return vector<T>(a);}

template<typename T,typename... Ts>
auto make_v(size_t a,Ts... ts){
	return vector<decltype(make_v<T>(ts...))>(a,make_v<T>(ts...));
}

template<typename T,typename V>
typename enable_if<is_class<T>::value==0>::type
fill_v(T &t,const V &v){t=v;}

template<typename T,typename V>
typename enable_if<is_class<T>::value!=0>::type
fill_v(T &t,const V &v){
	for(auto &e:t) fill_v(e,v);
}
#pragma endregion

int main(){
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	int a, b;
	cin >> a >> b;
	int ans = 0;
	if(a > b){
		ans += a;
		--a;
	}else{
		ans += b;
		--b;
	}
		if(a > b){
		ans += a;
		--a;
	}else{
		ans += b;
		--b;
	}
	cout << ans << endl;
}

Measured memory_bytes: 256
#include <stdio.h>
int main()
{

    int a, b;
    char op;
    for (int i = 1; i > 0; i++)
    {
        scanf("%d %c %d", &a, &op, &b);
        if (op == '+')
        {

            printf("%d\n", a + b);
        }
        else if (op == '-')
        {

            printf("%d\n", a - b);
        }

        else if (op == '*')
        {

            printf("%d\n", a * b);
        }
        else if (op == '/')
        {

            printf("%d\n", a / b);
        }
        else if (op == '?')
        {

            break;
        }
    }
    return 0;
}


Measured memory_bytes: 2100
#include "bits/stdc++.h"

#define REP(i,num) for(int i=0;i<(num);++i)
#define ALL(c) c.begin(),c.end()
#define LOOP(i) while(i--)
#define PRINTALL(c) for(auto& x:c){cout<<x<<' ';}cout<<endl;
#define PAIRCOMP(c,comp) [](const pair<ll,ll>& lhs,const pair<ll,ll>& rhs){return lhs.c comp rhs.c;}

using namespace std;
using ll = long long;

constexpr ll atcoder_mod = 1e9+7;

template<typename T=int>
T in(){T x; cin >> x; return (x);}
template<typename T=int,typename C=vector<T>>
C vecin(int N){C x(N);REP(i,N){x[i]=in<T>();}return move(x);}

void vout(){cout << endl;}
template<typename Head,typename... Tail>
void vout(Head&& h,Tail&&... t){cout << ' ' << h;vout(forward<Tail>(t)...);}
void out(){cout << endl;}
template<typename Head,typename... Tail>
void out(Head&& h,Tail&&... t){cout << h;vout(forward<Tail>(t)...);}

class ConnectNodeInfo{
	vector<vector<pair<ll,ll>>> graph;
public:
	ConnectNodeInfo(int node_num){
		graph.resize(node_num);
	}
	void AddNonDirectionalConnection(ll u,ll v,ll w){
		graph[u].emplace_back(v,w);
		graph[v].emplace_back(u,w);
	}
	void AddDirectionalConnection(ll u,ll v,ll w){
		graph[u].emplace_back(v,w);
	}
	vector<pair<ll,ll>>& operator[](ll index){
		return graph[index];
	}
	size_t size(){return graph.size();}
};

class BellmanFord{
	vector<ll> dist;
	set<ll> visit;
	bool ignore_unrelated_loop{false};

	bool CanReachImpl(int start,int end,ConnectNodeInfo& connect){
		bool reach=false;
		if(start==end) return true;

		for(int i=0,ei=connect[start].size();i<ei;i++){
			auto res = visit.emplace(connect[start][i].first);
			if(!res.second) continue;
			reach |= CanReachImpl(connect[start][i].first,end,connect);
		}
		return reach;
	}
	bool CanReach(int start,int end,ConnectNodeInfo& connect){
		visit.clear();
		visit.emplace(start);
		return CanReachImpl(start,end,connect);
	}
public:
	pair<ll,bool> CalcShortestPath(int start,int end,ConnectNodeInfo& connect){
		dist.resize(connect.size(),1LL<<60);

		dist[start] = 0;
		for(int i=0,ei=dist.size();i<ei;i++){
			for(int u=0,eu=connect.size();u<eu;u++){
				for(int v=0,ev=connect[u].size();v<ev;v++){
					auto& e = connect[u][v];

					if(dist[e.first]>dist[u]+e.second){
						dist[e.first] = dist[u]+e.second;
						if(i==ei-1){
							if(!ignore_unrelated_loop || (CanReach(start,u,connect) && CanReach(u,end,connect))){
								return make_pair(dist[end],false);
							}
						}
					}
				}
			}
		}
		return make_pair(dist[end],true);
	}
	void SetIgnoreUnrelatedLoop(bool flag){ignore_unrelated_loop=flag;}
};

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

	int N=in(),M=in();
	ConnectNodeInfo connect(N);
	REP(i,M){
		int u=in(),v=in();
		connect.AddDirectionalConnection(u,v,-1);
	}

	BellmanFord BF;
	for(int i=1;i<N;i++){
		auto res = BF.CalcShortestPath(0,i,connect);
		if(!res.second){
			out(1);
			return 0;
		}
	}
	out(0);
	return 0;
}



Measured memory_bytes: 3172