CF293C.Cube Problem

提高+/省选-

通过率:0%

时间限制:2.00s

内存限制:256MB

AC君温馨提醒

该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。

题目描述

Yaroslav, Andrey and Roman love playing cubes. Sometimes they get together and play cubes for hours and hours!

Today they got together again and they are playing cubes. Yaroslav took unit cubes and composed them into an a × a × a cube, Andrey made a b × b × b cube and Roman made a c × c × c cube. After that the game was finished and the guys left. But later, Vitaly entered the room. He saw the cubes and wanted to make a cube as well. But what size should the cube be? Of course it should be a large cube with the side of length a + b + c. Besides, Vitaly decided to decompose the cubes built by Yaroslav, Andrey and Roman and compose his own large cube out of them. However, it turned out that the unit cubes he got from destroying the three cubes just weren't enough to make a large cube. We know that Vitaly was short of exactly n cubes. Vitaly got upset, demolished everything and left. As he was leaving, he met Petya and told him that there had been three cubes in the room and that he needed another n unit cubes to make his own large cube.

Petya entered the room and saw the messily scattered cubes. He wanted to make it neat and orderly again. But he only knows that there had been three cubes, made of small unit cubes and that Vitaly needed n more unit cubes to make a large one! Help Petya understand, how many ways of sizes a, b, c are there to restore Yaroslav's, Andrey's and Roman's cubes.

亚罗斯拉夫、安德烈和罗曼喜欢玩积木。有时他们会聚在一起,连续几个小时玩积木!

今天他们又聚在了一起玩积木。亚罗斯拉夫用单位立方体拼成了一个 a×a×aa \times a \times a 的立方体,安德烈拼成了一个 b×b×bb \times b \times b 的立方体,罗曼拼成了一个 c×c×cc \times c \times c 的立方体。之后游戏结束,三人离开了房间。但后来,维塔利进入了房间。他看到了这些立方体,也想自己拼一个立方体。那么这个立方体该有多大呢?当然应该是一个边长为 a+b+ca + b + c 的大立方体。此外,维塔利决定将亚罗斯拉夫、安德烈和罗曼拼好的三个立方体全部拆开,再用所有得到的单位立方体来拼出他自己的这个大立方体。然而,结果发现:将这三个立方体拆解后所得的单位立方体总数,恰好不足以拼成那个大立方体——还少了恰好 nn 个单位立方体。维塔利很生气,把所有东西都砸了,然后离开了。临走时,他遇到了佩佳,并告诉佩佳:“房间里原来有三个立方体,而我还差 nn 个单位立方体才能拼出我想要的大立方体。”

佩佳进入房间,看到满地散落的单位立方体。他想把一切整理得整齐有序。但他只知道:房间里原来有三个由单位立方体构成的立方体,且维塔利还需要额外 nn 个单位立方体才能拼成那个大立方体!请帮佩佳弄清楚:满足条件的正整数三元组 (a,b,c)(a, b, c)(即亚罗斯拉夫、安德烈和罗曼各自所拼立方体的边长)有多少种可能?

输入格式

The single line of the input contains integer n (1 ≤ n ≤ 1014). We know that all numbers a, b, c are positive integers.

Please, do not use the %lld specifier to read or write 64-bit integers in С++. It is preferred to use the cin, cout streams or the %I64d specifier.

输入仅包含一个整数 nn(1 ≤ n ≤ 10141 \leq n \leq 10^{14})。已知所有数 aa、bb、cc 均为正整数。

请注意:在 C++ 中,不要使用 %lld 说明符读取或写入 64 位整数。推荐使用 cin、cout 流,或 %I64d 说明符。

输出格式

In the single line print the required number of ways. If it turns out that there isn't a single way of suitable sizes of a, b, c, print 0.

在单行中输出所需的方案数。如果不存在满足尺寸要求的 aa、bb、cc 的任何方案,则输出 0。

输入输出样例

  • 输入#1

    24

    输出#1

    1
  • 输入#2

    648

    输出#2

    7
  • 输入#3

    5

    输出#3

    0
  • 输入#4

    93163582512000

    输出#4

    39090

输入解题思路,AI测评打分。不知道怎么写?

首页