/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package lamps; /** * * @author cteam019 */ import java.util.Scanner; import java.util.ArrayList; import java.util.Collections; import java.util.Set; import java.util.HashSet; import java.util.Map; import java.util.HashMap; public class Lamps { /** * @param args the command line arguments */ public static void main(String[] args) { // TODO code application logic here Scanner sc = new Scanner(System.in); int number = sc.nextInt(); int ar[] = new int[number]; Map m = new HashMap(); for (int i = 0; i < number; i++) { int x = sc.nextInt(); if(m.containsKey(x)){ ar[i] = m.get(x); }else{ m.put(x, getNumbers(x)); } //System.out.println(getNumbers(x)); //ar[i] = getNumbers(1000000); } for(int i:ar){ System.out.println(i); } } private static int getNumbers(int number) { //long l = System.currentTimeMillis(); int t = 0; int combinations = 0; for(int x=1;x >= 1;x++){ for(int y = x + 1; y >= x+1;y++){ for(int z = y +1; z>=1;z++){ if(x*y*z<=number){ t=0; combinations++; }else{ t++; break; } } if(t>=2){ break;} } if(t==3){ break;} } // System.out.println(System.currentTimeMillis() - l); return combinations; } }