Skip to content

Instantly share code, notes, and snippets.

@b4284
Created November 16, 2015 12:21
Show Gist options
  • Select an option

  • Save b4284/2584f13f076bb21e150a to your computer and use it in GitHub Desktop.

Select an option

Save b4284/2584f13f076bb21e150a to your computer and use it in GitHub Desktop.
#include <stdio.h>
#include <stdlib.h>
static inline int calc(int q, int f) {
return (q * 244 + 1) / f;
}
int main(int c, char *v[]) {
int q = 0;
int f = atoi(v[1]);
for (int i = 0; i < 555; i++) {
q += calc(i, f);
}
printf("%d\n", q);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment