here is problem link :
First, if this problem is really of interest to you, it would have looked better, and perhaps encouraged more people to respond, if you had taken the trouble to type the problem in rather than just copying it to a file and requiring others to open the file. That's always a nuisance and always has the possiblity of opening a virus.
You are told that, on a certain island, everyone either always tells the truth or always lies. Also you are told that if you ask people at the university on this island, they will always tell you the following two things, no matter which employee you ask:
1. There are fewer than N employees who work more than me.
2. At least M employees of the university have a larger salary than me
You are asked to write a computer program that given the two values, N and M, will return the number of employees at the University.
They they give the example of N and M both equaling 1 in which case, we are told, the program should return "2".
That is, any employee at the University must respond either:
1. There is less than 1 employee who works more than me. (I.e. there are NO employees who work more than me.)
2. At least 1 employee of the university has a larger salary than me
But remember that some employees always tell the truth and some always lie.
So you would have to consider a number of possiblities. It is possible that all those who tell the truth will answer (1) and all those who lie will answer (2). Or the other way around. But you should also consider the possibility that some people who tell always tell the truth could answer (1) and some who always lie could answer (1). What would that mean?