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<string.h>
#include<vector>
#include<list>
#include<stdio.h>
#include<math.h>
#include<iomanip>
#include<map>
#include<stack>
#include<queue>
#define range(i,a,b) for(int i = (a); i < (b); i++)
#define rep(i,b) range(i,0,b)
#define debug(x) cout << "debug " << x << endl;
using namespace std;

int main(){
    int w;
    while(cin >> w, w != -1){
        int bill = 0, ans = 4280;
        if(w < 10){
            bill += 1150;
        }
        else if(w >= 10 && w < 20){
            bill += 1150;
            bill += (125 * (w - 10));
        }
        else if(w >= 20 && w < 30){
            bill += 1150;
            bill += (125 * 10);
            bill += (140 * (w - 20));
        }
        else if(w >= 30){
            bill += 1150;
            bill += (125 * 10);
            bill += (140 * 10);
            bill += (160 * (w - 30));
        }
        cout << ans - bill  << endl;
    }
}

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

int main(){
  int w;
  int kei;
  cin >> w;
  while(w!=-1){
	if(w<=10)
		kei=1150;
	else if(w>10&&w<=20)
		kei=1150+((10-(20-w))*125);
	else if(w>20&&w<=30)
		kei=1150+1250+((10-(30-w))*140);
	else
		kei=1150+1250+1400+((10-(40-w))*160);
	
	cout << 4280-kei << endl;

	cin >> w;
  }

  return 0;
}

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


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

C++: #include<stdio.h>
int main(void)
{
    int a,x,y,v,k;
	scanf("%d",&a);
	while(1){
	    if (a<=0) 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 <stdio.h>

const int o = 4280;

int main()
{
    int w;

    while (scanf("%d", &w), w != -1) {
        int ans = 1150;
        w -= 10;

        if (w > 0) {
            int mul = w >= 10 ? 10 : w;

            ans += mul * 125;
            w -= 10;
        }

        if (w > 0) {
            int mul = w >= 10 ? 10 : w;

            ans += mul * 140;
            w -= 10;
        }

        if (w > 0) {
            int mul = w;

            ans += mul * 160;
        }

        printf("%d\n", o - ans);
    }

    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;
    }
  }
}

C++: #include <iostream>
#include <vector>
#include <algorithm>

using namespace std;

int main(){

	int n;
	int q;
	while(cin>>q&&q!=-1){
		int val=1150;
		if(q>10){
			int m=min(q,20)-10;
			val+=m*125;
		}
		if(q>20){
			int m=min(q,30)-20;
			val+=m*140;
		}
		if(q>30){
			int m=q-30;
			val+=m*160;
		}
		cout<<4280-val<<endl;
	}
	return 0;
}

C++: #define _CRT_SECURE_NO_WARNINGS
#define _USE_MATH_DEFINES
#include <stdio.h>
#include <algorithm>
#include <functional>
#include <cstring>
#include <queue>
#include <stack>
#include <math.h>
#include <iterator>
#include <vector>
#include <string>
#include <set>
#include <math.h>
using namespace std;
int main() {
	while (true) {
		int w;
		scanf("%d", &w);
		if (w == -1) break;
		if (w <= 10) {
			printf("3130\n");
		}
		else if (w <= 20) {
			printf("%d\n", -1150 - (w - 10) * 125 + 4280);
		}
		else if (w <= 30) {
			printf("%d\n", -2400 - (w - 20) * 140 + 4280);
		}
		else {
			printf("%d\n", -3800 - (w - 30) * 160 + 4280);
		}
	}
}

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<stdio.h>

int main(){
	while(1){
		int w;
		scanf("%d",&w);
		if(w==-1)return 0;
		int ans=0;
		if(w<=10)ans=1150;
		else if(w<=20)ans=1150+(w-10)*125;
		else if(w<=30)ans=2400+(w-20)*140;
		else ans=3800+(w-30)*160;
		printf("%d\n",4280-ans);
	}
}

C++: #include<bits/stdc++.h>
#define rep(i,n)for(int i=0;i<n;i++)
using namespace std;

int main() {
	int w;
	while (cin >> w, w != -1) {
		int cost = 3130;
		if (w > 30)cost -= 1250 + 1400 + (w - 30) * 160;
		else if (w > 20)cost -= 1250 + (w - 20) * 140;
		else if (w > 10)cost -= (w - 10) * 125;
		cout << cost << endl;
	}
}

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

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

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

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);

    int w;
    while(cin >> w && w != -1){

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

        cout << lastmonth - ans << endl;
    }

   return 0;
}