Ann and Jimmy

Sort by

recency

|

11 Discussions

|

  • + 0 comments

    Constraints are given as 3<=N<=10^3, so why the need of the test case as 1. Nowhere in the question it is given what shall be the output for values less than 3. Please mention it in the question and be clearer.

  • + 0 comments
    int n = in.nextInt();
    int k = n/3;
    
    if(n == 1){
        System.out.println(1);
    }
    else if(n%3 == 0){
        System.out.println(k*k*k);
    }
    else if(n%3 == 1){
        System.out.println((k+1)*k*k);
    }
    else if(n%3 == 2){
        System.out.println((k+1)*(k+1)*k);
    }
    
  • + 0 comments

    can't we just apply arithematic mean >=geometric mean???

  • + 0 comments

    Test cases where N<3 are not valid as the the constarins given in the question. Also the sides of the cube are said to be positive intgers. 3≤N≤10^3

  • + 0 comments

    Why for input 1. The answer is also 1 ?