22200_Sequence

2022-5-16 18:21| 发布者: Hocassian| 查看: 36| 评论: 0|原作者: 肇庆学院ACM合集

摘要:
C:\Users\Administrator\Downloads\2019-10-12-10-14-5-89506195085799-Problem List-采集的数据-后羿采集器.html

Pro.ID

22200

Title

Sequence

Title链接

http://10.20.2.8/oj/exercise/problem?problem_id=22200

AC

0

Submit

0

Ratio

-

时间&空间限制

  • Time Limit: 2000/1000 MS (Java/Others)     Memory Limit: 65536/65536 K (Java/Others)
  • 描述

    Decompose a positive integer into sum of a sequence of consecutive positive integers.

    The sequence must contain at least two elements.

    You need to tell me the minimal length of the sequence.

    However, not each integer can be decomposed. Output -1 in this situation.

    输入

    A line contains a positive integer n. ( n < 263 )

    Multiple inputs. Process to the end of file.

    输出

    Description

    Decompose a positive integer into sum of a sequence of consecutive positive integers.

    The sequence must contain at least two elements.

    You need to tell me the minimal length of the sequence.

    However, not each integer can be decomposed. Output -1 in this situation.

    Input

    A line contains a positive integer n. ( n < 263 )

    Multiple inputs. Process to the end of file.

    Output

    For each case, output a line contains the minimal length.

    Sample Input

    9
    2

    Sample Output

    2
    -1

    Source

    样例输入

    9
    2

    样例输出

    2
    -1

    作者


    路过

    雷人

    握手

    鲜花

    鸡蛋

    最新评论

    返回顶部