Вывод последней строки

Вам нужно вывести последнюю строку файла.

Входные данные программы содержат одну строку — имя файла.

Выходные данные программы должны содержать одну строку — последнюю строку файла. Гарантируется, что файл содержит как минимум одну строку.

Вход

input.txt

Выход

input.txt

hello this is some file content

some file content

Вход

single.txt

Выход

single.txt

this file has only 1 line

this file has only 1 line

Вход

many.txt

Выход

many.txt

this file has … many many lines

many lines

Constraints

Time limit: 2 seconds

Memory limit: 512 MB

Output limit: 1 MB

To check your solution you need to sign in
Sign in to continue