Programming contests

ACM ICPC programozó csapatverseny, házi forduló, 2014. október 22.

October 22, 2014 10:05 AM – October 22, 2014 3:05 PM

Odd Sum

Given a range [ab], you are to find the sum of all the odd integers in this range. For example, the sum of all the odd integers in the range [3, 9] is 3 + 5 + 7 + 9 = 24.

Input Specification

There can be several test cases. The first line of the input gives you the number of test cases, T (1 ≤ T ≤ 100). Then T test cases follow. Each test case consists of 2 integers a and b (0 ≤ a ≤ b ≤ 100) in two separate lines.

Output Specification

For each test case, you are to print one line of output – the number of the test case, followed by the sum of the odd integers in the range [ab].

Sample Input

  1. 2
  2. 1
  3. 5
  4. 3
  5. 5
download as text file

Output for Sample Input

  1. Case 1: 9
  2. Case 2: 8
download as text file
University of Debrecen; Faculty of Informatics; v. 03/01/2019