Option Strict On
Imports System.IO
Module Module1

    Sub Main()
        Dim reader As StreamReader = New StreamReader("Input_data.txt")
        Dim N As Integer = Integer.Parse(reader.ReadLine())
        Dim T(N - 1), Cp(N - 1) As Double
        For i As Integer = 0 To N - 1
            Dim line As String = reader.ReadLine()
            T(i) = Double.Parse(line.Substring(0, line.IndexOf(";")))
            Cp(i) = Double.Parse(line.Substring(line.IndexOf(";") + 1))
        Next i
        Dim sum(4) As Double
        sum(0) = 1
        For i As Integer = 0 To N - 1
            sum(1) += Cp(i) * T(i) * 0.001
            sum(2) += Cp(i) * (T(i) * 0.001) ^ 2
            sum(3) += Cp(i) * (T(i) * 0.001) ^ 3
            sum(4) += Cp(i) * (T(i) * 0.001) ^ -2
        Next i
        Dim M As jama.matrix = New jama.matrix(sum)

    End Sub

End Module
