#include "iostream"
#include "algorithm"
using namespace std;
int main()
{
int TestCase;
cin >> TestCase;
while (TestCase--)
{
int range1, range2, tag = 0, abundance[1024] = {0};
cin >> range1 >> range2;
for (int i = range2; i >= range1; i--)
{
int DivisorSum = 0;
for (int j = 1; j <= i; j++)
{
if (i % j == 0)
DivisorSum += j;
}
abundance[i-1] = DivisorSum - i * 2;
}
sort(abundance, abundance+1024);
if (abundance[1023] > 0)
{
cout << abundance[1023] << endl;
tag = 1;
}
if (tag == 0)
cout << "-1" << endl;
}
}
sicily 1691
最新推荐文章于 2016-01-09 11:08:15 发布