Go: package main

import (
	"bufio"
			"os"
	"strconv"
	"fmt"
)

var scanner = bufio.NewScanner(os.Stdin)

const (
	LAST_MONTH = 4280
	BASE = 1150
)

func main() {
	for scanner.Scan() {
		w, _ := strconv.Atoi(scanner.Text())
		if w < 0 {
			break
		}
		s := BASE
		if  10 < w {
			if w <= 20 {
				s+= (w-10)*125
			} else {
				s+= 1250
			}
		}
		if 20 < w {
			if w <= 30 {
				s += (w-20)*140
			} else {
				s += 1400
			}
		}
		if 30 < w {
			s += (w-30)*160
		}
		fmt.Println(LAST_MONTH-s)
	}
}

C++: #include <stdio.h>
int main(){
	int w=1,fee=1150;
	while(w>0){
		scanf("%d",&w);
		if(w>=30) fee += (w-30)*160;
		if(w>=20){
			if((w-20)>=10) fee += 10*140;
			else fee += w*140;
		}
		if(w>=10){
			if((w-10)>=10) fee += 10*125;
			else fee += w*125;
		}
		printf("%d\n",4280-fee);
	}
	return 0;
}

C++: #include <iostream>
using namespace std;
int calc(int w){
	int money=1150;
	if(w>30){
		money+=(w-30)*160+10*140+10*125;
	}else if(w>20){
		money+=(w-20)*140+10*125;
	}else if(w>10){
		money+=(w-10)*125;
	}
	return money;
}
int main(){
	int w;
	while(cin>>w){
		if(w==-1)break;
		cout<<(4280-calc(w))<<"\n";
	}
	return 0;
}

C++: #include<iostream>
using namespace std;
int getCost(int w){
 int cost = 1150; // ?¬¬?????????
 for (int i = 11; i <= w; i++ ){
 if ( i <= 20 ) cost += 125; // ?¬¬?????????
 else if ( 30 < i ) cost += 160; // ?¬¬?????????
 else cost += 140; // ?¬¬?????????
 }
 return cost;
}
int main(){
 for( int w; cin >> w && w >= 0; ) {
 cout << 4280 - getCost(w) << endl;
 }
 return 0;
}

C++: #include <cstdio>
#include <algorithm>
using namespace std;

int main(){
    int n;
    for(;;){
        scanf("%d",&n);
        if(n==-1) break;
        int ret=1150;
        if(n>10) ret+=125*min(n-10,10);
        if(n>20) ret+=140*min(n-20,10);
        if(n>30) ret+=160*(n-30);
        printf("%d\n",4280-ret);
    }
}

C++: #include<iostream>
using namespace std;
int getCost(int w){
 int cost = 1150; // ?¬¬?????????
 for (int i = 11; i <= w; i++ ){
 if ( i <= 20 ) cost += 125; // ?¬¬?????????
 else if ( 30 < i ) cost += 160; // ?¬¬?????????
 else cost += 140; // ?¬¬?????????
 }
 return cost;}
int main(){
 for( int w; cin >> w && w >= 0; ) {
 cout << 4280 - getCost(w) << endl;
 }
 return 0;
}

C++: #include<iostream>
using namespace std;
int getCost(int w){
 int cost = 1150; // ?¬¬?????????
 for (int i = 11; i <= w; i++ ){
 if ( i <= 20 ) cost += 125; // ?¬¬?????????
 else if ( 30 < i ) cost += 160; // ?¬¬?????????
 else cost += 140; // ?¬¬?????????
 }
 return cost;
}
int main(){
 for( int w; cin >> w && w >= 0; ) {
 cout << 4280 - getCost(w) << endl;
 }
 return 0;
}

C++: #include <iostream>
#include <algorithm>
#include <string>
#include <cstdio>
using namespace std;

int main() {
	int t,n,s,f,sum=0;
	
	while(1){
		cin>>t;
		if(t==-1) break;
		if(t>30) sum=1150+1250+1400+(t-30)*160;
		else if(t>20) sum=1150+1250+(t-20)*140;
		else if(t>10) sum=1150+(t-10)*125;
		else if(t<=10) sum=1150;

        cout<<4280-sum<<endl;

		sum=0;
	}
	return 0;
}

C++: #include <iostream>

using namespace std;

int main()
{
	for(int w=0;cin>>w,w!=-1;){
		int p=1150;
		w-=10; p+=max(min(w,10)*125,0);
		w-=10; p+=max(min(w,10)*140,0);
		w-=10; p+=max(w*160,0);
		cout<<4280-p<<endl;
	}
	return 0;
}

C++: #include <cstdio>
#include <cstdlib>
#include <cmath>
#include <algorithm>

int fmin(int x, int y) {
	return x < y ? x : y;
}

int main(void) {
	while(true) {
		int n;
		scanf("%d", &n);
		if(n == -1)
			break;

		int ans = 1150;
		if(10 < n && n <= 20)
			ans += 125 * (n - 10);
		if(20 < n && n <= 30)
			ans += 140 * (n - 20);
		if(30 < n)
			ans += 160 * (n - 30);

		printf("%d\n", 4280 - ans);
	}
	return 0;
}

C++: #include<iostream>
using namespace std;
int getCost(int w){
 int cost = 1150; // ?¬¬?????????
 for (int i = 11; i <= w; i++ ){
 if ( i <= 20 ) cost += 125; // ?¬¬?????????
 else if ( 30 < i ) cost += 160; // ?¬¬?????????
 else cost += 140; // ?¬¬?????????
 }
 return cost;
}
int main(){
 for( int w; cin >> w && w >= 0; ) {
 cout << 4280 - getCost(w) << endl;
 }
 return 0;
}

C++: #include<iostream>
using namespace std;
 
int main(void)
{
  int w=0;
  while(1){
    cin >> w;
    if(w <= -1) break;
    else{
      if(w >= 0 && w < 10){
        w = 0;
      }
      else if(w >= 10 && w < 20){
        w -=10;
        w *= 125;
      }
      else if(w >= 20 && w < 30){
        w -=20;
        w *= 140;
        w +=1250;
      }
      else if(w >= 30 && w < 40){
        w -=30;
        w *= 160;
        w += 2650;
      }
      else if(w >= 40 && w <= 100){
        w -=40;
        w *= 160;
        w += 4250;
      }
      w+= 1150;
      cout << 4280-w << endl;
    }
 
  }
}

C++: #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;

int charge(int n){
    int res = 1150;
    int per[3] = {125, 140, 160};
    int lim[4] = {10, 20, 30, 100};
    for(int i=0; i<3; i++){
        res += per[i] *max(0, (min(lim[i+1], n) -lim[i]));
    }
    return res;
}

int main(){
    int n;
    while(cin >> n, n!=-1){
        cout << 4280 -charge(n) << endl;
    }
    return 0;
}

C++: #include<bits/stdc++.h>
using namespace std;
int main(){

   while(1){
    int n,ans=1150,m;
    cin >> n;
    if(n==-1)break;
    if(n>10){
        m=n-10;
        if(m>=10)m=10;
        ans+=m*125;
        cout << ans << endl;
        m=0;
    }
    if(n>20){
        m=n-20;
        if(m>=10)m=10;
        ans+=m*140;
        cout << ans << endl;
        m=0;
    }
    if(n>30){
        m=n-30;
        ans+=m*160;
        cout << ans << endl;
        m=0;
    }
    ans=4280-ans;
    cout << ans << endl;
   }

return 0;
}

C++: #include <stdio.h>
#include <iostream>

using namespace std;

int main() {

	int mae = 4280;
	int ryoukin;
	int water;

	while (1) {
		cin >> water;
		if (water == -1) {
			break;
		} else {
			if (water < 10) {
				ryoukin = 1150;
			} else {
				water = water - 10;
				if (water < 10) {
					ryoukin = 1150 + 125 * water;
				} else { 
					water = water - 10;
					if (water < 10) {
						ryoukin = 1150 + 125 * 10 + 140 * water;
					} else {
						water = water - 10;
						ryoukin = 1150 + 125 * 10 + 140 * 10 + 160 * water;
					}
				}
			}
		}
		cout << mae - ryoukin << endl;
	}

	return 0;
}

C++: #include<bits/stdc++.h>
using namespace std;
int main(){
  int w,ans;
  while(1){
    cin >> w;if(w==-1)break;
    ans = 1150;
    if(w>30){
      ans+=160*(w-30);
      w = 30;
    }
    if(w>20){
      ans+=140*(w-20);
      w = 20;
    }
    if(w>10){
      ans+=125*(w-10);
    }
    cout << 4280-ans << endl;
  }
}

C++: #include<bits/stdc++.h>
using namespace std;
int main()
{
    int n;
    while(cin>>n&&n!=-1){
        int sum=3130,num[3]={125,140,160};
        for(int i=0,j=n-10;i<3;i++,j-=10){
            if(j>10&&i!=2)sum-=num[i]*10;
            else if(j>0)sum-=num[i]*n;
        }
        cout<<sum<<endl;
    }
}

C++: #include <cstdio>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <ctime>
#include <cassert>
#include <string>
#include <algorithm>
#include <vector>
#include <queue>
#include <stack>
#include <functional>
#include <iostream>
#include <map>
#include <set>
using namespace std;
typedef pair<int,int> P;
typedef pair<int,P> P1;
typedef pair<P,P> P2;
typedef long long ll;
#define pu push
#define pb push_back
#define mp make_pair
#define eps 1e-7
#define INF 1000000000
#define fi first
#define sc second
#define rep(i,x) for(int i=0;i<x;i++)
int main()
{
	while(1)
	{
		int n;
		cin >> n;
		if(n == -1) return 0;
		int v = 0;
		if(n <= 10) v = 1150;
		else if(n <= 20) v = 1150+(n-10)*125;
		else if(n <= 30) v = 2400+(n-20)*140;
		else v = 3800+(n-30)*160;
		cout << 4280-v << endl;
	}
}