import java.io.PrintStream; public class ColourConvert { public static void main(String[] args) { PrintStream out = System.out; int r = Integer.parseInt(args[0]); int g = Integer.parseInt(args[1]); int b = Integer.parseInt(args[2]); double rnorm = (double) r / 255; double gnorm = (double) g / 255; double bnorm = (double) b / 255; // find the largest value of r, g, and b double w = Math.max(rnorm, gnorm); w = Math.max(w, bnorm); double c = (w - rnorm) / w; double m = (w - gnorm) / w; double y = (w - bnorm) / w; double k = 1 - w; out.println(c); out.println(m); out.println(y); out.println(k); } }