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 <algorithm>
#include <string>
#include <vector>
#include <queue>
#include <bitset>
#include <set>
#include <map>
#include <stack>
#include <list>

#define rep(i,n) for(int i=0;i<n;i++)
#define REP(i,b,n) for(int i=b;i<n;i++)
#define SORT(c) sort((c).begin(),(c).end())
#define DESCSORT(c) sort(c.begin(), c.end(), greater<int>())

const float PI = 3.1415926;
static const int INFTY = (1<<30);

using namespace std;

typedef long long ll;
typedef long double ld;

int n;
int KIHON = 1150;
int PLAN2 = 125;
int PLAN3 = 140;
int PLAN4 = 160;
int sen, kon;

int main() {
  sen = 4280;
  while(cin >> n) {
    if(n < 0) break;
    n -= 10;
    kon = KIHON;
    if(n > 0) {
      if(n - 10 >= 0) {
        kon += PLAN2 * 10;
      } else {
        kon += PLAN2 * n;
      }
      n -= 10;
    }
    if(n > 0) {
      if(n - 10 >= 0) {
        kon += PLAN3 * 10;
      } else {
        kon += PLAN3 * n;
      }
      n -= 10;
    }
    if(n > 0) {
      kon += PLAN4 * n;
    }

    cout << sen - kon << endl;
  }
  
  return 0;
}

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

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

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

#define pb push_back
#define in ,
#define rep(i, a, n) for(int i = (a); i < (n); i++)
#define dep(i, a, n) for(int i = (a); i >= (n); i--)
#define mod 1e9+7

__attribute__((constructor))
void initial() {
  cin.tie(0);
  ios::sync_with_stdio(false);
}

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

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

using namespace std;

int main(){
	int water;
	while(cin >> water){
		int ans = 1150;
		if(water == -1) break;
		int i = 10;
		while(water != i){
			if(water < 10) break;
			if(i < 20){
				ans += 125;
				++i;
			}
			else if(i >= 20 && i < 30){
				ans += 140;
				++i;
			}
			else if(i >= 30){
				ans += 160;
				++i;
			}
		}
		cout << 4280 - ans << endl;
 	}
	return 0;
}

C++: main(){int w,s;for(;s=1150,scanf("%d",&w),~w;printf("%d\n",4280-s))w<11?0:w<21?s+=w*125-1250:w<31?s+=140*w-1550:s+=w*160-2150;}

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

int main(){

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

    int ans = 0;

    for(int i=11;i<=n;i++){
      if(i > 30) ans += 160;
      else if(i > 20) ans += 140;
      else ans += 125;
    }

    cout << 4280 - (ans + 1150) << endl;

  }
}

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&&n>0;i++){
            n-=10;
            if(n>10)sum-=num[i]*10;
            else if(n>0)sum-=num[i]*n;
        }
        cout<<sum<<endl;
    }
}

C++: #include <stdio.h>
int main(void)


{
	int w;
	int a,b,c,d,e;
	a=4280;
	b=1150;
	
	scanf("%d",&w);
	while(w>1||w<100)
	{
	if(w<=10)
	{
		c=a-b;
		printf("%d",c);
	}
	else if(w>10||w<20)
	{
		c=w-10;
		d=b+(125*c);
		e=a-d;
		printf("%d",e);
	}
	else if(w>20||w<30)
	{
		c=w-20;
		d=b+(10*125)+(c*140);
		e=a-d;
		printf("%d",e);
	}
	else if(w>30)
	{
		c=w-30;
		d=b+(10*125)+(10*140)+(c*160);
		e=a-d;
		printf("%d",e);
	}
	scanf("%d",&w);
	}
	
	return 0;
}

C++: #include <iostream>
#include <cstdio>
#include <utility>
#include <algorithm>
#include <queue>
#include <stack>
#include <cstring>
#include <cstdlib>
#include <iomanip>
#include <string>
#include <ctype.h>

const int INF =100000000;

using namespace std;

int main(){

  int sa = 4280;

  while(1){


    int w;

    cin >> w;

    if(w == -1){
      break;
    }

    int m=1150;

    if(w > 10){

      m += 125*(min(w-10,10));

      if(w > 20){

	m += 140*(min(w-20,10));

	if(w > 30){

	  m += 160*(w-30);
	}
      }
    }

    cout << sa -m << endl;
  }
}

C++: #include <iostream>
#include <cstdlib>

using namespace std;

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

  return EXIT_SUCCESS;
}

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

int main(){
	int w,r;
	while(1){
	cin >> w;
	if(w<=10)r = 4280-1150;
	else if(10<w<=20)r = 4280 - (1150 + (w-10) * 125);
	else if(20<w<=30)r = 4280 - (1150 + 1250 + (w-20) * 140);
	else if(30<w)r = 4280 - (1150 + 1250 + 1400 + (w-20) * 160);

	else if(w==-1)break;

	cout << r << "\n";
	}

	return 0;
	}

C++: #include <iostream>

using namespace std;

int main(void){

  int w;
  while( cin >> w , 0 <= w ){

    int p = 1150;
    if( 0 <= w && w < 10 ){
      cout << 4280 - p << endl;
    }
    else{
      p = 1150;
      if( 10 <= w ){
	for( int i = 10 ; ( i < w && i < 20 ) ; i++ ){
	  p += 125;
	  //cout << "125" << endl;
	}
	if( 20 <= w ){
	  for( int i = 20 ; ( i < w && i < 30 ) ; i++ ){
	    p += 140;
	    //cout << "140" << endl;
	  }
	}
	if( 30 <= w ){
	  for( int i = 30 ; i < w ; i++ ){
	    p += 160;
	    //cout << "160" << endl;
	  }
	}
      }
      //cout << p << endl;
      cout << 4280 - p << endl;
    }
  }
  return 0;
}

C++: #include<iostream>
using namespace std;
int main()
{
	int a = 4280, b, sum, ans;
	while(true)
	{
		cin >> b;
		if (b == -1) break;
		if (b <= 10)
		{
			sum = 1150;
			ans = a - sum;
			cout << ans << endl;
		}
		if (b > 10 && b <= 20)
		{
			sum = 1150 + (b-10) * 125;
			ans = a - sum;
			cout << ans << endl;
		}
		if (b > 20 && b <= 30)
		{
			sum = 1150 + 1250 + (b - 20) * 140;
			ans = a - sum;
			cout << ans << endl;
		}
		if (b > 30)
		{
			sum = 1150 + 1250 + 1400 + (b - 30) * 160;
			ans = a - sum;
			cout << ans << endl;
		}
	}
}

C++: clude <iostream>
using namespace std;

int main()
{
    int n;
    while(cin >> n && (n >=0))  {
        int sum = 1150;
        if(n > 10 && n <= 20)
            sum += (n - 10) * 125;
        if(n > 20 && n <= 30)
            sum += 10 * 125 + (n - 20) * 140;
        if(n > 30)
            sum += 10 * 125 + 10 * 140 + (n - 30) * 160;
        cout << 4280 - sum << endl; 
    }
}

C++: #include<iostream>
#include<vector>
#include<string>
#include<algorithm>	
#include<cmath>
using namespace std;
int main() {
	int n, a, b = 0;
	for (int h = 0; h < 200; h++) {
		cin >> a;
		if (a == -1) {
			cin >> n; return 0;
		}
		b += 1150;
		if (a > 10) {
			b += min(10, a - 10) * 125;
		}
		if (a > 20) {
			b += min(10, a - 20) * 140;
		}
		if (a > 30) {
			b += (a - 30) * 160;
		}
		cout << 4280 - b << endl;
		b = 0;
	}
	cin >> n;
}