#include<stdio.h> #define N 65536 int main() { int k; while(scanf("%d",&k)!=EOF) { int n=0; int i=0; while(n<k) { i++; if((i*21+2)%5==3) n++; } printf("%d\n",i*21+2); } return 0; }
Double click to view unformatted code.