Please explain the Output

Revision en4, by Furcifer, 2016-10-26 19:56:24

I was trying to solve this problem uva 13136 Recurrences .

But, I couldn't manage to understand the output.

For example in test case 1, n = 1,A0 = 1,B0 = 2,C0 = 3. So, According to the relations given, I should get, S0 = 0
A1 = 4-6-9= -11
B1 = 5-8-12 = -15
C1 = 2-1 = 1 S1 = 0+(-11)*(-15)+1 = 166
so,ans should be 166%10 = 6. But the output is given 5.

Tags input-output, unable to understand, help needed

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en4 English Furcifer 2016-10-26 19:56:24 2 Tiny change: '1 = 4-6-9=11<br>\nB1' -> '1 = 4-6-9= -11<br>\nB1'
en3 English Furcifer 2016-10-26 10:26:17 16 Tiny change: ' = 166\nso,ans sho' -> ' = 166\n<br>so,ans sho'
en2 English Furcifer 2016-10-25 23:16:24 3 Tiny change: 'ccording the relat' -> 'ccording to the relat'
en1 English Furcifer 2016-10-25 23:15:36 496 Initial revision (published)