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

C++: #include<stdio.h>
int main(void)
{
    int a,x,y,v;
	scanf("%d",&a);
	x=4280-(a-10)*125-1150;
	y=4280-(a-20)*140-2400;
	v=4280-(a-30)*160-3800;
	if(a<=20){
	    printf("%d\n",x);
	}
	else if(a<=30){
	    printf("%d\n",y);
	}
	else if(30<=a){
	    printf("%d\n",v);
	}
	else if(a<=10){
	    printf("%d\n",3130);
	}
	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<bits/stdc++.h>
#define REP(i,n) for(long long i=0;i<n;++i)
#define FOR(i,a,b) for(long long i=a;i<b;++i)
using namespace std;
using point = pair< int,int >;
using ll = long long;

int main(){
    int w, sum;
    while (~scanf("%d", &w)) {
        if (!~w) break;
        sum = 1150;
        if (w > 30) sum += (w - 30) * 160 + 1400 + 1250;
        else if (w > 20) sum += (w - 20) * 140 + 1250;
        else if (w > 10) sum += (w - 10) * 125;

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

    return 0;
}

C++: #include<stdio.h>
int main(void){
	int w;
	while(1){
		int fee=1150;
		scanf("%d",&w);
		if(w==-1)break;
		if(w>10){
			w-=10;
			if(w>10)fee+=125*10;
			else fee+=125*w;
			if(w>10){
				w-=10;
				if(w>10)fee+=140*10;
				else fee+=140*w;
				if(w>10){
					w-=10;
					fee+=160*w;
				}
			}

		}
		printf("%d\n",4280-fee);
	}
	return 0;
}

C++: #include <iostream>
#include <cstdio>
#include <algorithm>
#include <vector>
#include <sstream>
#include <cmath>
#include <queue>

using namespace std;

int main(){
	
	int w;
	
	while(true){
		cin >> w;
		if(w < 0){
			break;
		}
		
		int cost = 0;
		
		if(w <= 10){
			cost = 1150;
		}else if(w <= 20){
			cost = 1150 + 125 * (w - 10);
		}else if(w <= 30){
			cost = 1150 + 125 * 10 + 140 * (w - 20);
		}else{
			cost = 1150 + 125 * 10 + 140 * 10 + 160 * (w - 30);
		}
		
		cout << 4280 - cost << endl;
		
	}
	
	return 0;
}

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

C++: #include<iostream>
#include<cmath>
using namespace std;
int main(){
    
    //変数：使用水量「 useWater 」と水道料金の合計金額「 sumMoney 」置く
    int useWater, sumMoney;
    
    //入力：使用水量「 useWater 」を入力する
    cin >> useWater;
    
    while(1){
        //終了条件：使用水量「 useWater 」が[ -1 ]のとき終了   ♪♪♪♪♪♪♪わぁいヽ(ω・ヽ)(ノ・ω)ﾉ わぁい♪♪♪♪♪♪♪♪♪♪
        if(useWater == -1) break;
        
        //初期値：基本料金は1150円だから
        sumMoney = 1150;
    
        //条件：大きい値から水道料金の計算をする
        if(30 < useWater) sumMoney += (10 * 125) + (10 * 140) + ((useWater - 30) * 160); 
        
        //一応：上の条件を満たしてないことは30以下の数字だよ
        else if(20 < useWater) sumMoney += (10 * 125) + ((useWater - 20) * 140); 
        else if(10 < useWater) sumMoney += ((useWater - 10) * 125);
        
        //出力：先月の水道料金との差を出力する（計算：先月の水道料金[ 4280円 ]　－　今月の水道料金）
        cout << 4280 - sumMoney << endl;
        
        //再入力：使用水量「 useWater 」を入力する
        cin >> useWater;
    
    }
}

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

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){
            cost += w * 160;
        }
        cout << 4280-cost << endl;
    }

    return 0;
}

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

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

C++: #define _USE_MATH_DEFINES
#define INF 10000000
#include <iostream>
#include <sstream>
#include <cmath>
#include <algorithm>
#include <queue>
#include <stack>
#include <limits>
#include <map>
#include <string>
#include <cstring>
#include <set>
#include <deque>
#include <bitset>
#include <list>

using namespace std;

typedef long long ll;
typedef pair <int,int> P;
typedef pair <int,P > PP;

static const double eps = 1e-8;

int main(){
	int w;
	while(~scanf("%d",&w)){
		if(w==-1) break;
		printf("%d\n",4280 - (1150 + (w > 30 ? 125 * 10 + 140 * 10 + 160 * (w-30)
			: w > 20 ? 125 * 10 + 140 * (w-20)
			: w > 10 ? 125 * (w-10)
			: 0)));
	}
}

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

C++: #include<cstdio>
#include<cstring>
#include<iostream>

using namespace std;

int main(){
	
	int moto,sum,a,b;
	
	while(1){
	
		cin >> a;
	
		if(a==-1) break;
		
		sum=1150;
		moto=4280;
		
		for(int i=11;i<=a;i++){
			if(20>=i){
				sum+=125;
			}else if(20<i && 30>=i){
				sum+=140;
			}else sum+=160;
		}
		
		b=moto-sum;
		
		printf("%d\n",b);
		
	}
	
	return 0;
}

C++: #include<iostream>
#include<string>
using namespace std;
int main(){
long n,p;
for(;;){
cin>>n;
if(n==-1)break;
p=1150;n-=10;
if(n>0)p+=125*n;n-=10;
if(n>0)p+=15*n;n-=10;
if(n>0)p+=20*n;
cout<<4280-p<<endl;
}
return 0;
}

C++: // AOJ 0216
#include<iostream>

int w;
const int ps[3] = { 125, 140, 160 };

int main()
{
	while( std::cin >> w, w != -1 )
	{
		int ans = 1150;
	
		for( int i = 0; i != 3; ++i )
		{
			const int border = ( i + 1 ) * 10;
			
			if( w > border )
				ans += ps[i] * std::min( w - border, 10 ); 
		}

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

	return 0;
}