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(void)
{
    int a,x,y,v,k;
	scanf("%d",&a);
	while(1){
	    if (a<-1) break;
		k=3130;
		x=4280-125*(a-10)-1150;
		y=4280-140*(a-20)-2400;
		v=4280-160*(a-30)-3800;
		if(a<=10){
			printf("%d\n",k);
		}
		else if(a<=20){
			printf("%d\n",x);
		}
		else if(a<=30){
			printf("%d\n",y);
		}
		else if(30<=a){
			printf("%d\n",v);
		}
	    return 0;
	}
}

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

int main(){
	int w;
	while(cin >> w, w != -1){
		int fee = 1150;
		for(int i=11; i <= 20 && i <= w; i++) fee += 125;
		for(int i=21; i <= 30 && i <= w; i++) fee += 140;
		for(int i=31; i < w; i++) fee += 160;

		cout << 4280 - fee << endl;
	}
}

C++: #include<stdio.h>
int main(void)
{
    int a,x,y,v,k;
	scanf("%d",&a);
	while(1){
	    if (a<=0) break;
		k=3130;
		x=4280-(a-10)*125-1150;
		y=4280-(a-20)*140-2400;
		v=4280-(a-30)*160-3800;
		if(a<=10){
			printf("%d\n",k);
		}
		else if(a<=20){
			printf("%d\n",x);
		}
		else if(a<=30){
			printf("%d\n",y);
		}
		else if(30<=a){
			printf("%d\n",v);
		}
	}
	return 0;
}

C++: #include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <ctime>
#include <cassert>
#include <iostream>
#include <cctype>
#include <sstream>
#include <string>
#include <list>
#include <vector>
#include <queue>
#include <set>
#include <stack>
#include <map>
#include <utility>
#include <numeric>
#include <algorithm>
#include <iterator>
#include <bitset>
#include <complex>
#include <fstream>
#include <iomanip>
using namespace std;
typedef long long ll;
const double EPS = 1e-9;
typedef vector<int> vint;
typedef pair<int, int> pint;
#define rep(i, n) REP(i, 0, n)
#define ALL(v) v.begin(), v.end()
#define MSG(a) cout << #a << " " << a << endl;
#define REP(i, x, n) for(int i = x; i < n; i++)
template<class T> T RoundOff(T a){ return int(a+.5-(a<0)); }
template<class T, class C> void chmax(T& a, C b){ if(a < b) a = b; }
template<class T, class C> void chmin(T& a, C b){ if(b < a) a = b; }
template<class T, class C> pair<T, C> mp(T a, C b){ return make_pair(a, b); }

int main()
{
	int w;
	while(cin >> w && w + 1)
	{
		int dw[] = {125, 140, 160};
		int res = 1150;
		
		w -= 10;
		for(int i = 0; 0 < w--; i++)
			res += dw[min(i / 10, 2)];

		cout << 4280 - res << endl;
	}
}

C++:                                                               
#include<iostream>
#include<string>
#include<cmath>
#include<vector>
#include<stack>
#include<queue>
#include<algorithm>
#include<complex>
using namespace std ;
typedef vector<int> vi ;
typedef vector<vi> vvi ;
typedef vector<string> vs ;
typedef pair<int, int> pii;
typedef long long ll ;

#define loop(i,a,b) for(int i = a ; i < b ; i ++)
#define rep(i,a) loop(i,0,a)
#define all(a) (a).begin(),(a).end()

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

    cout<<4280-sum<<endl;

  }
}

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

// http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0216

int calc(int w) {
	int sum = 1150;
	if (w < 10) return sum;
	sum += min(w - 10, 10) * 125;
	if (w < 20) return sum;
	sum += min(w - 20, 10) * 140;
	if (w < 30) return sum;
	sum += (w - 30) * 160;
	return sum;
}

int main() {
	int w;
	while (cin >> w) {
		if (w == -1) break;
		cout << (4280 - calc(w)) << endl;
	}
	return 0;
}

C++: #include <iostream>

int main(){
	int w;
	while(std::cin >> w, w+1){
		int p = 1150;
		if(w > 30)p += 2650 + (w-30) * 160;
		else if(w > 20)p += 1250 + (w-20) * 140;
		else if(w > 10)p += (w-10) * 125;
		std::cout << 4280 - p << std::endl;
	}
}

C++: #include<stdio.h>
int main(void)
{
	int n,sum,x,m,i;
	while(1){
		sum=1150;
		scanf("%d",&n);
		if(n<0)break;
		m=n;
		if(m>10){
			for(i=0;i<10;i++){
				if(n-10==0)break;
				sum+=125;
				n-=1;
			}
		}
		if(m>20){
			for(i=0;i<10;i++){
				if(n-10==0)break;
				sum+=140;
				n-=1;
			}
		}
		if(m>30){
			m=n;
			for(i=0;i<m-10;i++){
				if(n-10==0)break;
				sum+=160;
				n-=1;
			}
		}
		x=4280-sum;
		printf("%d\n",x);
	}
	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 <stdio.h>
#include <vector>
using namespace std;
int main(){
	int w,sum;
	while(1){
		scanf("%d",&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);
		printf("%d\n",4280-sum);
	}
}

C++: #include<stdio.h>

int main(void)
{
	int n;
	int a,b,c,d;

	scanf("%d",&n);
	
	while(n !=-1) {
		if(n<=10){
			printf("%d\n",4280-1150);
		}
		else if(n<=20){
			printf("%d\n",4280-125*(n-10)-1150);
		}
		else if(n<=30){
			printf("%d\n",4280-1150-140*(n-20)-1250);
		}
		else{
			printf("%d\n",4280-1250-1400-160*(n-30)-1150);
		}
		
		scanf("%d",&n);
	}

	return 0;
}

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

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


int main(){
    int w;
    while( cin >> w, w+1 ){
        int c = 0, t;
        if( w > 10 ){
            t = w/20?10:w-10;
            c += t * 125;
        }
        if( w > 20 ){
            t = w/30?10:w-20;
            c += t * 140; 
        }
        if( w > 30 ){
            c += (w-30)*160;
        }
        cout << 3130 - c << endl;
    }
    return 0;
}

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

int main(){
	int w, c;
	bool f;
	while (cin >> w && w != -1) {
		c = 1150;
		f = false;
		if (w > 30) {
			c += (w - 30) * 160;
			f = true;
		}
		if (w > 20) {
			if (f) {
				c += 1400;
			}
			else {
				c += (w - 20) * 140;
				f = true;
			}
		}
		if (w > 10) {
			if (f) {
				c += 1250;
			}
			else {
				c += (w - 10) * 125;
				f = true;
			}
		}
		cout << 4280 - c << endl;
	}

	return 0;
}

C++: #define _USE_MATH_DEFINES
#include<iostream>
#include<cstdio>
#include<algorithm>
#include<climits>
#include<string>
#include<vector>
#include<list>
#include<map>
#include<set>
#include<cmath>
#include<queue>
#include<cstring>
#include<stack>
#include<functional>
using namespace std;
const int INF = INT_MAX / 2;

typedef long long ll;

int N;
ll d[10], v[10];

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

ll LCM(ll a, ll b)
{
	return a / GCD(a, b) * b;
}

int main(){
	while(cin >> N, N != -1)
	{
		int ans = 1150;
		if(N > 10) ans += min(10, N - 10) * 125;
		if(N > 20) ans += min(10, N - 20) * 140;
		if(N > 30) ans += (N - 30) * 160;
		printf("%d\n", 4280 - ans);
	}
	return 0;
}