#CCBCHBAHAI0000125. Thay thế trong mảng I (Array Replacement I)
Thay thế trong mảng I (Array Replacement I)
Array Replacement I
Source: beecrowd
Version: Phuoc Hung OJ Extended
Problem Statement
You are given an integer array containing exactly elements indexed from through . For each element :
- if , replace it with ;
- if , keep it unchanged.
After all elements have been processed, print the complete array in the required format.
Input
The input contains exactly integers . Values may be positive, negative, or zero.
Output
Print exactly lines. For each from through , print X[i] = v, where is the value of after replacement.
Subtasks
Subtask 1 (100 points): every input value is in . This numeric bound is part of the Phuoc Hung OJ test configuration; the original replacement rule is unchanged.
Examples
Input
0
-5
63
0
8
-1
7
2
-3
10
Output
X[0] = 1
X[1] = 1
X[2] = 63
X[3] = 1
X[4] = 8
X[5] = 1
X[6] = 7
X[7] = 2
X[8] = 1
X[9] = 10
Explanation
Process the elements in index order. and are non-positive, so both become . is positive and remains unchanged. becomes . The same rule is applied to every remaining position, and each output line reports the transformed value at that index.