0 Up votes0 Down votes

10 views6 pagesamazon questions

Apr 18, 2013

© Attribution Non-Commercial (BY-NC)

TXT, PDF, TXT or read online from Scribd

amazon questions

Attribution Non-Commercial (BY-NC)

10 views

amazon questions

Attribution Non-Commercial (BY-NC)

- Algebra Project Chapter 5
- Vedic Maths
- Aptitude
- The Many-to-Many Location-Routing Problem.pdf
- 6042.pdf
- Ductile Design 2nd Ed - Errata
- IX Solution
- Basic Numeracy Unitary Method
- IA Checklist_ Math Studies
- http.docx
- 036 3.9.The-z-table
- Solution4_3_18.pdf
- SQ1
- productFlyer_978-0-387-22836-5.pdf
- Basic Numeracy Unitary Method
- Download ICET-2013 Answer key Set wise
- comandos 3
- 12 2007 Mathematics 1
- Excel Function
- Activity Selection Example

You are on page 1of 6

These ma chines work in parallel, so as to minimize the overall completion time of all jo bs. N jobs arrive in some order and they need to be fed in these M machines. Jobs ar e assigned to machines in contiguous blocks i.e say first k1 jobs are fed to fir st machine , next k2 jobs to second machine, next k3 jobs to third machine and s o on. All the machines are equal in terms of their processing power and within a singl e machine all jobs are done serially, so the total time a machine takes to finis h all the jobs assigned to it is the sum of processing time of these jobs. Write a program that partitions the given sequence of jobs in M groups and assig n them to M machines in a way that minimizes the time to complete all jobs. Input Format : First line of input contains two space separated integers N and M, N is the numb er of jobs and M is the number of machines. Then follow N lines each containing an integer which is the processing time requ ired to complete that job. Output Format : Output a single integer which is the minimum time at which all jobs can get comp leted. Sample Input : 5 3 3 6 7 5 3 Sample Output : 9

Explanation :

Some ways to partition these 5 tasks in 3 groups are (3 6) (7) (5 3) , (3) (6 7) (5 3), (3) (6 7 5) (3), (3 6 7) (5) (3) etc. In case of partition (3 6) (7) (5 3) first machine complete all the assigned jobs in 9 units of time, second machi ne does that in 7 units of time and the third machine complete all its jobs in 8 units of time. Since these machines work in parallel, the overall completion ti me of all jobs is 9 units of time and this this is also the minimum completion t

Constraints :

1 <= M <= N <= 100,000 0 <= T <= 100,000 , T is the time taken by any job to get processed in a machine . HackerVilla Towers: The country of HackerVilla contains of N cities and N - 1 roads between them suc h that there a path between any two cities. With a war by robots approaching, it was decided to build watch towers along each of the roads. In case the enemy at tacked, a watch tower would communicate the information by lighting a torch so t hat all watch towers at the same height could see it and be warned of the attack . Thus, it was necessary that all towers on the path between two watch towers ha ving the same height X should have height lesser than X. Also, it was decided th at no two adjacent towers (built on roads ending at the same city) should have t he same height as communicating information at such a short distance would not r eally be very useful.

All towers should have an positive integral height. Write a program to find the minimum height that the tallest watch tower can have.

Input Format:

The first line contains the number of test cases T. T test cases follow. The fir st line contains N, the number of cities in HackerVilla. The cities are numbered 0..N - 1. The following N - 1 lines contain the description of the roads. The i th line contains two integers a_i and b_i, meaning that there is a road connecti ng cities with numbers a_i and b_i.

Output Format:

Output T lines, one corresponding to each test case containing the required answ er for that test case.

Constraints:

Sample Input:

4 4 0 1 1 2 2 3 4 0 1 0 2 0 3 6 0 1 1 2 2 3 2 4 4 5 7 0 1 1 2 2 3 2 4 4 5 3 6

Sample Output:

2 3 3 4

Explanation:

For the first case, the roads 0-1 and 2-3 can have a tower of height 2 units eac h, while the road 1-2 can have a tower of height 1 unit. Thus, the tallest tower has height 2 units.

For the second case, all roads should have a tower of different height as every pair of them is adjacent. Thus, the tallest tower will have height 3.

For the third case, one solution is to build a tower of height 1 on the road 1-2 , build towers of height 2 on roads 0-1 and 2-4, and towers of height 3 on roads 2-3 and 4-5. MagicStones: Apart from the regular prizes if you win the contest, InterviewStreet will give you magical stones, yes the unique prizes not seen in any other contests. There are 3 types of magical stones. Let us call the types A,B and C. You have N stones of each type. Each magical stone has a power associated with it. The pow er of the ith stone of type A,B and C is a_i,b_i and c_i respectively. When you combine three stones of different types having powers a,b and c, you get a stone of type X. The power of this stone is (a^b) + (a^c). Here '^' is the XOR operat or.

You want to form N stones of type X. Write a program to find the maximum total power you can achieve by combining stones optimally

Input Format: The first line contains the number of test cases T. T test cases follow. Each te st case contains an integer N on the first line. The next three lines contain N integers each, denoting the powers of stones of type A,B and C respectively.

Output Format:

Output T lines, containing the maximum power you can achieve for the correspondi ng case.

Constraints: 1 <= T <= 50 1 <= N <= 100 0 <= a_i,b_i,c_i <= 10000000.

Sample Input: 3 1 2 4 5 2 1 2 3 4 5 6 1 7 7 7

Sample Output: 13 22 0

Explanation:

For the first example, the power of the resultant stone is (2^4) + (2^5) = 13. For the second example, combine stones a_1,b_1,c_2 and stones a_2,b_2,c_1. The r esultant power is 9 + 13 = 22.

Evacuation: The goal of this problem is, given a network of road and loations, to determine the maximum number of people that can be evacuated. People must be evacuated from evacuation points to rescue points. The list of r oads and the number of people they can carry per hour is provided. Input Format: The first line contains five integers n s t r h, where n is the number of locat ions (each location is given by a number from 0 to n-1), s is the number of loca tions to be evacuated from(evacuation points), t is the number of locations wher e people must be evacuated to( rescue points), r is the number of roads and h is the number of hours since the rescue mission started. The second line contains s integers giving the locations of the evacuation point s. Third line contains t integers giving the location of rescue points. The r following lines contain the road definitions. Each road is defined by 3 in tegers l1 l2 capacity( people/hr), where l1 and l2 are the locations connected b y road( roads are one way ), capacity is the number of people per hour that can fit on the road. h is the number of hours since rescue mission started. You need to find out how many people are saved after h hours. Output Format: The output should contain only 1 line, giving the maximum number of people that can be evacuated in an hour. Sample Input: 5 0 3 0 0 1 1 2 1 2 5 3 4 1 2 2 3 4 10 5 4 5 10

Sample Output: 24

- Algebra Project Chapter 5Uploaded byjoannajohnson39
- Vedic MathsUploaded byBhupesh Kumar
- AptitudeUploaded byPhani Kumar Mallela
- The Many-to-Many Location-Routing Problem.pdfUploaded byJuan Sebastián Poveda Gulfo
- 6042.pdfUploaded byNadir Mayra Mamani Mamani
- Ductile Design 2nd Ed - ErrataUploaded byapirakq
- IX SolutionUploaded byashish
- Basic Numeracy Unitary MethodUploaded byjunaidyousaf
- IA Checklist_ Math StudiesUploaded byLucy Hernandez
- http.docxUploaded byJeffery Yip
- 036 3.9.The-z-tableUploaded byTECH. Craft
- Solution4_3_18.pdfUploaded bySahabudeen Salaeh
- SQ1Uploaded byabdul Butt
- productFlyer_978-0-387-22836-5.pdfUploaded byGuilherme Wagner
- Basic Numeracy Unitary MethodUploaded byupscportal.com
- Download ICET-2013 Answer key Set wiseUploaded byMruthyunjay
- comandos 3Uploaded byElías Alexander
- 12 2007 Mathematics 1Uploaded bySachin Yadav
- Excel FunctionUploaded byNITIN
- Activity Selection ExampleUploaded byTarun Verma
- SopUploaded byJohn John
- Programming Assessed Work 2Uploaded byDaniel Carpenter
- Learning Experience II 2002Uploaded byMohsin Hassan
- Ajit Assignment 3 CodeUploaded byAjitPrabhakar
- Last 2 DigitsUploaded bytanya1780
- time_table_for_2semUploaded byvikramshilapolytechn
- AddmathF4C1Uploaded byThivyaTharsni Rajendran
- C4%20Practice%20Paper%20A6%20mark%20scheme[1]Uploaded byrbd3
- Timetable S-2018 V1.2Uploaded byshivaram yadav
- Workflow_to_optimize_well_design_using_a_specific_inclination_angle.pdfUploaded byMuhamad Afiq Rosnan

- pkcs-11v2-20Uploaded bytuanvukma6b
- ptoticAnalysisUploaded bypullasunil
- complete tressUploaded bypullasunil
- Perl TutorialUploaded byaiswarya m
- IBPS IT Officers PDF - Gr8AmbitionZUploaded bypullasunil
- oracle_ggUploaded byMaximo Decimo Meridio
- Problems on Algorithms (2002)Uploaded bylcnblzr3877
- Amazon QuestionsUploaded bypullasunil
- Java & C++Uploaded byKarthik Tantri

- daniel-moonasar-lesson-planning.pdfUploaded byKatia Demchenko
- Diameter Distance TraveledTEACHUploaded bykishan1234
- Cover PageUploaded byMuhammad Akmal Hossain
- 100 Urban Trends 1106 3MBUploaded byarchificial
- On the Nature of a.'.a.'.Uploaded byRick Rite
- US vs Eduave - Astudillo vs PpUploaded byMacy Marcelo
- Analysis DHLAWUploaded byLook At
- Altar RubricUploaded byDaniel Martin
- Natalia 09 (1979) completeUploaded byPeter Croeser
- User ManualUploaded bytomaz_filho
- Book. Astrolocality AstrologyUploaded byrgsr2008
- Mother's day one act play inter study materialUploaded byShanmuk_Ch
- Plants Poisonous to CatsUploaded byPenni Blakley Cotton
- Acctg Problem 7Uploaded bySalvie Perez Utana
- rubrics for critical inquiryUploaded byapi-384992976
- Timolol-fix Combination GlaucomaUploaded byinezsaraswat
- Provoke Edisi 104Uploaded byRie Iyya
- Elliot Goes to SchoolUploaded byITIugiwara
- ANALYSIS OF LATEST SONAS: PRESIDENT CORAZON AQUINO VS. PRESIDENT GLORIA ARROYOUploaded byGheeric Rose
- Detox - Louisa Williams HandoutUploaded byDaniel Solis
- Brueggemann_Covenant as Human Vocation_Int 33 (1979)Uploaded byjlhack67
- joel abad genre analysis-3 (1) finalUploaded byapi-271763375
- Centenary Conference ProgrammeUploaded bynasimhs
- Hetero to PiaUploaded byjeunipeuni
- econ eportfolioUploaded byapi-272556968
- A Practical Guide to the Preparation, Drafting and Submission of Dissertations in Finance by Dr. G. PollioUploaded byInformation should be FREE
- Gelatine s 1Uploaded byJohana Megawati
- 2.Rizal Cement vs VillarealUploaded byMJ Decolongon
- INSET Training MicroviewUploaded byVIJAY KUMAR HEER
- Civilization and TranscendenceUploaded bybabugaru

## Much more than documents.

Discover everything Scribd has to offer, including books and audiobooks from major publishers.

Cancel anytime.