All posts by admin

Question 1

Question 1

The Nilgiri Tahr

The Nilgiri Tahr is a mountain goat that lives in the Nilgiri hills on the border between Tamil Nadu and Kerala. The tahr lives along steep rock cliffs where grass does not grow easily. The tahr is a very good climber and can balance itself even on the steepest of cliffs. However, since it is a rather short animal, it cannot jump from one rock to another if the difference in height between the rocks is more than one foot.

One such tahr finds itself at the top-left corner of an M x N rectangular grid of rocks. There is a clump’ of grass at the opposite (bottom-right) corner. The tahr would like to find a way from its current position to the grass. The tahr cannot jump over rocks and can move from a given rock to only one of its four neighbours (left, right, up or down). The tahr must of course always stay within the grid. Further, remember that it can jump only one foot up or down, so it can move from a rock to its neighbour only if the difference in height between the two rocks is at most one foot. Your task is to help the tahr find such a path to the

grass, if it exists. If there is more than one valid path for the tahr to follow, it is sufficient to identify anyone path.

For example consider the following grid of rocks, where the number at each position in the grid indicates the height of the rock, in feet, at that position.

7 9 8 5

6 3 2 4

5 4 1 5

2 6 1 1

Here is a path that the tahr can follow to reach the grass. The path follows the rocks labelled by the letters (a), (b), …, (i), in that order.

7 (a) 9 8 5

6 (b) 3 (e) 2 (1) 4

5 (c) 4 (d) 1 (g) 5

2 6 1 (h) 1 (i)

Input format

The first line of input contains two integers M and N, specifying the number of rows and columns in the grid, respectively, where 1 < = M <= 1000 and 1 <= N <= 1000. The next M lines of input contain N positive integers each. The jth integer on the ith line is the height of the rock in the ith row and jth column of the grid. Output format.
. If there is no path for the tahr to reach the grass. print out a single line containing thenumber O.

. If there is a path, the first line of output should be the integer 1. After this, you have

to print out anyone path that the tahr can follow to reach the grass. The path is

1

described by a sequence of lines. Each line should consist of two integers. The integers Xi and Yi printed out on line i indicate that the ith step that the tahr takes should be to row Xi and column Yi.

Since the tahr always travels from the top-left corner to the bottom-right corner of the grid, the first line of the path is always 1 1 and the last line is always M N.

Example

Here is sample input and output corresponding to the example discussed above.

Sample input

4 4

7 9 8 5

6 3 2 4

5 4 1 5

2 6 1 1

Sample output

1

1 1

2 1

3 1

3 2

2 2

2 3

3 3

4 3

4 4

Question 2

The Rajah’s Wrestlers

Once upon a time, there lived a Rajah who was extremely fond of wrestling. In those days, wrestlers had supernatural powers. To win a match a wrestler relied not only on his own strength but also on a magical ring that he wore while fighting. This ring allowed a wrestler to gain additional strength proportional to the strength of his opponent.

The strength of a wrestler and the magical power of his ring are both positive integers. When wrestler A fights wrestler B, the fight index of wrestler A for this match is given by A’s own strength plus the strength of wrestler B multiplied by the magical power of A’s ring. Each match is won by the wrestler whose fight index is higher for that match.

For example, suppose that wrestler A has strength 10 and wears a ring whose magical power is 3 and wrestler B has strength 18 and wears a ring whose magical power is 4. If these two wrestlers fight each other, wrestler A wins. This is because A’s fight index for this match is 10 + (3 x 18) = 64 while B’s fight index for this match is only 18 + (10 x 4) = 58. On the other hand if A faces a wrestler C with strength 15 and a ring whose magical power

is 5, then C wins. In this match, A’s fight index is 10 + (3 x 15) = 55 while C’s fight index is 15 + (5 x 10) = 65. Similarly, in a match between Band C, C wins.

The Rajah organised a wrestling festival once a year. During this festival, each wrestler fought every other wrestler exactly once. At the end of the contest Rajahh honoured all the wrestlers by inviting them to his court and giving them gold coins.

It was the job of the Minister to decide the order in which the wrestlers got to meet the Rajah. This was an important task, because our Rajah was rather eccentric. He had declared that the number of coins to be given to a wrestler was determined by the number of matches he won and his position in the sequence: a wrestler was given one gold coin for each match he won and one gold coin for each wrestler whom he defeated but who was ahead of him in.the line to meet the Rajahh.

For instance if the Minister had presented the wrestlers A, Band C described above in the order A, B, C to the Rajahh, then A would get 1 gold coin (for the match he won against B), B would get 0 gold coins (since he won no matches) and C would get 4 gold coins (two for his wins against A and B, one because he beat A and A met the Rajah before him and one more since he beat Band B met the Rajah before him). Instead if the minister had presented them in the order C, A, B then C would get 2 coins (for his wins against A and

B), A would get 1 coin (for his win against B) and B would get 0 coins. .

The Minister is concerned about the finances of the kingdom. and wants to minimise the number of coins handed out by the Rajah to the wrestlers. Your task is to help the .Minister decide the sequence in which the wrestlers should be presented to the Rajah so that the number of gold coins handed out is minimum. You are provided with the strengths of all the wrestlers and the magical powers of their rings. You may assume that these values are such that no match. results in a tie.

Input format

The first line of input is an integer N indicating the number of wrestlers. Each wrestler is identified by a unique number in the range. {1, 2,. . ., N}. The next N lines each contain 2

positive integers. For 1 < = i <= N, the first integer on line i+1 denotes the strength Si of wrestler i and the second integer denotes the magical power Ri westler i's ring. You may assume that 1 <= n
< =10000 and each wrestler i, 1 <= Si <= 1000 and 1<=Ri<=1000
Output format

The output consists of N lines, indicating the sequence in which the wrestlers should meet the Rajah to mini mise the number of gold coins handed out by the Rajah. Thus, each line of output should be an integer between 1 and N and every integer between 1 and N should appear exactly once in the output. If the integer on line i is j, it means that wrestler j is the ith wrestler to meet the Rajah.

Example

Here is sample input and output corresponding to the example discussed above.

Sample input

3

103

184

155

Sample output

3

2

1

ps if doees not make any sence it is because of ocr

email me and i will email you the jpg’s

mohittaneja@gmail.com

This is a tough one?

Hi

We all know that there was much exitement after google announced that it would provide a gb of free email storage.But,some other company took profit out of this or had already embarked that banner;which was the first company to provide a gb of free email storage?:gmail is still in beta and not available for public.Also its invitations come 2$ and onwards?What is a major flaw rumored to be in gmail?

Intermediate Level Quiz-Senior Level Quiz

Intermediate Level Quiz-Senior Level Quiz

Total=30marks

Exun member(minimum)=

TOUGH LOT!!!(2*4)

1)We all know that Mridul Seth is the youngest child to clear MCSE,what was his age when he cleared it(1),which state does he belong to(1),what was abnormal about him before the age of 4 or below(2).

2)What is YAHOO! LAUNCHCast(2) and Slurp(1)?Who was the CEO of Yahoo till 4months ago(1)?

AHHH…(4*2)

1)What is the Chalta Phirta PCO(1),in which state was it started at the largest scale(1)?

2)What is a keygen(1),differentiate from a password generator?

3)We all know that the recent leak of Microsoft win 2000 was committed by Mainsoft,what was the leak of code(in %)(1):what is the latest version of XP(1)?

4)What is Evermore Integrated Office 2003:what is the difference in the licence agreements b/w microsoft office and this software?

SIMPLE STUFF(7*2)

1)What is fade(1)?Name any company involved in making it(1/2)?Which was the first game to integrate it(1/2)?

2)Differentiate b/w a hacker and cracker?Which did Ankit Fadia do to Chip(now Digit)?

3)At what age did Ankit Fadia write ‘An Unofficial Guide to Ethical Hacking by Ankit Fadia'(1/2),in how many days did he write the book(1/2) and when(1/2)?What does he do now(any 1 point)(1/2)?

4)What is Aperture Grille(1),what is Shadow mask(1)?

5)What is dot pitch(1)?What is NEC(1/2)In a LCD , what is better:smaller pixel size/larger pixel size(1/2)?

6)Who is the CEO of EBAY.com(1)/Amazon.com(1)?

7)What is WiMAX(1)(2points) ,how is it different from other connecting standards(1)(2points)?

Intermediate Level quiz for all Exun Members!!!

INTERMEDIATE LEVEL QUIZ

Total=40marks

Minimum Score by Quizer=22marks or more

Minimum Score By Exunite=10marks or more

ACRONYMS(10marks)

1)MCSE-

2)OCA-

3)FPU-

4)WPA-

5)MCDST-

6)WINE-

7)ARCHIE-

8)YAHOO-

9)ENIAC-

10)SUN-

NEWS TECH(5marks)

1)What is gmail?

2)What is kessiar aka EPC?

3)What is Songpro?

4)Evermore Integrated 2003 is a __________ product?

5)Recent leak of Win 2000 code was done by this company….?

AWARENESS(5marks)

1)Joltid:Altnet:

2)How is Nichal Zenstrom related to Janus Friis?

3)What is the new name of lindows?

4)Who was the first lady programmer?

5)What is the similarity between q-dos and MSDOS?

IMPORTANT PERSONALITIES(5marks)

1)Who is Deepak Puri?

2)Who is Tejas Shah?

3)Who is Kevin Mitnik?

4)Ex-CEO of Intel?

5)Who made the Analytic Engine?

Get YOUR HANDS WET(5*2marks)

1)Who is the CEO of Dell,who will proceed him,when?

2)What is raid?How many types it it of?

3)Bill Gates:OS::Paul Allens:,where did they start doing computers:what was the outcome?

4)What is CeBIT,where is it held each year?

5)What is the similarity between ShadowMask and Aperture Grille?Define any one.

AHHH…(2.5*2marks)

1)What is Tehas?What is its current condition;which is the next cpu generation in plan?

2)What is PCI-EXPress and 3GIO(2)?What is Alderwood or northwood?(1/2)

I’m not going to compromise

I’ve removed the Karan’s Blog link from the sidebar because some people think that the content on it is controversial and is detrimental to the great institution, i.e., Delhi Public School R K Puram as well as Exun. I am never, I repeat, NEVAH, going to censor my blog just to suit a certain community. However, for the purpose of being discreet, I have started implying things rather than stating explicitly.

Have fun guys,

–Karan