ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1705. Gangster Hares

WA#3 what is test 3.
Posted by xurshid_n 31 Jul 2009 12:45
please, any hint
Re: WA#3 what is test 3.
Posted by Bunyodbek Bobodjanov (TATU UF) 17 Aug 2009 15:22
Help Me Please. WA#2 what is test 2.
 My Code:
import java.util.Scanner;
public class Rubbits {
        public static void main(String[] args) {
            Scanner rb = new Scanner(System.in);
            int n = rb.nextInt();
            long [] a = new long [n];
            int i,j,k,m;
            for ( i = 0; i < n; i++)
            {
                a[i] = rb.nextInt();
            }
            for ( i = 0; i <n; i++)
            {
                if (a[i]==1){
                    System.out.println("0");

                }
                else
                if(a[i]==2)
                    System.out.println("1");
                else{
                for ( j =2; j < a[i]; j++)
                {
                 k =(int)a[i]/j;
                 m = k*j;
                 if (a[i]-m>=k)
                 {
                     System.out.println(j);
                     break;
                 }
                }

            }
            }
    }

}
Re: WA#3 what is test 3.
Posted by Quyon 19 Aug 2009 09:18
test #2
n=1 output 2
n=2 output 3
n=3 output 2
Re: WA#3 what is test 3.
Posted by Quyon 19 Aug 2009 09:19
test #3
n=2 output 3