This page is still under construction.

Parts of this page are still being built. What you see may change.

Scale

Time limit1sMemory limit1024 MB

Summary
For each line of space-separated integers, output a new list where every value is multiplied by its neighboring values.
Level

Easy2 of 10

Topics
Array, Implementation
Solved
No attempts yet

Problem

Write a program that takes in a list of integers and produces a new list of scaled integer values. The value of each will be the original value multiplied by its neighbors.

Input

There will be an unknown number of inputs, each on its own line. Each input will contain an unknown number of values separated by spaces.

Output

Display the result of each input on its own line, with each value separated by a single space.

Examples1

  1. Example 1

    Input
    1 1 1 1 1
    2 3 1 4 5 3
    7 4 18 5 2 6
    
    Expected output
    1 1 1 1 1
    6 6 12 20 60 15
    28 504 360 180 60 12