ural 1142. Relations

1142. Relations

Time limit: 1.0 second
Memory limit: 64 MB

Background

Consider a specific set of comparable objects. Between two objects a and b, there exits one of the following three classified relations:
a = b
a < b
b < a
Because relation '=' is symmetric, it is not repeated above.
So, with 3 objects (abc), there can exist 13 classified relations:
a = b = c       a = b < c       c < a = b       a < b = c
b = c < a       a = c < b       b < a = c       a < b < c
a < c < b       b < a < c       b < c < a       c < a < b
c < b < a

Problem

Given N, determine the number of different classified relations between N objects.

Input

Includes many integers N (in the range from 2 to 10), each number on one line. Ends with −1.

Output

For each N of input, print the number of classified relations found, each number on one line.

Sample

inputoutput
2
3
-1
3
13
 
posted @ 2015-12-25 20:13  yanzx6  阅读(266)  评论(0编辑  收藏  举报