6128번: Bessie's Secret Pasture
6128번
6128번 - Bessie's Secret Pasture
1 초 128 MB 9 9 8 100.000%
Farmer John has cut an almost unlimited number of square pieces of sod (grass sections) of all integer side-lengths from the pasture (sometimes FJ doesn't engage the blade properly and even makes a 0-sided sod squares). He has placed them in nicely organized piles that Bessie spotted one afternoon.
Bessie, always hoping to put delicious grass in her secret pasture, decided to carry precisely four of these sod sections over to her pasture and carve them into 1x1 sections in order to tile its N (1 <= N <= 10,000) unit-square sections.
Bessie is interested in knowing how many different ways she can choose four sod sections to tile her secret pasture. If she had a pasture of size 4, she might haul sod squares in these five different ways: (1,1,1,1), (2,0,0,0), (0,2,0,0), (0,0,2,0), (0,0,0,2). Order counts: (4,3,2,1) is a different way of choosing than (1,2,3,4).
Line 1: A single integer: N
Line 1: A single integer that is the number of different ways Bessie can choose four sod sections for her pasture
Olympiad > USA Computing Olympiad > 2007-2008 Season > USACO October 2007 Contest > Silver 1번