Sphere Online Judge

SPOJ Problem Set (classical)

4300. Rectangles

Problem code: AE00

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.

Added by:Race with time
Time limit:1s
Source limit:50000B
Memory limit:256MB
Cluster: Pyramid (Intel Pentium III 733 MHz)
Languages:All except: ERL JS NODEJS PERL 6
Resource:Algorithmic Engagements 2009

hide comments
2014-09-04 01:36:07 Pagarwal
2014-09-04 00:40:17 Pagarwal
10th case is not running..getting wrong answer..can anyone tell me if input is 7 then no. of triangles should be 9 or am i wrong..??

Last edit: 2014-09-04 00:41:37
2014-08-25 23:22:36 Rajat (1307086)
10 th test case was like 1 ball 6 runs cricket match.6 runs if 10th case beaten otherwise clean bold ;)
2014-08-14 07:26:58 vaibhav gosain
easy one even for begginers like me.... should be in the tutorial problems
2014-08-12 22:27:52 rituraj
Green AC in first attempt after spending some good time on finding the algo...
some test cases-10(15),15(24),25(46),100(246)
2014-07-30 10:37:57 Radha Jalan
AC in first attempt...yippee..:)
2014-07-25 21:35:52 Prajval Prabhakar
AC in first go :)
2014-07-20 11:11:28 akashdeep Singh dhanju
getting tle on 10th case anyone please explain
2014-06-27 13:50:07 Sanket Dasgupta
@Saurabh, a square is a kind of rectangle. It is not necessary for a rectangle to have two unequal sides.
2014-06-25 18:11:55 Saurav Sharma
There is a square in the diagram, not a rectangle. :)
© Spoj.com. All Rights Reserved. Spoj uses Sphere Engine™ © by Sphere Research Labs.