summaryrefslogblamecommitdiffstats
path: root/šola/p1/vaje/2023-10-19/Roman.java
blob: d44f633dc603c850bf0cf37a94a8a6ea77ca5005 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15














                                                                                            
import java.util.*;
public class Roman {
	public static void main (String[] args) {
		Scanner sc = new Scanner(System.in);
		int p = sc.nextInt();
		int d = sc.nextInt();
		int z = sc.nextInt();
		int dan = 0;
		while (p > 0 && d > 0) {
			System.out.println(++dan + ": " + p + " -> " + (p-d > 0 ? p-d : 0));
			p -= d;
			d -= z;
		}
	}
}