#include <stddef.h>
#include <stdio.h>

typedef struct {
    char r;
    char g;
    char b;
} Color;

char x;
char y;
char z;
int mag;
long long sum_ans;
#define LENGTH 1024
Color inputs[LENGTH];
int results[LENGTH];
long long total;

int magnitude() {
    mag = x*x+y*y+z*z;
}

long long sum() {
    sum_ans = 0;
    for (size_t i = 0; i < LENGTH; i++) {
        sum_ans += results[i];
    }
}

int main(void) {
    // ... input initialization ...
    for (size_t i = 0; i < LENGTH; i++) {
        inputs[i].r = (i * 3) % 255;
        inputs[i].g = (i * 5) % 255;
        inputs[i].b = (i * 7) % 255;
    }
    // ... resume calculation ...
    for (size_t i = 0; i < LENGTH; i++) {
        Color cc = inputs[i];
        x = cc.r;
        y = cc.g;
        z = cc.b;
        magnitude();
        results[i] = mag;
    }
    sum();
    printf("avrg: %ld\n", total / (long long) LENGTH);
}
