Your question is a little dicey.
In a 40 days cycle the ovulation will occur on day 26 of the cycle. So if you have sexual intercourse on day 22 to day 28 of the cycle then you are likely to be
pregnant.
If you have intercourse before day 22 of the cycle then you can't become pregnant.
And if you have intercourse on day 22 of the cycle and don't conceive then in any case you will get your periods on day 40 of the cycle (your pattern of periods) . That is 18 days after intercourse.
So a safe time to do the urine
pregnancy test is 21 days after the intercourse. If the urine test is negative 21 days after the single intercourse then you are not pregnant.