1 solutions

  • 0
    @ 2023-12-20 20:37:44
    #include<iostream>
    #include <bits/stdc++.h>
    using namespace std;
    int main()
    {
    	int a[10];
    	for(int i = 1 ;i <= 5 ;i++){
    		cin >> a[i];
    	}
    	for(int i = 1; i<= 5 ;i++){
    		a[i] = a[i]/3;
    		if(i == 1){
    			a[5] += a[i];
    		}else{
    			a[i-1] += a[i];
    		}
    		if(i == 5){
    			a[1] += a[i];
    		}else{
    			a[i+1] += a[i];
    		}
    	}
    	for(int i = 1 ;i <= 5 ;i++){
    		cout << a[i] << " ";
    	}
    	return 0;
    }
    
    • 1

    Information

    ID
    366
    Time
    1000ms
    Memory
    16MiB
    Difficulty
    6
    Tags
    # Submissions
    17
    Accepted
    12
    Uploaded By