Download as doc, pdf, or txt
Download as doc, pdf, or txt
You are on page 1of 4

CAT 1 – E2 – Slot Key

1. When V = {0,1}, 4-path does not exist between p and q because it is impossible to get from p to q
by traveling along points that are both 4-adjacent and also have values from V. Fig. a shows this
condition; it is not possible to get to q. The shortest 8-path is shown in Fig. b its length is 4. The
length of the shortest m- path (shown dashed) is 5. Both of these shortest paths are unique in
this case.

2. Answer

3. RGB to CMYK conversion formula


The R,G,B values are divided by 255 to change the range from 0..255 to 0..1:
R' = R/255
G' = G/255
B' = B/255
The black key (K) color is calculated from the red (R'), green (G') and blue (B') colors:
K = 1-max(R', G', B')
The cyan color (C) is calculated from the red (R') and black (K) colors:
C = (1-R'-K) / (1-K)
The magenta color (M) is calculated from the green (G') and black (K) colors:
M = (1-G'-K) / (1-K)
The yellow color (Y) is calculated from the blue (B') and black (K) colors:
Y = (1-B'-K) / (1-K)

CMYK to RGB conversion formula


The R,G,B values are given in the range of 0..255.
The red (R) color is calculated from the cyan (C) and black (K) colors:
R = 255 × (1-C) × (1-K)
The green color (G) is calculated from the magenta (M) and black (K) colors:
G = 255 × (1-M) × (1-K)
The blue color (B) is calculated from the yellow (Y) and black (K) colors:
B = 255 × (1-Y) × (1-K)

4: Output is:
By Zero Padding

0 123 125 126 0


120 124 126 130 127
118 120 124 127 125
115 118 120 125 123
0 111 115 119 0

(Or)
By Replicating
5

You might also like