1005:coffin Tiles
Time Limit:1 Sec |
|
Memory limit:128 MB |
Submit:2 |
|
Solved:2 |
Description
The Pumpkin King has a great idea for this christmas:personalized coffins for all the good little boys and girls! To make them extra special, Jack had ordered that the coffins had various designs based upon the interests of the Childre N (This is of course determined by what Google searches the children does most often. The clown with the Tear-away face has mad hacking skills).
Most little girls, and some of the boys (bronies) happen to being really into My little pony:friendship are Magic, and so A large number of Twilight Sparkle themed coffins has been ordered (Twilight is of course, the most awesome pony on the S how). These coffins is decorated by affixing alternating tiles in a rectangle up the middle of the coffin lid (they ' re flat). Now, all the children is different sizes and shapes. Some lids would need a rectangle 3 tiles wide, Some less, and Some more. In order to keep from ordering too many tiles from the. Ummm Coffin Tile factory (Just go with it). The Mayor wants to know what many tiles he needs to order, based upon how many dimensionally unique rectangles can be made Using tiles of a certain number.
So, the mayor have asked you-to-write a program that would, for each given integer, "n", output the minimal number of tiles (The tiles is square) that can is arranged into exactlynunique rectangles. For example, if the number of both was given, the minimal number of tiles required to make 2 unique rectangles is 4. With 4 can make A1x4and a2x2rectangle.
Inputinput consists of a single integer indicating the number of integers to read and a sequence of positive integers sepa Rated by whitespace. Outputfor each input integernyour program should output either a single line containing the minimal number of unit squares That can being arranged into exactlynrectangles, or "Too big" if the number of needed unit squares is bigger than 1000000.Sa Mple Input
51 4 19) 48 71
Sample Output
12478643227720Too Big
HINT Source
ACM ICPC South Central USA regional programming Contest the title was smelly and long, and I was the result of even's guess. Playing table Dafa is so happy!!!
/*#include <bits/stdc++.h> using namespace STD; bool judge (int n,int m) {int cnt = 0; int k = (int) sqrt (m*1.0); for (int i=1; i<=k; i++) {if (m%i==0) cnt++; } if (cnt==n) return true; else return false; } int Calc (int n) {for (int i=n*n; i<=1000000; i++) {if (judge (n,i)) return i; } return-1; } int main () {freopen ("OUT.txt", "w", stdout); for (int i=1;i<=1000;i++) printf ("%d\n", Calc (i)); return 0;}*/#include<bits/stdc++.h>inta[ -] = {1,4, A, -, $, -,192, -, the, -,576, the,1296, the,720,840,9216,1260,786432,1680,2880,15360,3600,2520,6480,61440,6300,6720,-1,5040,-1,7560,46080,983040,25920,10080,-1,32400,184320,15120,44100,20160,-1,107520,25200,-1,-1,27720,233280,45360,-1,430080,129600,50400,414720,60480,-1,-1,921600,55440,-1,-1,100800,83160,-1,322560,-1,176400,-1,181440,-1,110880,-1,-1,226800,-1,-1,-1,-1,166320,352800,-1,-1,221760,-1,-1,-1,967680,-1,277200,-1,-1,-1,-1,705600,332640,-1,-1,-1,498960,-1,-1,-1,-1,907200,-1,-1,554400,-1,-1,-1,665280,-1,-1,-1,-1,-1,-1,-1,720720}; intMain () {intT; scanf ("%d",&t); while(t--) { intN; scanf ("%d",&N); if(n> -) puts ("Too Big"); Else { if(a[n-1]==-1) puts ("Too Big"); Else{printf ("%d\n", a[n-1]); } } } return 0;} /************************************************************** problem:1005 User:yinjianzuishuai language:c + + result:accepted time:0 ms memory:1700 kb****************************************************************/
Csuft 1005 Coffin Tiles