Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package main
- import "fmt"
- func main() {
- var period, patients int
- fmt.Scanln(&period)
- var treated = 0
- var untreated = 0
- var doctors = 7
- for i := 1; i <= period; i++ {
- fmt.Scanln(&patients)
- if untreated > treated && i % 3 == 0 {
- doctors++
- }
- if patients > doctors {
- treated += doctors
- untreated += patients - doctors;
- } else {
- treated += patients
- }
- }
- fmt.Printf("Treated patients: %d.\n", treated)
- fmt.Printf("Untreated patients: %d.\n", untreated)
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement