Ann and Jimmy

  • + 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);
    }