## guptaabhinav206

BAN USER- 0of 0 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

**CareerCup**is the world's biggest and best source for software engineering interview preparation. See all our resources.

Open Chat in New Window