Codeforces Round #412 (rated, Div. 2, base on VK Cup 2017 Round 3), problem: (B) T-Shirt Hunt Solution In C/C++

By |2017-07-24T02:31:32+06:00July 24th, 2017|Categories: C/C++, Programming|Tags: , , , , , , , , , |

#include <bits/stdc++.h> using namespace std; int p,x,y,i; int luc(int s){ s = (s/50)%475; for (int i=0;i<25;i++) if((s=(s*96+42)%475)+26==p)return 1; return 0; } int main(){ cin>>p>>x>>y; for(i=x%50;!luc(i)||i<y;i+=50){} return cout<<(i<=x?0:(i-x+99)/100),0; }