1. Problem Code: APGP 
According to Wikipedia, an arithmetic progression (AP) is a sequence of numbers such that  the difference of any two successive members of the sequence is a constant. For instance,  the sequence 3, 5, 7, 9, 11, 13, . . . is an arithmetic progression with common difference 2.  For this problem, we will limit ourselves to arithmetic progression whose common  difference is a non‐zero integer.  On the other hand, a geometric progression (GP) is a sequence of numbers where each term  after the first is found by multiplying the previous one by a fixed non‐zero number called the  common ratio. For example, the sequence 2, 6, 18, 54, . . . is a geometric progression with  common ratio 3. For this problem, we will limit ourselves to geometric progression whose  common ratio is a non‐zero integer.  Given number of terms in a sequence and the corresponding successive members of the  sequence, you need to determine the type of the progression and the next successive  member. 

The first line of input contains ‘t’ specifying the number of sequences .  ‘t’ number of sequences follow.  The first digit say,n (1<=n<=5) of the sequence specifies the number of terms given in the  sequence.   ‘n’ terms of the sequence follow. 

Output the type of progression and the next number in the sequence. Print a new line after  a test case. 


3  3 11 17 23   5 2 4 8 16 32  2 2 4  

A.P 29  G.P 64  Input not sufficient 


Problem Set

 Problem Code: Encrypt    Bob and Alice are working in two different companies in different localities.  Each test case contains the actual message(Numbers between 100 to 999). Now. you being the  hacker wanted to capture that encryption procedure and tell us what they were  transferring.  Sample Input:  2  643  143  Sample output: 361327  010821  ChETanAs Problem Set .  Encryption Procedure:  Example 1:  Actual Message: 643   Encrypted Message: 361327  Example 2: Actual Message: 143  Encrypted Message: 010821  Input: The first line of input contains ‘t’ the number of messages. Bob was  sending some confidential information to Alice in encrypted form.CODE IT!!!   2.  Output: Output the encrypted form for each of the test cases separately in a new line.

 Problem Code: Triangle Count  We define the LEVEL of a triangle as in the following illustrative image: Task: Your task is very easy. All you have to do is to count all triangles in the given Level. (All answers will fit within the range of a 64-bit integer) Sample Input: 3 1 2 3 Sample Output: 1 5 13 ChETanAs Problem Set .the number of test cases and T lines follow. Each line contains an integer N (1 ≤ N ≤ 106) which is the level of the triangle in that test case. Output For each test case. you should write a separate line: the number of triangles in the biggest one (Level N). Input The first line of the input contains an integer T (T ≤ 10000) .CODE IT!!!   3.

A company needs to calculate with reversed numbers.CODE IT!!!   4.g. print exactly one line containing only one integer . Thus we must assume that no zeros were lost by reversing (e. the result is not unique because any particular number is a reversed form of several numbers (e. 21 could be 12. Note that all the leading zeros are omitted. most of the ancient plays are tragedies. Also note that the reversed number never has any trailing zeros. 1200 gives 21). The first line of the input contains only positive integer N. although all the things change to their opposites. For example.the reversed sum of two reversed numbers. Of course. it must be converted to its reversed form before being accepted into the comedy play.g. Obviously. Omit any leading zeros in the output. Problem Code: Add Reverse  The Antique Comedians of Malidinesia prefer comedies to tragedies. Input The input consists of N cases (equal to about 10000). These are the reversed numbers you are to add. assume that the original number was 12). Reversed number is a number written in Arabic numerals but the order of digits is reversed. 120 or 1200 before reversing). Example: Sample input: 3 24 1 4358 754 305 794 Sample output: 34 1998 1 ChETanAs Problem Set . Then follow the cases. Your task is to add two reversed numbers and output their reversed sum. Each case consists of exactly one line with two positive integers separated by space. Therefore the dramatic advisor of a company has decided to transfigure some tragedies into comedies. Output: For each case. he has 5421 of them now. if the main hero had 1245 strawberries in the tragedy. That means if the number ends with a zero. this work is very hard because the basic sense of the play must be kept intact.g. Unfortunately. For example the numbers: if any number appears in the tragedy. the zero is lost by reversing (e. The first digit becomes last and vice versa.

each of which contains a single Very Long Integer. (i. ☺ Input The input will consist of at most 100 lines of text. each of the numbers may contain at most “100 digits” and (Obviously) so no data type in the languages you know can really do the trick of storing the numbers (or the sum). The task is simple enough. Output Your program should output the sum of the Very Long Integers given in the input. The final input line will contain a single zero on a line by itself.e. Let’s bring on a twist in the problem.. Problem Code: Integer Sum   A very easy beginners’ problem in programming is to find the sum of two numbers and print the sum. stop taking the input after incurring zero).CODE IT!!!   5. Sample Input 123456789012345678901234567890 123456789012345678901234567890 123456789012345678901234567890 0 Output for the Sample Input 370370367037037036703703703670                 ChETanAs Problem Set . take the input of two numbers and print the sum. Each Very Long Integer will be 100 or fewer characters in length and will only contain digits (no Very Long Integer will be negative).

 Strangely instead of writing each name in a new line.   Input: The first line of input contains ‘t’ specifying the number of classes. the string of all the students in the class and the  name to be found. svec.  Each test case contains two strings.  If the class contains the students with names cse.  Output: Print Yes/No depending on the presence of the name. If present then find  its position in the list. the student wrote all the  names continuously. first. Now it’s your job to find whether that name is present or not .CODE IT!!!   6. Problem Code: Finding Substring                                                                                                                                                                       A student was asked to write all the names of all the students in each of the class in the  school.  Specifications: The string starts from the index1 (not 0).  Example: Input: 2  csesvecbtech  svec  abcdefgh  ac  Output: Yes 4 7  No  ChETanAs Problem Set . And also the position of the name in  the string. Now the teacher wants to know if there is a particular student’s name  in the list. btech then the student writes the list  as “csesvecbtech”. If the required name is present more than once then return the  position of first occurrence of the name.

Sign up to vote on this title
UsefulNot useful