+ All Categories
Home > Education > ICL 2010 Question Paper

ICL 2010 Question Paper

Date post: 22-May-2015
Category:
Upload: mayank-abhishek
View: 831 times
Download: 3 times
Share this document with a friend
Description:
ICL 2010 was conducted during Apogee 2010. The coding contest involved solving output only problems. Use of any programming language was allowed. This is the problem set for the finals.
Popular Tags:
15
[Cover Page] 10101001010101010101010110101010101001010101010101010110101010101001010101010101 01011010101010100101010101010101011010101010100101010101010101011010101010100101 01010101010101101010101010010101010101010101101010101010010101010101010101101010 10101001010101010101010110101010101001010101010101010110101010101001010101010101 01011010101010100101010101010101011010101010100101010101010101011010101010100101 01010101010101101010101010010101010101010101101010101010010101010101010101101010 10101001010101010101010110101010101001010101010101010110101010101001010101010101 01011010101010100101010101010101011010101010100101010101010101011010101010100101 01010101010101101010101010010101010101010101101010101010010101010101010101101010 10101001010101010101010110101010101001010101010101010110101010101001010101010101
Transcript
Page 1: ICL 2010 Question Paper

[Cover Page]

10101001010101010101010110101010101001010101010101010110101010101001010101010101 01011010101010100101010101010101011010101010100101010101010101011010101010100101 01010101010101101010101010010101010101010101101010101010010101010101010101101010 10101001010101010101010110101010101001010101010101010110101010101001010101010101 01011010101010100101010101010101011010101010100101010101010101011010101010100101 01010101010101101010101010010101010101010101101010101010010101010101010101101010 10101001010101010101010110101010101001010101010101010110101010101001010101010101 01011010101010100101010101010101011010101010100101010101010101011010101010100101 01010101010101101010101010010101010101010101101010101010010101010101010101101010 10101001010101010101010110101010101001010101010101010110101010101001010101010101

Page 2: ICL 2010 Question Paper

[Problem List]

Contest Time

3 hours

# Problem Description Name Credits

1 Love The Simplicity straight [40]

2 Magical Duels duel 40

3 Sword of Exandira sword 50

4 Cookies Again wonder 80

5 The War sight [120]

6 The War Continues energy [120]

# Total 450

Page 3: ICL 2010 Question Paper

[Instructions]

Instructions

1. There are six questions in this question set. For each question download the input files. Write your program in any language of your choice and submit the output files. See ‘Submission Formalities’ at the end for instructions on how to submit the output files.

2. The total credits possible in this paper are 450.

3. There are credits allocated per problem for solving it completely.

4. Complete credits for some problems can only be scored if the solution is submitted within the specified time period. So, be careful in choosing which questions to solve first.

5. These problems have their credits enclosed within square brackets.

6. Each question has a problem statement, input format, output format and problem details.

7. Please follow the given output format strictly. An automatic evaluator will verify your output files. It will treat incorrect format as wrong output. See submission formalities at the end.

8. Each question has 10 input files each.

9. #

Any general clarification will also be posted on the contest page.

Page 4: ICL 2010 Question Paper

[Problem #1]

[40] Credits

Partly based on the problem Architect v/s Mason, INOI Training Camp 2006 Day 1

Love The Simplicity

Problem Statement: Poorva gifted her 2 x N dollhouse and the unlimited supply of 2 x 1 decorative tiles to Agney’s daughter Pyra. Pyra shares with Poorva her fascination for the simplicity of vertical tiles and her detestation of big numbers. Pyra is very interested in knowing the number of vertical tiles in all possible arrangements of the 2 x N dollhouse. For example if N is 3 then there are 3 possible ways of tiling the room, they are shown below. There are a total of 5 vertical tiles in the 3 possible tiling arrangements. Help Pyra by finding the total number vertical tiles in all possible tiling arrangements of the 2 x N dollhouse. Since the number of vertical tiles can very easily grow into very large numbers (and both Poorva and Pyra hate big numbers), report only the last 4 digits of the answer to keep Pyra happy.

Input Format: The input file contains a single integer N.

Output Format: Output file should contain a single integer K. Where, K is the last 4 digits of the total number of vertical tiles across all tilings of the 2 x N dollhouse.

Problem Details:

Problem name: straight

N ≤ 6

Each input file carries 0.5 credits 5 more credits will be awarded, only if all 10 input files are solved correctly 30 more credits will be awarded, only if a completely correct solution is

submitted within 1 hour of start of the contest

Page 5: ICL 2010 Question Paper

[Problem #1]

[40] Credits

Partly based on the problem Architect v/s Mason, INOI Training Camp 2006 Day 1

Sample Input #1:

3

Sample Input #2:

5

Sample Output #1:

5

Sample Output #2:

20

Page 6: ICL 2010 Question Paper

[Problem #2]

40 Credits

Based on an unsolved conjecture in mathematics called The Collatz Conjecture

Magical Duels

Problem Statement: Poorva and Dakshiney participate in a magical duel. In the duel each participant is given a numerical rating. The participant with a higher rating wins the duel. In the duel Poorva uses a special charm. The charm when used, would reduce the Dakshiney’s rating to half its value if his rating is even, but if his rating is odd then it would be increased to a value one more than three times its original value. This charm will keep on working on Dakshiney until his rating reduces to 1. His rating will eventually reduce to 1, no matter what its initial value was. For example if Dakshiney’s rating was 5 before Poorva used the charm, then it will reduce to 1 by following this sequence 5, 16, 8, 4, 2 and 1. Thus, reducing to 1 in 5 steps. Unfortunately, Poorva can use the charm only for a limited number of steps. So, Poorva would like to know the number of steps the charm would take to work i.e. reduce Dakshiney’s rating to .

Input Format: The input file contains a single integer N.

Output Format: Output file should contain a single integer K. Where, K is the number of steps the charm takes to reduce Dakshiney’s rating to .

Problem Details:

Problem name: duel N ≤ Each input file carries 0.5 credits 35 more credits will be awarded, only if all 10 input files are solved correctly

Sample Input:

5

Sample Output:

5

Page 7: ICL 2010 Question Paper

[Problem #3]

50 Credits

Sword of Exandira

Problem Statement: Poorva’s teacher has a very antique sword called the ‘Sword of Exandira’. Poorva is very intrigued by this sword. But her teacher keeps it locked inside an M x N box. The box is in the form of an M x N grid. The Sword occupies one or more cells in this grid either vertically or horizontally. For example in this 4 x 4 grid the sword occupies 3 cells. . . . . . . . . . # # # . . . . Poorva asked for help form her friend Neyritya who can sense the sword from outside the box. Poorva can give coordinates of the top left and bottom right corners of any rectangular within the box and Neyritya would inform her if any part of the sword is present in that area. The top left is (1, 1) and the bottom right is (M, N). In the given example the query 1 1 2 4 would lead to ‘No’. 1 1 4 3 to ‘Yes’ and 4 1 4 4 to ‘No’. The queries are in the form of 4 space separated integers. The first two identify the top left and last two the bottom right corner of the area to be scanned by Neyritya. Find the exact length of the sword for Poorva.

Input Format: The input is provided in the form of an interactive executable file.

Output Format: Output file should contain a single integer K. Where, K is the length of the Sword of Exandira.

Problem Details:

Problem name: sword ≤ M, N ≤ There are 10 boxes to solve Each box carries 5 credits

Page 8: ICL 2010 Question Paper

[Problem #3]

50 Credits

Input/Output:

You have to interact with an ‘Executable file’ in this problem. Please see the

instructions attached with the input file/executable of this problem.

Page 9: ICL 2010 Question Paper

[Problem #4]

80 Credits

Based on the problem Cow Pie Treasures by Rob Kolstad, USACO

Cookies Again

Problem Statement: Poorva is playing with her friends on a wonerful playground of size M x N. The playground is in the form of an M x N matrix with each block of size 1 x 1. Each block of playground contains a certain number of cookies. A sample model is shown below. 6 5 3 7 9 2 7 2 4 3 5 6 8 6 4 9 9 9 1 5 8

This is a 3 x 7 playground. Poorva is at 1, 1. She has to reach M, N moving one column closer to the endpoint with each move. As she moves to a new column she can change her row to the one above it or the one below it. She cannot move off the playground. At the end of the game Poorva will get all the cookies from the points on the path she took. Since, Poorva loves cookies she would always take the path giving her the maximum benefit. For example in the given map the best she can do is take the path marked in red to get a maximum of 50 cookies. 6 5 3 7 9 2 7 2 4 3 5 6 8 6 4 9 9 9 1 5 8

Given the map find the number of cookies won by Poorva.

Input Format: The first line of the input file contains two space separated integers M and N specifying the dimensions of the playground. The next M lines contain N space separated integers. Each describing the number of cookies at the grid point i, j.

Output Format: Output file should contain a single integer K. Where, K is the maximum number of cookies which can be won by Poorva.

Problem Details:

Problem name: wonder ≤ M, N ≤ 100 Each input file carries 5 credits 30 more credits will be awarded, only if all 10 input files are solved correctly

Page 10: ICL 2010 Question Paper

[Problem #4]

80 Credits

Based on the problem Cow Pie Treasures by Rob Kolstad, USACO

Sample Input:

3 7

6 5 3 7 9 2 7

2 4 3 5 6 8 6

4 9 9 9 1 5 8

Sample Output:

50

Page 11: ICL 2010 Question Paper

[Problem #5]

[120] Credits

Partly based on the problem Rectangle, INOI Training Camp 2007 Day 8

The War

Problem Statement: The magical community is at war. Poorva with her friend Naina has the duty to spy and capture the enemy camp. The enemy camp has many randomly erected rectangular tents of varying heights throughout their area. Their camp is represented in the form of an R x C grid with N tents. Tents may overlap. The tents are represented by five integers x1, y1, x2, y2 and h. Here x1 and y1 represent the x and y coordinates of the top left corner of the tent and x2 and y2 are the coordinates of the bottom right corner of the tent, h is the height of the tent. Assume Cartesian Coordinate system for x1, y1, x2 and y2, h is vertical. Naina and Poorva are at 0, 0. Their heights are insignificant with respect to the tents. Now Poorva has the ability to shoot arrows through K tents. The leader of the enemy camp knows that Poorva and Naina are standing at 0, 0 and has hidden at a position which puts the maximum number of tents between him and Poorva. If Poorva shoots the leader she captures the camp. Given the description of the camp find if the pair will be able to capture the enemy camp or not.

Input Format: The first line of the input file contains two space separated integers N and K. N is the number of tents. K is the number of tents through which Poorva can shoot arrows. The next N lines describe the tents. Each of the next N lines contains five space separated integers, x1, y1, x2, y2 and h.

Output Format: Output file should contain either YES or NO depending on whether the pair will be able to capture the enemy camp or not.

Page 12: ICL 2010 Question Paper

[Problem #5]

[120] Credits

Partly based on the problem Rectangle, INOI Training Camp 2007 Day 8

Problem Details:

Problem name: sight N ≤ 100000 K ≤ 50000 For each correctly solved input file you will get 5 credits For each incorrectly solved input file, 10 credits will be deducted from your

score If you do not solve a test case, its credit would be 0 The minimum score you can get for this question is 0 10 more credits will be awarded, only if all 10 input files are solved correctly 60 more credits will be awarded, only if a completely correct solution is

submitted within 1 hour of the start of the contest

Sample Input:

4 8

1 6 3 4 8

2 7 3 4 6

2 5 5 2 7

6 2 8 1 8

Sample Output:

YES

Page 13: ICL 2010 Question Paper

[Problem #6]

[120] Credits

Based on the problem Counting Squares, INOI Training Camp 2006 Day 10

The War Continues

Problem Statement: The warriors of the Magical Clan are scattered throughout the battle field. The battle field is the positive quadrant. Each warrior is represented by a pair of coordinates x, y. Now Poorva does an energizer charm on her warrior friends. If there are any four friendly warriors who form a square then their energy is doubled. A warrior can be a part of more than one such distinct square. Find the total number of quadruples of warriors this charm benefits.

Input Format: The first line of the input file contains a single integer N, the number of friendly warriors. The next N lines contain the coordinates of the N warriors.

Output Format: Output file should contain a single integer K. Where, K is the number of quadruples of warriors the charm benefits

Problem Details:

Problem name: energy ≤ N ≤ 000 Each input file carries 5 credits 10 more credits will be awarded, only if all 10 input files are solved correctly 60 more credits will be awarded, only if a completely correct solution is

submitted within 1 hour of start of the contest

Page 14: ICL 2010 Question Paper

[Problem #6]

[120] Credits

Based on the problem Counting Squares, INOI Training Camp 2006 Day 10

Explanation of the Sample Input/Output:

There are three quadruples as given below, (6,5) (2,7) (0,3) (4,1) (0,3) (2,3) (2,5) (0,5) (2,3) (2,7) (6,7) (6,3)

Sample Input:

11

6 3

0 3

2 3

6 5

0 5

2 5

4 1

2 7

3 4

6 7

7 5

Sample Output:

3

Page 15: ICL 2010 Question Paper

[Submission Formalities]

Submission Formalities

For submitting make a directory with the problem name For example for Problem #1 make a directory with name straight For each input file .in, .in ….. 9.in produce the respective output files .out,

.out….. 9.out Zip the directory straight Upload the zip file In short, your submission for problem name straight should be a zip file

containing a directory named straight this directory should contain the output files 0.out, 1.out ….. 9.out


Recommended