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 WaterBill(int w){
	int bill=1150;
	
	if(w>=10 && w<=20)bill += 125*(w-10);
	else if(w>=20 && w<=30)bill += 1250 + 140*(w-20);
	else if(w>=30)bill += 1250 + 1400 + 160*(w-30);
	
	return bill;
}

int main() {
	int w;
	while(cin>>w,w+1){
		cout << 4280 - WaterBill(w) << endl;
	}
	
	return 0;
}

C++: #include<iostream>
using namespace std;
int main()
{
	int a = 4280, b, sum, ans;
	while(true)
	{
		cin >> b;
		if (b == -1) break;
		if (b <= 10)
		{
			sum = 1150;
			ans = a - sum;
			cout << ans << endl;
		}
		if (b > 10 && b <= 20)
		{
			sum = 1150 + (b-10) * 125;
			ans = a - sum;
			cout << ans << endl;
		}
		if (b > 20 && b <= 30)
		{
			sum = 1150 + 1250 + (b - 20) * 140;
			ans = a - sum;
			cout << ans << endl;
		}
		if (b > 30)
		{
			sum = 1150 + 1250 + 1400 + (b - 30) * 160;
			ans = a - sum;
			cout << ans << 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;
}
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 n;
	while (~scanf("%d",&n)){
		int m;
		if (n <= 10) { m = 1150; }
		else if (n <= 20) { m = 1150 + ((n - 10) * 125); }
		else if (n <= 30) { m = 1150 + 1250 + ((n - 20) * 140); }
		else { m = 1150 + 1250 + 1400 + ((n - 30) * 160); }
		cout << 4280-m << 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 argc, char** argv)
{
	int w;
	int fare;

	while( 1 )
	{
		cin >> w;
		if(w==-1) break;
		
		fare = 1150;
		if(w > 10) w -= 10;
		else w = 0;
		
		if(w > 10) fare += 1250, w -= 10;
		else fare += w * 125, w = 0;

		if(w > 10) fare += 1400, w -= 10;
		else fare += w * 140, w = 0;

		fare += w * 160;

		cout << 4280 - fare << endl;		
	}
}

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

int main(){
  int w;
  int ans;

  while(1){
    cin >> w;
    if(w<0)break;
    
    if(w<=10)ans = 1150;
    else if(w<=20)ans = 1150 + 125*(w-10);
    else if(w<=30)ans = 2400 + 140*(w-20);
    else ans = 3800 + 160*(w-30);

    cout << 4280 - ans << endl;
  }
}

C++: #include <vector>
#include <list>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <string>
#define REP(i, n) for(int i = 0;i < n;i++)
#define ll long long
#define INF 114514
using namespace std;




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

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

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

C++: #include <iostream>

using namespace std;

#define INF 1 << 10

int f(int n, int low, int up) {
	return n < low ? 0 : n > up ? up - low : n - low;
}

int main() {
	int w;
	while (cin >> w, w != -1) {
		int price =
			  1150
			+ f(w, 10, 20) * 125
			+ f(w, 20, 30) * 140
			+ f(w, 30, INF) * 160
			;
		cout << (4280 - price) << endl;
	}
}

C++: #include<bits/stdc++.h>
using namespace std;
int w;
int main(){

while( cin >> w && (~w) ){
int res = 1150;
if( w > 10){
res += min(10,w-10) * 125;
}
if(w > 20){
res += min(10,w-20) * 140;
}
if(w > 30){
res += (w-30)*160;
}
cout << 4280-res << endl;
}




}

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

C++: #include <stdio.h>
int main(){
	int w=1,fee=1150;
	while(1){
		scanf("%d",&w);
		if(w==-1) break;
		if(w>=30) fee += (w-30)*160;
		if(w>=20){
			if((w-20)>=10) fee += 10*140;
			else fee += (w-20)*140;
		}
		if(w>=10){
			if((w-10)>=10) fee += 10*125;
			else fee += (w-10)*125;
		}
		printf("%d\n",4280-fee);
		fee=1150;
	}
	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(){
	// 30 20 10 0
	int w, sum = 0;
	cin >> w;
	while (w >= 0){
		if (w >= 30) sum += 1150 + 1250 + 1400 + ((w - 30) * 160);
		else if (w < 30 && w >= 20) sum += 1150 + 1250 + ((w - 20) * 140);
		else if (w < 20 && w >= 10)sum += 1150 + ((w - 10) * 125);
		else sum += 1150;
		cout << 4280-sum << endl;
		sum = 0;

		cin >> w;
	}
	return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;
int main(){
  int n,s,i;
  while(cin>>n,n>-1){
    for(s=0,i=11;i<=n;i++){
      if(i<21)s+=125;
      else if(i>20&&i<31)s+=140;
      else s+=160;
    }
    cout<<3130-s<<endl;
  }
}

C++: #include<bits/stdc++.h>
using namespace std;
int main(){
  while(true){
    int w;
    cin>>w; if(w==-1) break;
    if(w<=10) cout<<4280-(1150)<<"\n";
    w-=10;
    if(w<=10 && w>0) cout<<4280-(1150+w*125)<<"\n";
    w-=10;
    if(w<=10 && w>0) cout<<4280-(1150+10*125+w*140)<<"\n";
    w-=10;
    if(w>=0) cout<<4280-(1150+10*125+10*140+w*160)<<"\n";
  }
      
    

  return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;

int main()
{
    int W;

    while ( cin >> W , W != -1 ) {
        cout << 3130 - (min(10, max(0, W - 10)) * 125 + min(10, max(0, W - 20)) * 140 + max(0, W - 30) * 160) << endl;
    }
    return ( 0 );
}

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