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 <algorithm>
#include <iostream>

using namespace std;

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

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


    return 0;
}

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

int main(void)
{
  int w=0;
  while(1){
    cin >> w;
    if(w == -1) break;
    else{
      if(w >= 10 && w < 20){
        w -=10;
        w *= 125;
      }
      else if(w >= 20 && w < 30){
        w -=20;
        w *= 140;
        w +=1250;
      }
      else if(w >= 30 && w < 40){
        w -=30;
        w *= 160;
        w += 2650;
      }
      else if(w >= 40 && w <= 100){
        w -=40;
        w *= 160;
        w += 4250;
      }
      w+= 1150;
      cout << 4280-w << endl;
    }

  }
}

C++: #include<iostream>
using namespace std;
int w;
main()
{
    while(cin>>w,w>=0)
    {
        int ans=4280-1150;
        w-=10;
        if(w>0)
        {
            if(w<=10)ans-=w*125;
            else ans-=1250;
            w-=10;
        }
        if(w>0)
        {
            if(w<=10)ans-=w*140;
            else ans-=1400;
            w-=10;
        }
        if(w>0)ans-=w*160;
        cout<<ans<<endl;
    }
}

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

int main(){
  int w;
 
  while(1){
    cin >> w;
    if(w == -1) break;
    
    int ans = 3130;
    w -= 10;

    if(10 <= w){
      ans -= 10*125;
      w -= 10;
    }
    else if(0 < w){
      ans -= w*125;
      w = 0;
    }
    else{
      cout << ans << endl;
      continue;
    }

    if(10 <= w){
      ans -= 10*140;
      w -= 10;
    }
    else if(0 < w){
      ans -= w*140;
      w = 0;
    }
    else{
      cout << ans << endl;
      continue;
    }
    
    if(10 <= w){
      ans -= 10*160;
      w -= 10;
    }
    else if(0 < w){
      ans -= w*160;
      w = 0;
    }
    else{
      cout << ans << endl;
      continue;
    } 
  }

  return 0;
}

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

C++: #include <cstdio>
#include <cstdlib>
#include <cmath>
#include <cstring>
#include <climits>
#include <vector>
#include <map>
#include <set>
#include <list>
#include <stack>
#include <queue>
#include <algorithm>
#include <iostream>
#include <string>

#define REP(i,n) for(long long i=0;i<n;++i)
#define REPR(i,n) for(long long i=n;i>=0;--i)
#define REPI(itr,v) for(auto itr=v.begin();itr!=v.end();++itr)
#define REPIR(itr,v) for(auto itr=v.rbegin();itr!=v.rend();++itr)
#define FOR(i,a,b) for(long long i=a;i<b;++i)
#define SORT(v,n) sort(v, v+n)
#define SORTV(v) sort(v.begin(), v.end())
#define ALL(v) v.begin(),v.end()
#define llong long long
#define INF 999999999
#define SUR 1000000007
#define pb push_back
#define pf push_front
#define MP make_pair
#define SV(v) {for(long long sitr=0;sitr<v.size();++sitr){cin>>v[sitr];}}

int dx[] = {0, 0, -1, 1};
int dy[] = {1, -1, 0, 0};

using namespace std;

typedef pair<int,int> pii;

int main(){

  while(true){

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

    int ans = 1150;
    //if(n <= 10) cout << 4280 - 1150 << endl;
    if(n > 10) ans += min(10, n - 10) * 125; 
    if(n > 20) ans += min(10, n - 20) * 140;
    if(n > 30) ans += (n - 30) * 160;
    cout << 4280 - ans << endl;
  }
  return 0;
}

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

C++: #include<stdio.h>
int main()
{
	int n,r;
	while(1){
		scanf("%d",&n);
		if(n==-1){
			break;
		}else if(n<10){
			r=1150;
		}else if(n<20){
			r=1150+125*(n-10);
		}else if(n<30){
			r=2400+140*(n-20);
		}else{
			r=3800+160*(n-30);
		}
		printf("%d\n",4280-r);
	}
	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<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<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 <iostream>
#include <algorithm>
#include <string>
#include <queue>
#include <vector>
#include <map>
#include <cstdio>
#include <cmath>
using namespace std;

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

C++: #include <iostream>
#include <cstring>
using namespace std;
int main()
{
	int w;
	while (cin >> w)
	{
		if (w < 0) break;
		if (w <= 10)		cout << 3130 << endl;
		else if (w <= 20)	cout << 3130 - (w-10) * 125 << endl;
		else if (w <= 30)	cout << 1880 - (w-20) * 140 << endl;
		else if (w <= 40)	cout << 480 - (w-30) * 160 << endl;
	}
}

C++: #include<vector>
#include<list>
#include<algorithm>
#include<iostream>
#include<string>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
using namespace std;
int main(){
  int w,g;
  while(cin>>w&&w!=-1){
    g=3130;
    if(w-w%10==0);
    else if(w-w%10==10)
      g-=w%10*125;
    else if(w-w%10==20){
      g-=1250;
      g-=w%10*140;
    }else{
      g-=2650;
      g-=(w-30)*160;
    }
    cout<<g<<endl;
  }
  return 0;
}