11773 - King's Wish
Moderator: Board moderators
11773 - King's Wish
for the example input 18, how is an output '9 1' violating the problem statement?
it seems '9 1' is better than '9 2'
can '9 1' cover a square smaller than 18x18?
it seems '9 1' is better than '9 2'
can '9 1' cover a square smaller than 18x18?

-
- A great helper
- Posts: 383
- Joined: Mon Oct 18, 2004 8:25 am
- Location: Bangladesh
- Contact:
Re: 11773 - King's Wish
Yes, it can cover, 9 x 9nealzane wrote:can '9 1' cover a square smaller than 18x18?
Re: 11773 - King's Wish
right, i was aware of it. but for '9 1' i guess 9x9 is not the problem wants because '9 1' covers a length of the square.emotional blind wrote:Yes, it can cover, 9 x 9nealzane wrote:can '9 1' cover a square smaller than 18x18?
the problem says '2 1' is valid for 4x4. while if '9 1' is valid for 9x9, '2 1' cannot be valid for 4x4, since in that case, '2 1' is valid for 2x2 also which is smaller than 4x4.
i guess '9 1' cannot be used for 9x9, just as '2 1' cannot be used for 2x2.

Re: 11773 - King's Wish
Guys, could you please give any difficult test cases?
Re: 11773 - King's Wish
Is 3 20 correct answer for test case 60?
-
- A great helper
- Posts: 383
- Joined: Mon Oct 18, 2004 8:25 am
- Location: Bangladesh
- Contact:
Re: 11773 - King's Wish
I think you did not understand the problem properly. In problem statement "For example, if K = 6, you cannot use (2, 1) tile as you can fill 4x4 square with it. (The king does not like smaller replica of his room with same size of tile)." - this line wants to say that 4 x 4 is a smaller possible square, but this is not smallest. The smallest possible square using (2, 1) is 2 x 2.nealzane wrote:right, i was aware of it. but for '9 1' i guess 9x9 is not the problem wants because '9 1' covers a length of the square.emotional blind wrote:Yes, it can cover, 9 x 9nealzane wrote:can '9 1' cover a square smaller than 18x18?
the problem says '2 1' is valid for 4x4. while if '9 1' is valid for 9x9, '2 1' cannot be valid for 4x4, since in that case, '2 1' is valid for 2x2 also which is smaller than 4x4.
i guess '9 1' cannot be used for 9x9, just as '2 1' cannot be used for 2x2.
-
- A great helper
- Posts: 383
- Joined: Mon Oct 18, 2004 8:25 am
- Location: Bangladesh
- Contact:
Re: 11773 - King's Wish
No, I think right answer is 4 30orfest wrote:Is 3 20 correct answer for test case 60?
Re: 11773 - King's Wish
i have not find any simple equation for this problem im getting tle. plz give me a hints. here is my code....
#include<iostream>
using namespace std;
int main()
{
long int n,flag,i,x,j,l,w;
scanf("%ld",&n);
for(i=1;i<=n;i++)
{
flag=0;
scanf("%ld",&x);
for(j=2;j*j<=x;j++)
{
if((x%j)==0)
{
w=j;
l=x/j;
if((l%w)!=0)
{
flag=1;
break;
}
}
}
if(flag==0)
printf("Case %ld: Impossible\n",i);
else
printf("Case %ld: %ld %ld\n",i,l,w);
}
return 0;
}
#include<iostream>
using namespace std;
int main()
{
long int n,flag,i,x,j,l,w;
scanf("%ld",&n);
for(i=1;i<=n;i++)
{
flag=0;
scanf("%ld",&x);
for(j=2;j*j<=x;j++)
{
if((x%j)==0)
{
w=j;
l=x/j;
if((l%w)!=0)
{
flag=1;
break;
}
}
}
if(flag==0)
printf("Case %ld: Impossible\n",i);
else
printf("Case %ld: %ld %ld\n",i,l,w);
}
return 0;
}
Re: 11773 - King's Wish
I think my algo is wrong .... 
nobody help me

nobody help me
