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;

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

    cout << lastBill - bill << endl;
  }
}

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

int main(){
	int p = 4280,c,n;
	while(1){
		cin >> n;
		if(n == -1) break;
		c = 1150;
		if(n > 10) c += 125 * (n - 10);
		if(n > 20) c += 15 * (n - 20);
		if(n > 30) c += 20 * (n - 30);
		cout << p - c << endl;
	}
	return 0;
}

C++: #include <cmath>
#include <iostream>

using namespace std;

int main() {

	int w, m;

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

	return 0;

}

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

int main(void){
    int x, w;
    while(true){
        cin >> w;
        x = 1150;
        if(w == -1){
            break;
        }
        if(w <= 10){
            x += 0;
        }
        else if(w <= 20){
            x += (w-10)*125;
        }
        else if(w <= 30){
            x += (w-20)*140 + 1250;
        }
        else if(w > 30){
            x += (w-30)*160 + 1250 + 1400;
        }
        cout << 4280 - x << 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<iostream>
using namespace std;
int main(){
	int w;
	while(cin>>w){
		if(w==-1){
		break;
		}else if(w<=10){
		cout<<4280-1150<<endl;
		}else if(w<=20){
		cout<<4280-(1150+(w-10)*1250)<<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 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(void)
{
	int n;
	scanf("%d",&n);
	while(n!=-1){
		if(n<=10){
			printf("%d\n",4280-1150);
		}
		else if(n<=20){
			printf("%d\n",4280-(1150+125*(n-10)));
		}
		else if(n<=30){
			printf("%d\n",4280-(1150+1250+140*(n-20)));
		}
		else {
			printf("%d\n",4280-(1150+1250+1400+160*(n-30)));
		}
		scanf("%d",&n);
	}
	return 0;
}

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-(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<iostream>
using namespace std;

int main(){

  while(1){
    int a;
    scanf("%d",&a);
    if(a==-1) break;
    
    int cost=1150;
    if(a>10) cost+=((a-10>=10)?(10):(a-10))*125;
    if(a>20) cost+=((a-20>=10)?(10):(a-20))*140;
    if(a>30) cost+=(a-30)*160;

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

  return 0;
}

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

int main() {
  int w, last = 4280;

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

C++: #include<iostream>
using namespace std;
int main(){
	int w;
	while(cin>>w){
		if(w==-1){
		break;
		}else if(w<=10){
		cout<<4280-1150<<endl;
		}else if(w<=20){
		cout<<4280-(1150+(w-10)*1250)<<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, last = 4280;

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

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

C++: #include <iostream>
#include <cstdio>
#include <string>
#include <sstream>
#include <algorithm>
#include <math.h>
#include <map>
#include <iomanip>
#include <vector>

using namespace std;





int main()
{
	int w;
	int fee;	//水道料金
	
	while (cin >> w)
	{
		if (w == -1) break;
		fee = 0;
		if (w > 30)
		{
			fee += 160 * (w - 30);
			w = 30;
		}
		if (w > 20)
		{
			fee += 140 * (w - 20);
			w = 20;
		}
		if (w > 10)
		{
			fee += 125 * (w - 10);
			w = 10;
		}
		if (w <= 10)
		{
			fee += 1150;
		}
		cout << 4280 - fee << endl;
	}
	
	return 0;
}

C++: #include <climits>
#include <iostream>
#include <map>
#include <queue>

using namespace std;

vector<int> mc;

int cost(int w)
{
	int c = 0;
	
	if( w <= 10 ) {
		c = 1150;
	} else if( 10 < w && w <= 20 ) {
		c = 1150 + (w - 10)*125;
	} else if( 20 < w && w <= 30 ) {
		c = 1150 + 125*10 + (w - 20)*140;
	} else if( 30 < w ) {
		c = 1150 + 125*10 + 10*140 + (w - 30)*160;
	}

	return c;
}

int main(int argc, char* argv[])
{
	int w;
	
	while(1) {

		cin >> w;

		if( w == -1 ) break;

		mc.push_back(cost(w));

	}

	for( int i = 0; i < mc.size(); i++ ) {

		int c0 = mc[i];

		cout << 4280 - c0 << endl;
		
	}

    return 0;
}

C++: #include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<cassert>
#include<iostream>
#include<sstream>
#include<string>
#include<vector>
#include<queue>
#include<set>
#include<map>
#include<utility>
#include<numeric>
#include<algorithm>
#include<bitset>
#include<complex>

using namespace std;

typedef long long Int;
typedef vector<int> vint;
typedef pair<int,int> pint;
#define mp make_pair

template<class T> void pv(T a, T b) { for (T i = a; i != b; ++i) cout << *i << " "; cout << endl; }
template<class T> void chmin(T &t, T f) { if (t > f) t = f; }
template<class T> void chmax(T &t, T f) { if (t < f) t = f; }
int in() { int x; scanf("%d", &x); return x; }

int main() {
	int w;
	while(w=in(),w!=-1){
		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;
}