guptaabhinav206
BAN USER- 2of 2 votes
Answerplease help me out!!..Its not striking me.
- guptaabhinav206 in India
Ramesh and Suresh get a box full of five stars on lottery each. Since both the boxes need not have the same number of chocolates, they decide to play a game. The winner gets to have both the boxes of chocolates. They play alternatively and Suresh starts the game. Given the number of chocolates in both the boxes, let them be c1 and c2, the player takes either c1 or c2 number of chocolates and divide the remaining box of chocolates to two boxes (these two boxes need not have the same number of chocolates). The player who cannot make such a move loses. Input
First line of input contains a number T(1<=T<=1000), the number of test cases. Then follows T lines each containing two space separated integers c1 and c2
(1<=c1<=c2<=10000).
Output For each test case print "Ramesh" or "Suresh" depending on who is the winner.
Input: 2 3 1 4 5
Output: Ramesh Suresh| Report Duplicate | Flag | PURGE
Capgemini Intern Algorithm
- 0 Answers NZEC error java..please help
import java.io.BufferedReader;
- guptaabhinav206 January 17, 2014
import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStreamReader;
import java.math.BigInteger;
import java.util.Arrays;
import java.util.Scanner;
import java.util.Vector;
import java.math.BigInteger;
public class Mkequal
{
public static void main(String[] args)throws IOException
{
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
Scanner sc=new Scanner(System.in);
int t=Integer.parseInt(br.readLine());
while(t-->0)
{
int sum=0;
int n=Integer.parseInt(br.readLine());
int arr[]=new int[n];
for(int i=0;i<n;i++)
arr[i]=sc.nextInt();
for(int i=0;i<n;i++)
sum+=arr[i];
if(sum%n==0)
System.out.println(n);
else System.out.println(n-1);
}
}
}| Flag | PURGE
Repkatierlaursen123, Analyst at ABC TECH SUPPORT
Hello I am working in Maxprofit as a Data coder operator.I have been working here for 5 years.When ...
RepHenryBrown, Associate at A9
I am an experienced budget analyst skilled at researching and consolidating financial and budget information. I am taught record keeping ...
Repleroykrtz, Backend Developer at Achieve Internet
I am a Homeowner association manager and am typically involved in drafting and enforcing community rules and regulations. These rules ...
RepAadenGarcia, Analyst at ADP
I have a knowledgeable professional librarian with more than 4 years of experience in the public library setting. I have ...
RepAnnetteFlynn, Android test engineer at ABC TECH SUPPORT
Hello I am a skill trainer. Master's Degree in Industrial and Organisational Psychology and 10 years of experience working ...