sunilkanaujia.manit
BAN USER- 2of 2 votes
AnswersThe King's Land Sale - 2
- sunilkanaujia.manit in India
You might have seen shopkeepers offering sale on their trade items to promote their business - like sale on electronic gadgets or sale on clothing and accessories etc. But have you ever come across something like sale of land ?
Yes, the king of Byteland has grown old and wants to sell away his territory as soon as possible. So he announced a sale on his plot. This drew attention of many land lords and everybody hurried to buy land at the cheapest prices. The king had declared that he would accept bids of only rectangular plots and one needs to mention the diagonally opposite corners(a, b) and (c, d) of the land he wishes to buy. They would write these 4 numbers (a, b, c, d) on a piece of paper, seal it in an airtight envelope and give it to the king.
The king received N such envelopes. As the process was hidden there were many envelopes containing plot descriptions that shared some (or even all) common area. The king now wants to know the union of the areas of all plots that have come under the bidding.
Note that the rectangles made by the plots are always aligned to the rectangular axes, their areas is always positive and c >= a and d >= b.
Note that the rectangles made by the plots are always aligned to the rectangular axes, their areas is always positive and c >= a and d >= b.
Constraints
1 ≤ T ≤ 20
1 ≤ N ≤ 20
-10000 ≤ a, b, c, d ≤ 10000
Input
The first line of the input contains the number of test cases T. The description of T test cases follow. Each test case starts with a line containing an integer N, the number of rectangular plots. Then N lines follow, each with 4 space separated integers, a b c d,(a, b) and (c, d) representing the diagonally opposite corners of the plots.
Output
For each test case print one line, the union of the areas of all the plots.
Explanation
1) The individual areas of both plots are 4 each. But they share a common area of 1 between them (between (1, 1) and (2, 2)). Therefore the total area is 4 + 4 - 1 = 7
2)Both the plots of no area in common. So we simply add their individual areas (6 + 9 = 15).| Report Duplicate | Flag | PURGE
Adobe Developer Program Engineer Algorithm - 0of 0 votes
AnswerGiven N natural numbers A1, A2, A3 . . . AN, you have process Q queries of following two types:
- sunilkanaujia.manit in India
1 i j: Perform the operation Ai = j.
2 L R: Print the LCM of the elements AL, AL+1, AL+2 . . . AR.
Here LCM stands for lowest common multiple. Please help Shil to open the lock.
Input
First line will contain integer N.
Second line will contain N natural numbers denoting array A.
Third line will contain number of queries Q.
Then next Q lines will contain either query of Type 1 or 2.
Output
For each query of Type 2 output the required answer. Since LCM can be very large output it modulus 109+7.| Report Duplicate | Flag | PURGE
Akamai Computer Scientist - 0of 0 votes
AnswersCount Scorecards
- sunilkanaujia.manit in India
In a tournament, N players play against each other exactly once. Each game results in exactly one player winning. There are no ties. You have been given a scorecard containing the scores of each player at the end of the tournament. The score of a player is the total number of games the player won in the tournament. However, the scores of some players might have been erased from the scorecard. How many possible scorecards are consistent with the input scorecard?
Input Format
The first line contains the number of cases T. T cases follow. Each case contains the number N on the first line followed by N numbers on the second line. The ith number denotes s_i, the score of the ith player. If the score of the ith player has been erased, it is represented by -1.
Output Format
Output T lines, containing the answer for each case. Output each result modulo 1000000007.
Constraints:
1 <= T <= 20
1 <= N <= 40
-1 <= s_i < N
Sample Input:
5
3
-1 -1 2
3
-1 -1 -1
4
0 1 2 3
2
1 1
4
-1 -1 -1 2
Sample Output:
2
7
1
0
12
Explanation:
For the first case, there are 2 scorecards possible: {0,1,2} or {1,0,2}.
For the second case, the valid scorecards are {1,1,1}, {0,1,2}, {0,2,1}, {1,0,2}, {1,2,0}, {2,0,1}, {2,1,0}.
For the third case, the only valid scorecard is {0,1,2,3}.
For the fourth case, there is no valid scorecard. It is not possible for both players to have score 1.
For the fifth case, 6-variations of {{3,1,0}[2]}, 3 variations each of {{2,2,0}[2]} and {{2,1,1}[2]}
Max Score: 89pts dynamic
Suggest Edits| Report Duplicate | Flag | PURGE
Front-end Software Engineer - 0of 0 votes
AnswersFor a table created using the following commands. State the SQL SELECT command to find the 1st and 2nd highest salary earned by staff working in DEL or MUM
- sunilkanaujia.manit in India
CREATE TABLE Employees (
ID int NOT NULL AUTO_INCREMENT,
Name varchar(100),
Sal decimal (10,2),
City char (3),
PRIMARY KEY (ID)
);
INSERT INTO Employees (Name, Sal, City) VALUES ('Ramesh',20000, 'BLR');
INSERT INTO Employees (Name, Sal, City) VALUES ('Sunil',24000, 'DEL');
INSERT INTO Employees (Name, Sal, City) VALUES ('Sreeja',21000, 'MUM');
INSERT INTO Employees (Name, Sal, City) VALUES ('Pavan',23000, 'DEL');
INSERT INTO Employees (Name, Sal, City) VALUES ('Maya',24000, 'MUM');| Report Duplicate | Flag | PURGE
Front-end Software Engineer - -1of 1 vote
AnswersThe below Java program prints the numbers from 1 to 50. But for multiples of three print "DNA" instead of the number and for the multiples of five print "RNA". For numbers which are multiples of both three and five print "ATGC". Please identify the three bugs in the code and suggest how they can be resolved.
- sunilkanaujia.manit in India
public class SeqTest {
public static void main(String args[]) {
for(int i = 1; i <= 50; i++) {
if(i % 3 == 0) System.out.println("DNA");
else if(i % 5 == 0) System.out.println("RNA");
else if(i % (3+5) == 0) System.out.println("ATGC");
else System.out.println(“1 to 50”);
}
}
}| Report Duplicate | Flag | PURGE
Front-end Software Engineer
RepSandraGabriel, Analyst at ABC TECH SUPPORT
We Data Entry Operators have a variety of duties, including processing documents, solving inconsistencies, securing information, updating databases and using ...
Reprichardcstrong, Accountant at AppPerfect
I am a modern magician, except I transform complicated technical ideas into user-friendly images before the eyes of your company ...
RepMorrisHelen, Speech writer at Micro Design
I am a speechwriter who works directly with senior executives or leaders to determine what points, themes, positions, or messages ...
RepHello friends my name Neha Nanda from India Chandigarh city. Doing work in SEO line in Softsys company.
Repannasteven1246, Analyst at Accenture
Creative, highly visual fashion professional who can brilliantly mix and match the technical expertise and intuition like fabric and color ...
Repmonicahbess, SDET at Adap.tv
Hi Everyone, I'm Monica H. Bess. I love to build props...everything from a casket to pneumatic monsters.My ...
Repwilliamchansen95, Computer Scientist at 247quickbookshelp
I am working as a manager in Lionel Kiddie City company. I really enjoy my job. I like to play ...
Repmariawharris2, Computer Scientist at Adjetter Media Network Pvt Ltd.
Hi I am an IT Project Management Professional with 2 years' experience,Handled project development and documentation of copier rentals ...
RepDiscover the cheapest packers and movers in Gurgaon at best price with smooth and hassle free relocation. We provide truck ...
RepAmmoBoard, Employee at A9
The best online ammo shop to buy ammunition for your rifles, handguns & shotguns from top brands you like.
RepI am an energetic sales professional with a track record of consistently increasing sales revenue in a competitive market. Contract ...
RepEviePaul, Member Technical Staff at Abs india pvt. ltd.
I am a Studio camera operator from Florida USA.I love to relax n' chill. love when it's cloudy ...
Repdeborahdond, Rehabilitation counsellor at Parts salesperson
Hello, I am Deborah Rehabilitation counsellors who help people with physical, mental, developmental, or emotional disabilities live independently. I want ...
Repmanduj972, Executive chef at Neptune, NJ 07753
Hello, I am Mandu and I completed all my study from Neptune. today I am working as an Executive Chef ...
which algorithm i have to used ?? for this problem ???
- sunilkanaujia.manit August 14, 2015