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<sstream>
#include<vector>
#include<set>
#include<map>
#include<queue>
#include<algorithm>
#include<numeric>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<cassert>

#define rep(i,n) for(int i=0;i<n;i++)
#define all(c) (c).begin(),(c).end()
#define mp make_pair
#define pb push_back
#define rp(i,c) rep(i,(c).size())
#define fr(i,c) for(__typeof((c).begin()) i=(c).begin();i!=(c).end();i++)
#define dbg(x) cerr<<#x<<" = "<<(x)<<endl

using namespace std;

typedef long long ll;
typedef vector<int> vi;
typedef pair<int,int> pi;
const int inf=1<<28;
const double INF=1e12,EPS=1e-9;

int w;
int calc()
{
	int ret=1150;
	if(w<=10)return ret;
	ret+=min(10,w-10)*125;
	if(w<=20)return ret;
	ret+=min(10,w-20)*140;
	if(w<=30)return ret;
	ret+=min(10,w-30)*160;
	return ret;
}
int main()
{
	while(scanf("%d",&w),w>=0)printf("%d\n",4280-calc());
	return 0;
}

C++: def water_charges(w):
    progressive_rate = {
    (float('inf'),30):160,
              (30,20):140,
              (20,10):125,
              (10, 0):0}

    charge = basic_charge = 1150
    for (upper, lower), rate in progressive_rate.items():
        usage = min(w, upper) - lower
        if 0 < usage:
            charge += usage * rate
            
    return charge

import sys
f = sys.stdin

last_water_charges = 4280
while True:
    w = int(f.readline())
    if w == -1:
        break
    print(last_water_charges - water_charges(w))

C++: #include<stdio.h>
#define N 10000

int main(void){
  int i,num;
  int w,fee[N];
  for(i=0;;i++){
    scanf("%d",&w);
    if(w==-1)
      break;
    fee[i]=1150;
    if(w-10<=0)
      continue;
    w-=10;
    if(w-10<=0){
      fee[i]+=w*125;
      continue;
    }
    fee[i]+=1250;
    w-=10;
    if(w-10<=0){
      fee[i]+=w*140;
      continue;
    }
    fee[i]+=1400;
    w-=10;
    fee[i]+=w*160;
  }
  num=i;
  for(i=0;i<num;i++){
    printf("%d\n",4280-fee[i]);
  }
  return 0;
}

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

int main(){
    int a;

    while(cin>>a,a!=-1){
        int v=1150;
        if(a>10)v+=min(a-10,10)*125;
        if(a>20)v+=min(a-20,10)*140;
        if(a>30)v+=(a-30)*160;

        cout<<4280-v<<endl;
    }
    return 0;
}

C++: // 2011/02/16 Tazoe

#include <iostream>
using namespace std;

int main()
{
	while(true){
		// üÍ
		int w;						// ¡ÌgpÊ
		cin >> w;
		if(w==-1)
			break;

		// Z
		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;

		// oÍ
		cout << 4280-bil << endl;	// ÇÌ­ç¢ßñÅ«½©
	}

	return 0;
}

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

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

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

int main() {
	while (1) {
		int s = 1150;
		int a;
		cin >> a;
		if (a==-1)break;
		for (int b = 11; b <= a; b++) {
			if (b < 21)s += 125;
			else if (b < 31)s += 140;
			else s += 160;
		}
		cout << 4280-s<<endl;
	}
}

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

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

C++: #include <iostream>
using namespace std;
int main () {
	int n;
	const int pre = 4280;
	while (cin >> n, n != -1) {
		int lv4 = max(0, n - 30);
		int lv3 = min(10, max(0, n - 20));
		int lv2 = min(10, max(0, n - 10));
		int sum = 1150 + lv2 * 125 + lv3 * 140 + lv4 * 160;
		cout << pre - sum << endl;
	}
	return 0;
}

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

int main(){
  int t=4280;
  while(1){
    int n;
    cin>>n;
    if(n==-1){
      break;
    }
    if(n<=10){
      cout<<t-1150<<endl;
    }
    else if(n<=20){
      cout<<t-1150-(n-10)*125<<endl;
    }
    else if(n<=30){
      cout<<t-1150-1250-(n-20)*140<<endl;
    }
    else{
      cout<<t-1150-1250-1400-(n-30)*160<<endl;
    }
  }
}

C++: #include<cstdio>
int main(){
  int n,a,b=4280;
  
  scanf("%d",&n);
  
  while(n != -1){
    a = 1150;
    if(n > 30) a += 2650+160*(n-30);
    else if(n > 20) a += 1250+140*(n-20);
    else if(n > 10) a += 125*(n-10);
    printf("%d\n",b-a);
    scanf("%d",&n);
  }
  return (0);
}

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

int main(){


  int used;
  while(1){
    cin >> used ;
    if(used == -1) break;
    int cost=0;

    if(30 < used){
      cost += 160 * (used-30);
      used = 30;
    }
    if(20 < used){
      cost += 140 * (used-20);
      used = 20;
    }
    if(10 < used ){
      cost += 125 * (used-10);
      used = 10;
    }
    if(used <= 10){
      cost += 1150;
    }


    cout << 4280 - cost << "\n";

  }


}

C++: #include<iostream>
using namespace std;
 
int main(void)
{
  while(1){
    int rate;
    cin >> rate;
    if(rate == -1) break;
    else{
      if(rate==0){
        rate==0;
      }
      else{
        rate-=10;
      }
      while(1){
        if(rate >=0 && rate < 10){
          rate*=125;
          break;
        }else if(rate >= 10 && rate < 20){
          rate-=10;
          rate*=140;
          rate+=1250;
          break;
        }else if(rate >= 20 && rate <= 30){
          rate-=20;
          rate*=160;
          rate+=2650;
          break;
        }
      }
      rate+=1150;
      cout << 4280-rate << endl;
    }
  }
}

C++: #include <iostream>
using namespace std;
int main(void){
    
    int w,a=0;
    for(int i=0;i<200;i++){
        cin>>w;
        a=1150;
        if(w>=10&&w<20){
            cout<<4280-(a+125*(w-10))<<endl;
            }
            else if(w>=20&&w<30){
                cout<<4280-(a+1250+140*(w-20))<<endl;
            }
            else if(w>=30){
                cout<<4280-(a+1250+1400+160*(w-30))<<endl;
            }
            else if(w<10&&w>=0){
                cout<<4280-1150<<endl;
            }
            
            if(w==-1){
            break;
            }
        }
        
        
    

}

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

#define REP(i,b,n) for(int i=b;i<n;i++)
#define rep(i,n) REP(i,0,n)

int past = 4280, w;

int solve() {
  int res = 4280 - 1150;
  
  if (w >= 10 && w < 20) {
    REP(i,10,w) res -= 125;
  }
  else if (w >= 20 && w < 30) {
    res -= 1250;
    REP(i,20,w) res -= 140;
  }
  else if (w >= 30) {
    res -= (1250 + 1400);
    REP(i,30,w) res -= 160;
  }
  return res;
}

int main (int argc, char const* argv[]) {
  while (cin>>w) {
    if (w == -1) break;
    cout<<solve()<<endl;;
  }
  return 0;
}