Perineal Noor💭

That night Mustafa goes to sleep and has a dream. When he wakes up he's not sure if the dream he had was divinely inspired or induced by the spicy jolof rice he had for iftar.
But he dreamt that a very blessed man would be sitting in the masjid that night for tarawih prayer. In his dream, he dreamt that he was floating above the rows of those standing in prayer. As he moves over the congregation, he sees that every person he floats over seems to glow.
He notices that some people glow brighter than others.
He realises that the man he is looking for, glows the brightest. Mustafa just couldnt see the man's face in the dream!

He wakes up puzzled by what this all meant and makes his way to the mosque to prayer fajr.
After salah, Mustafa sits to read a page of the Quran before leaving and sees one of the brothers in the mosque by the name of Richard is working on something he had been observing last night during tarawih prayers.

Tarawih prayers at The Bright Beacen Mosque are 8 rakah. These are prayed in pairs and spaced apart a few minutes before the next 2 begin. Richard being the data nerd that he is, has mapped out the mainhall of the mosque and taken tally of how many extra rakah of prayer members have prayed between the 2 rakah.
It looked a little like this:

2620224426
4220266086
4604484280
4X664024X2
4244064042
2620822264
4228284202
2X462888X0
2080446068
6602282402

This shows that there were 10 rows of 10 people. in between the 8 rakah of tarawih, the first person in the front row prayed an extra 2 rakah and the second person prayed 6 and so on.
Mustafa returns to reading the quran and falls asleep whilst doing so.

Once again he dreams. this time instead of floating above people, he floats above numbers. He sees that each number is illuminated by the numbers around it. The brightest number is the one with the sum of highest numbers around it plus its own number.

The rules

  • The example input above represents a 10 × 10 grid (your input will be bigger)
  • Each cell contains:
  • a digit (0–8), representing extra pairs of rakah prayed
  • or an X, representing a supporting column in the prayer hall (no value)
  • A cell’s perineal value is calculated as:
  • its own digit
  • plus the digits in all adjacent cells

What counts as adjacent?

  • Up
  • Down
  • Left
  • Right
  • Diagonals
    (Maximum of 8 surrounding cells)

Important constraints

  • Cells containing X:
  • have no value
  • do not contribute to neighbouring sums
  • Cells on edges or corners simply have fewer neighbours
  • Row and column indexes start from 0

so in second row and second number (2), the sorrounding numbers are 2,6,2,0,4,6,4 & 2.

x0 x1 x2
y0 2 6 2
y1 2 2 0
y2 4 6 4

The highlighted cell is located at y1x1.
Its illumination value (or perineal value) is calculated by adding:
- its own value: 2
- all surrounding cells: 2, 6, 2, 2, 0, 4, 6, 4

Total = 28

4 digits along, the number is 6. The sorrounding numbers are 2,2,4,6,4,8,4 & 2.
This equals 38.

The last number in the first row is a 6. This number is only sorrounded by digits to its left and the next row. No digits to its right. The numbers are: 2,8 & 6. The total is 22.

The main hall is suported using columns. These are represented by an X. These do not have a value.

Mustafa believes that the number with the highest illumination value is the position the man will be tonight!
Which row index and column index is the highest value?

If the highest digit was the 6 in row 2 that was demonstrated above, the answer would be y1x5.