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

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

int main(void) {
    const size_t length = 1024;
    Color inputs[length];
    // ... 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 ...
    long long total = 0;
    for (size_t i = 0; i < length; i++) {
        Color cc = inputs[i];
        total += cc.r*cc.r + cc.g*cc.g + cc.b*cc.b;
    }
    printf("avrg: %ld\n", total / (long long) length);
}
