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 <iostream>

using namespace std;

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

int main()
{
	solve();
	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 {
			s=1150+1250+1400+160*(a-30);
		}
		ss=4280-s;
		printf("%d\n",ss);
	}
	return 0;
}

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

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

int main() {
	int w,i;
	int sum;
	while(1){
		cin>>w;
		sum=1150;
		if(w==-1) break;
		if(w>30) {
			sum+=(w-30)*160;
			w=30;
		}
		if(w>=20){
			sum+=(w-20)*140;
			w=20;
		}
		if(w>=10){
			sum+=(w-10)*125;
		}
		sum=4280-sum;
		cout<<sum<<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>
using namespace std;

int main(){
  int w;
 
  while(1){
    cin >> w;
    if(w == -1) break;
    
    int ans = 3130;
    w -= 10;

    if(10 <= w){
      ans -= 10*125;
      w -= 10;
    }
    else if(0 < w){
      ans -= w*125;
      w = 0;
    }
    else{
      cout << ans << endl;
      continue;
    }

    if(10 <= w){
      ans -= 10*140;
      w -= 10;
    }
    else if(0 < w){
      ans -= w*140;
      w = 0;
    }
    else{
      cout << ans << endl;
      continue;
    }
    
    if(0 < w){
      ans -= w*160;
    }
    else{
      cout << ans << endl;
      continue;
    } 
    cout << ans << endl;
  }

  return 0;
}

C++: #include <cstdio>
#include <algorithm>
#include <iostream>
using namespace std;
int main(void){
  while(1){
    int w,c=1150;
    cin >> w;
    if(w == -1)break;
    w -= 10;
    c += max(0,min(w,10)) * 125;
    w -= 10;
    c += max(0,min(w,10)) * 140;
    w -= 10;
    c += max(0,w) * 160;
    cout << 4280 - c << endl;
  }
}

C++: #include <iostream>

using namespace std;

const int bf = 4280;

int main()
{
    int inp;

    while (cin >> inp, inp != -1) {
        int now = 0;

        while (inp >= 0) {
            if (inp > 30) {
                now += 160 * (inp - 30);
                inp = 30;
            }
            else if (inp > 20) {
                now += 140 * (inp - 20);
                inp = 20;
            }
            else if (inp > 10) {
                now += 125 * (inp - 10);
                inp = 10;
            }
            else {
                now += 1150;
                inp = -1;
            }
        }
        cout << bf - now << 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 <stdio.h>

int main()
{
	int last = 4280,now;
	int cost;

	scanf("%d",&now);

	while(now >= 0){
		cost = 1150;
		
		while(30 < now){
			cost += 160;
			now--;
		}
		while(20 < now){
			cost += 140;
			now--;
		}
		while(10 < now){
			cost += 125;
			now--;
		}

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

		scanf("%d",&now);
	}


	return 0;
}

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

int main(){
int w,money,flag,i;
    while(1){
        money = 1150;
        cin >> w;
        if(w == -1){
            break;
        }
        if(w <= 10){
            cout << 4280 - money << endl;
        }
        else {
            w -= 10;
            flag = 9;
            for(i=w;i>=1;i--){
                flag++;
                if(flag < 20){
                    money += 125;
                }
                else if(flag < 30){
                    money += 140;
                }
                else if(flag < 40){
                    money += 160;
                }
            }
            cout << 4280 - money << endl;
        }
    }
}

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;

C++: #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 <cstring>
using namespace std;
static const double EPS = 1e-5;
typedef long long ll;


int kakaku(n){
	int value=0;
	value+=1150;
	n-=10;
	if(n>0)value+=125*n;
	n-=10
	if(n>0)value+=15*n;
	n-=10;
	if(n>0)value+=20*n;
	return value;
}

int main(){
	int sui,sen,kon;
	
	cin>>sui;
	if(sui==-1)return ;
	sen=kakaku(sui);
	
	
	while(cin>>sui){
		if(sui==-1)break;
		kon=kakaku(sui);
		cout<<kon-sen<<endl;
		sen=kon;
	}
	return 0;
}

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

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;
    
for(int i=0;i<3;i++){
w-=10;
if(w<0)break;
if(w%10==0)res+=10*a[i];
else res+=w%10*a[i];
}
cout << p-res << endl;
}
    
return 0;
}

C++: // 2010/12/22 Tazoe

#include <iostream>
using namespace std;

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

		int ryokin;
		if(w<=10)
			ryokin = 1150;
		else if(w<=20)
			ryokin = 1150+(w-10)*125;
		else if(w<=30)
			ryokin = 1150+10*125+(w-20)*140;
		else
			ryokin = 1150+10*125+10*140+(w-30)*160;

		cout << 4280-ryokin << endl;
	}

	return 0;
}

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

int main(void){
	int w;
	int t[] = {0,125,140,160};

	while(cin>>w && w != -1){
		int sum = 1150;
		for(int i=10;i<w;i++)
			sum += t[i/10];
		cout<<4280-sum<<endl;
	}

	return 0;
}