Pagini recente » Cod sursa (job #2166885) | Cod sursa (job #782834) | Cod sursa (job #1184355) | Cod sursa (job #233812) | Cod sursa (job #1231098)
#include <fstream>
using namespace std;
int main()
{
ifstream ifs("ssnd.in");
ofstream ofs("ssnd.out");
int t;
ifs >> t;
for (int i = 0; i < t; ++i)
{
long long n;
ifs >> n;
int card = 1;
int sum = 1;
for (int k = 2; k <= n / 2; ++k)
{
if (n % k == 0)
{
++card;
sum += k;
}
}
if (n > 1)
{
++card;
sum += n;
}
ofs << card << " " << sum << "\n";
}
return 0;
}