Skip to content

Commit

Permalink
Problema: 1895
Browse files Browse the repository at this point in the history
  • Loading branch information
lrlucena committed Dec 20, 2024
1 parent 437d769 commit e3a507e
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions src/1800/1895.poti
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
a = leia_inteiros(" ")
var n, t := a[1] - 1, a[2]
l = a[3]
var pa, pb := 0

para i de 1 até n faça
temp = leia_inteiro
value = abs(t - temp)

se value <= l então
se i mod 2 == 0 então
pa := pa + value
senão
pb := pb + value
fim
t := temp
fim
fim

escreva "{pa} {pb}"

0 comments on commit e3a507e

Please sign in to comment.