Naloga

Imamo besedilo, zapisano tako, da so vsi znaki (tudi presledki, ločila ipd.) enako široki. Besedilo je raztegnjeno čez več vrstic.

Včasih se zgodi, da se presledki v več zaporednih vrsticah neugodno poravnajo in tvorijo »reko« presledkov (river); če stran besedila pogledamo od daleč, je takšna reka videti kot moteča bela lisa. Za potrebe naše naloge bomo reko definirali kot zaporedje presledkov, za katere velja, da je vsak presledek v naslednji vrstici kot prejšnji in leži bodisi tik pod prejšnjim
ali pa največ eno mesto levo ali desno od njega.



Napiši program, ki prebere besedilo s standardnega vhoda in izpiše dolžino najdaljše reke presledkov v njem. Besedilo naj bere vse do konca (EOF). Posamezna vrstica besedila je dolga največ 100 znakov. (Prazen prostor desno od konca posamezne vrstice ne šteje za presledke in zato ne more postati del reke.)


Primer: v spodnjem besedilu se najdaljša reka razteza prek 10 vrstic (od pete do štirinajste vrstice).

Two fierce and enormous bears, distinguished
by the appellations of Innocence and Mica
Aurea, could alone deserve to share the
favour of Maximin. The cages of those trusty
guards were always placed near the
bed-chamber of Valentinian, who frequently
amused his eyes with the grateful spectacle
of seeing them tear and devour the bleeding
limbs of the malefactors who were abandoned
to their rage. Their diet and exercises were
carefully inspected by the Roman emperor;
and, when Innocence had earned her discharge
by a long course of meritorious service, the
faithful animal was again restored to
the freedom of her native woods.