AE00 - Rectangles

Byteman has a collection of N squares with side 1. How many different rectangles can he form using these squares?

Two rectangles are considered different if none of them can be rotated and moved to obtain the second one. During rectangle construction, Byteman can neither deform the squares nor put any squares upon any other ones.


The first and only line of the standard input contains one integer N (1 <= N <= 10000).


The first and only line of the standard output should contain a single integer equal to the number of different rectangles that Byteman can form using his squares.


For the input data:


the correct result is:


Task author: Jakub Radoszewski.

hide comments
L: 2013-06-20 11:49:09

@Dark Knight
My program is showing the specified output for N=10^4 i.e 46884..
but the site is showing it as wrong answer??

Last edit: 2013-06-20 11:49:23
Sagar Grover: 2013-06-19 15:41:29

Recursion makes it easy

king: 2013-06-17 12:11:42

O(n^2) got passed :)

chk: 2013-06-03 10:08:34

nice and easy :)


Last edit: 2013-06-03 10:13:27
Ankur Yadav: 2013-05-30 15:14:50

what is the answer for n=10000?

Amey Telawane: 2013-05-30 10:49:34

easy problem,,, very short code :)

Rowan Zafer: 2013-05-14 17:40:16

Test case 10, keeps bringing me down

aya mohsen: 2013-04-23 12:54:58

momkn 7ad y2oly el test cases?

ওয়াসী (Wasi): 2013-04-06 12:29:04

Nice problem
short and simple..
AC at 2nd attempt(forgot to return 0 first time :P)

Juɑƞ Chɑpɑrro: 2013-03-29 02:47:34

10 Lines ;)

Added by:Race with time
Time limit:1s
Source limit:50000B
Memory limit:1536MB
Cluster: Cube (Intel G860)
Languages:All except: ERL JS-RHINO NODEJS PERL6 VB.NET
Resource:Algorithmic Engagements 2009