**Compilation/Execution Result:**

Given a binary tree, find the maximum path sum. The path may start and end at any node in the tree. Every node contains distinct data.

**Input:**

The first line of input contains an integer T denoting the number of test cases. Then T test cases follow. Each test case contains an integer n denoting the number of edges of the tree. The next line contains the edges of the binary tree.

**Output:**

Print the maximum path sum in the binary tree.

**Constraints:**

1<=T<=100

1<=n<=100

-100<=data of node<=100

**Example:
Input:**

2

6

10 2 L 2 20 L 2 1 R 10 -25 R -25 3 L -25 4 R

3

10 2 L 10 5 R 5 -2 R

**Output:**

32

17

Author: Ayush Govil 1

dauntless | 84 |

rksingh | 74 |

iharshitmittal | 74 |

sj5331 | 69 |

madhumitha d rao | 66 |

Shashank_Pathak | 636 |

dark_knights | 560 |

surbhi_7 | 556 |

SANJAY5797 | 359 |

rksingh | 358 |

akhayrutdinov | 4159 |

sanjay05 | 3611 |

Quandray | 2829 |

Ibrahim Nash | 2501 |

Michael Riegger | 2296 |