サンプル入力:
3 5 100 150 0
3 189 254 101 119
150 233 151 99 100
88 123 149 0 255
出力例:
003 189 254 000 000
000 233 151 099 000
088 000 000 000 255
import java.io.BufferedReader;
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int m = sc.nextInt();
int n = sc.nextInt();
int a = sc.nextInt();
int b = sc.nextInt();
int c = sc.nextInt();
while(m!=0){
boolean flag = true;
for(int i=0;i<n;i++){
int d = sc.nextInt();
if(d>=a && d<=b){
System.out.printf("%s%03d",flag==true?"":" ",c);
}
else System.out.printf("%s%03d",flag==true?"":" ",d);
if(i==n-1) System.out.printf("\n");
flag=false;
}
m--;
}
}}