#CCBCHBAHAI0000053. Trace mảng tích lũy lồng nhau (Trace a Nested Accumulation Array)
Trace mảng tích lũy lồng nhau (Trace a Nested Accumulation Array)
Trace a Nested Accumulation Array (Trace mảng tích lũy lồng nhau)
Source: Programming in C
Version: Phuoc Hung OJ Extended
Problem
Given integers and , consider an array of length , indexed from to . Initially,
Then execute the following nested accumulation exactly: for , and for every with in increasing order, perform
When is processed, already contain their updated values. Hence, for ,
Print the final array .
Input
One line contains integers and .
Output
Print on one line.
Subtask
Subtask 1 (20 points): , .
Subtask 2 (30 points): , .
Subtask 3 (50 points): , .
Example
Input
10 1
Output
1 1 2 4 8 16 32 64 128 256
Explanation
The sample follows the definitions and rules above.