Fork me on GitHub

teddy online judge

teddy es un oso de peluche

41. 1979

Limite de tiempo : 1 seg.   Total runs : 171  Aceptados : 46

Shakedown 1979
Cool kids never have the time
On a live wire right up off the street
You and I should meet
— Smashing Pumpkins, 1979

Billy, as well as most of you, was born in the 80's. The 2980's, that is. He likes his decade so much, he wants to know how many years in a given year range correspond to some specific decade.

For instance, if he wanted to know how many 80's years have happened from 1986 through 2082, the answer would be 7: 1986, 1987, 1988, 1989, 2080, 2081, and 2082. Given a closed interval representing years, find out how many years are in a given decade.


The first line of the input consists of a single number, N (1 ≤ N ≤ 50), the number of test cases to follow. Each test case consists of a single line that contains 3 numbers, d (d ∈ {00, 10, 20, 30, 40, 50, 60, 70, 80, 90}), a, and b (1 ≤ ab ≤ 106).


For each test case, you must print a line "Case c: y", c being the consecutive case number, and y being the number of years between a and b (inclusive) that are in the decade given by d.

Sample Input/Output

80 1986 2082
Case 1: 7

Hecho por Alan Gonzalez @_alanboy ; Concepto Luis Hector Chavez @lhchavez ; Infraestructura por Instituto Tecnologico de Celaya

contribuciones de los usuarios bajo la licencia cc-wiki con atribucion requerida