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

Python: def fee(w):
    if w>30:
        return (w-30)*160+10*140+10*125+1150
    if w>20:
        return (w-20)*140+10*125+1150
    if w>10:
        return (w-10)*125+1150
    return 1150

prev_m=4280
while True:
    W=int(input())
    if W==-1:
        break
    print(prev_m-fee(W))
    # prev_m=fee(W)

Python: while True :
    w = int(input())
    if w == -1 :
        break
    if w < 10 :
        print(4280-1150)
    elif w < 20 :
        print(4280-(1150+(w-10)*125))
    elif w < 30 :
        print(4280-(1150+10*125+(w-20)*140))
    else :
        print(4280-(1150+10*125+10*140+(w-30)*160))

Python: ans = []
while 1:
    x = int(input())
    if x == -1:
        break
    if x <= 10:
        r = 1150
    elif x <= 20:
        r = 1150 + (x - 10) * 125
    elif x <= 30:
        r = 1150 + 1250 + (x - 20) * 140
    else:
        r = 1150 + 1250 + 1400 + (x - 30) * 160
    ans.append(4280 - r)
print(*ans, sep='\n')

Python: while 1:
    w = int(input())
    if w == -1:
        break

    if w <= 10:
        price = 1150
    elif 10 < w <= 20:
        price = 1150 + (w - 10) * 125
    elif 20 < w <= 30:
        price = 2400 + (w - 20) * 140
    else:
        price = 3800 + (w - 30) * 160

    print(4280 - price)

Python: while 1:
    w = int(input())
    if w < 0: break
    s = 1150
    if w > 10:
        if w <= 20: s+= (w-10)*125
        else: s += 1250
    if w > 20:
        if w <= 30: s += (w-20)*140
        else: s += 1400
    if w > 30: s += (w-30)*160;
    print(4280-s)

Python: # AOJ 0216 Cutting Down Water Bills
# Python3 2018.6.23 bal4u

while 1:
	w = int(input())
	if w < 0: break
	s = 1150
	if w > 10:
		if w <= 20: s+= (w-10)*125
		else: s += 1250
	if w > 20:
		if w <= 30: s += (w-20)*140
		else: s += 1400
	if w > 30: s += (w-30)*160;
	print(4280-s)

Python: while 1:
    w=int(input())
    if w==-1:break
    elif w<=10:
        tm=1150
    elif w<=20:
        tm=1150+125*(w-10)
    elif w<=30:
        tm=2400+140*(w-20)
    else:
        tm=3800+160*(w-30)
    print(4280-tm)

Python: from sys import exit
# A, B, C = [int(n) for n in input().split()]

# a = [int(input()) for _ in range(N)]
# S = str(input())
# L = len(S)
# T = str(input())
# exit()
while(True):
    N = int(input())
    if N < 0:
        exit()
    elif N <= 10:
        temp = 1150
        print(-(temp-4280))
    elif 10 < N <= 20:
        temp = (N - 10) * 125 + 1150
        print(-(temp-4280))
    elif 20 < N <= 30:
        temp = (N - 20) * 140 + 10 * 125 + 1150
        print(-(temp-4280))
    else:
        temp = (N - 30) * 160 + 1400 + 10 * 125 + 1150
        print(-(temp-4280))

Python: def price(n):
  if n <= 10:
    x = 1150
  elif n <= 20:
    x = 1150 + (n - 10) * 125
  elif n <= 30:
    x = 1150 + 1250 + (n - 20) * 140
  else:
    x = 1150 + 1250 + 1400 + (n - 30) * 160
  return 4280 - x

while True:
  n = int(input())
  if n == -1: break
  print(price(n))

Python: def water_charges(w):
    progressive_rate = {
    (float('inf'),30):160,
              (30,20):140,
              (20,10):125,
              (10, 0):0}

    charge = basic_charge = 1150
    for (upper, lower), rate in progressive_rate.items():
        usage = min(w, upper) - lower
        if 0 < usage:
            charge += usage * rate
            
    return charge

import sys
f = sys.stdin

last_water_charges = 4280
while True:
    w = int(f.readline())
    if w == -1:
        break
    print(last_water_charges - water_charges(w))

Python: # -*- coding: utf-8 -*-
"""
Cutting Down Water Bills
http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0216

"""
import sys


def solve(w):
    ans = 1150
    if w > 10:
        ans += 125 * min(10, (w-10))
    if w > 20:
        ans += 140 * min(10, (w-20))
    if w > 30:
        ans += 160 * (w-30)
    return 4280 - ans


def main(args):
    while True:
        w = int(input())
        if w == -1:
            break
        ans = solve(w)
        print(ans)


if __name__ == '__main__':
    main(sys.argv[1:])

Python: def fee(w):
  acc = 1150
  if w <= 10:
    return acc
  w -= 10
  if w <= 10:
    return acc + 125 * w
  acc += 1250
  w -= 10
  if w <= 10:
    return acc + 140 * w
  acc += 1400
  w-= 10
  return acc + 160 * w



while True:
  w = int(input())
  if w == -1:
    break
  print(4280 - fee(w))

Python: while 1 :
    n=int(input())
    if n==-1:
        break
    else:
        if n<=10:
            w=1150
        elif 10<n<=20:
            w=1150+(n-10)*125
        elif 20<n<=30:
            w=2400+(n-20)*140
        else:
            w=3800+(n-30)*160
        print(4280-w)

Python: while True:
    n = int(input())
    if n == -1:
        break

    ans = 0
    if n <= 10:
        ans = 1150
    elif n <= 20:
        ans = 1150 + (n - 10)*125
    elif n <= 30:
        ans = 1150 + 1250 + (n - 20)*140
    else:
        ans = 1150 + 1250 + 1400 + (n - 30)*160

    print(4280 - ans)

Python: while 1:
    n=int(input())
    if n==-1:break
    w=1150
    if n>30:
        w+=(n-30)*160
        n-=n-30
    if n>20:
        w+=(n-20)*140
        n-=n-20
    if n>10:
        w+=(n-10)*125
    print(4280-w)

Python: pre = 4280
v = [0,125,140,160]
while True:
    w = int(input())
    if w == -1:break

    s= 1150

    
    amari = w

    for i in reversed(range(1,4)):
        if amari > i*10:
            spam = amari - i*10
            s += spam * v[i]
            amari = i*10

    print (pre - s)

Python: while True:
    N=int(input())
    if N== -1:
        break
    S=1150
    if N>30:
        S=S+(N-30)*160
        N-=N-30
    if N>20:
        S=S+(N-20)*140
        N-=N-20
    if N>10:
        S=S+(N-10)*125
    print(4280-S)

Python: while(True):
    n = int(input())
    if n == -1: break
    p = 1150
    if   n < 10: print(4280-p)
    elif n < 20: p += 125*(n-10); print(4280-p)
    elif n < 30: p += 125*10; p += 140*(n-20); print(4280-p)
    else: p += 125*10; p += 140*10; p += 160*(n-30); print(4280-p)

Python: # Aizu Problem 0216: Cutting Down Water Bills

import sys, math, os, fractions

# read input:
PYDEV = os.environ.get('PYDEV')
if PYDEV=="True":
    sys.stdin = open("sample-input.txt", "rt")


def water_bill(n):
    if n <= 10:
        return 4280 - 1150
    elif n <= 20:
        return 4280 - (1150 + (n - 10) * 125)
    elif n <= 30:
        return 4280 - (1150 + 1250 + (n - 20) * 140)
    else:
        return 4280 - (1150 + 1250 + 1400 + (n - 30) * 160)

while True:
    n = int(input())
    if n == -1:
        break
    print(water_bill(n))

Python: while 1:
    n = int(input())
    if n == -1:
        break
    fee = 1150
    if n > 30:
        fee += (n - 30) * 160 + 10 * 140 + 10 * 125
    elif n > 20:
        fee += (n - 20) * 140 + 10 * 125
    elif n > 10:
        fee += (n - 10) * 125

    print(4280-fee)

Python: prev = 4280
while True:
    cur = 0
    m = int(input())
    if m < 0:
        break

    if m <= 10:
        cur = 1150
    elif m <= 20:
        cur = 1150 + (m-10)*125
    elif m <= 30:
        cur = 1150 + 1250 + (m-20)* 140
    else:
        cur = 1150 + 1250 + 1400 + (m-30) * 160
    print(prev-cur)
    #prev = cur

Python: while True:
    w = int(input())
    if w==-1: break
    
    if w <= 10:
        mon = 1150
    elif 10 < w <= 20:
        mon = 1150 + (w-10)*125
    elif 20 < w <= 30:
        mon = 1150 + 1250 +(w-20)*140
    else:
        mon = 1150 + 1250 + 1400 +(w-30)*160
    
    print(4280-mon)