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-04-14 19:23:58 ppppppp
dont use float which cost me 5 wa but finally acc
2014-04-11 23:28:04 Simon Liang
so many gotcha's in this one
2014-03-01 00:16:27 Konstantin
the picture is broken
2014-02-18 12:28:13 Neel Jinwala
refrained from printing \n (newline) at the end.. ACcepted..
2014-01-21 20:51:24 RAJAT SINGH
please explain the algo.....to solve
2014-01-10 21:14:12 Sidharth Raja
0.00 AC at first go. That feel. :')
2013-12-28 13:05:24 Sanu Kumar Gupta
nice one...simple maths...AC with ex. time 0.02 sec.
2013-12-23 13:01:24 Ashwini
can anyone check why i am getting wrong answer. this question is so simple.
for n=10000 output 46884. is it wrong

Last edit: 2013-12-23 13:48:47
2013-12-08 18:06:16 lzyerste
2 lines in python
© Spoj.com. All Rights Reserved. Spoj uses Sphere Engine™ © by Sphere Research Labs.