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>
#include <stdio.h>
#include <sstream>
#include <string>
#include <vector>
#include <map>
#include <queue>
#include <algorithm>
#include <set>
#include <math.h>
#include <utility>
#include <stack>
#include <string.h>
#include <complex>
using namespace std;

const int INF = 1<<29;
const double EPS = 1e-8;
typedef vector<int> vec;
typedef pair<int,int> P;
typedef pair<int,P> iP;


int main(){
    while(1){
        int w;
        scanf("%d",&w);
        if(w==-1)break;

        int cost=1150;
        w -= 10;
        if(0<w){
            if(w>10){
                cost += 1250;
            }else{
                cost += w * 125;
            }
        }

        w -= 10;
        if(0<w){
            if(w>10){
                cost += 1400;
            }else{
                cost += w * 140;
            }
        }

        w -= 10;
        if(0<w){
            if(w>10){
                cost += 1600;
            }else{
                cost += w * 160;
            }
        }
        cout << 4280-cost << endl;
    }

    return 0;
}

C++: #include<iostream>

using namespace std;

const int base = 1150; 
const int money = 4280; 

int main() {
	
	int n;
	
	while(cin >> n && n != -1) {
		
		int sum = 0;
		
		if(n <= 10)
			sum = base;
		
		else if(n > 10 && n <= 20)
			sum = sum + (n-10) * 125 + base;
			
		else if( n <= 30)
			sum = sum + 10 * 125 + (n-20) * 140 + base;
		
		else if( n > 30)
			sum = sum + 10 * 125 + 10 * 140 + (n-30) * 160 + base;
			
		cout << money - sum << "\n";
	}


	return 0;
}

C++: #include<bits/stdc++.h>
using namespace std;
int main()
{
    int n;
    while(cin>>n&&n!=-1){
        int sum=3130,num[3]={125,140,160};
        for(int i=0;i<3;i++){
            n-=10;
            if(n>10)sum-=num[i]*10;
            else if(n>0)sum-=num[i]*n;
        }
        cout<<sum<<endl;
    }
}

C++: #include<iostream>
using namespace std;
 
int main(){
int n, bill;
 
while(cin>>n,~n){
bill = 1150;
n-=10;
if(n<0)n=0;
if(n>10){bill += 125*10; n -= 10;}
else{bill += 125*n; n = 0;}
if(n>10){bill += 140*10; n -= 10;}
else{bill += 140*n; n = 0;}
bill += 160*n;
 
cout<<4280bill<<endl;
}
 
return 0;
}

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

int main() {
	int mizu,kane,sa;
	kane=0;
	int n=1;
	while(n){
		
		cin >> mizu;
		
		if(mizu==-1) break;
		if(mizu>10 && mizu<=20){
			mizu=mizu-10;
			kane=1150+mizu*125;
		}else if(mizu>20 && mizu<=30){
			mizu=mizu-20;
			kane=1150+1250+mizu*140;
		}else if(mizu<=10){
			kane=1150;
		}else if(mizu>30){
			mizu=mizu-30;
			kane=1150+1250+1400+(mizu*160);
		}
		n++;
		cout << 4280-kane << endl;
		}
	
	return 0;
}

C++: #include "bits/stdc++.h"
#include<unordered_map>
#include<unordered_set>
#pragma warning(disable:4996)
using namespace std;
using ld = long double;
template<class T>
using Table = vector<vector<T>>;
const ld eps=1e-9;

//// < "D:\D_Download\Visual Studio 2015\Projects\programing_contest_c++\Debug\a.txt"
int main() {
	while (1) {
		int N; cin >> N;
		if (N == -1)break;
		int num;
		if (N <= 10)num = 1150;
		else if (N <= 20)num = 1150 + (N - 10) * 125;
		else if (N <= 30)num = 1150 + 1250 + (N - 20) * 140;
		else num = 1150 + 1250 + 1400 + (N - 30) * 160;
		cout << 4280- num << endl;
	}
	return 0;
}

C++: // Tazoe

#include <iostream>
using namespace std;

int main()
{
	while(true){
		int w;
		cin >> w;

		if(w==-1)
			break;

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

		cout << 4280-bil << '\n';
	}

	return 0;
}

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

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

        int ans = 1150;
        if(10 < w) ans += 125 * min(w - 10, 10);
        if(20 < w) ans += 140 * min(w - 20, 10);
        if(30 < w)  ans += 160 * (w - 30);

        cout << 4280 - ans << 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(0 < w){
      ans -= w*125;
      w -= 10;
    }
     

    if(0 < w){
      ans -= w*140;
      w -= 10;
    }

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

  return 0;
}

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 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=0,ans;
  cin >>n;
  while(n!=-1){
    ans=0;
    if(n>30){
      ans+=(n-30)*160;
      n=30;
    }
    if(n>20){
      ans+=(n-20)*140;
      n=20;
    }
    if(n>10)
      ans+=(n-10)*125;
    cout <<4280-(ans+1150)<<endl;
    cin>> n;
  }
  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(void){
  while(1){
    int all;
    cin >> all;
    if(all == -1) break;
    else{
      if(all < 10){
        all =0;
      }
      if(all >=10 && all < 20){
        all -= 10;
        all *= 125;
      }else if(all >= 20 && all < 30){
        all -= 20;
        all *= 140;
        all +=1250; 
      }else if(all >=30 && all <= 100){
        all -=30;
        all *= 160;
        all += 1250 + 1400;
      }
      all += 1150;
      cout << 4280 - all << endl;
    }
  }
}