DWITE '10 R3 #2 - Unit rectangles

View as PDF

Submit solution

Points: 5
Time limit: 2.0s
Memory limit: 64M

Problem type
Allowed languages
Ada, Assembly, Awk, Brain****, C, C#, C++, COBOL, CommonLisp, D, Dart, F#, Forth, Fortran, Go, Groovy, Haskell, Intercal, Java, JS, Kotlin, Lisp, Lua, Nim, ObjC, OCaml, Octave, Pascal, Perl, PHP, Pike, Prolog, Python, Racket, Ruby, Rust, Scala, Scheme, Sed, Swift, TCL, Text, Turing, VB, Zig
DWITE Online Computer Programming Contest, December 2010, Problem 2

Rectangles can be constructed out of smaller squares. Given a supply of unit squares (1 \times 1 in size), how many unique rectangles can be constructed?

The input file will contain 5 lines, each an integer 1 \le N \le 1000, a number of unit squares available.

The output will contain 5 lines, each a number of unique rectangles that can be constructed from up to N unit squares (not all squares have to be used for some of the rectangles).

Note: a rectangle is unique if another rectangle that had previously been constructed can't be rotated to look the same way. That is, 2 \times 3 and 3 \times 2 are considered to be the same.

Sample Input


Sample Output


Attribution-NonCommercial-ShareAlike 3.0 Unported (CC BY-NC-SA 3.0) Problem Resource: DWITE


There are no comments at the moment.