Problems
10080 - Even Fun!!!
SUBMIT PROBLEM

Even Fun!!!

Time Limit: 0.5 sec

 

The Problem

We know an even number is an integer number which is divisible by two. Zero is also considered to be an even number. So hope it’s easy for you to find an even number. OK let’s check!!!

 

In this problem, there will be N numbers a[0], a[1], a[2] ... a[N - 1]. Initially all are 0. Here you have to deal with two types of queries:

 

1) Increase the numbers between A and B (inclusive) by 1. This is represented by the command "0 A B" (0 – Increase numbers by 1). 

2) Output total number of even numbers between A and B (inclusive). This is represented by the command "1 A B" (1 – Output total number of even numbers).

 

 

The Input

Input file consist of several test cases. The first line of each test case contains two integers, N and Q. Each of the next Q lines are either of the form "0 A B" or "1 A B" as mentioned above. Input is terminated by EOF.

(0<N<=1000, 0<=A,B<=N-1, 0<=Q<=100)

 

The Output

For each test case print case number in first line in the format “Case X:”, where X is the case number and Output 1 line for each of the queries of the form "1 A B" containing the required answer for the corresponding query.

 

Sample Input

5 4

1 0 4

0 0 2

0 1 4

1 2 4

 

Sample Output

Case 1:

5

1

 

 

 

Inter University Programming Contest - 2016 [BGC Trust University Bangladesh]

Problem Setter: Md. Helal Uddin