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++: #define _CRT_SECURE_NO_WARNINGS
#define _USE_MATH_DEFINES
#include <iostream>
#include <cstdio>
#include <vector>
#include <string>
#include <array>
#include <queue>
#include <deque>
#include <set>
#include <unordered_set>
#include <list>
#include <map>
#include <stack>
#include <utility>
#include <bitset>
#include <complex>
#include <algorithm>
#include <numeric>
#include <cstdlib>
#include <cmath>
#include <cctype>
#include <cstring>
#include <climits>
#include <random>
#include <functional>
#include <sstream>
#include <iomanip>

using namespace std;

#define rep(i, n) for(int i=0; i<(n); ++i)
#define FOR(i, m, n) for(int i=(m); i<(n); ++i)
#define sz(x) ((int)(x).size())
#define all(x) (x).begin(),(x).end()
#define SORT(x) sort((x).begin(),(x).end())
#define REVE(x) reverse((x).begin(),(x).end())
#define mp make_pair
#define pb push_back
#define Cout(x) cout << (x) << endl
#define Cout2(x, y) cout << (x) << " " << (y) << endl
#define dump(x) cout << #x << " = " << (x) << endl;
#define forauto(i, a) for(auto i : a)cout << i << " "; puts("");

typedef long long LL;
typedef vector<int> VI;
typedef vector<LL> VL;
typedef vector<string> VS;
typedef vector<bool> VB;
typedef vector<vector<int>> VVI;
typedef pair<int, int> PII;
typedef pair<double, double> PDD;
typedef complex<double> CD;

int main() {
	while (true) {
		int n; cin >> n;
		if (n == -1)break;

		int mo = 1150 + min(10, max(0, n - 10)) * 125 + min(10, max(0, n - 20)) * 140 + max(0, n - 30) * 160;
		Cout(4280 - mo);
	}
}

C++: #include<iostream>
         
using namespace std;
         
const int p=4280,a[3]={125,140,160};
         
int main(void){
         
int w;
         
while(true){
cin >> w;
if(w==-1)break;
         
int res=1150;
w-=10;       
  
for(int i=0;i<2;i++){
if(w<=0)break;
if(w>9){
w-=10;
res+=10*a[i];
}
}
if(w>0)res+=w*a[2];
cout << p-res << endl;
}
         
return 0;
}

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


int main(){
  int w;
  while(cin >> w && w){
    int sum = 0,pre = 4280;
    if(w >= 10)sum += 1150;
    if(w >= 10 && w <= 20)sum += (w-10)*125;
    else if(w >= 20)sum += 10*125;
    if(w >= 20 && w <= 30)sum += (w-20)*140;
    else if(w >= 30)sum += 10*140;
    if(w >= 30)sum += (w-30)*160;
    cout << pre - sum << endl;
  }
  return 0;
}

C++: #include<iostream>
#include<climits>
#include<math.h>
#include<vector>
#include<algorithm>
#include<cstdio>
#include <string>
#include <complex>
#include <functional>
using namespace std;
typedef pair<int,int> P;
double dat[100][100];
int dp[6][1010];//動的計画法
int prime[1000001];
char str[1010][1010];
vector<pair<int,int> > pc[100001];
int ABS(int a){return max(a,-a);}
int main(){
    int n;
    int a,b,c,ans;
    while(cin>>n){
        if(n==-1) break;
        a=b=c=ans=0;
        if(n>30) a=n-30;
        if(n>20) b=n-20;
        if(n>10) c=n-10;
        if(b>10) b=10;
        if(c>10) c=10;
        ans=1150+c*125+b*140+a*160;
        ans=4280-ans;
        cout<<ans<<endl;
    }
    return 0;
}

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


int main(){
  int w;
  while(true){
    cin >> w;
    if(w == -1)break;
    int sum = 0,pre = 4280;
    if(w >= 10)sum += 1150;
    if(w >= 10 && w <= 20)sum += (w-10)*125;
    else if(w >= 20)sum += 10*125;
    if(w >= 20 && w <= 30)sum += (w-20)*140;
    else if(w >= 30)sum += 10*140;
    if(w >= 30)sum += (w-30)*160;
    cout << pre - sum << endl;
  }
  return 0;
}

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

C++: #include <iostream>

#define VARIABLE(x) cerr << #x << "=" << x << endl
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define REP(i,m,n) for (int i=m;i<(int)(n);i++)

const int INF = 10000000;
using namespace std;
typedef long long  ll;
const int MAX = 10000;

/** Problem0216 : Cutting Down Water Bills **/
int main()
{
	int w;
	
	while (cin>>w, w>=0) {
		int sum=1150;
		if (w>10) {
			w-=10;
		} else {
			w=0;
		}
		
		if (w>0) {
			if (10<w) {
				w-=10;
				sum+=1250;
			} else {
				sum+=w*125;
				w=0;
			}
		}
		
		if (w>0) {
			if (10<w) {
				w-=10;
				sum+=1400;
			} else {
				sum+=w*140;
				w=0;
			}
		}
		
		if (w>0)
			sum+=w*160;
			
		cout << 4280 - sum << endl;
	}
	return 0;
}

C++: #include <iostream>
using namespace std;
int main(){
    int w,sum=0;
    while(true){
        cin >> w;;
        if(w == -1)break;
        sum = 1150;
        if(w > 10){
            sum += 125*(min(10,w-10));
        }
        if(w > 20){
            sum += 140*(min(10,w-20));
        }
        if(w > 30){
            sum += 160*(w-30);
        }
        cout << 4280-sum << endl;
 
    }
 
    return 0;
}

C++: 
#include<stdio.h>
int main(void)
{
	int a,b,s,ss;
	while(1)	{
		scanf("%d",&a);
		if(a==-1)	break;
		if(a<=10){
			s=1150;
		}
		else if(a<=20){
			s=1150+125*(a-10);
		}
		else if(a<=30){
			s=1150+1250+140*(a-20);
		}
		else if(a<=40){
			s=1150+1250+1400+160*(a-30);
		}
		ss=4280-s;
		printf("%d\n",ss);
	}
	return 0;
}

C++: #include <iostream>
//#include <fstream>

using namespace std;

int main()
{
/*
æ 1 iK¿à	 10 m3ÜÅ	 î{¿à 1150 ~
æ 2 iK¿à	 10 m3´ß 20 m3ÜÅ	 1 m3 ½è 125 ~
æ 3 iK¿à	 20 m3´ß 30 m3ÜÅ	1 m3 ½è 140 ~
æ 4 iK¿à	 30 m3´ßª	 1 m3 ½è 160 ~
*/

//	cut here before submit 
//	freopen ("testcase.waterbill", "r", stdin );
	int n, m;

	while (cin >> n && n != -1 ){
		int res = 1150;
		
		if (n > 10 ){
			if (n <= 20){
				m = n - 10;
				res += m*125;
			}else if (n > 20 && n <= 30 ){
				res += 1250;
				m = n - 20;
				res += m*140;
			}else { //if (n > 30 )
				res += 1250;
				res += 1400;
				m = n - 30;
				res += m*160;
			} // end if
		} // end if
		cout << (4280 - res) << endl;
	} // end loop
		
	return 0;
}

C++: #include <cstdio>

int main(){
    int w;

    for(;;){
    int cost=0;
    scanf("%d",&w);
    if(w==-1) break;
    if(w<=10)
    {
        cost=1150;
    }

    if(11<=w&&w<=20)
    {
        cost=1150;
        for(int i=10; i<w; i++)
        cost+=125;
    }

    if(21<=w&&w<=30)
    {
        cost=2400;
        for(int i=20; i<w; i++)
        cost+=140;
    }

    if(w>=31)
    {
            cost=3800;
            for(int i=30; i<w; i++)
        cost+=160;

    }
    printf("%d\n",4280-cost);
    }
}

C++: #include <cstdio>

int w, money;

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

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