← Back to Problems

Sudoku Sum

Sudoku Sum

Solve each Sudoku puzzle in the input and report the sum of the 3-digit numbers formed by the top-left corner of each solution.

A valid Sudoku solution contains the digits 1–9 in each row, each column, and each 3×3 box, with no repeats. Every puzzle in the input has a unique solution.

Input

Line 1: an integer K — the number of puzzles. For each puzzle: 9 lines of 9 digits with no spaces, where 0 represents a blank cell. A blank line separates consecutive puzzles.

Output

A single integer: the sum across all K puzzles of solved[0][0]*100 + solved[0][1]*10 + solved[0][2].

Example

Input:

1
003020600
900305001
001806400
008102900
700000008
006708200
002609500
800203009
005010300

Output:

483

The solved puzzle has 4, 8, 3 as its top-left three digits.

Notes

  • A standard backtracking search starting from the first empty cell will solve typical puzzles.

Scoring

Your solution is evaluated against 10 test cases worth 10 points each (100 total).


LEADERBOARD

Rank Developer Score Submitted
1 🥇 mrsuyashkesharwani
100 / 100
May 22, 2026, 11:27 AM UTC
2 🥈 meetpatel-D3sTr0
100 / 100
May 22, 2026, 11:35 AM UTC
3 🥉 aniket-axy
100 / 100
May 22, 2026, 11:42 AM UTC
4 parth469
100 / 100
May 22, 2026, 11:46 AM UTC
5 shivam
100 / 100
May 22, 2026, 11:53 AM UTC
6 gAditya2208
100 / 100
May 22, 2026, 11:55 AM UTC
7 HetaDobariya
100 / 100
May 22, 2026, 11:56 AM UTC
8 harshwadhwani-10
100 / 100
May 22, 2026, 11:57 AM UTC
9 Abhishek0931
100 / 100
May 22, 2026, 12:02 PM UTC
10 Anujjj12
100 / 100
May 22, 2026, 12:21 PM UTC