编程介的小学生 2017-02-05 15:11 采纳率: 20.5%
浏览 1183
已采纳

H. Game

Alice likes to play games. One day she meets such a game. There are N * N switches arranged in an N * N array. Pressing a switch would change its state, from off to on or from on to off. In addition, if a switch at row r and column c is pressed, then all switches with coordinate (k * r, k * c) will change state, with integer k>1. Initially all switches are off.

For example, in the picture above, white buttons represent switches turned off and colored ones represent switches turnedon. Initially all buttons are white. If the button at (2,2) is pressed, then buttons at (2,2), (4,4) will change state(represented with orange color). And if one presses the button (2,1), buttons at (2,1) and (4,2) will change from off toon(represented with gray color).

The goal of the game is to turn on all the switches (i.e. when you finish the game, all the switches must be at the state of on) and the player must do that with as few presses as possible. Now Alice would like your help.

Input

The first line of input file is an integer T, the number of test cases. T lines follow, each contain an integer N, the dimension of the array in one game.

1≤T≤50,1≤N≤10^9

Output

Output consists of T lines. Each line contains an integer, the minimum number of presses for the corresponding test case.

  • 写回答

1条回答 默认 最新

报告相同问题?

悬赏问题

  • ¥15 程序不包含适用于入口点的静态Main方法
  • ¥15 素材场景中光线烘焙后灯光失效
  • ¥15 请教一下各位,为什么我这个没有实现模拟点击
  • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置
  • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
  • ¥15 ubuntu子系统密码忘记