Module Module1
Structure Man
Dim FN, LN As String
Dim Sum As UInteger
Dim Rang As Byte
End Structure
Sub Main()
Dim m As Integer = Console.ReadLine()
Dim n As Integer = Console.ReadLine()
Dim i, k As Integer
Dim buf, buf2(0) As String
Dim a(m - 1) As Man
Dim u As Man
For i = 0 To m - 1
a(i) = New Man()
buf = Console.ReadLine()
buf2 = buf.Split(" ")
a(i).FN = buf2(1)
a(i).LN = buf2(0)
For j As Integer = 2 To buf2.Length - 1
k += Byte.Parse(buf2(j))
Next
a(i).Sum = k
k = 0
Next
For i = 0 To a.Length - 1
For j = 0 To a.Length - 2
If (a(j).Sum <= a(j + 1).Sum) Then<br> u = a(j)
a(j) = a(j + 1)
a(j + 1) = u
End If
Next
Next
a(0).Rang = 1
For i = 0 To a.Length - 2
If (a(i).Sum > a(i + 1).Sum) Then
a(i + 1).Rang = a(i).Rang + 1
Else
a(i + 1).Rang = a(i).Rang
End If
Next
For Each b As Man In a
Console.Write(String.Join(" ", {b.LN, b.FN, b.Sum, b.Rang}) & System.Environment.NewLine)
Next
Console.ReadKey(False)
End Sub
End Module