#!/usr/bin/env python
# -*- coding: utf-8 -*-

def f(x):
    return x ** 2

def main(x, y, n):
    aralik = float(y - x) / n
    L = 0
    U = 0

    for i in range(n):
        L += f(x) * aralik
        x += aralik
        U += f(x) * aralik

    print L, U

if __name__ == '__main__':
    main(0, 1, 10)
    main(0, 1, 100)
    main(0, 1, 1000)

# 0.285 0.385
# 0.32835 0.33835
# 0.3328335 0.3338335