вторник, 19 августа 2008 г.

Problem 45

SELECT k
FROM (SELECT n * (n + 1) / 2 k
FROM (SELECT     LEVEL + 285 n
FROM DUAL
CONNECT BY LEVEL < 100000))
WHERE k > 40755
INTERSECT
SELECT k
FROM (SELECT n * (3 * n - 1) / 2 k
FROM (SELECT     LEVEL + 165 n
FROM DUAL
CONNECT BY LEVEL < 100000))
WHERE k > 40755
INTERSECT
SELECT k
FROM (SELECT n * (2 * n - 1) k
FROM (SELECT     LEVEL + 143 n
FROM DUAL
CONNECT BY LEVEL < 100000))
WHERE k > 40755

Комментариев нет: