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>
#define rep2(x,from,to) for(int x=(from);(x)<(to);(x)++)
#define rep(x,to) rep2(x,0,to)
using namespace std;

int main(){
	int n;
	while(cin >> n) {
		if(n==-1) break;
		int ret = 3130;
		n -= 10;
		if(n<=0) {
			cout << ret << endl;
			continue;
		}
		ret -= 1250;
		n -= 10;
		if(n<=0) {
			ret -= 125*n;
			cout << ret << endl;
			continue;
		}
		ret -= 1400;
		n -= 10;
		if(n<=0) {
			ret -= 140*n;
			cout << ret << endl;
			continue;
		}
		ret -= 160*n;
		cout << ret << endl;
	}
}

C++: #include<iostream>

using namespace std;

int money(int num){
	int sum = 0;
	if(num > 30){
		sum = (num - 30) * 160 + 3800;
	}else if(num > 20){
		sum = (num - 20) * 140 + 2400;
	}else if(num > 10){
		sum = (num - 10) * 125 + 1150;
	}else{
		sum = 1150;
	}
	return sum;
}

int main(){
	int w;
	int last = 4280,now;
	
	while(cin >> w,w!=-1){
		now = money(w);
		cout << last - now << endl;
	}
	return 0;
}

C++: #include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#define rep(i,n) for(int i=0;i<(int)n;i++)

using namespace std;


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

C++: #include <iostream>
#include <cstdio>
#include <cstdlib>
#include <time.h>
#include <math.h>
#include <vector>
#include <queue>
#include <map>
#include <set>
#include <algorithm>
#include <iterator>
#include <sstream>
#include <string>
#include <bitset>
using namespace std;
#define FOR(I,F,N) for(int I = F; I < (int)(N); I++)
#define rep(i, n) FOR(i, 0, n)
#define FIN(V) cout<<V<<endl
#define pb push_back
#define INF (1 << 30)
typedef pair<int, int> P;
typedef long long ll;
typedef priority_queue<int> pq;
int StrToInt(string);
string IntToStr(int);
int dx[4] = {1, -1, 0, 0};
int dy[4] = {0, 0, 1, -1};

int main(void){
	int n;
	int loger = 4280;
	while(1){
		cin >> n;
		int sum = 1150;
		int b = 125;
		if(n == -1)break;
		n++;
		rep(i, n-11){
			if(i == 10)b = 140;
			if(i == 20)b = 160;
			sum += b;
		}
		cout << loger - sum << endl;;
	}

	return 0;
}



int StrToInt(string s){
	stringstream ss;
	ss << s;
	int val;
	ss >> val;
	return val;
}
string IntToStr(int i){
	stringstream ss;
	ss << i;
	return ss.str();
}

C++: #include <iostream>
#include <cstring>
using namespace std;
int main()
{
	int w;
	while (cin >> w)
	{
		if (w < 0) break;
		if (w <= 10)		cout << 3130 << endl;
		else if (w <= 20)	cout << 3130 - (w-10) * 125 << endl;
		else if (w <= 30)	cout << 1880 - (w-20) * 140 << endl;
		else				cout << 480 - (w-30) * 160 << endl;
	}
}

C++: #include<iostream>
using namespace std;
int main(){
	int ans,w;
	while(cin>>w,w!=-1){
		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 <cstdio>

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 += 125 * 10 + 140 * (n - 20);
		if(30 < n)
			ans += 125 * 10 + 140 * 10 + 160 * (n - 30);

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

C++: #include<iostream>
using namespace std;
int main()
{
  while(true){
    int w;
    int val = 0;
    cin >> w;
    if( w == -1 ) break;
    
    val = 1150;
    int n = 0;
    int vs[] = {125,140,160};
    while(true){
      int t = w - 10*(n+1);
      if( t < 0 ) t = 0;
      if( t > 10 && n <= 1 ) t = 10;
      val += t * vs[n];
      ++n;
      if( n == 3 ) break;
    }
    cout << 4280 - val << 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<cassert>
using namespace std;

int getCost(int w){
    int cost = 0;
    for (int i = 0; i <= w; i++ ){
	if ( 10 < i && i <= 20 ) cost += 125;
	else if ( 20 < i && i <= 30 ) cost += 140;
	else if ( 30 < i ) cost += 160;
    }
    return 1150 + cost;
}

main(){
    int w;
    while(1){
	cin >> w;
	if ( w == -1 ) break;
	assert( 0 <= w && w <= 100);
	cout << 4280 - getCost(w) << endl;
    }
}

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

C++: #include<stdio.h>
int main(void)
{
		int n,t,i,k,j,g,s,r,a,w,z,o;
	while(1)	{
		scanf("%d",&t);
		if(t==-1)	break;
		if(10>t){
			printf("3130\n");
			}
		if(t>10&&t<20){
			n=t-10;
			i=4280-(n*125+1150);
			printf("%d\n",i);
			}
		if(t>20&&t<30){
			k=t-20;
			j=4280-((k*140)+2400);
			printf("%d\n",j);
		}
		if(t>30){
			s=t-30;
			g=4280-((s*160)+3800);
			printf("%d\n",g);
		}	
	}
	return 0;
}

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

int main(){
	int w,r;
	while(1){
	cin >> w;
	if(w==-1)break;
	else if(10<w<=20)r = 4280 - (1150 + (w-10) * 125);
	else if(20<w<=30)r = 4280 - (1150 + 1250 + (w-20) * 140);
	else if(30<w)r = 4280 - (1150 + 1250 + 1400 + (w-30) * 160);

	else if(w<=10)r = 4280 - 1150;

	cout << r << "\n";
	}

	return 0;
	}

C++: #include <bits/stdc++.h>
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define RFOR(i,a,b) for(int i=(b) - 1;i>=(a);i--)
#define REP(i,n) for(int i=0;i<(n);i++)
#define RREP(i,n) for(int i=n-1;i>=0;i--)

#define PB push_back
#define INF INT_MAX/3
#define ALL(a) (a).begin(),(a).end()
#define CLR(a) memset(a,0,sizeof(a))

typedef long long int ll;

using namespace std;

int main(){
    const int m = 4280;
    while(true){
	int n;
	cin >> n;
	if(n==-1) break;
	int a = max(115*n,1150);
	n -= 10;
	if(n>0) a += n * 10;
	n -= 10;
	if(n>0) a += n * 15;
	n -= 10;
	if(n>0) a += n * 20;
	cout << m - a << endl;
    }
    return 0;
}