akhauriyash/Code-Regression huggingface dataset:
#include<bits/stdc++.h>
using namespace std;
#define intt long long int
#define intu unsigned long long int
#define vi vector<int>
#define ii pair<int,int>
#define pb push_back
//#define mp make_pair
#define ff first
#define ss second
#define fast_io ios::sync_with_stdio(0);cin.tie(NULL);std::cout.tie(NULL);
# define PI           3.14159265358979323846 
#define all(a) a.begin(),a.end()
#define for0(i, n) for (int i = 0; i < n; i++)
#define for1(i, n) for (int i = 1; i <= n; i++)
#define loop(i,a,b) for (int i = a; i < b; i++)
#define bloop(i,a,b) for (int i = a ; i>=b;i--)
#define tc(t) int t; cin >> t; while (t--)
int mod = 1000000007;
int gcd(int a, int b) {return b ? gcd(b, a % b) : a;}
int lcm(int a, int b) {return a * b / gcd(a, b); }
intt bpow(intt a,intt b) 
{
  intt res = 1;
  while (b > 0) {
    if (b & 1)res = ((res%mod) * (a%mod))%mod;
      a = ((a%mod) * (a%mod))%mod;
      b >>= 1;
  }
  return res;
}
intt fact(intt n) { 
   if ((n==0)||(n==1))
      return 1; 
   else
      return n*fact(n-1);
}
void go()
{
#ifndef ONLINE_JUDGE
  freopen("inn.txt","r",stdin);
  freopen("ouut.txt","w",stdout);
  #endif
}
///////////U L R D
int dx[4]={0,-1,1,0};
int dy[4]={1,0,0,-1};


int main() 
{ 
    fast_io
    go();
   long double n;cin>>n;
   long double ans=n/3*n/3*n/3;
   cout << fixed << setprecision(12) << ans <<"\n";
}

/*!
    You are under no obligation to be the same person you were a minute ago,
    You have the right to grow !
*/




















Measured memory_bytes: 3792
#include <iostream>
#include <cstring>

using namespace std;

int main()
{
	int N,ans=0;
	char s[11],ring[11];
	cin>>s>>N;
	for (int i=0; i<N; i++) {
		cin>>ring;
		for (int j=0; j<strlen(ring); j++) {
			int k;
			for (k=0; k<strlen(s); k++) {
				if (s[k]!=ring[(j+k)%strlen(ring)]) break;
			}
			if (k==strlen(s)) {
				ans++;
				break;
			}
		}
	}
	cout<<ans<<endl;
}

Measured memory_bytes: 1164
#include<stdio.h>

int main(void) {
	int n, m, i, k;
	while (1) {
		scanf("%d %d", &n, &m);
		if (n == 0 && m == 0) break;
		for (i = 0; i < n; i++) {
			for (k = 0; k < m; k++) {
				if ((i + k) % 2 == 0) printf("#");
				else printf(".");
			}
			printf("\n");
		}
		printf("\n");
	}
	return 0;
}


Measured memory_bytes: 2104
import sys,collections,math,random;sys.setrecursionlimit(10**7)
from math import factorial
def Is(): return [int(x) for x in sys.stdin.readline().split()]
def Ss(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def S(): return input()

MOD = 10**9+7
def comb(n, r):
    return factorial(n)  // (factorial(n - r) * factorial(r)) % MOD
    
N,K = Is()
for i in range(1,K+1):
#    print(i,K-1,i-1,N-K+1,i)
    if N-K+1 < i:
        print(0)
    else:
        print((comb(K-1,i-1) * comb(N-K+1,i)) % MOD)


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

public class Main{
  public static void main(String[] args) {
  	Scanner sc = new Scanner(System.in);
	int n = sc.nextInt();
	int[] nums = new int[n];
		
	for (int i = 0; i < n; i++) {
		nums[i] = sc.nextInt();
	}
	Arrays.sort(nums);
	int mid = (n/2);
	System.out.println(nums[mid] - nums[mid-1]);
  }
}

Measured memory_bytes: 51168
#include <iostream>
#include <string>
#include <vector>
#include <cmath>
#include <queue>
#include <stack>
#include <algorithm>
#include <map>
#include <iomanip>
#include <set>
#include <unordered_set>
#include <unordered_map>
#include <bitset>
#include <cstdlib>
#include <ctime>

using namespace std;

//#define HOME
void jakos() {
#ifdef HOME
    freopen("in.txt", "r", stdin);
    //freopen("out.txt", "w", stdout);
#endif
    ios_base::sync_with_stdio(false);
    cin.tie(0);
}

#define endl '\n'
#define int long long
typedef long long ll;

const int mod = 1e9 + 7;
const int base = 179;
const int INF = 1e18;
const int N = 1e5 + 7;

signed main() {
    jakos();

    int n;
    cin >> n;
    set<int> st;
    bool ans = true;
    for (int i = 0; i < n; i++) {
        int temp;
        cin >> temp;
        if (st.count(temp)) {
            ans = false;
        }
        else st.insert(temp);
    }
    if (ans) cout << "YES" << endl;
    else cout << "NO" << endl;

    return 0;
}

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

ll inf=9223372036854775806;

int main()
{
	//freopen("input.txt","r",stdin);freopen("output.txt","w",stdout);
	ios_base::sync_with_stdio(false); cin.tie(0);
	string a,b,c;
	cin>>a>>b>>c;
	cout<<a[0]<<b[1]<<c[2];
	return 0;
}

Measured memory_bytes: 256
#include<cstdio>
#include<cstdlib>
#include<cmath>
#include<algorithm>

using namespace std;

int main()
{
	int n,s[1005];
	while(~scanf("%d",&n))
	{
		for(int i=0;i<n;i++)
			scanf("%d",&s[i]);
		sort(s,s+n);
		printf("%d\n",s[n-1]-s[0]);
	}
	return 0;
}


Measured memory_bytes: 128
import sys
line = ((0,1,2),(3,4,5),(6,7,8),(0,3,6),(1,4,7),(2,5,8),(0,4,8),(2,4,6))
for s in map(lambda s: s.rstrip(), sys.stdin):
    for l in line:
        ls = list(set(s[i] for i in l))
        if len(ls) == 1 and ls[0] != "s":
            print(ls[0])
            break
    else:
        print("d")


Measured memory_bytes: 5572
#include <bits/stdc++.h>
using namespace std;
#pragma GCC optimize("Ofast")
#define all(x) (x).begin(),(x).end()
#define rep(i,n) for(int (i)=0;i<(n);i++)
#define REP(i,m,n) for(int (i)=(m);(i)<(n);(i)++)
#define INF LLONG_MAX - 100
#define MOD 1000000007
#define fcout cout << fixed << setprecision(15)
#define int long long
#define yorn(f) puts((f)?"Yes":"No")
#define YORN(f) puts((f)?"YES":"NO")
#define lower_bound lowb
#define upper_bound upb
typedef long long ll;
typedef pair<int, int> P;
typedef priority_queue<int> pque;
int gcd(int a,int b){return b?gcd(b,a%b):a;};
int lcm(int a,int b){return a*b/gcd(a,b);};
int mod(int a,int b){return (a+b-1)/b;};
int month[12] = {31,28,31,30,31,30,31,31,30,31,30,31};
template<typename A, size_t N, typename T>
void Fill(A(&array)[N],const T &val){std::fill((T*)array,(T*)(array+N),val);}
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;};



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

	int n;
	cin >> n;
	int a[n], b[n], A = 0, B = 0;
	rep(i, n) {
		cin >> a[i];
		A += a[i];
	}
	rep(i, n) {
		cin >> b[i];
		B += b[i];
	}

	if(A < B) {
		puts("-1");
		return 0;
	}

	vector<int> d(100010);
	int ans = 0, s = 0;

	rep(i, n) {
		if(a[i] < b[i]) {
			ans++;
			s += b[i] - a[i];
			d[i] = 0;
		} else {
			d[i] = a[i] - b[i];
		}
	}

	sort(all(d), greater<int>());
	rep(i, n) {
		if(s <= 0) break;
		ans++;
		s -= d[i];
	}

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

Measured memory_bytes: 2560
#include <iostream>
#include <iomanip>
#include <string>
#include <vector>
using namespace std;

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

struct Read {
	long long operator()(void) {
		long long d;
		std::cin >> d;
		return d;
	}
}read;
struct ReadReal {
	double operator()(void) {
		double d;
		std::cin >> d;
		return d;
	}
}readReal;
struct ReadString {
	std::string operator()(void) {
		std::string s;
		std::cin >> s;
		return s;
	}
}readString;

struct Print {
	void operator()(double d, int digit) {
		std::cout << std::fixed << std::setprecision(digit) << d;
	}
	template <typename T>
	void operator()(T t) {
		std::cout << t;
	}
	template <typename T>
	void operator()(const vector<T> &v, const string &sep = " ") {
		if (v.empty()) return;
		Print()(v[0]);
		for(int i = 1;  i < v.size(); ++i) {
			Print()(sep);
			Print()(v[i]);
		}
		return;
	}
}print;

struct Println {
	void operator()(void) {
		std::cout << endl;
	}
	void operator()(double d, int digit) {
		print(d, digit);
		Println()();
	}
	template <typename T>
	void operator()(T t) {
		print(t);
		Println()();
	}
	template <typename T>
	void operator()(const vector<T> &v, const string &sep = " ") {
		print(v, sep);
		Println()();
		return;
	}
}println;

int gcd(int x, int y) {
	if (x < y) {
		swap(x, y);
	}
	while (y > 0) {
		int r = x % y;
		x = y;
		y = r;
	}
	return x;
}

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

	int x = read();
	int y = read();
	println(gcd(x, y));

	return 0;
}



Measured memory_bytes: 3204
#include <iostream>

using namespace std;

char S[10] = {};

int main() {
	cin >> S;
	for (int i = 1; i < 6; i++) {
		if (S[i] == NULL) {
			cout << "No" << endl;
			return 0;
		}
		else if (S[i] == 'C' && S[i - 1] == 'A') {
			cout << "Yes" << endl;
			return 0;
		}
	}
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <utility>
#include <stack>
#include <functional>
#include <queue>
#include <cmath>
#include <set>

#define rep(i,j,k) for(int i=j;i<k;i++)
#define drep(n,m) for(int i=0;i<n;i++)for(int j=0;j<m;j++)
#define Sort(x) sort((x).begin(),(x).end())
#define fi first
#define se second
#define vi vector<int>
#define INF 1000000000
#define MOD 1000000009
#define pb push_back
#define mp make_pair
typedef long long ll;
typedef unsigned long long ull;
int dx[4]={0,1,0,-1},dy[4]={1,0,-1,0};

using namespace std;

ll gcd(ll a,ll b){
    if(a<b){
        int t=a;a=b;b=t;
    }
    int c=a%b;
    while(c!=0){
        a=b;
        b=c;
        c=a%b;
    }
    return b;
}

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

bool isPrime(int x){
    if(x==1)return false;
    if(x==2)return true;
    if(x%2==0)return false;
    for(int i=3;i<=sqrt(x);i+=2){
        if(x%i==0)return false;
    }
    return true;
}

int kaizyo(int x){
    if(x==1)return x;
    else return x*kaizyo(x-1);
}

typedef struct Point{
    int x;
    int y;
} P;

int main() {
    string s; cin>>s;
    int n; cin>>n;
    rep(i,0,n){
        string ss;
        cin>>ss;
        if(ss=="print"){
            int a,b;cin>>a>>b;
            cout<<s.substr(a,b-a+1)<<endl;
        }else if(ss=="reverse"){
            int a,b; cin>>a>>b;
            reverse(s.begin()+a,s.begin()+b+1);
        }else {
            int a,b; cin>>a>>b;
            string sss; cin>>sss;
            rep(j,a,b+1){
                s[j]=sss[j-a];
            }
        }
    }

    return 0;
}



Measured memory_bytes: 3208
/*
 * atcoder/abc135/d.cpp
 */

// C++ 14
#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <cstring> // memset
#include <cassert>
using namespace std;
#define ll long long
#define loop(__x, __start, __end) for(int __x = __start; __x < __end; __x++)
template <class T> ostream & operator << (ostream & out, vector<T> const & v) {
  for (auto &&a: v) out << a << " "; out << endl; return out;
}
template <class T> void dump(T &a) { cout << a << endl; }
template <class T> bool chmin(T &a, T b) { if (a > b) {a = b; return true; } return false; }
template <class T> bool chmax(T &a, T b) { if (a < b) {a = b; return true; } return false; }
/* Mod */
#define MOD 1000000007
template <class T> void madd(T &a, T b){ if((a+=b)>=MOD) a-=MOD; }
template <class T> void msub(T &a, T b){ if((a+=MOD-b)>=MOD) a-=MOD; }

string S;
ll N;
vector<int> mul;
ll dp[100001][13];

ll rec(ll d = 0, ll rem = 0) {
  ll &cc = dp[d][rem];
  if (~cc) return cc;
  if (d == N) return cc = rem%13 == 5;
  char c = S[d];
  if (c != '?') {
    ll m_d = (ll)(c - '0');
    m_d = (m_d * mul[d] + rem) % 13;
    return cc = rec(d+1, m_d);
  }

  ll ways = 0;
  for (ll i=0; i<=9; i++) {
    ll m_d = i;
    m_d = (m_d * mul[d] + rem) % 13;
    madd(ways, rec(d+1, m_d));
  }

  return cc = ways;
}

void solve() {
  cin >> S;
  reverse(S.begin(), S.end());
  N = S.size();
  mul.push_back(1);
  for (int i=0; i<N; i++) mul.push_back((mul[mul.size()-1] * 10) % 13);
  memset(dp, -1, sizeof(dp));
  cout << rec() << endl;
}
int main() {
  // cout.precision(15); cout << fixed;

  solve();

  return 0;
}


Measured memory_bytes: 17272
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.StringTokenizer;

public class Main {
	public static void main(String[] args) {
		FastScanner sc = new FastScanner(System.in);
		int n = sc.nextInt(), m = sc.nextInt();
		int ans = (n*(n-1)/2)+(m*(m-1)/2);
		System.out.println(ans);
	}
	
	
	static class FastScanner {
		private BufferedReader reader = null;
	    private StringTokenizer tokenizer = null;
	    public FastScanner(InputStream in) {
	        reader = new BufferedReader(new InputStreamReader(in));
	        tokenizer = null;
	    }

	    public String next() {
	        if (tokenizer == null || !tokenizer.hasMoreTokens()) {
	            try {
	                tokenizer = new StringTokenizer(reader.readLine());
	            } catch (IOException e) {
	                throw new RuntimeException(e);
	            }
	        }
	        return tokenizer.nextToken();
	    }

	    public String nextLine() {
	        if (tokenizer == null || !tokenizer.hasMoreTokens()) {
	            try {
	                return reader.readLine();
	            } catch (IOException e) {
	                throw new RuntimeException(e);
	            }
	        }

	        return tokenizer.nextToken("\n");
	    }

	    public long nextLong() {
	        return Long.parseLong(next());
	    }

	    public int nextInt() {
	        return Integer.parseInt(next());
	    }

	    public double nextDouble() {
	         return Double.parseDouble(next());
	     }

	    public int[] nextIntArray(int n) {
	        int[] a = new int[n];
	        for (int i = 0; i < n; i++)
	            a[i] = nextInt();
	        return a;
	    }

	    public long[] nextLongArray(int n) {
	        long[] a = new long[n];
	        for (int i = 0; i < n; i++)
	            a[i] = nextLong();
	        return a;
	    }
	}
}

Measured memory_bytes: 21460
#include<bits/stdc++.h>
using namespace std;
const int mx = 200005;
int h, w, n, x, y, r, l, u, d;
char s[mx], t[mx];

int main(){
    scanf("%d%d%d%d%d%s%s", &h, &w, &n, &x, &y, s, t);
    l = 1; r = w; u = 1; d = h;
    for(int i = n-1; i >= 0; i--){
        if(t[i] == 'L' && r != w) r++;
        else if(t[i] == 'R' && l != 1) l--;
        else if(t[i] == 'U' && d != h) d++;
        else if(t[i] == 'D' && u != 1) u--;
        if(s[i] == 'L') l++;
        else if(s[i] == 'R') r--;
        else if(s[i] == 'U') u++;
        else d--;
        if(l > r || u > d) return puts("NO")*0;
    }
    puts(l <= y && y <= r && u <= x && x <= d ? "YES" : "NO");
}

Measured memory_bytes: 640
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <iomanip>

typedef long long ll;


using namespace std;

int main() {
    ll k, n;
    cin >> k >> n;

    ll* A = new ll[n];


    cin >> A[0] >> A[1];

    ll max = A[1] - A[0];

    for (int i = 2; i < n; i++) {
        cin >> A[i];

        if (A[i] - A[i - 1] > max) {
            max = A[i] - A[i - 1];
        }
    }

    if (A[0] + k - A[n - 1] > max) {
        max = A[0] + k - A[n - 1];
    }

    cout << k - max;;



    return 0;
}

Measured memory_bytes: 1792
#include <algorithm>
#include <cassert>
// #include <chrono>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <iostream>
#include <map>
#include <memory>
#include <queue>
// #include <random>
#include <set>
#include <stack>
#include <string>
#include <utility>
#include <vector>

/*
unsigned seed1 = std::chrono::system_clock::now().time_since_epoch().count();
mt19937 g1.seed(seed1);
*/
using namespace std;

const double PI = 2 * acos(0);

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> pii;
typedef pair<pii, pii> ppiipii;
typedef pair<int, ppiipii> pippiipii;
typedef pair<int, pii> pipii;
typedef pair<pii, int> ppiii;
typedef pair<int, ppiii> pippiii;
typedef pair<int, ll> pill;
typedef pair<int, double> pid;
typedef pair<double, double> pdd;
typedef pair<double, pdd> pddd;
typedef pair<string, string> pss;
// note to self, the below two triggers someone
typedef pair<ll, ll> pll;
typedef pair<ll, int> plli;
typedef long double ld;

int dp[105][105];
int a[1005];
int b[1005];
int c[1005];
int n, m;

int main() {
    scanf("%d%d", &n, &m);
    for(int i = 1; i <= n; i++) {
        for(int j = 1; j <= n; j++) {
            dp[i][j] = 1 << 25;
        }
        dp[i][i] = 0;
    }
    for(int i = 0; i < m; i++) {
        scanf("%d%d%d", &a[i], &b[i], &c[i]);
        dp[a[i]][b[i]] = c[i];
        dp[b[i]][a[i]] = c[i];
    }
    for(int k = 1; k <= n; k++) {
        for(int i = 1; i <= n; i++) {
            for(int j = 1; j <= n; j++) {
                dp[i][j] = min(dp[i][j], dp[i][k] + dp[k][j]);
            }
        }
    }
    int ret = 0;
    for(int i = 0; i < m; i++) {
        bool used = false;
        for(int x = 1; x <= n; x++) {
            for(int y = 1; y <= n; y++) {
                if(dp[x][y] == dp[x][a[i]] + c[i] + dp[b[i]][y]) {
                    used = true;
                }
            }
        }
        if(!used) ret++;
    }
    printf("%d\n", ret);
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
/*{{{*/  //template
#define REP(i,n) for(int i=0;i<n;i++)
#define rep(i,n) for(int i=0;i<n;i++)
#define INF 1<<29
#define LINF LLONG_MAX/3
#define MP make_pair
#define PB push_back
#define pb push_back
#define EB emplace_back
#define ALL(v) (v).begin(),(v).end()
#define all(v) ALL(v)
#define sz(x) (int)(x).size()
#define debug(x) cerr<<#x<<":"<<x<<endl
#define debug2(x,y) cerr<<#x<<","<<#y":"<<x<<","<<y<<endl
//struct fin{ fin(){ cin.tie(0); ios::sync_with_stdio(false); } } fin_;
struct Double{ double d; explicit Double(double x) : d(x){} };
ostream& operator<<(ostream& os,const Double x){ os << fixed << setprecision(20) << x.d; return os; }
template<typename T> ostream& operator<<(ostream& os,const vector<T>& vec){ os << "["; for(const auto& v : vec){ os << v << ","; } os << "]"; return os; }
template<typename T,typename U> ostream& operator<<(ostream& os,const pair<T,U>& p){ os << "(" << p.first << ","<< p.second <<")"; return os; }
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> pii;
typedef vector<int> vi;
typedef vector<vi> vvi;
ll gcd(ll a,ll b){ if(b==0) return a; else return gcd(b,a%b); }
constexpr double eps = 1e-14; 
constexpr ll mod = 1e9+7;
const int dx[]={1,0,-1,0} ,dy[] = {0,1,0,-1};
/*}}}*/

int main(){
    constexpr int cost[4] = {10,50,100,500};
    int m;
    bool f=false;
    while(cin>>m){
        if(m==0) break;
        if(f) cout << endl;
        f=true;
        vector<int> a(4);
        rep(i,4) cin>>a[i];
        int sa = accumulate(all(a),0);
        int mn = INF;
        int ans[4];
        rep(i,a[0]+1) rep(j,a[1]+1) rep(k,a[2]+1) rep(l,a[3]+1){
            int sum = i*10 + j*50 + k*100 + l*500;
            if(sum<m) continue;
            int r = sum - m;
            int ret = 0;
            for(int i=3;i>=0;i--){
                ret += r / cost[i];
                r %= cost[i];
            }

            int t = sa - i - j - k - l + ret;

            if(mn > t){
                mn = t;
                ans[0] = i;
                ans[1] = j;
                ans[2] = k;
                ans[3] = l;
            }
        }
        for(int i=0;i<4;i++){
            if(ans[i]==0) continue;
            cout << cost[i] << " " << ans[i] << endl;
        }
    }
}

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

int main() {
	int a;
	int b;
	cin >> a >> b;
	if(a < b){
		cout << "a < b" << endl;
	}
	if(a == b){
		cout << "a == b" << endl;
	}
	if(a > b){
		cout << "a > b" << endl;
	}
	return 0;
}

Measured memory_bytes: 3076
#include <stdio.h>
typedef long long ll;
using namespace std;

int main(void) {
  ll i, j, k, n, m, x, y, xmax = -200, ymin = 200, a;
  scanf("%lld%lld%lld%lld", &n, &m, &x, &y);
  for(i = 0; i < n; ++i) {
    scanf("%lld", &a);
    if(a > xmax) xmax = a;
  }
  for(i = 0; i < m; ++i) {
    scanf("%lld", &a);
    if(a <= ymin) ymin = a;
  }
  printf("%s", xmax < ymin && x < ymin && y > xmax ? "No War" : "War");
  return 0;
}

Measured memory_bytes: 128
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for(ll i = 0, i##_len = (n); i < i##_len; i++)
#define reps(i, s, n) for(ll i = (s), i##_len = (n); i < i##_len; i++)
#define rrep(i, n) for(ll i = (n) - 1; i >= 0; i--)
#define rreps(i, e, n) for(ll i = (n) - 1; i >= (e); i--)
#define all(x) (x).begin(), (x).end()
#define sz(x) ((ll)(x).size())
#define len(x) ((ll)(x).length())

struct mint {
    const int mod = 1e9 + 7;
    long long x;
    
    mint (long long x = 0) : x((x % mod + mod) % mod) {
        
    }
    
    mint& operator=(const long long a) {
        x = a % mod;
        return *this;
    }
    
    mint& operator=(const mint a) {
        x = a.x % mod;
        return *this;
    }
    
    mint& operator+=(const mint a) {
        if ((x += a.x) >= mod) x -= mod;
        return *this;
    }
    
    mint operator+(const mint a) const {
        mint res(*this);
        return res += a;
    }
    
    mint& operator-=(const mint a) {
        if ((x += (mod - a.x)) >= mod) x -= mod;
        return *this;
    }
    
    mint operator-(const mint a) const {
        mint res(*this);
        return res -= a;
    }
    
    mint& operator*=(const mint a) {
        (x *= a.x) %= mod;
        return *this;
    }
    
    mint operator*(const mint a) const {
        mint res(*this);
        return res *= a;
    }
    
    mint pow(long long t) const {
        if (!t) return 1;
        mint a = pow(t >> 1);
        a *= a;
        if (t & 1) a *= *this;
        return a;
    }
    
    mint inv() const {
        return pow(mod - 2);
    }
    
    mint& operator/=(const mint a) {
        return (*this) *= a.inv();
    }
    
    mint operator/(const mint a) const {
        mint res(*this);
        return res /= a;
    }
};

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    // ifstream in("input.txt");
    // cin.rdbuf(in.rdbuf());
    ll n;
    cin >> n;
    vector<ll> c(n);
    rep(i, n) cin >> c[i];
    vector<mint> e(n + 1);
    e[0] = 1;
    reps(i, 1, n + 1) e[i] = e[i - 1] * 2;
    sort(all(c));
    mint ans = 0;
    rep(i, n) {
        ll r = n - 1 - i;
        mint tmp = e[r];
        if (r > 0) tmp += e[r - 1] * r;
        ans += e[i] * tmp * c[i];
    }
    ans *= e[n];
    cout << ans.x << endl;
    return 0;
}


Measured memory_bytes: 4992
import java.io.FileInputStream;
import java.io.InputStream;
import java.util.Scanner;

public class Main{
	static Scanner sc;

	public static void main(String[] args) throws Exception {
		//InputStream in = new FileInputStream("src/input.txt");
		InputStream in = System.in;
		//PrintStream out = new PrintStream("src/output.txt");

		//System.setOut(out);

		sc = new Scanner(in);

		String S = sc.next();

		for(int i = 0; i < S.length() - 8; i++){
			System.out.print(S.charAt(i));
		}
		System.out.println();

		//out.close();
	}
}

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

class Program {
    static void Main() {
        Scanner cin = new Scanner();
        string S = Console.ReadLine();
        while(S.Length >= 5) {
            if (S.Substring(S.Length - 5) == "dream" || S.Substring(S.Length - 5) == "erase") {
                S = S.Substring(0, S.Length - 5);
            }
            else if (S.Substring(S.Length - 6) == "eraser") {
                S = S.Substring(0, S.Length - 6);
            }
            else if (S.Substring(S.Length - 7) == "dreamer") {
                S = S.Substring(0, S.Length - 7);
            }
            else {
                Console.WriteLine("NO");
                return;
            }
        }
        if (S == "") Console.WriteLine("YES");
        else Console.WriteLine("NO");
        Console.ReadLine();
    }
}

class Scanner //標準入力
{
    string[] s;
    int i;

    char[] cs = new char[] { ' ' };

    public Scanner()
    {
        s = new string[0];
        i = 0;
    }

    public string next()
    {
        if (i < s.Length) return s[i++];
        string st = Console.ReadLine();
        while (st == "") st = Console.ReadLine();
        s = st.Split(cs, StringSplitOptions.RemoveEmptyEntries);
        if (s.Length == 0) return next();
        i = 0;
        return s[i++];
    }

    public int Int()
    {
        return int.Parse(next());
    }
    public int[] ArrayInt(int N, int add = 0)
    {
        int[] Array = new int[N];
        for (int i = 0; i < N; i++)
        {
            Array[i] = Int() + add;
        }
        return Array;
    }

    public long Long()
    {
        return long.Parse(next());
    }

    public long[] ArrayLong(int N, long add = 0)
    {
        long[] Array = new long[N];
        for (int i = 0; i < N; i++)
        {
            Array[i] = Long() + add;
        }
        return Array;
    }

    public double Double()
    {
        return double.Parse(next());
    }


    public double[] ArrayDouble(int N, double add = 0)
    {
        double[] Array = new double[N];
        for (int i = 0; i < N; i++)
        {
            Array[i] = Double() + add;
        }
        return Array;
    }
}


Measured memory_bytes: 29428
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define ls (o<<1)
#define rs (o<<1|1)
#define pb push_back
const double PI= acos(-1.0);
const int M = 1e5+7;
/*
int head[M],cnt;
void init(){cnt=0,memset(head,0,sizeof(head));}
struct EDGE{int to,nxt,val;}ee[M*2];
void add(int x,int y){ee[++cnt].nxt=head[x],ee[cnt].to=y,head[x]=cnt;}
*/

char s[M];
struct na{
	int x,y;
	bool operator <(const na &r)const
	{
		return y<r.y;
	}
};
struct nb{
	int x,y;
	bool operator <(const nb &r)const
	{
		return x>r.x;
	}
};
vector<na>va;
vector<nb>vb;
int main()
{
	ios::sync_with_stdio(false);
  	cin.tie(0);
  	int n;
  	cin>>n;
	for(int i=1;i<=n;i++)
	{
		cin>>s;
		int l=strlen(s);
		int a=0,b=0;
		for(int j=0;j<l;j++)
		{
			if(s[j]=='(')a++;
			else
			{
				if(a)a--;
				else b++;
			}
		}
		//这里a的意思是需要在这个字符串后面补多少右括号，b是需要在其前面补多少左括号 
	 	//当a>b时，说明做左括号比右括号多，肯定优先放前面。显然，此时b越小在前面越优，因为需要在前面补左括号的个数就少了 
		//a<b时同理
	//	cout<<a<<" "<<b<<endl;
		if(a>=b)va.pb(na{a,b});
		else vb.pb(nb{a,b});
	} 
	sort(va.begin(),va.end());
	sort(vb.begin(),vb.end());
	bool f=true;
	int sm=0;
	for(int i=0;i<va.size();i++)
	{
		sm-=va[i].y;
		if(sm<0)f=false;//前面的左括号能否满足当前字符串的需要
		sm+=va[i].x;//当前字符串所能提供的左括号
		//肯定是左括号需求量少的在前面 
	}
	for(int i=0;i<vb.size();i++)
	{
		sm-=vb[i].y;
		if(sm<0)f=false;
		sm+=vb[i].x;
		//右边肯定是对称的来考虑，即需求后面右括号少的放在最右边 
	}
	if(sm!=0)f=false;
	if(f)cout<<"Yes"<<endl;
	else cout<<"No"<<endl;
	return 0;
}

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

#define endl "\n"
#define ll long long
#define ld long double
#define ull unsigned long long
#define forn(i, n) for (int i = 0; i < (int)(n); ++i)
#define for1n(i, n) for (int i = 1; i < (int)(n); ++i)
#define forln(i, n) for (long long i = 0; i < (long long)(n); ++i)
#define forl1n(i, n) for (long long i = 1; i < (long long)(n); ++i)

const ld EPS = 1e-9;
#define mod 1000000007
const int N = 1000000;

ll GetMod(ll n, ll z) { // func to get mod for positive num and negitive nums
    return (n % z + z) % z;
}
//          U   R  D  L
int dx[] = {-1, 0, 1, 0, -1, +1, +1, -1}; // dx for the 8 adjacent places in matrix
int dy[] = {0, 1, 0, -1, +1, +1, -1, -1};// dy for the 8 adjacent places in matrix
vector<int> v;
int main() {
//#ifndef ONLINE_JUDGE
//    freopen("../input.txt", "r", stdin);
//    freopen("../output.txt", "w", stdout);
//#endif
    ios_base::sync_with_stdio(false), cin.tie(NULL);
    ll n;cin>>n;
    ll k;cin>>k;

    v.resize(n);
    forn(i,n)cin>>v[i];
    if(n==k)return cout<<1 , 0;
    ll sum = 1;
    ll p1=k-1,p2=2*(k-1);
    int cnt=0;
    for(int i =p1;i<v.size();i++){
        cnt++;
        if(cnt==k){
            cnt=1;
            sum++;
        }
    }
    if(cnt>1)sum++;
    cout<<sum<<endl;




}

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

int main() {
  long double W,H,x,y;
  cin>>W>>H>>x>>y;
  cout<<fixed<<setprecision(6)<<W*H/2<<" ";
  if(W/2==x&&H/2==y){
    cout<<1;
  }
  else{
    cout<<0;
  }
  
}


Measured memory_bytes: 256
import sys
sys.setrecursionlimit(100001)
def input():
    return sys.stdin.readline()[:-1]

def dfs(v):
    ret = True
    for u, d in es[v]:
        if x[u] == None:
            x[u] = x[v] + d
            ret = ret and dfs(u)
        elif x[u] != x[v] + d:
            return False
    return ret

N, M = map(int, input().split())
es = [[] for i in range(N+1)]
for i in range(M):
    L, R, D = map(int, input().split())
    es[L].append((R, D))
    es[R].append((L, -D))
x = [None for i in range(N+1)]
flag = True
for v in range(1, N+1):
    if x[v] == None:
        x[v] = 0
        if dfs(v) == False:
            flag = False
            break
if flag:
    print("Yes")
else:
    print("No")

Measured memory_bytes: 129116
#include <iostream>
#include <vector>
#include <string>
#include <cstring>
#include <algorithm>
#include <sstream>
#include <map>
#include <set>

#define REP(i,k,n) for(int i=k;i<n;i++)
#define rep(i,n) for(int i=0;i<n;i++)
#define INF 1<<30
#define pb push_back
#define mp make_pair

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

int h, w, n;
int dp[1005][1005];

int main() {
	while(cin >> h >> w >> n) {
		if(h == 0 && w == 0 && n == 0) break;

		vector< vector<int> > v(h, vector<int>(w));
		rep(i, h) {
			rep(j, w) {
				cin >> v[i][j];
			}
		}

		memset(dp, 0, sizeof(dp));
		dp[0][0] = n;

		rep(i, h) {
			rep(j, w) {
				int s = dp[i][j] / 2;
				int t = dp[i][j] - s;

				if(v[i][j] % 2 == 1) {
					dp[i][j+1] += t;
					dp[i+1][j] += s;
				} else {
					dp[i+1][j] += t;
					dp[i][j+1] += s;
				}
			}
		}

		int y = 0, x = 0;
		while(y != h && x != w) {
			if(v[y][x] == 1) {
				if(dp[y][x] % 2 == 1) {
					x++;
				} else {
					y++;
				}
			} else {
				if(dp[y][x] % 2 == 1) {
					y++;
				} else {
					x++;
				}
			}
		}

		cout << y + 1 << " " << x + 1 << endl;
		// rep(i, h) {
		// 	rep(j, w) {
		// 		cout << dp[i][j] << " ";
		// 	}
		// 	cout << endl;
		// }
	}

	return 0;
}

Measured memory_bytes: 8976
#include <bits/stdc++.h>                                           
 
//#define int long long
//#pragma GCC optimize("Ofast")
//#pragma comment(linker, "/stack:200000000")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4")
 
 
#define file(s) freopen(s".in","r",stdin); freopen(s".out","w",stdout);
#define forev(i, b, a) for(int i = (b); i >= (a); --i)
#define forn(i, a, b) for(int i = (a); i <= (b); ++i)
#define all(x) x.begin(), x.end()
#define sz(s) (int)s.size()
#define pb push_back
#define ppb pop_back
#define mp make_pair
#define s second
#define f first
 
 
using namespace std;
 
 
typedef pair < long long, long long > pll;    
typedef pair < int, int > pii;
typedef unsigned long long ull;         
typedef vector < pii > vpii;
typedef vector < int > vi;
typedef long double ldb;  
typedef long long ll;  
typedef double db;                             
 
 
const int inf = 1e9, maxn = 4e5 + 148, mod = 1e9 + 7, N = 1e5 + 211;
const int dx[] = {1, -1, 0, 0}, dy[] = {0, 0, 1, -1}, block = 555;
const pii base = mp(1171, 3307), Mod = mp(1e9 + 7, 1e9 + 9);
const db eps = 1e-12, pi = 3.14159265359;
const ll INF = 1e18;


int n, m, h[N], v, u;
bool bad[N];

main () {
	cin >> n >> m;
	for (int i = 1; i <= n; ++i)
		cin >> h[i];

	while (m--) {
		cin >> v >> u;
		if (h[v] <= h[u])
			bad[v] = 1;
		if (h[u] <= h[v])
			bad[u] = 1;
	}

	int ans = 0;
	for (int i = 1; i <= n; ++i)
		if (!bad[i])
			++ans;

	cout << ans << endl;
}





Measured memory_bytes: 4108
#include<iostream>
#include<algorithm>
#include<vector>
#include<string>
using namespace std;
typedef long long lng;
#define FOR(i,a,b) for(int i=(a); i<=(b); ++i)
#define FORD(i,b,a) for(int i=(b); i>=(a); --i)
#define REP(i,n) FOR(i,0,n-1)
#define ALL(a) (a).begin(), (a).end()
#define UNIQUE(a) a.erase(unique(ALL(a)), a.end()) //ATTENTION: <a> must be sorted in advance

lng power(lng b, lng n) {lng sol=1; while(n>0) {if(n&1) {sol=sol*b;} n>>=1; b*= b;} return sol;} //calculate b^n

const int MOD = 1000000007; //10^9+7


/*********** variables ************/
int N, K;
int l[50];
/**********************************/

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    cin >> N >> K;
    REP(i, N) cin >> l[i];

    sort(l, l+N);
    int ans = 0;
    REP(i, K) {
        ans += l[N-1-i];
    }
    cout << ans << endl;
}


Measured memory_bytes: 256
import java.util.Scanner;


public class Main {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		 Scanner in = new Scanner(System.in);

	    String s = "CODEFESTIVAL2016";
        String tmp = in.nextLine();
        
        int ans =0;
        for(int i=0;i<s.length();i++)
        	if(tmp.charAt(i)!=s.charAt(i))
        		ans++;
        
        System.out.print(ans);
	        

	}

}


Measured memory_bytes: 8916
#include<bits/stdc++.h>
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define SZ(x) ((int)x.size())
#define FOR(i,a,b) for (int i=a;i<=b;++i)
#define FORD(i,a,b) for (int i=a;i>=b;--i)
using namespace std;
typedef long long LL;
typedef pair<int,int> pa;
typedef vector<int> vec;
void getint(int &v){
    char ch,fu=0;
    for(ch='*'; (ch<'0'||ch>'9')&&ch!='-'; ch=getchar());
    if(ch=='-') fu=1, ch=getchar();
    for(v=0; ch>='0'&&ch<='9'; ch=getchar()) v=v*10+ch-'0';
    if(fu) v=-v;
}
int n,a[500010],cnt[2][500010],mx1[500010],mx2[500010],ans;
int main(){
	cin>>n;
	FOR(i,1,n) getint(a[i]);
	FOR(i,1,n) ++cnt[i&1][a[i]];
	FOR(j,0,1)
		FOR(i,1,100000)
			if (cnt[j][i]>cnt[j][mx1[j]]){
				mx2[j]=mx1[j];
				mx1[j]=i;
			}
			else if (cnt[j][i]>cnt[j][mx2[j]])
				mx2[j]=i;
	if (mx1[0]!=mx1[1]) ans=max(ans,cnt[0][mx1[0]]+cnt[1][mx1[1]]);
	if (mx1[0]!=mx2[1]) ans=max(ans,cnt[0][mx1[0]]+cnt[1][mx2[1]]);
	if (mx2[0]!=mx1[1]) ans=max(ans,cnt[0][mx2[0]]+cnt[1][mx1[1]]);
	cout<<n-ans<<endl;
	return 0;
}

Measured memory_bytes: 6400
#include <bits/stdc++.h>
using namespace std;
#define debug(x) cout << #x " = " << (x) << '\n';
#define P(x) cout << #x << '\n';    
#define int long long
typedef pair<int, int> pii;
const int mod = 1000000007;


int32_t main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout << fixed << setprecision(9);
	#ifdef LOCAL_DEFINE
		freopen("in.txt", "rt", stdin);
	#endif
	
	
	int h;
	cin >> h;
	int cp = h;
	int cnt = 0;
	while(cp)
	{
		cp /= 2;
		++ cnt;
	}
	int ans = (1LL << cnt) - 1;
	cout << ans << '\n';
	
	return 0;
}






Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
constexpr int INF = numeric_limits<int>::max() / 2;
constexpr long long INFL = numeric_limits<long long>::max() / 2;
constexpr int MOD = 1000000007;


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

    double N,K;
    cin >> N >> K;
    double ans=0;
    rep(i,N){
        double m=1/N;
        double k=1+i;
        while(k<K){
            
            k*=2;
            m/=2;
        }
        ans+=m;
    }

    cout << fixed << setprecision(14);
    cout << ans << endl;



}

Measured memory_bytes: 256
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>

int descending_compare(const void *a, const void *b){
    if (*(int*)a > *(int*)b){
        return -1;
    }else if (*(int*)a == *(int*)b){
        return 0;
    }else{
        return 1;
    }
}

int ascending_compare(const void *a, const void *b){
    if (*(int*)a < *(int*)b){
        return -1;
    }else if (*(int*)a == *(int*)b){
        return 0;
    }else{
        return 1;
    }
}


int lower_bound(int *a, int n, int key){
    int left, mid, right;
    left = 0, right = n;
    mid = (left + right)/2;
    while ((left+1 != mid || mid+1 != right) && mid != left){
        if (key > a[mid]){
            left = mid;
        }else{
            right = mid+1;
        }
        mid = (left + right)/2;
    }
    if (a[left] >= key)return left;
    if (a[mid] >= key)return mid;
    if (a[right] >= key)return right;
    return n;
}

int IsPrime(int num)
{
    if (num < 2) return 0;
    else if (num == 2) return 1;
    else if (num % 2 == 0) return 0; // 偶数はあらかじめ除く

    double sqrtNum = sqrt(num);
    for (int i = 3; i <= sqrtNum; i += 2)
    {
        if (num % i == 0)
        {
            // 素数ではない
            return 0;
        }
    }

    // 素数である
    return 1;
}

int table[100005] = {0};
int table2[100005] = {0};
int l[100005];
int r[100005];

int main(void){
    int q;
    int i, j;
    int cnt = 0;
    scanf("%d", &q);
    for (i = 0; i < q; i++){
        scanf("%d %d", &l[i], &r[i]);
    }
    table[0] = -1;
    table[1] = -1;

    for (i = 2; i < 100005; i++){
        if (table[i] == 0){
            table[i] = 1;
            j = 2;
            while(i*j < 100005){
                table[i*j] = -1;
                j++;
            }
        } 
    }
    for (i = 0; i < 100005; i++){
        if (table[i] == 1 && table[(i+1)/2] == 1){
            table2[i] = 1;
        }
    }

    for (i = 1; i < 100005; i++){
        table2[i] += table2[i-1]; 
    }

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


Measured memory_bytes: 2176
#include<bits/stdc++.h>
#define vll vector<ll>
#define vi vector<int>
#define vpll vector<pair<ll,ll>>
#define pii pair<int,int>
#define REP(i,a) for(int (i)=0; (i)<(a); (i)++)
#define RREP(i,a) for(int (i)=a-1; (i)>=(0); (i)--)
#define REP2(i,a,b) for(int (i)=(a); (i)<(b); (i)++)
#define MOD 1000000007
#define ALL(v) v.begin(), v.end()
#define m0(x) memset(x,0,sizeof(x))
typedef long long ll;

using namespace std;


int main(){
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  ll N, K;
  cin >> N >> K;
  ll ans = 0;
  if(K > N){
      if(K<= 2*N) ans = K-N;
      else ans = N;
  }else{ // N >= K
    ll D = N/K;
    ans = min(N-D*K,(D+1)*K-N);
  }
  cout << ans;
  
  return 0;
}


Measured memory_bytes: 256
#include <stdio.h>

int main(){
    int x, y;
    
    while(scanf("%d %d", &x, &y), x > 0 || y > 0){
        if(x > y){
            printf("%d %d\n", y, x);
        }
        
        else {
            printf("%d %d\n", x, y);
        }
    }
    
    return 0;
}


Measured memory_bytes: 2112
#include <bits/stdc++.h>
#include <ext/pb_ds/detail/standard_policies.hpp>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

#define pb push_back
#define F first
#define S second
#define ll long long
#define ull unsigned long long
#define ld long double
#define endl '\n'
#define TIME 1.0*clock()/CLOCKS_PER_SEC
#define pii pair < int , int >
#define Endl '\n'

#pragma GCC optimize("Ofast")

using namespace std;
using namespace __gnu_pbds;

template <typename T> using ordered_set = tree <T,null_type,less<T>,rb_tree_tag,tree_order_statistics_node_update>;

mt19937 gen(chrono::system_clock::now().time_since_epoch().count());

const int mod = 1e9 + 7;
const int FFTM = 998244353;

const int SX[4] = {0 , 1 , -1 , 0};
const int SY[4] = {1 , 0 , 0 , -1};
const int rx[8] = {1, -1, 0, 0, 1, 1, -1, -1};
const int ry[8] = {0, 0, 1, -1, 1, -1, 1, -1};
const int kx[8] = {1, 1, -1, -1, 2, 2, -2, -2};
const int ky[8] = {2, -2, 2, -2, 1, -1, 1, -1};

typedef cc_hash_table< int, int, hash<int>, equal_to<int>, direct_mask_range_hashing<int>, hash_standard_resize_policy<hash_exponential_size_policy<>, hash_load_check_resize_trigger<true>, true>> ht;

int32_t main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
#ifdef LOCAL
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#else
//    freopen("gotham.in", "r", stdin);
//    freopen("gotham.out", "w", stdout);
#endif
    int n, k;
    cin >> n >> k;
    ll sum = 0;
    vector < ll > a(n);
    for (auto &to : a)cin >> to;
    for (int i = 0;i < k; ++i)sum += a[i];
    for (int i = 0;i + k < n; ++i){
        ll pred = sum;
        sum -= a[i];
        sum += a[i + k];
        if (sum > pred)cout << "Yes" << endl;
        else cout << "No" << endl;
    }
    return 0;
}



Measured memory_bytes: 4816
#include<bits/stdc++.h>
using namespace std;
#define MOD 1000000007
#define BIG 1000000010
#define repi(i,x,n) for(int i=x;i<n;i++)
#define rep(i,n) repi(i,0,n)
#define repn(i,n) for(int i=n;i>=0;i--)
typedef long long int ll;


int main(){
  int h,w,x,y;
  cin>>h>>w>>x>>y;
  if(h%2==1 && w%2==1 && (x+y)%2==1){
   cout<<"No"<<endl;
  }
  else cout<<"Yes"<<endl;

  return 0;
}







Measured memory_bytes: 3100
import java.io.*;
import java.math.BigDecimal;
import java.util.*;

class Main{
    public static void main(String args[])throws IOException{
        try(BufferedReader br = new BufferedReader(new InputStreamReader(System.in))){
          String[] input = br.readLine().split(" ");

          long A = Long.parseLong(input[0]);

          BigDecimal num = new  BigDecimal(input[1]);
          BigDecimal hum = new BigDecimal("100");
          BigDecimal mul = num.multiply(hum);       

          int tmp = mul.intValue();
          long result = 0;
          result = (A * tmp)/100;
          System.out.println(result);
        }

    }
}

Measured memory_bytes: 33200
#include <stdio.h>

int main(void)
{
	int i;
	double a,data[10];

	while(scanf("%lf",&a)!=EOF){
		double sum=0;
		for(i=1,data[0]=a; i<10; ++i)
			if(i%2)
				data[i]=data[i-1]*2;
			else
				data[i]=data[i-1]/3;
		for(i=0; i<10; i++)
			sum+=data[i];
		printf("%.8f\n",sum);
	}

	return 0;
}

Measured memory_bytes: 648
#include <stdio.h>

int main(void)
{
	int H, W;
	int i, j;
	for(; ; ) {
		scanf("%d%d", &H, &W);
		if(H==0 && W==0) break;
		for(i=0; i<H; i++) {
			for(j=0; j<W; j++) {
				printf("#");
			}
		putchar('\n');
		}
	putchar('\n');
	}
	
	return 0;
}


Measured memory_bytes: 576
#include <bits/stdc++.h>
 
using namespace std;
 
#define x first
#define y second
#define mp make_pair
#define pb push_back
 
typedef long long ll;
 
const ll MOD = 1e9+7;
 
int main() {
	ll a, b, k;
	cin >>a>>b>>k;
  	if (k<=a) {
    	cout <<a-k<<" "<<b<<endl;
      	return 0;
    }
  	k -= a;
  	cout <<0<<" "<<max(0LL, b-k)<<endl;
	return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<vector>
#include<string>
#include<cmath>
#include<algorithm>
using namespace std;
#define rep(i,n) for(int i=0;i<n;i++)
int main(){
    int h, w;
    cin >> h >> w;
    vector<string> s(h);
    rep(i, h)cin >> s[i];
    int l[h][w];
    int r[h][w];
    int d[h][w];
    int u[h][w];
    rep(i, h)rep(j, w){
        int x = h-i-1;
        int y = w-j-1;
        if(s[i][j] == '#'){
            l[i][j] = 0;
            u[i][j] = 0;
        }
        else {
            l[i][j] = 1;
            u[i][j] = 1;
            if(j > 0)l[i][j]+=l[i][j-1];
            if(i > 0)u[i][j]+=u[i-1][j];
        }
        if(s[x][y] == '#'){
            r[x][y] = 0;
            d[x][y] = 0;
        }
        else {
            r[x][y] = 1;
            d[x][y] = 1;
            if(y < w-1)r[x][y]+=r[x][y+1];
            if(x < h-1)d[x][y]+=d[x+1][y];
        }
    }
    int ans = 0;
    rep(i, h)rep(j, w){
        int lamp = l[i][j] + r[i][j] + d[i][j] + u[i][j] - 3;
        if(lamp > ans)ans = lamp;
    }
    cout << ans << endl;
}

Measured memory_bytes: 66816
#include <bits/stdc++.h>
#define rep(i, a, b) for(int i = a; i < b; i++)
#define Rep(i, a, b) for(int i = a; i <= b; i++)
#define _GLIBCXX_DEBUG
#define Vl vector<ll>
#define Vs vector<string>
#define Vp vector<pair<ll, ll>>
#define P pair<ll, ll>
#define ll long long
#define ALL(v) (v).begin(),(v).end()
#define endl "\n"
#define chmin(x, y) x = min(x, y)
#define chmax(x, y) x = max(x, y)
#define co(x) cout << x << endl
#define coel cout << endl
#define pb push_back
#define sz(v) ((int)(v).size())
using namespace std;  
const double pi = acos(-1.0);
const ll MOD = 1e9 + 7;
const ll INF = 1LL << 60;




////////////////////////////////////////////////////////

ll dp[20005];

int main() {
    ll H, N; cin >> H >> N;
    Rep(i, 0, 20000) dp[i] = INF;
    dp[0] = 0;
    rep(i, 0, N){
        ll a, b; cin >> a >> b;
        Rep(j, 1, H){
            if(j >= a) chmin(dp[j], dp[j-a]+b);
            else chmin(dp[j], b);
        }
    }
    ll ans = INF;
    Rep(j, H, 20000){
        chmin(ans, dp[j]);
    }
    co(ans);

    return 0;
}


Measured memory_bytes: 384
main :: IO ()
main = do
  [l, r] <- map read . words <$> getLine
  print $ solve l r

solve :: Int -> Int -> Int
solve l r | r - l >= 2019 = 0
solve l r | otherwise =
  minimum [(x * y) `mod` 2019 | x <- [l..r-1], y <- [l+1..r]]

Measured memory_bytes: 1148
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define mp make_pair
#define pb push_back
#define pii pair<int,int>
#define pll pair<ll,ll>
#define x first
#define y second
#define f(i,a,b) for(ll i=a;i<b;i++)
#define rof(i,a,b) for(ll i=a;i>b;i--)
ll mod=1e9+7;

//cf dont use unordered map. use simply map<... , ... > m;

//They are Iterator minus v.begin() krna //lower_bound(v.begin(),v.end(),x)-v.begin()  //upper_bound(v.begin(),v.end(),x)-v.begin()
// lower bound tells greater than or equal to // upper bound tells strictly greater than
//int a[1001][1001] //aise global me hi// ll lcm(ll a, ll b){ return a / __gcd(a, b) * b; }
//memset can initialize to 0 or -1 ONLY //memset(str, 't', sizeof(str)); // string //memset(a, 0, sizeof(a));  //1D array    // memset(a,0,sizeof(a[0][0])*n*n); //2D array
// set.insert(),find() //for(auto it=set.begin();....) cout<<*it;   // sort(v.begin(),v.end(),compare)

void solve()
{

    cout << fixed << setprecision(2);
    int t;cin>>t;
    cout<<2*3.14157*t;
    

}

int main()
{

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

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

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

namespace ConsoleApplication1 {
    class Program {
        static void Main(string[] args) {
            String line;
            while ((line = Console.ReadLine()) != null) {
                string[] strs = line.Split(' ');
                int n = int.Parse(strs[0]);
                int m = int.Parse(strs[1]);
                if (n == 0) { break; }
                List<int> prices = new List<int>();
                prices = Console.ReadLine().Split(' ').Select(int.Parse).ToList();
                prices.Sort();
                //Console.WriteLine(string.Join(",",prices));
                int sum = 0;
                for (int i = 0; i < n; i++) {
                    if ((i + 1) % m == 0) { continue; }
                    sum += prices[n - 1 - i];
                }
                Console.WriteLine(sum);

            }

        }
    }
}

Measured memory_bytes: 6432