i tried explaing here the tricky test cases
(but went really fast)
i tried explaing here the tricky test cases
(but went really fast)
try this 3 3 8 10
some base conditions are required , like when x is greater than y then substitute y at every alternate places
see [CodeChef: Practical coding for everyone](http://My Soln) , covers all cases
Consider test case : 1 1 11 7
For this case, there are no adjacent cells in the 1x1 matrix. So, the cell can hold the value of x even if it exceeds ‘y’. This is the only corner case due to which many must have got WA.
for 1X1 matrix output will be max value of X as there is no adjacent cell
lets say u take 3 3 8 10.
so, max u should get is: 4 X 2 + 5 X 8
i.e 48
This solution is giving WA. Am I missing any corner case?
FYI, I considered the corner case of 1x1 matrix.
https://www.codechef.com/viewsolution/36019255
sorry its giving correct for your solution, I was at mistake.
Yeah, I have missed the case for n=1 and m=1
Because it is only 1 element … since there are no adjacent to this… we need to print maximum X value …(our goal in problem was to find max. elements that can be filled)
I think it must be 45. If not, please explain.
This submission gets ac : CodeChef: Practical coding for everyone
But This doesnt get ac: CodeChef: Practical coding for everyone
The question clearly says sum cant be greater than y, Then how is the second one not ac
The minimum of x and y should have gotten ac, if(x>y) then answer is y or else x, But Second link gives WA
it should be like this for 3 3 8 10
8 2 8
2 8 2
8 2 8
total is 48
try the previous testcases everyone mentioned, like 3 3 8 10
I know
Just try the testcases from above, 3 3 8 10
gives WA for 1 1 4 1
U r getting WA because
at m=1,n=1,x=7,y=5
you have to print 7 & not 5.
this is the fault of problem setter. He must explain the question properly