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 rep(i,n) for(i = 0;i < n;i++)
using namespace std;

int w;

int main(){
	int i;
	int sum;

	while( cin >> w ){
		sum = 1150;
		if( w == -1 )
			break;
		w -= 10;
		if( w > 0 ){
			sum += 125*w;
			w -= 10;
		}
		if( w > 0 ){
			sum += 15*w;
			w -= 10;
		}
		if( w > 0 ){
			sum += 20*w;
		}
		cout << 4280-sum << endl;
	}
	return 0;
}

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

C++: #include <cstdio>
#include <cstdlib>
#include <cmath>
#include <climits>
#include <cfloat>
#include <map>
#include <utility>
#include <set>
#include <iostream>
#include <memory>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <sstream>
#include <complex>
#include <stack>
#include <queue>
#include <cstring>
using namespace std;
static const double EPS = 1e-5;
typedef long long ll;


int kakaku(int n){
	int value=1150;

	n-=10;
	if(n>0)value+=125*n;
	n-=10;
	if(n>0)value+=15*n;
	n-=10;
	if(n>0)value+=20*n;
	return value;
}

int main(){
	int sui,sen,kon;
	

	sen=4280;
	
	
	while(cin>>sui){
		if(sui==-1)break;
		kon=kakaku(sui);
		cout<<sen-kon<<endl;

	}
	return 0;
}

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;
      
for(int i=0;i<2;i++){
w-=10;
if(w<=0)break;
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<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 <iostream>
using namespace std;
int main()
{
  int a,hoge=0,ans=0;
  while(1){
    cin>>a;
    if(a==-1){
      break;
    }
    if(a<=10){
      hoge=1150;
      ans=4280-hoge;
    }else if(a>10&&a<=20){
      a=a-10;
      hoge=1150+a*125;
      ans=4280-hoge;
    }else if(a>20&&a<=30){
      a=a-20;
      hoge=1150+1250+a*140;
      ans=4280-hoge;
    }else if(a>30){
      a=a-30;
      hoge=1150+1250+1400+a*160;
      ans=4280-hoge;
    }
    cout<<ans<<'\n';
  }
  return 0;
}

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

int main() {

  int c = 4280;
  while(1) {

    int n;
    cin >> n;
    if(n == -1) break;
    
    int b = 1150;
    int flg = 0;
    if(n >= 20) b += 125 * 10;
    else  flg = 125;
    if(n >= 30) b += 140*10;
    else if(flg == 0) flg = 140;
    if(n >= 40) {
      for(int i=0;i<(n-30)/10;i++) b += 160*10;

    }
    for(int i=0;i<n%10;i++) b += flg;
    
    cout <<c- b << endl;


  }

  return 0;

}

C++: #include<iostream>
using namespace std;
int main() {
	int  date, ans[222], an;
	an = 0;
	while (1) {
		cin >> date;
		if (date == -1) {
			goto a;
		}
		an = an + 1;
		ans[an] = 1150;
		date = date - 10;
		if (date <= 0) {
			goto b;
		}
		if (date > 10) {
			ans[an] = ans[an] + 1250;
			date = date - 10;
		}
		else {
			ans[an] = date * 125 + ans[an];
			goto b;
		}
		if (date > 10) {
			ans[an] = ans[an] + 1400;
			date = date - 10;
		}
		else {
			ans[an] = ans[an]+date * 140;
			goto b;
		}
		ans[an] = ans[an]+date * 160;
	b:;
	}
a:;
	for (int i = 1; i <= an; i++) {
		cout << 4280-ans[i] << endl;
	}
}

C++: #include <stdio.h>
#include <vector>
#include <algorithm>
#include <stack>

using namespace std;

int main(){
	int w,sum;

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

		sum = 1150;

		if(w > 10){
			sum += 125*(min(10,w-10));
		}

		if(w > 20){
			sum += 140*(min(10,w-20));
		}

		if(w > 30){
			sum += 160*(w-30);
		}

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

	}

    return 0;
}

C++: #include <bits/stdc++.h>

using namespace std;

#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define REP(i,n) FOR(i,0,n)
#define ALL(v) (v).begin(),(v).end()
#define fi first
#define se second

template<typename A, typename B> inline bool chmax(A &a, B b) { if (a<b) { a=b; return 1; } return 0; }
template<typename A, typename B> inline bool chmin(A &a, B b) { if (a>b) { a=b; return 1; } return 0; }

typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<int, pii> pip;

const ll INF = 1ll<<29;
const ll MOD = 1000000007;
const double EPS  = 1e-10;

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

C++: #include <iostream>

#define VARIABLE(x) cerr << #x << "=" << x << endl
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define REP(i,m,n) for (int i=m;i<(int)(n);i++)

const int INF = 10000000;
using namespace std;
typedef long long  ll;
const int MAX = 10000;

/** Problem0216 : Cutting Down Water Bills **/
int main()
{
	int w;
	
	while (cin>>w, w>=0) {
		int sum=1150;
		if (w>10)
			w-=10;
		
		if (w>0) {
			if (10<w) {
				w-=10;
				sum+=1250;
			} else {
				sum+=w*125;
				w=0;
			}
		}
		
		if (w>0) {
			if (10<w) {
				w-=10;
				sum+=1400;
			} else {
				sum+=w*140;
				w=0;
			}
		}
		
		if (w>0)
			sum+=w*160;
			
		cout << 4280 - sum << endl;
	}
	return 0;
}