問題一覧 > 通常問題

No.1346 Rectangle

レベル : / AI推定難易度 : 1600 / 実行時間制限 : 1ケース 2.000秒 / メモリ制限 : 512 MB / 標準ジャッジ問題
タグ : (AC するまで非表示) / 解いたユーザー数 77
作問者 : PCTprobability / テスター : KoD maguro blackyuki
お気に入りにしたユーザー ProblemId : 5749 / 自分の提出
問題文最終更新日: 2021-01-16 17:42:21
This statement was translated by AI (claude-opus-5-5, effort medium) and may contain errors or differ in nuance from the original. The original statement takes precedence. Back to the original
灘中入試コンテストday1 (順位表) の他の問題:

Problem Statement

You are given a positive integer $N$. Find the largest positive integer $M$ satisfying the following condition. If $M$ can be arbitrarily large, output INF.

  • All cells of a rectangle consisting of $N×M$ cells can be painted white or black so that there exists no tuple of positive integers $(x_1,x_2,y_1,y_2)$ satisfying the following conditions.
    • $1 \le x_1 < x_2 \le N$
    • $1 \le y_1 < y_2 \le M$
    • Denoting the cell in the $i$-th row from the top and the $j$-th column from the left by $(i,j)$, the cells $(x_1,y_1),(x_1,y_2),(x_2,y_1),(x_2,y_2)$ are all the same color.

Input

$N$

  • All inputs are positive integers.
  • $2 \le N \le 10^{18}$

Output

Output the largest positive integer $M$ satisfying the condition. If $M$ can be arbitrarily large, output INF.

Sample

Sample 1
Input
5
Output
4

When $N=5$, a painting satisfying the condition exists for $M=4$, but no such painting exists for $M \ge 5$, so the answer is $4$.

提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。