x |
|||

a |
b |
||

p |
q |
r |

x = a + b

a = p + q

b = q + r

so, x = p + q + q + r

x = p + 2q + r

2q = x – (p + r)

q = (x – (p + r)) / 2

3 |
|||

a |
b |
||

2 |
x |
1 |

3 = a + b

a = 2 + x

b = x + 1

so, 3 = 2 + x + x + 1

3 = 2 + 2x + 1

2x = 3 – 3

therefore, x = 0

3 |
|||

a |
b |
||

2 |
0 |
1 |

a = 2 + 0 = 2

b = 0 + 1 = 1

3 |
|||

2 |
1 |
||

2 |
0 |
1 |

Similarly, thy to solve these block ..

1.

3 |
|||

a |
b |
||

1 |
x |
2 |

2.

5 |
|||

a |
b |
||

2 |
x |
1 |

3.

2 |
|||

a |
b |
||

1 |
x |
1 |

After solving these block, u will get all the values of ninth row. Then run a recursive process to find all upper cells value.

// to avoid ‘Presentation Error’:

do not print an extra space (‘ ‘) after each line of output