### Saratov State University :: Online Contester

::Go
- home
- news
- register
 - update personal info
 - problemset archive
- submit
- status online
- standing
- contests
- virtual contests
- forum
- statistic
- FAQ
- projects

 ::Poll Are you registered on Codeforces?YesNoWhat is it???[results]

::webboard

 who can help me ? i am getting WA in test four?
Author: zyt
ID: 045102
Problem: 302
Contest: 0
Date: 2011-07-30 17:04:46

#include <stdio.h>
#include <iostream>
#include <string.h>
#include <string>
#include <math.h>
#include <stdlib.h>
#include <algorithm>
#include <map>
#include <set>
#include <queue>
#include <vector>
using namespace std;

#define MAXN 1000005

int cont[MAXN];//cont[i]&#34920;&#31034;i&#26159;&#19981;&#21516;&#32032;&#22240;&#23376;&#20010;&#25968;
bool hash[MAXN];

void init(){
memset(cont, 0, sizeof(cont));
memset(hash, true, sizeof(hash));

for (int i = 2; i < MAXN; i++){
if (hash[i]){
for (int j = 1; j * i < MAXN; j++){
cont[i*j]++;
hash[i*j] = false;
}
}
}
}

int min(int a, int b){
return a > b ? b : a;
}

int main(){
int n, m;
init();
scanf("%d%d", &n, &m);

if (m == 1 && n == 1)
printf("0n");
else if (m == 1 || n == 1)
printf("1n");

else{
long long ans = 0;
for (int i = 1; i < min(n,m); i++){

if (cont[i]&1) {
ans -= ((n-1)/i)*((m-1)/i);
}
else {
ans += ((n-1)/i)*((m-1)/i);
}
}
printf("%lldn", ans+2);
}

return 0;
}

who can give me some test cases ? or sent your solution to kingszyt@gmail.com to test my program with.