Skip to content

Instantly share code, notes, and snippets.

@dazza
Created August 7, 2009 04:26
Show Gist options
  • Save dazza/163706 to your computer and use it in GitHub Desktop.
Save dazza/163706 to your computer and use it in GitHub Desktop.
#include <iostream>
using namespace std;
int n;
int fn(int n);
int main()
{
cin>>n;
while (!cin.eof())
{
int ret =fn(n);
cout<<ret<<endl;
cin>>n;
}
return 0;
}
int fn(int n)
{
int counter = 1;
while (counter!=0)
{
if (n>=50025002)
{
n -= 5;
}
else
{
counter+=2;
n+=2005;
}
counter--;
}
return n;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment